@@ -253,7 +254,7 @@ $(this).html(''); });titletitletitletitletitle ``` -接下来,定义表模型。 这是提供所有表选项的地方,包括界面的滚动,而不是分页,根据 dom 字符串提供的装饰,将数据导出为 CSV 和其他格式的能力,以及建立与服务器的 Ajax 连接。 请注意,使用 Groovy GString 调用 Grails **createLink()** 的方法创建 URL,在 **EmployeeController** 中指向 **browserLister** 操作。同样有趣的是表格列的定义。此信息将发送到后端,后端查询数据库并返回相应的记录。 +接下来,定义表模型。这是提供所有表选项的地方,包括界面的滚动,而不是分页,根据 DOM 字符串提供的装饰,将数据导出为 CSV 和其他格式的能力,以及建立与服务器的 AJAX 连接。 请注意,使用 Groovy GString 调用 Grails `createLink()` 的方法创建 URL,在 `EmployeeController` 中指向 `browserLister` 操作。同样有趣的是表格列的定义。此信息将发送到后端,后端查询数据库并返回相应的记录。 ``` var table = $('#employee_dt').DataTable( { @@ -302,7 +303,7 @@ that.search(this.value).draw(); ![](https://opensource.com/sites/default/files/uploads/screen_4.png) -这是另一个屏幕截图,显示了过滤和多列排序(寻找 position 包括字符 “dev” 的员工,先按 office 排序,然后按姓氏排序): +这是另一个屏幕截图,显示了过滤和多列排序(寻找 “position” 包括字符 “dev” 的员工,先按 “office” 排序,然后按姓氏排序): ![](https://opensource.com/sites/default/files/uploads/screen_5.png) @@ -314,37 +315,37 @@ that.search(this.value).draw(); ![](https://opensource.com/sites/default/files/uploads/screen7.png) -好的,视图部分看起来非常简单; 因此,控制器必须做所有繁重的工作,对吧? 让我们来看看… +好的,视图部分看起来非常简单;因此,控制器必须做所有繁重的工作,对吧? 让我们来看看…… #### 控制器 browserLister 操作 -回想一下,我们看到过这个字符串 +回想一下,我们看到过这个字符串: ``` "${createLink(controller: 'employee', action: 'browserLister')}" ``` -对于从 DataTables 模型中调用 Ajax 的 URL,是在 Grails 服务器上动态创建 HTML 链接,其 Grails 标记背后通过调用 [createLink()][17] 的方法实现的。这会最终产生一个指向 **EmployeeController** 的链接,位于: +对于从 DataTables 模型中调用 AJAX 的 URL,是在 Grails 服务器上动态创建 HTML 链接,其 Grails 标记背后通过调用 [createLink()][17] 的方法实现的。这会最终产生一个指向 `EmployeeController` 的链接,位于: ``` embrow/grails-app/controllers/com/nuevaconsulting/embrow/EmployeeController.groovy ``` -特别是控制器方法 **browserLister()**。我在代码中留了一些 print 语句,以便在运行时能够在终端看到中间结果。 +特别是控制器方法 `browserLister()`。我在代码中留了一些 `print` 语句,以便在运行时能够在终端看到中间结果。 ```     def browserLister() {         // Applies filters and sorting to return a list of desired employees ``` -首先,打印出传递给 **browserLister()** 的参数。我通常使用此代码开始构建控制器方法,以便我完全清楚我的控制器正在接收什么。 +首先,打印出传递给 `browserLister()` 的参数。我通常使用此代码开始构建控制器方法,以便我完全清楚我的控制器正在接收什么。 ```       println "employee browserLister params $params"         println() ``` -接下来,处理这些参数以使它们更加有用。首先,jQuery DataTables 参数,一个名为 **jqdtParams**的 Groovy 映射: +接下来,处理这些参数以使它们更加有用。首先,jQuery DataTables 参数,一个名为 `jqdtParams` 的 Groovy 映射: ``` def jqdtParams = [:] @@ -363,7 +364,7 @@ println "employee dataTableParams $jqdtParams" println() ``` -接下来,列数据,一个名为 **columnMap**的 Groovy 映射: +接下来,列数据,一个名为 `columnMap` 的 Groovy 映射: ``` def columnMap = jqdtParams.columns.collectEntries { k, v -> @@ -386,7 +387,7 @@ println "employee columnMap $columnMap" println() ``` -接下来,从 **columnMap** 中检索的所有列表,以及在视图中应如何排序这些列表,Groovy 列表分别称为 **allColumnList**和 **orderList**: +接下来,从 `columnMap` 中检索的所有列表,以及在视图中应如何排序这些列表,Groovy 列表分别称为 `allColumnList` 和 `orderList` : ``` def allColumnList = columnMap.keySet() as List @@ -395,7 +396,7 @@ def orderList = jqdtParams.order.collect { k, v -> [allColumnList[v.column as In println "employee orderList $orderList" ``` -我们将使用 Grails 的 Hibernate 标准实现来实际选择要显示的元素以及它们的排序和分页。标准要求过滤器关闭; 在大多数示例中,这是作为标准实例本身的创建的一部分给出的,但是在这里我们预先定义过滤器闭包。请注意,在这种情况下,“date hired” 过滤器的相对复杂的解释被视为一年并应用于建立日期范围,并使用 **createAlias** 以允许我们进入相关类别 Position 和 Office: +我们将使用 Grails 的 Hibernate 标准实现来实际选择要显示的元素以及它们的排序和分页。标准要求过滤器关闭;在大多数示例中,这是作为标准实例本身的创建的一部分给出的,但是在这里我们预先定义过滤器闭包。请注意,在这种情况下,“date hired” 过滤器的相对复杂的解释被视为一年并应用于建立日期范围,并使用 `createAlias` 以允许我们进入相关类别 `Position` 和 `Office`: ``` def filterer = { @@ -424,14 +425,14 @@ def filterer = { } ``` -是时候应用上述内容了。第一步是获取分页代码所需的所有 Employee 实例的总数: +是时候应用上述内容了。第一步是获取分页代码所需的所有 `Employee` 实例的总数: ```         def recordsTotal = Employee.count()         println "employee recordsTotal $recordsTotal" ``` -接下来,将过滤器应用于 Employee 实例以获取过滤结果的计数,该结果将始终小于或等于总数(同样,这是针对分页代码): +接下来,将过滤器应用于 `Employee` 实例以获取过滤结果的计数,该结果将始终小于或等于总数(同样,这是针对分页代码): ```         def c = Employee.createCriteria() @@ -467,7 +468,7 @@ def filterer = { 要完全清楚,JTable 中的分页代码管理三个计数:数据集中的记录总数,应用过滤器后得到的数字,以及要在页面上显示的数字(显示是滚动还是分页)。 排序应用于所有过滤的记录,并且分页应用于那些过滤的记录的块以用于显示目的。 -接下来,处理命令返回的结果,在每行中创建指向 Employee,Position 和 Office 实例的链接,以便用户可以单击这些链接以获取相关实例的所有详细信息: +接下来,处理命令返回的结果,在每行中创建指向 `Employee`、`Position` 和 `Office` 实例的链接,以便用户可以单击这些链接以获取相关实例的所有详细信息: ```         def dollarFormatter = new DecimalFormat('$##,###.##') @@ -490,14 +491,15 @@ def filterer = { } ``` -大功告成 +大功告成。 + 如果你熟悉 Grails,这可能看起来比你原先想象的要多,但这里没有火箭式的一步到位方法,只是很多分散的操作步骤。但是,如果你没有太多接触 Grails(或 Groovy),那么需要了解很多新东西 - 闭包,代理和构建器等等。 在那种情况下,从哪里开始? 最好的地方是了解 Groovy 本身,尤其是 [Groovy closures][18] 和 [Groovy delegates and builders][19]。然后再去阅读上面关于 Grails 和 Hibernate 条件查询的建议阅读文章。 ### 结语 -jQuery DataTables 为 Grails 制作了很棒的表格数据浏览器。对视图进行编码并不是太棘手,但DataTables 文档中提供的 PHP 示例提供的功能仅到此位置。特别是,它们不是用 Grails 程序员编写的,也不包含探索使用引用其他类(实质上是查找表)的元素的更精细的细节。 +jQuery DataTables 为 Grails 制作了很棒的表格数据浏览器。对视图进行编码并不是太棘手,但 DataTables 文档中提供的 PHP 示例提供的功能仅到此位置。特别是,它们不是用 Grails 程序员编写的,也不包含探索使用引用其他类(实质上是查找表)的元素的更精细的细节。 我使用这种方法制作了几个数据浏览器,允许用户选择要查看和累积记录计数的列,或者只是浏览数据。即使在相对适度的 VPS 上的百万行表中,性能也很好。 @@ -512,7 +514,7 @@ via: https://opensource.com/article/18/9/using-grails-jquery-and-datatables 作者:[Chris Hermansen][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[jrg](https://github.com/jrglinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -528,11 +530,11 @@ via: https://opensource.com/article/18/9/using-grails-jquery-and-datatables [9]: http://sdkman.io/ [10]: http://guides.grails.org/creating-your-first-grails-app/guide/index.html [11]: https://opensource.com/file/410061 -[12]: https://opensource.com/sites/default/files/uploads/screen_1.png "Embrow home screen" +[12]: https://opensource.com/sites/default/files/uploads/screen_1.png [13]: https://opensource.com/file/410066 -[14]: https://opensource.com/sites/default/files/uploads/screen_2.png "Office list screenshot" +[14]: https://opensource.com/sites/default/files/uploads/screen_2.png [15]: https://opensource.com/file/410071 -[16]: https://opensource.com/sites/default/files/uploads/screen3.png "Employee controller screenshot" +[16]: https://opensource.com/sites/default/files/uploads/screen3.png [17]: https://gsp.grails.org/latest/ref/Tags/createLink.html [18]: http://groovy-lang.org/closures.html [19]: http://groovy-lang.org/dsls.html From a7e9f8c3a2886149ae4074ab4ec7c7a529366850 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 24 Nov 2018 10:25:51 +0800 Subject: [PATCH 0423/1143] PUB:20180928 Using Grails with jQuery and DataTables.md @jrglinux https://linux.cn/article-10268-1.html --- .../20180928 Using Grails with jQuery and DataTables.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180928 Using Grails with jQuery and DataTables.md (100%) diff --git a/translated/tech/20180928 Using Grails with jQuery and DataTables.md b/published/20180928 Using Grails with jQuery and DataTables.md similarity index 100% rename from translated/tech/20180928 Using Grails with jQuery and DataTables.md rename to published/20180928 Using Grails with jQuery and DataTables.md From cef7e6ff5ab236aa1c1af6def0d434574123361c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 24 Nov 2018 10:52:27 +0800 Subject: [PATCH 0424/1143] PRF:20180409 How to create LaTeX documents with Emacs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @oneforalone 恭喜你,完成了第一篇翻译! --- ...ow to create LaTeX documents with Emacs.md | 179 ++++++------------ 1 file changed, 56 insertions(+), 123 deletions(-) diff --git a/translated/tech/20180409 How to create LaTeX documents with Emacs.md b/translated/tech/20180409 How to create LaTeX documents with Emacs.md index a202d90d10..e2c92583cf 100644 --- a/translated/tech/20180409 How to create LaTeX documents with Emacs.md +++ b/translated/tech/20180409 How to create LaTeX documents with Emacs.md @@ -1,256 +1,189 @@ 如何使用 Emacs 创建 LaTeX 文档 ====== +> 这篇教程将带你遍历在 Emacs 使用强大的开源排版系统 LaTex 来创建文档的全过程。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ) -一篇由 Aaron Cocker 写的很棒的文章 [An introduction to creating documents in LaTeX][1] 中,介绍了 LaTeX 排版系统 [LaTeX typesetting system][3] 并描述了如何使用 [TeXstudio][4] 来创建 LaTeX 文档。同时,他也列举了一些很多用户觉得创建 LaTeX 文档很方便的编辑器。 +一篇由 Aaron Cocker 写的很棒的文章 “[在 LaTeX 中创建文件的介绍][1]” 中,介绍了 [LaTeX 排版系统][3] 并描述了如何使用 [TeXstudio][4] 来创建 LaTeX 文档。同时,他也列举了一些很多用户觉得创建 LaTeX 文档很方便的编辑器。 -[Greg Pittman][5] 对这篇文章的评论吸引了我:“当你第一次开始使用 LaTeX 时,他似乎是个和差劲的排版。。。” 事实也确实如此。LaTeX 包含了多种排版字体和调试,如果你漏了一个特殊的字符比如说感叹号,这会阻碍很多用户,尤其是新手。在本文中,我将介绍如何使用 [GNU Emacs][6] 来创建 LaTeX 文档。 +[Greg Pittman][5] 对这篇文章的评论吸引了我:“当你第一次开始使用 LaTeX 时,他似乎是个和差劲的排版……” 事实也确实如此。LaTeX 包含了多种排版字体和调试,如果你漏了一个特殊的字符比如说感叹号,这会让很多用户感到沮丧,尤其是新手。在本文中,我将介绍如何使用 [GNU Emacs][6] 来创建 LaTeX 文档。 ### 创建你的第一个文档 -启动 Emacs: + +启动 Emacs: + ``` emacs -q --no-splash helloworld.org ``` -参数 `-q` 确保 Emacs 不会加载其他的初始化配置。参数 `--no-splash-screen` 防止 emacs 打开多个窗口,确保只打开一个窗口,最后的参数 `helloworld.org` 表示你要创建的文件名为 `helloworld.org` 。 + +参数 `-q` 确保 Emacs 不会加载其他的初始化配置。参数 `--no-splash-screen` 防止 Emacs 打开多个窗口,确保只打开一个窗口,最后的参数 `helloworld.org` 表示你要创建的文件名为 `helloworld.org` 。 ![Emacs startup screen][8] -GNU Emacs 打开文件名为 helloworld.org 的窗口时的样子。 +*GNU Emacs 打开文件名为 helloworld.org 的窗口时的样子。* -现在让我们用 Emacs 添加一些 LaTeX 的标题吧: 在菜单栏找到 **Org** 选项并选择 **Export/Publish**. +现在让我们用 Emacs 添加一些 LaTeX 的标题吧:在菜单栏找到 “Org” 选项并选择 “Export/Publish”。 ![template_flow.png][10] -导入一个默认的模板: +*导入一个默认的模板* -在下一个窗口中,Emacs 同时提供了导入和导出一个模板。使用 #([#] Insert template)来导入一个模板。这将会是光标跳转到一个带有 **Options category:** 提示的 mini-buffer 中。第一次你可能不知道这个类型的名字,但是你可以使用 Tab 键来查看所有的补全。输入 “default” 然后按回车,之后你就能看到如下的内容被插入了: +在下一个窗口中,Emacs 同时提供了导入和导出一个模板。输入 `#`(“[#] Insert template”)来导入一个模板。这将会使光标跳转到一个带有 “Options category:” 提示的 mini-buffer 中。第一次你可能不知道这个类型的名字,但是你可以使用 `Tab` 键来查看所有的补全。输入 “default” 然后按回车,之后你就能看到如下的内容被插入了: ``` #+TITLE: helloworld - #+DATE: <2018-03-12 Mon> - #+AUTHOR: - #+EMAIL: makerpm@nubia - #+OPTIONS: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline - #+OPTIONS: author:t c:nil creator:comment d:(not "LOGBOOK") date:t - #+OPTIONS: e:t email:nil f:t inline:t num:t p:nil pri:nil stat:t - #+OPTIONS: tags:t tasks:t tex:t timestamp:t toc:t todo:t |:t - #+CREATOR: Emacs 25.3.1 (Org mode 8.2.10) - #+DESCRIPTION: - #+EXCLUDE_TAGS: noexport - #+KEYWORDS: - #+LANGUAGE: en - #+SELECT_TAGS: export - ``` -根据自己的需求修改标题,日期,作者和 email。我自己的话是下面这样的: +根据自己的需求修改标题、日期、作者和 email。我自己的话是下面这样的: + ``` #+TITLE: Hello World! My first LaTeX document - #+DATE: \today - #+AUTHOR: Sachin Patil - #+EMAIL: psachin@redhat.com - ``` 我们目前还不想创建一个目录,所以要将 `toc` 的值由 `t` 改为 `nil`,具体如下: + ``` #+OPTIONS: tags:t tasks:t tex:t timestamp:t toc:nil todo:t |:t - ``` -现在让我们添加一个章节和段落吧。章节是由一个星号(*)开头。我们从 Aaron 的贴子([Lipsum Lorem Ipsum generator][11])复制一些文本过来: +现在让我们添加一个章节和段落吧。章节是由一个星号(`*`)开头。我们从 Aaron 的贴子(来自 [Lipsum Lorem Ipsum 生成器][11])复制一些文本过来: ``` * Introduction + \paragraph{} + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras lorem + nisi, tincidunt tempus sem nec, elementum feugiat ipsum. Nulla in + diam libero. Nunc tristique ex a nibh egestas sollicitudin. - -  \paragraph{} - -  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras lorem - -  nisi, tincidunt tempus sem nec, elementum feugiat ipsum. Nulla in - -  diam libero. Nunc tristique ex a nibh egestas sollicitudin. - - - -  \paragraph{} - -  Mauris efficitur vitae ex id egestas. Vestibulum ligula felis, - -  pulvinar a posuere id, luctus vitae leo. Sed ac imperdiet orci, non - -  elementum leo. Nullam molestie congue placerat. Phasellus tempor et - -  libero maximus commodo. - + \paragraph{} + Mauris efficitur vitae ex id egestas. Vestibulum ligula felis, + pulvinar a posuere id, luctus vitae leo. Sed ac imperdiet orci, non + elementum leo. Nullam molestie congue placerat. Phasellus tempor et + libero maximus commodo. ``` ![helloworld_file.png][13] -helloworld.org 文件 +*helloworld.org 文件* -将内容修改好后,我们要把它导出为 PDF 格式。再次在 **Org** 的菜单选项中选择 **Export/Publish**,但是这次,要输入 **l**(export to LaTeX),紧跟着输入 **o**(as PDF file and open)。这次操作不止会打开 PDF 文件让你浏览,同时也会将文件保存为 `helloworld.pdf`,并保存在与 `helloworld.org` 的同一个目录下。 +将内容修改好后,我们要把它导出为 PDF 格式。再次在 “Org” 的菜单选项中选择 “Export/Publish”,但是这次,要输入 `l`(“export to LaTeX”),紧跟着输入 `o`(“as PDF file and open”)。这次操作不止会打开 PDF 文件让你浏览,同时也会将文件保存为 `helloworld.pdf`,并保存在与 `helloworld.org` 的同一个目录下。 ![org_to_pdf.png][15] -将 helloworld.org 导出为 helloworld.pdf +*将 helloworld.org 导出为 helloworld.pdf* ![org_and_pdf_file.png][17] -打开 helloworld.pdf 文件 +*打开 helloworld.pdf 文件* -你也可以按下 `Alt + x` 键,然后输入 “org-latex-export-to-pdf” 来将 org 文件导出为 PDF 文件。可以使用 Tab 键来自动补全命令。 +你也可以按下 `Alt + x` 键,然后输入 `org-latex-export-to-pdf` 来将 org 文件导出为 PDF 文件。可以使用 `Tab` 键来自动补全命令。 Emacs 也会创建 `helloworld.tex` 文件来让你控制具体的内容。 ![org_tex_pdf.png][19] -Emacs 在三个不同的窗口中分别打开 LaTeX,org 和 PDF 文档。 +*Emacs 在三个不同的窗口中分别打开 LaTeX,org 和 PDF 文档。* 你可以使用命令来将 `.tex` 文件转换为 `.pdf` 文件: + ``` pdflatex helloworld.tex - ``` -你也可以将 `.org` 文件输出问HTML或是一个简单的文本格式的文件。我最喜欢 .org 文件的原因是他们可以被 push 到 [GitHub][20] 上,然后被渲染的同 markdown 的一样的格式。 +你也可以将 `.org` 文件输出为 HTML 或是一个简单的文本格式的文件。我最喜欢 `.org` 文件的原因是他们可以被推送到 [GitHub][20] 上,然后同 markdown 一样被渲染。 -### 创建一个 LaTeX 的 Beamer presentation +### 创建一个 LaTeX 的 Beamer 简报 + +现在让我们更进一步,通过少量的修改上面的文档来创建一个 LaTeX [Beamer][21] 简报,如下所示: -现在让我们更进一步,通过少量的修改上面的文档来创建一个 LaTeX [Beamer][21]的 presentation,如下所示: ``` #+TITLE: LaTeX Beamer presentation - #+DATE: \today - #+AUTHOR: Sachin Patil - #+EMAIL: psachin@redhat.com - #+OPTIONS: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline - #+OPTIONS: author:t c:nil creator:comment d:(not "LOGBOOK") date:t - #+OPTIONS: e:t email:nil f:t inline:t num:t p:nil pri:nil stat:t - #+OPTIONS: tags:t tasks:t tex:t timestamp:t toc:nil todo:t |:t - #+CREATOR: Emacs 25.3.1 (Org mode 8.2.10) - #+DESCRIPTION: - #+EXCLUDE_TAGS: noexport - #+KEYWORDS: - #+LANGUAGE: en - #+SELECT_TAGS: export - #+LATEX_CLASS: beamer - #+BEAMER_THEME: Frankfurt - #+BEAMER_INNER_THEME: rounded - - - * Introduction - *** Programming - -    - Python - -    - Ruby - - + - Python + - Ruby *** Paragraph one - - -    Lorem ipsum dolor sit amet, consectetur adipiscing - -    elit. Cras lorem nisi, tincidunt tempus sem nec, elementum feugiat - -    ipsum. Nulla in diam libero. Nunc tristique ex a nibh egestas - -    sollicitudin. - - + Lorem ipsum dolor sit amet, consectetur adipiscing + elit. Cras lorem nisi, tincidunt tempus sem nec, elementum feugiat + ipsum. Nulla in diam libero. Nunc tristique ex a nibh egestas + sollicitudin. *** Paragraph two - - -    Mauris efficitur vitae ex id egestas. Vestibulum - -    ligula felis, pulvinar a posuere id, luctus vitae leo. Sed ac - -    imperdiet orci, non elementum leo. Nullam molestie congue - -    placerat. Phasellus tempor et libero maximus commodo. - - + Mauris efficitur vitae ex id egestas. Vestibulum + ligula felis, pulvinar a posuere id, luctus vitae leo. Sed ac + imperdiet orci, non elementum leo. Nullam molestie congue + placerat. Phasellus tempor et libero maximus commodo. * Thanks - *** Links - -    - Link one - -    - Link two - + - Link one + - Link two ``` -We have added three more lines to the header: +我们给标题增加了三行: + ``` #+LATEX_CLASS: beamer - #+BEAMER_THEME: Frankfurt - #+BEAMER_INNER_THEME: rounded - ``` -导出为 PDF,按下 `Alt + x` 键后输入 “org-beamer-export-to-pdf” +导出为 PDF,按下 `Alt + x` 键后输入 `org-beamer-export-to-pdf`。 ![latex_beamer_presentation.png][23] -用 Emacs 和 Org mode 创建的 Latex Beamer persentation +*用 Emacs 和 Org 模式创建的 Latex Beamer 简报* -希望你会爱上使用 Emacs 来创建 LaTex 和 Beamer 文档(注意:使用快捷键比用鼠标更快些)。Emacs 的 Org-mode 提供了比我在这篇文章中说的更多的功能,你可以在 [orgmode.org][24] 获取更多的信息. +希望你会爱上使用 Emacs 来创建 LaTex 和 Beamer 文档(注意:使用快捷键比用鼠标更快些)。Emacs 的 Org 模式提供了比我在这篇文章中说的更多的功能,你可以在 [orgmode.org][24] 获取更多的信息. -------------------------------------------------------------------------------- via: https://opensource.com/article/18/4/how-create-latex-documents-emacs 作者:[Sachin Patil][a] -译者:[oneforalone](https://github.com/oneforalone) -校对:[校对者ID](https://github.com/校对者ID) 选题:[lujun9972](https://github.com/lujun9972) +译者:[oneforalone](https://github.com/oneforalone) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9a3439ffbb7176c3f1a6742f8134bcc14dd6a780 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 24 Nov 2018 10:53:55 +0800 Subject: [PATCH 0425/1143] PUB:20180409 How to create LaTeX documents with Emacs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @oneforalone 本文首发地址: https://linux.cn/article-10269-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/oneforalone 请注册领取 LCCN:https://lctt.linux.cn/ --- .../20180409 How to create LaTeX documents with Emacs.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180409 How to create LaTeX documents with Emacs.md (100%) diff --git a/translated/tech/20180409 How to create LaTeX documents with Emacs.md b/published/20180409 How to create LaTeX documents with Emacs.md similarity index 100% rename from translated/tech/20180409 How to create LaTeX documents with Emacs.md rename to published/20180409 How to create LaTeX documents with Emacs.md From 81b6407a527984620573fa9af52d1b746fb9a30e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 24 Nov 2018 10:56:01 +0800 Subject: [PATCH 0426/1143] PRF:20180409 How to create LaTeX documents with Emacs.md --- published/20180409 How to create LaTeX documents with Emacs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20180409 How to create LaTeX documents with Emacs.md b/published/20180409 How to create LaTeX documents with Emacs.md index e2c92583cf..efca4ef9bc 100644 --- a/published/20180409 How to create LaTeX documents with Emacs.md +++ b/published/20180409 How to create LaTeX documents with Emacs.md @@ -6,7 +6,7 @@ 一篇由 Aaron Cocker 写的很棒的文章 “[在 LaTeX 中创建文件的介绍][1]” 中,介绍了 [LaTeX 排版系统][3] 并描述了如何使用 [TeXstudio][4] 来创建 LaTeX 文档。同时,他也列举了一些很多用户觉得创建 LaTeX 文档很方便的编辑器。 -[Greg Pittman][5] 对这篇文章的评论吸引了我:“当你第一次开始使用 LaTeX 时,他似乎是个和差劲的排版……” 事实也确实如此。LaTeX 包含了多种排版字体和调试,如果你漏了一个特殊的字符比如说感叹号,这会让很多用户感到沮丧,尤其是新手。在本文中,我将介绍如何使用 [GNU Emacs][6] 来创建 LaTeX 文档。 +[Greg Pittman][5] 对这篇文章的评论吸引了我:“当你第一次开始使用 LaTeX 时,他似乎是个很差劲的排版……” 事实也确实如此。LaTeX 包含了多种排版字体和调试,如果你漏了一个特殊的字符比如说感叹号,这会让很多用户感到沮丧,尤其是新手。在本文中,我将介绍如何使用 [GNU Emacs][6] 来创建 LaTeX 文档。 ### 创建你的第一个文档 From a1414469215a4c375fe9d697a0a33a938d17dc7d Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 23 Nov 2018 22:12:56 +0800 Subject: [PATCH 0427/1143] =?UTF-8?q?=E6=B7=BB=E5=8A=A0cron=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 11 ++++++++++- scripts/status.sh | 8 ++++++++ scripts/status/status.sh | 13 ++++++++----- 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100755 scripts/status.sh diff --git a/.travis.yml b/.travis.yml index ab0090fa5a..99bc9b86a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,27 @@ language: c +install: + - sudo apt-get install jq + - git clone --depth=1 -b gh-pages https://github.com/LCTT/TranslateProject/ build && rm -rf build/.git script: - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then sh ./scripts/check.sh; fi' - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sh ./scripts/badge.sh; fi' + - 'if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then sh ./scripts/status.sh; fi' + branches: only: - master + # - status except: - gh-pages git: submodules: false + depth: false deploy: provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN local_dir: build on: - branch: master + branch: + - master + # - status diff --git a/scripts/status.sh b/scripts/status.sh new file mode 100755 index 0000000000..f3cc4b8d82 --- /dev/null +++ b/scripts/status.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# 重新生成badge +set -o errexit + +SCRIPTS_DIR=$(cd $(dirname "$0") && pwd) +BUILD_DIR=$(cd $SCRIPTS_DIR/.. && pwd)/build +mkdir -p ${BUILD_DIR}/status +${SCRIPTS_DIR}/status/status.sh > ${BUILD_DIR}/status/status.json diff --git a/scripts/status/status.sh b/scripts/status/status.sh index 9bb5aaf700..acb03bbf4e 100755 --- a/scripts/status/status.sh +++ b/scripts/status/status.sh @@ -13,12 +13,15 @@ function get_status_of() git log --date=short --pretty=format:"{\"file\":\"${file}\",\"time\":\"%ad\",\"user\":\"%an\"}" -n 1 "${file}" } -( -git grep -niE "translat|fanyi|翻译" sources/*.md |awk -F ":" '{if ($2<=3) print $1}' |xargs -I{} git log --date=short --pretty=format:"{\"filename\":\"{}\",\"time\":\"%ad\",\"user\":\"%an\"}" -n 1 "{}"|jq --slurp - +translating=$( git grep -niE "translat|fanyi|翻译" sources/*.md |awk -F ":" '{if ($2<=3) print $1}' |xargs -I{} git log --date=short --pretty=format:"{\"filename\":\"{}\",\"time\":\"%ad\",\"user\":\"%an\"}" -n 1 "{}") +unselected=$( find sources -name "2*.md"|sort|while read file;do if ! file-translating-p "${file}";then get_status_of "${file}" fi -done |jq --slurp -)|jq --slurp '{"translating":.[0],"unselected":.[1]}' +done +) +( +echo ${translating}|jq -s "." +echo ${unselected} |jq -s "." +)|jq -s '{"translating":.[0],"unselected":.[1]}' From 638d17e86605141c6dda84f3bb4c9a4a4ac808f5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 24 Nov 2018 12:22:43 +0800 Subject: [PATCH 0428/1143] PRF:20181113 4 tips for learning Golang.md @dianbanjiu --- .../20181113 4 tips for learning Golang.md | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/translated/tech/20181113 4 tips for learning Golang.md b/translated/tech/20181113 4 tips for learning Golang.md index 69fb028296..ed80a40ded 100644 --- a/translated/tech/20181113 4 tips for learning Golang.md +++ b/translated/tech/20181113 4 tips for learning Golang.md @@ -1,47 +1,51 @@ 学习 Golang 的 4 个技巧 ====== -到达 Golang 大陆:一个高级开发者的日记。 + +> 到达 Golang 大陆:一位资深开发者之旅。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_laptop_code_programming_mountain_view.jpg?itok=yx5buqkr) -2014 年夏天... +2014 年夏天…… > IBM:“我们需要你弄清楚这个 Docker。” -> Me:“没问题。” + +> 我:“没问题。” + > IBM:“那就开始吧。” -> Me:“好的。”(内心声音):”Docker 是用 Go 编写的。是吗?“(Googles)“哦,一门编程语言。我在我的岗位上已经学习了很多了。这不会太难。” +> 我:“好的。”(内心声音):”Docker 是用 Go 编写的。是吗?“(Google 一下)“哦,一门编程语言。我在我的岗位上已经学习了很多了。这不会太难。” -我的大学新生编程课是使用 VAX 汇编程序教授的。在数据结构课上,我们在图书馆计算机中心的旧电脑上使用 Pascal 加载的软盘。在一门更上一级的课程中,我有一个教授喜欢用 ADA 去展示所有的例子。我在我们的 Sun 工作站上通过各种的 UNIX 的实用源代码学到了一点 C。在 IBM,我们使用 C 和一些 x86 汇编程序来获取 OS/2 源代码,我们大量使用 C++ 的面向对象功能与 Apple 合作。不久后我学到了 shell 脚本,并开始使用 csh,但是在 90 年代中期发现 Linux 后就转到了 Bash。在 90 年代后期将其移植到 Linux 时,我正在研究 IBM 的自定义 JVM 代码中的即时(JIT)编译器,因此我开始学习 m4(可以说是宏编程器而不是编程语言)。 +我的大学新生编程课是使用 VAX 汇编程序教授的。在数据结构课上,我们使用 Pascal —— 在图书馆计算机中心的旧电脑上使用软盘加载。在一门更高一级的课程中,我的教授教授喜欢用 ADA 去展示所有的例子。在我们的 Sun 工作站上,我通过各种 UNIX 的实用源代码学到了一点 C。在 IBM,OS/2 源代码中我们使用了 C 和一些 x86 汇编程序;在一个与 Apple 合作的项目中我们大量使用 C++ 的面向对象功能。不久后我学到了 shell 脚本,开始是 csh,但是在 90 年代中期发现 Linux 后就转到了 Bash。在 90 年代后期,我在将 IBM 的定制的 JVM 代码中的即时(JIT)编译器移植到 Linux 时,我不得不开始学习 m4(与其说是编程语言,不如说是一种宏处理器)。 -快进 20 年... 我从未因为学习一门新的编程语言而焦灼。但是 [Go][1] 感觉有些不同。我打算在 GitHub 上游公开贡献,让任何有兴趣的人都可以看到!作为一个 40 多岁高级开发者的 Go 新手,我不想成为一个笑话。我们都知道程序员的骄傲是不想受伤,不论你的经验水平如何。 +一晃 20 年……我从未因为学习一门新的编程语言而焦灼。但是 [Go][1] 让我感觉有些不同。我打算公开贡献,上传到 GitHub,让任何有兴趣的人都可以看到!作为一个 40 多岁的资深开发者的 Go 新手,我不想成为一个笑话。我们都知道程序员的骄傲,不想丢人,不论你的经验水平如何。 -我早期的调查显示,Go 似乎比某些语言更倾向于 “惯用语”。它不仅仅是编译代码; 我需要能够用 “Go 的方式” 写代码。 +我早期的调研显示,Go 似乎比某些语言更 “地道”。它不仅仅是让代码可以编译;也需要让代码可以 “Go Go Go”。 -现在在我的私人 Go 日志上,四年有上百个 pull requests,我不是致力于成为一个专家,但是我觉得贡献和编写代码比我在 2014 年的时候更舒服了。所以,你该怎么教一个老人新的技能或者至少一门编程语言?以下是我自己在前往 Golang 大陆的四个步骤。 +现在,我的个人的 Go 之旅四年间有了几百个拉取请求(PR),我不是致力于成为一个专家,但是现在我觉得贡献和编写代码比我在 2014 年的时候更舒服了。所以,你该怎么教一个老人新的技能或者一门编程语言呢?以下是我自己在前往 Golang 大陆之旅的四个步骤。 -### 1. 不要跳过基础 +### 1、不要跳过基础 -虽然你可以通过复制代码来进行你早期的学习(还有谁有时间阅读手册!?),Go 有一个非常易读的 [语言规范][2],它写的很清楚,即便你在语言或者编译理论方面没有硕士学位。鉴于 Go 在 **参数:类型** 的顺序做的独特决定,在使用有趣的语言功能,例如 通道和 goroutines 时,搞定这些新概念是非常重要的是事情。阅读文档 [高效 Go 编程][3],这是 Golang 创作者的另一个重要资源,它将为你提供有效和正确使用语言的准备。 +虽然你可以通过复制代码来进行你早期的学习(谁还有时间阅读手册!?),Go 有一个非常易读的 [语言规范][2],它写的很易于理解,即便你在语言或者编译理论方面没有取得硕士学位。鉴于 Go 的 **参数:类型** 顺序的特有习惯,以及一些有趣的语言功能,例如通道和 go 协程,搞定这些新概念是非常重要的是事情。阅读这个附属的文档 [高效 Go 编程][3],这是 Golang 创造者提供的另一个重要资源,它将为你提供有效和正确使用语言的准备。 -### 2. 从最好的中学习 +### 2、从最好的中学习 -有许多宝贵的资源可供挖掘,并将你的 Go 知识提升到下一个等级。最近在 [GopherCon][4] 上的所有谈话都可以在网上找到,就像 [GopherCon US 在 2018][5] 中的详尽列表一样。谈话的专业知识和技术水平各不相同,但是你可以通过谈话轻松地找到一些你不了解的事情。[Francesc Campoy][6] 创建了一个名叫 [JustForFunc][7] 的 Go 编程视频系列,其中有越来越多的剧集来拓宽你的 Go 知识和理解。快速搜索 “Golang" 可以为那些想要了解更多信息的人们展示许多其他视频和在线资源。 +有许多宝贵的资源可供挖掘,可以将你的 Go 知识提升到下一个等级。最近在 [GopherCon][4] 上的所有讲演都可以在网上找到,如这个 [GopherCon US 2018][5] 的详尽列表。这些讲演的专业知识和技术水平各不相同,但是你可以通过它们轻松地找到一些你所不了解的事情。[Francesc Campoy][6] 创建了一个名叫 [JustForFunc][7] 的 Go 编程视频系列,其不断增多的剧集可以用来拓宽你的 Go 知识和理解。直接搜索 “Golang" 可以为那些想要了解更多信息的人们展示许多其它视频和在线资源。 -想要看代码?在 GitHub 上许多受欢迎的云原生项目都是用 Go 写的:[Docker/Moby][8],[Kubernetes][9],[Istio][10],[containerd][11],[CoreDNS][12],以及许多其他的。语言纯粹者可能会评价一些项目的惯用语优于其他的,但是这些都是在了解大型代码在高度活跃的项目中开始使用 Go 的大好起点。 +想要看代码?在 GitHub 上许多受欢迎的云原生项目都是用 Go 写的:[Docker/Moby][8]、[Kubernetes][9]、[Istio][10]、[containerd][11]、[CoreDNS][12],以及许多其它的。语言纯粹主义者可能会认为一些项目比另外一些更地道,但这些都是很好的起点,可以看到在高度活跃的项目的大型代码库中使用 Go 的程度。 -### 3. 使用优秀的语言工具 +### 3、使用优秀的语言工具 -你将要快速了解有关 [gofmt][13] 的宝贵之处。Go 最漂亮的一个地方就在于没有关于每个项目代码格式的争论 —— **gofmt** 内置在语言的运行库中,并且根据一系列稳固、易于理解的语言规则对 Go 代码进行格式化。我不理解任何基于 Golang 不坚持使用 **gofmt** 检查 pull requests 作为持续集成一部分的项目。 +你会很快了解到 [gofmt][13] 的宝贵之处。Go 最漂亮的一个地方就在于没有关于每个项目代码格式的争论 —— **gofmt** 内置在语言的运行环境中,并且根据一系列可靠的、易于理解的语言规则对 Go 代码进行格式化。我不知道有哪个基于 Golang 的项目会在持续集成中不坚持使用 **gofmt** 检查拉取请求。 -除了直接构建在 runtime/SDK 有价值的工具之外,我强烈建议使用一个对 Golang 的特性有良好支持的编辑器或者 IDE。由于我经常在命令行中进行工作,我依赖于 Vim 加上强大的 [vim-go][14] 插件。我也喜欢微软提供的 [VS Code][15],特别是它的 [Go language][16] 插件。 +除了直接构建于运行环境和 SDK 中的一系列有价值的工具之外,我强烈建议使用一个对 Golang 的特性有良好支持的编辑器或者 IDE。由于我经常在命令行中进行工作,我依赖于 Vim 加上强大的 [vim-go][14] 插件。我也喜欢微软提供的 [VS Code][15],特别是它的 [Go 语言][16] 插件。 -想要一个调试器?[Delve][17] 项目在不断的改进和成熟,而且是在 Go 二进制文件上进行 [gdb][18] 式调试的强有力的竞争者。 +想要一个调试器?[Delve][17] 项目在不断的改进和成熟,它是在 Go 二进制文件上进行 [gdb][18] 式调试的强有力的竞争者。 -### 4. 写一些代码 +### 4、写一些代码 -你要是不开始尝试使用 Go 写代码,你永远不知道它有什么好的地方。找一个有 “需要帮助” 问题标签的项目,然后开始贡献代码。如果你已经使用了一个用 Go 编写的开源项目,找出它是否有一些用初学者方式解决的 Bugs,然后开始你的第一个 pull request。与生活中的大多数事情一样,唯一真正的改进方法就是通过实践,所以开始吧。 +你要是不开始尝试使用 Go 写代码,你永远不知道它有什么好的地方。找一个有 “需要帮助” 问题标签的项目,然后开始贡献代码。如果你已经使用了一个用 Go 编写的开源项目,找出它是否有一些可以用初学者方式解决的 Bug,然后开始你的第一个拉取请求。与生活中的大多数事情一样,实践出真知,所以开始吧。 -事实证明,你似乎可以教一个老高级开发者至少一门新的技能或者编程语言。 +事实证明,你可以教会一个资深的老开发者一门新的技能甚至编程语言。 -------------------------------------------------------------------------------- @@ -50,7 +54,7 @@ via: https://opensource.com/article/18/11/learning-golang 作者:[Phill Estes][a] 选题:[lujun9972][b] 译者:[dianbanjiu](https://github.com/dianbanjiu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 50bd3368e5162308730de4461a1353a33d2d7ffd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 24 Nov 2018 12:23:14 +0800 Subject: [PATCH 0429/1143] PUB:20181113 4 tips for learning Golang.md @dianbanjiu https://linux.cn/article-10270-1.html --- .../tech => published}/20181113 4 tips for learning Golang.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181113 4 tips for learning Golang.md (100%) diff --git a/translated/tech/20181113 4 tips for learning Golang.md b/published/20181113 4 tips for learning Golang.md similarity index 100% rename from translated/tech/20181113 4 tips for learning Golang.md rename to published/20181113 4 tips for learning Golang.md From f90047aea7abc5c1b9244ab022b001d770f2e860 Mon Sep 17 00:00:00 2001 From: Jamkr Date: Sat, 24 Nov 2018 12:30:36 +0800 Subject: [PATCH 0430/1143] [Translated] 20181115 How to install a device driver on Linux --- ...How to install a device driver on Linux.md | 147 ------------------ ...How to install a device driver on Linux.md | 143 +++++++++++++++++ 2 files changed, 143 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20181115 How to install a device driver on Linux.md create mode 100644 translated/tech/20181115 How to install a device driver on Linux.md diff --git a/sources/tech/20181115 How to install a device driver on Linux.md b/sources/tech/20181115 How to install a device driver on Linux.md deleted file mode 100644 index 517d984409..0000000000 --- a/sources/tech/20181115 How to install a device driver on Linux.md +++ /dev/null @@ -1,147 +0,0 @@ -Translating by Jamskr - -How to install a device driver on Linux -====== -Learn how Linux drivers work and how to use them. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc) - -One of the most daunting challenges for people switching from a familiar Windows or MacOS system to Linux is installing and configuring a driver. This is understandable, as Windows and MacOS have mechanisms that make this process user-friendly. For example, when you plug in a new piece of hardware, Windows automatically detects it and shows a pop-up window asking if you want to continue with the driver's installation. You can also download a driver from the internet, then just double-click it to run a wizard or import the driver through Device Manager. - -This process isn't as easy on a Linux operating system. For one reason, Linux is an open source operating system, so there are [hundreds of Linux distribution variations][1] . This means it's impossible to create one how-to guide that works for all Linux distros. Each Linux operating system handles the driver installation process a different way. - -Second, most default Linux drivers are open source and integrated into the system, which makes installing any drivers that are not included quite complicated, even though most hardware devices can be automatically detected. Third, license policies vary among the different Linux distributions. For example, [Fedora prohibits][2] including drivers that are proprietary, legally encumbered, or that violate US laws. And Ubuntu asks users to [avoid using proprietary or closed hardware][3]. - -To learn more about how Linux drivers work, I recommend reading [An Introduction to Device Drivers][4] in the book Linux Device Drivers. - -### Two approaches to finding drivers - -#### 1\. User interfaces - -If you are new to Linux and coming from the Windows or MacOS world, you'll be glad to know that Linux offers ways to see whether a driver is available through wizard-like programs. Ubuntu offers the [Additional Drivers][5] option. Other Linux distributions provide helper programs, like [Package Manager for GNOME][6], that you can check for available drivers. - -#### 2\. Command line - -What if you can't find a driver through your nice user interface application? Or you only have access through the shell with no graphic interface whatsoever? Maybe you've even decided to expand your skills by using a console. You have two options: - - A. **Use a repository** -This is similar to the [**homebrew**][7] command in MacOS.** ** By using **yum** , **dnf** , **apt-get** , etc., you're basically adding a repository and updating the package cache. - - - B. **Download, compile, and build it yourself** -This usually involves downloading a package directly from a website or using the **wget** command and running the configuration file and Makefile to install it. This is beyond the scope of this article, but you should be able to find online guides if you choose to go this route. - - - -### Check if a driver is already installed - -Before jumping further into installing a driver in Linux, let's look at some commands that will determine whether the driver is already available on your system. - -The [**lspci**][8] command shows detailed information about all PCI buses and devices on the system: - -``` -$ lscpci -``` - -Or with **grep** : - -``` -$ lscpci | grep SOME_DRIVER_KEYWORD -``` - -For example, you can type **lspci | grep SAMSUNG** if you want to know if a Samsung driver is installed. - -The [**dmesg**][9] command shows all device drivers recognized by the kernel: - -``` -$ dmesg -``` - -Or with **grep** : - -``` -$ dmesg | grep SOME_DRIVER_KEYWORD -``` - -Any driver that's recognized will show in the results. - -If nothing is recognized by the **dmesg** or **lscpi** commands, try these two commands to see if the driver is at least loaded on the disk: - -``` -$ /sbin/lsmod -``` - -and - -``` -$ find /lib/modules -``` - -Tip: As with **lspci** or **dmesg** , append **| grep** to either command above to filter the results. - -If a driver is recognized by those commands but not by **lscpi** or **dmesg** , it means the driver is on the disk but not in the kernel. In this case, load the module with the **modprobe** command: - -``` -$ sudo modprobe MODULE_NAME -``` - -Run as this command as **sudo** since this module must be installed as a root user. - -### Add the repository and install - -There are different ways to add the repository through **yum** , **dnf** , and **apt-get** ; describing them all is beyond the scope of this article. To make it simple, this example will use **apt-get** , but the idea is similar for the other options. - -**1\. Delete the existing repository, if it exists.** - -``` -$ sudo apt-get purge NAME_OF_DRIVER* -``` - -where **NAME_OF_DRIVER** is the probable name of your driver. You can also add pattern match to your regular expression to filter further. - -**2\. Add the repository to the repolist, which should be specified in the driver guide.** - -``` -$ sudo add-apt-repository REPOLIST_OF_DRIVER -``` - -where **REPOLIST_OF_DRIVER** should be specified from the driver documentation (e.g., **epel-list** ). - -**3\. Update the repository list.** - -``` -$ sudo apt-get update -``` - -**4\. Install the package.** - -``` -$ sudo apt-get install NAME_OF_DRIVER -``` - -**5\. Check the installation.** - -Run the **lscpi** command (as above) to check that the driver was installed successfully. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/11/how-install-device-driver-linux - -作者:[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://en.wikipedia.org/wiki/List_of_Linux_distributions -[2]: https://fedoraproject.org/wiki/Forbidden_items?rd=ForbiddenItems -[3]: https://www.ubuntu.com/licensing -[4]: https://www.xml.com/ldd/chapter/book/ch01.html -[5]: https://askubuntu.com/questions/47506/how-do-i-install-additional-drivers -[6]: https://help.gnome.org/users/gnome-packagekit/stable/add-remove.html.en -[7]: https://brew.sh/ -[8]: https://en.wikipedia.org/wiki/Lspci -[9]: https://en.wikipedia.org/wiki/Dmesg diff --git a/translated/tech/20181115 How to install a device driver on Linux.md b/translated/tech/20181115 How to install a device driver on Linux.md new file mode 100644 index 0000000000..e078e05c0c --- /dev/null +++ b/translated/tech/20181115 How to install a device driver on Linux.md @@ -0,0 +1,143 @@ +如何在 Linux 上安装设备驱动程序 +====== +学习 Linux 设备驱动如何工作,并知道如何使用它们。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc) + +对于一个熟悉 Windows 或者 MacOS 的人,想要切换到 Linux,它们都会面临一个艰巨的问题就是怎么安装和配置设备驱动。这是可以理解的,因为 Windows 和 MacOS 都有一套机制把这个过程做得非常的友好。比如说,当你插入一个新的硬件设备, Windows 能够自动检测并会弹出一个窗口询问你是否要继续驱动程序。你也可以从网络上下载驱动程序,仅仅需要双击解压或者是通过设备管理器导入驱动程序即可。 + +而这在 Linux 操作系统上并非这么简单。第一个原因是, Linux 是一个开源的操作系统,所以有 [数百种 Linux 发行版的变体][1]。也就是说不可能做一个指南来适应所有的 Linux 发行版。因为每种 Linux 安装驱动程序的过程都有差异。 + +第二,大多数默认的 Linux 驱动程序也都是开源的,并被集成到了系统中,这使得安装一些并未包含的驱动程序变得非常复杂,即使已经可以检测大多数的硬件设备。第三,不同发行版的许可也有差异。例如,[Fedora 禁止事项][2] 禁止包含专有的,受法律保护,或者是违反美国法律的驱动程序。而 Ubuntu 则让用户[避免使用受法律保护或闭源的硬件设备][3]。 + +为了更好的学习 Linux 驱动程序是如何工作的,我建议阅读 Linux 设备驱动程序一书中的 [设备驱动程序简介][4]。 + +### 两种方式来寻找驱动程序 + +#### 1\. 用户界面 + +如果是一个刚从 Windows 或 MacOS 转过来的 Linux 新手,那你会很高兴知道 Linux 也提供了一个通过向导式的程序来查看驱动程序是否可用的方法。 Ubuntu 提供了一个 [附加驱动程序][5] 选项。其它的 Linux 发行版也提供了帮助程序,像 [GNOME 的包管理器][6],你可以使用它来检查驱动程序是否可用。 + +#### 2\. 命令行 + +如果你通过漂亮的用户界面找到驱动程序,那又该怎么办呢?或许你只能通过没有任何图形界面的 shell?甚至你可以使用控制台来展现你的技能。你有两个选择: + + A. **通过一个仓库** +这和 MacOS 中的 [**homebrew**][7] 命令行很像。通过使用 `yum` , `dnf` , `apt-get` , 等等。你基本可以通过添加仓库,并更新包缓存。 + + B. **下载, 编译, 然后自己构建** +这通常包括直接从网络,或通过 `wget` 命令下载源码包,然后运行配置和编译、安装。这超出了本文的范围,但是你可以在网络上找到很多在线指南,如果你选择的是这条路的话。 + +### 检查是否已经安装了这个驱动程序 + +在进一步学习安装 Linux 驱动程序之前,让我们来学习几条命令,用来检测驱动程序是否已经在你的系统上可用。 + +[`lspci`][8] 命令显示了系统上所有 PCI 总线和设备驱动程序的详细信息。 + +``` +$ lscpci +``` + +或者使用 `grep`: + +``` +$ lscpci | grep SOME_DRIVER_KEYWORD +``` + +例如,你可以使用 `lspci | grep SAMSUNG` 命令,如果你想知道是否安装过三星的驱动。 + +[`dmesg`][9] 命令显示了所有内核识别的驱动程序。 + +``` +$ dmesg +``` + +或配合 `grep` 使用 + +``` +$ dmesg | grep SOME_DRIVER_KEYWORD +``` + +任何识别到的驱动程序都会显示在结果中。 + +如果通过 `dmesg` 或者 `lscpi` 命令没有识别到任何驱动程序,尝试下这两个命令,看看驱动程序至少是否加载到硬盘。 + +``` +$ /sbin/lsmod +``` + +和 + +``` +$ find /lib/modules +``` + +小贴士:和`lspci` 或 `dmesg` 一样,通过在上面的命令后面加上 `| grep` 来过滤结果。 + +如果一个驱动程序已经被识别到了,但是通过 `lscpi` 或 `dmesg` 并没有找到,这意味着驱动程序已经存在于硬盘上,但是并没有加载到内核中,这种情况,你可以通过 `modprobe` 命令来加载这个模块。 + +``` +$ sudo modprobe MODULE_NAME +``` + +使用 `sudo` 来运行这个命令,因为这个模块要使用 root 权限来安装。 + +### 添加仓库并安装 + +可以通过 `yum` , `dnf` , 和 `apt-get` 几种不同的方式来添加一个仓库;一个个介绍完它们并不在本文的范围。简单一点来说,这个示例将会使用 `apt-get` ,但是这个命令和其它的几个都是很类似的。 + +**1\. 删除存在的仓库,如果它存在.** + +``` +$ sudo apt-get purge NAME_OF_DRIVER* +``` + +其中 `NAME_OF_DRIVER` 是你的驱动程序的可能的名称。你还可以将模式匹配加到正则表达式中来进一步过滤。 + +**2\. 将仓库加入到仓库表中,这应该在驱动程序指南中有指定** + +``` +$ sudo add-apt-repository REPOLIST_OF_DRIVER +``` + +其中 `REPOLIST_OF_DRIVER` 应该从驱动文档中有指定(例如:`epel-list`)。 + +**3\. 更新仓库列表。** + +``` +$ sudo apt-get update +``` + +**4\. 安装驱动程序。** + +``` +$ sudo apt-get install NAME_OF_DRIVER +``` + +**5\. 检查安装状态.** + +像上面说的一样,通过 `lscpi` 命令来检查驱动程序是否已经安装成功。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/how-install-device-driver-linux + +作者:[Bryant Son][a] +选题:[lujun9972][b] +译者:[Jamskr](https://github.com/Jamskr) +校对:[校对者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://en.wikipedia.org/wiki/List_of_Linux_distributions +[2]: https://fedoraproject.org/wiki/Forbidden_items?rd=ForbiddenItems +[3]: https://www.ubuntu.com/licensing +[4]: https://www.xml.com/ldd/chapter/book/ch01.html +[5]: https://askubuntu.com/questions/47506/how-do-i-install-additional-drivers +[6]: https://help.gnome.org/users/gnome-packagekit/stable/add-remove.html.en +[7]: https://brew.sh/ +[8]: https://en.wikipedia.org/wiki/Lspci +[9]: https://en.wikipedia.org/wiki/Dmesg From d9ef6f8c63504cbcc7ad4a20db0da3e72e039cf4 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 24 Nov 2018 12:31:41 +0800 Subject: [PATCH 0431/1143] =?UTF-8?q?=E6=9B=B4=E6=94=B9CI=E7=9A=84?= =?UTF-8?q?=E7=BC=96=E7=A8=8B=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99bc9b86a0..0b12ca6653 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -language: c +language: minimal install: - sudo apt-get install jq - git clone --depth=1 -b gh-pages https://github.com/LCTT/TranslateProject/ build && rm -rf build/.git From 8fc06f9c34ff97364d0bf49e150c0564622e54aa Mon Sep 17 00:00:00 2001 From: lxy <524187166@qq.com> Date: Sat, 24 Nov 2018 13:20:45 +0800 Subject: [PATCH 0432/1143] =?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 --- ...he i3 window manager makes Linux better.md | 113 ------------------ ...he i3 window manager makes Linux better.md | 109 +++++++++++++++++ 2 files changed, 109 insertions(+), 113 deletions(-) delete mode 100644 sources/tech/20180807 5 reasons the i3 window manager makes Linux better.md create mode 100644 translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md diff --git a/sources/tech/20180807 5 reasons the i3 window manager makes Linux better.md b/sources/tech/20180807 5 reasons the i3 window manager makes Linux better.md deleted file mode 100644 index fb4329f9a8..0000000000 --- a/sources/tech/20180807 5 reasons the i3 window manager makes Linux better.md +++ /dev/null @@ -1,113 +0,0 @@ -translating by lixinyuxx - -5 reasons the i3 window manager makes Linux better -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-windows.png?itok=jd5sBNQH) - -One of the nicest things about Linux (and open source software in general) is the freedom to choose among different alternatives to address our needs. - -I've been using Linux for a long time, but I was never entirely happy with the desktop environment options available. Until last year, [Xfce][1] was the closest to what I consider a good compromise between features and performance. Then I found [i3][2], an amazing piece of software that changed my life. - -I3 is a tiling window manager. The goal of a window manager is to control the appearance and placement of windows in a windowing system. Window managers are often used as part a full-featured desktop environment (such as GNOME or Xfce), but some can also be used as standalone applications. - -A tiling window manager automatically arranges the windows to occupy the whole screen in a non-overlapping way. Other popular tiling window managers include [wmii][3] and [xmonad][4]. - -![i3 tiled window manager screenshot][6] - -Screenshot of i3 with three tiled windows - -Following are the top five reasons I use the i3 window manager and recommend it for a better Linux desktop experience. - -### 1\. Minimalism - -I3 is fast. It is neither bloated nor fancy. It is designed to be simple and efficient. As a developer, I value these features, as I can use the extra capacity to power my favorite development tools or test stuff locally using containers or virtual machines. - -In addition, i3 is a window manager and, unlike full-featured desktop environments, it does not dictate the applications you should use. Do you want to use Thunar from Xfce as your file manager? GNOME's gedit to edit text? I3 does not care. Pick the tools that make the most sense for your workflow, and i3 will manage them all in the same way. - -### 2\. Screen real estate - -As a tiling window manager, i3 will automatically "tile" or position the windows in a non-overlapping way, similar to laying tiles on a wall. Since you don't need to worry about window positioning, i3 generally makes better use of your screen real estate. It also allows you to get to what you need faster. - -There are many useful cases for this. For example, system administrators can open several terminals to monitor or work on different remote systems simultaneously; and developers can use their favorite IDE or editor and a few terminals to test their programs. - -In addition, i3 is flexible. If you need more space for a particular window, enable full-screen mode or switch to a different layout, such as stacked or tabbed. - -### 3\. Keyboard-driven workflow - -I3 makes extensive use of keyboard shortcuts to control different aspects of your environment. These include opening the terminal and other programs, resizing and positioning windows, changing layouts, and even exiting i3. When you start using i3, you need to memorize a few of those shortcuts to get around and, with time, you'll use more of them. - -The main benefit is that you don't often need to switch contexts from the keyboard to the mouse. With practice, it means you'll improve the speed and efficiency of your workflow. - -For example, to open a new terminal, press `+`. Since the windows are automatically positioned, you can start typing your commands right away. Combine that with a nice terminal-driven text editor (e.g., Vim) and a keyboard-focused browser for a fully keyboard-driven workflow. - -In i3, you can define shortcuts for everything. Here are some examples: - - * Open terminal - * Open browser - * Change layouts - * Resize windows - * Control music player - * Switch workspaces - - - -Now that I am used to this workflow, I can't see myself going back to a regular desktop environment. - -### 4\. Flexibility - -I3 strives to be minimal and use few system resources, but that does not mean it can't be pretty. I3 is flexible and can be customized in several ways to improve the visual experience. Because i3 is a window manager, it doesn't provide tools to enable customizations; you need external tools for that. Some examples: - - * Use `feh` to define a background picture for your desktop. - * Use a compositor manager such as `compton` to enable effects like window fading and transparency. - * Use `dmenu` or `rofi` to enable customizable menus that can be launched from a keyboard shortcut. - * Use `dunst` for desktop notifications. - - - -I3 is fully configurable, and you can control every aspect of it by updating the default configuration file. From changing all keyboard shortcuts, to redefining the name of the workspaces, to modifying the status bar, you can make i3 behave in any way that makes the most sense for your needs. - -![i3 with rofi menu and dunst desktop notifications][8] - -i3 with `rofi` menu and `dunst` desktop notifications - -Finally, for more advanced users, i3 provides a full interprocess communication ([IPC][9]) interface that allows you to use your favorite language to develop scripts or programs for even more customization options. - -### 5\. Workspaces - -In i3, a workspace is an easy way to group windows. You can group them in different ways according to your workflow. For example, you can put the browser on one workspace, the terminal on another, an email client on a third, etc. You can even change i3's configuration to always assign specific applications to their own workspaces. - -Switching workspaces is quick and easy. As usual in i3, do it with a keyboard shortcut. Press `+num` to switch to workspace `num`. If you get into the habit of always assigning applications/groups of windows to the same workspace, you can quickly switch between them, which makes workspaces a very useful feature. - -In addition, you can use workspaces to control multi-monitor setups, where each monitor gets an initial workspace. If you switch to that workspace, you switch to that monitor—without moving your hand off the keyboard. - -Finally, there is another, special type of workspace in i3: the scratchpad. It is an invisible workspace that shows up in the middle of the other workspaces by pressing a shortcut. This is a convenient way to access windows or programs that you frequently use, such as an email client or your music player. - -### Give it a try - -If you value simplicity and efficiency and are not afraid of working with the keyboard, i3 is the window manager for you. Some say it is for advanced users, but that is not necessarily the case. You need to learn a few basic shortcuts to get around at the beginning, but they'll soon feel natural and you'll start using them without thinking. - -This article just scratches the surface of what i3 can do. For more details, consult [i3's documentation][10]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/8/i3-tiling-window-manager - -作者:[Ricardo Gerardi][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/rgerardi -[1]:https://xfce.org/ -[2]:https://i3wm.org/ -[3]:https://code.google.com/archive/p/wmii/ -[4]:https://xmonad.org/ -[5]:/file/406476 -[6]:https://opensource.com/sites/default/files/uploads/i3_screenshot.png (i3 tiled window manager screenshot) -[7]:/file/405161 -[8]:https://opensource.com/sites/default/files/uploads/rofi_dunst.png (i3 with rofi menu and dunst desktop notifications) -[9]:https://i3wm.org/docs/ipc.html -[10]:https://i3wm.org/docs/userguide.html diff --git a/translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md b/translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md new file mode 100644 index 0000000000..428665c170 --- /dev/null +++ b/translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md @@ -0,0 +1,109 @@ +i3窗口管理器让Linux更好的五个原因 +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-windows.png?itok=jd5sBNQH) + +Linux(和一般的开源软件) 最美好的一点是在不同的替代方案中进行选择的自由,以满足我们的需求。 + +我使用 Linux 已经很长时间了,但我从来没有对可用的桌面环境完全满意。直到去年 [Xfce][1] 是我认为在功能和性能之间的一个接近优秀的妥协。然后我发现 [i3][2] 一个惊人的软件改变了我的生活 + +I3 是一个平铺窗口管理器。窗口管理器的目标是控制窗口系统中窗口的外观和位置。窗口管理器通常用作功能齐全的桌面环境 (如 GONME 或 Xfce ) 的一部分, 但也有一些可以用作独立的应用程序。 + +平铺式窗口管理器会自动排列窗口, 以不重叠的方式占据整个屏幕。其他流行的平铺式窗口管理器包括 [wmii][3] 和 [xmonad][4] 。 + +![i3 tiled window manager screenshot][6] + +带有三个的 i3 屏幕截图 + +以下是我使用 i3 窗口管理器的五个首要原因,并推荐它以获得更好的 Linux 桌面体验。 + +### 1\.简化的艺术 + +I3 速度很快。它既不冗杂, 也不花哨。它的设计简单而高效。作为开发人员, 我重视这些功能, 因为我可以使用额外的功能为我最喜欢的开发工具助力, 或者使用容器或虚拟机在本地测试内容。 + +此外, I3 是一个窗口管理器,与功能齐全的桌面环境不同,它并不规定您应该使用的应用程序。您是否想使用 Xfce 的 Thunar 作为文件管理器?GNOME 的 gedit 去编辑文本? I3 并不在乎。选择对您的工作流最有意义的工具,I3 将以相同的方式管理它们。 + +### 2\. 屏幕实际使用面积 + +作为平铺式窗口管理器, I3 将自动 "平铺" 或以不重叠的方式定位窗口, 类似于在墙上放置瓷砖。因为您不需要担心窗口定位, i3 一般会更好地利用您的屏幕空间。它还可以让您更快地找到您需要的东西。 + +对于这种情况有很多有用的例子。例如, 系统管理员可以打开多个?来同时监视或在不同的远程系统上工作;开发人员可以使用他们最喜欢的 IDE 或编辑器和几个?来测试他们的程序。 + +此外, i3 具有灵活性。如果您需要为特定窗口提供更多空间, 请启用全屏模式或切换到其他布局, 如堆叠或选项卡式(标签式)。 + +### 3\. 键盘驱动的工作流程 + +i3 广泛使用键盘快捷键来控制环境的不同方面。其中包括打开?和其他程序、调整大小和定位窗口、更改布局, 甚至退出 i3。当您开始使用 i3 时, 您需要记住其中的一些快捷方式来绕行,随着时间的推移,您会使用更多的快捷方式。 + +主要好处是, 您不需要经常用键盘和鼠标切换上下文。通过练习, 意味着您将提高工作流程的速度和效率。 + +例如, 要打开新的?,请按 `+` .由于窗口是自动定位的, 您可以立即开始键入命令。结合一个很好的?驱动的文本编辑器 (如 Vim) 和一个以键盘为焦点的浏览器,形成一个完全由键盘驱动的工作流程。 + +在 i3 中, 您可以为所有内容定义快捷方式。下面是一些示例: + + * 打开? + * 打开浏览器 + * 更改布局 + * 调整窗口大小 + * 控制音乐播放器 + * 切换工作区 + +现在我已经习惯了这个工作形式,我已无法回到了常规的桌面环境。 + +### 4\. 灵活 + +i3 力求最小化,很少使用系统资源, 但这并不意味着它不可能漂亮。i3 具有灵活性, 可通过多种方式进行自定义, 以改善视觉体验。因为 i3 是一个窗口管理器, 所以它不提供启用自定义的工具,而是提供启用自定义的工具。您需要外部工具来实现这一点。一些例子: + + * 用 `feh` 定义桌面的背景图片。 + * 使用复合器管理器, 如`compton`以启用窗口淡入淡出和透明度等效果。 + * 用 `dmenu` 或 `rofi`以启用可从键盘快捷方式启动的可自定义菜单。 + * 用 `dunst` 用于桌面通知。 + + + +i3 是完全可配置的,您可以通过更新默认配置文件来控制它的各个方面。从更改所有键盘快捷键,到重新定义工作区的名称,再到修改状态栏,您都可以使 i3 以任何最适合您需要的方式运行。 + +![i3 with rofi menu and dunst desktop notifications][8] + +i3 与 `rofi` 菜单和 `dunst` 桌面通知。 + +最后, 对于更高级的用户, i3 提供了完整的进程间通信([IPC][9]) 界面, 允许您使用您最喜爱的语言来开发脚本或程序,以实现更多的自定义选项。 + +### 5\. 工作空间 + +在 i3 中, 工作区是对窗口进行分组的一种简单方法。您可以根据您的工作流以不同的方式对它们进行分组。例如, 您可以将浏览器放在一个工作区上, ?命令行放在另一个工作区上, 将电子邮件客户端放在第三个工作区上, 等等。您甚至可以更改 i3 的配置, 以便始终将特定应用程序分配给它们自己的工作区。 + +切换工作区既快速又简单。像 i3 中的往常一样,使用键盘快捷方式执行此操作。按 `+num` 切换到工作区 `num` 。如果您养成了始终将应用程序组的窗口分配到同一工作区的习惯,则可以在它们之间快速切换,这使得工作区成为非常有用的功能。 + +此外,还可以使用工作区来控制多监视器的设置,其中每个监视器都可以获得初始工作区。如果切换到该工作区, 则切换到该监视器,而无需让手离开键盘。 + +最后,i3 中还有另一种特殊类型的工作空间: the scratchpad(便笺簿)。它是一个不可见的工作区,通过按快捷方式显示在其他工作区的中间。这是一种方便的方式来访问您经常使用的窗口或程序,如电子邮件客户端或音乐播放器。 + +### 尝试一下吧 + +如果您重视简单性和效率, 并且不抵触使用键盘, i3 就是您的窗口管理器。有人说是为高级用户准备的,但情况不一定如此。你需要学习一些基本的快捷方式来度过开始的阶段,不久就会越来越自然并且不假思索地使用它们。 + +这篇文章只是触及了 i3 表面能做的事情。欲了解更多详情, 请咨询 [i3's documentation][10]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/8/i3-tiling-window-manager + +作者:[Ricardo Gerardi][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[lixinyuxx](https://github.com/lixinyuxx) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/rgerardi +[1]:https://xfce.org/ +[2]:https://i3wm.org/ +[3]:https://code.google.com/archive/p/wmii/ +[4]:https://xmonad.org/ +[5]:/file/406476 +[6]:https://opensource.com/sites/default/files/uploads/i3_screenshot.png "i3 tiled window manager screenshot" +[7]:/file/405161 +[8]:https://opensource.com/sites/default/files/uploads/rofi_dunst.png "i3 with rofi menu and dunst desktop notifications" +[9]:https://i3wm.org/docs/ipc.html +[10]:https://i3wm.org/docs/userguide.html From de00d5b4a5efbbbe77b166b74d167ea1093a6a91 Mon Sep 17 00:00:00 2001 From: Jamkr Date: Sat, 24 Nov 2018 13:42:25 +0800 Subject: [PATCH 0433/1143] [Translating] 20171108 Continuous infrastructure- The other CI --- .../tech/20171108 Continuous infrastructure- The other CI.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171108 Continuous infrastructure- The other CI.md b/sources/tech/20171108 Continuous infrastructure- The other CI.md index 8a9ac97ae4..757ec2a723 100644 --- a/sources/tech/20171108 Continuous infrastructure- The other CI.md +++ b/sources/tech/20171108 Continuous infrastructure- The other CI.md @@ -1,3 +1,5 @@ +Translating by Jamskr + Continuous infrastructure: The other CI ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_darwincloud_520x292_0311LL.png?itok=74DLgd8Q) From 138c3216c9b925983f38ed7526975fd2b5d6a9ad Mon Sep 17 00:00:00 2001 From: cycoe Date: Sat, 24 Nov 2018 19:03:08 +0800 Subject: [PATCH 0434/1143] translating by cycoe --- sources/tech/20180518 How to Manage Fonts in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180518 How to Manage Fonts in Linux.md b/sources/tech/20180518 How to Manage Fonts in Linux.md index 0faca7fa17..84aa907886 100644 --- a/sources/tech/20180518 How to Manage Fonts in Linux.md +++ b/sources/tech/20180518 How to Manage Fonts in Linux.md @@ -1,3 +1,5 @@ +translating by cycoe +cycoe 翻译中 How to Manage Fonts in Linux ====== From a405a77971bc5b4ed97a1d7a100224d80f939a65 Mon Sep 17 00:00:00 2001 From: cycoe Date: Sat, 24 Nov 2018 20:03:37 +0800 Subject: [PATCH 0435/1143] partial translated --- .../20180518 How to Manage Fonts in Linux.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sources/tech/20180518 How to Manage Fonts in Linux.md b/sources/tech/20180518 How to Manage Fonts in Linux.md index 84aa907886..80889b87ac 100644 --- a/sources/tech/20180518 How to Manage Fonts in Linux.md +++ b/sources/tech/20180518 How to Manage Fonts in Linux.md @@ -1,51 +1,51 @@ translating by cycoe cycoe 翻译中 -How to Manage Fonts in Linux +如何在 Linux 上管理字体 ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/fonts_main.jpg?itok=qcJks7-c) -Not only do I write technical documentation, I write novels. And because I’m comfortable with tools like GIMP, I also create my own book covers (and do graphic design for a few clients). That artistic endeavor depends upon a lot of pieces falling into place, including fonts. +我不仅写技术文档,还写小说。并且因为我对 GIMP 等工具感到满意,所以我也(译者注:此处应指使用 GIMP)创建了自己的书籍封面(并为少数客户做了图形设计)。艺术创作取决于很多东西,包括字体。 -Although font rendering has come a long way over the past few years, it continues to be an issue in Linux. If you compare the look of the same fonts on Linux vs. macOS, the difference is stark. This is especially true when you’re staring at a screen all day. But even though the rendering of fonts has yet to find perfection in Linux, one thing that the open source platform does well is allow users to easily manage their fonts. From selecting, adding, scaling, and adjusting, you can work with fonts fairly easily in Linux. +虽然字体渲染已经在过去的几年里取得了长足进步,但它在 Linux 平台上仍是个问题。如果你在 Linux 和 macOS 平台上比较相同字体的外观,差别是显而易见的,尤其是你要盯着屏幕一整天的时候。虽然在 Linux 平台上尚未找到完美的字体渲染方案,开源平台做得好的一件事是允许用户轻松地管理他们的字体。通过选择、添加、缩放和调整,你可以在 Linux 平台上相当轻松地使用字体。 -Here, I’ll share some of the tips I’ve depended on over the years to help extend my “font-ability” in Linux. These tips will especially help those who undertake artistic endeavors on the open source platform. Because there are so many desktop interfaces available for Linux (each of which deal with fonts in a different way), when a desktop environment becomes central to the management of fonts, I’ll be focusing primarily on GNOME and KDE. +此处,我将分享一些这些年来我赖于在 Linux 上帮助我扩展“字体能力”的技巧。这些技巧将对那些在开源平台上进行艺术创作的人有特别的帮助。因为 Linux 平台上有非常多可用的桌面界面(每种界面以不同的方式处理字体),因此当桌面环境成为字体管理的中心时,我将主要聚焦在 GNOME 和 KDE 上。 -With that said, let’s get to work. +话虽如此,让我们开始吧。 -### Adding new fonts +### 添加新字体 -For the longest time, I have been a collector of fonts. Some might say I have a bit of an obsession. And since my early days of using Linux, I’ve always used the same process for adding fonts to my desktops. There are two ways to do this: +在相当长的一段时间里,我都是一个字体收藏家,甚至有些人会说我有些痴迷。从我使用 Linux 的早期开始,我就总是用相同的方法向我的桌面添加字体。有两种方法可以做到这一点: - * Make the fonts available on a per-user basis. + * 使字体针对每个用户可用; - * Make the fonts available system-wide. + * 使字体在系统范围内可用。 -Because my desktops never have other users (besides myself), I only ever work with fonts on a per-user basis. However, I will show you how to do both. First, let’s see how to add fonts on a per-user basis. The first thing you must do is find fonts. Both True Type Fonts (TTF) and Open Type Fonts (OTF) can be added. I add fonts manually. Do this is, I create a new hidden directory in ~/ called ~/.fonts. This can be done with the command: +因为我的桌面从没有其他用户(除了我自己),我只使用了每个用户的字体设置。然而,我会向你演示如何完成这两种设置。首先,让我们来看一下如何向每个用户添加新字体。你首先要做的是找到字体文件,真实类型字体(TTF)和开源类型字体(OTF)都可以被添加。我选择手动添加字体,也就是说,我在 ~/ 目录下新建了一个名为 ~/.fonts 的隐藏目录。该操作可由以下命令完成: ``` mkdir ~/.fonts ``` -With that folder created, I then move all of my TTF and OTF files into the directory. That’s it. Every font you add into that directory will now be available for use to your installed apps. But remember, those fonts will only be available to that one user. +当此文件夹新建完成,我将所有 TTF 和 OTF 字体文件移动到此文件夹中。也就是说,你在此文件夹中添加的所有字体都可以在已安装的应用中使用了。但是要记住,这些字体只会对这一个用户可用。 -If you want to make that collection of fonts available to all, here’s what you do: +如果你想要使这个字体集合对所有用户可用,你可以如下操作: - 1. Open up a terminal window. + 1. 打开一个终端窗口; - 2. Change into the directory housing all of your fonts. + 2. 切换路径到包含你所有字体的目录中; - 3. Copy all of those fonts with the commands sudo cp *.ttf *.TTF /usr/share/fonts/truetype/ and sudo cp *.otf *.OTF /usr/share/fonts/opentype + 3. 使用 `sudo cp *.ttf *.TTF /usr/share/fonts/truetype/` 和 `sudo cp *.otf *.OTF /usr/share/fonts/opentype` 命令拷贝所有字体。 -The next time a user logs in, they’ll have access to all those glorious fonts. +当下次用户登录时,他们就将可以使用所有这些漂亮的字体。 -### GUI Font Managers +### 图形界面字体管理 There are a few ways to manage your fonts in Linux, via GUI. How it’s done will depend on your desktop environment. Let’s examine KDE first. With the KDE that ships with Kubuntu 18.04, you’ll find a Font Management tool pre-installed. Open that tool and you can easily add, remove, enable, and disable fonts (as well as get information about all of the installed fonts. This tool also makes it easy for you to add and remove fonts for personal and system-wide use. Let’s say you want to add a particular font for personal usage. To do this, download your font and then open up the Font Management tool. In this tool (Figure 1), click on Personal Fonts and then click the + Add button. From 5e0564690328f74591f9a5dff90177a548bbc1e4 Mon Sep 17 00:00:00 2001 From: darksun Date: Sat, 24 Nov 2018 22:16:36 +0800 Subject: [PATCH 0436/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Buil?= =?UTF-8?q?d=20a=20Netboot=20Server,=20Part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3 How to Build a Netboot Server, Part 1.md | 466 ++++++++++++++++++ 1 file changed, 466 insertions(+) create mode 100644 sources/tech/20181123 How to Build a Netboot Server, Part 1.md diff --git a/sources/tech/20181123 How to Build a Netboot Server, Part 1.md b/sources/tech/20181123 How to Build a Netboot Server, Part 1.md new file mode 100644 index 0000000000..980ccba78c --- /dev/null +++ b/sources/tech/20181123 How to Build a Netboot Server, Part 1.md @@ -0,0 +1,466 @@ +[^#]: collector: lujun9972 +[^#]: translator: +[^#]: reviewer: +[^#]: publishor: +[^#]: subject: How to Build a Netboot Server, Part 1 +[^#]: via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ +[^#]: author: [Gregory Bartholomew](https://fedoramagazine.org/author/glb/) +[^#]: url: + +How to Build a Netboot Server, Part 1 +====== + +![](https://fedoramagazine.org/wp-content/uploads/2018/11/build-netboot-816x345.jpg) + +Some computer networks need to maintain identical software installations and configurations on several physical machines. One such environment would be a school computer lab. A [netboot][1] server can be set up to serve an entire operating system over a network so that the client computers can be configured from one central location. This tutorial will show one method of building a netboot server. + +Part 1 of this tutorial will cover creating a netboot server and image. Part 2 will show how to add Kerberos-authenticated home directories to the netboot configuration. + +### Initial Configuration + +Start by downloading one of Fedora Server’s [netinst][2] images, burning it to a CD, and booting the server that will be reformatted from it. We just need a typical “Minimal Install” of Fedora Server for our starting point and we will use the command line to add any additional packages that are needed after the installation is finished. + +![][3] + +> NOTE: For this tutorial we will be using Fedora 28. Other versions may include a slightly different set of packages in their “Minimal Install”. If you start with a different version of Fedora, then you may need to do some troubleshooting if an expected file or command is not available. + +Once you have your minimal installation of Fedora Server up and running, log in as root and set the hostname: + +``` +$ MY_HOSTNAME=server-01.example.edu +$ hostnamectl set-hostname $MY_HOSTNAME +``` + +> NOTE: Red Hat recommends that both static and transient names match the fully-qualified domain name (FQDN) used for the machine in DNS, such as host.example.com ([Understanding Host Names][4]). +> +> NOTE: This guide is meant to be copy-and-paste friendly. Any value that you might need to customize will be stated as a MY_* variable that you can tweak before running the remaining commands. Beware that if you log out, the variable assignments will be cleared. +> +> NOTE: Fedora 28 Server tends to dump a lot of logging output to the console by default. You may want to disable the console logging temporarily by running: sysctl -w kernel.printk=0 + +Next, we need a static network address on our server. The following sequence of commands should find and reconfigure your default network connection appropriately: + +``` +$ MY_DNS1=192.0.2.91 +$ MY_DNS2=192.0.2.92 +$ MY_IP=192.0.2.158 +$ MY_PREFIX=24 +$ MY_GATEWAY=192.0.2.254 +$ DEFAULT_DEV=$(ip route show default | awk '{print $5}') +$ DEFAULT_CON=$(nmcli d show $DEFAULT_DEV | sed -n '/^GENERAL.CONNECTION:/s!.*:\s*!! p') +$ nohup bash << END +nmcli con mod "$DEFAULT_CON" connection.id "$DEFAULT_DEV" +nmcli con mod "$DEFAULT_DEV" connection.interface-name "$DEFAULT_DEV" +nmcli con mod "$DEFAULT_DEV" ipv4.method disabled +nmcli con up "$DEFAULT_DEV" +nmcli con add con-name br0 ifname br0 type bridge +nmcli con mod br0 bridge.stp no +nmcli con mod br0 ipv4.dns $MY_DNS1,$MY_DNS2 +nmcli con mod br0 ipv4.addresses $MY_IP/$MY_PREFIX +nmcli con mod br0 ipv4.gateway $MY_GATEWAY +nmcli con mod br0 ipv4.method manual +nmcli con up br0 +nmcli con add con-name br0-slave0 ifname "$DEFAULT_DEV" type bridge-slave master br0 +nmcli con up br0-slave0 +END +``` + +> NOTE: The last set of commands above is wrapped in a “nohup” script because it will disable networking temporarily. The nohup command should allow the nmcli commands to finish running even while your ssh connection is down. Beware that it may take 10 or so seconds for the connection to come back up and that you will have to start a new ssh connection if you changed the server’s IP address. +> +> NOTE: The above network configuration creates a [network bridge][5] on top of the default connection so that we can run a virtual machine instance directly on the server for testing later. If you do not want to test the netboot image directly on the server, you can skip creating the bridge and set the static IP address directly on your default network connection. + +### Install and Configure NFS4 + +Start by installing the nfs-utils package: + +``` +$ dnf install -y nfs-utils +``` + +Create a top-level [pseudo filesystem][6] for the NFS exports and share it out to your network: + +``` +$ MY_SUBNET=192.0.2.0 +$ mkdir /export +$ echo "/export -fsid=0,ro,sec=sys,root_squash $MY_SUBNET/$MY_PREFIX" > /etc/exports +``` + +SELinux will interfere with the netboot server’s operation. Configuring exceptions for it is beyond the scope of this tutorial, so we will disable it: + +``` +$ sed -i '/GRUB_CMDLINE_LINUX/s/"$/ audit=0 selinux=0"/' /etc/default/grub +$ grub2-mkconfig -o /boot/grub2/grub.cfg +$ sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux +$ setenforce 0 +``` + +> NOTE: Editing the grub command line should not be necessary, but simply editing /etc/sysconfig/selinux proved ineffective across reboots of Fedora Server 28 during testing, so the “selinux=0” flag has been set here to be doubly sure. + +Now, add an exception for the NFS service to the local firewall and start the NFS service: + +``` +$ firewall-cmd --add-service nfs +$ firewall-cmd --runtime-to-permanent +$ systemctl enable nfs-server.service +$ systemctl start nfs-server.service +``` + +### Create the Netboot Image + +Now that our NFS server is up and running, we need to supply it with an operating system image to serve to the client computers. We will start with a very minimal image and add to it after everything is working. + +First, create a new directory where our image will be stored: + +``` +$ mkdir /fc28 +``` + +Use the “dnf” command to build the image under the new directory with only a few base packages: + +``` +$ dnf -y --releasever=28 --installroot=/fc28 install fedora-release systemd passwd rootfiles sudo dracut dracut-network nfs-utils vim-minimal dnf +``` + +It is important that the “kernel” packages were omitted from the above command. Before they are installed, we need to tweak the set of drivers that will be included in the “initramfs” image that is built automatically when the kernel is first installed. In particular, we need to disable “hostonly” mode so that the initramfs image will work on a wider set of hardware platforms and we need to add support for networking and NFS: + +``` +$ echo 'hostonly=no' > /fc28/etc/dracut.conf.d/hostonly.conf +$ echo 'add_dracutmodules+=" network nfs "' > /fc28/etc/dracut.conf.d/netboot.conf +``` + +Now, install the kernel: + +``` +$ dnf -y --installroot=/fc28 install kernel +``` + +Set a rule to prevent the kernel from being updated: + +``` +$ echo 'exclude=kernel-*' >> /fc28/etc/dnf/dnf.conf +``` + +Set the locale: + +``` +$ echo 'LANG="en_US.UTF-8"' > /fc28/etc/locale.conf +``` + +> NOTE: Some programs (e.g. GNOME Terminal) will not function if the locale is not properly configured. + +Blank root’s passwd: + +``` +$ sed -i 's/^root:\*/root:/' /fc28/etc/shadow +``` + +Set the client’s hostname: + +``` +$ MY_CLIENT_HOSTNAME=client-01.example.edu +$ echo $MY_CLIENT_HOSTNAME > /fc28/etc/hostname +``` + +Disable logging to the console: + +``` +$ echo 'kernel.printk = 0 4 1 7' > /fc28/etc/sysctl.d/00-printk.conf +``` + +Define a local “liveuser” in the netboot image: + +``` +$ echo 'liveuser:x:1000:1000::/home/liveuser:/bin/bash' >> /fc28/etc/passwd +$ echo 'liveuser::::::::' >> /fc28/etc/shadow +$ echo 'liveuser:x:1000:' >> /fc28/etc/group +$ echo 'liveuser:!::' >> /fc28/etc/gshadow +``` + +Allow “liveuser” to sudo: + +``` +$ echo 'liveuser ALL=(ALL) NOPASSWD: ALL' > /fc28/etc/sudoers.d/liveuser +``` + +Enable automatic home directory creation: + +``` +$ dnf install -y --installroot=/fc28 authselect oddjob-mkhomedir +$ echo 'dirs /home' > /fc28/etc/rwtab.d/home +$ chroot /fc28 authselect select sssd with-mkhomedir --force +$ chroot /fc28 systemctl enable oddjobd.service +``` + +Since multiple clients will be mounting our image concurrently, we need to configure the image so that it will operate in read-only mode: + +``` +$ sed -i 's/^READONLY=no$/READONLY=yes/' /fc28/etc/sysconfig/readonly-root +``` + +Configure logging to go to RAM rather than permanent storage: + +``` +$ sed -i 's/^#Storage=auto$/Storage=volatile/' /fc28/etc/systemd/journald.conf +``` + +Configure DNS: + +``` +$ MY_DNS1=192.0.2.91 +$ MY_DNS2=192.0.2.92 +$ cat << END > /fc28/etc/resolv.conf +nameserver $MY_DNS1 +nameserver $MY_DNS2 +END +``` + +Work-around a few bugs that exist for read-only root mounts at the time this tutorial is being written ([BZ1542567][7]): + +``` +$ echo 'dirs /var/lib/gssproxy' > /fc28/etc/rwtab.d/gssproxy +$ cat << END > /fc28/etc/rwtab.d/systemd +dirs /var/lib/systemd/catalog +dirs /var/lib/systemd/coredump +END +``` + +Finally, we can create the NFS filesystem for our image and share it out to our subnet: + +``` +$ mkdir /export/fc28 +$ echo '/fc28 /export/fc28 none bind 0 0' >> /etc/fstab +$ mount /export/fc28 +$ echo "/export/fc28 -ro,sec=sys,no_root_squash $MY_SUBNET/$MY_PREFIX" > /etc/exports.d/fc28.exports +$ exportfs -vr +``` + +### Create the Boot Loader + +Now that we have an operating system available to netboot, we need a boot loader to kickstart it on the client systems. For this setup, we will be using [iPXE][8]. + +> NOTE: This section and the following section — Testing with QEMU — can be done on a separate computer; they do not have to be run on the netboot server. + +Install git and use it to download iPXE: + +``` +$ dnf install -y git +$ git clone http://git.ipxe.org/ipxe.git $HOME/ipxe +``` + +Now we need to create a special startup script for our bootloader: + +``` +$ cat << 'END' > $HOME/ipxe/init.ipxe +#!ipxe + +prompt --key 0x02 --timeout 2000 Press Ctrl-B for the iPXE command line... && shell || + +dhcp || exit +set prefix file:///linux +chain ${prefix}/boot.cfg || exit +END +``` + +Enable the “file” download protocol: + +``` +$ echo '#define DOWNLOAD_PROTO_FILE' > $HOME/ipxe/src/config/local/general.h +``` + +Install the C compiler and related tools and libraries: + +``` +$ dnf groupinstall -y "C Development Tools and Libraries" +``` + +Build the boot loader: + +``` +$ cd $HOME/ipxe/src +$ make clean +$ make bin-x86_64-efi/ipxe.efi EMBED=../init.ipxe +``` + +Make note of where the where the newly-compiled boot loader is. We will need it for the next section: + +``` +$ IPXE_FILE="$HOME/ipxe/src/bin-x86_64-efi/ipxe.efi" +``` + +### Testing with QEMU + +This section is optional, but you will need to duplicate the file layout of the [EFI system partition][9] that is shown below on your physical machines to configure them for netbooting. + +> NOTE: You could also copy the files to a TFTP server and reference that server from DHCP if you wanted a fully diskless system. + +In order to test our boot loader with QEMU, we are going to create a small disk image containing only an EFI system partition and our startup files. + +Start by creating the required directory layout for the EFI system partition and copying the boot loader that we created in the previous section to it: + +``` +$ mkdir -p $HOME/esp/efi/boot +$ mkdir $HOME/esp/linux +$ cp $IPXE_FILE $HOME/esp/efi/boot/bootx64.efi +``` + +The below command should identify the kernel version that our netboot image is using and store it in a variable for use in the remaining configuration directives: + +``` +$ DEFAULT_VER=$(ls -c /fc28/lib/modules | head -n 1) +``` + +Define the boot configuration that our client computers will be using: + +``` +$ MY_DNS1=192.0.2.91 +$ MY_DNS2=192.0.2.92 +$ MY_NFS4=server-01.example.edu +$ cat << END > $HOME/esp/linux/boot.cfg +#!ipxe + +kernel --name kernel.efi \${prefix}/vmlinuz-$DEFAULT_VER initrd=initrd.img ro ip=dhcp rd.peerdns=0 nameserver=$MY_DNS1 nameserver=$MY_DNS2 root=nfs4:$MY_NFS4:/fc28 console=tty0 console=ttyS0,115200n8 audit=0 selinux=0 quiet +initrd --name initrd.img \${prefix}/initramfs-$DEFAULT_VER.img +boot || exit +END +``` + +> NOTE: The above boot script shows a minimal example of how to get iPXE to netboot Linux. Much more complex configurations are possible. Most notably, iPXE has support for interactive boot menus which can be configured with a default selection and a timeout. A more advanced iPXE script could, for example, default to booting an operation system from the local disk and only go to the netboot operation if a user pressed a key before a countdown timer reached zero. + +Copy the Linux kernel and its associated initramfs to the EFI system partition: + +``` +$ cp $(find /fc28/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $DEFAULT_VER) $HOME/esp/linux/vmlinuz-$DEFAULT_VER +$ cp $(find /fc28/boot -name 'init*' | grep -m 1 $DEFAULT_VER) $HOME/esp/linux/initramfs-$DEFAULT_VER.img +``` + +Our resulting directory layout should look like this: + +``` +esp +├── efi +│   └── boot +│   └── bootx64.efi +└── linux + ├── boot.cfg + ├── initramfs-4.18.18-200.fc28.x86_64.img + └── vmlinuz-4.18.18-200.fc28.x86_64 +``` + +To use our EFI system partition with QEMU, we need to create a small “uefi.img” disk image containing it and then connect that to QEMU as the primary boot drive. + +Begin by installing the necessary tools: + +``` +$ dnf install -y parted dosfstools +``` + +Now create the “uefi.img” file and copy the files from the “esp” directory into it: + +``` +$ ESP_SIZE=$(du -ks $HOME/esp | cut -f 1) +$ dd if=/dev/zero of=$HOME/uefi.img count=$((${ESP_SIZE}+5000)) bs=1KiB +$ UEFI_DEV=$(losetup --show -f $HOME/uefi.img) +$ parted ${UEFI_DEV} -s mklabel gpt mkpart EFI FAT16 1MiB 100% toggle 1 boot +$ mkfs -t msdos ${UEFI_DEV}p1 +$ mkdir -p $HOME/mnt +$ mount ${UEFI_DEV}p1 $HOME/mnt +$ cp -r $HOME/esp/* $HOME/mnt +$ umount $HOME/mnt +$ losetup -d ${UEFI_DEV} +``` + +> NOTE: On a physical computer, you need only copy the files from the “esp” directory to the computer’s existing EFI system partition. You do not need the “uefi.img” file to boot a physical computer. +> +> NOTE: On a physical computer you can rename the “bootx64.efi” file if a file by that name already exists, but if you do so, you will probably have to edit the computer’s BIOS settings and add the renamed efi file to the boot list. + +Next we need to install the qemu package: + +``` +$ dnf install -y qemu-system-x86 +``` + +Allow QEMU to access the bridge that we created in the “Initial Configuration” section of this tutorial: + +``` +$ echo 'allow br0' > /etc/qemu/bridge.conf +``` + +Create a copy of the “OVMF_VARS.fd” image to store our virtual machine’s persistent BIOS settings: + +``` +$ cp /usr/share/edk2/ovmf/OVMF_VARS.fd $HOME +``` + +Now, start the virtual machine: + +``` +$ qemu-system-x86_64 -machine accel=kvm -nographic -m 1024 -drive if=pflash,format=raw,unit=0,file=/usr/share/edk2/ovmf/OVMF_CODE.fd,readonly=on -drive if=pflash,format=raw,unit=1,file=$HOME/OVMF_VARS.fd -drive if=ide,format=raw,file=$HOME/uefi.img -net bridge,br=br0 -net nic,model=virtio +``` + +If all goes well, you should see results similar to what is shown in the below image: + +![][10] +You can use the “shutdown” command to get out of the virtual machine and back to the server: + +``` +$ sudo shutdown -h now +``` + +> NOTE: If something goes wrong and the virtual machine hangs, you may need to start a new ssh session to the server and use the “kill” command to terminate the “qemu-system-x86_64” process. + +### Adding to the Image + +Adding to the image should be a simple matter of chroot’ing into the image on the server and running “dnf install ”. + +There is no limit to what can be installed on the netboot image. A full graphical installation should function perfectly. + +Here is an example of how to bring our minimal netboot image up to a complete graphical installation: + +``` +$ for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done +$ chroot /fc28 /usr/bin/bash --login +$ dnf -y groupinstall "Fedora Workstation" +$ dnf -y remove gnome-initial-setup +$ systemctl disable sshd.service +$ systemctl enable gdm.service +$ systemctl set-default graphical.target +$ sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux +$ logout +$ for i in run sys proc dev/shm dev/pts dev; do umount /fc28/$i; done +``` + +Optionally, you may want to enable automatic login for the “liveuser” account: + +``` +$ sed -i '/daemon/a AutomaticLoginEnable=true' /fc28/etc/gdm/custom.conf +$ sed -i '/daemon/a AutomaticLogin=liveuser' /fc28/etc/gdm/custom.conf +``` + +#### Like this: + +Like + +Loading... + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Network_booting +[2]: https://dl.fedoraproject.org/pub/fedora/linux/releases/28/Server/x86_64/iso/ +[3]: https://fedoramagazine.org/wp-content/uploads/2018/11/installation-summary-1024x768.png +[4]: https://docs.fedoraproject.org/en-US/Fedora/25/html/Networking_Guide/ch-Configure_Host_Names.html#sec_Understanding_Host_Names +[5]: https://en.wikipedia.org/wiki/Bridging_(networking) +[6]: https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-nfs-server-config-exportfs-nfsv4.html +[7]: https://bugzilla.redhat.com/show_bug.cgi?id=1542567 +[8]: https://ipxe.org/ +[9]: https://en.wikipedia.org/wiki/EFI_system_partition +[10]: https://fedoramagazine.org/wp-content/uploads/2018/11/netboot-liveuser-1024x641.png From 38590c31673f1b97623ebae7769129370e7e509b Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Sun, 25 Nov 2018 00:09:22 +0800 Subject: [PATCH 0437/1143] hankchow translated --- ...9 How To Customize Bash Prompt In Linux.md | 300 ------------------ ...9 How To Customize Bash Prompt In Linux.md | 290 +++++++++++++++++ 2 files changed, 290 insertions(+), 300 deletions(-) delete mode 100644 sources/tech/20181119 How To Customize Bash Prompt In Linux.md create mode 100644 translated/tech/20181119 How To Customize Bash Prompt In Linux.md diff --git a/sources/tech/20181119 How To Customize Bash Prompt In Linux.md b/sources/tech/20181119 How To Customize Bash Prompt In Linux.md deleted file mode 100644 index 267e2b85e2..0000000000 --- a/sources/tech/20181119 How To Customize Bash Prompt In Linux.md +++ /dev/null @@ -1,300 +0,0 @@ -HankChow translating - -How To Customize Bash Prompt In Linux -====== -![](https://www.ostechnix.com/wp-content/uploads/2017/10/BASH-720x340.jpg) - -As you know already, **BASH** (the **B** ourne- **A** gain **Sh** ell) is the default shell for most modern Linux distributions. In this guide, we are going to customize BASH prompt and enhance its look by adding some colors and styles. Of course, there are many plugins/tools available to get this job done easily and quickly. However, we still can do some basic customization, such as adding, modifying elements, changing the foreground and background color etc., without having to install any additional tools and plugins. Let us get started! - -### Customize Bash Prompt In Linux - -In BASH, we can customize and change the BASH prompt as the way you want by changing the value of **PS1** environment variable. - -Usually, the BASH prompt will look something like below: -![](https://www.ostechnix.com/wp-content/uploads/2017/10/Linux-Terminal.png) - -Here, **sk** is my username and **ubuntuserver** is my hostname. - -Now, we are going to change this prompt as per your liking by inserting some backslash-escaped special characters called **Escape Sequences**. - -Let me show you some examples. - -Before going further, it is highly recommended to backup the **~/.bashrc** file. - -``` -$ cp ~/.bashrc ~/.bashrc.bak -``` - -**Modify “[[email protected]][1]” part in the Bash prompt** - -As I mentioned above, the BASH prompt has “[[email protected]][1]” part by default in most Linux distributions. You can change this part to something else. - -To do so, edit **~/.bashrc **file: - -``` -$ vi ~/.bashrc -``` - -Add the following line at the end: - -``` -PS1="ostechnix> " -``` - -Replace “ostechnix” with any letters/words of your choice. Once added, hit the **ESC** key and type **:wq** to save and exit the file. - -Run the following command to update the changes: - -``` -$ source ~/.bashrc -``` - -Now, the BASH prompt will have the letters “ostechnix” in the shell prompt. - -![][3] - -Here is another example. I am going to replace “[[email protected]][1]” part with “[[email protected]][1]>”. - -To do so, add the following entry in your **~./bashrc** file. - -Don’t forget to update the changes using “source ~./bashrc” command. - -Here is the output of my BASH prompt in Ubuntu 18.04 LTS. -![](https://www.ostechnix.com/wp-content/uploads/2017/10/bash-prompt-1.png) - -**Display username only:** - -To display the username only, just add the following line in **~/.bashrc** file. - -``` -export PS1="\u " -``` - -Here, **\u** is the escape sequence. - -Here are some more values to add to your PS1 variable to change the BASH prompt. After adding each entry, you must run “source ~/.bashrc” command to take effect the changes. - -**Add username with hostname:** - -``` -export PS1="\u\h " -``` - -Your prompt will now look like below: - -``` -skubuntuserver -``` - -**Add username and FQDN (Fully Qualified Domain Name):** - -``` -export PS1="\u\H " -``` - -**Add extra characters between username and hostname:** - -If you want to any letter, for example **@** , between the username and hostname, use the following entry: - -``` -export PS1="\u@\h " -``` - -The bash prompt will look like below: -``` -sk@ubuntuserver -``` - -**Add username with hostname with $ symbol at the end:** -``` -export PS1="\u@\h\\$ " -``` - -**Add special characters between and after username and hostname:** -``` -export PS1="\u@\h> " -``` - -This entry will change the BASH prompt as shown below. -``` -sk@ubuntuserver> -``` - -Similarly, you can add other special characters, such as colon, semi-colon, *, underscore, space etc. - -**Display username, hostname, shell name:** -``` -export PS1="\u@\h>\s " -``` - -**Display username, hostname, shell and and its version:** -``` -export PS1="\u@\h>\s\v " -``` - -Bash prompt output: - -![][4] - -Display username, hostname and path to current directory: -``` -export PS1="\u@\h\w " -``` - -You will see a tilde (~) symbol if the current directory is $HOME. - -**Display date in BASH prompt:** - -To display date with your username and hostname in the BASH prompt, add the following entry in ~/.bashrc file. -``` -export PS1="\u@\h>\d " -``` -![][5] - -**Date and time in 12 hour format in BASH prompt:** -``` -export PS1="\u@\h>\d\@ " -``` - -**Date and 12 hour time hh:mm:ss format:** -``` -export PS1="\u@\h>\d\T " -``` - -**Date and 24 hour time:** -``` -export PS1="\u@\h>\d\A " -``` - -**Date and 24 hour hh:mm:ss format:** -``` -export PS1="\u@\h>\d\t " -``` - -These are some common escape sequences to change the Bash prompt format. There are few more escape sequences are available. You can view them all in in the **bash man page** under the **“PROMPTING”** section. - -And, you can view the current prompt settings at any time using command: - -``` -$ echo $PS1 -``` - -**Hide “username@hostname” Part In Bash prompt** - -I don’t want to change anything. Can I hide it altogether? Yes, you can! - -If you’re a blogger or tech writer, there are chances that you have to upload the screenshots of your Linux Terminal in your websites and blogs. Your username/hostname might be too cool, so you may not want others to copy and use them as their own. On the other hand, your username/hostname might be too weird or too bad or contain offensive characters, so you don’t want others to view them. In such cases, this small tip might help you to hide or modify “[[email protected]][1]” part in Terminal. - -If you don’t like to let the users to view your username/hostname part, just follow the steps given below. - -Edit your **“~/.bashrc”** file: - -``` -$ vi ~/.bashrc -``` - -Add the following at the end: - -``` -PS1="\W> " -``` - -Type **:wq** to save and close the file. - -Then, run the following command to take effect the changes. - -``` -$ source ~/.bashrc -``` - -That’s it. Now, check your Terminal. You will not see the [[email protected]][1] part. You will only see the **~ >** symbol. - -![][6] - -Want to know another simplest way without messing the **~/.bashrc** file? Just create another user account something like **[[email protected]][1]** , or **[[email protected]][1]**. Use these accounts for making guides, videos and upload them on your blog or online. Now, you have nothing to worry about your identity. - -**Warning:** This is a bad practice in some cases. For example, if another shells like zsh inherits your current shell, it will cause some problems. Use it only for hiding or modifying your [[email protected]][1] part if you use single shell. Apart from hiding the [[email protected]][1] part in the Terminal, this tip is pretty useless and might be problematic. - -### Colorizing BASH prompt - -What we have seen so far is we just changed/added some elements to the BASH prompt. In this section, we are going to add colors the elements. - -You can enhance the foreground (text) and background color of BASH prompt’s elements by adding some code to the ~/.bashrc file. - -For example, to change the foreground color of all texts to Red, add the following code: -``` -export PS1="\u@\[\e[31m\]\h\[\e[m\] " -``` - -Once added, update the changes using command: - -Now, your BASH prompt will look like below: -![][7] - -Similarly, to change the background color, add this code: -``` -export PS1="\u@\[\e[31;46m\]\h\[\e[m\] " -``` - -![][8] - -### **Adding Emojis** - -Who doesn’t love emoji? We can add an emoji by placing the following code in the ~/.bashrc file. - -``` -PS1="\W 🔥 >" -``` - -Please note that some terminal may not show the emojis properly depending upon the font used. You may see either garbled characters or monochrome emoji if you don’t have suitable fonts. - -### Customizing BASH is bit difficult to me, Is there any other easy way? - -If you’re a newbie, writing and adding PS1 values will be confusing and difficult. Also, you will find it bit difficult to arrange the elements to get the result of your choice. No worries! There is an online Bash PS1 generator available which allows you to easily generate different PS1 values as you wish. - -Go to the following website: - -[![EzPrompt](https://www.ostechnix.com/wp-content/uploads/2017/10/EzPrompt.png)][9] - -Just pick the elements you want to use in your BASH prompt. Add the colors to the elements and re-arrange them in any order of your liking. Preview the output instantly and finally copy/paste resulting code in your **~/.bashrc** file. It is that simple! Most of the examples mentioned in this guide are taken from this website. - - -### I messed up with my .bashrc file? How to restore it to default settings? - -As I mentioned earlier, it is strongly recommended to take backup ~./bashrc (Or any important configuration files in general) before making any changes. So, you can restore it to the previous working version if something went wrong. However if you forgot to backup the ~/.bashrc file in the first place, you still can restore it to the default settings as described in the following guide. - -[How To Restore .bashrc File To Default Settings][10] - -The above guide is based on Ubuntu, but it may applicable to other Linux distributions as well. Please let us be clear that the aforementioned guide will help you to reset ~/.bashrc to its default settings at the time of new installation. Any changes done afterwards will be lost. - -And, that’s all for now. I will keep updating this guide as I learned more ways to customize the BASH prompt in future. - -Hope this helps. More good stuffs to come. Stay tuned! - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/hide-modify-usernamelocalhost-part-terminal/ - -作者:[SK][a] -选题:[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.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/cdn-cgi/l/email-protection -[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[3]: http://www.ostechnix.com/wp-content/uploads/2017/10/Linux-Terminal-2.png -[4]: http://www.ostechnix.com/wp-content/uploads/2017/10/bash-prompt-2.png -[5]: http://www.ostechnix.com/wp-content/uploads/2017/10/bash-prompt-3.png -[6]: http://www.ostechnix.com/wp-content/uploads/2017/10/Linux-Terminal-1.png -[7]: http://www.ostechnix.com/hide-modify-usernamelocalhost-part-terminal/bash-prompt-4/ -[8]: http://www.ostechnix.com/hide-modify-usernamelocalhost-part-terminal/bash-prompt-5/ -[9]: http://ezprompt.net/ -[10]: https://www.ostechnix.com/restore-bashrc-file-default-settings-ubuntu/ diff --git a/translated/tech/20181119 How To Customize Bash Prompt In Linux.md b/translated/tech/20181119 How To Customize Bash Prompt In Linux.md new file mode 100644 index 0000000000..a1f63304f3 --- /dev/null +++ b/translated/tech/20181119 How To Customize Bash Prompt In Linux.md @@ -0,0 +1,290 @@ +在 Linux 上自定义 bash 命令提示符 +====== +![](https://www.ostechnix.com/wp-content/uploads/2017/10/BASH-720x340.jpg) + +众所周知,**bash**(the **B**ourne-**A**gain **Sh**ell)是目前绝大多数 Linux 发行版使用的默认 shell。本文将会介绍如何通过添加颜色和样式来自定义 bash 命令提示符的显示。尽管很多插件或工具都可以很轻易地满足这一需求,但我们也可以不使用插件和工具,自己手动自定义一些基本的显示方式,例如添加或者修改某些元素、更改前景色、更改背景色等等。 + +### 在 Linux 中自定义 bash 命令提示符 + +在 bash 中,我们可以通过更改 `$PS1` 环境变量的值来自定义 bash 命令提示符。 + +一般情况下,bash 命令提示符会是以下这样的形式: +![](https://www.ostechnix.com/wp-content/uploads/2017/10/Linux-Terminal.png) + +在上图这种默认显示形式当中,sk 是我的用户名,而 ubuntuserver 是我的主机名。 + +只要插入一些以反斜杠开头的特殊转义字符串,就可以按照你的喜好修改命令提示符了。下面我来举几个例子。 + +在开始之前,我强烈建议你预先备份 `~/.bashrc` 文件。 + +``` +$ cp ~/.bashrc ~/.bashrc.bak +``` + +#### 更改 bash 命令提示符中的 username@hostname 部分 + +如上所示,bash 命令提示符一般都带有 username@hostname 部分,这个部分是可以修改的。 + +只需要编辑 `~/.bashrc` 文件: + +``` +$ vi ~/.bashrc +``` + +在文件的最后添加一行: + +``` +PS1="ostechnix> " +``` + +将上面的“ostechnix”替换为任意一个你想使用的单词,然后按 `ESC` 并输入 `:wq` 保存、退出文件。 + +执行以下命令使刚才的修改生效: + +``` +$ source ~/.bashrc +``` + +你就可以看见 bash 命令提示符中出现刚才添加的“ostechnix”了。 + +![][3] + +再来看看另一个例子,比如将 username@hostname 替换为 Hello@welcome>。 + +同样是像刚才那样修改 `~/.bashrc` 文件,然后执行 `source ~/.bashrc` 让修改结果立即生效。 + +以下是我在 Ubuntu 18.04 LTS 上修改后的效果。 +![](https://www.ostechnix.com/wp-content/uploads/2017/10/bash-prompt-1.png) + +#### 仅显示用户名 + +如果需要仅显示用户名,只需要在 `~/.bashrc` 文件中加入以下这一行。 + +``` +export PS1="\u " +``` + +这里的 `\u` 就是一个转义字符串。 + +下面提供了一些可以添加到 `$PS1` 环境变量中的用以改变 bash 命令提示符样式的转义字符串。每次修改之后,都需要执行 `source ~/.bashrc` 命令才能立即生效。 + +**显示用户名和主机名:** + +``` +export PS1="\u\h " +``` + +命令提示符会这样显示: + +``` +skubuntuserver +``` + +**显示用户名和完全限定域名Fully Qualified Domain Name(FQDN)** + +``` +export PS1="\u\H " +``` + +**在用户名和主机名之间显示其它字符** + +如果你还需要在用户名和主机名之间显示其它字符(例如 `@`),可以使用以下格式: + +``` +export PS1="\u@\h " +``` + +命令提示符会这样显示: +``` +sk@ubuntuserver +``` + +**显示用户名、主机名,并在末尾添加符号** +``` +export PS1="\u@\h\\$ " +``` + +**综合以上两种显示方式** +``` +export PS1="\u@\h> " +``` + +命令提示符最终会这样显示: +``` +sk@ubuntuserver> +``` + +相似地,还可以添加其它特殊字符,例如冒号、分号、星号、下划线、空格等等。 + +**显示用户名、主机名、shell 名称** +``` +export PS1="\u@\h>\s " +``` + +**显示用户名、主机名、shell 名称以及 shell 版本** +``` +export PS1="\u@\h>\s\v " +``` + +bash 命令提示符显示样式: + +![][4] + +**显示用户名、主机名、当前目录** + +``` +export PS1="\u@\h\w " +``` + +如果当前目录是 `$HOME` ,会以一个波浪线(`~`)显示。 + +**在 bash 命令提示符中显示日期** + +除了用户名和主机名,如果还想在 bash 命令提示符中显示日期,可以在 `~/.bashrc` 文件中添加以下内容: +``` +export PS1="\u@\h>\d " +``` +![][5] + +**在 bash 命令提示符中显示日期及 12 小时制时间** +``` +export PS1="\u@\h>\d\@ " +``` + +**显示日期及 hh:mm:ss 格式时间** +``` +export PS1="\u@\h>\d\T " +``` + +**显示日期及 24 小时制时间** +``` +export PS1="\u@\h>\d\A " +``` + +**显示日期及 24 小时制 hh:mm:ss 格式时间** +``` +export PS1="\u@\h>\d\t " +``` + +以上是一些常见的可以改变 bash 命令提示符的转义字符串。除此以外的其它转义字符串,可以在 bash 的 man 手册 PROMPTING 章节中查阅。 + +你也可以随时执行以下命令查看当前的命令提示符样式。 + +``` +$ echo $PS1 +``` + +#### 在 bash 命令提示符中去掉 username@hostname 部分 + +如果我不想做任何调整,直接把 username@hostname 部分整个去掉可以吗?答案是肯定的。 + +如果你是一个技术方面的博主,你有可能会需要在网站或者博客中上传自己的 Linux 终端截图。或许你的用户名和主机名太拉风、太另类,不想让别人看到,在这种情况下,你就需要隐藏命令提示符中的 username@hostname 部分。 + +如果你不想暴露自己的用户名和主机名,只需要按照以下步骤操作。 + +编辑 `~/.bashrc` 文件: + +``` +$ vi ~/.bashrc +``` + +在文件末尾添加这一行: + +``` +PS1="\W> " +``` + +输入 `:wq` 保存并关闭文件。 + +执行以下命令让修改立即生效。 + +``` +$ source ~/.bashrc +``` + +现在看一下你的终端,username@hostname 部分已经消失了,只保留了一个 `~>` 标记。 + +![][6] + +如果你想要尽可能简单的操作,又不想弄乱你的 `~/.bashrc` 文件,最好的办法就是在系统中创建另一个用户(例如 user@example、admin@demo)。用带有这样的命令提示符的用户去截图或者录屏,就不需要顾虑自己的用户名或主机名被别人看见了。 + +**警告:**在某些情况下,这种做法并不推荐。例如像 zsh 这种 shell 会继承当前 shell 的设置,这个时候可能会出现一些意想不到的问题。这个技巧只用于隐藏命令提示符中的 username@hostname 部分,仅此而已,如果把这个技巧挪作他用,也可能会出现异常。 + +### 为 bash 命令提示符着色 + +目前我们也只是变更了 bash 命令提示符中的内容,下面介绍一下如何对命令提示符进行着色。 + +通过向 `~/.bashrc` 文件写入一些配置,可以修改 bash 命令提示符的前景色(也就是文本的颜色)和背景色。 + +例如,下面这一行配置可以令某些文本的颜色变成红色: +``` +export PS1="\u@\[\e[31m\]\h\[\e[m\] " +``` + +添加配置后,执行 `source ~/.bashrc` 立即生效。 + +你的 bash 命令提示符就会变成这样: +![][7] + +类似地,可以用这样的配置来改变背景色: +``` +export PS1="\u@\[\e[31;46m\]\h\[\e[m\] " +``` + +![][8] + +### 添加 emoji + +大家都喜欢 emoji。还可以按照以下配置把 emoji 插入到命令提示符中。 + +``` +PS1="\W 🔥 >" +``` + +需要注意的是,emoji 的显示取决于使用的字体,因此某些终端可能会无法正常显示 emoji,取而代之的是一些乱码或者单色表情符号。 + +### 自定义 bash 命令提示符有点难,有更简单的方法吗? + +如果你是一个新手,编辑 `$PS1` 环境变量的过程可能会有些困难,因为命令提示符中的大量转义字符串可能会让你有点晕头转向。但不要担心,有一个在线的 bash `$PS1` 生成器可以帮助你轻松生成各种 `$PS1` 环境变量值。 + +就是这个网站: + +[![EzPrompt](https://www.ostechnix.com/wp-content/uploads/2017/10/EzPrompt.png)][9] + +只需要直接选择你想要的 bash 命令提示符样式,添加颜色、设计排序,然后就完成了。你可以预览输出,并将配置代码复制粘贴到 `~/.bashrc` 文件中。就这么简单。顺便一提,本文中大部分的示例都是通过这个网站制作的。 + + +### 我把我的 `~/.bashrc` 文件弄乱了,该如何恢复? + +正如我在上面提到的,强烈建议在更改 `~/.bashrc` 文件前做好备份(在更改其它重要的配置文件之前也一定要记得备份)。这样一旦出现任何问题,你都可以很方便地恢复到更改之前的配置状态。当然,如果你忘记了备份,还可以按照下面这篇文章中介绍的方法恢复为默认配置。 + +[如何将 `~/.bashrc` 文件恢复到默认配置][10] + +这篇文章是基于 ubuntu 的,但也适用于其它的 Linux 发行版。不过事先声明,这篇文章的方法会将 `~/.bashrc` 文件恢复到系统最初时的状态,你对这个文件做过的任何修改都将丢失。 + +感谢阅读! + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/hide-modify-usernamelocalhost-part-terminal/ + +作者:[SK][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/cdn-cgi/l/email-protection +[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[3]: http://www.ostechnix.com/wp-content/uploads/2017/10/Linux-Terminal-2.png +[4]: http://www.ostechnix.com/wp-content/uploads/2017/10/bash-prompt-2.png +[5]: http://www.ostechnix.com/wp-content/uploads/2017/10/bash-prompt-3.png +[6]: http://www.ostechnix.com/wp-content/uploads/2017/10/Linux-Terminal-1.png +[7]: http://www.ostechnix.com/hide-modify-usernamelocalhost-part-terminal/bash-prompt-4/ +[8]: http://www.ostechnix.com/hide-modify-usernamelocalhost-part-terminal/bash-prompt-5/ +[9]: http://ezprompt.net/ +[10]: https://www.ostechnix.com/restore-bashrc-file-default-settings-ubuntu/ + From 292d4e214bc0fee20bed565e0136b9db8517dc49 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Sat, 24 Nov 2018 17:00:26 +0000 Subject: [PATCH 0438/1143] Revert "translating by Flowsnow" This reverts commit ee02cf201a9fa439119fa8786e33947fa2627021. --- ...20180928 Quiet log noise with Python and machine learning.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/tech/20180928 Quiet log noise with Python and machine learning.md b/sources/tech/20180928 Quiet log noise with Python and machine learning.md index 79894775ed..f1fe2f1b7f 100644 --- a/sources/tech/20180928 Quiet log noise with Python and machine learning.md +++ b/sources/tech/20180928 Quiet log noise with Python and machine learning.md @@ -1,5 +1,3 @@ -translating by Flowsnow - Quiet log noise with Python and machine learning ====== From da09150162d8a4b8b6a531b3887265b70083cce9 Mon Sep 17 00:00:00 2001 From: Bestony <13283837+bestony@users.noreply.github.com> Date: Sun, 25 Nov 2018 10:07:20 +0800 Subject: [PATCH 0439/1143] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对:An introduction to the Django Python web app framework --- ... to the Django Python web app framework.md | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/translated/tech/20180816 An introduction to the Django Python web app framework.md b/translated/tech/20180816 An introduction to the Django Python web app framework.md index dc9fd20449..294f5db920 100644 --- a/translated/tech/20180816 An introduction to the Django Python web app framework.md +++ b/translated/tech/20180816 An introduction to the Django Python web app framework.md @@ -3,17 +3,17 @@ Python Web 应用程序 Django 框架简介 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web-spider-frame-framework.png?itok=Rl2AG2Dc) -在本系列(由四部分组成)的前三篇文章中,我们讨论了 [Pyramid][1], [Flask][2] 和 [Tornado][3] 这 3 个 Web 框架。我们已经构建了三次相同的应用程序,最终我们遇到了 [Django][4]。总的来说,Django 是目前 Python 开发人员使用的主要 Web 框架,并且不难看出原因。它擅长隐藏大量的配置逻辑,让你专注于能过够快速构建大型应用程序。 +在本系列(由四部分组成)的前三篇文章中,我们讨论了 [Pyramid][1], [Flask][2] 和 [Tornado][3] 这 3 个 Web 框架。我们已经构建了三次相同的应用程序,最终我们遇到了 [Django][4]。总的来说,Django 是目前 Python 开发人员使用的主要 Web 框架,并且不难看出原因。它擅长隐藏大量的配置逻辑,让你专注于能够快速构建大型应用程序。 也就是说,当涉及到小型项目时,比如我们的待办事项列表应用程序,Django 可能有点像用消防水管来进行水枪大战。让我们来看看它们是如何结合在一起的。 ### 关于 Django -Django 将自己定位为“一个高级的 Python Web 框架,它鼓励快速开发和干净,实用的设计。它由经验丰富的开发人员构建,解决了 Web 开发的很多麻烦,因此你可以专注于编写应用程序而无需重新发明轮子”。它真的做到了!这个庞大的 Web 框架附带了非常多的工具,通常在开发过程中,如何将所有内容组合在一起协同工作可能是个谜。 +Django 将自己定位为“一个鼓励快速开发、整洁、实用的设计、高级的 Python Web 框架。它由经验丰富的开发人员构建,解决了 Web 开发的很多麻烦,因此你可以专注于编写应用程序而无需重新发明轮子”。它真的做到了!这个庞大的 Web 框架附带了非常多的工具,以至于在开发过程中,如何将所有内容组合在一起协同工作可能是个谜。 -除了框架本身很大,Django 社区也是非常庞大的。事实上,它非常庞大和活跃,以至于有[一个网站][5]致力于为人们收集第三方包,这些第三方包可集成进 Django 来做一大堆事情。包括从身份验证和授权到完全基于 Django 的内容管理系统,电子商务附加组件以及与 Stripe(译注:美版“支付宝”)集成的所有内容。关于不要重新发明轮子:如果你想用 Django 完成一些事情,有人可能已经做过了,你只需将它集成进你的项目就行。 +除了框架本身很大,Django 社区也是非常庞大的。事实上,它非常庞大和活跃,以至于有[一个网站][5]致力于为人们收集第三方包,这些第三方包可集成进 Django 来做一大堆事情。包括从身份验证和授权到完全基于 Django 的内容管理系统,电子商务附加组件以及与 Stripe(译注:美版“支付宝”)集成的所有内容。至于不要重新发明轮子:如果你想用 Django 完成一些事情,有人可能已经做过了,你只需将它集成进你的项目就行。 -为此,我们希望使用 Django 构建 REST API,因此我们将利用流行的 [Django REST framework][6]。它的工作是将 Django 框架(Django 使用自己的模板引擎构建 HTML 页面)转换为专门用于有效地处理 REST 交互的系统。让我们开始吧。 +为此,我们希望使用 Django 构建 REST API,因此我们将使用流行的 [Django REST framework][6]。它的工作是将 Django 框架(Django 使用自己的模板引擎构建 HTML 页面)转换为专门用于有效地处理 REST 交互的系统。让我们开始吧。 ### Django 启动和配置 @@ -52,13 +52,13 @@ manage.py   django_todo ``` -`manage.py` 是一个可执行命令行 Python 文件,它最终成为 `django-admin` 的装饰器(to 校正:这里装饰器只是一个语义上的称呼,与 Python 的装饰器不同)。因此,它的工作与 `django-admin` 是一样的:帮助我们管理项目。因此得名 `manage.py`。 +`manage.py` 是一个可执行命令行 Python 文件,它最终成为 `django-admin` 的封装。因此,它的工作与 `django-admin` 是一样的:帮助我们管理项目。因此得名 `manage.py`。 它在 `django_todo` 目录里创建了一个新目录 `django_todo`,其代表了我们项目的配置根目录。现在让我们深入研究一下。 ### 配置 Django -可以将 `django_todo` 目录称为“配置根”,我们的意思是这个目录包含了通常配置 Django 项目所需的文件。几乎所有这个目录之外的内容都只关注与项目模型,视图,路由等相关的“业务逻辑”。所有连接项目的点都将在这里出现。 +可以将 `django_todo` 目录称为“配置根目录”,我们的意思是这个目录包含了通常配置 Django 项目所需的文件。几乎所有这个目录之外的内容都只关注与项目模型,视图,路由等相关的“业务逻辑”。所有连接项目的点都将在这里出现。 在 `django_todo` 目录中调用 `ls` 会显示以下四个文件: ``` @@ -88,7 +88,7 @@ __init__.py settings.py urls.py     wsgi.py * `DEBUG` 告诉 Django 是以开发模式还是生产模式运行项目。这是一个非常关键的区别。 - * 在开发模式下,当弹出一个错误时,Django 将显示导致错误的完整堆栈跟踪,以及运行项目所涉及的所有设置和配置。如果在生产环境中将 `DEBUG` 设置为 `True`,这可能是一个巨大的安全问题。 + * 在开发模式下,当弹出一个错误时,Django 将显示导致错误的完整堆栈跟踪,以及运行项目所涉及的所有设置和配置。如果在生产环境中将 `DEBUG` 设置为 `True`,这可能成为一个巨大的安全问题。 * 在生产模式下,当出现问题时,Django 会显示一个简单的错误页面,即除错误代码外不提供任何信息。 @@ -121,11 +121,11 @@ __init__.py settings.py urls.py     wsgi.py * `TIME_ZONE` 是我们 Django 项目后中自动生成的时间戳的时区。我强调坚持使用 UTC 并在其它地方执行任何特定于时区的处理,而不是尝试重新配置此设置。正如[这篇文章][12] 所述,UTC 是所有时区的共同点,因为不需要担心偏移。如果偏移很重要,我们可以根据需要使用与 UTC 的适当偏移来计算它们。 - * `USE_I18N` 将让 Django 使用自己的翻译服务来为前端翻译字符串。I18N = 国际化(“i” 和 “n” 之间的 18 个字符)。 + * `USE_I18N` 将让 Django 使用自己的翻译服务来为前端翻译字符串。I18N = 国际化(internationalization,“i” 和 “n” 之间共 18 个字符)。 - * `USE_L10N` (L10N = 本地化[在 "l" 和 "n" 之间有 10 个字符]) 如果设置为 `True`,那么将使用数据的公共本地格式。一个很好的例子是日期:在美国它是 MM-DD-YYYY。在欧洲,日期往往写成 DD-MM-YYYY。 + * `USE_L10N` (L10N = 本地化[localization,在 "l" 和 "n" 之间共 10 个字符]) 如果设置为 `True`,那么将使用数据的公共本地格式。一个很好的例子是日期:在美国它是 MM-DD-YYYY。在欧洲,日期往往写成 DD-MM-YYYY。 - * `STATIC_URL` 是用于提供静态文件的大量设置的一部分。我们将构建一个 REST API,因此我们不需要担心静态文件。通常,这会为每个静态文件的域名设置根路径。所以,如果我们有一个徽标图像,那就是 `http:////logo.gif`。 + * `STATIC_URL` 是用于提供静态文件的大量设置的一部分。我们将构建一个 REST API,因此我们不需要担心静态文件。通常,这会为每个静态文件的域名设置根路径。所以,如果我们有一个 Logo 图像,那就是 `http:////logo.gif`。 默认情况下,这些设置已准备就绪。我们必须改变的一个选项是 `DATABASES` 设置。首先,我们创建将要使用的数据库: ``` @@ -169,7 +169,7 @@ DATABASES = { ``` -在继续之前,请确保设置环境变量或 Django 不起作用(to 校正:这里不清楚原文的意思,什么叫 django 不起作用)。此外,我们需要在此环境中安装 `psycopg2`,以便我们可以与数据库通信。 +在继续之前,请确保设置环境变量,否则 Django 将不起作用。此外,我们需要在此环境中安装 `psycopg2`,以便我们可以与数据库通信。 ### Django 路由和视图 @@ -313,17 +313,17 @@ Django REST Framework 希望我们在使用浏览器浏览时拥有一个人性 现在让我们来创建数据模型吧。 -Django 项目的整个基础架构都是围绕数据模型构建的,它是这样编写的,因此每个数据模型够可以拥有自己的小天地,拥有自己的视图,自己与其资源相关的 URL 集合,甚至是自己的测试(如果我们需要(to 校正:这里???))。 +Django 项目的整个基础架构都是围绕数据模型构建的,它是这样编写的,因此每个数据模型够可以拥有自己的小天地,拥有自己的视图,自己与其资源相关的 URL 集合,甚至是自己的测试(如果我们如此想要)。 -如果我们想构建一个简单的 Django 项目,我们可以通过在 `django_todo` 目录中编写我们自己的 `models.py` 文件并将其导入我们的视图来避免这种情况。但是,我们试图以“正确”的方式编写 Django 项目,因此我们应该尽可能地将模型分成 Django 方式的包(to 校正:这里 Django Way™ 有点懵)。 +如果我们想构建一个简单的 Django 项目,我们可以通过在 `django_todo` 目录中编写我们自己的 `models.py` 文件并将其导入我们的视图来避免这种情况。但是,我们试图以“正确”的方式编写 Django 项目,因此我们应该尽可能地将模型拆分成符合 Django Way™(Django 风格)的包。 Django Way 涉及创建所谓的 Django “apps”,它本身并不是单独的应用程序,它们没有自己的设置和诸如此类的东西(虽然它们也可以)。但是,它们可以拥有一个人们可能认为属于独立应用程序的东西: - * 一组自包含的 URL - * 一组自包含的 HTML 模板(如果我们想要提供 HTML) + * 一组自建的 URL + * 一组自建的 HTML 模板(如果我们想要提供 HTML) * 一个或多个数据模型 - * 一套自包含的视图 - * 一套自包含的测试 + * 一套自建的视图 + * 一套自建的测试 它们是独立的,因此可以像独立应用程序一样轻松共享。实际上,Django REST Framework 是 Django app 的一个例子。它包含自己的视图和 HTML 模板,用于提供我们的 JSON。我们只是利用这个 Django app 将我们的项目变成一个全面的 RESTful API 而不用那么麻烦。 @@ -353,11 +353,11 @@ __init__.py admin.py    apps.py     migrations  models.py   tests.py     * `__init__.py` 是空文件。它之所以存在是因为此目录可看作是模型,视图等的有效导入路径。 - * `admin.py` 不是空文件。它用于在 Django admin 中格式化(to 校正:格式化可能欠妥)这个应用程序的模型,我们在本文中没有涉及到它。 + * `admin.py` 不是空文件。它用于在 Django admin 中规范化这个应用程序的模型,我们在本文中没有涉及到它。 - * `apps.py` 这里基本不起作用。它有助于格式化 Django admin 的模型。 + * `apps.py` 这里基本不起作用。它有助于规范化 Django admin 的模型。 - * `migrations` 是一个包含我们数据模型快照的目录。它用于更新数据库。这是内置数据库管理的少数几个框架之一,其中一部分允许我们更新数据库,而不必拆除它并重建它以更改模式。 + * `migrations` 是一个包含我们数据模型快照的目录。它用于更新数据库。这是内置数据库管理的少数几个框架之一,其中一部分允许我们更新数据库,而不必拆除它并重建它以更改 Schema。 * `models.py` 是数据模型所在。 @@ -661,8 +661,7 @@ Please select a fix:   2. 将一个默认值添加到 `Task` 对象的 `owner` 字段   3. 允许任务为 `owner` 字段设置 `NULL` 值 -方案 2 在这里没有多大意义。我们建议,任何创建的 `Task`,默认情况下都会对应到某个默认所有者,尽管不一定存在。(to 校正:后面这句发意义在哪里?既然它已经说了方案 2 没有意义) - +方案 2 在这里没有多大意义。我们建议,默认情况下,任何创建的 `Task`都会对应到某个默认所有者,尽管默认所有者不一定存在。 方案 1 要求我们销毁和重建我们的迁移,而我们应该把它们留下。 让我们考虑选项 3。在这种情况下,如果我们允许 `Task` 表为所有者提供空值,它不会很糟糕。从这一点开始创建的任何任务都必然拥有一个所有者。如果你的数据库表不是一个可重新架构的情况下,请删除迁移,删除表并重建迁移。 @@ -1180,7 +1179,7 @@ Django 作为一个框架是高度可定制的,每个人都有自己的方式 Django 旨在处理多种模型,这些模型涵盖了不同的项目领域,但它们可能有一些共同点。这个项目是一个小型的双模型项目,有一些路由。如果我们要构建更多,我们只有七条路由,但仍然是相同的两个模型。这还不足以证明一个完整的 Django 项目。 -如果我们期望这个项目能够扩展,那将是一个很好的选择。这不是其中一个项目。这是选择一个点燃蜡烛的火焰喷射器。这是绝对的矫枉过正。(to 校正:这里有点迷糊) +如果我们期望这个项目能够拓展,那么将会是一个很好的选择。如果不是其中一个项目,这就是使用火焰喷射器来点燃蜡烛,绝对是矫枉过正了。 尽管如此,Web 框架仍然是一个 Web 框架,无论你使用哪个框架。它都可以接收请求并做出任何响应,因此你可以按照自己的意愿进行操作。只需要注意你选择的框架所带来的开销。 @@ -1194,7 +1193,7 @@ via: https://opensource.com/article/18/8/django-framework 作者:[Nicholas Hunt-Walker][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[Bestony](https://github.com/bestony) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ac4f86018c0b1d9edf9507c3428336c0b59a4cee Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 10:28:28 +0800 Subject: [PATCH 0440/1143] PRF:20181008 Play Windows games on Fedora with Steam Play and Proton.md @hopefully2333 --- ...es on Fedora with Steam Play and Proton.md | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/translated/tech/20181008 Play Windows games on Fedora with Steam Play and Proton.md b/translated/tech/20181008 Play Windows games on Fedora with Steam Play and Proton.md index 26d315f64b..c0859f1dc1 100644 --- a/translated/tech/20181008 Play Windows games on Fedora with Steam Play and Proton.md +++ b/translated/tech/20181008 Play Windows games on Fedora with Steam Play and Proton.md @@ -3,7 +3,7 @@ ![](https://fedoramagazine.org/wp-content/uploads/2018/09/steam-proton-816x345.jpg) -几周前,Steam 宣布要给 Steam Play 增加一个新组件,用于支持在 Linux 平台上使用 Proton 来玩 Windows 的游戏,这个组件是 WINE 的一个分支。这个功能仍然处于测试阶段,且并非对所有游戏都有效。这里有一些关于 Steam 和 Proton 的细节。 +之前,Steam [宣布][1]要给 Steam Play 增加一个新组件,用于支持在 Linux 平台上使用 Proton 来玩 Windows 的游戏,这个组件是 WINE 的一个分支。这个功能仍然处于测试阶段,且并非对所有游戏都有效。这里有一些关于 Steam 和 Proton 的细节。 据 Steam 网站称,测试版本中有以下这些新功能: @@ -13,29 +13,27 @@ * 改进了对游戏控制器的支持,游戏自动识别所有 Steam 支持的控制器,比起游戏的原始版本,能够获得更多开箱即用的控制器兼容性。 * 和 vanilla WINE 比起来,游戏的多线程性能得到了极大的提高。 - - ### 安装 如果你有兴趣,想尝试一下 Steam 和 Proton。请按照下面这些简单的步骤进行操作。(请注意,如果你已经安装了最新版本的 Steam,可以忽略启用 Steam 测试版这个第一步。在这种情况下,你不再需要通过 Steam 测试版来使用 Proton。) -打开 Steam 并登陆到你的帐户,这个截屏示例显示的是在使用 Proton 之前仅支持22个游戏。 +打开 Steam 并登陆到你的帐户,这个截屏示例显示的是在使用 Proton 之前仅支持 22 个游戏。 ![][3] -现在点击客户端顶部的 Steam 选项,这会显示一个下拉菜单。然后选择设置。 +现在点击客户端顶部的 “Steam” 选项,这会显示一个下拉菜单。然后选择“设置”。 ![][4] -现在弹出了设置窗口,选择账户选项,并在 Beta participation 旁边,点击更改。 +现在弹出了设置窗口,选择“账户”选项,并在 “参与 Beta 测试” 旁边,点击“更改”。 ![][5] -现在将 None 更改为 Steam Beta Update。 +现在将 “None” 更改为 “Steam Beta Update”。 ![][6] -点击确定,然后系统会提示你重新启动。 +点击“确定”,然后系统会提示你重新启动。 ![][7] @@ -43,11 +41,11 @@ ![][8] -在重新启动之后,返回到上面的设置窗口。这次你会看到一个新选项。确定有为提供支持的游戏使用 Stream Play 这个复选框,让所有的游戏都使用 Steam Play 进行运行,而不是 steam 中游戏特定的选项。兼容性工具应该是 Proton。 +在重新启动之后,返回到上面的设置窗口。这次你会看到一个新选项。确定勾选了“为提供支持的游戏使用 Stream Play” 、“让所有的游戏都使用 Steam Play 运行”,“使用这个工具替代 Steam 中游戏特定的选项”。这个兼容性工具应该就是 Proton。 ![][9] -Steam 客户端会要求你重新启动,照做,然后重新登陆你的 Steam 账户,你的 Linux 的游戏库就能得到扩展了。 +Steam 客户端会要求你重新启动,照做,然后重新登录你的 Steam 账户,你的 Linux 的游戏库就能得到扩展了。 ![][10] @@ -69,7 +67,7 @@ Steam 客户端会要求你重新启动,照做,然后重新登陆你的 Stea ![][16] -一些游戏可能会受到 Proton 测试性质的影响,在下面这个叫 Chantelise 游戏中,没有了声音并且帧率很低。请记住这个功能仍然在测试阶段,Fedora 不会对结果负责。如果你想要了解更多,社区已经创建了一个 Google 文档,这个文档里有已经测试过的游戏的列表。 +一些游戏可能会受到 Proton 测试性质的影响,在这个叫 Chantelise 游戏中,没有了声音并且帧率很低。请记住这个功能仍然在测试阶段,Fedora 不会对结果负责。如果你想要了解更多,社区已经创建了一个 Google 文档,这个文档里有已经测试过的游戏的列表。 -------------------------------------------------------------------------------- @@ -79,25 +77,25 @@ via: https://fedoramagazine.org/play-windows-games-steam-play-proton/ 作者:[Francisco J. Vergara Torres][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[hopefully2333](https://github.com/hopefully2333) -校对:[校对者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/patxi/ [1]: https://steamcommunity.com/games/221410/announcements/detail/1696055855739350561 [2]: https://fedoramagazine.org/third-party-repositories-fedora/ -[3]: https://fedoramagazine.org/wp-content/uploads/2018/09/listOfGamesLinux-300x197.png -[4]: https://fedoramagazine.org/wp-content/uploads/2018/09/1-300x169.png -[5]: https://fedoramagazine.org/wp-content/uploads/2018/09/2-300x196.png -[6]: https://fedoramagazine.org/wp-content/uploads/2018/09/4-300x272.png -[7]: https://fedoramagazine.org/wp-content/uploads/2018/09/6-300x237.png -[8]: https://fedoramagazine.org/wp-content/uploads/2018/09/7-300x126.png -[9]: https://fedoramagazine.org/wp-content/uploads/2018/09/10-300x237.png -[10]: https://fedoramagazine.org/wp-content/uploads/2018/09/12-300x196.png -[11]: https://fedoramagazine.org/wp-content/uploads/2018/09/13-300x196.png -[12]: https://fedoramagazine.org/wp-content/uploads/2018/09/14-300x195.png -[13]: https://fedoramagazine.org/wp-content/uploads/2018/09/15-300x196.png -[14]: https://fedoramagazine.org/wp-content/uploads/2018/09/16-300x195.png -[15]: https://fedoramagazine.org/wp-content/uploads/2018/09/Screenshot-from-2018-08-30-15-14-59-300x169.png -[16]: https://fedoramagazine.org/wp-content/uploads/2018/09/Screenshot-from-2018-08-30-15-19-34-300x169.png +[3]: https://fedoramagazine.org/wp-content/uploads/2018/09/listOfGamesLinux-768x505.png +[4]: https://fedoramagazine.org/wp-content/uploads/2018/09/1-768x432.png +[5]: https://fedoramagazine.org/wp-content/uploads/2018/09/2-768x503.png +[6]: https://fedoramagazine.org/wp-content/uploads/2018/09/4.png +[7]: https://fedoramagazine.org/wp-content/uploads/2018/09/6.png +[8]: https://fedoramagazine.org/wp-content/uploads/2018/09/7.png +[9]: https://fedoramagazine.org/wp-content/uploads/2018/09/10.png +[10]: https://fedoramagazine.org/wp-content/uploads/2018/09/12-768x503.png +[11]: https://fedoramagazine.org/wp-content/uploads/2018/09/13-768x501.png +[12]: https://fedoramagazine.org/wp-content/uploads/2018/09/14-768x498.png +[13]: https://fedoramagazine.org/wp-content/uploads/2018/09/15-768x501.png +[14]: https://fedoramagazine.org/wp-content/uploads/2018/09/16-768x500.png +[15]: https://fedoramagazine.org/wp-content/uploads/2018/09/Screenshot-from-2018-08-30-15-14-59-768x432.png +[16]: https://fedoramagazine.org/wp-content/uploads/2018/09/Screenshot-from-2018-08-30-15-19-34-768x432.png [17]: https://docs.google.com/spreadsheets/d/1DcZZQ4HL_Ol969UbXJmFG8TzOHNnHoj8Q1f8DIFe8-8/edit#gid=1003113831 From d5b168ff8423089d9355522c324971952a570d0b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 10:28:54 +0800 Subject: [PATCH 0441/1143] PUB:20181008 Play Windows games on Fedora with Steam Play and Proton.md @hopefully2333 https://linux.cn/article-10271-1.html --- ...008 Play Windows games on Fedora with Steam Play and Proton.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181008 Play Windows games on Fedora with Steam Play and Proton.md (100%) diff --git a/translated/tech/20181008 Play Windows games on Fedora with Steam Play and Proton.md b/published/20181008 Play Windows games on Fedora with Steam Play and Proton.md similarity index 100% rename from translated/tech/20181008 Play Windows games on Fedora with Steam Play and Proton.md rename to published/20181008 Play Windows games on Fedora with Steam Play and Proton.md From 854062ea10d85509f38b8bb3c608b6e7dab76f30 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 10:42:07 +0800 Subject: [PATCH 0442/1143] PRF:20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md @HankChow --- ...ncrypted Notepad To Save Your Notes Online.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/translated/tech/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md b/translated/tech/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md index 60b53cca9a..99a92d917b 100644 --- a/translated/tech/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md +++ b/translated/tech/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md @@ -1,18 +1,19 @@ ProtectedText:一个免费的在线加密笔记 ====== + ![](https://www.ostechnix.com/wp-content/uploads/2018/11/protected-text-720x340.png) -记录笔记是我们每个人必备的重要技能,它可以帮助我们把自己听到、读到、学到的内容长期地保留下来,也有很多的应用和工具都能让我们更好地记录笔记。下面我要介绍一个叫做 **ProtectedText** 的应用,一个可以将你的笔记在线上保存起来的免费的加密笔记。它是一个免费的 web 服务,在上面记录文本以后,它将会对文本进行加密,只需要一台支持连接到互联网并且拥有 web 浏览器的设备,就可以访问到记录的内容。 +记录笔记是我们每个人必备的重要技能,它可以帮助我们把自己听到、读到、学到的内容长期地保留下来,也有很多的应用和工具都能让我们更好地记录笔记。下面我要介绍一个叫做 **ProtectedText** 的应用,这是一个可以将你的笔记在线上保存起来的免费的加密笔记。它是一个免费的 web 服务,在上面记录文本以后,它将会对文本进行加密,只需要一台支持连接到互联网并且拥有 web 浏览器的设备,就可以访问到记录的内容。 ProtectedText 不会向你询问任何个人信息,也不会保存任何密码,没有广告,没有 Cookies,更没有用户跟踪和注册流程。除了拥有密码能够解密文本的人,任何人都无法查看到笔记的内容。而且,使用前不需要在网站上注册账号,写完笔记之后,直接关闭浏览器,你的笔记也就保存好了。 ### 在加密笔记本上记录笔记 -访问 这个链接,就可以打开 ProtectedText 页面了。这个时候你将进入网站主页,接下来需要在页面上的输入框输入一个你想用的名称,或者在地址栏后面直接加上想用的名称。这个名称是一个自定义的名称(例如 ),是你查看自己保存的笔记的专有入口。 +访问 这个链接,就可以打开 ProtectedText 页面了(LCTT 译注:如果访问不了,你知道的)。这个时候你将进入网站主页,接下来需要在页面上的输入框输入一个你想用的名称,或者在地址栏后面直接加上想用的名称。这个名称是一个自定义的名称(例如 ),是你查看自己保存的笔记的专有入口。 ![](https://www.ostechnix.com/wp-content/uploads/2018/11/Protected-Text-1.png) -如果你选用的名称还没有被占用,你就会看到下图中的提示信息。点击“Create”键就可以创建你的个人笔记页了。 +如果你选用的名称还没有被占用,你就会看到下图中的提示信息。点击 “Create” 键就可以创建你的个人笔记页了。 ![](https://www.ostechnix.com/wp-content/uploads/2018/11/Protected-Text-2.png) @@ -20,11 +21,11 @@ ProtectedText 不会向你询问任何个人信息,也不会保存任何密码 ProtectedText 使用 AES 算法对你的笔记内容进行加密和解密,而计算散列则使用了 SHA512 算法。 -笔记记录完毕以后,点击顶部的“Save”键保存。 +笔记记录完毕以后,点击顶部的 “Save” 键保存。 ![](https://www.ostechnix.com/wp-content/uploads/2018/11/Protected-Text-3.png) -按下保存键之后,ProtectedText 会提示你输入密码以加密你的笔记内容。按照它的要求输入两次密码,然后点击“Save”键。 +按下保存键之后,ProtectedText 会提示你输入密码以加密你的笔记内容。按照它的要求输入两次密码,然后点击 “Save” 键。 ![](https://www.ostechnix.com/wp-content/uploads/2018/11/Protected-Text-4.png) @@ -45,15 +46,12 @@ ProtectedText 还有配套的 [Android 应用][6] 可以让你在移动设备上 * 存储的内容没有到期时间,只要你愿意,笔记内容可以一直保存在服务器上 * 可以让你的数据限制为私有或公开开放 - - **缺点** * 尽管客户端代码是公开的,但服务端代码并没有公开,因此你无法自行搭建一个类似的服务。如果你不信任这个网站,请不要使用。 * 由于网站不存储你的任何个人信息,包括你的密码,因此如果你丢失了密码,数据将永远无法恢复。网站方还声称他们并不清楚谁拥有了哪些数据,所以一定要牢记密码。 - 如果你想通过一种简单的方式将笔记保存到线上,并且需要在不需要安装任何工具的情况下访问,那么 ProtectedText 会是一个好的选择。如果你还知道其它类似的应用程序,欢迎在评论区留言! @@ -65,7 +63,7 @@ via: https://www.ostechnix.com/protectedtext-a-free-encrypted-notepad-to-save-yo 作者:[SK][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 908cc0fbf1c1b31d9719d1c8f4721288f7086aab Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 10:42:32 +0800 Subject: [PATCH 0443/1143] PUB:20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md @HankChow https://linux.cn/article-10272-1.html --- ...edText - A Free Encrypted Notepad To Save Your Notes Online.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md (100%) diff --git a/translated/tech/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md b/published/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md similarity index 100% rename from translated/tech/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md rename to published/20181114 ProtectedText - A Free Encrypted Notepad To Save Your Notes Online.md From e38f9e17d05ff3e69ff36aaeadd5e238765aab82 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 12:02:47 +0800 Subject: [PATCH 0444/1143] PRF:20180907 6.828 lab tools guide.md @qhwdw --- .../tech/20180907 6.828 lab tools guide.md | 198 ++++++++++-------- 1 file changed, 110 insertions(+), 88 deletions(-) diff --git a/translated/tech/20180907 6.828 lab tools guide.md b/translated/tech/20180907 6.828 lab tools guide.md index 1396289ad1..936ce535f8 100644 --- a/translated/tech/20180907 6.828 lab tools guide.md +++ b/translated/tech/20180907 6.828 lab tools guide.md @@ -1,185 +1,207 @@ -6.828 实验工具指南 +Caffeinated 6.828:实验工具指南 ====== -### 6.828 实验工具指南 -熟悉你的环境对高效率的开发和调试来说是至关重要的。本文将为你简单概述一下 JOS 环境和非常有用的 GDB 和 QEMU 命令。话虽如此,但你仍然需要去阅读 GDB 和 QEMU 手册,来理解这些强大的工具如何使用。 +熟悉你的环境对高效率的开发和调试来说是至关重要的。本文将为你简单概述一下 JOS 环境和非常有用的 GDB 和 QEMU 命令。话虽如此,但你仍然应该去阅读 GDB 和 QEMU 手册,来理解这些强大的工具如何使用。 -#### 调试小贴士 +### 调试小贴士 -##### 内核 +#### 内核 -GDB 是你的朋友。使用 `qemu-gdb target`(或它的变体 `qemu-gdb-nox`)使 QEMU 等待 GDB 去绑定。下面在调试内核时用到的一些命令,可以去查看 GDB 的资料。 +GDB 是你的朋友。使用 `qemu-gdb target`(或它的变体 `qemu-gdb-nox`)使 QEMU 等待 GDB 去绑定。下面在调试内核时用到的一些命令,可以去查看 GDB 的资料。 如果你遭遇意外的中断、异常、或三重故障,你可以使用 `-d` 参数要求 QEMU 去产生一个详细的中断日志。 -调试虚拟内存问题时,尝试 QEMU 监视命令 `info mem`(提供内存高级概述)或 `info pg`(提供更多细节内容)。注意,这些命令仅显示**当前**页表。 +调试虚拟内存问题时,尝试 QEMU 的监视命令 `info mem`(提供内存高级概述)或 `info pg`(提供更多细节内容)。注意,这些命令仅显示**当前**页表。 (在实验 4 以后)去调试多个 CPU 时,使用 GDB 的线程相关命令,比如 `thread` 和 `info threads`。 -##### 用户环境(在实验 3 以后) +#### 用户环境(在实验 3 以后) -GDB 也可以去调试用户环境,但是有些事情需要注意,因为 GDB 无法区分开多个用户环境或用户环境与内核环境。 +GDB 也可以去调试用户环境,但是有些事情需要注意,因为 GDB 无法区分开多个用户环境或区分开用户环境与内核环境。 你可以使用 `make run-name`(或编辑 `kern/init.c` 目录)来指定 JOS 启动的用户环境,为使 QEMU 等待 GDB 去绑定,使用 `run-name-gdb` 的变体。 -你可以符号化调试用户代码,就像调试内核代码一样,但是你要告诉 GDB,哪个符号表用到符号文件命令上,因为它一次仅能够使用一个符号表。提供的 `.gdbinit` 用于加载内核符号表 `obj/kern/kernel`。对于一个用户环境,这个符号表在它的 ELF 二进制文件中,因此你可以使用 `symbol-file obj/user/name` 去加载它。不要从任何 `.o` 文件中加载符号,因为它们不会被链接器迁移进去(库是静态链接进 JOS 用户二进制文件中的,因此这些符号已经包含在每个用户二进制文件中了)。确保你得到了正确的用户二进制文件;在不同的二直制文件中,库函数被链接为不同的 EIP,而 GDB 并不知道更多的内容! +你可以符号化调试用户代码,就像调试内核代码一样,但是你要告诉 GDB,哪个符号表用到符号文件命令上,因为它一次仅能够使用一个符号表。提供的 `.gdbinit` 用于加载内核符号表 `obj/kern/kernel`。对于一个用户环境,这个符号表在它的 ELF 二进制文件中,因此你可以使用 `symbol-file obj/user/name` 去加载它。不要从任何 `.o` 文件中加载符号,因为它们不会被链接器迁移进去(库是静态链接进 JOS 用户二进制文件中的,因此这些符号已经包含在每个用户二进制文件中了)。确保你得到了正确的用户二进制文件;在不同的二进制文件中,库函数被链接为不同的 EIP,而 GDB 并不知道更多的内容! (在实验 4 以后)因为 GDB 绑定了整个虚拟机,所以它可以将时钟中断看作为一种控制转移。这使得从底层上不可能实现步进用户代码,因为一个时钟中断无形中保证了片刻之后虚拟机可以再次运行。因此可以使用 `stepi` 命令,因为它阻止了中断,但它仅可以步进一个汇编指令。断点一般来说可以正常工作,但要注意,因为你可能在不同的环境(完全不同的一个二进制文件)上遇到同一个 EIP。 -#### 参考 +### 参考 -##### JOS makefile +#### JOS makefile JOS 的 GNUmakefile 包含了在各种方式中运行的 JOS 的许多假目标。所有这些目标都配置 QEMU 去监听 GDB 连接(`*-gdb` 目标也等待这个连接)。要在运行中的 QEMU 上启动它,只需要在你的实验目录中简单地运行 `gdb ` 即可。我们提供了一个 `.gdbinit` 文件,它可以在 QEMU 中自动指向到 GDB、加载内核符号文件、以及在 16 位和 32 位模式之间切换。退出 GDB 将关闭 QEMU。 * `make qemu` + 在一个新窗口中构建所有的东西并使用 VGA 控制台和你的终端中的串行控制台启动 QEMU。想退出时,既可以关闭 VGA 窗口,也可以在你的终端中按 `Ctrl-c` 或 `Ctrl-a x`。 * `make qemu-nox` + 和 `make qemu` 一样,但仅使用串行控制台来运行。想退出时,按下 `Ctrl-a x`。这种方式在通过 SSH 拨号连接到 Athena 上时非常有用,因为 VGA 窗口会占用许多带宽。 * `make qemu-gdb` + 和 `make qemu` 一样,但它与任意时间被动接受 GDB 不同,而是暂停第一个机器指令并等待一个 GDB 连接。 * `make qemu-nox-gdb` + 它是 `qemu-nox` 和 `qemu-gdb` 目标的组合。 * `make run-nam` + (在实验 3 以后)运行用户程序 _name_。例如,`make run-hello` 运行 `user/hello.c`。 * `make run-name-nox`,`run-name-gdb`, `run-name-gdb-nox` + (在实验 3 以后)与 `qemu` 目标变量对应的 `run-name` 的变体。 - - makefile 也接受几个非常有用的变量: * `make V=1 …` -详细模式。输出正在运行的每个命令,包括参数。 + + 详细模式。输出正在运行的每个命令,包括参数。 * `make V=1 grade` -在评级测试失败后停止,并将 QEMU 的输出放入 `jos.out` 文件中以备检查。 + + 在评级测试失败后停止,并将 QEMU 的输出放入 `jos.out` 文件中以备检查。 * `make QEMUEXTRA=' _args_ ' …` -指定传递给 QEMU 的额外参数。 + + 指定传递给 QEMU 的额外参数。 - - -##### JOS obj/ +#### JOS obj/ 在构建 JOS 时,makefile 也产生一些额外的输出文件,这些文件在调试时非常有用: * `obj/boot/boot.asm`、`obj/kern/kernel.asm`、`obj/user/hello.asm`、等等。 -引导加载器、内核、和用户程序的汇编代码列表。 + + 引导加载器、内核、和用户程序的汇编代码列表。 * `obj/kern/kernel.sym`、`obj/user/hello.sym`、等等。 -内核和用户程序的符号表。 + + 内核和用户程序的符号表。 * `obj/boot/boot.out`、`obj/kern/kernel`、`obj/user/hello`、等等。 -内核和用户程序链接的 ELF 镜像。它们包含了 GDB 用到的符号信息。 + + 内核和用户程序链接的 ELF 镜像。它们包含了 GDB 用到的符号信息。 - - -##### GDB +#### GDB 完整的 GDB 命令指南请查看 [GDB 手册][1]。下面是一些在 6.828 课程中非常有用的命令,它们中的一些在操作系统开发之外的领域几乎用不到。 * `Ctrl-c` -在当前指令处停止机器并打断进入到 GDB。如果 QEMU 有多个虚拟的 CPU,所有的 CPU 都会停止。 + + 在当前指令处停止机器并打断进入到 GDB。如果 QEMU 有多个虚拟的 CPU,所有的 CPU 都会停止。 * `c`(或 `continue`) -继续运行,直到下一个断点或 `Ctrl-c`。 + + 继续运行,直到下一个断点或 `Ctrl-c`。 * `si`(或 `stepi`) -运行一个机器指令。 + + 运行一个机器指令。 * `b function` 或 `b file:line`(或 `breakpoint`) -在给定的函数或行上设置一个断点。 + + 在给定的函数或行上设置一个断点。 * `b * addr`(或 `breakpoint`) -在 EIP 的 addr 处设置一个断点。 + + 在 EIP 的 addr 处设置一个断点。 * `set print pretty` -启用数组和结构的美化输出。 + + 启用数组和结构的美化输出。 * `info registers` -输出通用寄存器 `eip`、`eflags`、和段选择器。更多更全的机器寄存器状态转储,查看 QEMU 自己的 `info registers` 命令。 + + 输出通用寄存器 `eip`、`eflags`、和段选择器。更多更全的机器寄存器状态转储,查看 QEMU 自己的 `info registers` 命令。 * `x/ N x addr` -以十六进制显示虚拟地址 addr 处开始的 N 个词的转储。如果 N 省略,默认为 1。addr 可以是任何表达式。 + + 以十六进制显示虚拟地址 addr 处开始的 N 个词的转储。如果 N 省略,默认为 1。addr 可以是任何表达式。 * `x/ N i addr` -显示从 addr 处开始的 N 个汇编指令。使用 `$eip` 作为 addr 将显示当前指令指针寄存器中的指令。 + + 显示从 addr 处开始的 N 个汇编指令。使用 `$eip` 作为 addr 将显示当前指令指针寄存器中的指令。 * `symbol-file file` -(在实验 3 以后)切换到符号文件 file 上。当 GDB 绑定到 QEMU 后,它并不是虚拟机中进程边界内的一部分,因此我们要去告诉它去使用哪个符号。默认情况下,我们配置 GDB 去使用内核符号文件 `obj/kern/kernel`。如果机器正在运行用户代码,比如是 `hello.c`,你就需要使用 `symbol-file obj/user/hello` 去切换到 hello 的符号文件。 - - + + (在实验 3 以后)切换到符号文件 file 上。当 GDB 绑定到 QEMU 后,它并不是虚拟机中进程边界内的一部分,因此我们要去告诉它去使用哪个符号。默认情况下,我们配置 GDB 去使用内核符号文件 `obj/kern/kernel`。如果机器正在运行用户代码,比如是 `hello.c`,你就需要使用 `symbol-file obj/user/hello` 去切换到 hello 的符号文件。 QEMU 将每个虚拟 CPU 表示为 GDB 中的一个线程,因此你可以使用 GDB 中所有的线程相关的命令去查看或维护 QEMU 的虚拟 CPU。 * `thread n` -GDB 在一个时刻只关注于一个线程(即:CPU)。这个命令将关注的线程切换到 n,n 是从 0 开始编号的。 + + GDB 在一个时刻只关注于一个线程(即:CPU)。这个命令将关注的线程切换到 n,n 是从 0 开始编号的。 * `info threads` -列出所有的线程(即:CPU),包括它们的状态(活动还是停止)和它们在什么函数中。 + + 列出所有的线程(即:CPU),包括它们的状态(活动还是停止)和它们在什么函数中。 - -##### QEMU +#### QEMU QEMU 包含一个内置的监视器,它能够有效地检查和修改机器状态。想进入到监视器中,在运行 QEMU 的终端中按入 `Ctrl-a c` 即可。再次按下 `Ctrl-a c` 将切换回串行控制台。 监视器命令的完整参考资料,请查看 [QEMU 手册][2]。下面是 6.828 课程中用到的一些有用的命令: * `xp/ N x paddr` -显示从物理地址 paddr 处开始的 N 个词的十六进制转储。如果 N 省略,默认为 1。这是 GDB 的 `x` 命令模拟的物理内存。 - + + 显示从物理地址 paddr 处开始的 N 个词的十六进制转储。如果 N 省略,默认为 1。这是 GDB 的 `x` 命令模拟的物理内存。 * `info registers` -显示机器内部寄存器状态的一个完整转储。实践中,对于段选择器,这将包含机器的 _隐藏_ 段状态和局部、全局、和中断描述符表加任务状态寄存器。隐藏状态是在加载段选择器后,虚拟的 CPU 从 GDT/LDT 中读取的信息。下面是实验 1 中 JOS 内核处于运行中时的 CS 信息和每个字段的含义: -```c + + 显示机器内部寄存器状态的一个完整转储。实践中,对于段选择器,这将包含机器的 _隐藏_ 段状态和局部、全局、和中断描述符表加任务状态寄存器。隐藏状态是在加载段选择器后,虚拟的 CPU 从 GDT/LDT 中读取的信息。下面是实验 1 中 JOS 内核处于运行中时的 CS 信息和每个字段的含义: + + ```c CS =0008 10000000 ffffffff 10cf9a00 DPL=0 CS32 [-R-] -``` + ``` * `CS =0008` -代码选择器可见部分。我们使用段 0x8。这也告诉我们参考全局描述符表(0x8 &4=0),并且我们的 CPL(当前权限级别)是 0x8&3=0。 - * `10000000` -这是段基址。线性地址 = 逻辑地址 + 0x10000000。 - * `ffffffff` -这是段限制。访问线性地址 0xffffffff 以上将返回段违规异常。 - * `10cf9a00` -段的原始标志,QEMU 将在接下来的几个字段中解码这些对我们有用的标志。 - * `DPL=0` -段的权限级别。一旦代码以权限 0 运行,它将就能够加载这个段。 - * `CS32` -这是一个 32 位代码段。对于数据段(不要与 DS 寄存器混淆了),另外的值还包括 `DS`,而对于本地描述符表是 `LDT`。 - * `[-R-]` -这个段是只读的。 + 代码选择器可见部分。我们使用段 0x8。这也告诉我们参考全局描述符表(0x8&4=0),并且我们的 CPL(当前权限级别)是 0x8&3=0。 + * `10000000` + + 这是段基址。线性地址 = 逻辑地址 + 0x10000000。 + * `ffffffff` + + 这是段限制。访问线性地址 0xffffffff 以上将返回段违规异常。 + * `10cf9a00` + + 段的原始标志,QEMU 将在接下来的几个字段中解码这些对我们有用的标志。 + * `DPL=0` + + 段的权限级别。一旦代码以权限 0 运行,它将就能够加载这个段。 + * `CS32` + + 这是一个 32 位代码段。对于数据段(不要与 DS 寄存器混淆了),另外的值还包括 `DS`,而对于本地描述符表是 `LDT`。 + * `[-R-]` + + 这个段是只读的。 * `info mem` -(在实验 2 以后)显示映射的虚拟内存和权限。比如: -``` + + (在实验 2 以后)显示映射的虚拟内存和权限。比如: + + ``` ef7c0000-ef800000 00040000 urw efbf8000-efc00000 00008000 -rw + ``` -``` - -这告诉我们从 0xef7c0000 到 0xef800000 的 0x00040000 字节的内存被映射为读取/写入/用户可访问,而映射在 0xefbf8000 到 0xefc00000 之间的内存权限是读取/写入,但是仅限于内核可访问。 + 这告诉我们从 0xef7c0000 到 0xef800000 的 0x00040000 字节的内存被映射为读取/写入/用户可访问,而映射在 0xefbf8000 到 0xefc00000 之间的内存权限是读取/写入,但是仅限于内核可访问。 * `info pg` -(在实验 2 以后)显示当前页表结构。它的输出类似于 `info mem`,但与页目录条目和页表条目是有区别的,并且为每个条目给了单独的权限。重复的 PTE 和整个页表被折叠为一个单行。例如: -``` - VPN range Entry Flags Physical page - [00000-003ff] PDE[000] -------UWP - [00200-00233] PTE[200-233] -------U-P 00380 0037e 0037d 0037c 0037b 0037a .. - [00800-00bff] PDE[002] ----A--UWP - [00800-00801] PTE[000-001] ----A--U-P 0034b 00349 - [00802-00802] PTE[002] -------U-P 00348 - -``` - -这里各自显示了两个页目录条目、虚拟地址范围 0x00000000 到 0x003fffff 以及 0x00800000 到 0x00bfffff。 所有的 PDE 都存在于内存中、可写入、并且用户可访问,而第二个 PDE 也是可访问的。这些页表中的第二个映射了三个页、虚拟地址范围 0x00800000 到 0x00802fff,其中前两个页是存在于内存中的、可写入、并且用户可访问的,而第三个仅存在于内存中,并且用户可访问。这些 PTE 的第一个条目映射在物理页 0x34b 处。 - + + (在实验 2 以后)显示当前页表结构。它的输出类似于 `info mem`,但与页目录条目和页表条目是有区别的,并且为每个条目给了单独的权限。重复的 PTE 和整个页表被折叠为一个单行。例如: + ``` +VPN range Entry Flags Physical page +[00000-003ff] PDE[000] -------UWP + [00200-00233] PTE[200-233] -------U-P 00380 0037e 0037d 0037c 0037b 0037a .. +[00800-00bff] PDE[002] ----A--UWP + [00800-00801] PTE[000-001] ----A--U-P 0034b 00349 + [00802-00802] PTE[002] -------U-P 00348 + ``` + 这里各自显示了两个页目录条目、虚拟地址范围 0x00000000 到 0x003fffff 以及 0x00800000 到 0x00bfffff。 所有的 PDE 都存在于内存中、可写入、并且用户可访问,而第二个 PDE 也是可访问的。这些页表中的第二个映射了三个页、虚拟地址范围 0x00800000 到 0x00802fff,其中前两个页是存在于内存中的、可写入、并且用户可访问的,而第三个仅存在于内存中,并且用户可访问。这些 PTE 的第一个条目映射在物理页 0x34b 处。 QEMU 也有一些非常有用的命令行参数,使用 `QEMUEXTRA` 变量可以将参数传递给 JOS 的 makefile。 * `make QEMUEXTRA='-d int' ...` -记录所有的中断和一个完整的寄存器转储到 `qemu.log` 文件中。你可以忽略前两个日志条目、"SMM: enter" 和 "SMM: after RMS”,因为这些是在进入引导加载器之前生成的。在这之后的日志条目看起来像下面这样: -``` - 4: v=30 e=0000 i=1 cpl=3 IP=001b:00800e2e pc=00800e2e SP=0023:eebfdf28 EAX=00000005 - EAX=00000005 EBX=00001002 ECX=00200000 EDX=00000000 - ESI=00000805 EDI=00200000 EBP=eebfdf60 ESP=eebfdf28 - ... - + + 记录所有的中断和一个完整的寄存器转储到 `qemu.log` 文件中。你可以忽略前两个日志条目、“SMM: enter” 和 “SMM: after RMS”,因为这些是在进入引导加载器之前生成的。在这之后的日志条目看起来像下面这样: + + ``` + 4: v=30 e=0000 i=1 cpl=3 IP=001b:00800e2e pc=00800e2e SP=0023:eebfdf28 EAX=00000005 +EAX=00000005 EBX=00001002 ECX=00200000 EDX=00000000 +ESI=00000805 EDI=00200000 EBP=eebfdf60 ESP=eebfdf28 +... ``` -第一行描述了中断。`4:` 只是一个日志记录计数器。`v` 提供了十六进程的向量号。`e` 提供了错误代码。`i=1` 表示它是由一个 `int` 指令(相对一个硬件产生的中断而言)产生的。剩下的行的意思很明显。对于一个寄存器转储而言,接下来看到的就是寄存器信息。 + 第一行描述了中断。`4:` 只是一个日志记录计数器。`v` 提供了十六进程的向量号。`e` 提供了错误代码。`i=1` 表示它是由一个 `int` 指令(相对一个硬件产生的中断而言)产生的。剩下的行的意思很明显。对于一个寄存器转储而言,接下来看到的就是寄存器信息。 -注意:如果你运行的是一个 0.15 版本之前的 QEMU,日志将写入到 `/tmp` 目录,而不是当前目录下。 + 注意:如果你运行的是一个 0.15 版本之前的 QEMU,日志将写入到 `/tmp` 目录,而不是当前目录下。 @@ -190,7 +212,7 @@ via: https://pdos.csail.mit.edu/6.828/2018/labguide.html 作者:[csail.mit][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 87ad96500bd2250c434683d33f1bf7d95b50797f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 12:03:10 +0800 Subject: [PATCH 0445/1143] PUB:20180907 6.828 lab tools guide.md @qhwdw https://linux.cn/article-10273-1.html --- {translated/tech => published}/20180907 6.828 lab tools guide.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180907 6.828 lab tools guide.md (100%) diff --git a/translated/tech/20180907 6.828 lab tools guide.md b/published/20180907 6.828 lab tools guide.md similarity index 100% rename from translated/tech/20180907 6.828 lab tools guide.md rename to published/20180907 6.828 lab tools guide.md From f6aba4283168ebe262feeb9bd460bd7878ed7b07 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 12:39:45 +0800 Subject: [PATCH 0446/1143] PRF:20181025 What breaks our systems- A taxonomy of black swans.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @belitex 翻译的很棒! --- ... our systems- A taxonomy of black swans.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/talk/20181025 What breaks our systems- A taxonomy of black swans.md b/translated/talk/20181025 What breaks our systems- A taxonomy of black swans.md index 22d2bdd3df..e3aa38e75a 100644 --- a/translated/talk/20181025 What breaks our systems- A taxonomy of black swans.md +++ b/translated/talk/20181025 What breaks our systems- A taxonomy of black swans.md @@ -1,27 +1,27 @@ 让系统崩溃的黑天鹅分类 ====== -在严重的故障发生之前,找到引起问题的异常事件,并修复它。 +> 在严重的故障发生之前,找到引起问题的异常事件,并修复它。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/black-swan-pair_0.png?itok=MkshwqVg) -黑天鹅用来比喻造成严重影响的小概率事件(比如 2008 年的金融危机)。在生产环境的系统中,黑天鹅是指这样的事情:它引发了你不知道的问题,造成了重大影响,不能快速修复或回滚,也不能用值班说明书上的其他标准响应来解决。它是事发几年后你还在给新人说起的事件。 +黑天鹅Black swan用来比喻造成严重影响的小概率事件(比如 2008 年的金融危机)。在生产环境的系统中,黑天鹅是指这样的事情:它引发了你不知道的问题,造成了重大影响,不能快速修复或回滚,也不能用值班说明书上的其他标准响应来解决。它是事发几年后你还在给新人说起的事件。 从定义上看,黑天鹅是不可预测的,不过有时候我们能找到其中的一些模式,针对有关联的某一类问题准备防御措施。 -例如,大部分故障的直接原因是变更(代码、环境或配置)。虽然这种方式触发的 bug 是独特的,不可预测的,但是常见的金丝雀发布对避免这类问题有一定的作用,而且自动回滚已经成了一种标准止损策略。 +例如,大部分故障的直接原因是变更(代码、环境或配置)。虽然这种方式触发的 bug 是独特的、不可预测的,但是常见的金丝雀发布对避免这类问题有一定的作用,而且自动回滚已经成了一种标准止损策略。 随着我们的专业性不断成熟,一些其他的问题也正逐渐变得容易理解,被归类到某种风险并有普适的预防策略。 ### 公布出来的黑天鹅事件 -所有科技公司都有生产环境的故障,只不过并不是所有公司都会分享他们的事故分析。那些公开讨论事故的公司帮了我们的忙。下列事故都描述了某一类问题,但它们绝对不是只属于一个类别。我们的系统中都有黑天鹅在潜伏着,只是有些人还不知道而已。 +所有科技公司都有生产环境的故障,只不过并不是所有公司都会分享他们的事故分析。那些公开讨论事故的公司帮了我们的忙。下列事故都描述了某一类问题,但它们绝对不是只一个孤例。我们的系统中都有黑天鹅在潜伏着,只是有些人还不知道而已。 #### 达到上限 达到任何类型的限制都会引发严重事故。这类问题的一个典型例子是 2017 年 2 月 [Instapaper 的一次服务中断][1]。我把这份事故报告给任何一个运维工作者看,他们读完都会脊背发凉。Instapaper 生产环境的数据库所在的文件系统有 2 TB 的大小限制,但是数据库服务团队并不知情。在没有任何报错的情况下,数据库不再接受任何写入了。完全恢复需要好几天,而且还得迁移数据库。 -资源限制有各式各样的触发场景。Sentry 遇到了 [Postgres 的最大事务 ID 限制][2]。Platform.sh 遇到了[管道缓冲区大小限制][3]。SparkPost [触发了 AWS 的 DDos 保护][4]。Foursquare 在他们的一个 [MongoDB 耗尽内存][5]时遭遇了性能骤降。 +资源限制有各式各样的触发场景。Sentry 遇到了 [Postgres 的最大事务 ID 限制][2]。Platform.sh 遇到了[管道缓冲区大小限制][3]。SparkPost [触发了 AWS 的 DDoS 保护][4]。Foursquare 在他们的一个 [MongoDB 耗尽内存][5]时遭遇了性能骤降。 提前了解系统限制的一个办法是定期做测试。好的压力测试(在生产环境的副本上做)应该包含写入事务,并且应该把每一种数据存储都写到超过当前生产环境的容量。压力测试时很容易忽略的是次要存储(比如 Zookeeper)。如果你是在测试时遇到了资源限制,那么你还有时间去解决问题。鉴于这种资源限制问题的解决方案可能涉及重大的变更(比如数据存储拆分),所以时间是非常宝贵的。 @@ -32,7 +32,7 @@ #### 扩散的慢请求 > “这个世界的关联性远比我们想象中更大。所以我们看到了更多 Nassim Taleb 所说的‘黑天鹅事件’ —— 即罕见事件以更高的频率离谱地发生了,因为世界是相互关联的” -> — [Richard Thaler][6] +> —— [Richard Thaler][6] HostedGraphite 的负载均衡器并没有托管在 AWS 上,却[被 AWS 的服务中断给搞垮了][7],他们关于这次事故原因的分析报告很好地诠释了分布式计算系统之间存在多么大的关联。在这个事件里,负载均衡器的连接池被来自 AWS 上的客户访问占满了,因为这些连接很耗时。同样的现象还会发生在应用的线程、锁、数据库连接上 —— 任何能被慢操作占满的资源。 @@ -40,7 +40,7 @@ HostedGraphite 的负载均衡器并没有托管在 AWS 上,却[被 AWS 的服 重试的间隔应该用指数退避来限制一下,并加入一些时间抖动。Square 有一次服务中断是 [Redis 存储的过载][9],原因是有一段代码对失败的事务重试了 500 次,没有任何重试退避的方案,也说明了过度重试的潜在风险。另外,针对这种情况,[断路器][10]设计模式也是有用的。 -应该设计出监控仪表盘来清晰地展示所有资源的[使用率,饱和度和报错][11],这样才能快速发现问题。 +应该设计出监控仪表盘来清晰地展示所有资源的[使用率、饱和度和报错][11],这样才能快速发现问题。 #### 突发的高负载 @@ -48,7 +48,7 @@ HostedGraphite 的负载均衡器并没有托管在 AWS 上,却[被 AWS 的服 在预定时刻同时发生的事件并不是突发大流量的唯一原因。Slack 经历过一次短时间内的[多次服务中断][12],原因是非常多的客户端断开连接后立即重连,造成了突发的大负载。 CircleCI 也经历过一次[严重的服务中断][13],当时 Gitlab 从故障中恢复了,所以数据库里积累了大量的构建任务队列,服务变得饱和而且缓慢。 -几乎所有的服务都会受突发的高负载所影响。所以对这类可能出现的事情做应急预案——并测试一下预案能否正常工作——是必须的。客户端退避和[减载][14]通常是这些方案的核心。 +几乎所有的服务都会受突发的高负载所影响。所以对这类可能出现的事情做应急预案 —— 并测试一下预案能否正常工作 —— 是必须的。客户端退避和[减载][14]通常是这些方案的核心。 如果你的系统必须不间断地接收数据,并且数据不能被丢掉,关键是用可伸缩的方式把数据缓冲到队列中,后续再处理。 @@ -57,7 +57,7 @@ HostedGraphite 的负载均衡器并没有托管在 AWS 上,却[被 AWS 的服 > “复杂的系统本身就是有风险的系统” > —— [Richard Cook, MD][15] -过去几年里软件的运维操作趋势是更加自动化。任何可能降低系统容量的自动化操作(比如擦除磁盘,退役设备,关闭服务)都应该谨慎操作。这类自动化操作的故障(由于系统有 bug 或者有不正确的调用)能很快地搞垮你的系统,而且可能很难恢复。 +过去几年里软件的运维操作趋势是更加自动化。任何可能降低系统容量的自动化操作(比如擦除磁盘、退役设备、关闭服务)都应该谨慎操作。这类自动化操作的故障(由于系统有 bug 或者有不正确的调用)能很快地搞垮你的系统,而且可能很难恢复。 谷歌的 Christina Schulman 和 Etienne Perot 在[用安全规约协助保护你的数据中心][16]的演讲中给了一些例子。其中一次事故是将谷歌整个内部的内容分发网络(CDN)提交给了擦除磁盘的自动化系统。 @@ -69,11 +69,11 @@ Schulman 和 Perot 建议使用一个中心服务来管理规约,限制破坏 ### 防止黑天鹅事件 -可能在等着击垮系统的黑天鹅可不止上面这些。有很多其他的严重问题是能通过一些技术来避免的,像金丝雀发布,压力测试,混沌工程,灾难测试和模糊测试——当然还有冗余性和弹性的设计。但是即使用了这些技术,有时候你的系统还是会有故障。 +可能在等着击垮系统的黑天鹅可不止上面这些。有很多其他的严重问题是能通过一些技术来避免的,像金丝雀发布、压力测试、混沌工程、灾难测试和模糊测试 —— 当然还有冗余性和弹性的设计。但是即使用了这些技术,有时候你的系统还是会有故障。 -为了确保你的组织能有效地响应,在服务中断期间,请保证关键技术人员和领导层有办法沟通协调。例如,有一种你可能需要处理的烦人的事情,那就是网络完全中断。拥有故障时仍然可用的通信通道非常重要,这个通信通道要完全独立于你们自己的基础设施和基础设施的依赖。举个例子,假如你使用 AWS,那么把故障时可用的通信服务部署在 AWS 上就不明智了。在和你的主系统无关的地方,运行电话网桥或 IRC 服务器是比较好的方案。确保每个人都知道这个通信平台,并练习使用它。 +为了确保你的组织能有效地响应,在服务中断期间,请保证关键技术人员和领导层有办法沟通协调。例如,有一种你可能需要处理的烦人的事情,那就是网络完全中断。拥有故障时仍然可用的通信通道非常重要,这个通信通道要完全独立于你们自己的基础设施及对其的依赖。举个例子,假如你使用 AWS,那么把故障时可用的通信服务部署在 AWS 上就不明智了。在和你的主系统无关的地方,运行电话网桥或 IRC 服务器是比较好的方案。确保每个人都知道这个通信平台,并练习使用它。 -另一个原则是,确保监控和运维工具对生产环境系统的依赖尽可能的少。将控制平面和数据平面分开,你才能在系统不健康的时候做变更。不要让数据处理和配置变更或监控使用同一个消息队列,比如——应该使用不同的消息队列实例。在 [SparkPost: DNS 挂掉的那一天][4] 这个演讲中,Jeremy Blosser 讲了一个这类例子,很关键的工具依赖了生产环境的 DNS 配置,但是生产环境的 DNS 出了问题。 +另一个原则是,确保监控和运维工具对生产环境系统的依赖尽可能的少。将控制平面和数据平面分开,你才能在系统不健康的时候做变更。不要让数据处理和配置变更或监控使用同一个消息队列,比如,应该使用不同的消息队列实例。在 [SparkPost: DNS 挂掉的那一天][4] 这个演讲中,Jeremy Blosser 讲了一个这类例子,很关键的工具依赖了生产环境的 DNS 配置,但是生产环境的 DNS 出了问题。 ### 对抗黑天鹅的心理学 @@ -83,7 +83,7 @@ Schulman 和 Perot 建议使用一个中心服务来管理规约,限制破坏 ### 了解更多 -关于黑天鹅(或者以前的黑天鹅)事件以及应对策略,还有很多其他的事情可以说。如果你想了解更多,我强烈推荐你去看这两本书,它们是关于生产环境中的弹性和稳定性的:Susan Fowler 写的[生产微服务][19],还有 Michael T. Nygard 的 [Release It!][20]。 +关于黑天鹅(或者以前的黑天鹅)事件以及应对策略,还有很多其他的事情可以说。如果你想了解更多,我强烈推荐你去看这两本书,它们是关于生产环境中的弹性和稳定性的:Susan Fowler 写的《[生产微服务][19]》,还有 Michael T. Nygard 的 《[Release It!][20]》。 -------------------------------------------------------------------------------- @@ -92,7 +92,7 @@ via: https://opensource.com/article/18/10/taxonomy-black-swans 作者:[Laura Nolan][a] 选题:[lujun9972][b] 译者:[BeliteX](https://github.com/belitex) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8d87021494dbbb06a895f609f1da8a242322191a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 12:40:09 +0800 Subject: [PATCH 0447/1143] PUB:20181025 What breaks our systems- A taxonomy of black swans.md @belitex https://linux.cn/article-10274-1.html --- ...20181025 What breaks our systems- A taxonomy of black swans.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20181025 What breaks our systems- A taxonomy of black swans.md (100%) diff --git a/translated/talk/20181025 What breaks our systems- A taxonomy of black swans.md b/published/20181025 What breaks our systems- A taxonomy of black swans.md similarity index 100% rename from translated/talk/20181025 What breaks our systems- A taxonomy of black swans.md rename to published/20181025 What breaks our systems- A taxonomy of black swans.md From 7ad23152c2e956d08085eef07c101d152cda57ef Mon Sep 17 00:00:00 2001 From: darksun Date: Sun, 25 Nov 2018 14:33:29 +0800 Subject: [PATCH 0448/1143] =?UTF-8?q?file-translating-p=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=96=B0=E6=97=A7=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/status.sh | 2 +- scripts/status/status.sh | 29 +++++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/scripts/status.sh b/scripts/status.sh index f3cc4b8d82..5ca3e8684c 100755 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# 重新生成badge +# 重新生成status data set -o errexit SCRIPTS_DIR=$(cd $(dirname "$0") && pwd) diff --git a/scripts/status/status.sh b/scripts/status/status.sh index acb03bbf4e..9705c3cbc0 100755 --- a/scripts/status/status.sh +++ b/scripts/status/status.sh @@ -1,27 +1,32 @@ #!/usr/bin/env bash set -e -cd "$(dirname $0)/../.." # 进入TP root +cd "$(dirname "$0")/../.." # 进入TP root function file-translating-p () { local file="$*" - head -n 3 "$file" |grep -E -i "translat|fanyi|翻译" >/dev/null 2>&1 + if head -n 1 "${file}" |grep '\[^#\]:'>/dev/null 2>&1 ;then + # 新模板 + head -n 12 "$file" |grep -v '\[^#\]:' |grep -E -i "translat|fanyi|翻译" >/dev/null 2>&1 + else + # 旧模板 + head -n 3 "$file" |grep -E -i "translat|fanyi|翻译" >/dev/null 2>&1 + fi } function get_status_of() { - local file="$@" + local file="$*" git log --date=short --pretty=format:"{\"file\":\"${file}\",\"time\":\"%ad\",\"user\":\"%an\"}" -n 1 "${file}" } -translating=$( git grep -niE "translat|fanyi|翻译" sources/*.md |awk -F ":" '{if ($2<=3) print $1}' |xargs -I{} git log --date=short --pretty=format:"{\"filename\":\"{}\",\"time\":\"%ad\",\"user\":\"%an\"}" -n 1 "{}") -unselected=$( -find sources -name "2*.md"|sort|while read file;do - if ! file-translating-p "${file}";then - get_status_of "${file}" +while read -r file;do + if file-translating-p "${file}";then + translating="${translating} $(get_status_of "${file}")" + else + unselected="${unselected} $(get_status_of "${file}")" fi -done -) +done< <(find sources -name "2*.md") ( -echo ${translating}|jq -s "." -echo ${unselected} |jq -s "." +echo "${translating}"|jq -s "." +echo "${unselected}"|jq -s "." )|jq -s '{"translating":.[0],"unselected":.[1]}' From 6aa23f5d9587a07039fa72f3aae0fa221c07316d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 14:49:31 +0800 Subject: [PATCH 0449/1143] PRF:20181014 How Lisp Became God-s Own Programming Language.md @Northurland @no1xsyzy --- ...181014 How Lisp Became God-s Own Programming Language.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/published/20181014 How Lisp Became God-s Own Programming Language.md b/published/20181014 How Lisp Became God-s Own Programming Language.md index 4666cad45e..017a67799f 100644 --- a/published/20181014 How Lisp Became God-s Own Programming Language.md +++ b/published/20181014 How Lisp Became God-s Own Programming Language.md @@ -30,6 +30,8 @@ Lisp 是怎么成为上帝的编程语言的 > 我知道,上帝偏爱那一门 > 名字是四个字母的语言。 + +(LCTT 译注:参见 “四个字母”,参见:[四字神名](https://zh.wikipedia.org/wiki/%E5%9B%9B%E5%AD%97%E7%A5%9E%E5%90%8D),致谢 [no1xsyzy](https://github.com/LCTT/TranslateProject/issues/11320)) 以下这句话我实在不好在人前说;不过,我还是觉得,这样一种 “Lisp 是奥术魔法”的文化模因实在是有史以来最奇异、最迷人的东西。Lisp 是象牙塔的产物,是人工智能研究的工具;因此,它对于编程界的俗人而言总是陌生的,甚至是带有神秘色彩的。然而,当今的程序员们[开始怂恿彼此,“在你死掉之前至少试一试 Lisp”][4],就像这是一种令人恍惚入迷的致幻剂似的。尽管 Lisp 是广泛使用的编程语言中第二古老的(只比 Fortran 年轻一岁)[^1] ,程序员们也仍旧在互相怂恿。想象一下,如果你的工作是为某种组织或者团队推广一门新的编程语言的话,忽悠大家让他们相信你的新语言拥有神力难道不是绝佳的策略吗?—— 但你如何能够做到这一点呢?或者,换句话说,一门编程语言究竟是如何变成人们口中“隐晦知识的载体”的呢? @@ -83,7 +85,7 @@ SICP 究竟有多奇怪这一点值得好好说;因为我认为,时至今日 *SICP 封面上的画作。* -说真的,这上面画的究竟是怎么一回事?为什么桌子会长着动物的腿?为什么这个女人指着桌子?墨水瓶又是干什么用的?我们是不是该说,这位巫师已经破译了宇宙的隐藏奥秘,而所有这些奥秘就蕴含在 eval/apply 循环和 Lambda 微积分之中?看似就是如此。单单是这张图片,就一定对人们如今谈论 Lisp 的方式产生了难以计量的影响。 +说真的,这上面画的究竟是怎么一回事?为什么桌子会长着动物的腿?为什么这个女人指着桌子?墨水瓶又是干什么用的?我们是不是该说,这位巫师已经破译了宇宙的隐藏奥秘,而所有这些奥秘就蕴含在 eval/apply 循环和 Lambda 演算之中?看似就是如此。单单是这张图片,就一定对人们如今谈论 Lisp 的方式产生了难以计量的影响。 然而,这本书的内容通常并不比封面正常多少。SICP 跟你读过的所有计算机科学教科书都不同。在引言中,作者们表示,这本书不只教你怎么用 Lisp 编程 —— 它是关于“现象的三个焦点:人的心智、复数的计算机程序,和计算机”的作品 [^19]。在之后,他们对此进行了解释,描述了他们对如下观点的坚信:编程不该被当作是一种计算机科学的训练,而应该是“程序性认识论procedural epistemology”的一种新表达方式 [^20]。程序是将那些偶然被送入计算机的思想组织起来的全新方法。这本书的第一章简明地介绍了 Lisp,但是之后的绝大部分都在讲述更加抽象的概念。其中包括了对不同编程范式的讨论,对于面向对象系统中“时间”和“一致性”的讨论;在书中的某一处,还有关于通信的基本限制可能会如何带来同步问题的讨论 —— 而这些基本限制在通信中就像是光速不变在相对论中一样关键 [^21]。都是些高深难懂的东西。 @@ -97,7 +99,7 @@ SICP 究竟有多奇怪这一点值得好好说;因为我认为,时至今日 理所当然地,确定人们对 Lisp 重新燃起热情的具体时间并不可能;但这多半是保罗·格雷厄姆发表他那几篇声称 Lisp 是首选入门语言的短文之后的事了。保罗·格雷厄姆是 Y-Combinator 的联合创始人和《Hacker News》的创始者,他这几篇短文有很大的影响力。例如,在短文《[胜于平庸][20]Beating the Averages》中,他声称 Lisp 宏使 Lisp 比其它语言更强。他说,因为他在自己创办的公司 Viaweb 中使用 Lisp,他得以比竞争对手更快地推出新功能。至少,[一部分程序员][21]被说服了。然而,庞大的主流程序员群体并未换用 Lisp。 -实际上出现的情况是,Lisp 并未流行,但越来越多 Lisp 式的特性被加入到广受欢迎的语言中。Python 有了列表理解。C# 有了 Linq。Ruby……嗯,[Ruby 是 Lisp 的一种][22]。就如格雷厄姆之前在 2001 年提到的那样,“在一系列常用语言中所体现出的‘默认语言’正越发朝着 Lisp 的方向演化” [^23]。尽管其它语言变得越来越像 Lisp,Lisp 本身仍然保留了其作为“很少人了解但是大家都该学的神秘语言”的特殊声望。在 1980 年,Lisp 的诞生二十周年纪念日上,麦卡锡写道,Lisp 之所以能够存活这么久,是因为它具备“编程语言领域中的某种近似局部最优” [^24]。这句话并未充分地表明 Lisp 的真正影响力。Lisp 能够存活超过半个世纪之久,并非因为程序员们一年年地勉强承认它就是最好的编程工具;事实上,即使绝大多数程序员根本不用它,它还是存活了下来。多亏了它的起源和它的人工智能研究用途,说不定还要多亏 SICP 的遗产,Lisp 一直都那么让人着迷。在我们能够想象上帝用其它新的编程语言创造世界之前,Lisp 都不会走下神坛。 +实际上出现的情况是,Lisp 并未流行,但越来越多 Lisp 式的特性被加入到广受欢迎的语言中。Python 有了列表推导式。C# 有了 Linq。Ruby……嗯,[Ruby 是 Lisp 的一种][22]。就如格雷厄姆之前在 2001 年提到的那样,“在一系列常用语言中所体现出的‘默认语言’正越发朝着 Lisp 的方向演化” [^23]。尽管其它语言变得越来越像 Lisp,Lisp 本身仍然保留了其作为“很少人了解但是大家都该学的神秘语言”的特殊声望。在 1980 年,Lisp 的诞生二十周年纪念日上,麦卡锡写道,Lisp 之所以能够存活这么久,是因为它具备“编程语言领域中的某种近似局部最优” [^24]。这句话并未充分地表明 Lisp 的真正影响力。Lisp 能够存活超过半个世纪之久,并非因为程序员们一年年地勉强承认它就是最好的编程工具;事实上,即使绝大多数程序员根本不用它,它还是存活了下来。多亏了它的起源和它的人工智能研究用途,说不定还要多亏 SICP 的遗产,Lisp 一直都那么让人着迷。在我们能够想象上帝用其它新的编程语言创造世界之前,Lisp 都不会走下神坛。 -------------------------------------------------------------------------------- From 87fb3dc8ccd362d965d2dd226661df349dad1070 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Sun, 25 Nov 2018 16:09:10 +0800 Subject: [PATCH 0450/1143] translated --- ...scure Python libraries for data science.md | 258 ----------------- ...scure Python libraries for data science.md | 268 ++++++++++++++++++ 2 files changed, 268 insertions(+), 258 deletions(-) delete mode 100644 sources/tech/20181119 9 obscure Python libraries for data science.md create mode 100644 translated/tech/20181119 9 obscure Python libraries for data science.md diff --git a/sources/tech/20181119 9 obscure Python libraries for data science.md b/sources/tech/20181119 9 obscure Python libraries for data science.md deleted file mode 100644 index 0250199d7c..0000000000 --- a/sources/tech/20181119 9 obscure Python libraries for data science.md +++ /dev/null @@ -1,258 +0,0 @@ -heguangzhi Translating - -9 obscure Python libraries for data science -====== -Go beyond pandas, scikit-learn, and matplotlib and learn some new tricks for doing data science in Python. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-python.jpg?itok=F2PYP2wT) -Python is an amazing language. In fact, it's one of the fastest growing programming languages in the world. It has time and again proved its usefulness both in developer job roles and data science positions across industries. The entire ecosystem of Python and its libraries makes it an apt choice for users (beginners and advanced) all over the world. One of the reasons for its success and popularity is its set of robust libraries that make it so dynamic and fast. - -In this article, we will look at some of the Python libraries for data science tasks other than the commonly used ones like **pandas, scikit-learn** , and **matplotlib**. Although libraries like **pandas and scikit-learn** are the ones that come to mind for machine learning tasks, it's always good to learn about other Python offerings in this field. - -### Wget - -Extracting data, especially from the web, is one of a data scientist's vital tasks. [Wget][1] is a free utility for non-interactive downloading files from the web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. Since it is non-interactive, it can work in the background even if the user isn't logged in. So the next time you want to download a website or all the images from a page, **wget** will be there to assist. - -#### Installation - -``` -$ pip install wget -``` - -#### Example - -``` -import wget -url = 'http://www.futurecrew.com/skaven/song_files/mp3/razorback.mp3' - -filename = wget.download(url) -100% [................................................] 3841532 / 3841532 - -filename -'razorback.mp3' -``` - -### Pendulum - -For people who get frustrated when working with date-times in Python, **[Pendulum][2]** is here. It is a Python package to ease **datetime** manipulations. It is a drop-in replacement for Python's native class. Refer to the [documentation][3] for in-depth information. - -#### Installation - -``` -$ pip install pendulum -``` - -#### Example - -``` -import pendulum - -dt_toronto = pendulum.datetime(2012, 1, 1, tz='America/Toronto') -dt_vancouver = pendulum.datetime(2012, 1, 1, tz='America/Vancouver') - -print(dt_vancouver.diff(dt_toronto).in_hours()) - -3 -``` - -### Imbalanced-learn - -Most classification algorithms work best when the number of samples in each class is almost the same (i.e., balanced). But real-life cases are full of imbalanced datasets, which can have a bearing upon the learning phase and the subsequent prediction of machine learning algorithms. Fortunately, the **[imbalanced-learn][4]** library was created to address this issue. It is compatible with [**scikit-learn**][5] and is part of **[scikit-learn-contrib][6]** projects. Try it the next time you encounter imbalanced datasets. - -#### Installation - -``` -pip install -U imbalanced-learn - -# or - -conda install -c conda-forge imbalanced-learn -``` - -#### Example - -For usage and examples refer to the [documentation][7]. - -### FlashText - -Cleaning text data during natural language processing (NLP) tasks often requires replacing keywords in or extracting keywords from sentences. Usually, such operations can be accomplished with regular expressions, but they can become cumbersome if the number of terms to be searched runs into the thousands. - -Python's **[FlashText][8]** module, which is based upon the [FlashText algorithm][9], provides an apt alternative for such situations. The best part of FlashText is the runtime is the same irrespective of the number of search terms. You can read more about it in the [documentation][10]. - -#### Installation - -``` -$ pip install flashtext -``` - -#### Examples - -##### **Extract keywords:** - -``` -from flashtext import KeywordProcessor -keyword_processor = KeywordProcessor() - -# keyword_processor.add_keyword(, ) - -keyword_processor.add_keyword('Big Apple', 'New York') -keyword_processor.add_keyword('Bay Area') -keywords_found = keyword_processor.extract_keywords('I love Big Apple and Bay Area.') - -keywords_found -['New York', 'Bay Area'] -``` - -**Replace keywords:** - -``` -keyword_processor.add_keyword('New Delhi', 'NCR region') - -new_sentence = keyword_processor.replace_keywords('I love Big Apple and new delhi.') - -new_sentence -'I love New York and NCR region.' -``` - -For more examples, refer to the [usage][11] section in the documentation. - -### FuzzyWuzzy - -The name sounds weird, but **[FuzzyWuzzy][12]** is a very helpful library when it comes to string matching. It can easily implement operations like string comparison ratios, token ratios, etc. It is also handy for matching records kept in different databases. - -#### Installation - -``` -$ pip install fuzzywuzzy -``` - -#### Example - -``` -from fuzzywuzzy import fuzz -from fuzzywuzzy import process - -# Simple Ratio - -fuzz.ratio("this is a test", "this is a test!") -97 - -# Partial Ratio -fuzz.partial_ratio("this is a test", "this is a test!") - 100 -``` - -More examples can be found in FuzzyWuzzy's [GitHub repo.][12] - -### PyFlux - -Time-series analysis is one of the most frequently encountered problems in machine learning. **[PyFlux][13]** is an open source library in Python that was explicitly built for working with time-series problems. The library has an excellent array of modern time-series models, including but not limited to **ARIMA** , **GARCH** , and **VAR** models. In short, PyFlux offers a probabilistic approach to time-series modeling. It's worth trying out. - -#### Installation - -``` -pip install pyflux -``` - -#### Example - -Please refer to the [documentation][14] for usage and examples. - -### IPyvolume - -Communicating results is an essential aspect of data science, and visualizing results offers a significant advantage. **[**IPyvolume**][15]** is a Python library to visualize 3D volumes and glyphs (e.g., 3D scatter plots) in the Jupyter notebook with minimal configuration and effort. However, it is currently in the pre-1.0 stage. A good analogy would be something like this: IPyvolume's **volshow** is to 3D arrays what matplotlib's **imshow** is to 2D arrays. You can read more about it in the [documentation][16]. - -#### Installation - -``` -Using pip -$ pip install ipyvolume - -Conda/Anaconda -$ conda install -c conda-forge ipyvolume -``` - -#### Examples - -**Animation:** -![](https://opensource.com/sites/default/files/uploads/ipyvolume_animation.gif) - -**Volume rendering:** -![](https://opensource.com/sites/default/files/uploads/ipyvolume_volume-rendering.gif) - -### Dash - -**[Dash][17]** is a productive Python framework for building web applications. It is written on top of Flask, Plotly.js, and React.js and ties modern UI elements like drop-downs, sliders, and graphs to your analytical Python code without the need for JavaScript. Dash is highly suitable for building data visualization apps that can be rendered in the web browser. Consult the [user guide][18] for more details. - -#### Installation - -``` -pip install dash==0.29.0  # The core dash backend -pip install dash-html-components==0.13.2  # HTML components -pip install dash-core-components==0.36.0  # Supercharged components -pip install dash-table==3.1.3  # Interactive DataTable component (new!) -``` - -#### Example - -The following example shows a highly interactive graph with drop-down capabilities. As the user selects a value in the drop-down, the application code dynamically exports data from Google Finance into a Pandas DataFrame. -![](https://opensource.com/sites/default/files/uploads/dash_animation.gif) - -### Gym - -**[Gym][19]** from [OpenAI][20] is a toolkit for developing and comparing reinforcement learning algorithms. It is compatible with any numerical computation library, such as TensorFlow or Theano. The Gym library is a collection of test problems, also called environments, that you can use to work out your reinforcement-learning algorithms. These environments have a shared interface, which allows you to write general algorithms. - -#### Installation - -``` -pip install gym -``` - -#### Example - -The following example will run an instance of the environment **[CartPole-v0][21]** for 1,000 timesteps, rendering the environment at each step. -![](https://opensource.com/sites/default/files/uploads/gym_animation.gif) - -You can read about [other environments][22] on the Gym website. - -### Conclusion - -These are my picks for useful, but little-known Python libraries for data science. If you know another one to add to this list, please mention it in the comments below. - -This was originally published on the [Analytics Vidhya][23] Medium channel and is reprinted with permission. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/11/python-libraries-data-science - -作者:[Parul Pandey][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/parul-pandey -[b]: https://github.com/lujun9972 -[1]: https://pypi.org/project/wget/ -[2]: https://github.com/sdispater/pendulum -[3]: https://pendulum.eustace.io/docs/#installation -[4]: https://github.com/scikit-learn-contrib/imbalanced-learn -[5]: http://scikit-learn.org/stable/ -[6]: https://github.com/scikit-learn-contrib -[7]: http://imbalanced-learn.org/en/stable/api.html -[8]: https://github.com/vi3k6i5/flashtext -[9]: https://arxiv.org/abs/1711.00046 -[10]: https://flashtext.readthedocs.io/en/latest/ -[11]: https://flashtext.readthedocs.io/en/latest/#usage -[12]: https://github.com/seatgeek/fuzzywuzzy -[13]: https://github.com/RJT1990/pyflux -[14]: https://pyflux.readthedocs.io/en/latest/index.html -[15]: https://github.com/maartenbreddels/ipyvolume -[16]: https://ipyvolume.readthedocs.io/en/latest/?badge=latest -[17]: https://github.com/plotly/dash -[18]: https://dash.plot.ly/ -[19]: https://github.com/openai/gym -[20]: https://openai.com/ -[21]: https://gym.openai.com/envs/CartPole-v0 -[22]: https://gym.openai.com/ -[23]: https://medium.com/analytics-vidhya/python-libraries-for-data-science-other-than-pandas-and-numpy-95da30568fad diff --git a/translated/tech/20181119 9 obscure Python libraries for data science.md b/translated/tech/20181119 9 obscure Python libraries for data science.md new file mode 100644 index 0000000000..ec9cab2858 --- /dev/null +++ b/translated/tech/20181119 9 obscure Python libraries for data science.md @@ -0,0 +1,268 @@ + +9个不为人知晓的Python数据科学库 +====== + +除了 pandas 、scikit-learn 和 matplotlib,还要学习一些用 Python 进行数据科学的新技巧。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-python.jpg?itok=F2PYP2wT) + + +Python 是一种令人惊叹的语言。事实上,它是世界上增长最快的编程语言之一。它一次又一次地证明了它在各个行业的开发者和数据科学者中的作用。Python 及其库的整个生态系统使其成为全世界用户(初学者和高级用户)的恰当选择。它成功和受欢迎的原因之一是它的一组强大的库,使它如此动态和快速。 + +在本文中,我们将看到 Python 库中的一些数据科学工具,而不是那些常用的工具,如 **pandas,scikit-learn** ,和 **matplotlib** 。虽然像 **pandas,scikit-learn** 这样的库是机器学习中最常想到的,但是了解这个领域的其他 Python 产品库也是非常有帮助的。 + +### Wget + +提取数据,尤其是从网络中提取数据,是数据科学家的重要任务之一。[Wget][1] 是一个免费的工具,用于从网络上非交互式下载文件。它支持 HTTP、HTTPS 和 FTP 协议,以及通过 HTTP 代理进行检索。因为它是非交互式的,所以即使用户没有登录,它也可以在后台工作。所以下次你想下载一个网站或者网页上的所有图片,**wget** 会提供帮助。 + +#### 安装 + +``` +$ pip install wget +``` + +#### 例子 + +``` +import wget +url = 'http://www.futurecrew.com/skaven/song_files/mp3/razorback.mp3' + +filename = wget.download(url) +100% [................................................] 3841532 / 3841532 + +filename +'razorback.mp3' +``` + +### 钟摆 + +对于在 Python 中处理时间感到沮丧的人来说, **[Pendulum][2]** 库是很有帮助的。这是一个 Python 包,可以简化 **datetime** 操作。它是 Python 原生类的一个替换。有关详细信息,请参阅[documentation][3]。 + + +#### 安装 + +``` +$ pip install pendulum +``` + +#### 例子 + +``` +import pendulum + +dt_toronto = pendulum.datetime(2012, 1, 1, tz='America/Toronto') +dt_vancouver = pendulum.datetime(2012, 1, 1, tz='America/Vancouver') + +print(dt_vancouver.diff(dt_toronto).in_hours()) + +3 +``` + +### 不平衡学习 + +当每个类别中的样本数几乎相同(即平衡)时,大多数分类算法会工作得最好。但是现实生活中的案例中充满了不平衡的数据集,这可能会影响到机器学习算法的学习和后续预测。幸运的是, **[imbalanced-learn][4]** 库就是为了解决这个问题而创建的。它与[**scikit-learn**][5] 兼容,并且是 **[scikit-learn-contrib][6]** 项目的一部分。下次遇到不平衡的数据集时,可以尝试一下。 + +#### 安装 + +``` +pip install -U imbalanced-learn + +# or + +conda install -c conda-forge imbalanced-learn +``` + +#### 例子 + +有关用法和示例,请参阅 [documentation][7] 。 + + +### 闪光灯文字 + +在自然语言处理( NLP )任务中清理文本数据通常需要替换句子中的关键词或从句子中提取关键词。通常,这种操作可以用正则表达式来完成,但是如果要搜索的术语数达到数千个,它们可能会变得很麻烦。 + +Python的 **[FlashText][8]** 模块,基于 [FlashText algorithm][9]算法,为这种情况提供了一个合适的替代方案。FlashText 的最佳部分是运行时间与搜索项的数量无关。你可以在 [documentation][10] 中读到更多关于它的信息。 + +#### 安装 + +``` +$ pip install flashtext +``` + +#### 例子 + +##### **提取关键词:** + +``` +from flashtext import KeywordProcessor +keyword_processor = KeywordProcessor() + +# keyword_processor.add_keyword(, ) + +keyword_processor.add_keyword('Big Apple', 'New York') +keyword_processor.add_keyword('Bay Area') +keywords_found = keyword_processor.extract_keywords('I love Big Apple and Bay Area.') + +keywords_found +['New York', 'Bay Area'] +``` + +**替代关键词:** + +``` +keyword_processor.add_keyword('New Delhi', 'NCR region') + +new_sentence = keyword_processor.replace_keywords('I love Big Apple and new delhi.') + +new_sentence +'I love New York and NCR region.' +``` + +For more examples, refer to the [usage][11] section in the documentation. + +有关更多示例,请参阅文档中的 [usage][11] 一节。 + +### 模糊处理 + +这个名字听起来很奇怪,但是 **[FuzzyWuzzy][12]** 在字符串匹配方面是一个非常有用的库。它可以很容易地实现字符串比较、令牌比较等操作。对于匹配保存在不同数据库中的记录也很方便。 + +#### 安装 + +``` +$ pip install fuzzywuzzy +``` + +#### 例子 + +``` +from fuzzywuzzy import fuzz +from fuzzywuzzy import process + +# 简单的匹配率 + +fuzz.ratio("this is a test", "this is a test!") +97 + +# 部分的匹配率 +fuzz.partial_ratio("this is a test", "this is a test!") + 100 +``` + +更多的例子可以在 FuzzyWuzy 的 [GitHub repo.][12]得到。 + +### PyFlux + +时间序列分析是机器学习中最常遇到的问题之一。**[PyFlux][13]** 是Python中的开源库,专门为处理时间序列问题而构建的。该库拥有一系列优秀的现代时间序列模型,包括但不限于 **ARIMA** 、 **GARCH** ,、以及**VAR**模型。简而言之,PyFlux 为时间序列建模提供了一种概率方法。这值得一试。 + +#### 安装 + +``` +pip install pyflux +``` + +#### 例子 + +有关用法和示例,请参阅 [documentation][14]。 + +### IPyvolume + + +交流结果是数据科学的一个重要方面,可视化结果提供了显著优势。 **[**IPyvolume**][15]** 是一个Python库,用于在Jupyter笔记本中可视化3D体积和字形(例如3D散点图),配置和工作量极小。然而,它目前处于1.0之前的阶段。一个很好的类比是这样的: IPyVolumee **volshow** 是3D阵列,Matplotlib 的**imshow** 是2D阵列。你可以在 [documentation][16] 中读到更多关于它的信息。 + +#### 安装 + +``` +Using pip +$ pip install ipyvolume + +Conda/Anaconda +$ conda install -c conda-forge ipyvolume +``` + +#### 例子 + +**Animation:** +![](https://opensource.com/sites/default/files/uploads/ipyvolume_animation.gif) + +**Volume rendering:** +![](https://opensource.com/sites/default/files/uploads/ipyvolume_volume-rendering.gif) + +### Dash + +**[Dash][17]** 是一个用于构建 Web 应用程序的高效 Python 框架。它写在Flask、Plotty.js和Response.js 的顶部,将下拉菜单、滑块和图形等流行 UI 元素与分析 Python 代码联系起来,而不需要JavaScript。Dash 非常适合构建可在 Web 浏览器中呈现的数据可视化应用程序。有关详细信息,请参阅 [user guide][18] 。 + +#### 安装 + +``` +pip install dash==0.29.0  # The core dash backend +pip install dash-html-components==0.13.2  # HTML components +pip install dash-core-components==0.36.0  # Supercharged components +pip install dash-table==3.1.3  # Interactive DataTable component (new!) +``` + +#### 例子 + + +下面的示例显示了一个具有下拉功能的高度交互的图表。当用户在下拉列表中选择一个值时,应用程序代码将数据从Google Finance 动态导出到 Pandas 数据框架中。 +![](https://opensource.com/sites/default/files/uploads/dash_animation.gif) + +### Gym + +从[OpenAI][20] 而来的 **[Gym][19]** 是开发和比较强化学习算法的工具包。它与任何数值计算库兼容,如TensorFlow 或Theano 。Gym 是一个测试问题的集合,也称为环境,你可以用它来制定你的强化学习算法。这些环境有一个共享接口,允许您编写通用算法。 + +#### 安装 + +``` +pip install gym +``` + +#### 例子 + + + +以下示例将在 **[CartPole-v0][21]** 环境中,运行1,000次,在每一步渲染环境。 +![](https://opensource.com/sites/default/files/uploads/gym_animation.gif) + +You can read about [other environments][22] on the Gym website. +你可以在 Gym 网站上读到其他的 [other environments][22] 。 + +### 结论 + +这些是我挑选的有用但鲜为人知的数据科学 Python 库。如果你知道另一个要添加到这个列表中,请在下面的评论中提及。 +这本书最初发表在 [Analytics Vidhya][23] 的媒体频道上,并经许可转载。 + + +via: https://opensource.com/article/18/11/python-libraries-data-science + +作者:[Parul Pandey][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/parul-pandey +[b]: https://github.com/lujun9972 +[1]: https://pypi.org/project/wget/ +[2]: https://github.com/sdispater/pendulum +[3]: https://pendulum.eustace.io/docs/#installation +[4]: https://github.com/scikit-learn-contrib/imbalanced-learn +[5]: http://scikit-learn.org/stable/ +[6]: https://github.com/scikit-learn-contrib +[7]: http://imbalanced-learn.org/en/stable/api.html +[8]: https://github.com/vi3k6i5/flashtext +[9]: https://arxiv.org/abs/1711.00046 +[10]: https://flashtext.readthedocs.io/en/latest/ +[11]: https://flashtext.readthedocs.io/en/latest/#usage +[12]: https://github.com/seatgeek/fuzzywuzzy +[13]: https://github.com/RJT1990/pyflux +[14]: https://pyflux.readthedocs.io/en/latest/index.html +[15]: https://github.com/maartenbreddels/ipyvolume +[16]: https://ipyvolume.readthedocs.io/en/latest/?badge=latest +[17]: https://github.com/plotly/dash +[18]: https://dash.plot.ly/ +[19]: https://github.com/openai/gym +[20]: https://openai.com/ +[21]: https://gym.openai.com/envs/CartPole-v0 +[22]: https://gym.openai.com/ +[23]: https://medium.com/analytics-vidhya/python-libraries-for-data-science-other-than-pandas-and-numpy-95da30568fad From fc4c1debe83551d8781b6524f7b7fe6596d33ca8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 21:09:51 +0800 Subject: [PATCH 0451/1143] PRF:20180308 20 questions DevOps job candidates should be prepared to answer.md @FelixYFZ --- ...candidates should be prepared to answer.md | 70 ++++++++++++------- 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/translated/talk/20180308 20 questions DevOps job candidates should be prepared to answer.md b/translated/talk/20180308 20 questions DevOps job candidates should be prepared to answer.md index c236b5fef4..b675b5764b 100644 --- a/translated/talk/20180308 20 questions DevOps job candidates should be prepared to answer.md +++ b/translated/talk/20180308 20 questions DevOps job candidates should be prepared to answer.md @@ -1,26 +1,34 @@ -DevOps应聘者应该准备回答的20个问题 +DevOps 应聘者应该准备回答的 20 个问题 ====== +> 想要建立一个积极,富有成效的工作环境? 在招聘过程中要专注于寻找契合点。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/hire-job-career.png?itok=SrZo0QJ3) -聘请一个不合适的人代价是很高的。根据Link人力资源的首席执行官Jörgen Sundberg的统计,招聘,雇佣一名新员工将会花费公司$240,000之多,当你进行了一次不合适的招聘: - * 你失去了他们所知道的。 - * 你失去了他们认识的人 + +聘请一个不合适的人[代价是很高的][1]。根据 Link 人力资源的首席执行官 Jörgen Sundberg 的统计,招聘、雇佣一名新员工将会花费公司$240,000 之多,当你进行了一次不合适的招聘: + + * 你失去了他们的知识技能。 + * 你失去了他们的人脉。 * 你的团队将可能进入到一个组织发展的震荡阶段 * 你的公司将会面临组织破裂的风险 -当你失去一名员工的时候,你就像丢失了公司图谱中的一块。同样值得一提的是另一端的疼痛。应聘到一个错误工作岗位的员工会感受到很大的压力以及整个身心的不满意,甚至是健康问题。 +当你失去一名员工的时候,你就像丢失了公司版图中的一块。同样值得一提的是另一端的痛苦。应聘到一个错误工作岗位的员工会感受到很大的压力以及整个身心的不满意,甚至是健康问题。 + 另外一方面,当你招聘到合适的人时,新的员工将会: - * 丰富公司现有的文化,使你的组织成为一个更好的工作场所。研究表明一个积极的工作文化能够帮助驱动一个更长久的财务业绩,而且如果你在一个欢快的环境中工 作,你更有可能在生活中做的更好。 + + * 丰富公司现有的文化,使你的组织成为一个更好的工作场所。研究表明一个积极的工作文化能够帮助更长久推动财务业绩增长,而且如果你在一个欢快的环境中工作,你更有可能在生活中做的更好。 * 热爱和你的组织在一起工作。当人们热爱他们所在做的,他们会趋向于做的更好。 -招聘适合的或者加强现有的文化在DevOps和敏捷团多中是必不可少的。也就是说雇佣到一个能够鼓励积极合作的人,以便来自不同背景,有着不同目标和工作方式的团队能够在一起有效的工作。你新雇佣的员工因应该能够帮助团队合作来充分发挥放大他们的价值同时也能够增加员工的满意度以及平衡组织目标的冲突。他或者她应该能够通过明智的选择工具和工作流来促进你的组织,文化就是一切。 +招聘以适合或加强现有的文化在 DevOps 和敏捷团多中是必不可少的。也就是说雇佣到一个能够鼓励积极合作的人,以便来自不同背景,有着不同目标和工作方式的团队能够在一起有效的工作。你新雇佣的员工应该能够帮助团队合作来充分发挥放大他们的价值,同时也能够增加员工的满意度以及平衡组织目标的冲突。他或者她应该能够通过明智的选择工具和工作流来促进你的组织,文化就是一切。 + +作为我们 2017 年 11 月发布的一篇文章 [DevOps 的招聘经理应该准备回答的 20 个问题][4] 的回应,这篇文章将会重点关注在如何招聘最适合的人。 -作为我们2017年11月发布的一篇文章,[DevOps的招聘经理应该准备回答的20个问题][4],这篇文章将会重点关注在如何招聘最适合的人。 ### 为什么招聘走错了方向 -很多公司现在在用的典型的雇佣策略是基于人才过剩的基础上: - * 职位公告栏。 - * 关注和所需才能符合的应聘者。 +很多公司现在用的典型的雇佣策略是基于人才过剩的基础上: + + * 在职位公告栏发布招聘。 + * 关注具有所需才能的应聘者。 * 尽可能找多的候选者。 * 通过面试淘汰弱者。 * 通过正式的面试淘汰更多的弱者。 @@ -30,37 +38,48 @@ DevOps应聘者应该准备回答的20个问题 ![](https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/hiring_graphic.png?itok=1udGbkhB) 职位公告栏是有成千上万失业者人才过剩的经济大萧条时期发明的。在今天的求职市场上已经没有人才过剩了,然而我们仍然在使用基于此的招聘策略。 + ![](https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/732px-unemployed_men_queued_outside_a_depression_soup_kitchen_opened_in_chicago_by_al_capone_02-1931_-_nara_-_541927.jpg?itok=HSs4NjCN) ### 雇佣最合适的人员:运用文化和情感 -在人才过剩雇佣策略背后的思想是去设计工作岗位然后将人员安排进去。 -相反,做相反的事情:寻找将会积极融入你的商业文化的人才,然后为他们寻找他们热爱的最合适的岗位。要想如此实现,你必须能够围绕他们热情为他们创造工作岗位。 -**谁正在寻找一份工作?** 根据一份2016年对美国50,000名开发者的调查显示,[85.7%的受访对象][5]要么对新的机会不感兴趣,要么对于寻找新工作没有积极性。在寻找工作的那部分中,有将近[28.3%的求职者][5]来自于朋友的推荐。如果你只是在那些在找工作的人中寻找人才,你将会错过高端的人才。 -**运用团队力量去发现和寻找潜力的雇员**。列如,戴安娜是你的团队中的一名开发者,她所提供的机会即使她已经从事编程很多年而且在期间已经结识了很多从事热爱他们所从事的工作的人。难道你不认为她所推荐的潜在员工在技能,知识和智慧上要比HR所寻找的要优秀吗?在要求戴安娜分享她同伴之前,通知她即将到来的使命任务,向她阐明你要雇佣潜在有探索精神的团队,描述在将来会需要的知识领域。 -**雇员想要什么?**一份来自千禧年,婴儿潮实时期出生的人的对比综合性研究显示,20% 的人所想要的是相同的: + +在人才过剩雇佣策略背后的思想是设计工作岗位然后将人员安排进去。 + +反而应该反过来:寻找将会积极融入你的商业文化的人才,然后为他们寻找他们热爱的最合适的岗位。要想实现这样的目标,你必须能够围绕他们热情为他们创造工作岗位。 + +**谁正在寻找一份工作?** 根据一份 2016 年对美国 50000 名开发者的调查显示,[85.7% 的受访对象][5]要么对新的机会不感兴趣,要么对于寻找新工作没有积极性。在寻找工作的那部分中,有将近 [28.3% 的求职者][5]来自于朋友的推荐。如果你只是在那些在找工作的人中寻找人才,你将会错过高端的人才。 + +**运用团队力量去发现和寻找潜力的雇员**。例如,戴安娜是你的团队中的一名开发者,她所能提供的机会是,她已经[从事编程很多年][6]而且在期间已经结识了很多从事热爱他们所从事的工作的人。难道你不认为她所推荐的潜在员工在技能、知识和智慧上要比 HR 所寻找的要优秀吗?在要求戴安娜分享她同伴之前,通知她即将到来的使命任务,向她阐明你要雇佣潜在有探索精神的团队,描述在将来会需要的知识领域。 + +**雇员想要什么?**一份来自千禧年婴儿潮时期出生的人的对比综合性研究显示,20% 的人所想要的是相同的: + 1. 对组织产生积极的影响 2. 帮助解决社交或者环境上的挑战 3. 和一群有动力的人一起工作 ### 面试的挑战 -面试应该是招聘者和应聘者双方为了寻找最合适的人才进行的一次双方之间的对话。将面试聚焦在企业文化和情感对话两个问题上:这个应聘者将会丰富你的企业文化并且会热爱和你在一起工作吗?你能够在工作中帮他们取得成功吗? -**对于招聘经理来说:** 每一次的面试都是你学习如何将自己的组织变得对未来的团队成员更有吸引力,并且每次积极的面试多都可能是你发现人才(即使你不会雇佣)的机会。每个人都将会记得积极有效的面试的经历。即使他们不会被雇佣,他们将会和他们的朋友谈论这次经历,你竟会得到一个被推荐的机会。这又很大的好处:如果你无法吸引到这个人才,你也将会从中学习吸取经验并且改善。 -**对面试者来说**:每次的面试都是你释放激情的机会 -### 助你释放潜在雇员激情的20个问题 +面试应该是招聘者和应聘者双方为了寻找最合适的人才进行的一次双方之间的对话。将面试聚焦在企业文化和情感对话两个问题上:这个应聘者将会丰富你的企业文化并且会热爱和你在一起工作吗?你能够在工作中帮他们取得成功吗? + +**对于招聘经理来说:** 每一次的面试都是你学习如何将自己的组织变得对未来的团队成员更有吸引力,并且每次积极的面试都可能是你发现人才(即使你不会雇佣)的机会。每个人都将会记得积极有效的面试的经历。即使他们不会被雇佣,他们将会和他们的朋友谈论这次经历,你会得到一个被推荐的机会。这有很大的好处:如果你无法吸引到这个人才,你也将会从中学习吸取经验并且改善。 + +**对面试者来说**:每次的面试都是你释放激情的机会。 + +### 助你释放潜在雇员激情的 20 个问题 + 1. 你热爱什么? - 2. “今天早晨我已经迫不及待的要去工作”你怎么看待这句话? + 2. “今天早晨我已经迫不及待的要去工作”,你怎么看待这句话? 3. 你曾经最快乐的是什么? 4. 你曾经解决问题的最典型的例子是什么,你是如何解决的? 5. 你如何看待配对学习? 6. 你到达办公室和离开办公室心里最先想到的是什么? - 7. 你如果你有一次改变你之前或者现在的共工作的一件事的机会,将会是什么事? - 8. 当你在这工作的时候,你最兴奋去学习什么? + 7. 你如果你有一次改变你之前或者现在的工作中的一件事的机会,将会是什么事? + 8. 当你在工作的时候,你最乐于去学习什么? 9. 你的梦想是什么,你如何去实现? 10. 你在学会如何去实现你的追求的时候想要或者需要什么? 11. 你的价值观是什么? 12. 你是如何坚守自己的价值观的? - 13. 平衡在你的生活中意味着什么? + 13. 在你的生活中平衡意味着什么? 14. 你最引以为傲的工作交流能力是什么?为什么? 15. 你最喜欢营造什么样的环境? 16. 你喜欢别人怎样对待你? @@ -70,14 +89,13 @@ DevOps应聘者应该准备回答的20个问题 20. 如果你正在雇佣我,你将会问我什么问题? - -------------------------------------------------------------------------------- via: https://opensource.com/article/18/3/questions-devops-employees-should-answer 作者:[Catherine Louis][a] 译者:[FelixYFZ](https://github.com/FelixYFZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e988b202f1c117b357bbbc84265db4d0d9ab1ffc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 21:10:14 +0800 Subject: [PATCH 0452/1143] PUB:20180308 20 questions DevOps job candidates should be prepared to answer.md @FelixYFZ https://linux.cn/article-10275-1.html --- ...uestions DevOps job candidates should be prepared to answer.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180308 20 questions DevOps job candidates should be prepared to answer.md (100%) diff --git a/translated/talk/20180308 20 questions DevOps job candidates should be prepared to answer.md b/published/20180308 20 questions DevOps job candidates should be prepared to answer.md similarity index 100% rename from translated/talk/20180308 20 questions DevOps job candidates should be prepared to answer.md rename to published/20180308 20 questions DevOps job candidates should be prepared to answer.md From 79b029e755e6d4103f6e9167d8381c77b7cd343f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 21:51:30 +0800 Subject: [PATCH 0453/1143] PRF:20180831 Test containers with Python and Conu.md @GraveAccent --- ...31 Test containers with Python and Conu.md | 91 ++++++++++--------- 1 file changed, 49 insertions(+), 42 deletions(-) diff --git a/translated/tech/20180831 Test containers with Python and Conu.md b/translated/tech/20180831 Test containers with Python and Conu.md index dbf9fa090b..286ebf116b 100644 --- a/translated/tech/20180831 Test containers with Python and Conu.md +++ b/translated/tech/20180831 Test containers with Python and Conu.md @@ -3,11 +3,12 @@ ![](https://fedoramagazine.org/wp-content/uploads/2018/08/conu-816x345.jpg) -越来越多的开发人员使用容器开发和部署他们的应用。这意味着可以轻松地测试容器也变得很重要。[Conu][1] (container utilities 的简写) 是一个Python库,让你编写容器测试变得简单。本文向你介绍如何使用它测试容器。 +越来越多的开发人员使用容器开发和部署他们的应用。这意味着可以轻松地测试容器也变得很重要。[Conu][1] (container utilities 的简写) 是一个 Python 库,让你编写容器测试变得简单。本文向你介绍如何使用它测试容器。 ### 开始吧 -首先,你需要一个容器程序来测试。为此,以下命令创建一个包含一个容器 Dockerfile 和一个被容器伺服的 Flask 应用程序的文件夹。 +首先,你需要一个容器程序来测试。为此,以下命令创建一个包含一个容器的 Dockerfile 和一个被容器伺服的 Flask 应用程序的文件夹。 + ```bash $ mkdir container_test $ cd container_test @@ -15,22 +16,24 @@ $ touch Dockerfile $ touch app.py ``` -将以下代码复制到 app.py 文件中。这是惯常的基本 Flask 应用,它返回字符串“Hello Container World!”。 +将以下代码复制到 `app.py` 文件中。这是惯常的基本 Flask 应用,它返回字符串 “Hello Container World!”。 + ```python from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): - return 'Hello Container World!' + return 'Hello Container World!' if __name__ == '__main__': - app.run(debug=True,host='0.0.0.0') + app.run(debug=True,host='0.0.0.0') ``` ### 创建和构建测试容器 为了构建测试容器,将以下指令添加到 Dockerfile。 + ```dockerfile FROM registry.fedoraproject.org/fedora-minimal:latest RUN microdnf -y install python3-flask && microdnf clean all @@ -39,6 +42,7 @@ CMD ["python3", "/srv/app.py"] ``` 然后使用 Docker CLI 工具构建容器。 + ```bash $ sudo dnf -y install docker $ sudo systemctl start docker @@ -48,6 +52,7 @@ $ sudo docker build . -t flaskapp_container 提示:只有在系统上未安装 Docker 时才需要前两个命令。 构建之后使用以下命令运行容器。 + ```bash $ sudo docker run -p 5000:5000 --rm flaskapp_container * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) @@ -56,17 +61,19 @@ $ sudo docker run -p 5000:5000 --rm flaskapp_container * Debugger PIN: 473-505-51 ``` -最后,使用 curl 检查 Flask 应用程序是否在容器内正确运行: +最后,使用 `curl` 检查 Flask 应用程序是否在容器内正确运行: + ```bash $ curl http://127.0.0.1:5000 Hello Container World! ``` -现在,flaskapp_container 正在运行并准备好进行测试,你可以使用 Ctrl+C 将其停止。 +现在,flaskapp_container 正在运行并准备好进行测试,你可以使用 `Ctrl+C` 将其停止。 ### 创建测试脚本 -在编写测试脚本之前,必须安装 conu。在先前创建的 container_test 目录中,运行以下命令。 +在编写测试脚本之前,必须安装 `conu`。在先前创建的 `container_test` 目录中,运行以下命令。 + ```bash $ python3 -m venv .venv $ source .venv/bin/activate @@ -75,48 +82,48 @@ $ source .venv/bin/activate $ touch test_container.py ``` -然后将以下脚本复制并保存在 test_container.py 文件中。 +然后将以下脚本复制并保存在 `test_container.py` 文件中。 + ```python import conu PORT = 5000 with conu.DockerBackend() as backend: - image = backend.ImageClass("flaskapp_container") - options = ["-p", "5000:5000"] - container = image.run_via_binary(additional_opts=options) + image = backend.ImageClass("flaskapp_container") + options = ["-p", "5000:5000"] + container = image.run_via_binary(additional_opts=options) + + try: + # Check that the container is running and wait for the flask application to start. + assert container.is_running() + container.wait_for_port(PORT) + + # Run a GET request on / port 5000. + http_response = container.http_request(path="/", port=PORT) + + # Check the response status code is 200 + assert http_response.ok + + # Get the response content + response_content = http_response.content.decode("utf-8") - try: - # Check that the container is running and wait for the flask application to start. - assert container.is_running() - container.wait_for_port(PORT) + # Check that the "Hello Container World!" string is served. + assert "Hello Container World!" in response_content - # Run a GET request on / port 5000. - http_response = container.http_request(path="/", port=PORT) - - # Check the response status code is 200 - assert http_response.ok - - # Get the response content - response_content = http_response.content.decode("utf-8") - - # Check that the "Hello Container World!" string is served. - assert "Hello Container World!" in response_content - - # Get the logs from the container - logs = [line for line in container.logs()] - # Check the the Flask application saw the GET request. - assert b'"GET / HTTP/1.1" 200 -' in logs[-1] - - finally: - container.stop() - container.delete() + # Get the logs from the container + logs = [line for line in container.logs()] + # Check the the Flask application saw the GET request. + assert b'"GET / HTTP/1.1" 200 -' in logs[-1] + finally: + container.stop() + container.delete() ``` #### 测试设置 -这个脚本首先设置 conu 使用 Docker 作为后端来运行容器。然后它设置容器镜像以使用你在本教程第一部分中构建的 flaskapp_container。 +这个脚本首先设置 `conu` 使用 Docker 作为后端来运行容器。然后它设置容器镜像以使用你在本教程第一部分中构建的 flaskapp_container。 下一步是配置运行容器所需的选项。在此示例中,Flask 应用在端口5000上提供内容。于是你需要暴露此端口并将其映射到主机上的同一端口。 @@ -124,13 +131,13 @@ with conu.DockerBackend() as backend: #### 测试方法 -在测试容器之前,检查容器是否正在运行并准备就绪。示范脚本使用 container.is_running 和 container.wait_for_port。这些方法可确保容器正在运行,并且服务在预设端口上可用。 +在测试容器之前,检查容器是否正在运行并准备就绪。示范脚本使用 `container.is_running` 和 `container.wait_for_port`。这些方法可确保容器正在运行,并且服务在预设端口上可用。 -container.http_request 是 [request][2] 库的包装器,可以方便地在测试期间发送 HTTP 请求。这个方法返回[requests.Responseobject][3],因此可以轻松地访问响应的内容以进行测试。 +`container.http_request` 是 [request][2] 库的包装器,可以方便地在测试期间发送 HTTP 请求。这个方法返回[requests.Responseobject][3],因此可以轻松地访问响应的内容以进行测试。 -Conu 还可以访问容器日志。又一次,这在测试期间非常有用。在上面的示例中,container.logs 方法返回容器日志。你可以使用它们断言打印了特定日志,或者,例如在测试期间没有异常被引发。 +`conu` 还可以访问容器日志。又一次,这在测试期间非常有用。在上面的示例中,`container.logs` 方法返回容器日志。你可以使用它们断言打印了特定日志,或者,例如在测试期间没有异常被引发。 -Conu 提供了许多与容器接合的有用方法。[文档][4]中提供了完整的 API 列表。你还可以参考 [GitHub][5] 上提供的示例。 +`conu` 提供了许多与容器接合的有用方法。[文档][4]中提供了完整的 API 列表。你还可以参考 [GitHub][5] 上提供的示例。 运行本教程所需的所有代码和文件也可以在 [GitHub][6] 上获得。 对于想要进一步采用这个例子的读者,你可以看看使用 [pytest][7] 来运行测试并构建一个容器测试套件。 @@ -141,7 +148,7 @@ via: https://fedoramagazine.org/test-containers-python-conu/ 作者:[Clément Verna][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[GraveAccent](https://github.com/GraveAccent) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3e971304459ded396afd1bd6d8636087a7ac7341 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 21:51:54 +0800 Subject: [PATCH 0454/1143] PUB:20180831 Test containers with Python and Conu.md @GraveAccent https://linux.cn/article-10276-1.html --- .../20180831 Test containers with Python and Conu.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180831 Test containers with Python and Conu.md (100%) diff --git a/translated/tech/20180831 Test containers with Python and Conu.md b/published/20180831 Test containers with Python and Conu.md similarity index 100% rename from translated/tech/20180831 Test containers with Python and Conu.md rename to published/20180831 Test containers with Python and Conu.md From 467d4fbe1ae7447234ea8c2d856719f07c4faca7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 22:28:48 +0800 Subject: [PATCH 0455/1143] PRF:20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md @qhwdw --- ... the Kernel Community Is Securing Linux.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md b/translated/tech/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md index a110960a9f..58996654e5 100644 --- a/translated/tech/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md +++ b/translated/tech/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md @@ -1,42 +1,42 @@ -Greg Kroah-Hartman 解释内核社区如何保护 Linux -============================================================ +Greg Kroah-Hartman 解释内核社区是如何使 Linux 安全的 +============ ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/kernel-security_0.jpg?itok=hOaTQwWV) -内核维护者 Greg Kroah-Hartman 谈论内核社区如何保护 Linux 不遭受损害。[Creative Commons Zero][2] -由于 Linux 使用量持续扩大,内核社区去提高全世界最广泛使用的技术 — Linux 内核的安全性的重要程序越来越高。安全不仅对企业客户很重要,它对消费者也很重要,因为 80% 的移动设备都使用了 Linux。在本文中,Linux 内核维护者 Greg Kroah-Hartman 带我们了解内核社区如何应对威胁。 +> 内核维护者 Greg Kroah-Hartman 谈论内核社区如何保护 Linux 不遭受损害。 + +由于 Linux 使用量持续扩大,内核社区去提高这个世界上使用最广泛的技术 —— Linux 内核的安全性的重要性越来越高。安全不仅对企业客户很重要,它对消费者也很重要,因为 80% 的移动设备都使用了 Linux。在本文中,Linux 内核维护者 Greg Kroah-Hartman 带我们了解内核社区如何应对威胁。 ### bug 不可避免 - ![Greg Kroah-Hartman](https://www.linux.com/sites/lcom/files/styles/floated_images/public/greg-k-h.png?itok=p4fREYuj "Greg Kroah-Hartman") -Greg Kroah-Hartman [Linux 基金会][1] +*Greg Kroah-Hartman [Linux 基金会][1]* -正如 Linus Torvalds 曾经说过,大多数安全问题都是 bug 造成的,而 bug 又是软件开发过程的一部分。是个软件就有 bug。 +正如 Linus Torvalds 曾经说过的,大多数安全问题都是 bug 造成的,而 bug 又是软件开发过程的一部分。是软件就有 bug。 -Kroah-Hartman 说:“就算是 bug ,我们也不知道它是安全的 bug 还是不安全的 bug。我修复的一个著名 bug,在三年后才被 Red Hat 认定为安全漏洞“。 +Kroah-Hartman 说:“就算是 bug,我们也不知道它是安全的 bug 还是不安全的 bug。我修复的一个著名 bug,在三年后才被 Red Hat 认定为安全漏洞“。 在消除 bug 方面,内核社区没有太多的办法,只能做更多的测试来寻找 bug。内核社区现在已经有了自己的安全团队,它们是由熟悉内核核心的内核开发者组成。 -Kroah Hartman 说:”当我们收到一个报告时,我们就让参与这个领域的核心开发者去修复它。在一些情况下,他们可能是同一个人,让他们进入安全团队可以更快地解决问题“。但他也强调,内核所有部分的开发者都必须清楚地了解这些问题,因为内核是一个可信环境,它必须被保护起来。 +Kroah-Hartman 说:”当我们收到一个报告时,我们就让参与这个领域的核心开发者去修复它。在一些情况下,他们可能是同一个人,让他们进入安全团队可以更快地解决问题“。但他也强调,内核所有部分的开发者都必须清楚地了解这些问题,因为内核是一个可信环境,它必须被保护起来。 -Kroah Hartman 说:”一旦我们修复了它,我们就将它放到我们的栈分析规则中,以便于以后不再重新出现这个 bug。“ +Kroah-Hartman 说:”一旦我们修复了它,我们就将它放到我们的栈分析规则中,以便于以后不再重新出现这个 bug。“ -除修复 bug 之外,内核社区也不断加固内核。Kroah Hartman 说:“我们意识到,我们需要一些主动的缓减措施。因此我们需要加固内核。” +除修复 bug 之外,内核社区也不断加固内核。Kroah-Hartman 说:“我们意识到,我们需要一些主动的缓减措施,因此我们需要加固内核。” -Kees Cook 和其他一些人付出了巨大的努力,带来了一直在内核之外的加固特性,并将它们合并或适配到内核中。在每个内核发行后,Cook 都对所有新的加固特性做一个总结。但是只加固内核是不够的,供应商必须要启用这些新特性来让它们充分发挥作用。但他们并没有这么做。 +Kees Cook 和其他一些人付出了巨大的努力,带来了一直在内核之外的加固特性,并将它们合并或适配到内核中。在每个内核发行后,Cook 都对所有新的加固特性做一个总结。但是只加固内核是不够的,供应商们必须要启用这些新特性来让它们充分发挥作用,但他们并没有这么做。 -Kroah-Hartman [每周发布一个稳定版内核][5],而为了长周期的支持,公司只从中挑选一个,以便于设备制造商能够利用它。但是,Kroah-Hartman 注意到,除了 Google Pixel 之外,大多数 Android 手机并不包含这些额外的安全加固特性,这就意味着,所有的这些手机都是有漏洞的。他说:“人们应该去启用这些加固特性”。 +Kroah-Hartman [每周发布一个稳定版内核][5],而为了长期的支持,公司们只从中挑选一个,以便于设备制造商能够利用它。但是,Kroah-Hartman 注意到,除了 Google Pixel 之外,大多数 Android 手机并不包含这些额外的安全加固特性,这就意味着,所有的这些手机都是有漏洞的。他说:“人们应该去启用这些加固特性”。 -Kroah-Hartman 说:“我购买了基于 Linux 内核 4.4 的所有旗舰级手机,去查看它们中哪些确实升级了新特性。结果我发现只有一家公司升级了它们的内核”。“我在整个供应链中努力去解决这个问题,因为这是一个很棘手的问题。它涉及许多不同的组织 — SoC 制造商、运营商、等等。关键点是,需要他们把我们辛辛苦苦设计的内核去推送给大家。 +Kroah-Hartman 说:“我购买了基于 Linux 内核 4.4 的所有旗舰级手机,去查看它们中哪些确实升级了新特性。结果我发现只有一家公司升级了它们的内核。……我在整个供应链中努力去解决这个问题,因为这是一个很棘手的问题。它涉及许多不同的组织 —— SoC 制造商、运营商等等。关键点是,需要他们把我们辛辛苦苦设计的内核去推送给大家。” -好消息是,与消息电子产品不一样,像 Red Hat 和 SUSE 这样的大供应商,在企业环境中持续对内核进行更新。使用容器、pod、和虚拟化的现代系统做到这一点更容易了。无需停机就可以毫不费力地更新和重启。事实上,现在来保证系统安全相比过去容易多了。 +好消息是,与消费电子产品不一样,像 Red Hat 和 SUSE 这样的大供应商,在企业环境中持续对内核进行更新。使用容器、pod 和虚拟化的现代系统做到这一点更容易了。无需停机就可以毫不费力地更新和重启。事实上,现在来保证系统安全相比过去容易多了。 ### Meltdown 和 Spectre -没有任何一个关于安全的讨论能够避免提及 Meltdown 和 Spectre。内核社区一直致力于修改新发现的和已查明的安全漏洞。不管怎样,Intel 已经因为这些事情改变了它们的策略。 +没有任何一个关于安全的讨论能够避免提及 Meltdown 和 Spectre 缺陷。内核社区一直致力于修改新发现的和已查明的安全漏洞。不管怎样,Intel 已经因为这些事情改变了它们的策略。 Kroah-Hartman 说:“他们已经重新研究如何处理安全 bug,以及如何与社区合作,因为他们知道他们做错了。内核已经修复了几乎所有大的 Spectre 问题,但是还有一些小问题仍在处理中”。 @@ -57,7 +57,7 @@ via: https://www.linux.com/blog/2018/10/greg-kroah-hartman-explains-how-kernel-c 作者:[SWAPNIL BHARTIYA][a] 选题:[oska874][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e2ef25c0a0e9dfb66332b6a170c3dda35fb15312 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 22:29:09 +0800 Subject: [PATCH 0456/1143] PUB:20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md @qhwdw https://linux.cn/article-10277-1.html --- ...Hartman Explains How the Kernel Community Is Securing Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md (100%) diff --git a/translated/tech/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md b/published/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md similarity index 100% rename from translated/tech/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md rename to published/20181002 Greg Kroah-Hartman Explains How the Kernel Community Is Securing Linux.md From 5d2619598123b38802ecd12f6e8bae2e35b9b136 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 23:00:08 +0800 Subject: [PATCH 0457/1143] PRF:20181115 How to install a device driver on Linux.md @Jamskr --- ...How to install a device driver on Linux.md | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/translated/tech/20181115 How to install a device driver on Linux.md b/translated/tech/20181115 How to install a device driver on Linux.md index e078e05c0c..bd1c3fd353 100644 --- a/translated/tech/20181115 How to install a device driver on Linux.md +++ b/translated/tech/20181115 How to install a device driver on Linux.md @@ -1,38 +1,40 @@ 如何在 Linux 上安装设备驱动程序 ====== -学习 Linux 设备驱动如何工作,并知道如何使用它们。 + +> 学习 Linux 设备驱动如何工作,并知道如何使用它们。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc) -对于一个熟悉 Windows 或者 MacOS 的人,想要切换到 Linux,它们都会面临一个艰巨的问题就是怎么安装和配置设备驱动。这是可以理解的,因为 Windows 和 MacOS 都有一套机制把这个过程做得非常的友好。比如说,当你插入一个新的硬件设备, Windows 能够自动检测并会弹出一个窗口询问你是否要继续驱动程序。你也可以从网络上下载驱动程序,仅仅需要双击解压或者是通过设备管理器导入驱动程序即可。 +对于一个熟悉 Windows 或者 MacOS 的人,想要切换到 Linux,它们都会面临一个艰巨的问题就是怎么安装和配置设备驱动。这是可以理解的,因为 Windows 和 MacOS 都有一套机制把这个过程做得非常的友好。比如说,当你插入一个新的硬件设备, Windows 能够自动检测并会弹出一个窗口询问你是否要继续驱动程序的安装。你也可以从网络上下载驱动程序,仅仅需要双击解压或者是通过设备管理器导入驱动程序即可。 而这在 Linux 操作系统上并非这么简单。第一个原因是, Linux 是一个开源的操作系统,所以有 [数百种 Linux 发行版的变体][1]。也就是说不可能做一个指南来适应所有的 Linux 发行版。因为每种 Linux 安装驱动程序的过程都有差异。 -第二,大多数默认的 Linux 驱动程序也都是开源的,并被集成到了系统中,这使得安装一些并未包含的驱动程序变得非常复杂,即使已经可以检测大多数的硬件设备。第三,不同发行版的许可也有差异。例如,[Fedora 禁止事项][2] 禁止包含专有的,受法律保护,或者是违反美国法律的驱动程序。而 Ubuntu 则让用户[避免使用受法律保护或闭源的硬件设备][3]。 +第二,大多数默认的 Linux 驱动程序也都是开源的,并被集成到了系统中,这使得安装一些并未包含的驱动程序变得非常复杂,即使已经可以检测大多数的硬件设备。第三,不同发行版的许可也有差异。例如,[Fedora 禁止事项][2] 禁止包含专有的、受法律保护,或者是违反美国法律的驱动程序。而 Ubuntu 则让用户[避免使用受法律保护或闭源的硬件设备][3]。 -为了更好的学习 Linux 驱动程序是如何工作的,我建议阅读 Linux 设备驱动程序一书中的 [设备驱动程序简介][4]。 +为了更好的学习 Linux 驱动程序是如何工作的,我建议阅读 《Linux 设备驱动程序》一书中的 [设备驱动程序简介][4]。 ### 两种方式来寻找驱动程序 -#### 1\. 用户界面 +#### 1、 用户界面 如果是一个刚从 Windows 或 MacOS 转过来的 Linux 新手,那你会很高兴知道 Linux 也提供了一个通过向导式的程序来查看驱动程序是否可用的方法。 Ubuntu 提供了一个 [附加驱动程序][5] 选项。其它的 Linux 发行版也提供了帮助程序,像 [GNOME 的包管理器][6],你可以使用它来检查驱动程序是否可用。 -#### 2\. 命令行 +#### 2、 命令行 -如果你通过漂亮的用户界面找到驱动程序,那又该怎么办呢?或许你只能通过没有任何图形界面的 shell?甚至你可以使用控制台来展现你的技能。你有两个选择: +如果你通过漂亮的用户界面没有找到驱动程序,那又该怎么办呢?或许你只能通过没有任何图形界面的 shell?甚至你可以使用控制台来展现你的技能。你有两个选择: - A. **通过一个仓库** -这和 MacOS 中的 [**homebrew**][7] 命令行很像。通过使用 `yum` , `dnf` , `apt-get` , 等等。你基本可以通过添加仓库,并更新包缓存。 +1. **通过一个仓库** - B. **下载, 编译, 然后自己构建** -这通常包括直接从网络,或通过 `wget` 命令下载源码包,然后运行配置和编译、安装。这超出了本文的范围,但是你可以在网络上找到很多在线指南,如果你选择的是这条路的话。 + 这和 MacOS 中的 [homebrew][7] 命令行很像。通过使用 `yum`、 `dnf`、`apt-get` 等等。你基本可以通过添加仓库,并更新包缓存。 +2. **下载、编译,然后自己构建** + + 这通常包括直接从网络,或通过 `wget` 命令下载源码包,然后运行配置和编译、安装。这超出了本文的范围,但是你可以在网络上找到很多在线指南,如果你选择的是这条路的话。 ### 检查是否已经安装了这个驱动程序 在进一步学习安装 Linux 驱动程序之前,让我们来学习几条命令,用来检测驱动程序是否已经在你的系统上可用。 -[`lspci`][8] 命令显示了系统上所有 PCI 总线和设备驱动程序的详细信息。 +[lspci][8] 命令显示了系统上所有 PCI 总线和设备驱动程序的详细信息。 ``` $ lscpci @@ -46,13 +48,13 @@ $ lscpci | grep SOME_DRIVER_KEYWORD 例如,你可以使用 `lspci | grep SAMSUNG` 命令,如果你想知道是否安装过三星的驱动。 -[`dmesg`][9] 命令显示了所有内核识别的驱动程序。 +[dmesg][9] 命令显示了所有内核识别的驱动程序。 ``` $ dmesg ``` -或配合 `grep` 使用 +或配合 `grep` 使用: ``` $ dmesg | grep SOME_DRIVER_KEYWORD @@ -72,7 +74,7 @@ $ /sbin/lsmod $ find /lib/modules ``` -小贴士:和`lspci` 或 `dmesg` 一样,通过在上面的命令后面加上 `| grep` 来过滤结果。 +技巧:和 `lspci` 或 `dmesg` 一样,通过在上面的命令后面加上 `| grep` 来过滤结果。 如果一个驱动程序已经被识别到了,但是通过 `lscpi` 或 `dmesg` 并没有找到,这意味着驱动程序已经存在于硬盘上,但是并没有加载到内核中,这种情况,你可以通过 `modprobe` 命令来加载这个模块。 @@ -84,9 +86,9 @@ $ sudo modprobe MODULE_NAME ### 添加仓库并安装 -可以通过 `yum` , `dnf` , 和 `apt-get` 几种不同的方式来添加一个仓库;一个个介绍完它们并不在本文的范围。简单一点来说,这个示例将会使用 `apt-get` ,但是这个命令和其它的几个都是很类似的。 +可以通过 `yum`、`dnf` 和 `apt-get` 几种不同的方式来添加一个仓库;一个个介绍完它们并不在本文的范围。简单一点来说,这个示例将会使用 `apt-get` ,但是这个命令和其它的几个都是很类似的。 -**1\. 删除存在的仓库,如果它存在.** +#### 1、删除存在的仓库,如果它存在 ``` $ sudo apt-get purge NAME_OF_DRIVER* @@ -94,7 +96,7 @@ $ sudo apt-get purge NAME_OF_DRIVER* 其中 `NAME_OF_DRIVER` 是你的驱动程序的可能的名称。你还可以将模式匹配加到正则表达式中来进一步过滤。 -**2\. 将仓库加入到仓库表中,这应该在驱动程序指南中有指定** +#### 2、将仓库加入到仓库表中,这应该在驱动程序指南中有指定 ``` $ sudo add-apt-repository REPOLIST_OF_DRIVER @@ -102,23 +104,22 @@ $ sudo add-apt-repository REPOLIST_OF_DRIVER 其中 `REPOLIST_OF_DRIVER` 应该从驱动文档中有指定(例如:`epel-list`)。 -**3\. 更新仓库列表。** +#### 3、更新仓库列表 ``` $ sudo apt-get update ``` -**4\. 安装驱动程序。** +#### 4、安装驱动程序 ``` $ sudo apt-get install NAME_OF_DRIVER ``` -**5\. 检查安装状态.** +#### 5、检查安装状态 像上面说的一样,通过 `lscpi` 命令来检查驱动程序是否已经安装成功。 - -------------------------------------------------------------------------------- via: https://opensource.com/article/18/11/how-install-device-driver-linux @@ -126,7 +127,7 @@ via: https://opensource.com/article/18/11/how-install-device-driver-linux 作者:[Bryant Son][a] 选题:[lujun9972][b] 译者:[Jamskr](https://github.com/Jamskr) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 62305fcc0a12a26a351c688cb5170d21776f70a6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Nov 2018 23:00:41 +0800 Subject: [PATCH 0458/1143] PUB:20181115 How to install a device driver on Linux.md @Jamskr https://linux.cn/article-10278-1.html --- .../20181115 How to install a device driver on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181115 How to install a device driver on Linux.md (100%) diff --git a/translated/tech/20181115 How to install a device driver on Linux.md b/published/20181115 How to install a device driver on Linux.md similarity index 100% rename from translated/tech/20181115 How to install a device driver on Linux.md rename to published/20181115 How to install a device driver on Linux.md From 2864992caa774553fca635c3ad7a8a09d626d538 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 26 Nov 2018 08:56:15 +0800 Subject: [PATCH 0459/1143] translated --- ... To Browse Stack Overflow From Terminal.md | 140 ------------------ ... To Browse Stack Overflow From Terminal.md | 139 +++++++++++++++++ 2 files changed, 139 insertions(+), 140 deletions(-) delete mode 100644 sources/tech/20180417 How To Browse Stack Overflow From Terminal.md create mode 100644 translated/tech/20180417 How To Browse Stack Overflow From Terminal.md diff --git a/sources/tech/20180417 How To Browse Stack Overflow From Terminal.md b/sources/tech/20180417 How To Browse Stack Overflow From Terminal.md deleted file mode 100644 index 0bd7789d87..0000000000 --- a/sources/tech/20180417 How To Browse Stack Overflow From Terminal.md +++ /dev/null @@ -1,140 +0,0 @@ -translating---geekpi - -How To Browse Stack Overflow From Terminal -====== - -![](https://www.ostechnix.com/wp-content/uploads/2018/04/how2-720x340.png) -A while ago, we have written about [**SoCLI**][1], a python script to search and browse Stack Overflow website from command line. Today, we will discuss about a similar tool named **“how2”**. It is a command line utility to browse Stack Overflow from Terminal. You can query in the plain English as the way you do in [**Google search**][2] and it uses Google and Stackoverflow APIs to search for the given queries. It is free and open source utility written using NodeJS. - -### Browse Stack Overflow From Terminal Using how2 - -Since how2 is a NodeJS package, we can install it using Npm package manager. If you haven’t installed Npm and NodeJS already, refer the following guide. - -After installing Npm and NodeJS, run the following command to install how2 utility. -``` -$ npm install -g how2 - -``` - -Now let us see how to browse Stack Overflow uisng this program. The typical usage to search through Stack Overflow site using “how2” utility is: -``` -$ how2 - -``` - -For example, I am going to search for how to create tgz archive. -``` -$ how2 create archive tgz - -``` - -Oops! I get the following error. -``` -/home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/transport.js:59 -Transport.prototype.__proto__ = EventEmitter.prototype; - ^ - - TypeError: Cannot read property 'prototype' of undefined - at Object. (/home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/transport.js:59:46) - at Module._compile (internal/modules/cjs/loader.js:654:30) - at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) - at Module.load (internal/modules/cjs/loader.js:566:32) - at tryModuleLoad (internal/modules/cjs/loader.js:506:12) - at Function.Module._load (internal/modules/cjs/loader.js:498:3) - at Module.require (internal/modules/cjs/loader.js:598:17) - at require (internal/modules/cjs/helpers.js:11:18) - at Object. (/home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/stream.js:8:17) - at Module._compile (internal/modules/cjs/loader.js:654:30) - -``` - -I may be a bug. I hope it gets fixed in the future versions. However, I find a workaround posted [**here**][3]. - -To fix this error temporarily, you need to edit the **transport.js** file using command: -``` -$ vi /home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/transport.js - -``` - -The actual path of this file will be displayed in your error output. Replace the above file path with your own. Then find the following line: -``` -var EventEmitter = process.EventEmitter; - -``` - -and replace it with following line: -``` -var EventEmitter = require('events'); - -``` - -Press ESC and type **:wq** to save and quit the file. - -Now search again the query. -``` -$ how2 create archive tgz - -``` - -Here is the sample output from my Ubuntu system. - -[![][4]][5] - -If the answer you’re looking for is not displayed in the above output, press **SPACE BAR** key to start the interactive search where you can go through all suggested questions and answers from the Stack Overflow site. - -[![][4]][6] - -Use UP/DOWN arrows to move between the results. Once you got the right answer/question, hit SPACE BAR or ENTER key to open it in the Terminal. - -[![][4]][7] - -To go back and exit, press **ESC**. - -**Search answers for specific language** - -If you don’t specify a language it **defaults to Bash** unix command line and give you immediately the most likely answer as above. You can also narrow the results to a specific language, for example perl, python, c, Java etc. - -For instance, to search for queries related to “Python” language only using **-l** flag as shown below. -``` -$ how2 -l python linked list - -``` - -[![][4]][8] - -To get a quick help, type: -``` -$ how2 -h - -``` - -### Conclusion - -The how2 utility is a basic command line program to quickly search for questions and answers from Stack Overflow without leaving your Terminal and it does this job pretty well. However, it is just CLI browser for Stack overflow. For some advanced features such as searching most voted questions, searching queries using multiple tags, colored interface, submitting a new question and viewing questions stats etc., **SoCLI** is good to go. - -And, that’s all for now. Hope this was useful. I will be soon here with another useful guide. Until then, stay tuned with OSTechNix! - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-browse-stack-overflow-from-terminal/ - -作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.ostechnix.com/author/sk/ -[1]:https://www.ostechnix.com/search-browse-stack-overflow-website-commandline/ -[2]:https://www.ostechnix.com/google-search-navigator-enhance-keyboard-navigation-in-google-search/ -[3]:https://github.com/santinic/how2/issues/79 -[4]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[5]:http://www.ostechnix.com/wp-content/uploads/2018/04/stack-overflow-1.png -[6]:http://www.ostechnix.com/wp-content/uploads/2018/04/stack-overflow-2.png -[7]:http://www.ostechnix.com/wp-content/uploads/2018/04/stack-overflow-3.png -[8]:http://www.ostechnix.com/wp-content/uploads/2018/04/stack-overflow-4.png diff --git a/translated/tech/20180417 How To Browse Stack Overflow From Terminal.md b/translated/tech/20180417 How To Browse Stack Overflow From Terminal.md new file mode 100644 index 0000000000..54cc6ab815 --- /dev/null +++ b/translated/tech/20180417 How To Browse Stack Overflow From Terminal.md @@ -0,0 +1,139 @@ +如何在终端中浏览 Stack Overflow +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/04/how2-720x340.png) +前段时间,我们写了一篇关于 [**SoCLI**][1] 的文章,它是一个从命令行搜索和浏览 Stack Overflow 网站的 python 脚本。今天,我们将讨论一个名为 **“how2”** 的类似工具。它是一个命令行程序,可以从终端浏览 Stack Overflow。你可以如你在 [Google 搜索][2]中那样直接用英语查询,然后它会使用 Google 和 Stackoverflow API 来搜索给定的查询。它是使用 NodeJS 编写的免费开源程序。 + +### 使用 how2 从终端浏览 Stack Overflow + +由于 how2 是一个 NodeJS 包,我们可以使用 Npm 包管理器安装它。如果你尚未安装 Npm 和 NodeJS,请参考以下指南。 + +在安装 Npm 和 NodeJS 后,运行以下命令安装 how2。 +``` +$ npm install -g how2 + +``` + +现在让我们看下如何使用这个程序浏览 Stack Overflow。使用 “how2” 搜索 Stack Overflow 站点的典型用法是: +``` +$ how2 + +``` + +例如,我将搜索如何创建 tgz 存档。 +``` +$ how2 create archive tgz + +``` + +哎呀!我收到以下错误。 +``` +/home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/transport.js:59 +Transport.prototype.__proto__ = EventEmitter.prototype; + ^ + + TypeError: Cannot read property 'prototype' of undefined + at Object. (/home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/transport.js:59:46) + at Module._compile (internal/modules/cjs/loader.js:654:30) + at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) + at Module.load (internal/modules/cjs/loader.js:566:32) + at tryModuleLoad (internal/modules/cjs/loader.js:506:12) + at Function.Module._load (internal/modules/cjs/loader.js:498:3) + at Module.require (internal/modules/cjs/loader.js:598:17) + at require (internal/modules/cjs/helpers.js:11:18) + at Object. (/home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/stream.js:8:17) + at Module._compile (internal/modules/cjs/loader.js:654:30) + +``` + +我可能遇到了一个 bug。我希望它在未来版本中得到修复。但是,我在[**这里**][3]找到了一个临时方法。 + + +要临时修复此错误,你需要使用以下命令编辑 **transport.js**: +``` +$ vi /home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/transport.js + +``` + +此文件的实际路径将显示在错误输出中。用你自己的文件路径替换上述文件路径。然后找到以下行: +``` +var EventEmitter = process.EventEmitter; + +``` + +并用以下行替换它: +``` +var EventEmitter = require('events'); + +``` + +按 ESC 并输入 **:wq** 以保存并退出文件。 + +现在再次搜索查询。 +``` +$ how2 create archive tgz + +``` + +这是我的 Ubuntu 系统的示例输出。 + +[![][4]][5] + +如果你要查找的答案未显示在上面的输出中,请按**空格键**键开始交互式搜索,你可以通过它查看 Stack Overflow 站点中的所有建议问题和答案。 + +[![][4]][6] + +使用向上/向下箭头在结果之间移动。得到正确的答案/问题后,点击空格键或回车键在终端中打开它。 + +[![][4]][7] + +要返回并退出,请按 **ESC**。 + +**搜索特定语言的答案** + +如果你没有指定语言,它**默认为 Bash** unix 命令行,并立即为你提供最可能的答案。你还可以将结果缩小到特定语言,例如 perl、python、c、Java 等。 + +例如,使用 **-l** 标志仅搜索与 “Python” 语言相关的查询,如下所示。 +``` +$ how2 -l python linked list + +``` + +[![][4]][8] + +要获得快速帮助,请输入: +``` +$ how2 -h + +``` + +### 总结 + +how2 是一个基本的命令行程序,它可以快速搜索 Stack Overflow 中的问题和答案,而无需离开终端,并且它可以很好地完成这项工作。但是,它只是 Stack overflow 的 CLI 浏览器。对于一些高级功能,例如搜索投票最多的问题,使用多个标签搜索查询,彩色界面,提交新问题和查看问题统计信息等,**SoCLI** 做得更好。 + +就是这些了。希望这篇文章有用。我将很快写一篇新的指南。在此之前,请继续关注 OSTechNix! + +干杯! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-browse-stack-overflow-from-terminal/ + +作者:[SK][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.ostechnix.com/author/sk/ +[1]:https://www.ostechnix.com/search-browse-stack-overflow-website-commandline/ +[2]:https://www.ostechnix.com/google-search-navigator-enhance-keyboard-navigation-in-google-search/ +[3]:https://github.com/santinic/how2/issues/79 +[4]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[5]:http://www.ostechnix.com/wp-content/uploads/2018/04/stack-overflow-1.png +[6]:http://www.ostechnix.com/wp-content/uploads/2018/04/stack-overflow-2.png +[7]:http://www.ostechnix.com/wp-content/uploads/2018/04/stack-overflow-3.png +[8]:http://www.ostechnix.com/wp-content/uploads/2018/04/stack-overflow-4.png From 80330c807d7097cf8f80b631036362e73f46561b Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 26 Nov 2018 09:00:11 +0800 Subject: [PATCH 0460/1143] translating --- ... How to Set Different Wallpaper for Each Monitor in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md b/sources/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md index 386149400c..d9c4498c24 100644 --- a/sources/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md +++ b/sources/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md @@ -1,3 +1,5 @@ +translating----geekpi + How to Set Different Wallpaper for Each Monitor in Linux ====== **Brief: If you want to display different wallpapers on multiple monitors on Ubuntu 18.04 or any other Linux distribution with GNOME, MATE or Budgie desktop environment, this nifty tool will help you achieve this.** From 5d69feebddbd11e0009d7aa1a00a753035bd0d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= Date: Mon, 26 Nov 2018 15:06:13 +0800 Subject: [PATCH 0461/1143] Update 20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md 30 Best Sources For Linux / *BSD / Unix Documentation On the Web --- ...urces For Linux - -BSD - Unix Documentation On the Web.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/tech/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md b/sources/tech/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md index 6a4d1f4828..06154bdb9c 100644 --- a/sources/tech/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md +++ b/sources/tech/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md @@ -1,4 +1,7 @@ -30 Best Sources For Linux / *BSD / Unix Documentation On the We +ScarboroughCoral translating! + + +30 Best Sources For Linux / *BSD / Unix Documentation On the Web ====== From 7ae527f5e2f8fc9249d51f30d5cbadf921a62408 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Mon, 26 Nov 2018 15:16:33 +0800 Subject: [PATCH 0462/1143] hankchow translating --- .../tech/20181105 5 Easy Tips for Linux Web Browser Security.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181105 5 Easy Tips for Linux Web Browser Security.md b/sources/tech/20181105 5 Easy Tips for Linux Web Browser Security.md index 17d06c72d6..ef77d6c43c 100644 --- a/sources/tech/20181105 5 Easy Tips for Linux Web Browser Security.md +++ b/sources/tech/20181105 5 Easy Tips for Linux Web Browser Security.md @@ -1,3 +1,5 @@ +HankChow translating + 5 Easy Tips for Linux Web Browser Security ====== ![](https://www.linux.com/learn/intro-to-linux/2018/11/5-easy-tips-linux-web-browser-security) From 633263475b2f5380b189e0a37e0623988830ef49 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 26 Nov 2018 19:31:48 +0800 Subject: [PATCH 0463/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Coupled=20comma?= =?UTF-8?q?nds=20with=20control=20operators=20in=20Bash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...commands with control operators in Bash.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20181121 Coupled commands with control operators in Bash.md diff --git a/sources/tech/20181121 Coupled commands with control operators in Bash.md b/sources/tech/20181121 Coupled commands with control operators in Bash.md new file mode 100644 index 0000000000..8ddeb3489b --- /dev/null +++ b/sources/tech/20181121 Coupled commands with control operators in Bash.md @@ -0,0 +1,127 @@ +Coupled commands with control operators in Bash +====== +Add logic to the command line with control operators in compound commands. + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-yearbook-best-couple.png?itok=a_99oCdE) + +Simple compound commands—such as stringing several commands together in a sequence on the command line—are used often. Such commands are separated by semicolons, which define the end of a command. To create a simple series of shell commands on a single line, simply separate each command using a semicolon, like this: + +``` +command1 ; command2 ; command3 ; command4 ; +``` + +You don't need to add a final semicolon because pressing the Enter key implies the end of the final command, but it's fine to add it for consistency. + +**& &** and **||** control operators built into Bash. These two control operators provide some flow control and enable us to alter the code-execution sequence. The semicolon and the **newline** character are also considered to be Bash control operators. + +All the commands will run without a problem—as long as no error occurs. But what happens if an error happens? We can anticipate and allow for errors using theandcontrol operators built into Bash. These two control operators provide some flow control and enable us to alter the code-execution sequence. The semicolon and thecharacter are also considered to be Bash control operators. + +The **& &** operator simply says "if command1 is successful, then run command2." If command1 fails for any reason, command2 won't run. That syntax looks like: + +``` +command1 && command2 +``` + +This works because every command returns a code to the shell that indicates whether it completed successfully or failed during execution. By convention, a return code (RC) of 0 (zero) indicates success and any positive number indicates some type of failure. Some sysadmin tools just return a 1 to indicate any failure, but many use other positive numerical codes to indicate the type of failure. + +The Bash shell's **$?** variable can be checked very easily by a script, by the next command in a list of commands, or even directly by a sysadmin. Let's look at RCs. We can run a simple command and immediately check the RC, which will always pertain to the last command that ran. + +``` +[student@studentvm1 ~]$ ll ; echo "RC = $?" +total 284 +-rw-rw-r--  1 student student   130 Sep 15 16:21 ascii-program.sh +drwxrwxr-x  2 student student  4096 Nov 10 11:09 bin + +drwxr-xr-x. 2 student student  4096 Aug 18 10:21 Videos +RC = 0 +[student@studentvm1 ~]$ +``` + +This RC is 0, which means the command completed successfully. Now try the same command on a directory where we don't have permissions. + +``` +[student@studentvm1 ~]$ ll /root ; echo "RC = $?" +ls: cannot open directory '/root': Permission denied +RC = 2 +[student@studentvm1 ~]$ +``` + +This RC's meaning can be found in the [**ls** command's man page][1]. + +Let's try the **& &** control operator as it might be used in a command-line program. We'll start with something simple: Create a new directory and, if that is successful, create a new file in it. + +We need a directory where we can create other directories. First, create a temporary directory in your home directory where you can do some testing. + +``` +[student@studentvm1 ~]$ cd ; mkdir testdir +``` + +Create a new directory in **~/testdir** , which should be empty because you just created it, and then create a new, empty file in that new directory. The following command will do those tasks. + +``` +[student@studentvm1 ~]$ mkdir ~/testdir/testdir2 && touch ~/testdir/testdir2/testfile1 +[student@studentvm1 ~]$ ll ~/testdir/testdir2/ +total 0 +-rw-rw-r-- 1 student student 0 Nov 12 14:13 testfile1 +[student@studentvm1 ~]$ +``` + +We know everything worked as it should because the **testdir** directory is accessible and writable. Change the permissions on **testdir** so it is no longer accessible to the user **student** as follows: + +``` +[student@studentvm1 ~]$ chmod 076 testdir ; ll | grep testdir +d---rwxrw-. 3 student student  4096 Nov 12 14:13 testdir +[student@studentvm1 ~]$ +``` + +Using the **grep** command after the long list ( **ll** ) shows the listing for **testdir**. You can see that the user **student** no longer has access to the **testdir** directory. Now let's run almost the same command as before but change it to create a different directory name inside **testdir**. + +``` +[student@studentvm1 ~]$ mkdir ~/testdir/testdir3 && touch ~/testdir/testdir3/testfile1 +mkdir: cannot create directory ‘/home/student/testdir/testdir3’: Permission denied +[student@studentvm1 ~]$ +``` + +Although we received an error message, using the **& &** control operator prevents the **touch** command from running because there was an error in creating **testdir3**. This type of command-line logical flow control can prevent errors from compounding and making a real mess of things. But let's make it a little more complicated. + +The **||** control operator allows us to add another command that executes when the initial program statement returns a code larger than zero. + +``` +[student@studentvm1 ~]$ mkdir ~/testdir/testdir3 && touch ~/testdir/testdir3/testfile1 || echo "An error occurred while creating the directory." +mkdir: cannot create directory ‘/home/student/testdir/testdir3’: Permission denied +An error occurred while creating the directory. +[student@studentvm1 ~]$ +``` + +Our compound command syntax using flow control takes this general form when we use the **& &** and **||** control operators: + +``` +preceding commands ; command1 && command2 || command3 ; following commands +``` + +The compound command using the control operators may be preceded and followed by other commands that can be related to the ones in the flow-control section but which are unaffected by the flow control. All of those commands will execute without regard to anything that takes place inside the flow-control compound command. + +These flow-control operators can make working at the command line more efficient by handling decisions and letting us know when a problem has occurred. I use them directly on the command line as well as in scripts. + +You can clean up as the root user to delete the directory and its contents. + +``` +[root@studentvm1 ~]# rm -rf /home/student/testdir +``` + +How do you use Bash control operators? Let us know in the comment section. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/control-operators-bash-shell + +作者:[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]: http://man7.org/linux/man-pages/man1/ls.1.html From e286a3e583db49893c2c6c58d8a96ad1f5eafbf8 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 26 Nov 2018 19:33:51 +0800 Subject: [PATCH 0464/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20swap?= =?UTF-8?q?=20Ctrl=20and=20Caps=20Lock=20keys=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o swap Ctrl and Caps Lock keys in Linux.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md diff --git a/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md new file mode 100644 index 0000000000..da658cb261 --- /dev/null +++ b/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md @@ -0,0 +1,111 @@ +How to swap Ctrl and Caps Lock keys in Linux +====== +Linux desktop environments make it easy to set up your keyboard as you want it. Here's how. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K) + +For many people who've been computer users for (let's just say) "quite some time now," the Ctrl and Caps Lock keys have been in the wrong place since shortly after the first PC keyboards rolled off the production line. For me, the correct positioning appears in this image of a vintage 1995 Sun Workstation keyboard. (Forgive me for the blurriness of the image; it was taken with a Minox spy camera in low light.) + +If you're interested, you can read about the [history of the Ctrl key location][1]. I'm not going to discuss the various rationales for placing the Ctrl key next to the "a" key versus below the Shift key; I'm not going to comment on the overall uselessness of the Caps Lock key (whoops); and I'm not going to argue with those who advocate using the heel of the hand to activate the Ctrl key, even though it's impossible to do on some laptop keyboards where the keys are inset below the level of the wrist rest (whoops). + +Rather, I'm going to assume I'm not the only one who prefers the Ctrl key next to the "a" and describe how to use the wonderful flexibility that comes with Linux to swap the Ctrl and Caps Lock keys on various desktop environments. Note that this kind of advice seems to have a limited shelf life, as tools for tweaking desktop settings change fairly often. But I hope this offers a good place for you to start. + +### With GNOME 3 + +[GNOME 3][2] desktop environment users can use the [Tweaks][3] tool to swap their Caps Lock and Ctrl keys, as you can see below. +![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png) +Here's how to do it: + + 1. Install the Tweaks tool from your distribution's repositories. + 2. Start the Tweaks application. + 3. Select "Keyboard & Mouse" from the left-hand menu. + 4. Click "Additional Layout Options". + 5. Click "Ctrl position" on the window that opens and choose "Swap Ctrl and Caps Lock." + + + +That's it! By the way, you can do lots of cool stuff with the Tweaks tool. For example, I set my right Ctrl key to be a Compose key, which allows me to type all sorts of characters with keyboard shortcuts—such as ç, é, ô, and ñ and with the keystrokes Compose+c+Comma; Compose+e+Right quote; Compose+o+Circumflex; and Compose+n+Tilde. + +### With KDE + +I don't use [KDE][4], but item 5 in this article about [KDE tweaks that will change your life][5] by my colleague Seth Kenlon will show you how to remap your keys. + +### With Xfce + +As far as I can tell, the [Xfce][6] desktop environment doesn't have a handy tool for managing these kinds of settings. However, the **ctrl:swapcaps** option to the **setxkbmap** command will help you make these changes. This type of modification has two parts: + + 1. Figuring out the command's usage; + 2. Figuring out where to invoke the command so it is activated as the desktop comes up. + + + +The first part is pretty straightforward: the command is: + +``` +/usr/bin/setxkbmap -option "ctrl:nocaps" +``` + +It's worth executing this in a terminal window to make sure the results are what you expect. + +Assuming it works, where should you invoke the command? That requires some experimentation; one possibility is in the file **.profile** in the user's home directory. Another option is to add the command to the autostart facility in Xfce (look for "Session and Startup" in the Settings Manager). + +Another possibility is to use the same option in the file / **etc/default/keyboard** , which might end up looking like this: + +``` +# KEYBOARD CONFIGURATION FILE + +# Consult the keyboard(5) manual page. + +XKBMODEL="pc105" +XKBLAYOUT="us" +XKBVARIANT="" +XKBOPTIONS="ctrl:swapcaps" + +BACKSPACE="guess" +``` + +Note that this kind of change will affect all users, so if you share your computer, be prepared to do some explaining. Also, system updates may overwrite this file, so you'll need to edit it again if your setup stops working. Putting the same information in the file **.keyboard** in the user's home directory might accomplish the same task on the user's behalf. + +Finally, note that these kinds of changes require you to restart Xfce (except when running the command on the command line in the terminal window, but that won't stick past the end of the session). + +### With LXQt and other desktop environments + +I haven't tried [LXQt][7], but if my memory serves from [LXDE][8], I would try the same recipe used above for Xfce. I'd also expect that the Xfce recipe could work for other Linux desktop environments, but, of course, your favorite search engine is always your friend. + +### The console + +I haven't tried this, as I have very few opportunities to interact with the console (what you see on a server or when your window system doesn't come up properly). The recipes presented above affect the terminal window in the way one would hope, i.e., consistently with other applications. + +However, if the file **/etc/default/keyboard** or **~/.keyboard** has already been edited (as described above), the utility **setupcon** is intended to change the console keyboard setup so it functions the same way.** **This [StackExchange article][9], [this other one][10], and [this third one][11] give some ideas on how to effect these changes from both of these files. The third article also talks about using **dumpkeys** and **loadkeys**. It's also worthwhile to read [the setupcon man page][12] — it's short and to the point, and combined with the comments from the StackExchange articles, should be enough to get a solution in place. + +Finally, it's worth emphasizing here the point mentioned in the StackExchange articles - configuring the console IS NOT THE SAME as configuring terminal windows; the latter are configured through the desktop manager as described previously. + +### When all else fails + +The manual pages for **setxkbmap** , **xkeyboard-config** , **keyboard** , **console-setup** , and **setupcon** are all useful references. Or, if you don't like reading manual pages, there's [this great article][13]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard + +作者:[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://en.wikipedia.org/wiki/Control_key +[2]: https://www.gnome.org/gnome-3/ +[3]: https://wiki.gnome.org/Apps/Tweaks +[4]: https://www.kde.org/ +[5]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life +[6]: https://www.xfce.org/ +[7]: https://lxqt.org/ +[8]: https://lxde.org/ +[9]: https://askubuntu.com/questions/485454/how-to-remap-keys-on-a-user-level-both-with-and-without-x +[10]: https://unix.stackexchange.com/questions/198791/how-do-i-permanently-change-the-console-tty-font-type-so-it-holds-after-reboot +[11]: https://superuser.com/questions/290115/how-to-change-console-keymap-in-linux +[12]: http://man.he.net/man1/setupcon +[13]: http://www.noah.org/wiki/CapsLock_Remap_Howto From f4322b6f9e2ec2afb3f36620cab2b761987f903a Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 26 Nov 2018 19:35:52 +0800 Subject: [PATCH 0465/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=2010=20ways=20to?= =?UTF-8?q?=20give=20thanks=20to=20open=20source=20and=20free=20software?= =?UTF-8?q?=20maintainers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...en source and free software maintainers.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md diff --git a/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md b/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md new file mode 100644 index 0000000000..86a291d0d5 --- /dev/null +++ b/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md @@ -0,0 +1,58 @@ +[^#]: collector: lujun9972 +[^#]: translator: +[^#]: reviewer: +[^#]: publishor: +[^#]: subject: 10 ways to give thanks to open source and free software maintainers +[^#]: via: https://opensource.com/article/18/11/ways-give-thanks-open-source +[^#]: author: [Moshe Zadka]( https://opensource.com/users/moshez) +[^#]: url: + +10 ways to give thanks to open source and free software maintainers +====== +How to express your gratitude. +![](https://opensource.com/users/moshez) + +Every day, I use high-quality software that is developed and maintained by people who do not ask for payment, who respect my freedoms, and who are generous with their time and energy. + +In this season of giving thanks, I encourage those of you who also use and appreciate the work of open source and free software maintainers to express your gratitude. Here are ten ways to do that: + +### Easy to do + + 1. Send an e-mail thanking the developers. Be specific—tell them what you are using their software for and how it has benefited you. + 2. Use your favorite social media platform to spread the word. + 3. Write a blog post about your favorite software. + + + +### Give money + + 4. If your favorite open source projects accept donations, send money. + 5. If you are employed by a company that uses open source software, see if you can convince management to sponsor some of the projects. + 6. Offer to match donations up to a set amount. It is amazing what social motivation can do! + + + +### Give time + + 7. Help review patches. + 8. Help triage bugs. + 9. Answer questions on IRC, mailing lists, or [Stack Overflow][1]. + + + +**10. Bonus:** If you are like me, you have at some point said harsh words to other people in the open source community. Commit to do better: Communicate with kindness and openness. The best way to give thanks is to make the open source community a place where people feel comfortable communicating. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/ways-give-thanks-open-source + +作者:[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://meta.stackoverflow.com/ From f56590e79547f400089f4b780ec8cf99c65b995e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 26 Nov 2018 19:37:53 +0800 Subject: [PATCH 0466/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Getting=20start?= =?UTF-8?q?ed=20with=20Jenkins=20X?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20181122 Getting started with Jenkins X.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20181122 Getting started with Jenkins X.md diff --git a/sources/tech/20181122 Getting started with Jenkins X.md b/sources/tech/20181122 Getting started with Jenkins X.md new file mode 100644 index 0000000000..d32f5a4d39 --- /dev/null +++ b/sources/tech/20181122 Getting started with Jenkins X.md @@ -0,0 +1,148 @@ +[^#]: collector: lujun9972 +[^#]: translator: +[^#]: reviewer: +[^#]: publishor: +[^#]: subject: Getting started with Jenkins X +[^#]: via: https://opensource.com/article/18/11/getting-started-jenkins-x +[^#]: author: [Dave Johnson](https://opensource.com/users/snoopdave) +[^#]: url: + +Getting started with Jenkins X +====== +Jenkins X provides continuous integration, automated testing, and continuous delivery to Kubernetes. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_wheel_gear_devops_kubernetes.png?itok=xm4a74Kv) + +[Jenkins X][1] is an open source system that offers software developers continuous integration, automated testing, and continuous delivery, known as CI/CD, in Kubernetes. Jenkins X-managed projects get a complete CI/CD process with a Jenkins pipeline that builds and packages project code for deployment to Kubernetes and access to pipelines for promoting projects to staging and production environments. + +Developers are already benefiting from running "classic" open source Jenkins and CloudBees Jenkins on Kubernetes, thanks in part to the Jenkins Kubernetes plugin, which allows you to dynamically spin-up Kubernetes pods to run Jenkins build agents. Jenkins X adds what's missing from Jenkins: comprehensive support for continuous delivery and managing the promotion of projects to preview, staging, and production environments running in Kubernetes. + +This article is a high-level explanation of how Jenkins X works; it assumes you have some knowledge of Kubernetes and classic Jenkins. + +### What you get with Jenkins X + +If you're running on one of the major cloud providers (Amazon Elastic Container Service for Kubernetes, Google Kubernetes Engine, or Microsoft Azure Kubernetes Service), installing and deploying Jenkins X is easy. Download the Jenkins X command-line interface and run the **jx create cluster** command. You'll be prompted for the necessary information and, if you take the defaults, Jenkins X will create a starter-size Kubernetes cluster and install Jenkins X. + +When you deploy Jenkins X, a number of services are put in motion to watch your Git repositories and respond by building, testing, and promoting your applications to staging, production, and other environments you define. Jenkins X also deploys a set of supporting services, including [Jenkins][2], [Docker Registry][3], [Chart Museum][4], and [Monocular][5] to manage [Helm][6] charts, and [Nexus][7], which serves as a Maven and npm repository. + +The Jenkins X deployment also creates two Git repositories, one for your staging environment and one for production. These are in addition to the Git repositories you use to manage your project source code. Jenkins X uses these repositories to manage what is deployed to each environment, and promotions are done via Git pull requests (PRs)—this approach is known as [GitOps][8]. Each repository contains a Helm chart that specifies the applications to be deployed to the corresponding environment. Each repository also has a Jenkins pipeline to handle promotions. + +### Creating a new project with Jenkins X + +To create a new project with Jenkins X, use the **jx create quickstart** command. If you don't specify any options, jx will prompt you to select a project name and a platform—which can be just about anything. SpringBoot, Go, Python, Node, ASP.NET, Rust, Angular, and React are all supported, and the list keeps growing. Once you have chosen your project name and platform, Jenkins X will: + + * Create a new project that includes a "hello-world"-style web project + * Add the appropriate type of makefile or build script for the chosen platform + * Add a Jenkinsfile to manage promotions to staging and production environments + * Add a Dockerfile and Helm charts, created via [Draft][9] + * Add a [Skaffold][10] configuration for deploying the application to Kubernetes + * Create a Git repository and push the new project code there + + + +Next, a webhook from Git will notify Jenkins X that a project changed, and it will run your project's Jenkins pipeline to build and push your Docker image and Helm charts. + +Finally, the pipeline will submit a PR to the staging environment's Git repository with the changes needed to promote the application. + +Once the PR is merged, the staging pipeline will run to apply those changes and do the promotion. A couple of minutes after creating your project, you'll have end-to-end CI/CD, and your project will be running in staging and available for use. + +![Developer commits changes, project deployed to staging][12] + +Developer commits changes, project deployed to the staging environment. + +The figure above illustrates the repositories, registries, and pipelines and how they interact in a Jenkins X promotion to staging. Here are the steps: + + 1. The developer commits and pushes the change to the project's Git repository + 2. Jenkins X is notified and runs the project's Jenkins pipeline in a Docker image that includes the project's language and supporting frameworks + 3. The project pipeline builds, tests, and pushes the project's Helm chart to Chart Museum and its Docker image to the registry + 4. The project pipeline creates a PR with changes needed to add the project to the staging environment + 5. Jenkins X automatically merges the PR to Master + 6. Jenkins X is notified and runs the staging pipeline + 7. The staging pipeline runs Helm, which deploys the environment, pulling Helm charts from Chart Museum and Docker images from the Docker registry. Kubernetes creates the project's resources, typically a pod, service, and ingress. + + + +### Importing your existing projects into Jenkins X + +**jx import** , Jenkins X adds the things needed for your project to be deployed to Kubernetes and participate in CI/CD. It will add a Jenkins pipeline, Helm charts, and a Skaffold configuration for deploying the application to Kubernetes. Jenkins X will create a Git repository and push the changes there. Next, a webhook from Git will notify Jenkins X that a project changed, and promotion to staging will happen as described above for new projects. + +### Promoting your project to production + +When you import a project via, Jenkins X adds the things needed for your project to be deployed to Kubernetes and participate in CI/CD. It will add a Jenkins pipeline, Helm charts, and a Skaffold configuration for deploying the application to Kubernetes. Jenkins X will create a Git repository and push the changes there. Next, a webhook from Git will notify Jenkins X that a project changed, and promotion to staging will happen as described above for new projects. + +To promote a version of your project to the production environment, use the **jx promote** command. This command will prepare a Git PR that contains the Helm chart changes needed to deploy into the production environment and submit this request to the production environment's Git repository. Once the request is manually approved, Jenkins X will run the production pipeline to deploy your project via Helm. + +![Promoting project to production][14] + +Developer promotes the project to production. + +This figure illustrates the repositories, registries, and pipelines and how they interact in a Jenkins X promotion to production. Here are the steps: + + 1. The developer runs the **jx promote** command to promote a project to production + 2. Jenkins X creates a PR with changes needed to add the project to the production environment + 3. The developer manually approves the PR, and it is merged to Master + 4. Jenkins X is notified and runs the production pipeline + 5. The production pipeline runs Helm, which deploys the environment, pulling Helm charts from Chart Museum and Docker images from the Docker registry. Kubernetes creates the project's resources, typically a pod, service, and ingress. + + + +### Other features of Jenkins X + +Other interesting and appealing features of Jenkins X include: + +#### Preview environments + +When you create a PR to add a new feature to your project, you can ask Jenkins X to create a preview environment so you can make your new feature available for preview and testing before the PR is merged. + +#### Extensions + +It is possible to create extensions to Jenkins X. An extension is code that runs at specific times in the CI/CD process. An extension can provide code that runs when the extension is installed, uninstalled, as well as before and after each pipeline. + +#### Serverless Jenkins + +Instead of running the Jenkins web application, which continually consumes CPU and memory resources, you can run Jenkins only when you need it. During the past year, the Jenkins community created a version of Jenkins that can run classic Jenkins pipelines via the command line with the configuration defined by code instead of HTML forms. + +This capability is now available in Jenkins X. When you create a Jenkins X cluster, you can choose to use Serverless Jenkins. If you do, Jenkins X will deploy [Prow][15] to handle webhooks from GitHub and [Knative][16] to run Jenkins pipelines. + +### Jenkins X limitations + +Jenkins X also has some limitations that should be considered: + + * **Jenkins X is currently limited to projects that use Git:** Jenkins X is opinionated about CI/CD and assumes everybody wants to run and deploy software to Kubernetes and everybody is happy to use Git for source code and defining environments. Also, the Serverless Jenkins feature currently works only with GitHub. + * **Jenkins X is limited to Kubernetes:** It is true that Jenkins X can run automated builds, testing, and continuous integration for any type of software, but the continuous delivery part targets a Kubernetes namespace managed by Jenkins X. + * **Jenkins X requires cluster-admin level Kubernetes access:** Jenkins X needs cluster-admin access so it can define and manage a Kubernetes custom resource definition. Hopefully, this is a temporary limitation, because it could be a show-stopper for some. + + + +### Conclusions + +Jenkins X looks to be a good way to implement CI/CD for Kubernetes, and I'm looking forward to putting it to the test in production. Using Jenkins X is also a good way to learn about some useful open source tools for deploying to Kubernetes, including Helm, Draft, Skaffold, Prow, and more. These are things you might want to use even if you decide Jenkins X is not for you. If you're deploying to Kubernetes, take Jenkins X for a spin. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/getting-started-jenkins-x + +作者:[Dave 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/snoopdave +[b]: https://github.com/lujun9972 +[1]: https://jenkins-x.io/ +[2]: https://jenkins.io/ +[3]: https://docs.docker.com/registry/ +[4]: https://github.com/helm/chartmuseum +[5]: https://github.com/helm/monocular +[6]: https://helm.sh +[7]: https://www.sonatype.com/nexus-repository-oss +[8]: https://www.weave.works/blog/gitops-operations-by-pull-request +[9]: https://draft.sh/ +[10]: https://github.com/GoogleContainerTools/skaffold +[11]: /file/414941 +[12]: https://opensource.com/sites/default/files/uploads/jenkinsx_fig1.png (Developer commits changes, project deployed to staging) +[13]: /file/414946 +[14]: https://opensource.com/sites/default/files/uploads/jenkinsx_fig2.png (Promoting project to production) +[15]: https://github.com/kubernetes/test-infra/tree/master/prow +[16]: https://cloud.google.com/knative/ From 95e283f08561f5eb47bf6e4e2923f00749680877 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 26 Nov 2018 19:39:49 +0800 Subject: [PATCH 0467/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20A=20Closer=20Lo?= =?UTF-8?q?ok=20at=20Voice-Assisted=20Speakers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Closer Look at Voice-Assisted Speakers.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md diff --git a/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md b/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md new file mode 100644 index 0000000000..767a4d7880 --- /dev/null +++ b/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md @@ -0,0 +1,124 @@ +[^#]: collector: lujun9972 +[^#]: translator: +[^#]: reviewer: +[^#]: publishor: +[^#]: subject: A Closer Look at Voice-Assisted Speakers +[^#]: via: https://www.linux.com/blog/2018/11/closer-look-voice-assisted-speakers +[^#]: author: [Eric Brown](https://www.linux.com/users/ericstephenbrown) +[^#]: url: + +A Closer Look at Voice-Assisted Speakers +====== +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anavi-elc.png?itok=vN-QXvJf) + +U.S. consumers are expected to drop a bundle this Black Friday on smart speakers and home hubs. A Nov. 15 [Canalys report][1] estimates that shipments of voice-assisted speakers grew 137 percent in Q3 2018 year-to-year and are on the way to 75 million-unit sales in 2018. At the recent [Embedded Linux Conference and Open IoT Summit][2] in Edinburgh, embedded Linux developer and [Raspberry Pi HAT][3] creator Leon Anavi of the Konsulko Group reported on the latest smart speaker trends. + +As Anavi noted in his “Comparison of Voice Assistant SDKs for Embedded Linux Devices” talk, conversing with computers became a staple of science fiction over half a century ago. Voice technology is interesting “because it combines AI, big data, IoT, and application development,” said Anavi. + +In Q3 2017, Amazon and Google owned the industry with 74.7 percent and 24.6 percent, respectively, said Canalys. A year later, the percentages were down to 31.9 and 29.8. China-based Alibaba and Xiaomi almost equally split another 21.8 percent share, followed by 17.4 percent for “others,” which mostly use Amazon Alexis, and increasingly, Google Assistant. + +Despite the success of the mostly Linux-driven smart speaker market, Linux application developers have not jumped into voice app development in the numbers one might expect. In part, this is due to reservations about Google and [Amazon privacy safeguards][4], as well as the proprietary nature of the hardware and cloud software. + +“Privacy is a concern with smart speakers,” said Anavi. “You can’t fully trust a corporation if the product is not open source.” + +Anavi summarized the Google and Amazon SDKs but spent more time on the fully open source Mycroft Mark. Although Anavi clearly prefers Mycroft, he encouraged developers to investigate all the platforms. “There is a huge demand in the market for these devices and a lot of opportunity for IoT integration, from writing new skills to integrating voice assistants in consumer electronics devices,” said Anavi. + +### Alexa/Echo + +Amazon’s Alexa debuted in the Echo smart speaker four years ago. Amazon has since expanded to the Echo branded Dot, Spot, Tap, and Plus speakers, as well as the Echo Show and new [Echo Show 2][5] display hubs. + +The market leading Echo devices run on Amazon’s Linux- and Android-based Fire OS. The original Echo and Dot ran on the Cortex-A8-based TI DM3725 SoC while more recent devices have moved to an Armv8 MediaTek MT8163V SoC with 256MB RAM and 4GB flash. + +Thanks to Amazon’s wise decision to release an Apache 2.0 licensed Alexa Voice Services (AVS) SDK, Alexa also runs on most third-party hubs. The SDK includes an Alexa Skills Kit for creating custom Skills. The cloud platform required to make Alexa devices work is not open source, however, and commercial vendors must sign an agreement and undergo a certification process. + +Alexa runs on a variety of hardware [including the Raspberry Pi][6], as well as smart devices ranging from the Ecobee4 Smart Thermostat to the LG Hub Robot. Microsoft recently began [selling Echo devices][7], and earlier this year partnered with Amazon to integrate Alexa with its own Cortana voice agent in devices. This week, Microsoft announced that users can [voice-activate Skype calls][8] via Alexa on Echo devices. + +### Google Assistant/Home + +The Google Assistant voice agent debuted on the Google Home smart speaker in 2016. It has since expanded to the Echo Dot-like Home Mini, which like the Home runs on a 1.2GHz dual-core Cortex-A7 Marvell Armada 1500 Mini Plus with 512MB RAM and 4GB flash. This year’s [Home Max][9] offered improved speakers and advanced to a 1.5GHz, quad-core Cortex-A53 processor. More recently, Google launched the touchscreen enabled [Google Home Hub][10]. + +The Google Home devices run on a version of the Linux-based Google Cast OS. Like Alexa, the Python driven [Google Assistant SDK][11] lets you add the voice agent to third-party devices. However, it’s still in preview stage and lacks an open source license. Developers can create applications with [Google Actions][12]. + +Last year, Google [launched][13] a version of its Google Assistant SDK for the Raspberry Pi 3 and began selling an [AIY Voice Kit][14] that runs on the Pi. There’s also a kit that runs on the Orange Pi, said Anavi. + +This year, Google has aggressively [courted hardware partners][15] to produce home hub devices that combine Assistant with Google’s proprietary [Android Things][16]. The devices run on a variety of Arm-based SoCs led by the Qualcomm SD212 Home Hub Platform. + +The SDK expansion has resulted in a variety of third-party devices running Assistant, including the Lenovo Smart Display and the just released [LG XBOOM AI ThinQ WK9][17] touchscreen hubs. Sales of Google Home devices outpaced Echo earlier this year, although Amazon regained the lead in Q3, says Canalys. + +Like Alexa, but unlike Mycroft, Google Assistant offers multilingual support. The latest version supports follow-up questions without having to repeat the activation word, and there’s a voice match feature that can recognize up to six users. A new Google Duplex feature accomplishes real-world tasks through natural phone conversations. + +### Mycroft/Mark + +Anavi’s favorite smart speaker is the Linux-driven, open source (Apache 2.0 and CERN) [Mycroft][18]. The Raspberry Pi based [Mycroft Mark 1][19] speaker was certified by the Open Source Hardware Association (OSHA). + +The [Mycroft Mark II][20] launched on Kickstarter in January and has received $450,000 in funding. This Xilinx [Zynq UltraScale+ MPSoC][21] driven home hub integrates Aaware’s far-field [Sound Capture][22] technology. A [Nov. 15 update post][23] revealed that the Mark II will miss its December ship date. + +Kansas City-based Mycroft has raised $2.5 million from institutional investors and is now seeking funding on [StartEngine][24]. Mycroft sees itself as a software company and is encouraging other companies to build the Mycroft Core platform and Mycroft AI voice agent into products. The company offers an enterprise server license to corporate customers for $1,500 a month, and there’s a free, Raspbian based [Picroft][25] application for the Raspberry Pi. A Picroft hardware kit is under consideration. + +Mycroft promises that user data will never be saved without an opt-in (to improve machine learning algorithms), and that it will never be used for marketing purposes. Like Alexa and Assistant, however, it’s not available offline without a cloud service, a feature that would better ensure privacy. Anavi says the company is working on an offline option. + +The Mycroft AI agent is enabled via a Python based Mycroft Pulse SDK, and a Mycroft Skills Manager is available for Skills development. Like Alexa and Assistant, Mycroft supports custom wake words. The new version uses its homegrown [Precise][26] wake-word listener technology in place of the earlier PocketSphinx. There’s also an optional device and account management stack called Mycroft Home. + +For text-to-speech (TTS), Mycroft defaults to the open source [Mimic][27], which is co-developed with VocaliD. It also supports eSpeak, MaryTTS, Google TTS, and FATTS. + +Mycroft lacks its own speech to-text (STT) engine, which Anavi calls “the biggest challenge for an open source voice assistant.” Instead, it defaults to Google STT and supports [IBM Watson STT][28] and [wit.ai][29]. + +Mycroft is collaborating with Mozilla on its open source [DeepSpeech][30] STT, an open source TensorFlow implementation of [Baidu’s DeepSpeech][31] platform. Baidu trails Alibaba and Xiaomi in the [Chinese voice assistant][32] market but is one of the fastest growing voice AI companies. Just as Alibaba uses its homegrown, Alexa-like AliGenie agent on its Tmall Genie speaker, Baidu loads its [speakers][33] with its DeepSpeech-driven [DuerOS][34] voice platform. Xiaomi has used Alexa and Cortana. + +Mycroft is the most mature of several alternative voice AI projects that promise improved privacy safeguards. A recent [VentureBeat][35] article reported on emerging privacy-oriented technologies including [Snips][36] and [SoundHound][37]. + +Anavi concluded with some demo videos showing off his soothing, Bulgarian AI whisperer vocal style. “I try to be polite with these things,” said Anavi. “Someday they may rule the world and I want to survive.” + +Anavi’s video presentation can be seen here: + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2018/11/closer-look-voice-assisted-speakers + +作者:[Eric 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://www.linux.com/users/ericstephenbrown +[b]: https://github.com/lujun9972 +[1]: https://www.canalys.com/newsroom/amazon-reclaims-top-spot-in-smart-speaker-market-in-q3-2018 +[2]: https://events.linuxfoundation.org/events/elc-openiot-europe-2018/ +[3]: http://linuxgizmos.com/phat-adds-ir-to-the-raspberry-pi/ +[4]: https://qz.com/1288743/amazon-alexa-echo-spying-on-users-raises-a-data-privacy-problem/ +[5]: https://www.techadvisor.co.uk/review/digital-home/amazon-echo-show-2-3685964/ +[6]: https://www.linux.com/news/event/open-source-summit-na/2017/3/add-skills-your-raspberry-pi-alexa +[7]: https://www.theverge.com/2018/11/17/18099978/microsoft-store-amazon-echo-devices +[8]: https://www.engadget.com/2018/11/19/alexa-can-now-make-skype-calls/ +[9]: https://store.google.com/us/product/google_home_max?hl=en-US +[10]: https://arstechnica.com/gadgets/2018/10/google-home-hub-under-the-hood-its-nothing-like-other-google-smart-displays/ +[11]: https://developers.google.com/assistant/sdk/overview +[12]: https://developers.google.com/actions/ +[13]: http://linuxgizmos.com/google-assistant-sdk-dev-preview-brings-voice-agent-to-the-raspberry-pi/ +[14]: http://linuxgizmos.com/googles-updated-aiy-vision-and-voice-kits-ship-with-raspberry-pi-zero-wh/ +[15]: http://linuxgizmos.com/android-things-and-google-assistant-appear-in-new-smart-speakers-smart-displays-and-coms/ +[16]: https://www.linux.com/blog/2018/5/android-things-10-offers-free-ota-updates-restrictions +[17]: https://www.engadget.com/2018/11/20/lg-wk9-google-assistant-smart-speaker/ +[18]: https://mycroft.ai/ +[19]: http://linuxgizmos.com/open-source-echo-like-gizmo-is-halfway-to-kickstarter-gold/ +[20]: http://linuxgizmos.com/open-source-voice-assistant-promises-user-privacy/ +[21]: http://linuxgizmos.com/16nm-zynq-soc-mixes-cortex-a53-fpga-cortex-r5/ +[22]: https://aaware.com/technology/ +[23]: https://www.kickstarter.com/projects/aiforeveryone/mycroft-mark-ii-the-open-voice-assistant/posts/2344940 +[24]: https://www.startengine.com/mycroft-ai +[25]: https://mycroft.ai/documentation/picroft/#hardware-prerequisites +[26]: https://mycroft.ai/documentation/precise/ +[27]: https://mycroft.ai/documentation/mimic/ +[28]: http://linuxgizmos.com/whipping-up-ibm-watson-voice-services-with-openwhisk/ +[29]: https://wit.ai/ +[30]: https://github.com/mozilla/DeepSpeech +[31]: http://research.baidu.com/Blog/index-view?id=90 +[32]: https://www.cbinsights.com/research/china-voice-assistants-smart-speakers-ai/ +[33]: https://www.theverge.com/ces/2018/1/8/16866068/baidu-smart-speakers-dueros-ces-2018 +[34]: https://dueros.baidu.com/en/index.html +[35]: https://venturebeat.com/2018/07/14/alexa-alternatives-have-a-secret-weapon-privacy/ +[36]: https://snips.ai/ +[37]: https://soundhound.com/ From 77e8e4642e6b4033d23aa4f175a1c47b4a0bd37a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 20:57:50 +0800 Subject: [PATCH 0468/1143] Update 20181121 10 ways to give thanks to open source and free software maintainers.md --- ... give thanks to open source and free software maintainers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md b/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md index 86a291d0d5..15e6e5d229 100644 --- a/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md +++ b/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md @@ -1,7 +1,7 @@ [^#]: collector: lujun9972 [^#]: translator: [^#]: reviewer: -[^#]: publishor: +[^#]: publisher: [^#]: subject: 10 ways to give thanks to open source and free software maintainers [^#]: via: https://opensource.com/article/18/11/ways-give-thanks-open-source [^#]: author: [Moshe Zadka]( https://opensource.com/users/moshez) From bdcb72a68b54124442a044cc64ff3d0aaaed3c32 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 21:06:05 +0800 Subject: [PATCH 0469/1143] Update 20181122 Getting started with Jenkins X.md --- sources/tech/20181122 Getting started with Jenkins X.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181122 Getting started with Jenkins X.md b/sources/tech/20181122 Getting started with Jenkins X.md index d32f5a4d39..bd9591af44 100644 --- a/sources/tech/20181122 Getting started with Jenkins X.md +++ b/sources/tech/20181122 Getting started with Jenkins X.md @@ -1,7 +1,7 @@ [^#]: collector: lujun9972 [^#]: translator: [^#]: reviewer: -[^#]: publishor: +[^#]: publisher: [^#]: subject: Getting started with Jenkins X [^#]: via: https://opensource.com/article/18/11/getting-started-jenkins-x [^#]: author: [Dave Johnson](https://opensource.com/users/snoopdave) From 3d7992b2242aa7dfc4d49b88885a4bf31248669f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 21:06:56 +0800 Subject: [PATCH 0470/1143] Update 20181121 A Closer Look at Voice-Assisted Speakers.md --- .../talk/20181121 A Closer Look at Voice-Assisted Speakers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md b/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md index 767a4d7880..963d99511a 100644 --- a/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md +++ b/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md @@ -1,7 +1,7 @@ [^#]: collector: lujun9972 [^#]: translator: [^#]: reviewer: -[^#]: publishor: +[^#]: publisher: [^#]: subject: A Closer Look at Voice-Assisted Speakers [^#]: via: https://www.linux.com/blog/2018/11/closer-look-voice-assisted-speakers [^#]: author: [Eric Brown](https://www.linux.com/users/ericstephenbrown) From d65a0d1fb4899df4a2dffb912553905859e5cd5d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 21:11:13 +0800 Subject: [PATCH 0471/1143] Update 20181123 How to Build a Netboot Server, Part 1.md --- sources/tech/20181123 How to Build a Netboot Server, Part 1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181123 How to Build a Netboot Server, Part 1.md b/sources/tech/20181123 How to Build a Netboot Server, Part 1.md index 980ccba78c..30c1e3ea08 100644 --- a/sources/tech/20181123 How to Build a Netboot Server, Part 1.md +++ b/sources/tech/20181123 How to Build a Netboot Server, Part 1.md @@ -1,7 +1,7 @@ [^#]: collector: lujun9972 [^#]: translator: [^#]: reviewer: -[^#]: publishor: +[^#]: publisher: [^#]: subject: How to Build a Netboot Server, Part 1 [^#]: via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ [^#]: author: [Gregory Bartholomew](https://fedoramagazine.org/author/glb/) From b4c5f7451f3bd77dae9c6b4fc04edc3bbcc93b52 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 22:20:45 +0800 Subject: [PATCH 0472/1143] Update 20181123 How to Build a Netboot Server, Part 1.md --- ...1123 How to Build a Netboot Server, Part 1.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20181123 How to Build a Netboot Server, Part 1.md b/sources/tech/20181123 How to Build a Netboot Server, Part 1.md index 30c1e3ea08..443b89e615 100644 --- a/sources/tech/20181123 How to Build a Netboot Server, Part 1.md +++ b/sources/tech/20181123 How to Build a Netboot Server, Part 1.md @@ -1,11 +1,11 @@ -[^#]: collector: lujun9972 -[^#]: translator: -[^#]: reviewer: -[^#]: publisher: -[^#]: subject: How to Build a Netboot Server, Part 1 -[^#]: via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ -[^#]: author: [Gregory Bartholomew](https://fedoramagazine.org/author/glb/) -[^#]: url: +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (How to Build a Netboot Server, Part 1) +[#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) +[#]: url: ( ) How to Build a Netboot Server, Part 1 ====== From 9239443fc0b12eab2b8d2b3b9887de8ea741a205 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 26 Nov 2018 22:55:35 +0800 Subject: [PATCH 0473/1143] =?UTF-8?q?=E6=96=B0=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...open source and free software maintainers.md | 16 ++++++++-------- ... A Closer Look at Voice-Assisted Speakers.md | 17 +++++++++-------- .../20181122 Getting started with Jenkins X.md | 16 ++++++++-------- ...123 How to Build a Netboot Server, Part 1.md | 5 ----- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md b/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md index 15e6e5d229..b1ad8d8e38 100644 --- a/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md +++ b/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md @@ -1,11 +1,11 @@ -[^#]: collector: lujun9972 -[^#]: translator: -[^#]: reviewer: -[^#]: publisher: -[^#]: subject: 10 ways to give thanks to open source and free software maintainers -[^#]: via: https://opensource.com/article/18/11/ways-give-thanks-open-source -[^#]: author: [Moshe Zadka]( https://opensource.com/users/moshez) -[^#]: url: +[^#]: collector: (lujun9972) +[^#]: translator: ( ) +[^#]: reviewer: ( ) +[^#]: publisher: ( ) +[^#]: subject: (10 ways to give thanks to open source and free software maintainers) +[^#]: via: (https://opensource.com/article/18/11/ways-give-thanks-open-source) +[^#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[^#]: url: ( ) 10 ways to give thanks to open source and free software maintainers ====== diff --git a/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md b/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md index 963d99511a..f00259ee61 100644 --- a/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md +++ b/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md @@ -1,14 +1,15 @@ -[^#]: collector: lujun9972 -[^#]: translator: -[^#]: reviewer: -[^#]: publisher: -[^#]: subject: A Closer Look at Voice-Assisted Speakers -[^#]: via: https://www.linux.com/blog/2018/11/closer-look-voice-assisted-speakers -[^#]: author: [Eric Brown](https://www.linux.com/users/ericstephenbrown) -[^#]: url: +[^#]: collector: (lujun9972) +[^#]: translator: ( ) +[^#]: reviewer: ( ) +[^#]: publisher: ( ) +[^#]: subject: (A Closer Look at Voice-Assisted Speakers) +[^#]: via: (https://www.linux.com/blog/2018/11/closer-look-voice-assisted-speakers) +[^#]: author: (Eric Brown https://www.linux.com/users/ericstephenbrown) +[^#]: url: ( ) A Closer Look at Voice-Assisted Speakers ====== + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/anavi-elc.png?itok=vN-QXvJf) U.S. consumers are expected to drop a bundle this Black Friday on smart speakers and home hubs. A Nov. 15 [Canalys report][1] estimates that shipments of voice-assisted speakers grew 137 percent in Q3 2018 year-to-year and are on the way to 75 million-unit sales in 2018. At the recent [Embedded Linux Conference and Open IoT Summit][2] in Edinburgh, embedded Linux developer and [Raspberry Pi HAT][3] creator Leon Anavi of the Konsulko Group reported on the latest smart speaker trends. diff --git a/sources/tech/20181122 Getting started with Jenkins X.md b/sources/tech/20181122 Getting started with Jenkins X.md index bd9591af44..70cb27b956 100644 --- a/sources/tech/20181122 Getting started with Jenkins X.md +++ b/sources/tech/20181122 Getting started with Jenkins X.md @@ -1,11 +1,11 @@ -[^#]: collector: lujun9972 -[^#]: translator: -[^#]: reviewer: -[^#]: publisher: -[^#]: subject: Getting started with Jenkins X -[^#]: via: https://opensource.com/article/18/11/getting-started-jenkins-x -[^#]: author: [Dave Johnson](https://opensource.com/users/snoopdave) -[^#]: url: +[^#]: collector: (lujun9972) +[^#]: translator: ( ) +[^#]: reviewer: ( ) +[^#]: publisher: ( ) +[^#]: subject: (Getting started with Jenkins X) +[^#]: via: (https://opensource.com/article/18/11/getting-started-jenkins-x) +[^#]: author: (Dave Johnson https://opensource.com/users/snoopdave) +[^#]: url: ( ) Getting started with Jenkins X ====== diff --git a/sources/tech/20181123 How to Build a Netboot Server, Part 1.md b/sources/tech/20181123 How to Build a Netboot Server, Part 1.md index 443b89e615..01bc4a49dd 100644 --- a/sources/tech/20181123 How to Build a Netboot Server, Part 1.md +++ b/sources/tech/20181123 How to Build a Netboot Server, Part 1.md @@ -435,11 +435,6 @@ $ sed -i '/daemon/a AutomaticLoginEnable=true' /fc28/etc/gdm/custom.conf $ sed -i '/daemon/a AutomaticLogin=liveuser' /fc28/etc/gdm/custom.conf ``` -#### Like this: - -Like - -Loading... -------------------------------------------------------------------------------- From 4a0586871875f4a09d12c1e41e96b2424a1ddb24 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 23:20:45 +0800 Subject: [PATCH 0474/1143] PRF:20181119 How To Customize Bash Prompt In Linux.md @HankChow --- ...9 How To Customize Bash Prompt In Linux.md | 79 ++++++++++++------- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/translated/tech/20181119 How To Customize Bash Prompt In Linux.md b/translated/tech/20181119 How To Customize Bash Prompt In Linux.md index a1f63304f3..190fdb914b 100644 --- a/translated/tech/20181119 How To Customize Bash Prompt In Linux.md +++ b/translated/tech/20181119 How To Customize Bash Prompt In Linux.md @@ -1,5 +1,6 @@ 在 Linux 上自定义 bash 命令提示符 ====== + ![](https://www.ostechnix.com/wp-content/uploads/2017/10/BASH-720x340.jpg) 众所周知,**bash**(the **B**ourne-**A**gain **Sh**ell)是目前绝大多数 Linux 发行版使用的默认 shell。本文将会介绍如何通过添加颜色和样式来自定义 bash 命令提示符的显示。尽管很多插件或工具都可以很轻易地满足这一需求,但我们也可以不使用插件和工具,自己手动自定义一些基本的显示方式,例如添加或者修改某些元素、更改前景色、更改背景色等等。 @@ -9,9 +10,10 @@ 在 bash 中,我们可以通过更改 `$PS1` 环境变量的值来自定义 bash 命令提示符。 一般情况下,bash 命令提示符会是以下这样的形式: + ![](https://www.ostechnix.com/wp-content/uploads/2017/10/Linux-Terminal.png) -在上图这种默认显示形式当中,sk 是我的用户名,而 ubuntuserver 是我的主机名。 +在上图这种默认显示形式当中,“sk” 是我的用户名,而 “ubuntuserver” 是我的主机名。 只要插入一些以反斜杠开头的特殊转义字符串,就可以按照你的喜好修改命令提示符了。下面我来举几个例子。 @@ -23,7 +25,7 @@ $ cp ~/.bashrc ~/.bashrc.bak #### 更改 bash 命令提示符中的 username@hostname 部分 -如上所示,bash 命令提示符一般都带有 username@hostname 部分,这个部分是可以修改的。 +如上所示,bash 命令提示符一般都带有 “username@hostname” 部分,这个部分是可以修改的。 只需要编辑 `~/.bashrc` 文件: @@ -37,7 +39,7 @@ $ vi ~/.bashrc PS1="ostechnix> " ``` -将上面的“ostechnix”替换为任意一个你想使用的单词,然后按 `ESC` 并输入 `:wq` 保存、退出文件。 +将上面的 “ostechnix” 替换为任意一个你想使用的单词,然后按 `ESC` 并输入 `:wq` 保存、退出文件。 执行以下命令使刚才的修改生效: @@ -45,15 +47,22 @@ PS1="ostechnix> " $ source ~/.bashrc ``` -你就可以看见 bash 命令提示符中出现刚才添加的“ostechnix”了。 +你就可以看见 bash 命令提示符中出现刚才添加的 “ostechnix” 了。 ![][3] -再来看看另一个例子,比如将 username@hostname 替换为 Hello@welcome>。 +再来看看另一个例子,比如将 “username@hostname” 替换为 “Hello@welcome>”。 -同样是像刚才那样修改 `~/.bashrc` 文件,然后执行 `source ~/.bashrc` 让修改结果立即生效。 +同样是像刚才那样修改 `~/.bashrc` 文件。 + +``` +export PS1="Hello@welcome> " +``` + +然后执行 `source ~/.bashrc` 让修改结果立即生效。 以下是我在 Ubuntu 18.04 LTS 上修改后的效果。 + ![](https://www.ostechnix.com/wp-content/uploads/2017/10/bash-prompt-1.png) #### 仅显示用户名 @@ -68,7 +77,7 @@ export PS1="\u " 下面提供了一些可以添加到 `$PS1` 环境变量中的用以改变 bash 命令提示符样式的转义字符串。每次修改之后,都需要执行 `source ~/.bashrc` 命令才能立即生效。 -**显示用户名和主机名:** +#### 显示用户名和主机名 ``` export PS1="\u\h " @@ -80,13 +89,13 @@ export PS1="\u\h " skubuntuserver ``` -**显示用户名和完全限定域名Fully Qualified Domain Name(FQDN)** +#### 显示用户名和完全限定域名 ``` export PS1="\u\H " ``` -**在用户名和主机名之间显示其它字符** +#### 在用户名和主机名之间显示其它字符 如果你还需要在用户名和主机名之间显示其它字符(例如 `@`),可以使用以下格式: @@ -95,33 +104,39 @@ export PS1="\u@\h " ``` 命令提示符会这样显示: + ``` sk@ubuntuserver ``` -**显示用户名、主机名,并在末尾添加符号** +#### 显示用户名、主机名,并在末尾添加 $ 符号 + ``` export PS1="\u@\h\\$ " ``` -**综合以上两种显示方式** +#### 综合以上两种显示方式 + ``` export PS1="\u@\h> " ``` 命令提示符最终会这样显示: + ``` sk@ubuntuserver> ``` 相似地,还可以添加其它特殊字符,例如冒号、分号、星号、下划线、空格等等。 -**显示用户名、主机名、shell 名称** +#### 显示用户名、主机名、shell 名称 + ``` export PS1="\u@\h>\s " ``` -**显示用户名、主机名、shell 名称以及 shell 版本** +#### 显示用户名、主机名、shell 名称以及 shell 版本 + ``` export PS1="\u@\h>\s\v " ``` @@ -130,7 +145,7 @@ bash 命令提示符显示样式: ![][4] -**显示用户名、主机名、当前目录** +#### 显示用户名、主机名、当前目录 ``` export PS1="\u@\h\w " @@ -138,30 +153,36 @@ export PS1="\u@\h\w " 如果当前目录是 `$HOME` ,会以一个波浪线(`~`)显示。 -**在 bash 命令提示符中显示日期** +#### 在 bash 命令提示符中显示日期 除了用户名和主机名,如果还想在 bash 命令提示符中显示日期,可以在 `~/.bashrc` 文件中添加以下内容: + ``` export PS1="\u@\h>\d " ``` + ![][5] -**在 bash 命令提示符中显示日期及 12 小时制时间** +#### 在 bash 命令提示符中显示日期及 12 小时制时间 + ``` export PS1="\u@\h>\d\@ " ``` -**显示日期及 hh:mm:ss 格式时间** +#### 显示日期及 hh:mm:ss 格式时间 + ``` export PS1="\u@\h>\d\T " ``` -**显示日期及 24 小时制时间** +#### 显示日期及 24 小时制时间 + ``` export PS1="\u@\h>\d\A " ``` -**显示日期及 24 小时制 hh:mm:ss 格式时间** +#### 显示日期及 24 小时制 hh:mm:ss 格式时间 + ``` export PS1="\u@\h>\d\t " ``` @@ -178,7 +199,7 @@ $ echo $PS1 如果我不想做任何调整,直接把 username@hostname 部分整个去掉可以吗?答案是肯定的。 -如果你是一个技术方面的博主,你有可能会需要在网站或者博客中上传自己的 Linux 终端截图。或许你的用户名和主机名太拉风、太另类,不想让别人看到,在这种情况下,你就需要隐藏命令提示符中的 username@hostname 部分。 +如果你是一个技术方面的博主,你有可能会需要在网站或者博客中上传自己的 Linux 终端截图。或许你的用户名和主机名太拉风、太另类,不想让别人看到,在这种情况下,你就需要隐藏命令提示符中的 “username@hostname” 部分。 如果你不想暴露自己的用户名和主机名,只需要按照以下步骤操作。 @@ -202,13 +223,13 @@ PS1="\W> " $ source ~/.bashrc ``` -现在看一下你的终端,username@hostname 部分已经消失了,只保留了一个 `~>` 标记。 +现在看一下你的终端,“username@hostname” 部分已经消失了,只保留了一个 `~>` 标记。 ![][6] -如果你想要尽可能简单的操作,又不想弄乱你的 `~/.bashrc` 文件,最好的办法就是在系统中创建另一个用户(例如 user@example、admin@demo)。用带有这样的命令提示符的用户去截图或者录屏,就不需要顾虑自己的用户名或主机名被别人看见了。 +如果你想要尽可能简单的操作,又不想弄乱你的 `~/.bashrc` 文件,最好的办法就是在系统中创建另一个用户(例如 “user@example”、“admin@demo”)。用带有这样的命令提示符的用户去截图或者录屏,就不需要顾虑自己的用户名或主机名被别人看见了。 -**警告:**在某些情况下,这种做法并不推荐。例如像 zsh 这种 shell 会继承当前 shell 的设置,这个时候可能会出现一些意想不到的问题。这个技巧只用于隐藏命令提示符中的 username@hostname 部分,仅此而已,如果把这个技巧挪作他用,也可能会出现异常。 +**警告:**在某些情况下,这种做法并不推荐。例如像 zsh 这种 shell 会继承当前 shell 的设置,这个时候可能会出现一些意想不到的问题。这个技巧只用于隐藏命令提示符中的 “username@hostname” 部分,仅此而已,如果把这个技巧挪作他用,也可能会出现异常。 ### 为 bash 命令提示符着色 @@ -217,6 +238,7 @@ $ source ~/.bashrc 通过向 `~/.bashrc` 文件写入一些配置,可以修改 bash 命令提示符的前景色(也就是文本的颜色)和背景色。 例如,下面这一行配置可以令某些文本的颜色变成红色: + ``` export PS1="\u@\[\e[31m\]\h\[\e[m\] " ``` @@ -224,9 +246,11 @@ export PS1="\u@\[\e[31m\]\h\[\e[m\] " 添加配置后,执行 `source ~/.bashrc` 立即生效。 你的 bash 命令提示符就会变成这样: + ![][7] 类似地,可以用这样的配置来改变背景色: + ``` export PS1="\u@\[\e[31;46m\]\h\[\e[m\] " ``` @@ -247,18 +271,17 @@ PS1="\W 🔥 >" 如果你是一个新手,编辑 `$PS1` 环境变量的过程可能会有些困难,因为命令提示符中的大量转义字符串可能会让你有点晕头转向。但不要担心,有一个在线的 bash `$PS1` 生成器可以帮助你轻松生成各种 `$PS1` 环境变量值。 -就是这个网站: +就是这个[网站][9]: [![EzPrompt](https://www.ostechnix.com/wp-content/uploads/2017/10/EzPrompt.png)][9] 只需要直接选择你想要的 bash 命令提示符样式,添加颜色、设计排序,然后就完成了。你可以预览输出,并将配置代码复制粘贴到 `~/.bashrc` 文件中。就这么简单。顺便一提,本文中大部分的示例都是通过这个网站制作的。 - -### 我把我的 `~/.bashrc` 文件弄乱了,该如何恢复? +### 我把我的 ~/.bashrc 文件弄乱了,该如何恢复? 正如我在上面提到的,强烈建议在更改 `~/.bashrc` 文件前做好备份(在更改其它重要的配置文件之前也一定要记得备份)。这样一旦出现任何问题,你都可以很方便地恢复到更改之前的配置状态。当然,如果你忘记了备份,还可以按照下面这篇文章中介绍的方法恢复为默认配置。 -[如何将 `~/.bashrc` 文件恢复到默认配置][10] +- [如何将 `~/.bashrc` 文件恢复到默认配置][10] 这篇文章是基于 ubuntu 的,但也适用于其它的 Linux 发行版。不过事先声明,这篇文章的方法会将 `~/.bashrc` 文件恢复到系统最初时的状态,你对这个文件做过的任何修改都将丢失。 @@ -271,7 +294,7 @@ via: https://www.ostechnix.com/hide-modify-usernamelocalhost-part-terminal/ 作者:[SK][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0b157f72a44eab10d417f4e6a402fd84a1b039fe Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 23:21:12 +0800 Subject: [PATCH 0475/1143] PUB:20181119 How To Customize Bash Prompt In Linux.md @HankChow https://linux.cn/article-10280-1.html --- .../20181119 How To Customize Bash Prompt In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181119 How To Customize Bash Prompt In Linux.md (100%) diff --git a/translated/tech/20181119 How To Customize Bash Prompt In Linux.md b/published/20181119 How To Customize Bash Prompt In Linux.md similarity index 100% rename from translated/tech/20181119 How To Customize Bash Prompt In Linux.md rename to published/20181119 How To Customize Bash Prompt In Linux.md From 817bff427efa518d0092f6efee3c4899cc5e600e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 23:28:13 +0800 Subject: [PATCH 0476/1143] Update 20181122 Getting started with Jenkins X.md --- .../20181122 Getting started with Jenkins X.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20181122 Getting started with Jenkins X.md b/sources/tech/20181122 Getting started with Jenkins X.md index 70cb27b956..1c2aab6903 100644 --- a/sources/tech/20181122 Getting started with Jenkins X.md +++ b/sources/tech/20181122 Getting started with Jenkins X.md @@ -1,11 +1,11 @@ -[^#]: collector: (lujun9972) -[^#]: translator: ( ) -[^#]: reviewer: ( ) -[^#]: publisher: ( ) -[^#]: subject: (Getting started with Jenkins X) -[^#]: via: (https://opensource.com/article/18/11/getting-started-jenkins-x) -[^#]: author: (Dave Johnson https://opensource.com/users/snoopdave) -[^#]: url: ( ) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Getting started with Jenkins X) +[#]: via: (https://opensource.com/article/18/11/getting-started-jenkins-x) +[#]: author: (Dave Johnson https://opensource.com/users/snoopdave) +[#]: url: ( ) Getting started with Jenkins X ====== From d45e7e97ec88e200d08bd0c2e501e8db5439bf1d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 23:28:39 +0800 Subject: [PATCH 0477/1143] Update 20181121 A Closer Look at Voice-Assisted Speakers.md --- ...1 A Closer Look at Voice-Assisted Speakers.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md b/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md index f00259ee61..c3f477c0c3 100644 --- a/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md +++ b/sources/talk/20181121 A Closer Look at Voice-Assisted Speakers.md @@ -1,11 +1,11 @@ -[^#]: collector: (lujun9972) -[^#]: translator: ( ) -[^#]: reviewer: ( ) -[^#]: publisher: ( ) -[^#]: subject: (A Closer Look at Voice-Assisted Speakers) -[^#]: via: (https://www.linux.com/blog/2018/11/closer-look-voice-assisted-speakers) -[^#]: author: (Eric Brown https://www.linux.com/users/ericstephenbrown) -[^#]: url: ( ) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (A Closer Look at Voice-Assisted Speakers) +[#]: via: (https://www.linux.com/blog/2018/11/closer-look-voice-assisted-speakers) +[#]: author: (Eric Brown https://www.linux.com/users/ericstephenbrown) +[#]: url: ( ) A Closer Look at Voice-Assisted Speakers ====== From ff85e76d645eede3aad0722ee32d81e461aafd1a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 26 Nov 2018 23:29:03 +0800 Subject: [PATCH 0478/1143] Update 20181121 10 ways to give thanks to open source and free software maintainers.md --- ... open source and free software maintainers.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md b/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md index b1ad8d8e38..67951fce7c 100644 --- a/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md +++ b/sources/talk/20181121 10 ways to give thanks to open source and free software maintainers.md @@ -1,11 +1,11 @@ -[^#]: collector: (lujun9972) -[^#]: translator: ( ) -[^#]: reviewer: ( ) -[^#]: publisher: ( ) -[^#]: subject: (10 ways to give thanks to open source and free software maintainers) -[^#]: via: (https://opensource.com/article/18/11/ways-give-thanks-open-source) -[^#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[^#]: url: ( ) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (10 ways to give thanks to open source and free software maintainers) +[#]: via: (https://opensource.com/article/18/11/ways-give-thanks-open-source) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) +[#]: url: ( ) 10 ways to give thanks to open source and free software maintainers ====== From 0df7fc26aacc6d174a9fc6becfbbb1dcef591be7 Mon Sep 17 00:00:00 2001 From: Jamkr Date: Mon, 26 Nov 2018 23:56:25 +0800 Subject: [PATCH 0479/1143] [Translating] 20181121 Coupled commands with control operators in Bash --- .../20181121 Coupled commands with control operators in Bash.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181121 Coupled commands with control operators in Bash.md b/sources/tech/20181121 Coupled commands with control operators in Bash.md index 8ddeb3489b..b599dc64af 100644 --- a/sources/tech/20181121 Coupled commands with control operators in Bash.md +++ b/sources/tech/20181121 Coupled commands with control operators in Bash.md @@ -1,3 +1,5 @@ +Translating by Jamskr + Coupled commands with control operators in Bash ====== Add logic to the command line with control operators in compound commands. From c38cd35fad7dd2e3822093cbbfb9d60347099c33 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Tue, 27 Nov 2018 00:23:05 +0800 Subject: [PATCH 0480/1143] hankchow translated --- ...asy Tips for Linux Web Browser Security.md | 159 ------------------ ...asy Tips for Linux Web Browser Security.md | 141 ++++++++++++++++ 2 files changed, 141 insertions(+), 159 deletions(-) delete mode 100644 sources/tech/20181105 5 Easy Tips for Linux Web Browser Security.md create mode 100644 translated/tech/20181105 5 Easy Tips for Linux Web Browser Security.md diff --git a/sources/tech/20181105 5 Easy Tips for Linux Web Browser Security.md b/sources/tech/20181105 5 Easy Tips for Linux Web Browser Security.md deleted file mode 100644 index ef77d6c43c..0000000000 --- a/sources/tech/20181105 5 Easy Tips for Linux Web Browser Security.md +++ /dev/null @@ -1,159 +0,0 @@ -HankChow translating - -5 Easy Tips for Linux Web Browser Security -====== -![](https://www.linux.com/learn/intro-to-linux/2018/11/5-easy-tips-linux-web-browser-security) - -If you use your Linux desktop and never open a web browser, you are a special kind of user. For most of us, however, a web browser has become one of the most-used digital tools on the planet. We work, we play, we get news, we interact, we bank… the number of things we do via a web browser far exceeds what we do in local applications. Because of that, we need to be cognizant of how we work with web browsers, and do so with a nod to security. Why? Because there will always be nefarious sites and people, attempting to steal information. Considering the sensitive nature of the information we send through our web browsers, it should be obvious why security is of utmost importance. - -So, what is a user to do? In this article, I’ll offer a few basic tips, for users of all sorts, to help decrease the chances that your data will end up in the hands of the wrong people. I will be demonstrating on the Firefox web browser, but many of these tips cross the application threshold and can be applied to any flavor of web browser. - -### 1. Choose Your Browser Wisely - -Although most of these tips apply to most browsers, it is imperative that you select your web browser wisely. One of the more important aspects of browser security is the frequency of updates. New issues are discovered quite frequently and you need to have a web browser that is as up to date as possible. Of major browsers, here is how they rank with updates released in 2017: - - 1. Chrome released 8 updates (with Chromium following up with numerous security patches throughout the year). - - 2. Firefox released 7 updates. - - 3. Edge released 2 updates. - - 4. Safari released 1 update (although Apple does release 5-6 security patches yearly). - - - - -But even if your browser of choice releases an update every month, if you (as a user) don’t upgrade, that update does you no good. This can be problematic with certain Linux distributions. Although many of the more popular flavors of Linux do a good job of keeping web browsers up to date, others do not. So, it’s crucial that you manually keep on top of browser updates. This might mean your distribution of choice doesn’t include the latest version of your web browser of choice in its standard repository. If that’s the case, you can always manually download the latest version of the browser from the developer’s download page and install from there. - -If you like to live on the edge, you can always use a beta or daily build version of your browser. Do note, that using a daily build or beta version does come with it the possibility of unstable software. Say, however, you’re okay with using a daily build of Firefox on a Ubuntu-based distribution. To do that, add the necessary repository with the command: - -``` -sudo apt-add-repository ppa:ubuntu-mozilla-daily/ppa -``` - -Update apt and install the daily Firefox with the commands: - -``` -sudo apt-get update -sudo apt-get install firefox -``` - -What’s most important here is to never allow your browser to get far out of date. You want to have the most updated version possible on your desktop. Period. If you fail this one thing, you could be using a browser that is vulnerable to numerous issues. - -### 2. Use A Private Window - -Now that you have your browser updated, how do you best make use of it? If you happen to be of the really concerned type, you should consider always using a private window. Why? Private browser windows don’t retain your data: No passwords, no cookies, no cache, no history… nothing. The one caveat to browsing through a private window is that (as you probably expect), every time you go back to a web site, or use a service, you’ll have to re-type any credentials to log in. If you’re serious about browser security, never saving credentials should be your default behavior. - -This leads me to a reminder that everyone needs: Make your passwords strong! In fact, at this point in the game, everyone should be using a password manager to store very strong passwords. My password manager of choice is [Universal Password Manager][1]. - -### 3\. Protect Your Passwords - -For some, having to retype those passwords every single time might be too much. So what do you do if you want to protect those passwords, while not having to type them constantly? If you use Firefox, there’s a built-in tool, called Master Password. With this enabled, none of your browser’s saved passwords are accessible, until you correctly type the master password. To set this up, do the following: - - 1. Open Firefox. - - 2. Click the menu button. - - 3. Click Preferences. - - 4. In the Preferences window, click Privacy & Security. - - 5. In the resulting window, click the checkbox for Use a master password (Figure 1). - - 6. When prompted, type and verify your new master password (Figure 2). - - 7. Close and reopen Firefox. - - - - -![Master Password][3] - -Figure 1: The Master Password option in Firefox Preferences. - -[Used with permission][4] - -![Setting password][6] - -Figure 2: Setting the Master Password in Firefox. - -[Used with permission][4] - -### 4\. Know your Extensions - -There are plenty of privacy-focused extensions available for most browsers. What extensions you use will depend upon what you want to focus on. For myself, I choose the following extensions for Firefox: - - * [Firefox Multi-Account Containers][7] \- Allows you to configure certain sites to open in a containerized tab. - - * [Facebook Container][8] \- Always opens Facebook in a containerized tab (Firefox Multi-Account Containers is required for this). - - * [Avast Online Security][9] \- Identifies and blocks known phishing sites and displays a website’s security rating (curated by the Avast community of over 400 million users). - - * [Mining Blocker][10] \- Blocks all CPU-Crypto Miners before they are loaded. - - * [PassFF][11] \- Integrates with pass (A UNIX password manager) to store credentials safely. - - * [Privacy Badger][12] \- Automatically learns to block trackers. - - * [uBlock Origin][13] \- Blocks trackers based on known lists. - - -Of course, you’ll find plenty more security-focused extensions for: - - - -+ [Firefox][2] - -+ [Chrome, Chromium, & Vivaldi][5] - -+ [Opera][14] - - -Not every web browser offers extensions. Some, such as Midoria, offer a limited about of built-in plugins, that can be enabled/disabled (Figure 3). However, you won’t find third-party plugins available for the majority of these lightweight browsers. - -![Midori Browser][15] - -Figure 3: The Midori Browser plugins window. - -[Used with permission][4] - -### 5\. Virtualize - -For those that are concerned about releasing locally stored data to prying eyes, one option would be to only use a browser on a virtual machine. To do this, install the likes of [VirtualBox][16], install a Linux guest, and then run whatever browser you like in the virtual environment. If you then apply the above tips, you can be sure your browsing experience will be safe. - -### The Truth of the Matter - -The truth is, if the machine you are working from is on a network, you’re never going to be 100% safe. However, if you use that web browser intelligently you’ll get more bang out of your security buck and be less prone to having data stolen. The silver lining with Linux is that the chances of getting malicious software installed on your machine is exponentially less than if you were using another platform. Just remember to always use the latest release of your browser, keep your operating system updated, and use caution with the sites you visit. - -Learn more about Linux through the free ["Introduction to Linux" ][17] course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/intro-to-linux/2018/11/5-easy-tips-linux-web-browser-security - -作者:[Jack Wallen][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/jlwallen -[b]: https://github.com/lujun9972 -[1]: http://upm.sourceforge.net/ -[2]: https://addons.mozilla.org/en-US/firefox/search/?q=security -[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/browsersecurity_1.jpg?itok=gHMPKEvr (Master Password) -[4]: https://www.linux.com/licenses/category/used-permission -[5]: https://chrome.google.com/webstore/search/security -[6]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/browsersecurity_2.jpg?itok=4L7DR2Ik (Setting password) -[7]: https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/?src=search -[8]: https://addons.mozilla.org/en-US/firefox/addon/facebook-container/?src=search -[9]: https://addons.mozilla.org/en-US/firefox/addon/avast-online-security/?src=search -[10]: https://addons.mozilla.org/en-US/firefox/addon/miningblocker/?src=search -[11]: https://addons.mozilla.org/en-US/firefox/addon/passff/?src=search -[12]: https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/ -[13]: https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/?src=search -[14]: https://addons.opera.com/en/search/?query=security -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/browsersecurity_3.jpg?itok=hdNor0gw (Midori Browser) -[16]: https://www.virtualbox.org/ -[17]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/translated/tech/20181105 5 Easy Tips for Linux Web Browser Security.md b/translated/tech/20181105 5 Easy Tips for Linux Web Browser Security.md new file mode 100644 index 0000000000..6e7ea17a3a --- /dev/null +++ b/translated/tech/20181105 5 Easy Tips for Linux Web Browser Security.md @@ -0,0 +1,141 @@ +提高 Linux 网络浏览器安全性的 5 个建议 +====== +![](https://www.linux.com/learn/intro-to-linux/2018/11/5-easy-tips-linux-web-browser-security) + +如果你使用 Linux 桌面但从来不使用网络浏览器,那你算得上是百里挑一。网络浏览器是绝大多数人最常用的工具之一,无论是工作、娱乐、看新闻、社交、理财,对网络浏览器的依赖都比本地应用要多得多。因此,我们需要知道如何使用网络浏览器才是安全的。一直以来都有不法的犯罪分子以及他们建立的网页试图窃取私密的信息。正是由于我们需要通过网络浏览器收发大量的敏感信息,安全性就更是至关重要。 + +对于用户来说,需要采取什么措施呢?在下文中,我会提出一些基本的建议,让你的重要数据不会被他人轻易窃取。尽管我用于演示的是 Firefox 网络浏览器,但其中大部分建议在任何一种网络浏览器当中都可以适用。 + +### 正确选择浏览器 + +尽管我我提出的建议具有普适性,但是正确选择网络浏览器也是很必要的。网络浏览器的更新频率是它安全性的一个重要体现。网络浏览器会不断暴露出新的问题,因此版本越新的网络浏览器修复的问题就越多,也越安全。在主流的网络浏览器当中,2017 年版本更新的发布量排行榜如下: + + 1. Chrome 发布了 8 个更新(Chromium 全年跟进发布了大量安全补丁)。 + 2. Firefox 发布了 7 个更新。 + 3. Edge 发布了 2 个更新。 + 4. Safari 发布了 1 个更新(苹果也会每年发布 5 到 6 个安全补丁)。 + + + + +网络浏览器会经常发布更新,同时用户方面也要及时升级到最新的版本,否则毫无意义了。尽管大部分流行的 Linux 发行版都会自动更新网络浏览器到最新版本,但还是有一些 Linux 发行版不会自动进行更新,所以最好还是手动保持浏览器更新到最新版本。这就意味着你所使用的 Linux 发行版对应的标准软件库中存放的很可能就不是最新版本的网络浏览器,在这种情况下,你可以随时从网络浏览器开发者提供的最新版本下载页中进行下载安装。 + +如果你是一个勇于探索的人,你还可以尝试使用测试版或者每日构建daily build版的网络浏览器,不过,这些版本将伴随着不能稳定运行的可能性。在基于 Ubuntu 的发行版中,你可以使用到每日构建版的 Firefox,只需要执行以下命令添加所需的存储库: + +``` +sudo apt-add-repository ppa:ubuntu-mozilla-daily/ppa +``` + +按照以下命令更新 `apt` 并安装每日构建版 Firefox: + +``` +sudo apt-get update +sudo apt-get install firefox +``` + +最重要的事情就是永远不要让你的网络浏览器版本过时,必须使用最新版本的网络浏览器。就是这样。如果你没有跟上版本更新的脚步,你使用的将会是一个暴露着各种问题的浏览器。 + +### 使用隐私窗口 + +将网络浏览器更新到最新版本之后,又该如何使用呢?答案是使用隐私窗口,如果你确实很重视安全的话。隐私窗口不会保存你的数据:密码?cookie?缓存?历史?什么都不会保存。因此隐私窗口的一个显著缺点就是每次访问常用的网站或者服务时,都得重新输入密码才能登录使用。当然,如果你认为网络浏览器的安全性很重要,就永远都不要保存任何密码。 + +说到这里,我觉得每一个人都需要让自己的密码变得更强。事实上,大家都应该使用强密码,然后通过管理器来存储。而我的选择是[通用密码管理器Universal Password Manager][1]。 + +### 保护好密码 + +有的人可能会认为,每次都需要重复输入密码,这样的操作太麻烦了。在 Firefox 中,如果你既想保护好自己的密码,又不想经常输入密码,就可以通过 Master Password 这一款内置的工具来实现你的需求。起用了这个工具之后,需要输入正确的主密码,才能后续使用保存在浏览器中的其它密码。你可以按照以下步骤进行操作: + + 1. 打开 Firefox。 + + 2. 点击菜单按钮。 + + 3. 点击“偏好设置”。 + + 4. 在偏好设置页面,点击“隐私与安全”。 + + 5. 在页面中勾选“使用主密码”选项(图 1)。 + + 6. 确认以后,输入新的主密码(图 2)。 + + 7. 重启 Firefox。 + + + + +![Master Password][3] + +图 1: Firefox 偏好设置页中的主密码设置。 + +![Setting password][6] + +图 2:在 Firefox 中设置主密码。 + +### 了解你使用的扩展和插件 + +大多数网络浏览器在保护隐私方面都有很多扩展,你可以根据自己的需求选择不同的扩展。而我自己则选择了一下这些扩展: + + * [Firefox Multi-Account Containers][7] \- 允许将某些站点配置为在容器化选项卡中打开。 + * [Facebook Container][8] \- 始终在容器化选项卡中打开 Facebook(这个扩展需要 Firefox Multi-Account Containers)。 + * [Avast Online Security][9] \- 识别并拦截已知的钓鱼网站,并显示网站的安全评级(由超过 4 亿用户的 Avast 社区支持)。 + * [Mining Blocker][10] \- 拦截所有使用 CPU 的挖矿工具。 + * [PassFF][11] \- 通过集成 `pass` (一个 UNIX 密码管理器)以安全存储密码。 + * [Privacy Badger][12] \- 自动拦截网站跟踪。 + * [uBlock Origin][13] \- 拦截已知的网站跟踪。 + + +除此以外,以下这些浏览器还有很多安全方面的扩展: + ++ [Firefox][2] + ++ [Chrome、Chromium,、Vivaldi][5] + ++ [Opera][14] + + +但并非每一个网络浏览器都会向用户提供扩展或插件。例如 Midoria 就只有少量可以开启或关闭的内置插件(图 3),同时这些轻量级浏览器的第三方插件也相当缺乏。 + +![Midori Browser][15] + +图 3:Midori 浏览器的插件窗口。 + +### 虚拟化 + +如果担心数据在本地存储会被窃取,也可以在虚拟机上运行网络浏览器。只需要安装诸如 [VirtualBox][16] 的软件并安装 Linux 系统,然后就可以在虚拟机中运行任何一款浏览器了。再结合以上几条建议,基本可以保证一定的安全性。 + +### 事情的真相 + +实际上,如果你的机器连接到互联网,就永远不能保证 100% 的安全。当然,只要你正确地使用网络浏览器,你的安全系数会更高,数据也不会轻易被窃取。Linux 的一个好处是被安装恶意软件的几率比其它操作系统要低得多。另外,请记住要使用最新版本的网络浏览器、保持更新操作系统,并且谨慎访问一切网站。 + +你还可以通过 Linux 基金会和 edX 开办的 “[Linux 介绍][17]” 公开课学习到更多这方面的内容。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/intro-to-linux/2018/11/5-easy-tips-linux-web-browser-security + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/jlwallen +[b]: https://github.com/lujun9972 +[1]: http://upm.sourceforge.net/ +[2]: https://addons.mozilla.org/en-US/firefox/search/?q=security +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/browsersecurity_1.jpg?itok=gHMPKEvr "Master Password" +[4]: https://www.linux.com/licenses/category/used-permission +[5]: https://chrome.google.com/webstore/search/security +[6]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/browsersecurity_2.jpg?itok=4L7DR2Ik "Setting password" +[7]: https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/?src=search +[8]: https://addons.mozilla.org/en-US/firefox/addon/facebook-container/?src=search +[9]: https://addons.mozilla.org/en-US/firefox/addon/avast-online-security/?src=search +[10]: https://addons.mozilla.org/en-US/firefox/addon/miningblocker/?src=search +[11]: https://addons.mozilla.org/en-US/firefox/addon/passff/?src=search +[12]: https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/ +[13]: https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/?src=search +[14]: https://addons.opera.com/en/search/?query=security +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/browsersecurity_3.jpg?itok=hdNor0gw "Midori Browser" +[16]: https://www.virtualbox.org/ +[17]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux + From ebc6df38e40e2192038d21408f03e8f57a387503 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Mon, 26 Nov 2018 17:00:55 +0000 Subject: [PATCH 0481/1143] Revert "translating by leemeans" This reverts commit e69a5f975de53457fdd3ef59b6712d81d791f7a1. --- ... Exploring the Linux kernel- The secrets of Kconfig-kbuild.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20181011 Exploring the Linux kernel- The secrets of Kconfig-kbuild.md b/sources/tech/20181011 Exploring the Linux kernel- The secrets of Kconfig-kbuild.md index f2885b177c..8ee4f34897 100644 --- a/sources/tech/20181011 Exploring the Linux kernel- The secrets of Kconfig-kbuild.md +++ b/sources/tech/20181011 Exploring the Linux kernel- The secrets of Kconfig-kbuild.md @@ -1,4 +1,3 @@ -translating by leemeans Exploring the Linux kernel: The secrets of Kconfig/kbuild ====== Dive into understanding how the Linux config/build system works. From 40ee6e9d49cabbba71e458be3ad39fba5f4fda63 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 27 Nov 2018 08:53:23 +0800 Subject: [PATCH 0482/1143] translated --- ...20181116 Akash Angle- How do you Fedora.md | 63 ------------------- ...20181116 Akash Angle- How do you Fedora.md | 61 ++++++++++++++++++ 2 files changed, 61 insertions(+), 63 deletions(-) delete mode 100644 sources/talk/20181116 Akash Angle- How do you Fedora.md create mode 100644 translated/talk/20181116 Akash Angle- How do you Fedora.md diff --git a/sources/talk/20181116 Akash Angle- How do you Fedora.md b/sources/talk/20181116 Akash Angle- How do you Fedora.md deleted file mode 100644 index 1c5fe612cf..0000000000 --- a/sources/talk/20181116 Akash Angle- How do you Fedora.md +++ /dev/null @@ -1,63 +0,0 @@ -translating---geekpi - -Akash Angle: How do you Fedora? -====== -![](https://fedoramagazine.org/wp-content/uploads/2018/11/akash-angle-816x345.jpg) - -We recently interviewed Akash Angle on how he uses Fedora. This is [part of a series][1] on the Fedora Magazine. The series profiles Fedora users and how they use Fedora to get things done. Contact us on the [feedback form][2] to express your interest in becoming a interviewee. - -### Who is Akash Angle? - -Akash is a Linux user who ditched Windows some time ago. An avid Fedora user for the past 9 years, he has tried out almost all the Fedora flavors and spins to get his day to day tasks done. He was introduced to Fedora by a school friend. - -### What Hardware? - -Akash uses a Lenovo B490 at work. It is equipped with an Intel Core i3-3310 Processor, and a 240GB Kingston SSD. “This laptop is great for day to work like surfing the internet, blogging, and a little bit of photo editing and video editing too. Although not a professional laptop and the specs not being that high end, it does the job perfectly,” says Akash. - -He uses a Logitech basic wireless mouse and would like to eventually get a mechanical keyboard. His personal computer — which is a custom-built desktop — has the latest 7th-generation Intel i5 7400 processor, and 8GB Corsair Vengeance RAM. - -![][3] - -### What Software? - -Akash is a fan of the GNOME 3 desktop environment. He loves most of the goodies and bells and whistles the OS can throw in for getting basic tasks done. - -For practical reasons he prefers a fresh installation as a way of upgrading to the latest Fedora version. He thinks Fedora 29 is arguably the the best workstation out there. Akash says this has been backed up by reviews of various tech evangelists and open source news sites. - -To play videos, his go-to is the VLC video player packaged as a [Flatpak][4], which gives him the latest stable version. When Akash wants to make screenshots, the ultimate tool for him is [Shutter, which the Magazine has covered in the past][5]. For graphics, GIMP is something without which he wouldn’t be able to work. - -Google Chrome stable, and the dev channel, are his most used web browsers. He also uses Chromium and the default version of Firefox, and sometimes even Opera makes its way into the party as well. - -All the rest of the magic Akash does is from the terminal, as he is a power user. The GNOME Terminal app is the one for him. - -#### Favorite wallpapers - -One of his favorite wallpapers originally coming from Fedora 16 is the following one: - -![][6] - -And this is the one he currently uses on his Fedora 29 Workstation today: - -![][7] - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/akash-angle-how-do-you-fedora/ - -作者:[Adam Šamalík][a] -选题:[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/asamalik/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/tag/how-do-you-fedora/ -[2]: https://fedoramagazine.org/submit-an-idea-or-tip/ -[3]: https://fedoramagazine.org/wp-content/uploads/2018/11/akash-angle-desktop-300x259.png -[4]: https://fedoramagazine.org/getting-started-flatpak/ -[5]: https://fedoramagazine.org/screenshot-everything-shutter-fedora/ -[6]: https://fedoramagazine.org/wp-content/uploads/2018/11/Fedora-16-300x188.png -[7]: https://fedoramagazine.org/wp-content/uploads/2018/11/wallpaper2you_72588-300x169.jpg diff --git a/translated/talk/20181116 Akash Angle- How do you Fedora.md b/translated/talk/20181116 Akash Angle- How do you Fedora.md new file mode 100644 index 0000000000..9ed990094a --- /dev/null +++ b/translated/talk/20181116 Akash Angle- How do you Fedora.md @@ -0,0 +1,61 @@ +Akash Angle: 你如何使用 Fedora? +====== +![](https://fedoramagazine.org/wp-content/uploads/2018/11/akash-angle-816x345.jpg) + +我们最近采访了Akash Angle 来了解他如何使用 Fedora。这是 Fedora Magazine 上 Fedora [系列的一部分[1]。该系列介绍 Fedora 用户以及他们如何使用 Fedora 完成工作。请通过[反馈栏][2]与我们联系表达你对成为受访者的兴趣。 + +### Akash Angle 是谁? + +Akash 是一位不久前抛弃 Windows 的 Linux 用户。作为一名过去 9 年的狂热 Fedora 用户,他已经尝试了几乎所有的 Fedora 定制版和桌面环境来完成他的日常任务。他被一位学校朋友介绍给 Fedora。 + +### 使用什么硬件? + +Akash 在工作时使用联想 B490。它配备了英特尔酷睿 i3-3310 处理器和 240GB 金士顿 SSD。Akash 说:“这台笔记本电脑非常适合一些日常任务,如上网、写博客,以及一些照片编辑和视频编辑。虽然不是专业的笔记本电脑,而且规格并不是那么高端,但它完美地完成了工作。“ + +他使用一个入门的罗技无线鼠标,并希望能有一个机械键盘。他的 PC 是一台定制桌面电脑,拥有最新的第 7 代 Intel i5 7400 处理器和 8GB Corsair Vengeance 内存。 + +![][3] + +### 使用什么软件? + +Akash 是 GNOME 3 桌面环境的粉丝。他喜欢操作系统为完成基本任务而加入的华丽功能。 + +出于实际原因,他更喜欢全新安来升级到最新 Fedora 版本。他认为 Fedora 29 可以说是最好的工作站。Akash 说这得到了各种科技传播网站和开源新闻网站评论的支持。。 + +为了播放视频,他的首选是打包为 [Flatpak][4] 的 VLC 视频播放器 ,它提供了最新的稳定版本。当 Akash 想截图时,他的终极工具是 [Shutter,Magazine 曾介绍过][5]。对于图形处理,GIMP 是他不能离开的工具。 + +Google Chrome 稳定版和开发版是他最常用的网络浏览器。他还使用 Chromium 和 Firefox 的默认版本,有时甚至会使用 Opera。 + +由于他是一名资深用户,所以 Akash 其余时候都使用终端。GNOME Terminal 是他使用的一个终端。 + +#### 最喜欢的壁纸 + +他最喜欢的壁纸之一是下面最初来自 Fedora 16 的壁纸: + +![][6] + +这是他目前在 Fedora 29 工作站上使用的壁纸之一: + +![][7] + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/akash-angle-how-do-you-fedora/ + +作者:[Adam Šamalík][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/asamalik/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/tag/how-do-you-fedora/ +[2]: https://fedoramagazine.org/submit-an-idea-or-tip/ +[3]: https://fedoramagazine.org/wp-content/uploads/2018/11/akash-angle-desktop-300x259.png +[4]: https://fedoramagazine.org/getting-started-flatpak/ +[5]: https://fedoramagazine.org/screenshot-everything-shutter-fedora/ +[6]: https://fedoramagazine.org/wp-content/uploads/2018/11/Fedora-16-300x188.png +[7]: https://fedoramagazine.org/wp-content/uploads/2018/11/wallpaper2you_72588-300x169.jpg \ No newline at end of file From 3b1b57fd81e77e753501f1a412a7c585c5ec279d Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 27 Nov 2018 08:56:24 +0800 Subject: [PATCH 0483/1143] translating --- ...ng project requirements using the Open Decision Framework.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20180208 Gathering project requirements using the Open Decision Framework.md b/sources/talk/20180208 Gathering project requirements using the Open Decision Framework.md index 5744062efa..9c41f0c78b 100644 --- a/sources/talk/20180208 Gathering project requirements using the Open Decision Framework.md +++ b/sources/talk/20180208 Gathering project requirements using the Open Decision Framework.md @@ -1,3 +1,5 @@ +translating---geekpi + Gathering project requirements using the Open Decision Framework ====== From c88fb31c0d1fd1945c1156b4f7a3593c481731ec Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Nov 2018 11:52:27 +0800 Subject: [PATCH 0484/1143] PRF:20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md @geekpi --- ... ARM (libhoudini) Support, The Easy Way.md | 41 ++++++++----------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/translated/tech/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md b/translated/tech/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md index 16b2bb8d18..2a8ec9139c 100644 --- a/translated/tech/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md +++ b/translated/tech/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md @@ -1,38 +1,38 @@ -Anbox:如何方便地安装 Google Play 商店以及启用 ARM(libhoudini) 支持 +如何在 Anbox 上安装 Google Play 商店及启用 ARM 支持 ====== ![](https://4.bp.blogspot.com/-xBysI_ar5UU/W0NxTe42FkI/AAAAAAAAA2c/KTRtA4C2yYYN9aaMwwAwTXe8deXF4LdNgCLcBGAs/s1600/anbox-google-play-store.png) -**[Anbox][1] 或称为 Anroid in a Box 是一个免费的开源工具,它允许在 Linux 上运行 Android 应用程序**。它的工作原理是在 LXC 容器中运行 Android 运行时环境,重新创建 Android 的目录结构作为可挂载的 loop 镜像,同时使用本机 Linux 内核来执行应用。 +[Anbox][1] (Anroid in a Box)是一个自由开源工具,它允许你在 Linux 上运行 Android 应用程序。它的工作原理是在 LXC 容器中运行 Android 运行时环境,重新创建 Android 的目录结构作为可挂载的 loop 镜像,同时使用本机 Linux 内核来执行应用。 据其网站所述,它的主要特性是安全性、性能、集成和趋同(不同外形尺寸缩放)。 -**使用 Anbox,每个 Android 应用或游戏就像系统应用一样都在一个单独的窗口中启动**,它们的行为或多或少类似于常规窗口,显示在启动器中,可以平铺等等。 +使用 Anbox,每个 Android 应用或游戏就像系统应用一样都在一个单独的窗口中启动,它们的行为或多或少类似于常规窗口,显示在启动器中,可以平铺等等。 -默认情况下,Anbox 没有 Google Play 商店或 ARM 应用支持。要安装应用,你必须下载每个应用 APK 并使用 adb 手动安装。此外,默认情况下不能使用 Anbox 安装 ARM 应用或游戏 - 尝试安装 ARM 应用会显示以下错误: +默认情况下,Anbox 没有 Google Play 商店或 ARM 应用支持。要安装应用,你必须下载每个应用的 APK 并使用 `adb` 手动安装。此外,默认情况下不能使用 Anbox 安装 ARM 应用或游戏 —— 尝试安装 ARM 应用会显示以下错误: ``` Failed to install PACKAGE.NAME.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113] ``` -你可以在 Anbox 中手动设置 Google Play 商店和 ARM 应用支持(通过 libhoudini),但这是一个非常复杂的过程。**为了更容易地在 Anbox 上安装 Google Play 商店和 Google Play 服务,并让它支持 ARM 应用程序和游戏(使用 libhoudini),[geeks-r-us.de][2](文章是德语)上的人创建了一个自动执行这些任务的脚本**。 +你可以在 Anbox 中手动设置 Google Play 商店和 ARM 应用支持(通过 libhoudini),但这是一个非常复杂的过程。为了更容易地在 Anbox 上安装 Google Play 商店和 Google Play 服务,并让它支持 ARM 应用程序和游戏(使用 libhoudini),[geeks-r-us.de][2](文章是德语)上的人创建了一个自动执行这些任务的脚本。 在使用之前,我想明确指出,即使在集成 libhoudini 来支持 ARM 后,也并非所有 Android 应用和游戏都能在 Anbox 中运行。某些 Android 应用和游戏可能根本不会出现在 Google Play 商店中,而一些应用和游戏可能可以安装但无法使用。此外,某些应用可能无法使用某些功能。 -### 安装 Google Play 商店并在 Anbox 上启用 ARM 应用/游戏支持(Android in a Box) +### 安装 Google Play 商店并在 Anbox 上启用 ARM 应用/游戏支持 如果你的 Linux 桌面上尚未安装 Anbox,这些说明显然不起作用。如果你还没有,请按照[此处][7]的安装说明安装 Anbox。此外,请确保在安装 Anbox 之后,使用此脚本之前至少运行一次 `anbox.appmgr`,以避免遇到问题。另外,确保在执行下面的脚本时 Anbox 没有运行(我怀疑这是导致评论中提到的这个[问题][8]的原因)。 -1\. 安装所需的依赖项(wget、lzip、unzip 和 squashfs-tools)。 +1、 安装所需的依赖项(wget、lzip、unzip 和 squashfs-tools)。 在 Debian、Ubuntu 或 Linux Mint 中,使用此命令安装所需的依赖项: + ``` sudo apt install wget lzip unzip squashfs-tools - ``` -2\. 下载并运行脚本,在 Anbox 上自动下载并安装 Google Play商店(和 Google Play 服务)和 libhoudini(用于 ARM 应用/游戏支持)。 +2、 下载并运行脚本,在 Anbox 上自动下载并安装 Google Play 商店(和 Google Play 服务)和 libhoudini(用于 ARM 应用/游戏支持)。 **警告:永远不要在不知道它做什么的情况下运行不是你写的脚本。在运行此脚本之前,请查看其[代码][4]。** @@ -42,25 +42,23 @@ sudo apt install wget lzip unzip squashfs-tools wget https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh chmod +x install-playstore.sh sudo ./install-playstore.sh - ``` -3\. 要让 Google Play 商店在 Anbox 中运行,你需要启用 Google Play 商店和 Google Play 服务的所有权限 +3、要让 Google Play 商店在 Anbox 中运行,你需要启用 Google Play 商店和 Google Play 服务的所有权限 为此,请运行Anbox: ``` anbox.appmgr - ``` -然后进入`设置>应用> Google Play 服务>权限`并启用所有可用权限。对 Google Play 商店也一样! +然后进入“设置 > 应用 > Google Play 服务 > 权限”并启用所有可用权限。对 Google Play 商店也一样! ![](https://4.bp.blogspot.com/-_eNBaOz1RFs/W0NySoRZ5qI/AAAAAAAAA2s/tJseV74r-3Y3M6dnUBmMo9mDfQLqNK7YwCLcBGAs/s1600/anbox-google-play-services-permissions.png) 你现在应该可以使用 Google 帐户登录 Google Play 商店了。 -如果未启用 Google Play 商店和 Google Play 服务的所有权限,你可能会在尝试登录 Google 帐户时可能会遇到问题,并显示以下错误消息:“_Couldn't sign in. There was a problem communicating with Google servers. Try again later_ “,如你在下面的截图中看到的那样: +如果未启用 Google Play 商店和 Google Play 服务的所有权限,你可能会在尝试登录 Google 帐户时可能会遇到问题,并显示以下错误消息:“Couldn't sign in. There was a problem communicating with Google servers. Try again later“,如你在下面的截图中看到的那样: ![](https://4.bp.blogspot.com/-00ffP4iLTT4/W0NyBGECDLI/AAAAAAAAA2k/re7YRgzeU6M6ccVnODlYGak0UsdImrJ_ACLcBGAs/s1600/anbox-google-play-error-login-problem-google-servers.png) @@ -68,23 +66,18 @@ anbox.appmgr **如果你在 Anbox 上登录 Google 帐户时遇到一些连接问题**,请确保 `anbox-bride.sh` 正在运行: - * 启动它: - +启动它: ``` sudo /snap/anbox/current/bin/anbox-bridge.sh start - ``` - - * 重启它: - +重启它: ``` sudo /snap/anbox/current/bin/anbox-bridge.sh restart - ``` -根据[此][9]用户的说法,如果 Anbox 仍然存在连接问题,你可能还需要安装 dnsmasq 包。但是在我的 Ubuntu 18.04 桌面上不需要这样做。 +根据[此用户][9]的说法,如果 Anbox 仍然存在连接问题,你可能还需要安装 dnsmasq 包。但是在我的 Ubuntu 18.04 桌面上不需要这样做。 -------------------------------------------------------------------------------- @@ -94,7 +87,7 @@ via: https://www.linuxuprising.com/2018/07/anbox-how-to-install-google-play-stor 作者:[Logix][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[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/) 荣誉推出 @@ -107,4 +100,4 @@ via: https://www.linuxuprising.com/2018/07/anbox-how-to-install-google-play-stor [6]:https://github.com/anbox/anbox/issues/118#issuecomment-295270113 [7]:https://github.com/anbox/anbox/blob/master/docs/install.md [8]:https://www.linuxuprising.com/2018/07/anbox-how-to-install-google-play-store.html?showComment=1533506821283#c4415289781078860898 -[9]:https://github.com/anbox/anbox/issues/118#issuecomment-295270113 \ No newline at end of file +[9]:https://github.com/anbox/anbox/issues/118#issuecomment-295270113 From 3ad3152b6e229a74d9a3507112d6b472c6693329 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Nov 2018 11:53:37 +0800 Subject: [PATCH 0485/1143] PUB:20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md @geekpi https://linux.cn/article-10281-1.html --- ...lay Store And Enable ARM (libhoudini) Support, The Easy Way.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md (100%) diff --git a/translated/tech/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md b/published/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md similarity index 100% rename from translated/tech/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md rename to published/20180709 Anbox- How To Install Google Play Store And Enable ARM (libhoudini) Support, The Easy Way.md From 62b297eedc7ee0a4c605663e37ca6bb274fc4b92 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Nov 2018 12:39:18 +0800 Subject: [PATCH 0486/1143] PRF:20181105 Revisiting the Unix philosophy in 2018.md @Jamskr --- ... Revisiting the Unix philosophy in 2018.md | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/translated/tech/20181105 Revisiting the Unix philosophy in 2018.md b/translated/tech/20181105 Revisiting the Unix philosophy in 2018.md index 09e6c7fa53..7c9931e601 100644 --- a/translated/tech/20181105 Revisiting the Unix philosophy in 2018.md +++ b/translated/tech/20181105 Revisiting the Unix philosophy in 2018.md @@ -1,67 +1,65 @@ 2018 重温 Unix 哲学 ====== -在现代微服务环境中,构建小型,集中应用程序的旧策略又再一次流行了起来。 +> 在现代微服务环境中,构建小型、单一的应用程序的旧策略又再一次流行了起来。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_data.png?itok=RH6NA32X) -1984年,Rob Pike 和 Brian W 在 AT&T 贝尔实验室技术期刊上发表了名为 “[Unix 环境编程][1]” 的文章,其中他们使用 BSD 的 **cat -v** 例子来认证 Unix 哲学。简而言之,Unix 哲学是:构建小型,单一的应用程序——不管用什么语言——只做一件小而美的事情,用 **stdin** / **stdout** 进行通信,并通过管道进行连接。 +1984 年,Rob Pike 和 Brian W. Kernighan 在 AT&T 贝尔实验室技术期刊上发表了名为 “[Unix 环境编程][1]” 的文章,其中他们使用 BSD 的 `cat -v` 例子来认证 Unix 哲学。简而言之,Unix 哲学是:构建小型、单一的应用程序 —— 不管用什么语言 —— 只做一件小而美的事情,用 `stdin` / `stdout` 进行通信,并通过管道进行连接。 听起来是不是有点耳熟? 是的,我也这么认为。这就是 James Lewis 和 Martin Fowler 给出的 [微服务的定义][2] 。 -> 简单来说,微服务架构的风格是将应用程序开发为一套单一,小型服务的方法,每个服务都运行在它的进程中,并用轻量级机制进行通信,通常是 HTTP 资源 API 。 +> 简单来说,微服务架构的风格是将单个 应用程序开发为一套小型服务的方法,每个服务都运行在它的进程中,并用轻量级机制进行通信,通常是 HTTP 资源 API 。 -虽然一个 *nix 程序或者是一个微服务本身可能非常局限甚至不是很有趣,但是当这些独立工作的单元组合在一起的时候就显示出了它们真正的好处和强大。 +虽然一个 *nix 程序或者是一个微服务本身可能非常局限甚至不是很有用,但是当这些独立工作的单元组合在一起的时候就显示出了它们真正的好处和强大。 ### *nix程序 vs 微服务 -下面的表格对比了 *nix 环境中的程序(例如 **cat** 或 **lsof**)与微服务环境中的程序。 +下面的表格对比了 *nix 环境中的程序(例如 `cat` 或 `lsof`)与微服务环境中的程序。 -| | *nix 程序 | 微服务 | -| ----------------------------------- | -------------------------- | ---------------------------------- | -| 执行单元 | 程序使用 `stdin/stdout` | 使用 HTTP 或 gRPC API | -| 数据流 | 管道 | ? | -| 可配置和参数化 | 命令行参数 | | -| 环境变量和配置文件 | JSON/YAML 文档 | | -| 发现 | 包管理器, man, make | DNS, 环境变量, OpenAPI | +| | *nix 程序 | 微服务 | +| ------------- | ------------------------- | ----------------------- | +| 执行单元 | 程序使用 `stdin`/`stdout` | 使用 HTTP 或 gRPC API | +| 数据流 | 管道 | ? | +| 可配置和参数化 | 命令行参数、环境变量和配置文件 | JSON/YAML 文档 | +| 发现 | 包管理器、man、make | DNS、环境变量、OpenAPI | 让我们详细的看看每一行。 #### 执行单元 -*nix 系统(像 Linux)中的执行单元是一个可执行的文件(二进制或者是脚本),理想情况下,它们从 `stdin` 读取输入并将输出写入 `stdout`。而微服务通过暴露一个或多个通信接口来提供服务,比如 HTTP 和 gRPC APIs。在这两种情况下,你都会发现无状态示例(本质上是纯函数行为)和有状态示例,除了输入之外,还有一些内部(持久)状态决定发生了什么。 +*nix 系统(如 Linux)中的执行单元是一个可执行的文件(二进制或者是脚本),理想情况下,它们从 `stdin` 读取输入并将输出写入 `stdout`。而微服务通过暴露一个或多个通信接口来提供服务,比如 HTTP 和 gRPC API。在这两种情况下,你都会发现无状态示例(本质上是纯函数行为)和有状态示例,除了输入之外,还有一些内部(持久)状态决定发生了什么。 #### 数据流 -传统的,*nix 程序能够通过管道进行通信。换名话说,我们要感谢 [Doug McIlroy][3],你不需要创建临时文件来传递,而可以在每个进程之间处理无穷无尽的数据流。据我所知,除了 [2017 年做的基于 `Apache Kafka` 小实验][4],没有什么能比得上管道化的微服务了。 +传统的,*nix 程序能够通过管道进行通信。换句话说,我们要感谢 [Doug McIlroy][3],你不需要创建临时文件来传递,而可以在每个进程之间处理无穷无尽的数据流。据我所知,除了我在 [2017 年做的基于 Apache Kafka 小实验][4],没有什么能比得上管道化的微服务了。 #### 可配置和参数化 -你是如何配置程序或者服务的,无论是永久性的服务还是即时的服务?是的,在 *nix 系统上,你通常有三种方法:命令行参数,环境变量,或全面化的配置文件。在微服务架构中,典型的做法是用 YAML ( 或者甚至是worse,JSON ) 文档,定制好一个服务的布局和配置以及依赖的组件和通信,存储,和运行时配置。例如 [ Kubernetes 资源定义][5],[Nomad 工作规范][6],或 [Docker 组件][7] 文档。这些可能参数化也可能不参数化;也就是说,除非你知道一些模板语言,像 Kubernetes 中的 [Helm][8],否则你会发现你使用了很多 **sed -i** 这样的命令。 +你是如何配置程序或者服务的,无论是永久性的服务还是即时的服务?是的,在 *nix 系统上,你通常有三种方法:命令行参数、环境变量,或全面的配置文件。在微服务架构中,典型的做法是用 YAML(或者甚至是 JSON)文档,定制好一个服务的布局和配置以及依赖的组件和通信、存储和运行时配置。例如 [Kubernetes 资源定义][5]、[Nomad 工作规范][6] 或 [Docker 编排][7] 文档。这些可能参数化也可能不参数化;也就是说,除非你知道一些模板语言,像 Kubernetes 中的 [Helm][8],否则你会发现你使用了很多 `sed -i` 这样的命令。 #### 发现 -你怎么知道有哪些程序和服务可用,以及如何使用它们?在 *nix 系统中通常都有一个包管理器和一个很好用的 man 页面;使用他们,应该能够回答你所有的问题。在微服务的设置中,在寻找一个服务的时候会相对更自动化一些。除了像 [Airbnb 的 SmartStack][9] 或 [Netflix 的 Eureka][10] 等可以定制以外,通常还有基于环境变量或基于 DNS 的[方法][11],允许您动态的发现服务。同样重要的是,事实上 [OpenAPI][12] 为 HTTP API 提供了一套标准文档和设计模式,[gRPC][13] 为一些耦合性强的高性能项目也做了同样的事情。最后非常重要的一点是,考虑到开发人员的经验(DX),应该从写一份好的 [Makefiles][14] 开始,并以编写符合 [**风格**][15] 的文档结束。 +你怎么知道有哪些程序和服务可用,以及如何使用它们?在 *nix 系统中通常都有一个包管理器和一个很好用的 man 页面;使用它们,应该能够回答你所有的问题。在微服务的设置中,在寻找一个服务的时候会相对更自动化一些。除了像 [Airbnb 的 SmartStack][9] 或 [Netflix 的 Eureka][10] 等可以定制以外,通常还有基于环境变量或基于 DNS 的[方法][11],允许您动态的发现服务。同样重要的是,事实上 [OpenAPI][12] 为 HTTP API 提供了一套标准文档和设计模式,[gRPC][13] 为一些耦合性强的高性能项目也做了同样的事情。最后非常重要的一点是,考虑到开发者经验(DX),应该从写一份好的 [Makefile][14] 开始,并以编写符合 [风格][15] 的文档结束。 ### 优点和缺点 -*nix 系统和微服务都提供了许多挑战和机遇 +*nix 系统和微服务都提供了许多挑战和机遇。 #### 模块性 -设计一个简洁,有清晰的目的并且能够很好的和其它模块配合是很困难的。甚至是在不同版本中实现并引入相应的异常处理流程都很困难的。在微服务中,这意味着重试逻辑和超时机制,或者将这些功能外包到服务网格( service mesh )是不是一个更好的选择呢?这确实比较难,可如果你做好了,那它的可重用性是巨大的。 +要设计一个简洁、有清晰的目的,并且能够很好地和其它模块配合的某个东西是很困难的。甚至是在不同版本中实现并引入相应的异常处理流程都很困难的。在微服务中,这意味着重试逻辑和超时机制,或者将这些功能外包到服务网格service mesh是不是一个更好的选择呢?这确实比较难,可如果你做好了,那它的可重用性是巨大的。 -#### Observability +#### 可观测性 -#### 预测 - -在一个巨型(2018年)或是一个试图做任何事情的大型程序(1984)年,当事情开始变坏的时候,应当能够直接的找到问题的根源。但是在一个 +在一个独石monolith(2018 年)或是一个试图做任何事情的大型程序(1984 年),当情况恶化的时候,应当能够直接的找到问题的根源。但是在一个 ``` yes | tr \\n x | head -c 450m | grep n ``` -或者在一个微服务设置中请求一个路径,例如,涉及20个服务,你怎么弄清楚是哪个服务的问题?幸运的是,我们有很多标准,特别是 [OpenCensus][16] 和 [OpenTracing][17]。如果您希望转向微服务,可预测性仍然可能是最大的问题。 +或者在一个微服务设置中请求一个路径,例如,涉及 20 个服务,你怎么弄清楚是哪个服务的问题?幸运的是,我们有很多标准,特别是 [OpenCensus][16] 和 [OpenTracing][17]。如果您希望转向微服务,可预测性仍然可能是最大的问题。 #### 全局状态 @@ -77,8 +75,8 @@ via: https://opensource.com/article/18/11/revisiting-unix-philosophy-2018 作者:[Michael Hausenblas][a] 选题:[lujun9972][b] -译者:[Jamkr](https://github.com/Jamkr) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Jamskr](https://github.com/Jamskr) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1f894788fa8fb5638ad1d73b50d1e6c0e9cde9e2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Nov 2018 12:39:39 +0800 Subject: [PATCH 0487/1143] PUB:20181105 Revisiting the Unix philosophy in 2018.md @Jamskr https://linux.cn/article-10282-1.html --- .../20181105 Revisiting the Unix philosophy in 2018.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181105 Revisiting the Unix philosophy in 2018.md (100%) diff --git a/translated/tech/20181105 Revisiting the Unix philosophy in 2018.md b/published/20181105 Revisiting the Unix philosophy in 2018.md similarity index 100% rename from translated/tech/20181105 Revisiting the Unix philosophy in 2018.md rename to published/20181105 Revisiting the Unix philosophy in 2018.md From 5b9c4ad3c98ed1beebae08692515ae8a26c17534 Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Tue, 27 Nov 2018 15:19:04 +0800 Subject: [PATCH 0488/1143] Update 20181119 7 command-line tools for writers - Opensource.com.md --- ...0181119 7 command-line tools for writers - Opensource.com.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md b/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md index a482895af2..a222389079 100644 --- a/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md +++ b/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md @@ -1,3 +1,5 @@ +Translating by LazyWolfLin + 7 command-line tools for writers | Opensource.com ====== Put away your word processor and start writing from the command line using these open source tools. From 84537f2c78cda139dce7ef7c6cdef3b282ab9b23 Mon Sep 17 00:00:00 2001 From: Valonia Kim <34000495+Valoniakim@users.noreply.github.com> Date: Tue, 27 Nov 2018 15:44:18 +0800 Subject: [PATCH 0489/1143] Translating --- ...04 How Creative Commons benefits artists and big business.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20180104 How Creative Commons benefits artists and big business.md b/sources/talk/20180104 How Creative Commons benefits artists and big business.md index cbcc346c28..b3bba7686e 100644 --- a/sources/talk/20180104 How Creative Commons benefits artists and big business.md +++ b/sources/talk/20180104 How Creative Commons benefits artists and big business.md @@ -1,3 +1,5 @@ +translating by valonia + How Creative Commons benefits artists and big business ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/CreativeCommons_ideas_520x292_1112JS.png?itok=otei0vKb) From 2f894f510586a0222582daf37bc67308bcf12e5b Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 27 Nov 2018 19:05:45 +0800 Subject: [PATCH 0490/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Conf?= =?UTF-8?q?igure=20IP=20Address=20In=20Ubuntu=2018.04=20LTS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...onfigure IP Address In Ubuntu 18.04 LTS.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md diff --git a/sources/tech/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md b/sources/tech/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md new file mode 100644 index 0000000000..61d10fdba9 --- /dev/null +++ b/sources/tech/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (How To Configure IP Address In Ubuntu 18.04 LTS) +[#]: via: (https://www.ostechnix.com/how-to-configure-ip-address-in-ubuntu-18-04-lts/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) +[#]: url: ( ) + +How To Configure IP Address In Ubuntu 18.04 LTS +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/11/configure-ip-address-720x340.jpg) + +The method of configuring IP address on Ubuntu 18.04 LTS is significantly different than the older methods. Unlike the previous versions, the Ubuntu 18.04 uses **Netplan** , a new command line network configuration utility, to configure IP address. Netplan has been introduced by Ubuntu developers in Ubuntu 17.10. In this new approach, we no longer use **/etc/network/interfaces** file to configure IP address rather we use a YAML file. The default configuration files of Netplan are found under **/etc/netplan/** directory. In this brief tutorial, we are going to learn to configure static and dynamic IP address in **Ubuntu 18.04 LTS** minimal server. + +### Configure Static IP Address In Ubuntu 18.04 LTS + +Let us find out the default network configuration file: + +``` +$ ls /etc/netplan/ +50-cloud-init.yaml +``` + +As you can see, the default network configuration file is **50-cloud-init.yaml** and it is obviously a YAML file. + +Now, let check the contents of this file: + +``` +$ cat /etc/netplan/50-cloud-init.yaml +``` + +I have configured my network card to obtain IP address from the DHCP server when I am installing Ubuntu 18.04, so here is my network configuration details: + +![](https://www.ostechnix.com/wp-content/uploads/2018/11/configure-network.png) + +As you can see, I have two network cards, namely **enp0s3** and **enp0s8** , and both are configured to accept IPs from the DHCP server. + +Let us now configure static IP addresses to both network cards. + +To do so, open the default network configuration file in any editor of your choice. + +``` +$ sudo nano /etc/netplan/50-cloud-init.yaml +``` + +Now, update the file by adding the IP address, netmask, gateway and DNS server. For the purpose of this file, I have used **192.168.225.50** as my IP for **enp0s3** and **192.168.225.51** for **enp0s8** , **192.168.225.1** as gateway, **255.255.255.0** as netwmask and **8.8.8.8** , **8.8.4.4** as DNS servers. + +![](https://www.ostechnix.com/wp-content/uploads/2018/11/configure-static-ip.png) + +Please mind the space between the lines. Don’t use **TAB** to align the lines as it will not work in Ubuntu 18.04. Instead, just use SPACEBAR key to make them in a consistent order as shown in the above picture. + +Also, we don’t use a separate line to define netmask (255.255.255.0) in Ubuntu 18.04. For instance, in older Ubuntu versions, we configure IP and netmask like below: + +``` +address = 192.168.225.50 +netmask = 255.255.255.0 +``` + +However, with netplan, we combine those two lines with a single line as shown below: + +``` +addresses : [192.168.225.50/24] +``` + +Once you’re done, Save and close the file. + +Apply the network configuration using command: + +``` +$ sudo netplan apply +``` + +If there are any issues, run the following command to investigate and check what is the problem in the configuration. + +``` +$ sudo netplan --debug apply +``` + +Output: + +``` +** (generate:1556): DEBUG: 09:14:47.220: Processing input file //etc/netplan/50-cloud-init.yaml.. +** (generate:1556): DEBUG: 09:14:47.221: starting new processing pass +** (generate:1556): DEBUG: 09:14:47.221: enp0s8: setting default backend to 1 +** (generate:1556): DEBUG: 09:14:47.222: enp0s3: setting default backend to 1 +** (generate:1556): DEBUG: 09:14:47.222: Generating output files.. +** (generate:1556): DEBUG: 09:14:47.223: NetworkManager: definition enp0s8 is not for us (backend 1) +** (generate:1556): DEBUG: 09:14:47.223: NetworkManager: definition enp0s3 is not for us (backend 1) +DEBUG:netplan generated networkd configuration exists, restarting networkd +DEBUG:no netplan generated NM configuration exists +DEBUG:device enp0s3 operstate is up, not replugging +DEBUG:netplan triggering .link rules for enp0s3 +DEBUG:device lo operstate is unknown, not replugging +DEBUG:netplan triggering .link rules for lo +DEBUG:device enp0s8 operstate is up, not replugging +DEBUG:netplan triggering .link rules for enp0s8 +``` + +Now, let us check the Ip address using command: + +``` +$ ip addr +``` + +Sample output from my Ubuntu 18.04 LTS: +![](https://www.ostechnix.com/wp-content/uploads/2018/11/Check-IP-address.png) + +Congratulations! We have successfully configured static IP address in Ubuntu 18.04 LTS with Netplan configuration tool. + +For more details, refer the Netplan man pages. + +``` +$ man netplan +``` + +### Configure Dynamic IP Address In Ubuntu 18.04 LTS + +To configure dynamic address, just leave the default configuration file as the way it is. If you already have configured static IP address, just remove the newly added lines and make the YAML file look like exactly as shown in the **figure 1** in the previous section. + +That’s all. You know now how to configure static and dynamic IP in Ubuntu 18.04 LTS server. Personally, I don’t like this new method. The old method is much easier and better. How about you? Did you find it easy or hard? Let me know in the comment section below. + +More good stuffs to come. Stay tuned! + +Cheers! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-configure-ip-address-in-ubuntu-18-04-lts/ + +作者:[SK][a] +选题:[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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 From d35d68e9406e150ebb42f2c81436dccc6b2bb398 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 27 Nov 2018 19:15:14 +0800 Subject: [PATCH 0491/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=2014=20Best=20ASC?= =?UTF-8?q?II=20Games=20for=20Linux=20That=20are=20Insanely=20Good?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Games for Linux That are Insanely Good.md | 335 ++++++++++++++++++ 1 file changed, 335 insertions(+) create mode 100644 sources/tech/20181124 14 Best ASCII Games for Linux That are Insanely Good.md diff --git a/sources/tech/20181124 14 Best ASCII Games for Linux That are Insanely Good.md b/sources/tech/20181124 14 Best ASCII Games for Linux That are Insanely Good.md new file mode 100644 index 0000000000..094467698b --- /dev/null +++ b/sources/tech/20181124 14 Best ASCII Games for Linux That are Insanely Good.md @@ -0,0 +1,335 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (14 Best ASCII Games for Linux That are Insanely Good) +[#]: via: (https://itsfoss.com/best-ascii-games/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: url: ( ) + +14 Best ASCII Games for Linux That are Insanely Good +====== + +Text-based or should I say [terminal-based games][1] were very popular a decade back – when you didn’t have visual masterpieces like God Of War, Red Dead Redemption 2 or Spiderman. + +Of course, the Linux platform has its share of good games – but not always the “latest and greatest”. But, there are some ASCII games out there – to which you can never turn your back on. + +I’m not sure if you’d believe me, some of the ASCII games proved to be very addictive (So, it might take a while for me to resume work on the next article, or I might just get fired? – Help me!) + +Jokes apart, let us take a look at the best ASCII games. + +**Note:** Installing ASCII games could be time-consuming (some might ask you to install additional dependencies or simply won’t work). You might even encounter some ASCII games that require you build from Source. So, we’ve filtered out only the ones that are easy to install/run – without breaking a sweat. + +### Things to do before Running or Installing an ASCII Game + +Some of the ASCII games might require you to install [Simple DirectMedia Layer][2] unless you already have it installed. So, in case, you should install them first before trying to run any of the games mentioned in this article. + +For that, you just need to type in these commands: + +``` +sudo apt install libsdl2-2.0 +``` + +``` +sudo apt install libsdl2_mixer-2.0 +``` + + +### Best ASCII Games for Linux + +![Best Ascii games for Linux][3] + +The games listed are in no particular order of ranking. + +#### 1 . [Curse of War][4] + +![Curse of War ascii games][5] + +Curse of War is an interesting strategy game. You might find it a bit confusing at first but once you get to know it – you’ll love it. I’ll recommend you to take a look at the rules of the game on their [homepage][4] before launching the game. + +You will be building infrastructure, secure resources and directing your army to fight. All you have to do is place your flag in a good position to let your army take care of the rest. It’s not just about attacking – you need to manage and secure the resources to help win the fight. + +If you’ve never played any ASCII game before, be patient and spend some time learning it – to experience it to its fullest potential. + +##### How to install Curse of War? + +You will find it in the official repository. So, type in the following command to install it: + +``` +sudo apt install curseofwar +``` +#### 2. ASCII Sector + +![ascii sector][6] + +Hate strategy games? Fret not, ASCII sector is a game that has a space-setting and lets you explore a lot. + +Also, the game isn’t just limited to exploration, you need some action? You got that here as well. Of course, not the best combat experience- but it is fun. It gets even more exciting when you see a variety of bases, missions, and quests. You’ll encounter a leveling system in this tiny game where you have to earn enough money or trade in order upgrade your spaceship. + +The best part about this game is – you can create your own quests or play other’s. + +###### How to install ASCII Sector? + +You need to first download and unpack the archived package from the [official site][7]. After it’s done, open up your terminal and type these commands (replace the **Downloads** folder with your location where the unpacked folder exists, ignore it if the unpacked folder resides inside your home directory): + +``` +cd Downloads +cd asciisec +chmod +x asciisec +./asciisec +``` + +#### 3. DoomRL + +![doom ascii game][8] + +You must be knowing the classic game “Doom”. So, if you want the scaled down experience of it as a rogue-like, DoomRL is for you. It is an ASCII-based game, in case you don’t feel like it to be. + +It’s a very tiny game with a lot of gameplay hours to have fun with. + +###### How to install DoomRL? + +Similar to what you did for ASCII Sector, you need to download the official archive from their [download page][9] and then extract it to a folder. + +After extracting it, type in these commands: + +``` +cd Downloads // navigating to the location where the unpacked folder exists +``` + +``` +cd doomrl-linux-x64-0997 +chmod +x doomrl +./doomrl +``` +#### 4. Pyramid Builder + +![Pyramid Builder ascii game for Linux][10] + +Pyramid Builder is an innovative take as an ASCII game where get to improve your civilization by helping build pyramids. + +You need to direct the workers to farm, unload the cargo, and move the gigantic stones to successfully build the pyramid. + +It is indeed a beautiful ASCII game to download. + +###### How to install Pyramid Builder? + +Simply head to its official site and download the package to unpack it. After extraction, navigate to the folder and run the executable file. + +``` +cd Downloads +cd pyramid_builder_linux +chmod +x pyramid_builder_linux.x86_64 +./pyramid_builder_linux.x86_64 +``` +#### 5. DiabloRL + +![Diablo ascii RPG game][11] + +If you’re an avid gamer, you must have heard about Blizzard’s Diablo 1. It is undoubtedly a good game. + +You get the chance to play a unique rendition of the game – which is an ASCII game. DiabloRL is a turn-based rogue-like game that is insanely good. You get to choose from a variety of classes (Warrior, Sorcerer, or Rogue). Every class would result in a different gameplay experience with a set of different stats. + +Of course, personal preference will differ – but it’s a decent “unmake” of Diablo. What do you think? + +#### 6. Ninvaders + +![Ninvaders terminal game for Linux][12] + +Ninvaders is one of the best ASCII game just because it’s so simple and an arcade game to kill time. + +You have to defend against a hord of invaders – just finish them off before they get to you. It sounds very simple – but it is a challenging game. + +##### How to install Ninvaders? + +Similar to Curse of War, you can find this in the official repository. So, just type in this command to install it: + +``` +sudo apt install ninvaders  +``` +#### 7. Empire + +![Empire terminal game][13] + +A real-time strategy game for which you will need an active Internet connection. I’m personally not a fan of Real-Time strategy games, but if you are a fan of such games – you should really check out their [guide][14] to play this game – because it can be very challenging to learn. + +The rectangle contains cities, land, and water. You need to expand your city with an army, ships, planes and other resources. By expanding quickly, you will be able to capture other cities by destroying them before they make a move. + +##### How to install Empire? + +Install this is very simple, just type in the following command: + +``` +sudo apt install empire +``` + +#### 8. Nudoku + +![Nudoku is a terminal version game of Sudoku][15] + +Love Sudoku? Well, you have Nudoku – a clone for it. A perfect time-killing ASCII game while you relax. + +It presents you with three difficulty levels – Easy, normal, and hard. If you want to put up a challenge with the computer, the hard difficulty will be perfect! If you just want to chill, go for the easy one. + +##### How to install Nudoku? + +It’s very easy to get it installed, just type in the following command in the terminal: + +``` +sudo apt install nudoku +``` + +#### 9\. Nethack + +A dungeons and dragon-style ASCII game which is one of the best out there. I believe it’s one of your favorites if you already knew about ASCII games for Linux – in general. + +It features a lot of different levels (about 45) and comes packed in with a bunch of weapons, scrolls, potions, armor, rings, and gems. You can also choose permadeath as your mode to play it. + +It’s not just about killing here – you got a lot to explore. + +##### How to install Nethack? + +Simply follow the command below to install it: + +``` +sudo apt install nethack +``` + +#### 10. ASCII Jump + +![ascii jump game][16] + +ASCII Jump is a dead simple game where you have to slide along a varierty of tracks – while jumping, changing position, and moving as long as you can to cover maximum distance. + +It’s really amazing to see how this ASCII game looks like (visually) even it seems so simple. You can start with the training mode and then proceed to the world cup. You also get to choose your competitors and the hills on which you want to start the game. + +##### How to install Ascii Jump? + +To install the game, just type the following command: + +``` +sudo apt install asciijump +``` + +#### 11. Bastet + +![Bastet is tetris game in ascii form][17] + +Let’s just not pay any attention to the name – it’s actually a fun clone of Tetris game. + +You shouldn’t expect it to be just another ordinary tetris game – but it will present you the worst possible bricks to play with. Have fun! + +##### How to install Bastet? + +Open the terminal and type in the following command: + +``` +sudo apt install bastet +``` + +#### 12\. Bombardier + +![Bomabrdier game in ascii form][18] + +Bombardier is yet another simple ASCII game which will keep you hooked on to it. + +Here, you have a helicopter (or whatever you’d like to call your aircraft) which lowers down every cycle and you need to throw bombs in order to destroy the blocks/buildings under you. The game also puts a pinch of humor for the messages it displays when you destroy a block. It is fun. + +##### How to install Bombardier? + +Bombardier is available in the official repository, so just type in the following in the terminal to install it: + +``` +sudo apt install bombardier +``` + +#### 13\. Angband + +![Angband ascii game][19] + +A cool dungeon exploration game with a neat interface. You can see all the vital information in a single screen while you explore the game. + +It contains different kinds of race to pick a character. You can either be an Elf, Hobbit, Dwarf or something else – there’s nearly a dozen to choose from. Remember, that you need to defeat the lord of darkness at the end – so make every upgrade possible to your weapon and get ready. + +How to install Angband? + +Simply type in the following command: + +``` +sudo apt install angband +``` + +#### 14\. GNU Chess + +![GNU Chess is a chess game that you can play in Linux terminal][20] + +How can you not play chess? It is my favorite strategy game! + +But, GNU Chess can be tough to play with unless you know the Algebraic notation to describe the next move. Of course, being an ASCII game – it isn’t quite possible to interact – so it asks you the notation to detect your move and displays the output (while it waits for the computer to think its next move). + +##### How to install GNU Chess? + +If you’re aware of the algebraic notations of Chess, enter the following command to install it from the terminal: + +``` +sudo apt install gnuchess +``` + +#### Some Honorable Mentions + +As I mentioned earlier, we’ve tried to recommend you the best (but also the ones that are the easiest to install on your Linux machine). + +However, there are some iconic ASCII games which deserve the attention and requires a tad more effort to install (You will get the source code and you need to build it / install it). + +Some of those games are: + ++ [Cataclysm: Dark Days Ahead][22] ++ [Brogue][23] ++ [Dwarf Fortress][24] + +You should follow our [guide to install software from source code][21]. + +### Wrapping Up + +Which of the ASCII games mentioned seem perfect for you? Did we miss any of your favorites? + +Let us know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-ascii-games/ + +作者:[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-command-line-games-linux/ +[2]: https://www.libsdl.org/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/best-ascii-games-featured.png?resize=800%2C450&ssl=1 +[4]: http://a-nikolaev.github.io/curseofwar/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/curseofwar-ascii-game.jpg?fit=800%2C479&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/ascii-sector-game.jpg?fit=800%2C424&ssl=1 +[7]: http://www.asciisector.net/download/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/doom-rl-ascii-game.jpg?ssl=1 +[9]: https://drl.chaosforge.org/downloads +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/pyramid-builder-ascii-game.jpg?fit=800%2C509&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/diablo-rl-ascii-game.jpg?ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/ninvaders-ascii-game.jpg?fit=800%2C426&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/empire-ascii-game.jpg?fit=800%2C570&ssl=1 +[14]: http://www.wolfpackempire.com/infopages/Guide.html +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/nudoku-ascii-game.jpg?fit=800%2C434&ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/ascii-jump.jpg?fit=800%2C566&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/bastet-tetris-clone-ascii.jpg?fit=800%2C465&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/bombardier.jpg?fit=800%2C571&ssl=1 +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/angband-ascii-game.jpg?ssl=1 +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/gnuchess-ascii-game.jpg?ssl=1 +[21]: https://itsfoss.com/install-software-from-source-code/ +[22]: https://github.com/CleverRaven/Cataclysm-DDA +[23]: https://sites.google.com/site/broguegame/ +[24]: http://www.bay12games.com/dwarves/index.html + From fda8302530fe376ff48cec0d220555a4e2491118 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 27 Nov 2018 19:19:54 +0800 Subject: [PATCH 0492/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Three=20SSH=20G?= =?UTF-8?q?UI=20Tools=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20181123 Three SSH GUI Tools for Linux.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/tech/20181123 Three SSH GUI Tools for Linux.md diff --git a/sources/tech/20181123 Three SSH GUI Tools for Linux.md b/sources/tech/20181123 Three SSH GUI Tools for Linux.md new file mode 100644 index 0000000000..9691a737ca --- /dev/null +++ b/sources/tech/20181123 Three SSH GUI Tools for Linux.md @@ -0,0 +1,176 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Three SSH GUI Tools for Linux) +[#]: via: (https://www.linux.com/blog/learn/intro-to-linux/2018/11/three-ssh-guis-linux) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) +[#]: url: ( ) + +Three SSH GUI Tools for Linux +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh.jpg?itok=3UcXhJt7) + +At some point in your career as a Linux administrator, you’re going to use Secure Shell (SSH) to remote into a Linux server or desktop. Chances are, you already have. In some instances, you’ll be SSH’ing into multiple Linux servers at once. In fact, Secure Shell might well be one of the most-used tools in your Linux toolbox. Because of this, you’ll want to make the experience as efficient as possible. For many admins, nothing is as efficient as the command line. However, there are users out there who do prefer a GUI tool, especially when working from a desktop machine to remote into and work on a server. + +If you happen to prefer a good GUI tool, you’ll be happy to know there are a couple of outstanding graphical tools for SSH on Linux. Couple that with a unique terminal window that allows you to remote into multiple machines from the same window, and you have everything you need to work efficiently. Let’s take a look at these three tools and find out if one (or more) of them is perfectly apt to meet your needs. + +I’ll be demonstrating these tools on [Elementary OS][1], but they are all available for most major distributions. + +### PuTTY + +Anyone that’s been around long enough knows about [PuTTY][2]. In fact, PuTTY is the de facto standard tool for connecting, via SSH, to Linux servers from the Windows environment. But PuTTY isn’t just for Windows. In fact, from withing the standard repositories, PuTTY can also be installed on Linux. PuTTY’s feature list includes: + + * Saved sessions. + + * Connect via IP address or hostname. + + * Define alternative SSH port. + + * Connection type definition. + + * Logging. + + * Options for keyboard, bell, appearance, connection, and more. + + * Local and remote tunnel configuration + + * Proxy support + + * X11 tunneling support + + + + +The PuTTY GUI is mostly a way to save SSH sessions, so it’s easier to manage all of those various Linux servers and desktops you need to constantly remote into and out of. Once you’ve connected, from PuTTY to the Linux server, you will have a terminal window in which to work. At this point, you may be asking yourself, why not just work from the terminal window? For some, the convenience of saving sessions does make PuTTY worth using. + +Installing PuTTY on Linux is simple. For example, you could issue the command on a Debian-based distribution: + +``` +sudo apt-get install -y putty +``` + +Once installed, you can either run the PuTTY GUI from your desktop menu or issue the command putty. In the PuTTY Configuration window (Figure 1), type the hostname or IP address in the HostName (or IP address) section, configure the port (if not the default 22), select SSH from the connection type, and click Open. + +![PuTTY Connection][4] + +Figure 1: The PuTTY Connection Configuration Window. + +[Used with permission][5] + +Once the connection is made, you’ll then be prompted for the user credentials on the remote server (Figure 2). + +![log in][7] + +Figure 2: Logging into a remote server with PuTTY. + +[Used with permission][5] + +To save a session (so you don’t have to always type the remote server information), fill out the IP address (or hostname), configure the port and connection type, and then (before you click Open), type a name for the connection in the top text area of the Saved Sessions section, and click Save. This will then save the configuration for the session. To then connect to a saved session, select it from the saved sessions window, click Load, and then click Open. You should then be prompted for the remote credentials on the remote server. + +### EasySSH + +Although [EasySSH][8] doesn’t offer the amount of configuration options found in PuTTY, it’s (as the name implies) incredibly easy to use. One of the best features of EasySSH is that it offers a tabbed interface, so you can have multiple SSH connections open and quickly switch between them. Other EasySSH features include: + + * Groups (so you can group tabs for an even more efficient experience). + + * Username/password save. + + * Appearance options. + + * Local and remote tunnel support. + + + + +Install EasySSH on a Linux desktop is simple, as the app can be installed via flatpak (which does mean you must have Flatpak installed on your system). Once flatpak is installed, add EasySSH with the commands: + +``` +sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + +sudo flatpak install flathub com.github.muriloventuroso.easyssh +``` + +Run EasySSH with the command: + +``` +flatpak run com.github.muriloventuroso.easyssh +``` + +The EasySSH app will open, where you can click the + button in the upper left corner. In the resulting window (Figure 3), configure your SSH connection as required. + +![Adding a connection][10] + +Figure 3: Adding a connection in EasySSH is simple. + +[Used with permission][5] + +Once you’ve added the connection, it will appear in the left navigation of the main window (Figure 4). + +![EasySSH][12] + +Figure 4: The EasySSH main window. + +[Used with permission][5] + +To connect to a remote server in EasySSH, select it from the left navigation and then click the Connect button (Figure 5). + +![Connecting][14] + +Figure 5: Connecting to a remote server with EasySSH. + +[Used with permission][5] + +The one caveat with EasySSH is that you must save the username and password in the connection configuration (otherwise the connection will fail). This means anyone with access to the desktop running EasySSH can remote into your servers without knowing the passwords. Because of this, you must always remember to lock your desktop screen any time you are away (and make sure to use a strong password). The last thing you want is to have a server vulnerable to unwanted logins. + +### Terminator + +Terminator is not actually an SSH GUI. Instead, Terminator functions as a single window that allows you to run multiple terminals (and even groups of terminals) at once. Effectively you can open Terminator, split the window vertical and horizontally (until you have all the terminals you want), and then connect to all of your remote Linux servers by way of the standard SSH command (Figure 6). + +![Terminator][16] + +Figure 6: Terminator split into three different windows, each connecting to a different Linux server. + +[Used with permission][5] + +To install Terminator, issue a command like: + +### sudo apt-get install -y terminator + +Once installed, open the tool either from your desktop menu or from the command terminator. With the window opened, you can right-click inside Terminator and select either Split Horizontally or Split Vertically. Continue splitting the terminal until you have exactly the number of terminals you need, and then start remoting into those servers. +The caveat to using Terminator is that it is not a standard SSH GUI tool, in that it won’t save your sessions or give you quick access to those servers. In other words, you will always have to manually log into your remote Linux servers. However, being able to see your remote Secure Shell sessions side by side does make administering multiple remote machines quite a bit easier. + +Few (But Worthwhile) Options + +There aren’t a lot of SSH GUI tools available for Linux. Why? Because most administrators prefer to simply open a terminal window and use the standard command-line tools to remotely access their servers. However, if you have a need for a GUI tool, you have two solid options and one terminal that makes logging into multiple machines slightly easier. Although there are only a few options for those looking for an SSH GUI tool, those that are available are certainly worth your time. Give one of these a try and see for yourself. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/intro-to-linux/2018/11/three-ssh-guis-linux + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/jlwallen +[b]: https://github.com/lujun9972 +[1]: https://elementary.io/ +[2]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html +[3]: https://www.linux.com/files/images/sshguis1jpg +[4]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_1.jpg?itok=DiNTz_wO (PuTTY Connection) +[5]: https://www.linux.com/licenses/category/used-permission +[6]: https://www.linux.com/files/images/sshguis2jpg +[7]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_2.jpg?itok=4ORsJlz3 (log in) +[8]: https://github.com/muriloventuroso/easyssh +[9]: https://www.linux.com/files/images/sshguis3jpg +[10]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_3.jpg?itok=bHC2zlda (Adding a connection) +[11]: https://www.linux.com/files/images/sshguis4jpg +[12]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_4.jpg?itok=hhJzhRIg (EasySSH) +[13]: https://www.linux.com/files/images/sshguis5jpg +[14]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_5.jpg?itok=piFEFYTQ (Connecting) +[15]: https://www.linux.com/files/images/sshguis6jpg +[16]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ssh_guis_6.jpg?itok=-kYl6iSE (Terminator) From 08cd67688b596344adc8691601af0ebf94cf5c4a Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 27 Nov 2018 19:23:32 +0800 Subject: [PATCH 0493/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20use?= =?UTF-8?q?=20the=20sudo=20command=20to=20deploy=20superuser=20powers=20on?= =?UTF-8?q?=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...and to deploy superuser powers on Linux.md | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 sources/tech/20181126 How to use the sudo command to deploy superuser powers on Linux.md diff --git a/sources/tech/20181126 How to use the sudo command to deploy superuser powers on Linux.md b/sources/tech/20181126 How to use the sudo command to deploy superuser powers on Linux.md new file mode 100644 index 0000000000..322bb8f303 --- /dev/null +++ b/sources/tech/20181126 How to use the sudo command to deploy superuser powers on Linux.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (How to use the sudo command to deploy superuser powers on Linux) +[#]: via: (https://www.networkworld.com/article/3322504/linux/selectively-deploying-your-superpowers-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) +[#]: url: ( ) + +How to use the sudo command to deploy superuser powers on Linux +====== + +![](https://images.idgesg.net/images/article/2018/11/superman-100781085-large.jpg) + +The **sudo** command is very handy when you need to run occasional commands with superuser power, but you can sometimes run into problems when it doesn’t do everything you expect it should. Say you want to add an important message at the end of some log file and you try something like this: + +``` +$ echo "Important note" >> /var/log/somelog +-bash: /var/log/somelog: Permission denied +``` + +OK, it looks like you need to employ some extra privilege. In general, you can't write to a system log file with your user account. Let’s try that again with **sudo**. + +``` +$ sudo !! +sudo echo "Important note" >> /var/log/somelog +-bash: /var/log/somelog: Permission denied +``` + +Hmm, that didn't work either. Let's try something a little different. + +``` +$ sudo 'echo "Important note" >> /var/log/somelog' +sudo: echo "Important note" >> /var/log/somelog: command not found +``` + +**[ Also see:[Invaluable tips and tricks for troubleshooting Linux][1] ]** + +### What's going on here? + +The response to the first of the commands shown above indicates that you lack the required privilege to write to the log file. In the second, you have simply tried to run the previously entered command with root privilege, but that resulted in a **Permission denied** error. In the third, you've tried to rerun the command by putting the entire command in quotes and ran into a **command not found** error. So, what went wrong? + + * First command: You can’t write to that log without root privilege. + * Second command: Your superpowers don't extend to the redirect. + * Third command: Sudo doesn’t recognize everything you’ve put into the quotes as a "command." + + + +And if you had tried to use sudo when you had no sudo access at all, you would have seen an error like this: + +``` +nemo is not in the sudoers file. This incident will be reported. +``` + +### What can you do? + +One fairly simple option is to use the sudo command to briefly become root. Given you have sudo privileges, you might be able to do that with a command like this one: + +``` +$ sudo su +[sudo] password for nemo: +# +``` + +Notice that the prompt has changed to indicate your new authority. Then you can run the original command as root: + +``` +# echo "Important note" >> /var/log/somelog +``` + +And then you can enter **^d** and go back to being yourself. Of course, some sudo configurations might prevent you from using sudo to become root. + +Another option is to switch user to root with just the **su** command, but that requires knowing the root password. Many people will be given access to sudo without being provided with the root password, so this won't always work. + +If you switch user to root, you can then run commands as root to your heart’s content. The problems with this approach are 1) everyone exercising root privilege will have to know the root password (not very secure) and 2) you won't be protected from the repercussions of making big mistakes if you fail to exit your privileged status after you run the specific commands that require root privilege. The sudo command is intended to allow you to use root privilege _only_ when you really need it and to control how much of root’s power each sudo user ought to have. It’s also intended to easily revert to having you working in your normal user state. + +Note also that this entire discussion is predicated on the assumption that you have access to sudo and that your access is not narrowly defined. More on that in a moment. + +Another option is to use a different command. If adding to a file by editing it is an option, you might use a command such as "sudo vi /var/log/somelog", though editing an active log file isn't generally a good idea because of how frequently the system might need to write to it. + +A final but more complex option is to use one of the following commands that get around the problems we saw earlier, but they involve more complex syntax. The first command allows you to repeat your command using !! after getting the "Permission denied" rejection: + +``` +$ sudo echo "Important note" >> /var/log/somelog +-bash: /var/log/somelog: Permission denied +$ !!:gs/>/|sudo tee -a / <===== +$ tail -1 /var/log/somelog +Important note +``` + +The second allows you to add your message by passing your message to **tee** using the sudo command. Note that the **-a** specifies that the text should be appended to the file: + +``` +$ echo "Important note" | sudo tee -a /var/log/somelog +$ tail -1 /var/log/somelog +Important note +``` + +### How controllable is sudo? + +The quick answer to this question is that it depends on the person administering it. Most Linux systems default to a very simple setup. If a user is assigned to a particular group, which might be called **wheel** or **admin** , that user will have the ability to run any command as root without having to know the root password. This is the default setup on most Linux systems. Once a user is added to the privileged group in the **/etc/group** file, that person can run any command with root privilege. On the other hand, sudo can be set up so that some users can only run a single command or any in a set of commands as root and nothing more. + +If lines like those shown below were added to the **/etc/sudoers** file, for example, the user "nemo" would be allowed to run the **whoami** command with root authority. While this might not make any sense in the "real world," it works fairly well as an example. + +``` +# User alias specification +nemo ALL=(root) NOPASSWD: WHOAMI + +# Cmnd alias specification +Cmnd_Alias WHOAMI = /usr/bin/whoami +``` + +Note that we've added both a command alias (Cmnd_Alias) that specifies the command that can be run — with their full paths — and a user alias that allows that user to run that single command with sudo without even entering a password. + +When nemo runs the command **sudo whoami** , he will see this: + +``` +$ sudo whoami +root +``` + +Notice that, since nemo is running the command using sudo, the response to **whoami** shows that when the command is running, the user is **root**. + +For other commands, nemo will see something like this: + +``` +$ sudo date +[sudo] password for nemo: +Sorry, user nemo is not allowed to execute '/bin/date' as root on butterfly. +``` + +### Default sudo setup + +In the default approach, we'd be taking advantage of a line like one of those shown below from the **/etc/sudoers** file: + +``` +$ sudo egrep "admin|sudo" /etc/sudoers +# Members of the admin group may gain root privileges +%admin ALL=(ALL) ALL <===== +# Allow members of group sudo to execute any command +%sudo ALL=(ALL:ALL) ALL <===== +``` + +In these lines, **%admin** and **%sudo** both refer to groups that permit anyone added to one of these groups to run any command as root using the sudo command. + +A line like the one shown below from the /etc/group file makes the individuals listed members of the group, thereby giving them sudo privileges without any changes required in the /etc/sudoers file. + +``` +sudo:x:27:shs,nemo +``` + +### Wrap-up + +The sudo command is meant to allow you to easily deploy superuser access on an as-needed basis, but also to endow users with very limited privileged access when that's all that is required. You can run into problems that require a different approach than a simple "sudo command," and the responses that you get from **sudo** should indicate what problem you've run into. + +Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3322504/linux/selectively-deploying-your-superpowers-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[2]: https://www.facebook.com/NetworkWorld/ +[3]: https://www.linkedin.com/company/network-world From c35cb4d69c0b3ed5caac979f7ccf0b947db5a358 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 27 Nov 2018 19:25:38 +0800 Subject: [PATCH 0494/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20use?= =?UTF-8?q?=20multiple=20programming=20languages=20without=20losing=20your?= =?UTF-8?q?=20mind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ming languages without losing your mind.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/talk/20181126 How to use multiple programming languages without losing your mind.md diff --git a/sources/talk/20181126 How to use multiple programming languages without losing your mind.md b/sources/talk/20181126 How to use multiple programming languages without losing your mind.md new file mode 100644 index 0000000000..008c976f5b --- /dev/null +++ b/sources/talk/20181126 How to use multiple programming languages without losing your mind.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (How to use multiple programming languages without losing your mind) +[#]: via: (https://opensource.com/article/18/11/multiple-programming-languages) +[#]: author: (Bart Copeland https://opensource.com/users/bartcopeland) +[#]: url: ( ) + +How to use multiple programming languages without losing your mind +====== +A polyglot environment is a double-edged sword, bringing benefits along with complexities that may threaten the organization. + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2) + +With all the different programming languages available today, many organizations have become digital polyglots. Open source opens up a world of languages and technology stacks developers can use to accomplish their tasks, including developing and supporting legacy and modern software applications. + +Polyglots can talk with millions more people than those who only speak their native language. In software environments, developers don't introduce new languages to achieve specifc ends, not to communicate better. Some languages are great for one task but not another, so working with multiple programming languages enables developers to use the right tool for the job. In this way, all development is polyglot; it's just the nature of the beast. + +The creation of a polyglot environment is often gradual and situational. For example, when an enterprise acquires a company, it takes on the company's technology stacks—including its programming languages. Or as tech leadership changes, new leaders may bring different technologies into the fold. Technologies also fall in and out of fashion, expanding the number of programming languages and technologies an organization has to maintain over time. + +A polyglot environment is a double-edged sword for enterprises, bringing benefits but also complexities and challenges. Ultimately, if the situation remains unchecked, polyglot will kill your enterprise. + +### Tricky technical tongue-twisters + +Where there are multiple different technologies—programming languages, legacy tools, and up-and-coming technology stacks—there is complexity. Engineering teams spend more time wrestling to retrofit programming languages with licenses, security, and dependencies. At the same time, management lacks oversight on code compliance and can't gauge risk. + +What happens is that enterprises have varying degrees of programming language quality and high variability in tooling support. It's hard to become an expert in one language when you're required to work with a dozen. There's a big difference in skill level between a person who speaks French and Italian fluently and a person who can string a few sentences together in eight languages. The same is true for developers and programming languages. + +The difficulties only increase with the addition of more programming languages, leading to a digital Tower of Babel. + +The answer is not to take away the tools your developers need for the job. Adding new programming languages builds their skill base and empowers them with the right equipment to fulfill their craft. So, you want to say "yes" to your developers, but as more and more programming languages are added to the enterprise, they impose a drag on your software development lifecycle (SDLC). At scale, all these languages and tools can kill the enterprise. + +There are three main issues enterprises should pay attention to: + + 1. **Visibility:** Teams come together for a project, then disband. Applications are released and never updated—why fix what's not broken? As a result, when a critical vulnerability is discovered, the enterprise may not have visibility into which applications are affected, which libraries those applications contain, or even what languages they were built with. This can result in costly "exploration projects" to ensure the vulnerability is properly addressed. + 2. **Updating or coding:** Some enterprises centralize the updating and fixing function in a single team. Others require that each "pizza team" manage its own development tools. In either case, the engineering team and management pay an opportunity cost: rather than coding new features, these teams are constantly updating and fixing libraries in their open source tools since they move so quickly. + 3. **Reinventing the wheel:** Since code dependencies and library versions are constantly being updated, the artifacts associated with the original build of an application may no longer be available when a vulnerability is found. As a result, many development cycles are wasted trying to recreate an environment in which the vulnerability can be fixed. + + + +Multiply each programming language in your organization by these three issues, and what started out as a molehill suddenly looks like Mount Everest. And just like a mountain climber, you won't survive without the proper equipment and tools. + +### Finding your Rosetta Stone + +A comprehensive solution that serves the needs of the enterprise and its individual stakeholders in the SDLC is in order. Enterprises can create this solution using these best practices: + + 1. Monitor code running in production and respond based on risk of flagged components (e.g., common vulnerabilities and exposures components) used in your applications. + 2. Receive regular updates to keep code current and bug-free. + 3. Use commercial open source support to get help with programming language versions and platforms that are near end-of-life and not supported by the community. + 4. Standardize specific programming language builds across your enterprise to enable consistent environments across teams and minimize dependencies. + 5. Set thresholds for when to trigger an update, alarm, or another kind of event based on dependencies. + 6. Create a single source of truth for your package management; this may require the assistance of a knowledgeable technology provider. + 7. Get smaller build distributions with only the packages you need, based on your specific criteria. + + + +Using these best practices, developers can maximize their time to create more value for the enterprise instead of doing basic tooling or build-engineering tasks. This will create code consistency in all environments in the software development life cycle (SDLC). It will also create greater efficiency and cost savings as fewer resources are needed to maintain programming languages and package distributions. This new way of operating will make the lives of both technical staff and management easier. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/multiple-programming-languages + +作者:[Bart Copeland][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bartcopeland +[b]: https://github.com/lujun9972 From 24d1f7b5be2d0732428e3a6dae667f485e5d1e4a Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 27 Nov 2018 19:28:31 +0800 Subject: [PATCH 0495/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20DevOps=20is=20f?= =?UTF-8?q?or=20everyone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20181121 DevOps is for everyone.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/talk/20181121 DevOps is for everyone.md diff --git a/sources/talk/20181121 DevOps is for everyone.md b/sources/talk/20181121 DevOps is for everyone.md new file mode 100644 index 0000000000..075046f615 --- /dev/null +++ b/sources/talk/20181121 DevOps is for everyone.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (DevOps is for everyone) +[#]: via: (https://opensource.com/article/18/11/how-non-engineer-got-devops) +[#]: author: (Dawn Parych https://opensource.com/users/dawnparzych) +[#]: url: ( ) + +DevOps is for everyone +====== + +A non-engineer explains why you don't need to be a developer or an operations person to fall for DevOps. + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1) + +I've never held a job as a developer nor in operations—so what am I doing writing an article about [DevOps][1]? I've always been interested in computers and technology. I also have a passion for people, psychology, and helping others. When I first heard about DevOps, the concept piqued my interest, as it seemed to merge many of the things I was interested in, even if I don't write code. + +My first computer was a TRS-80, and I loved writing BASIC programs on it. I took the only two computer programming classes my high school offered. A few years later, I started a computer company. I made custom mailing labels, stationery, and built a database to store addresses. + +The problem was I didn't enjoy writing code. I wanted to teach and to help people, and I didn't see writing code as an opportunity to do this. Yes, technology can help people and change lives, but writing code didn't spark my passion. I need to feel excited about my work and do something I love. + + * The culture, not the code + * The journey, not the result + * Building an environment where everybody can continuously improve + * Communicating and collaborating, not working independently + + + +I found that I love DevOps. To me, DevOps is about: + +Ultimately, DevOps is about being part of a community working towards the same goal. DevOps merges psychology, people, and technology. DevOps isn't a job title; it is a philosophy for life and work. + +### Finding my people + +Almost four years ago, I attended my first [DevOpsDays][2] conference in Seattle. I felt like I had found my people. I felt welcomed and accepted, even though I work in marketing and don't have a computer science degree. I could geek out over psychology and technology. + +At DevOpsDays, I learned about the ["Three Ways" of DevOps][3]—flow, feedback, and continuous experimentation and learning—and new (to me) concepts such as Kaizen and Kaikaku. As I learned, I found myself saying things like, "I do this! I didn't know there was a name for this!" + +[Kaizen][4] is the practice of continuous improvement and learning. Small, incremental changes over time can yield significant results. I found parallels between this and Carol Dweck's idea of a [growth mindset][5]. People aren't born experts. Becoming skilled at something takes time, practice, and often failure. Recognizing incremental improvement is necessary to make sure we don't give up. + +[Kaikaku][6], on the other hand, is the notion that small changes over time sometimes won't work, and you need to make a radical or disruptive change. Quitting a job without having a new one lined up or moving to a new city can be pretty disruptive—yes, I've done both. But these radical changes can reap great rewards. I might not have learned about DevOps if I hadn't quit my job and taken some time off. Once I decided to return to work, I kept hearing about DevOps and started researching it. This led me to attend my first DevOpsDays, where I began to see all my passions come together. Since then, I have presented at five DevOpsDays and regularly write about DevOps topics. + +### Putting the Three Ways to work + +Change is hard and learning something new can be scary. The Three Ways of DevOps provide a framework for managing change. For example: How is information flowing? What is driving you to make a change? Once you know a change is needed, how do you get feedback about whether the changes you are making are the right changes? How do you know if you're making progress? Feedback is essential and should include both positive and constructive elements. The hard part is making sure the constructive elements don't outweigh the positive. + +For me, the third Way—continuous experimentation and learning—is the most important part of DevOps. Having an environment where people are free to experiment and take risks can lead to unexpected outcomes. Sometimes those outcomes are good, sometimes not so good—and that's OK. Creating an environment where it is acceptable if things don't work out encourages people to take risks. We should all strive to continuously experiment and learn something new on a regular basis. + +The Three Ways of DevOps provides a method of trying something, getting feedback, and learning from our mistakes. A few years ago, my son told me, "I don't ever want to be the best at something, because then I can't learn from my mistakes." We all make mistakes, and learning from them helps us grow and improve. We aren't willing to make mistakes if our culture doesn't support experimentation and learning. + +### Being part of the community + +I've worked in technology for over 20 years and often felt like an outsider until I found the DevOps community. If you're like me—passionate about technology but not the engineering or operations side of things—you can still be a part of DevOps, even if you work in sales, marketing, product marketing, technical writing, support, and more. DevOps is for everyone. + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/how-non-engineer-got-devops + +作者:[Dawn Parych][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/resources/devops +[2]: https://www.devopsdays.org/ +[3]: https://itrevolution.com/the-three-ways-principles-underpinning-devops/ +[4]: https://en.wikipedia.org/wiki/Kaizen +[5]: https://en.wikipedia.org/wiki/Mindset#Fixed_and_growth +[6]: https://en.wikipedia.org/wiki/Kaikaku From 67a72c34d44ab2cc5861e7182bc0f3135d6e0cf5 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 27 Nov 2018 19:40:17 +0800 Subject: [PATCH 0496/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Arch-Wiki-Man?= =?UTF-8?q?=20=E2=80=93=20A=20Tool=20to=20Browse=20The=20Arch=20Wiki=20Pag?= =?UTF-8?q?es=20As=20Linux=20Man=20Page=20from=20Offline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ki Pages As Linux Man Page from Offline.md | 214 ++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md diff --git a/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md b/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md new file mode 100644 index 0000000000..9e1ee18be7 --- /dev/null +++ b/sources/tech/20181119 Arch-Wiki-Man - A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline.md @@ -0,0 +1,214 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline) +[#]: via: (https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/) +[#]: author: ([Prakash Subramanian](https://www.2daygeek.com/author/prakash/)) +[#]: url: ( ) + +Arch-Wiki-Man – A Tool to Browse The Arch Wiki Pages As Linux Man Page from Offline +====== + +Getting internet is not a big deal now a days, however there will be a limitation on technology. + +I was really surprise to see the technology growth but in the same time there will be fall in everywhere. + +Whenever you search anything about other Linux distributions most of the time you will get a third party links in the first place but for Arch Linux every time you would get the Arch Wiki page for your results. + +As Arch Wiki has most of the solution other than third party websites. + +As of now, you might used web browser to get a solution for your Arch Linux system but you no need to do the same for now. + +There is a solution is available in command line to perform this action much faster way and the utility called arch-wiki-man. If you are Arch Linux lover, i would suggest you to read **[Arch Linux Post Installation guide][1]** which helps you to tweak your system for day to day use. + +### What is arch-wiki-man? + +[arch-wiki-man][2] tool allows user to search the arch wiki pages right from the command line (CLI) instantly without internet connection. It allows user to access and search an entire wiki pages as a Linux man page. + +Also, you no need to switch to GUI. Updates are pushed automatically every two days so, your local copy of the Arch Wiki pages will be upto date. The tool name is `awman`. awman stands for Arch Wiki Man. + +We had already wrote similar kind of topic called **[Arch Wiki Command Line Utility][3]** (arch-wiki-cli) which allows user search Arch Wiki from command line but make sure you should have internet to use this utility. + +### How to Install arch-wiki-man tool? + +arch-wiki-man utility is available in AUR repository so, we need to use AUR helper to install it. There are many AUR helper is available and we had wrote an article about **[Yaourt AUR helper][4]** and **[Packer AUR helper][5]** which are very famous AUR helper. + +``` +$ yaourt -S arch-wiki-man + +or + +$ packer -S arch-wiki-man +``` + +Alternatively we can install it using npm package manager. Make sure, you should have installed **[NodeJS][6]** on your system. If so, run the following command to install it. + +``` +$ npm install -g arch-wiki-man +``` + +### How to Update the local Arch Wiki copy? + +As updated previously, updates are pushed automatically every two days and it can be done by running the following command. + +``` +$ sudo awman-update +[sudo] password for daygeek: +[email protected] /usr/lib/node_modules/arch-wiki-man +└── [email protected] + +arch-wiki-md-repo has been successfully updated or reinstalled. +``` + +awman-update is faster and more convenient method to get the update. However, you can get the updates by reinstalling this package using the following command. + +``` +$ yaourt -S arch-wiki-man + +or + +$ packer -S arch-wiki-man +``` + +### How to Use Arch Wiki from command line? + +It’s very simple interface and easy to use. To search anything, just run `awman` followed by the search term. The general syntax is as follow. + +``` +$ awman Search-Term +``` + +### How to Search Multiple Matches? + +If you would like to list all the results titles comes with `installation` string, run the following command format. If the output comes with multiple results then you will get a selection menu to navigate each item. + +``` +$ awman installation +``` + +![][8] + +Detailed page screenshot. +![][9] + +### Search a given string in Titles & Descriptions + +The `-d` or `--desc-search` option allow users to search a given string in titles and descriptions. + +``` +$ awman -d mirrors + +or + +$ awman --desc-search mirrors +? Select an article: (Use arrow keys) +❯ [1/3] Mirrors: Related articles + [2/3] DeveloperWiki-NewMirrors: Contents + [3/3] Powerpill: Powerpill is a pac +``` + +### Search a given string in Contents + +The `-k` or `--apropos` option allow users to search a given string in content as well. Make a note, this option significantly slower your search as this scan entire wiki page content. + +``` +$ awman -k openjdk + +or + +$ awman --apropos openjdk +? Select an article: (Use arrow keys) +❯ [1/26] Hadoop: Related articles + [2/26] XDG Base Directory support: Related articles + [3/26] Steam-Game-specific troubleshooting: See Steam/Troubleshooting first. + [4/26] Android: Related articles + [5/26] Elasticsearch: Elasticsearch is a search engine based on Lucene. It provides a distributed, mul.. + [6/26] LibreOffice: Related articles + [7/26] Browser plugins: Related articles +(Move up and down to reveal more choices) +``` + +### Open the search results in a web browser + +The `-w` or `--web` option allow users to open the search results in a web browser. + +``` +$ awman -w AUR helper + +or + +$ awman --web AUR helper +``` + +![][10] + +### Search in other languages + +The `-w` or `--web` option allow users to open the search results in a web browser. To see a list of supported language, run the following command. + +``` +$ awman --list-languages +arabic +bulgarian +catalan +chinesesim +chinesetrad +croatian +czech +danish +dutch +english +esperanto +finnish +greek +hebrew +hungarian +indonesian +italian +korean +lithuanian +norwegian +polish +portuguese +russian +serbian +slovak +spanish +swedish +thai +ukrainian +``` + +Run the awman command with your preferred language to see the results with different language other than English. + +``` +$ awman -l chinesesim deepin +``` + +![][11] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/arch-wiki-man-a-tool-to-browse-the-arch-wiki-pages-as-linux-man-page-from-offline/ + +作者:[Prakash Subramanian][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/prakash/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/arch-linux-post-installation-30-things-to-do-after-installing-arch-linux/ +[2]: https://github.com/greg-js/arch-wiki-man +[3]: https://www.2daygeek.com/search-arch-wiki-website-command-line-terminal/ +[4]: https://www.2daygeek.com/install-yaourt-aur-helper-on-arch-linux/ +[5]: https://www.2daygeek.com/install-packer-aur-helper-on-arch-linux/ +[6]: https://www.2daygeek.com/install-nodejs-on-ubuntu-centos-debian-fedora-mint-rhel-opensuse/ +[7]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[8]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-1.png +[9]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-2.png +[10]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-3.png +[11]: https://www.2daygeek.com/wp-content/uploads/2018/11/arch-wiki-man-%E2%80%93-A-Tool-to-Browse-The-Arch-Wiki-Pages-As-Linux-Man-page-from-Offline-4.png From e6d9118e05a4b6b753ba6a52ee72f05d98bbfa25 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Nov 2018 22:45:41 +0800 Subject: [PATCH 0497/1143] PRF:20181113 The alias And unalias Commands Explained With Examples.md @dianbanjiu --- ...nalias Commands Explained With Examples.md | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/translated/tech/20181113 The alias And unalias Commands Explained With Examples.md b/translated/tech/20181113 The alias And unalias Commands Explained With Examples.md index da859b2d29..1448918a1e 100644 --- a/translated/tech/20181113 The alias And unalias Commands Explained With Examples.md +++ b/translated/tech/20181113 The alias And unalias Commands Explained With Examples.md @@ -1,22 +1,23 @@ 举例说明 alias 和 unalias 命令 ====== + ![](https://www.ostechnix.com/wp-content/uploads/2018/11/alias-command-720x340.png) -如果不是一个深度的命令行用户的话,你可能已经忘记了这些复杂且冗长的 Linux 命令了。当然,有很多方法可以让你 [**回想起遗忘的命令**][1]。你可以简单的 [**保存常用的命令**][2] 然后按需使用。也可以在终端里 [**标记重要的命令**][3],然后在任何时候你想要的时间使用它们。而且,Linux 有一个内建命令 **history** 可以帮助你记忆这些命令。另外一个最简便的方式就是为这些命令创建一个别名。你可以为任何经常重复调用的常用命令创建别名,而不仅仅是长命令。通过这种方法,你不必再过多地记忆这些命令。这篇文章中,我们将会在 Linux 环境下举例说明 **alias** 和 **unalias** 命令。 +如果不是一个命令行重度用户的话,过了一段时间之后,你就可能已经忘记了这些复杂且冗长的 Linux 命令了。当然,有很多方法可以让你 [回想起遗忘的命令][1]。你可以简单的 [保存常用的命令][2] 然后按需使用。也可以在终端里 [标记重要的命令][3],然后在任何时候你想要的时间使用它们。而且,Linux 有一个内建命令 `history` 可以帮助你记忆这些命令。另外一个记住这些如此长的命令的简便方式就是为这些命令创建一个别名。你可以为任何经常重复调用的常用命令创建别名,而不仅仅是长命令。通过这种方法,你不必再过多地记忆这些命令。这篇文章中,我们将会在 Linux 环境下举例说明 `alias` 和 `unalias` 命令。 ### alias 命令 -**alias** 使用一个用户自定义的字符串来代替一个或者一串命令(包括多个选项,参数)。这个字符串可以是一个简单的名字或者缩写,不管这个命令原来多么复杂。alias 命令已经预装在 shell(包括 BASH,Csh,Ksh 和 Zsh 等) 当中。 +`alias` 使用一个用户自定义的字符串来代替一个或者一串命令(包括多个选项、参数)。这个字符串可以是一个简单的名字或者缩写,不管这个命令原来多么复杂。`alias` 命令已经预装在 shell(包括 BASH、Csh、Ksh 和 Zsh 等) 当中。 - -alias 的通用语法是: +`alias` 的通用语法是: ``` alias [alias-name[=string]...] ``` + 接下来看几个例子。 -**列出别名** +#### 列出别名 可能在你的系统中已经设置了一些别名。有些应用在你安装它们的时候可能已经自动创建了别名。要查看已经存在的别名,运行: @@ -40,7 +41,7 @@ alias pbpaste='xclip -selection clipboard -o' alias update='newsbeuter -r && sudo pacman -Syu' ``` -**创建一个新的别名** +#### 创建一个新的别名 像我之前说的,你不必去记忆这些又臭又长的命令。你甚至不必一遍一遍的运行长命令。只需要为这些命令创建一个简单易懂的别名,然后在任何你想使用的时候运行这些别名就可以了。这种方式会让你爱上命令行。 @@ -54,21 +55,22 @@ $ du -h --max-depth=1 | sort -hr $ alias du='du -h --max-depth=1 | sort -hr' ``` -这里的 **du** 就是这条命令的别名。这个别名可以被设置为任何名字,主要便于记忆和区别。 +这里的 `du` 就是这条命令的别名。这个别名可以被设置为任何名字,主要便于记忆和区别。 在创建一个别名的时候,使用单引号或者双引号都是可以的。这两种方法最后的结果没有任何区别。 -现在你可以运行这个别名(例如我们这个例子中的 **du** )。它和上面的原命令将会产生相同的结果。 +现在你可以运行这个别名(例如我们这个例子中的 `du` )。它和上面的原命令将会产生相同的结果。 这个别名仅限于当前 shell 会话中。一旦你退出了当前 shell 会话,别名也就失效了。为了让这些别名长久有效,你需要把它们添加到你 shell 的配置文件当中。 -BASH,编辑 **~/.bashrc** 文件: +BASH,编辑 `~/.bashrc` 文件: ``` $ nano ~/.bashrc ``` 一行添加一个别名: + ![](https://www.ostechnix.com/wp-content/uploads/2018/11/alias.png) 保存并退出这个文件。然后运行以下命令更新修改: @@ -79,21 +81,20 @@ $ source ~/.bashrc 现在,这些别名在所有会话中都可以永久使用了。 -ZSH,你需要添加这些别名到 **~/.zshrc**文件中。 -Fish,跟上面的类似,添加这些别名到 **~/.config/fish/config.fish** 文件中。 +ZSH,你需要添加这些别名到 `~/.zshrc`文件中。Fish,跟上面的类似,添加这些别名到 `~/.config/fish/config.fish` 文件中。 -**查看某个特定的命令别名** +#### 查看某个特定的命令别名 -像我上面提到的,你可以使用 ‘alias’ 命令列出你系统中所有的别名。如果你想查看跟给定的别名有关的命令,例如 ‘du’,只需要运行: +像我上面提到的,你可以使用 `alias` 命令列出你系统中所有的别名。如果你想查看跟给定的别名有关的命令,例如 `du`,只需要运行: ``` $ alias du alias du='du -h --max-depth=1 | sort -hr' ``` -像你看到的那样,上面的命令可以显示与单词 ‘du’ 有关的命令。 +像你看到的那样,上面的命令可以显示与单词 `du` 有关的命令。 -关于 别名 命令更多的细节,参阅 man 手册页: +关于 `alias` 命令更多的细节,参阅 man 手册页: ``` $ man alias @@ -101,23 +102,23 @@ $ man alias ### unalias 命令 -跟它的名字说的一样,**unalias** 命令可以很轻松地从你的系统当中移除别名。unalias 命令的通用语法是: +跟它的名字说的一样,`unalias` 命令可以很轻松地从你的系统当中移除别名。`unalias` 命令的通用语法是: ``` unalias ``` -要移除命令的别名,像我们之前创建的 ‘du’,只需要运行: +要移除命令的别名,像我们之前创建的 `du`,只需要运行: ``` $ unalias du ``` -unalias 命令不仅会从当前会话中移除别名,也会从你的 shell 配置文件中永久地移除别名。 +`unalias` 命令不仅会从当前会话中移除别名,也会从你的 shell 配置文件中永久地移除别名。 还有一种移除别名的方法,是创建具有相同名称的新别名。 -要从当前会话中移除所有的别名,使用 **-a** 选项: +要从当前会话中移除所有的别名,使用 `-a` 选项: ``` $ unalias -a @@ -144,7 +145,7 @@ via: https://www.ostechnix.com/the-alias-and-unalias-commands-explained-with-exa 作者:[SK][a] 选题:[lujun9972][b] 译者:[dianbanjiu](https://github.com/dianbanjiu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 10ab66e2adff826bc03bdb8544783c1021f3cd70 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Nov 2018 22:46:03 +0800 Subject: [PATCH 0498/1143] PUB:20181113 The alias And unalias Commands Explained With Examples.md @dianbanjiu https://linux.cn/article-10283-1.html --- ...1113 The alias And unalias Commands Explained With Examples.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181113 The alias And unalias Commands Explained With Examples.md (100%) diff --git a/translated/tech/20181113 The alias And unalias Commands Explained With Examples.md b/published/20181113 The alias And unalias Commands Explained With Examples.md similarity index 100% rename from translated/tech/20181113 The alias And unalias Commands Explained With Examples.md rename to published/20181113 The alias And unalias Commands Explained With Examples.md From 812d2b6d138263beb91683983bd1b1fe82bb40d5 Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Tue, 27 Nov 2018 23:05:53 +0800 Subject: [PATCH 0499/1143] Translating 7 command-line tools for writers. --- ...line tools for writers - Opensource.com.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 translated/tech/20181119 7 command-line tools for writers - Opensource.com.md diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md new file mode 100644 index 0000000000..4d2edb8472 --- /dev/null +++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md @@ -0,0 +1,73 @@ +给写作者们的 7 个命令行工具 | Opensource.com +====== +扔掉你的打字机,然后使用这些开源工具在命令行上编辑吧。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE) + +对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文本编辑器上编辑文本。但是还有很多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。 + +在使用图形界面写作的世界同样有命令行工具的一席之地。这些命令行工具可以帮助他们进行写作,检查他们的拼写等等——无论是在写一篇文章、博客或者故事;写一个 README 文件;或者准备一份技术文档的时候。 + +下面是一些在任何写作情况下都有用的命令行工具。 + +### 编辑器 + +Yes, you _can_ do actual writing at the command line. I know writers who do their work using editors like [Nano][2], [Vim][3], [Emacs][4], and [Jove][5] in a terminal window. And those editors [aren't the only games in town][6]. Text editors are great because they (at a basic level, anyway) are easy to use and distraction free. They're perfect for tapping out a first draft of anything or even completing a long and complicated writing project. + +If you want a more word processor-like experience at the command line, take a look at [WordGrinder][7] . WordGrinder is a bare-bones word processor, but it has more than enough features for writing and publishing your work. It supports basic formatting and styles, and you can export your writing to formats like Markdown, ODT, LaTeX, and HTML. + +### 拼写检查 + +Every writer does (or at least should do) a spelling check on their work at least once. Why? An immutable law of the writing universe states that, no matter how many times you look over your manuscript, a spelling mistake or typo will creep in. + +My favorite command-line spelling checker is [GNU Aspell][8], which I previously [looked at][9] in detail. Aspell checks plaintext documents interactively and not only highlights errors but often puts the best correction at the top of its list of suggestions. Aspell also ignores many markup languages while doing its thing. + +A much older but still useful alternative is [Ispell][10]. It's a bit slower than Aspell, but both utilities work the same way. As you interact with your text file, Ispell suggests corrections. Ispell also has good support for foreign languages. + +### Prose linters + +Software developers use [linters][11] to check their code for errors or bugs. There are also linters for prose that check for style and syntax errors; think of them as the _Elements of Style_ for the command line. While any writer can (and probably should) use one, a prose linter is especially useful for team documentation projects that require a consistent voice and style. + +[Proselint][12] is a comprehensive tool for checking what you're writing. It looks for jargon, hyperbole, incorrect date and time format, misused terms, and [much more][13]. It's also easy to run and ignores markup in a plaintext file. + +[Alex][14] is a simple yet powerful prose linter. Run it against a plaintext document or one formatted with Markdown or HTML. Alex pumps out warnings of "gender favouring, polarising, race related, religion inconsiderate, or other unequal phrasing in text." If you want to give Alex a test drive, there's an [online demo][15]. + +### 其他工具 + +Sometimes you just can't find the right synonym for a word. But you don't need to grab a "dead tree" thesaurus or go to a dedicated website to perfect your word choice. Just run [Aiksaurus][16] against the word you want to replace, and it does the work for you. This utility's main drawback, though, is that it supports English only. + +Even writers with few (if any) technical skills are embracing [Markdown][17] to quickly and easily format their work. Sometimes, though, you need to convert files formatted with Markdown to something else. That's where [Pandoc][18] comes in. You can use it to convert your documents to HTML, Word, LibreOffice Writer, LaTeX, EPUB, and other formats. You can even use Pandoc to produce books and [research papers][19]. + +Do you have a favorite command-line tool for writing? Share it with the Opensource.com community by leaving a comment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/command-line-tools-writers + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[LazyWolfLin](https://github.com/LazyWolfLin) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://plaintextproject.online +[2]: https://www.nano-editor.org/ +[3]: https://www.vim.org +[4]: https://www.gnu.org/software/emacs/ +[5]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim +[6]: https://en.wikipedia.org/wiki/List_of_text_editors#Text_user_interface +[7]: https://cowlark.com/wordgrinder/ +[8]: http://aspell.net/ +[9]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell +[10]: https://www.cs.hmc.edu/~geoff/ispell.html +[11]: https://en.wikipedia.org/wiki/Lint_(software) +[12]: http://proselint.com/ +[13]: http://proselint.com/checks/ +[14]: https://github.com/get-alex/alex +[15]: https://alexjs.com/#demo +[16]: http://aiksaurus.sourceforge.net/ +[17]: https://en.wikipedia.org/wiki/Markdown +[18]: https://pandoc.org +[19]: https://opensource.com/article/18/9/pandoc-research-paper From 3f6eb3032309cffc82bfe1fb64605d5cb5955d97 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Nov 2018 23:47:49 +0800 Subject: [PATCH 0500/1143] PRF:20180417 How To Browse Stack Overflow From Terminal.md @geekpi --- ... To Browse Stack Overflow From Terminal.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/translated/tech/20180417 How To Browse Stack Overflow From Terminal.md b/translated/tech/20180417 How To Browse Stack Overflow From Terminal.md index 54cc6ab815..220045aaa0 100644 --- a/translated/tech/20180417 How To Browse Stack Overflow From Terminal.md +++ b/translated/tech/20180417 How To Browse Stack Overflow From Terminal.md @@ -2,31 +2,33 @@ ====== ![](https://www.ostechnix.com/wp-content/uploads/2018/04/how2-720x340.png) -前段时间,我们写了一篇关于 [**SoCLI**][1] 的文章,它是一个从命令行搜索和浏览 Stack Overflow 网站的 python 脚本。今天,我们将讨论一个名为 **“how2”** 的类似工具。它是一个命令行程序,可以从终端浏览 Stack Overflow。你可以如你在 [Google 搜索][2]中那样直接用英语查询,然后它会使用 Google 和 Stackoverflow API 来搜索给定的查询。它是使用 NodeJS 编写的免费开源程序。 + +前段时间,我们写了一篇关于 [SoCLI][1] 的文章,它是一个从命令行搜索和浏览 Stack Overflow 网站的 python 脚本。今天,我们将讨论一个名为 “how2” 的类似工具。它是一个命令行程序,可以从终端浏览 Stack Overflow。你可以如你在 [Google 搜索][2]中那样直接用英语查询,然后它会使用 Google 和 Stackoverflow API 来搜索给定的查询。它是使用 NodeJS 编写的自由开源程序。 ### 使用 how2 从终端浏览 Stack Overflow -由于 how2 是一个 NodeJS 包,我们可以使用 Npm 包管理器安装它。如果你尚未安装 Npm 和 NodeJS,请参考以下指南。 +由于 `how2` 是一个 NodeJS 包,我们可以使用 Npm 包管理器安装它。如果你尚未安装 Npm 和 NodeJS,请参考以下指南。 在安装 Npm 和 NodeJS 后,运行以下命令安装 how2。 + ``` $ npm install -g how2 - ``` -现在让我们看下如何使用这个程序浏览 Stack Overflow。使用 “how2” 搜索 Stack Overflow 站点的典型用法是: +现在让我们看下如何使用这个程序浏览 Stack Overflow。使用 `how2` 搜索 Stack Overflow 站点的典型用法是: + ``` $ how2 - ``` 例如,我将搜索如何创建 tgz 存档。 + ``` $ how2 create archive tgz - ``` 哎呀!我收到以下错误。 + ``` /home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/transport.js:59 Transport.prototype.__proto__ = EventEmitter.prototype; @@ -46,85 +48,83 @@ Transport.prototype.__proto__ = EventEmitter.prototype; ``` -我可能遇到了一个 bug。我希望它在未来版本中得到修复。但是,我在[**这里**][3]找到了一个临时方法。 +我可能遇到了一个 bug。我希望它在未来版本中得到修复。但是,我在[这里][3]找到了一个临时方法。 -要临时修复此错误,你需要使用以下命令编辑 **transport.js**: +要临时修复此错误,你需要使用以下命令编辑 `transport.js`: + ``` $ vi /home/sk/.nvm/versions/node/v9.11.1/lib/node_modules/how2/node_modules/devnull/transports/transport.js - ``` 此文件的实际路径将显示在错误输出中。用你自己的文件路径替换上述文件路径。然后找到以下行: + ``` var EventEmitter = process.EventEmitter; - ``` 并用以下行替换它: + ``` var EventEmitter = require('events'); - ``` -按 ESC 并输入 **:wq** 以保存并退出文件。 +按 `ESC` 并输入 `:wq` 以保存并退出文件。 现在再次搜索查询。 + ``` $ how2 create archive tgz - ``` 这是我的 Ubuntu 系统的示例输出。 -[![][4]][5] +![][5] 如果你要查找的答案未显示在上面的输出中,请按**空格键**键开始交互式搜索,你可以通过它查看 Stack Overflow 站点中的所有建议问题和答案。 -[![][4]][6] +![][6] 使用向上/向下箭头在结果之间移动。得到正确的答案/问题后,点击空格键或回车键在终端中打开它。 -[![][4]][7] +![][7] -要返回并退出,请按 **ESC**。 +要返回并退出,请按 `ESC`。 **搜索特定语言的答案** 如果你没有指定语言,它**默认为 Bash** unix 命令行,并立即为你提供最可能的答案。你还可以将结果缩小到特定语言,例如 perl、python、c、Java 等。 -例如,使用 **-l** 标志仅搜索与 “Python” 语言相关的查询,如下所示。 +例如,使用 `-l` 标志仅搜索与 “Python” 语言相关的查询,如下所示。 + ``` $ how2 -l python linked list - ``` [![][4]][8] 要获得快速帮助,请输入: + ``` $ how2 -h - ``` ### 总结 -how2 是一个基本的命令行程序,它可以快速搜索 Stack Overflow 中的问题和答案,而无需离开终端,并且它可以很好地完成这项工作。但是,它只是 Stack overflow 的 CLI 浏览器。对于一些高级功能,例如搜索投票最多的问题,使用多个标签搜索查询,彩色界面,提交新问题和查看问题统计信息等,**SoCLI** 做得更好。 +`how2` 是一个基本的命令行程序,它可以快速搜索 Stack Overflow 中的问题和答案,而无需离开终端,并且它可以很好地完成这项工作。但是,它只是 Stack overflow 的 CLI 浏览器。对于一些高级功能,例如搜索投票最多的问题,使用多个标签搜索查询,彩色界面,提交新问题和查看问题统计信息等,**SoCLI** 做得更好。 -就是这些了。希望这篇文章有用。我将很快写一篇新的指南。在此之前,请继续关注 OSTechNix! +就是这些了。希望这篇文章有用。我将很快写一篇新的指南。在此之前,请继续关注! 干杯! - - -------------------------------------------------------------------------------- via: https://www.ostechnix.com/how-to-browse-stack-overflow-from-terminal/ 作者:[SK][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) 选题:[lujun9972](https://github.com/lujun9972) +译者:[geekpi](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 92eabc82edfc34cc172aa4f9b7b4b02ffb26dfeb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Nov 2018 23:48:31 +0800 Subject: [PATCH 0501/1143] PUB:20180417 How To Browse Stack Overflow From Terminal.md @geekpi https://linux.cn/article-10284-1.html --- .../20180417 How To Browse Stack Overflow From Terminal.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180417 How To Browse Stack Overflow From Terminal.md (100%) diff --git a/translated/tech/20180417 How To Browse Stack Overflow From Terminal.md b/published/20180417 How To Browse Stack Overflow From Terminal.md similarity index 100% rename from translated/tech/20180417 How To Browse Stack Overflow From Terminal.md rename to published/20180417 How To Browse Stack Overflow From Terminal.md From 1069f1583177821b6e265713744368a0a485a556 Mon Sep 17 00:00:00 2001 From: zs19940317 <798345852zs@gmail.com> Date: Wed, 28 Nov 2018 08:01:23 +0800 Subject: [PATCH 0502/1143] Update 20171007 The Most Important Database You-ve Never Heard of.md --- ...0171007 The Most Important Database You-ve Never Heard of.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20171007 The Most Important Database You-ve Never Heard of.md b/sources/talk/20171007 The Most Important Database You-ve Never Heard of.md index f429aba373..cebfa1a959 100644 --- a/sources/talk/20171007 The Most Important Database You-ve Never Heard of.md +++ b/sources/talk/20171007 The Most Important Database You-ve Never Heard of.md @@ -1,3 +1,5 @@ +zs19940317翻译中 + The Most Important Database You've Never Heard of ====== In 1962, JFK challenged Americans to send a man to the moon by the end of the decade, inspiring a heroic engineering effort that culminated in Neil Armstrong’s first steps on the lunar surface. Many of the fruits of this engineering effort were highly visible and sexy—there were new spacecraft, new spacesuits, and moon buggies. But the Apollo Program was so staggeringly complex that new technologies had to be invented even to do the mundane things. One of these technologies was IBM’s Information Management System (IMS). From 8226963b8378e7eb56b96fc9061394bc3125deea Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 28 Nov 2018 08:53:53 +0800 Subject: [PATCH 0503/1143] translated --- ...Great Clipboard Manager For Gnome Shell.md | 98 ------------------- ...Great Clipboard Manager For Gnome Shell.md | 97 ++++++++++++++++++ 2 files changed, 97 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md create mode 100644 translated/tech/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md diff --git a/sources/tech/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md b/sources/tech/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md deleted file mode 100644 index be86776740..0000000000 --- a/sources/tech/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md +++ /dev/null @@ -1,98 +0,0 @@ -translating---geekpi - -GPaste Is A Great Clipboard Manager For Gnome Shell -====== -**[GPaste][1] is a clipboard management system that consists of a library, daemon, and interfaces for the command line and Gnome (using a native Gnome Shell extension).** - -A clipboard manager allows keeping track of what you're copying and pasting, providing access to previously copied items. GPaste, with its native Gnome Shell extension, makes the perfect addition for those looking for a Gnome clipboard manager. - -[![GPaste Gnome Shell extension Ubuntu 18.04][2]][3] -GPaste Gnome Shell extension -**Using GPaste in Gnome, you get a configurable, searchable clipboard history, available with a click on the top panel. GPaste remembers not only the text you copy, but also file paths and images** (the latter needs to be enabled from its settings as it's disabled by default). - -What's more, GPaste can detect growing lines, meaning it can detect when a new text copy is an extension of another and replaces it if it's true, useful for keeping your clipboard clean. - -From the extension menu you can pause GPaste from tracking the clipboard, and remove items from the clipboard history or the whole history. You'll also find a button that launches the GPaste user interface window. - -**If you prefer to use the keyboard, you can use a key shortcut to open the GPaste history from the top bar** (`Ctrl + Alt + H`), **or open the full GPaste GUI** (`Ctrl + Alt + G`). - -The tool also incorporates keyboard shortcuts to (can be changed): - - * delete the active item from history: `Ctrl + Alt + V` - - * **mark the active item as being a password (which obfuscates the clipboard entry in GPaste):** `Ctrl + Alt + S` - - * sync the clipboard to the primary selection: `Ctrl + Alt + O` - - * sync the primary selection to the clipboard: `Ctrl + Alt + P` - - * upload the active item to a pastebin service: `Ctrl + Alt + U` - -[![][4]][5] -GPaste GUI - -The GPaste interface window provides access to the clipboard history (with options to clear, edit or upload items), which can be searched, an option to pause GPaste from tracking the clipboard, restart the GPaste daemon, backup current clipboard history, as well as to its settings. - -[![][6]][7] -GPaste GUI - -From the GPaste UI you can change settings like: - - * Enable or disable the Gnome Shell extension - * Sync the daemon state with the extension's one - * Primary selection affects history - * Synchronize clipboard with primary selection - * Image support - * Trim items - * Detect growing lines - * Save history - * History settings like max history size, memory usage, max text item length, and more - * Keyboard shortcuts - - - -### Download GPaste - -[Download GPaste](https://github.com/Keruspe/GPaste) - -The Gpaste project page does not link to any GPaste binaries, and only source installation instructions. Users running Linux distributions other than Debian or Ubuntu (for which you'll find GPaste installation instructions below) can search their distro repositories for GPaste. - -Do not confuse GPaste with the GPaste Integration extension posted on the Gnome Shell extension website. That is a Gnome Shell extension that uses GPaste daemon, which is no longer maintained. The native Gnome Shell extension built into GPaste is still maintained. - -#### Install GPaste in Ubuntu (18.04, 16.04) or Debian (Jessie and newer) - -**For Debian, GPaste is available for Jessie and newer, while for Ubuntu, GPaste is in the repositories for 16.04 and newer (so it's available in the Ubuntu 18.04 Bionic Beaver).** - -**You can install GPaste (the daemon and the Gnome Shell extension) in Debian or Ubuntu using this command:** -``` -sudo apt install gnome-shell-extensions-gpaste gpaste - -``` - -After the installation completes, restart Gnome Shell by pressing `Alt + F2` and typing `r` , then pressing the `Enter` key. The GPaste Gnome Shell extension should now be enabled and its icon should show up on the top Gnome Shell panel. If it's not, use Gnome Tweaks (Gnome Tweak Tool) to enable the extension. - -**The GPaste 3.28.0 package from[Debian][8] and [Ubuntu][9] has a bug that makes it crash if the image support option is enabled, so do not enable this feature for now.** This was marked as - - --------------------------------------------------------------------------------- - -via: https://www.linuxuprising.com/2018/08/gpaste-is-great-clipboard-manager-for.html - -作者:[Logix][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/118280394805678839070 -[1]:https://github.com/Keruspe/GPaste -[2]:https://2.bp.blogspot.com/-2ndArDBcrwY/W2gyhMc1kEI/AAAAAAAABS0/ZAe_onuGCacMblF733QGBX3XqyZd--WuACLcBGAs/s400/gpaste-gnome-shell-extension-ubuntu1804.png (Gpaste Gnome Shell) -[3]:https://2.bp.blogspot.com/-2ndArDBcrwY/W2gyhMc1kEI/AAAAAAAABS0/ZAe_onuGCacMblF733QGBX3XqyZd--WuACLcBGAs/s1600/gpaste-gnome-shell-extension-ubuntu1804.png -[4]:https://2.bp.blogspot.com/-7FBRsZJvYek/W2gyvzmeRxI/AAAAAAAABS4/LhokMFSn8_kZndrNB-BTP4W3e9IUuz9BgCLcBGAs/s640/gpaste-gui_1.png -[5]:https://2.bp.blogspot.com/-7FBRsZJvYek/W2gyvzmeRxI/AAAAAAAABS4/LhokMFSn8_kZndrNB-BTP4W3e9IUuz9BgCLcBGAs/s1600/gpaste-gui_1.png -[6]:https://4.bp.blogspot.com/-047ShYc6RrQ/W2gyz5FCf_I/AAAAAAAABTA/-o6jaWzwNpsSjG0QRwRJ5Xurq_A6dQ0sQCLcBGAs/s640/gpaste-gui_2.png -[7]:https://4.bp.blogspot.com/-047ShYc6RrQ/W2gyz5FCf_I/AAAAAAAABTA/-o6jaWzwNpsSjG0QRwRJ5Xurq_A6dQ0sQCLcBGAs/s1600/gpaste-gui_2.png -[8]:https://packages.debian.org/buster/gpaste -[9]:https://launchpad.net/ubuntu/+source/gpaste -[10]:https://www.imagination-land.org/posts/2018-04-13-gpaste-3.28.2-released.html diff --git a/translated/tech/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md b/translated/tech/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md new file mode 100644 index 0000000000..d8891edc7b --- /dev/null +++ b/translated/tech/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md @@ -0,0 +1,97 @@ +GPaste 是 Gnome Shell 中优秀的剪贴板管理器 +====== +**[GPaste][1] 是一个剪贴板管理系统,它包含了库、守护程序以及命令行和 Gnome 的接口(使用原生 Gnome Shell 扩展)。** + +剪贴板管理器能够跟踪你正在复制和粘贴的内容,从而能够访问以前复制的项目。GPaste 带有原生的 Gnome Shell 扩展,是那些寻找 Gnome 剪贴板管理器的人的完美补充。 + +[![GPaste Gnome Shell extension Ubuntu 18.04][2]][3] +GPaste Gnome Shell扩展 + +**在 Gnome 中使用 GPaste,你只需单击顶部面板即可得到可配置的、可搜索的剪贴板历史记录。GPaste 不仅会记住你复制的文本,还能记住文件路径和图像**(后者需要在设置中启用,因为默认情况下它被禁用)。 + +不仅如此,GPaste 还可以检测到增长的行,这意味着当检测到新文本是另一个文本的扩展时,它会替换它,这对于保持剪贴板整洁非常有用。 + +在扩展菜单中,你可以暂停 GPaste 跟踪剪贴板,并从剪贴板历史记录或整个历史记录中删除项目。你还会发现一个启动 GPaste 用户界面窗口的按钮。 + +**如果你更喜欢使用键盘,你可以使用快捷键从顶栏开启 GPaste 历史记录** (`Ctrl + Alt + H`) **或打开全部的 GPaste GUI**(`Ctrl + Alt + G`)。 + +该工具还包含这些键盘快捷键(可以更改): + + * 从历史记录中删除活动项目: `Ctrl + Alt + V` + + * **将活动项目显示为密码(在 GPaste 中混淆剪贴板条目):** `Ctrl + Alt + S` + + * 将剪贴板同步到主选择: `Ctrl + Alt + O` + + * 将主选择同步到剪贴板:`Ctrl + Alt + P` + + * 将活动项目上传到 pastebin 服务:`Ctrl + Alt + U` + +[![][4]][5] +GPaste GUI + +GPaste 窗口界面提供可供搜索的剪贴板历史记录(包括清除、编辑或上传项目的选项)、暂停 GPaste 跟踪剪贴板的选项、重启 GPaste 守护程序,备份当前剪贴板历史记录,还有它的设置。 + +[![][6]][7] +GPaste GUI + +在 GPaste UI 中,你可以更改以下设置: + + * 启用或禁用 Gnome Shell 扩展 + * 将守护程序状态与扩展程序的状态同步 + * 主选择影响历史 + * 使剪贴板与主选择同步 + * 图像支持 + * 修整条目 + * 检测增长行 + * 保存历史 + * 历史记录设置,如最大历史记录大小、内存使用情况、最大文本长度等 + * 键盘快捷键 + + + +### 下载 GPaste + +[Download GPaste](https://github.com/Keruspe/GPaste) + +Gpaste 项目页面没有链接到任何 GPaste 二进制文件,它只有源码安装说明。非 Debian 或 Ubuntu 的 Linux 发行版的用户(你可以在下面找到 GPaste 安装说明)可以在各自的发行版仓库中搜索 GPaste。 + +不要将 GPaste 与 Gnome Shell 扩展网站上发布的 GPaste Integration 扩展混淆。这是一个使用 GPaste 守护程序的 Gnome Shell 扩展,它不再维护。内置于 GPaste 中的原生 Gnome Shell 扩展仍然维护。 + +#### 在 Ubuntu(18.04、16.04)或 Debian(Jessie 和更新版本)中安装 GPaste + +**对于 Debian,GPaste 可用于 Jessie 和更新版本,而对于 Ubuntu,GPaste 在 16.04 及更新版本的仓库中(因此可在 Ubuntu 18.04 Bionic Beaver 中使用)。** + +**你可以使用以下命令在 Debian 或 Ubuntu 中安装 GPaste(守护程序和 Gnome Shell 扩展):** +``` +sudo apt install gnome-shell-extensions-gpaste gpaste + +``` + +安装完成后,按下 `Alt + F2` 并输入 `r` 重新启动 Gnome Shell,然后按`回车`键。现在应该启用了 GPaste Gnome Shell 扩展,其图标应显示在顶部 Gnome Shell 面板上。如果没有,请使用 Gnome Tweaks(Gnome Tweak Tool)启用扩展。 + +**[Debian][8] 和 [Ubuntu][9] 的 GPaste 3.28.0 中有一个错误,如果启用了图像支持选项会导致它崩溃,所以现在不要启用此功能。** 这在 GPaste 3.28.2 中被标记为[已修复][10],但 Debian 和 Ubuntu 仓库中尚未提供此包。 + + +-------------------------------------------------------------------------------- + +via: https://www.linuxuprising.com/2018/08/gpaste-is-great-clipboard-manager-for.html + +作者:[Logix][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/118280394805678839070 +[1]:https://github.com/Keruspe/GPaste +[2]:https://2.bp.blogspot.com/-2ndArDBcrwY/W2gyhMc1kEI/AAAAAAAABS0/ZAe_onuGCacMblF733QGBX3XqyZd--WuACLcBGAs/s400/gpaste-gnome-shell-extension-ubuntu1804.png (Gpaste Gnome Shell) +[3]:https://2.bp.blogspot.com/-2ndArDBcrwY/W2gyhMc1kEI/AAAAAAAABS0/ZAe_onuGCacMblF733QGBX3XqyZd--WuACLcBGAs/s1600/gpaste-gnome-shell-extension-ubuntu1804.png +[4]:https://2.bp.blogspot.com/-7FBRsZJvYek/W2gyvzmeRxI/AAAAAAAABS4/LhokMFSn8_kZndrNB-BTP4W3e9IUuz9BgCLcBGAs/s640/gpaste-gui_1.png +[5]:https://2.bp.blogspot.com/-7FBRsZJvYek/W2gyvzmeRxI/AAAAAAAABS4/LhokMFSn8_kZndrNB-BTP4W3e9IUuz9BgCLcBGAs/s1600/gpaste-gui_1.png +[6]:https://4.bp.blogspot.com/-047ShYc6RrQ/W2gyz5FCf_I/AAAAAAAABTA/-o6jaWzwNpsSjG0QRwRJ5Xurq_A6dQ0sQCLcBGAs/s640/gpaste-gui_2.png +[7]:https://4.bp.blogspot.com/-047ShYc6RrQ/W2gyz5FCf_I/AAAAAAAABTA/-o6jaWzwNpsSjG0QRwRJ5Xurq_A6dQ0sQCLcBGAs/s1600/gpaste-gui_2.png +[8]:https://packages.debian.org/buster/gpaste +[9]:https://launchpad.net/ubuntu/+source/gpaste +[10]:https://www.imagination-land.org/posts/2018-04-13-gpaste-3.28.2-released.html \ No newline at end of file From 1e3395f4f600fd78d777e53e976bb8ac77ad2f99 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 28 Nov 2018 08:58:13 +0800 Subject: [PATCH 0504/1143] translating --- .../20180709 5 Firefox extensions to protect your privacy.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180709 5 Firefox extensions to protect your privacy.md b/sources/tech/20180709 5 Firefox extensions to protect your privacy.md index 848856fe07..821769aa2c 100644 --- a/sources/tech/20180709 5 Firefox extensions to protect your privacy.md +++ b/sources/tech/20180709 5 Firefox extensions to protect your privacy.md @@ -1,3 +1,5 @@ +translating---geekpi + 5 Firefox extensions to protect your privacy ====== From 5be1073298b96bb43aea51a5bc0e0930042d4187 Mon Sep 17 00:00:00 2001 From: guevaraya Date: Wed, 28 Nov 2018 10:02:13 +0800 Subject: [PATCH 0505/1143] Translated by Guevaraya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成,请审核 --- ...e GDM Login Screen Background In Ubuntu.md | 85 ------------------- ...e GDM Login Screen Background In Ubuntu.md | 83 ++++++++++++++++++ 2 files changed, 83 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md create mode 100644 translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md diff --git a/sources/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md b/sources/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md deleted file mode 100644 index 1b35fd563d..0000000000 --- a/sources/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md +++ /dev/null @@ -1,85 +0,0 @@ -Translating by Guevaraya -How To Change GDM Login Screen Background In Ubuntu -====== -Whenever you log in or lock and unlock your Ubuntu 18.04 LTS desktop, you will be greeted with a plain purple-colored screen. It is the default GDM (GNOME Display Manager) background since Ubuntu version 17.04. Some of you may feel boring to look at this plain background and want to make the Login screen something cool and eye-candy! If so, you’re on the right track. This brief guide describes how to change GDM Login screen background in Ubuntu 18.04 LTS desktop. - -### Change GDM Login Screen Background In Ubuntu - -Here is how the default GDM login screen background image looks like in Ubuntu 18.04 LTS desktop. -![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-1.png) - -Whether you like it or not, you will stumbled upon this screen every time you log in or lock and unlock the system. No worries! You can change this background with any beautiful image of your choice. - -Changing desktop wallpaper and user’s profile picture is not a big deal in Ubuntu. We can do it with a few mouse clicks in no time. However, changing Login/Lock screen background need a little bit editing of a file called **ubuntu.css** located under **/usr/share/gnome-shell/theme** directory. - -Before modifying this file, take a backup of this file. So, we can restore it if something went wrong. - -``` -$ sudo cp /usr/share/gnome-shell/theme/ubuntu.css /usr/share/gnome-shell/theme/ubuntu.css.bak -``` - -Now, edit ubuntu.css file: - -``` -$ sudo nano /usr/share/gnome-shell/theme/ubuntu.css -``` - -Find the following lines under the directive named **“lockDialogGroup”** in the file: - -``` -#lockDialogGroup { - background: #2c001e url(resource:///org/gnome/shell/theme/noise-texture.png); - background-repeat: repeat; -} -``` -![](https://www.ostechnix.com/wp-content/uploads/2018/11/ubuntu_css.png) - -As you can see, the default image for the GDM login screen is **noise-texture.png**. - -Now, change the background image by adding your image path. You can use either .jpg or .png file. Both format images worked fine for me. After editing the file, the contents of file will look like below: - -``` -#lockDialogGroup { - background: #2c001e url(file:///home/sk/image.png); - background-repeat: no-repeat; - background-size: cover; - background-position: center; -} -``` - -Please pay little attention to the modified version of this directive in the ubuntu.css file. I have marked the changes in bold. - -As you might have noticed, I have changed the line “… **url(resource:///org/gnome/shell/theme/noise-texture.png);** ” with “ **…url(file:///home/sk/image.png);”**. I.e You should change “… **url(resource** …” to “… **url(file**..”. - -Also, I have changed the value of “background-repeat:” parameter from **“repeat”** to **“no-repeat”** and added two more lines. You can simply copy/paste the above lines and change image path with your own in your ubuntu.css file. - -Once you are done, save and close the file. And, reboot your system. - -Here is my GDM login screen with updated backgrounds: -![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-2.png) - -![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-3.png) - -Cool, yeah? As you can see, changing GDM login screen is not that difficult either. All you have to do is to change the path of the image in ubuntu.css file and restart your system. It is simple as that. Have fun! - -You can also edit **gdm3.css** file located under **/usr/share/gnome-shell/theme** directory and modify it as shown above to get the same result. Again, don’t forget to take the backup of the file before making any changes. - -And, that’s all now. More good stuffs to come. Stay tuned! - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-change-gdm-login-screen-background-in-ubuntu/ - -作者:[SK][a] -选题:[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.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 diff --git a/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md b/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md new file mode 100644 index 0000000000..71d9ec1fc5 --- /dev/null +++ b/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md @@ -0,0 +1,83 @@ +如何更换Ubuntu系统的GDM登录界面背景 +====== +Ubuntu 18.04 LTS桌面系统在登录,锁屏和解锁状态下,我们会看到一个纯紫色的背景。它是GDM(GNOME Display Manager)从ubuntu 17.04版本开始使用的默认背景。有一些人可能会不喜欢这个纯色的背景,想换一个酷一点,更吸睛的!如果是这样,你找对地方了。这篇简文将会告诉你如何更换Ubuntu 18.04 LTS的GDM登录界面的背景。 +### 更换Ubuntu的登录界面背景 + +这是Ubuntu 18.04 LTS桌面系统默认的登录界面 +![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-1.png) + +不管你喜欢还是不喜欢,你总是会不经意在登录,解屏/锁屏的时面对它。别担心!你可以随便更换一个你喜欢的图片。 + +在Ubuntu上更换桌面壁纸和用户的资料图像不难。我们可以点击鼠标就搞定了。但更换解屏/锁屏的背景则需要修改文件 **ubuntu.css** 位于 **/usr/share/gnome-shell/theme**。 + +修改这个文件之前,最好备份一下它。这样我们可以避免出现问题时可以恢复它。 + +``` +$ sudo cp /usr/share/gnome-shell/theme/ubuntu.css /usr/share/gnome-shell/theme/ubuntu.css.bak +``` + +修改文件ubuntu.css : + +``` +$ sudo nano /usr/share/gnome-shell/theme/ubuntu.css +``` +在文件中找到关键字 **“lockDialogGroup”** ,如下行: + + +``` +#lockDialogGroup { + background: #2c001e url(resource:///org/gnome/shell/theme/noise-texture.png); + background-repeat: repeat; +} +``` +![](https://www.ostechnix.com/wp-content/uploads/2018/11/ubuntu_css.png) + +可以看到,GDM默认登录的背景图片是 **noise-texture.png** + +现在修改为你自己的图片路径。也可以选择.jpg或.png格式的文件,两种格式的图片文件都是支持的。修改完成后的文件内容如下: + +``` +#lockDialogGroup { + background: #2c001e url(file:///home/sk/image.png); + background-repeat: no-repeat; + background-size: cover; + background-position: center; +} +``` + +请注意ubuntu.css文件里这个关键字的修改,我把修改点加粗了. + +你可能注意到,我原来的“… **url(resource:///org/gnome/shell/theme/noise-texture.png);** ” 修改为“ **…url(file:///home/sk/image.png);”**。也就是说,你可以把“… **url(resource** …” 修改为to “… **url(file**..”。 + +同时,你可以把参数“background-repeat:” 的值 **“repeat”** 修改为 **“no-repeat”** 来增加多行。你可以直接复制上面几行的修改到你的ubuntu.css文件,对应的修改为你的图片路径。 + +修改完成后,保存和关闭此文件。然后系统重启生效。 + +下面是GDM登录界面的最新背景图片: +![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-2.png) + +![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-3.png) + +是不是很酷,你都看到了,更换GDM登录的默认背景很简单。你只需要修改ubuntu.css 文件中图片的路径然后重启系统。是不是很简单也很有意思. + +你可以修改 **/usr/share/gnome-shell/theme** 目录下的文件 **gdm3.css** ,具体修改内容和修改结果和上面一样。同时记得修改前备份要修改的文件。 + +就这些了。如果有好的东东再分享了,请大家关注! + +后会有期 + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-change-gdm-login-screen-background-in-ubuntu/ + +作者:[SK][a] +选题:[lujun9972][b] +译者:[Guevaraya](https://github.com/guevaraya) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 From 3f08329c1a88d6e254297e55f0af3801d4db3aa6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 10:18:45 +0800 Subject: [PATCH 0506/1143] PRF:20181113 What you need to know about the GPL Cooperation Commitment.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @HankChow 翻译的不错 --- ...know about the GPL Cooperation Commitment.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/translated/talk/20181113 What you need to know about the GPL Cooperation Commitment.md b/translated/talk/20181113 What you need to know about the GPL Cooperation Commitment.md index 0db4bf2272..2218dfcd2c 100644 --- a/translated/talk/20181113 What you need to know about the GPL Cooperation Commitment.md +++ b/translated/talk/20181113 What you need to know about the GPL Cooperation Commitment.md @@ -1,21 +1,21 @@ GPL 合作承诺的发展历程 ====== -GPL 合作承诺消除了开发者对许可证失效的顾虑,从而达到促进技术创新的目的。 +> GPL 合作承诺GPL Cooperation Commitment消除了开发者对许可证失效的顾虑,从而达到促进技术创新的目的。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Law_balance_open_source.png?itok=5c4JhuEY) -假如没有任何顾虑,技术创新和发展将会让世界发生天翻地覆的改变。[GPL 合作承诺][1]就这样应运而生,只为通过公平、一致、可预测的许可证来让科技创新无后顾之忧。 +假如能免于顾虑,技术创新和发展将会让世界发生天翻地覆的改变。[GPL 合作承诺][1]GPL Cooperation Commitment就这样应运而生,只为通过公平、一致、可预测的许可证来让科技创新无后顾之忧。 -去年,我曾经写过一篇文章,讨论了许可证对开源软件下游用户的影响。在进行研究的时候,我就发现许可证的约束力并不强,而且很多情况下是不可预测的。因此,我在文章中提出了一个能使开源许可证具有一致性和可预测性的潜在解决方案。但我只考虑到了诸如通过法律系统立法的传统方法。 +去年,我曾经写过一篇文章,讨论了许可证对开源软件下游用户的影响。在进行研究的时候,我就发现许可证的约束力并不强,而且很多情况下是不可预测的。因此,我在文章中提出了一个能使开源许可证具有一致性和可预测性的潜在解决方案。但我只考虑到了诸如通过法律系统立法的“传统”方法。 2017 年 11 月,RedHat、IBM、Google 和 Facebook 提出了这种我从未考虑过的非传统的解决方案:GPL 合作承诺。GPL 合作承诺规定了 GPL 公平一致执行的方式。我认为,GPL 合作承诺之所以有这么深刻的意义,有以下两个原因:一是许可证的公平性和一致性对于开源社区的发展来说至关重要,二是法律对不可预测性并不容忍。 -### 了解 GPL +### 了解 GPL -要了解 GPL 合作承诺,首先要了解什么是 GPL。GPL 是 [GNU 通用许可证][2]GNU General Public License的缩写,它是一个公共版权的开源许可证,这就意味着开源软件的分发者必须向下游用户公开源代码。GPL 还禁止对下游用户作出限制,要求个人用户不得拒绝他人对开源软件的使用自由、研究自由、共享自由和改进自由。GPL 规定,只要下游用户满足了许可证的要求和条件,就可以使用该许可证。如果被许可人出现了不符合许可证的情况,则视为违规。 +要了解 GPL 合作承诺,首先要了解什么是 GPL。GPL 是 [GNU 通用许可证][2]GNU General Public License的缩写,它是一个公共版权的开源许可证,这就意味着开源软件的分发者必须向下游用户公开源代码。GPL 还禁止对下游的使用作出限制,要求个人用户不得拒绝他人对开源软件的使用自由、研究自由、共享自由和改进自由。GPL 规定,只要下游用户满足了许可证的要求和条件,就可以使用该许可证。如果被许可人出现了不符合许可证的情况,则视为违规。 -按照第二版 GPL(GPLv2)的描述,许可证会在任何违规的情况下自动终止,这就导致了部分开发者对 GPL 有所抗拒。而在第三版 GPL(GPLv3)中则引入了“[治愈条款cure provision][3]”,这一条款规定,被许可人可以在 30 天内对违反 GPL 的行为进行改正,如果在这个缓冲期内改正完成,许可证就不会被终止。 +按照第二版 GPL(GPLv2)的描述,许可证会在任何违规的情况下自动终止,这就导致了部分开发者对 GPL 有所抗拒。而在第三版 GPL(GPLv3)中则引入了“[治愈条款][3]cure provision”,这一条款规定,被许可人可以在 30 天内对违反 GPL 的行为进行改正,如果在这个缓冲期内改正完成,许可证就不会被终止。 这一规定消除了许可证被无故终止的顾虑,从而让软件的开发者和用户专注于开发和创新。 @@ -23,10 +23,9 @@ GPL 合作承诺消除了开发者对许可证失效的顾虑,从而达到促 GPL 合作承诺将 GPLv3 的治愈条款应用于使用 GPLv2 的软件上,让使用 GPLv2 许可证的开发者避免许可证无故终止的窘境,并与 GPLv3 许可证保持一致。 - 很多软件开发者都希望正确合规地做好一件事情,但有时候却不了解具体的实施细节。因此,GPL 合作承诺的重要性就在于能够对软件开发者们做出一些引导,让他们避免因一些简单的错误导致许可证违规终止。 -Linux 基金会技术顾问委员会在 2017 年宣布,Linux 内核项目将会[采用 GPLv3 的治愈条款][4]。在 GPL 合作承诺的推动下,很多大型科技公司和个人开发者都承诺,会将自己的开源软件和 Linux 内核贡献在 30 天缓冲期内从 GPLv2 或 LGPLv2.1 扩展到 GPLv3。 +Linux 基金会技术顾问委员会在 2017 年宣布,Linux 内核项目将会[采用 GPLv3 的治愈条款][4]。在 GPL 合作承诺的推动下,很多大型科技公司和个人开发者都做出了相同的承诺,会将该条款扩展应用于他们采用 GPLv2(或 LGPLv2.1)许可证的所有软件,而不仅仅是对 Linux 内核的贡献。 GPL 合作承诺的广泛采用将会对开源社区产生非常积极的影响。如果更多的公司和个人开始采用 GPL 合作承诺,就能让大量正在使用 GPLv2 或 LGPLv2.1 许可证的软件以更公平和更可预测的形式履行许可证中的条款。 @@ -41,7 +40,7 @@ via: https://opensource.com/article/18/11/gpl-cooperation-commitment 作者:[Brooke Driver][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0dc7b0143bb98dc3cfeb14a30bc0a8f55f643834 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 10:19:05 +0800 Subject: [PATCH 0507/1143] PUB:20181113 What you need to know about the GPL Cooperation Commitment.md @HankChow https://linux.cn/article-10285-1.html --- ... What you need to know about the GPL Cooperation Commitment.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20181113 What you need to know about the GPL Cooperation Commitment.md (100%) diff --git a/translated/talk/20181113 What you need to know about the GPL Cooperation Commitment.md b/published/20181113 What you need to know about the GPL Cooperation Commitment.md similarity index 100% rename from translated/talk/20181113 What you need to know about the GPL Cooperation Commitment.md rename to published/20181113 What you need to know about the GPL Cooperation Commitment.md From 9d17e4521be9a8f5b3abbff21a3db059f1b93121 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 11:48:36 +0800 Subject: [PATCH 0508/1143] PRF:20180807 5 reasons the i3 window manager makes Linux better.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lixinyuxx 恭喜你完成了第一篇翻译。(可适当注意中文标点符号,另外 terminal 是 Linux 中的“终端”,即命令行窗口) --- ...he i3 window manager makes Linux better.md | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md b/translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md index 428665c170..b9df0f4509 100644 --- a/translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md +++ b/translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md @@ -1,47 +1,49 @@ -i3窗口管理器让Linux更好的五个原因 +i3 窗口管理器使 Linux 更美好 ====== +> 通过键盘操作的 i3 平铺窗口管理器使用 Linux 桌面。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-windows.png?itok=jd5sBNQH) -Linux(和一般的开源软件) 最美好的一点是在不同的替代方案中进行选择的自由,以满足我们的需求。 +Linux(和一般的开源软件)最美好的一点是自由 —— 可以在不同的替代方案中进行选择以满足我们的需求。 -我使用 Linux 已经很长时间了,但我从来没有对可用的桌面环境完全满意。直到去年 [Xfce][1] 是我认为在功能和性能之间的一个接近优秀的妥协。然后我发现 [i3][2] 一个惊人的软件改变了我的生活 +我使用 Linux 已经很长时间了,但我从来没有对可选用的桌面环境完全满意过。直到去年,[Xfce][1] 还是我认为在功能和性能之间的平和最接近满意的一个桌面环境。然后我发现了 [i3][2],这是一个改变了我的生活的惊人的软件。 -I3 是一个平铺窗口管理器。窗口管理器的目标是控制窗口系统中窗口的外观和位置。窗口管理器通常用作功能齐全的桌面环境 (如 GONME 或 Xfce ) 的一部分, 但也有一些可以用作独立的应用程序。 +i3 是一个平铺窗口管理器。窗口管理器的目标是控制窗口系统中窗口的外观和位置。窗口管理器通常用作功能齐全的桌面环境 (如 GONME 或 Xfce ) 的一部分,但也有一些可以用作独立的应用程序。 -平铺式窗口管理器会自动排列窗口, 以不重叠的方式占据整个屏幕。其他流行的平铺式窗口管理器包括 [wmii][3] 和 [xmonad][4] 。 +平铺式窗口管理器会自动排列窗口,以不重叠的方式占据整个屏幕。其他流行的平铺式窗口管理器还有 [wmii][3] 和 [xmonad][4] 。 ![i3 tiled window manager screenshot][6] -带有三个的 i3 屏幕截图 +*带有三个的 i3 屏幕截图* -以下是我使用 i3 窗口管理器的五个首要原因,并推荐它以获得更好的 Linux 桌面体验。 +为了获得更好的 Linux 桌面体验,以下是我使用和推荐 i3 窗口管理器的五个首要原因。 -### 1\.简化的艺术 +### 1、极简艺术 -I3 速度很快。它既不冗杂, 也不花哨。它的设计简单而高效。作为开发人员, 我重视这些功能, 因为我可以使用额外的功能为我最喜欢的开发工具助力, 或者使用容器或虚拟机在本地测试内容。 +i3 速度很快。它既不冗杂、也不花哨。它的设计简单而高效。作为开发人员,我重视这些功能,因为我可以使用更多的功能以丰富我最喜欢的开发工具,或者使用容器或虚拟机在本地测试内容。 -此外, I3 是一个窗口管理器,与功能齐全的桌面环境不同,它并不规定您应该使用的应用程序。您是否想使用 Xfce 的 Thunar 作为文件管理器?GNOME 的 gedit 去编辑文本? I3 并不在乎。选择对您的工作流最有意义的工具,I3 将以相同的方式管理它们。 +此外, i3 是一个窗口管理器,与功能齐全的桌面环境不同,它并不规定您应该使用的应用程序。您是否想使用 Xfce 的 Thunar 作为文件管理器?GNOME 的 gedit 去编辑文本? i3 并不在乎。选择对您的工作流最有意义的工具,i3 将以相同的方式管理它们。 -### 2\. 屏幕实际使用面积 +### 2、屏幕实际使用面积 -作为平铺式窗口管理器, I3 将自动 "平铺" 或以不重叠的方式定位窗口, 类似于在墙上放置瓷砖。因为您不需要担心窗口定位, i3 一般会更好地利用您的屏幕空间。它还可以让您更快地找到您需要的东西。 +作为平铺式窗口管理器,i3 将自动 “平铺”,以不重叠的方式定位窗口,类似于在墙上放置瓷砖。因为您不需要担心窗口定位,i3 一般会更好地利用您的屏幕空间。它还可以让您更快地找到您需要的东西。 -对于这种情况有很多有用的例子。例如, 系统管理员可以打开多个?来同时监视或在不同的远程系统上工作;开发人员可以使用他们最喜欢的 IDE 或编辑器和几个?来测试他们的程序。 +对于这种情况有很多有用的例子。例如,系统管理员可以打开多个终端来同时监视或在不同的远程系统上工作;开发人员可以使用他们最喜欢的 IDE 或编辑器和几个终端来测试他们的程序。 -此外, i3 具有灵活性。如果您需要为特定窗口提供更多空间, 请启用全屏模式或切换到其他布局, 如堆叠或选项卡式(标签式)。 +此外,i3 具有灵活性。如果您需要为特定窗口提供更多空间,请启用全屏模式或切换到其他布局,如堆叠或选项卡式(标签式)。 -### 3\. 键盘驱动的工作流程 +### 3、键盘式工作流程 -i3 广泛使用键盘快捷键来控制环境的不同方面。其中包括打开?和其他程序、调整大小和定位窗口、更改布局, 甚至退出 i3。当您开始使用 i3 时, 您需要记住其中的一些快捷方式来绕行,随着时间的推移,您会使用更多的快捷方式。 +i3 广泛使用键盘快捷键来控制环境的不同方面。其中包括打开终端和其他程序、调整大小和定位窗口、更改布局,甚至退出 i3。当您开始使用 i3 时,您需要记住其中的一些快捷方式才能使用,随着时间的推移,您会使用更多的快捷方式。 -主要好处是, 您不需要经常用键盘和鼠标切换上下文。通过练习, 意味着您将提高工作流程的速度和效率。 +主要好处是,您不需要经常在键盘和鼠标之间切换。通过练习,您将提高工作流程的速度和效率。 -例如, 要打开新的?,请按 `+` .由于窗口是自动定位的, 您可以立即开始键入命令。结合一个很好的?驱动的文本编辑器 (如 Vim) 和一个以键盘为焦点的浏览器,形成一个完全由键盘驱动的工作流程。 +例如, 要打开新的终端,请按 `+`。由于窗口是自动定位的,您可以立即开始键入命令。结合一个很好的终端文本编辑器(如 Vim)和一个以面向键盘的浏览器,形成一个完全由键盘驱动的工作流程。 -在 i3 中, 您可以为所有内容定义快捷方式。下面是一些示例: +在 i3 中,您可以为所有内容定义快捷方式。下面是一些示例: - * 打开? + * 打开终端 * 打开浏览器 * 更改布局 * 调整窗口大小 @@ -50,40 +52,38 @@ i3 广泛使用键盘快捷键来控制环境的不同方面。其中包括打 现在我已经习惯了这个工作形式,我已无法回到了常规的桌面环境。 -### 4\. 灵活 +### 4、灵活 -i3 力求最小化,很少使用系统资源, 但这并不意味着它不可能漂亮。i3 具有灵活性, 可通过多种方式进行自定义, 以改善视觉体验。因为 i3 是一个窗口管理器, 所以它不提供启用自定义的工具,而是提供启用自定义的工具。您需要外部工具来实现这一点。一些例子: +i3 力求极简,使用很少的系统资源,但这并不意味着它不能变漂亮。i3 是灵活且可通过多种方式进行自定义以改善视觉体验。因为 i3 是一个窗口管理器,所以它没有提供启用自定义的工具,你需要外部工具来实现这一点。一些例子: * 用 `feh` 定义桌面的背景图片。 - * 使用复合器管理器, 如`compton`以启用窗口淡入淡出和透明度等效果。 - * 用 `dmenu` 或 `rofi`以启用可从键盘快捷方式启动的可自定义菜单。 + * 使用合成器管理器,如 `compton` 以启用窗口淡入淡出和透明度等效果。 + * 用 `dmenu` 或 `rofi` 以启用可从键盘快捷方式启动的可自定义菜单。 * 用 `dunst` 用于桌面通知。 - - -i3 是完全可配置的,您可以通过更新默认配置文件来控制它的各个方面。从更改所有键盘快捷键,到重新定义工作区的名称,再到修改状态栏,您都可以使 i3 以任何最适合您需要的方式运行。 +i3 是可完全配置的,您可以通过更新默认配置文件来控制它的各个方面。从更改所有键盘快捷键,到重新定义工作区的名称,再到修改状态栏,您都可以使 i3 以任何最适合您需要的方式运行。 ![i3 with rofi menu and dunst desktop notifications][8] -i3 与 `rofi` 菜单和 `dunst` 桌面通知。 +*i3 与 `rofi` 菜单和 `dunst` 桌面通知。* -最后, 对于更高级的用户, i3 提供了完整的进程间通信([IPC][9]) 界面, 允许您使用您最喜爱的语言来开发脚本或程序,以实现更多的自定义选项。 +最后,对于更高级的用户,i3 提供了完整的进程间通信([IPC][9])接口,允许您使用偏好的语言来开发脚本或程序,以实现更多的自定义选项。 -### 5\. 工作空间 +### 5、工作空间 -在 i3 中, 工作区是对窗口进行分组的一种简单方法。您可以根据您的工作流以不同的方式对它们进行分组。例如, 您可以将浏览器放在一个工作区上, ?命令行放在另一个工作区上, 将电子邮件客户端放在第三个工作区上, 等等。您甚至可以更改 i3 的配置, 以便始终将特定应用程序分配给它们自己的工作区。 +在 i3 中,工作区是对窗口进行分组的一种简单方法。您可以根据您的工作流以不同的方式对它们进行分组。例如,您可以将浏览器放在一个工作区上,终端放在另一个工作区上,将电子邮件客户端放在第三个工作区上等等。您甚至可以更改 i3 的配置,以便始终将特定应用程序分配给它们自己的工作区。 -切换工作区既快速又简单。像 i3 中的往常一样,使用键盘快捷方式执行此操作。按 `+num` 切换到工作区 `num` 。如果您养成了始终将应用程序组的窗口分配到同一工作区的习惯,则可以在它们之间快速切换,这使得工作区成为非常有用的功能。 +切换工作区既快速又简单。像 i3 中的惯例,使用键盘快捷方式执行此操作。按 `+num` 切换到工作区 `num` 。如果您养成了始终将应用程序组的窗口分配到同一个工作区的习惯,则可以在它们之间快速切换,这使得工作区成为非常有用的功能。 -此外,还可以使用工作区来控制多监视器的设置,其中每个监视器都可以获得初始工作区。如果切换到该工作区, 则切换到该监视器,而无需让手离开键盘。 +此外,还可以使用工作区来控制多监视器环境,其中每个监视器都有个初始工作区。如果切换到该工作区,则切换到该监视器,而无需让手离开键盘。 -最后,i3 中还有另一种特殊类型的工作空间: the scratchpad(便笺簿)。它是一个不可见的工作区,通过按快捷方式显示在其他工作区的中间。这是一种方便的方式来访问您经常使用的窗口或程序,如电子邮件客户端或音乐播放器。 +最后,i3 中还有另一种特殊类型的工作空间:the scratchpad(便笺簿)。它是一个不可见的工作区,通过按快捷方式显示在其他工作区的中间。这是一种访问您经常使用的窗口或程序的方便方式,如电子邮件客户端或音乐播放器。 ### 尝试一下吧 -如果您重视简单性和效率, 并且不抵触使用键盘, i3 就是您的窗口管理器。有人说是为高级用户准备的,但情况不一定如此。你需要学习一些基本的快捷方式来度过开始的阶段,不久就会越来越自然并且不假思索地使用它们。 +如果您重视简洁和效率,并且不惮于使用键盘,i3 就是您的窗口管理器。有人说是为高级用户准备的,但情况不一定如此。你需要学习一些基本的快捷方式来度过开始的阶段,不久就会越来越自然并且不假思索地使用它们。 -这篇文章只是触及了 i3 表面能做的事情。欲了解更多详情, 请咨询 [i3's documentation][10]. +这篇文章只是浅浅谈及了 i3 能做的事情。欲了解更多详情,请参阅 [i3 的文档][10]。 -------------------------------------------------------------------------------- @@ -92,7 +92,7 @@ via: https://opensource.com/article/18/8/i3-tiling-window-manager 作者:[Ricardo Gerardi][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[lixinyuxx](https://github.com/lixinyuxx) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9923529515f60fe1ff58fd37865d139681e0e1ea Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 11:49:39 +0800 Subject: [PATCH 0509/1143] PUB:20180807 5 reasons the i3 window manager makes Linux better.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lixinyuxx 本文首发地址: https://linux.cn/article-10286-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/lixinyuxx 请注册领取 LCCN: https://lctt.linux.cn/ --- ...20180807 5 reasons the i3 window manager makes Linux better.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180807 5 reasons the i3 window manager makes Linux better.md (100%) diff --git a/translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md b/published/20180807 5 reasons the i3 window manager makes Linux better.md similarity index 100% rename from translated/tech/20180807 5 reasons the i3 window manager makes Linux better.md rename to published/20180807 5 reasons the i3 window manager makes Linux better.md From 2ea4a2009351bd17f9196dbdfae9d79454505456 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 12:02:42 +0800 Subject: [PATCH 0510/1143] PRF:20180417 How To Browse Stack Overflow From Terminal --- .../20180417 How To Browse Stack Overflow From Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20180417 How To Browse Stack Overflow From Terminal.md b/published/20180417 How To Browse Stack Overflow From Terminal.md index 220045aaa0..03d4c9df5f 100644 --- a/published/20180417 How To Browse Stack Overflow From Terminal.md +++ b/published/20180417 How To Browse Stack Overflow From Terminal.md @@ -101,7 +101,7 @@ $ how2 create archive tgz $ how2 -l python linked list ``` -[![][4]][8] +![][8] 要获得快速帮助,请输入: From 0417e5139f139835313c36d8a32d0d781a50a295 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 28 Nov 2018 17:01:40 +0800 Subject: [PATCH 0511/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20OpenSnitch=20?= =?UTF-8?q?=E2=80=93=20an=20Application=20Firewall=20for=20Linux=20[Review?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Application Firewall for Linux -Review.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md diff --git a/sources/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md b/sources/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md new file mode 100644 index 0000000000..2a1602a6bb --- /dev/null +++ b/sources/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (OpenSnitch – an Application Firewall for Linux [Review]) +[#]: via: (https://itsfoss.com/opensnitch-firewall-linux/) +[#]: author: ([John Paul](https://itsfoss.com/author/john/)) +[#]: url: ( ) + +OpenSnitch – an Application Firewall for Linux [Review] +====== + +Just because Linux is a lot more secure than Windows, there is no reason you should not be cautious. There are a number of firewalls available for Linux that you can use to make your Linux system more secure. Today we will be taking a look at one of such firewall tool called OpenSnitch. + +### What is OpenSnitch? + +![Linux firewall and security][1] + +[OpenSnitch][2] is a port of Little Snitch. Little Snitch, in turn, is an application firewall designed solely for Mac OS. OpenSnitch is created by [Simone Margaritelli][3], also known as [evilsocket][4]. + +The main thing that OpenSnitch does is track internet requests made by applications you have installed. OpenSnitch allows you to create rules for which apps to allow to access the internet and which to block. Each time an application that does not have a rule in place tries to access the internet, a dialog box appears. This dialog box gives you the option to allow or block the connection. + +You can also decide whether this new rule applies to the process, the exact URL it is attempting to reach, the domain that it is attempting to reach, to this single instance, to this session or forever. + +![OpenSnitch firewall app in Linux][5]OpenSnatch rule request + +All of the rules that you create are stored as [JSON files][6] so you can change them later if you need to. For example, if you incorrectly blocked an application. + +OpenSnitch also has a nice graphical user interface that lets you see at a glance: + + * What applications are accessing the web + * What IP address they are using + * What User owns it + * What port is being used + + + +You can also export the information to a CSV file if you wish. + +OpenSnitch is available under the GPL v3 license. + +![OpenSnitch firewall interface][7]OpenSnitch processes tab + +### Installing OpenSnitch in Linux + +The installation instructions on the [OpenSnitch GitHub page][8] are aimed at Ubuntu users. If you are using another distro, you will have to adjust the commands. As far as I know, this application is only packaged in the [Arch User Repository][9]. + +Before you start, you need to have Go properly installed and the `$GOPATH` environment variable is defined. + +First, install the necessary dependencies. + +``` +sudo apt-get install protobuf-compiler libpcap-dev libnetfilter-queue-dev python3-pip + +go get github.com/golang/protobuf/protoc-gen-go + +go get -u github.com/golang/dep/cmd/dep + +python3 -m pip install --user grpcio-tools +``` + +Next, you will need to clone the OpenSnitch repo. There will probably be a message that no Go files where found. Ignore it. If you get a message that git is missing, just install it. + +``` +go get github.com/evilsocket/opensnitch + +cd $GOPATH/src/github.com/evilsocket/opensnitch +``` + +If the `$GOPATH` environment variable is not setup correctly, you will get a “no such folder found” error on the previous command. just `cd` into the location of the “evilsocket/opensnitch” folder that was listed when you cloned it to your system. + +Now, we build and install it. + +``` +make + +sudo make install +``` + +If you get an error that the `dep` command could not be found, add `GOPATH/bin` is in the `PATH`. + +Once that is finished, we will initiate the daemon and start the graphical user environment. + +``` +sudo systemctl enable opensnitchd + +sudo service opensnitchd start + +opensnitch-ui +``` + +![OpenSnitch firewall interface][10]OpenSnitch on Manjaro + +### Experience + +I’ll be honest: my experience with OpenSnitch was not great. I started by trying to install it on Fedora. I had trouble finding some of the dependencies. I switched over to Manjaro and was happy to find it in the Arch User Repository. + +Unfortunately, after I ran the installation, I could not launch the graphical user interface. So I ran the last three steps by hand. Everything seemed to be working fine. The dialog box popped up asking me if I wanted to let Firefox visit the Manjaro website. + +Interestingly, when I ran an [AUR tool][11] `yay` to update my system, the dialog box requested rules for `yay`, `pacman`, `pamac`, and `git`. Later, I had to close and restart the GUI because it was acting up. When I restart it, it stopped asking me to create rules. I installed Falkon and OpenSnitch did not ask me to give it any permissions. It did not even list Falkon in the OpenSnithch GUI. I reinstalled OpenSnitch. Same issue. + +Then I moved to Ubuntu Mate. Since the installation instructions were written for Ubuntu, things went easier. However, I ran into a couple issues. I tweaked the installation instructions above to fix the problems I encountered. + +Installation was not the only issue that I ran into. The dialog box that appeared every time a new app created a connection only lasted for 10 seconds. That was barely enough time to explore the available options. Most of the time, I only had time to allow an application (only the ones I trust) to access the web forever. + +The GUI also left a bit to be desired. For some reason, the window was set to be on top all of the time. On top of that, there are no setting to change it. It would also have been nice to have the option to change rules from the GUI. + +![][12]OpenSnitch hosts tab + +### Final Thoughts on OpenSnitch + +I like what OpenSnitch is aiming for: any easy way to control what information leaves your computer. However, it has too many rough edges for me to recommend it to a regular or hobby user. If you are a power user, who likes to tinker and dig for answers then maybe this is for you. + +It’s kinda disappointing. I would have hoped that an application that recently hit 1.0 would be in a little better shape. + +Have you ever used OpenSnitch? If not, what is your favorite firewall app? How do you make your Linux system more secure? Let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][13]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/opensnitch-firewall-linux/ + +作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/linux-firewall-security.jpg?fit=800%2C450&ssl=1 +[2]: https://www.opensnitch.io/ +[3]: https://github.com/evilsocket +[4]: https://twitter.com/evilsocket +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/opensnitch-dialog.jpg?fit=800%2C421&ssl=1 +[6]: https://www.json.org/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/opensnitch-processes.jpg?fit=800%2C651&ssl=1 +[8]: https://github.com/evilsocket/opensnitch +[9]: https://aur.archlinux.org/packages/opensnitch-git +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/opensnitch-manjaro.jpg?fit=800%2C651&ssl=1 +[11]: https://itsfoss.com/best-aur-helpers/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/opensnitch-hosts.jpg?fit=800%2C651&ssl=1 +[13]: http://reddit.com/r/linuxusersgroup From 02b3b5e0430622263d03329cfa1ea7fb88db0752 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 28 Nov 2018 17:03:36 +0800 Subject: [PATCH 0512/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20What=20the=20op?= =?UTF-8?q?en=20source=20community=20means=20to=20me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t the open source community means to me.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/talk/20181127 What the open source community means to me.md diff --git a/sources/talk/20181127 What the open source community means to me.md b/sources/talk/20181127 What the open source community means to me.md new file mode 100644 index 0000000000..bdb43bf20c --- /dev/null +++ b/sources/talk/20181127 What the open source community means to me.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (What the open source community means to me) +[#]: via: (https://opensource.com/article/18/11/what-open-source-community-means-me) +[#]: author: ([Florian Effenberger](https://opensource.com/users/floeff)) +[#]: url: ( ) + +What the open source community means to me +====== +Contributing to open source is more than a way to make better software; it can enrich your entire life. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_remote_teams_world.png?itok=_9DCHEel) + +Every time I tell my friends about my hobby—which became my career as the executive director at [The Document Foundation][1]—I face lots of questions. A worldwide community? Contributors around the globe? An open source community? Can you eat that?! + +Well, actually [sometimes you can][2] eat it. But seriously, today, I'd like to share my very personal view about what the open source community means to me and why being active is not only fun but also benefits your whole life. + +### A long, long time ago… + +Back in the good old days (around 2003 or 2004) when I was in my early twenties, I was a casual open source user. Flat-rate broadband connections had just become common, which suddenly made communication around the globe possible for everyone. More and more free software (not just Linux) made its way onto people's computers. Long before we had open source operating systems for smartphones and the Internet of Things, we could download open source email clients, browsers, and other software. Like many other people, my primary motivation was price, simply because the programs were free of charge. I saw hints that these applications were driven by a community, but I didn't fully understand what that meant. Since I wasn't a developer, having access to the source code was not a compelling reason for me to use open source—neither the software nor I would have gotten any advantage if I'd started coding. + +### From user to community member + +In those early days, the idea of a free office suite was tempting, so I installed OpenOffice on my computer. More out of coincidence than a plan, I subscribed to the project's mailing list. My curiosity was much larger than my understanding, but luckily that didn't keep me from doing things. + +Time went by, autumn arrived, and the inevitable trade show season started again. Without really knowing what the heck I was doing, I offered to help OpenOffice.org at a Munich trade show, even though I had neither any clue about trade shows nor about the software itself—conditions couldn't have been worse, actually. I have always been quite skeptical and a bit shy, but that probably contributed to the fact that this was the best-documented trade show we'd ever had and quite a success for us. + +I also met a colleague, whom I still work closely with, who took me under his wing. He never gave me the feeling that I was a useless rookie; on the contrary, from the very beginning, I was treated as a full and respected member of the community whose opinion mattered. Soon I became responsible for things that I had never done on a professional basis. To my surprise, it was a lot of fun and ultimately started something that shaped my life very much. + +### Credit of trust + +Unlike large corporations with their hierarchies and complex structures, in open source, I could start doing the things that interested me almost immediately. I could work in a very relaxed and easy way, which made it a whole lot of fun. + +This credit of trust I received from the community is something that still touches me. After contributing in some areas—opportunities I owe to people who believed in me from the very beginning—I had the honor of meeting a wonderful human being, my mentor and good friend [John McCreesh][3], who sadly passed away in 2016. I had the joy of working with him to shape our project's international marketing. Even today, it is hard to believe this credit of trust, and I deeply value it as a gift that is anything but usual. + +Over time, I was introduced to more and more areas—along with marketing, I was also responsible for distributing files on our mirror network, co-organizing several events, and co-founding what is most likely the first German foundation [tailored specifically for the open source community][4]. + +### Friends around the world + +Over the years I've met lots of wonderful human beings through my open source activities. Not just colleagues or contacts, but true friends who live around the globe. We not only share an interest in our community but also lots of private moments and wonderful discussions. + +We don't often meet in person due to distance, but that lack of proximity doesn't affect the mutual trust we share. One of my favorite memories is of meeting a friend from Rio de Janeiro, whom I've known since early 2000 when I helped him with a problem on his Linux server. We didn't meet in person until 2013; even though we'd never been in the same room throughout our friendship and the language barriers were high, we had an amazing evening among two good friends, 10,000km from home. We are in regular contact to this day. + +### Broaden your mind + +Having friends around the globe also gives you amazing insight and widens your scope, helping you redefine your point of view. Heading to the Vatican after a conference in Italy, my friend John once commented how fascinating it is seeing all the places free software can bring you. + +During trips to foreign countries to attend conferences, my local colleagues help me learn a lot about life in other countries. I've met contributors from high-poverty countries, people with very touching personal stories, and colleagues who took long trips to English-speaking conferences despite large language barriers. I admire these people for taking these chances. + +My colleagues' lives and credentials are often truly inspiring, as open source projects are open to everyone, independent of age, profession, and education. It's clear that the supposed barriers of culture, language, and time exist only in our heads—and they can be crossed in harmony. This is an important model for everyone, especially in these complicated times. + +Meeting people from other cultures and learning about their lives helps me think about the world in new ways. When I read news reports about violence and war in countries where I have friends and colleagues, I worry about their well-being. Suddenly all the anonymous pain and suffering has a name and a face, and looking away is no longer an option. + +### A life's philosophy + +To me, open source is not just a license or a development model—it's an open mentality of mutual respect for everyone, trust in newbies, appreciation and value for other people's opinions, joint goals, and shared ideals. Open source involves data privacy, civil rights, free knowledge, open standards, and much more. I often say it's a philosophy of life by its own. + +Like in any social group, open source projects are full of discussions, arguments, and discrepancies—very often you'll meet strong characters and learn that email communication can lead to a lot of confusion and misunderstanding. Still, none of this disention changes the very open, motivated, and motivating attitude of contributors. This creates an incredibly welcoming and inviting environment, which (in addition to the technical aspect) reveals a wonderful, human side of things. + +### Reality of life + +After all these years, open source has finally arrived, thanks to so many people spreading the word and living the ideals. Ten to 12 years ago, we were like aliens at trade shows, but nowadays, not only are the development and license model well recognized, but open source is an integral part of many companies' business. I'm delighted that more and more companies understand the open source model, contribute to it, act according to its principles, and therefore become an equal part of the open source community. This shows that the open source model has become mature. + +I am skeptical, however, of the growing use of the term "community," as it seems any company with more than a handful of users on their platform claims membership, even if they are far more interested in marketing their product than serving the community. Nonetheless, it's great to see even conservative companies opening up to collaborate with their customers and the general public. + +### The future is open + +Even after more than 15 years in open source, every day is a new beginning, every day is exciting, there's always something new to discover, and the number of successes grows as the challenges do. + +I am quite excited and curious where things will lead—not only in the projects and the code but even more in users' and decision-makers' minds. We all benefit, at least indirectly, from the achievements of the projects and the people driving them. + +I'm certain the open source community will continue bringing me in touch with new topics and connecting me to new people who'll enrich my life. I am proud and happy to be a part of this movement, which allows me to experience how mutual respect, trust, and shared ideals help move things forward. + +This was originally published on [Florian Effenberger][5]'s blog and is reprinted with permission. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/what-open-source-community-means-me + +作者:[Florian Effenberger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/floeff +[b]: https://github.com/lujun9972 +[1]: https://www.documentfoundation.org/ +[2]: https://opensource.com/article/18/9/open-source-cooking +[3]: https://blog.documentfoundation.org/blog/2016/01/24/r-i-p-john-mccreesh/ +[4]: https://blog.documentfoundation.org/blog/2012/02/20/the-document-foundation-officially-incorporated-in-berlin-germany/ +[5]: https://blog.effenberger.org/2016/04/28/what-the-open-source-community-means-to-me/ From 55326b3ee7af5739fb6552e80089e6879ad5ed1a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 18:25:37 +0800 Subject: [PATCH 0513/1143] PRF:20181001 Turn your book into a website and an ePub using Pandoc.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @jlztan 翻译很好 --- ...into a website and an ePub using Pandoc.md | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/translated/tech/20181001 Turn your book into a website and an ePub using Pandoc.md b/translated/tech/20181001 Turn your book into a website and an ePub using Pandoc.md index 54a92afd88..734ac021cb 100644 --- a/translated/tech/20181001 Turn your book into a website and an ePub using Pandoc.md +++ b/translated/tech/20181001 Turn your book into a website and an ePub using Pandoc.md @@ -1,13 +1,13 @@ 使用 Pandoc 将你的书转换成网页和电子书 ====== -通过 Markdown 和 Pandoc,可以做到编写一次,发布两次。 +> 通过 Markdown 和 Pandoc,可以做到编写一次,发布两次。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_paper_envelope_document.png?itok=uPj_kouJ) -Pandoc 是一个命令行工具,用于将文件从一种标记语言转换为另一种标记语言。在我的 [Pandoc 简介][1] 一文中,我演示了如何把 Markdown 编写的文本转换为网页、幻灯片和 PDF。 +Pandoc 是一个命令行工具,用于将文件从一种标记语言转换为另一种标记语言。在我 [对 Pandoc 的简介][1] 一文中,我演示了如何把 Markdown 编写的文本转换为网页、幻灯片和 PDF。 -在这篇后续文章中,我将深入探讨 [Pandoc][2],展示如何从同一 Markdown 源文件生成网页和 ePub 格式的电子书。我将使用我即将发布的电子书-- [面向对象思想的 GRASP 原则][3] 为例进行讲解,这本电子书正是通过以下过程创建的。 +在这篇后续文章中,我将深入探讨 [Pandoc][2],展示如何从同一个 Markdown 源文件生成网页和 ePub 格式的电子书。我将使用我即将发布的电子书《[面向对象思想的 GRASP 原则][3]》为例进行讲解,这本电子书正是通过以下过程创建的。 首先,我将解释这本书使用的文件结构,然后介绍如何使用 Pandoc 生成网页并将其部署在 GitHub 上;最后,我演示了如何生成对应的 ePub 格式电子书。 @@ -15,7 +15,7 @@ Pandoc 是一个命令行工具,用于将文件从一种标记语言转换为 ### 设置图书结构 -我用 Markdown 语法完成了所有的写作,你也可以使用 HTML,但是当 Pandoc 将 Markdown 转换为 ePub 文档时,引入的 HTML 越多,出现问题的风险就越高。我的书按照每章一个文件的形式进行组织,用 Markdown 的 `H1` 标记(`#`)声明每章的标题。你也可以在每个文件中放置多个章节,但将它们放在单独的文件中可以更轻松地查找内容并在以后进行更新。 +我用 Markdown 语法完成了所有的写作,你也可以使用 HTML 标记,但是当 Pandoc 将 Markdown 转换为 ePub 文档时,引入的 HTML 标记越多,出现问题的风险就越高。我的书按照每章一个文件的形式进行组织,用 Markdown 的 `H1` 标记(`#`)声明每章的标题。你也可以在每个文件中放置多个章节,但将它们放在单独的文件中可以更轻松地查找内容并在以后进行更新。 元信息遵循类似的模式,每种输出格式都有自己的元信息文件。元信息文件定义有关文档的信息,例如要添加到 HTML 中的文本或 ePub 的许可证。我将所有 Markdown 文档存储在名为 `parts` 的文件夹中(这对于用来生成网页和 ePub 的 Makefile 非常重要)。下面以一个例子进行说明,让我们看一下目录,前言和关于本书(分为 `toc.md`、`preface.md` 和 `about.md` 三个文件)这三部分,为清楚起见,我们将省略其余的章节。 @@ -48,60 +48,60 @@ author: Kiko Fernandez-Reyes rights: 2017 Kiko Fernandez-Reyes, CC-BY-NC-SA 4.0 International header-includes: - | -  \```{=html} -  -  \``` + ```{=html} + + + ``` include-before: - | -  \```{=html} - 

If you like this book, please consider -      spreading the word or -      -        buying me a coffee -     

-  \``` + ```{=html} +

If you like this book, please consider + spreading the word or + + buying me a coffee + +

+ ``` include-after: - | -  ```{=html} - 
-   
-   
-        -   
-  \``` ----: + ```{=html} +
+
+
+ +
+
+ ``` +--- ``` 下面几个变量需要注意一下: - `header-includes` 变量包含将要嵌入 `` 标签的 HTML 文本。 -- 调用变量后的下一行必须是 `- |`。再往下一行必须以与`|`对齐的三个反引号开始,否则 Pandoc 将无法识别。`{= html}` 告诉 Pandoc 其中的内容是原始文本,不应该作为 Markdown 处理。(为此,需要检查 Pandoc 中的 `raw_attribute` 扩展是否已启用。要进行此检查,键入 `pandoc --list-extensions | grep raw` 并确保返回的列表包含名为 `+ raw_html` 的项目,加号表示已启用。) -- 变量 `include-before` 在网页开头添加一些 HTML 文本,此处我要求读者帮忙宣传我的书或给我打赏。 +- 调用变量后的下一行必须是 `- |`。再往下一行必须以与 `|` 对齐的三个反引号开始,否则 Pandoc 将无法识别。`{= html}` 告诉 Pandoc 其中的内容是原始文本,不应该作为 Markdown 处理。(为此,需要检查 Pandoc 中的 `raw_attribute` 扩展是否已启用。要进行此检查,键入 `pandoc --list-extensions | grep raw` 并确保返回的列表包含名为 `+ raw_html` 的项目,加号表示已启用。) +- 变量 `include-before` 在网页开头添加一些 HTML 文本,此处我请求读者帮忙宣传我的书或给我打赏。 - `include-after` 变量在网页末尾添加原始 HTML 文本,同时显示我的图书许可证。 这些只是其中一部分可用的变量,查看 HTML 中的模板变量(我的文章 [Pandoc简介][1] 中介绍了如何查看 LaTeX 的模版变量,查看 HTML 模版变量的过程是相同的)对其余变量进行了解。 #### 将网页分成多章 -网页可以作为一个整体生成,这会产生一个包含所有内容的长页面;也可以分成多章,我认为这样会更容易阅读。 我将解释如何将网页划分为多章,以便读者不会被长网页吓到。 +网页可以作为一个整体生成,这会产生一个包含所有内容的长页面;也可以分成多章,我认为这样会更容易阅读。我将解释如何将网页划分为多章,以便读者不会被长网页吓到。 为了使网页易于在 GitHub Pages 上部署,需要创建一个名为 `docs` 的根文件夹(这是 GitHub Pages 默认用于渲染网页的根文件夹)。然后我们需要为 `docs` 下的每一章创建文件夹,将 HTML 内容放在各自的文件夹中,将文件内容放在名为 `index.html` 的文件中。 例如,`about.md` 文件将转换成名为 `index.html` 的文件,该文件位于名为 `about`(`about/index.html`)的文件夹中。这样,当用户键入 `http:///about/` 时,文件夹中的 `index.html` 文件将显示在其浏览器中。 -下面的 Makefile 将执行上述所有操作: +下面的 `Makefile` 将执行上述所有操作: ``` # Your book files @@ -149,6 +149,7 @@ clean: ``` make ``` + 根文件夹现在应该包含如下所示的文件结构: ``` @@ -200,7 +201,7 @@ stylesheet: assets/epub.css ... ``` -将以下内容添加到之前的 Makefile 中: +将以下内容添加到之前的 `Makefile` 中: ``` epub: @@ -208,7 +209,7 @@ epub:         $(addprefix parts/, $(DEPENDENCIES:=.md)) -o $(DOCS)/assets/book.epub ``` -用于产生 ePub 格式图书的命令从 HTML 版本获取所有依赖项(每章的名称),向它们添加 Markdown 扩展,并在它们前面加上每一章的文件夹路径,以便让 Pandoc 知道如何进行处理。例如,如果 `$(DEPENDENCIES` 变量只包含 “前言” 和 “关于本书” 两章,那么 Makefile 将会这样调用: +用于产生 ePub 格式图书的命令从 HTML 版本获取所有依赖项(每章的名称),向它们添加 Markdown 扩展,并在它们前面加上每一章的文件夹路径,以便让 Pandoc 知道如何进行处理。例如,如果 `$(DEPENDENCIES` 变量只包含 “前言” 和 “关于本书” 两章,那么 `Makefile` 将会这样调用: ``` @pandoc -s --toc epub-meta.yaml \ @@ -226,18 +227,17 @@ Pandoc 将提取这两章的内容,然后进行组合,最后生成 ePub 格 - HTML 图书: - 使用 Markdown 语法创建每章内容 - 添加元信息 - - 创建一个 Makefile 将各个部分组合在一起 + - 创建一个 `Makefile` 将各个部分组合在一起 - 设置 GitHub Pages - 部署 - ePub 电子书: - 使用之前创建的每一章内容 - 添加新的元信息文件 - - 创建一个 Makefile 以将各个部分组合在一起 + - 创建一个 `Makefile` 以将各个部分组合在一起 - 设置 GitHub Pages - 部署 - ------ via: https://opensource.com/article/18/10/book-to-website-epub-using-pandoc @@ -245,12 +245,12 @@ via: https://opensource.com/article/18/10/book-to-website-epub-using-pandoc 作者:[Kiko Fernandez-Reyes][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[jlztan](https://github.com/jlztan) -校对:[校对者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/kikofernandez -[1]: https://opensource.com/article/18/9/intro-pandoc +[1]: https://linux.cn/article-10228-1.html [2]: https://pandoc.org/ [3]: https://www.programmingfightclub.com/ [4]: https://github.com/kikofernandez/programmingfightclub From a10833e697c1e96921e6337ca5627f99a359a2f2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 18:25:58 +0800 Subject: [PATCH 0514/1143] PUB:20181001 Turn your book into a website and an ePub using Pandoc.md @jlztan https://linux.cn/article-10287-1.html --- ...1001 Turn your book into a website and an ePub using Pandoc.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181001 Turn your book into a website and an ePub using Pandoc.md (100%) diff --git a/translated/tech/20181001 Turn your book into a website and an ePub using Pandoc.md b/published/20181001 Turn your book into a website and an ePub using Pandoc.md similarity index 100% rename from translated/tech/20181001 Turn your book into a website and an ePub using Pandoc.md rename to published/20181001 Turn your book into a website and an ePub using Pandoc.md From 5231fd96edb17b217f6fab7b9e323b7f01fa4eaf Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 28 Nov 2018 20:26:36 +0800 Subject: [PATCH 0515/1143] Update 20181121 How to swap Ctrl and Caps Lock keys in Linux.md --- .../20181121 How to swap Ctrl and Caps Lock keys in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md index da658cb261..c9f24938ff 100644 --- a/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md +++ b/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md @@ -1,3 +1,5 @@ +Translating by jlztan + How to swap Ctrl and Caps Lock keys in Linux ====== Linux desktop environments make it easy to set up your keyboard as you want it. Here's how. From e80817b3dc40939deb7af49d132b0e7fb8828051 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 21:38:25 +0800 Subject: [PATCH 0516/1143] PRF:20181019 What is an SRE and how does it relate to DevOps.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @belitex 翻译的很棒 --- ...t is an SRE and how does it relate to DevOps.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/talk/20181019 What is an SRE and how does it relate to DevOps.md b/translated/talk/20181019 What is an SRE and how does it relate to DevOps.md index 80700d6fb9..03bd773fa7 100644 --- a/translated/talk/20181019 What is an SRE and how does it relate to DevOps.md +++ b/translated/talk/20181019 What is an SRE and how does it relate to DevOps.md @@ -1,15 +1,15 @@ 什么是 SRE?它和 DevOps 是怎么关联的? ===== -大型企业里 SRE 角色比较常见,不过小公司也需要 SRE。 +> 大型企业里 SRE 角色比较常见,不过小公司也需要 SRE。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/toolbox-learn-draw-container-yearbook.png?itok=xDbwz1pP) -虽然站点可靠性工程师(SRE)角色在近几年变得流行起来,但是很多人 —— 甚至是软件行业里的 —— 还不知道 SRE 是什么或者 SRE 都干些什么。为了搞清楚这些问题,这篇文章解释了 SRE 的含义,还有 SRE 怎样关联 DevOps,以及在工程师团队规模不大的组织里 SRE 该如何工作。 +虽然站点可靠性工程师site reliability engineer(SRE)角色在近几年变得流行起来,但是很多人 —— 甚至是软件行业里的 —— 还不知道 SRE 是什么或者 SRE 都干些什么。为了搞清楚这些问题,这篇文章解释了 SRE 的含义,还有 SRE 怎样关联 DevOps,以及在工程师团队规模不大的组织里 SRE 该如何工作。 ### 什么是站点可靠性工程? -谷歌的几个工程师写的《 [SRE:谷歌运维解密][1]》被认为是站点可靠性工程的权威书籍。谷歌的工程副总裁 Ben Treynor Sloss 在二十一世纪初[创造了这个术语][2]。他是这样定义的:“当你让软件工程师设计运维功能时,SRE 就产生了。” +谷歌的几个工程师写的《[SRE:谷歌运维解密][1]》被认为是站点可靠性工程的权威书籍。谷歌的工程副总裁 Ben Treynor Sloss 在二十一世纪初[创造了这个术语][2]。他是这样定义的:“当你让软件工程师设计运维功能时,SRE 就产生了。” 虽然系统管理员从很久之前就在写代码,但是过去的很多时候系统管理团队是手动管理机器的。当时他们管理的机器可能有几十台或者上百台,不过当这个数字涨到了几千甚至几十万的时候,就不能简单的靠人去解决问题了。规模如此大的情况下,很明显应该用代码去管理机器(以及机器上运行的软件)。 @@ -19,13 +19,13 @@ ### SRE 和 DevOps -站点可靠性工程的核心,就是对 DevOps 范例的实践。[DevOps 的定义][3]有很多种方式。开发团队(“devs”)和运维(“ops”)团队相互分离的传统模式下,写代码的团队在服务交付给用户使用之后就不再对服务状态负责了。开发团队“把代码扔到墙那边”让运维团队去部署和支持。 +站点可靠性工程的核心,就是对 DevOps 范例的实践。[DevOps 的定义][3]有很多种方式。开发团队(“dev”)和运维(“ops”)团队相互分离的传统模式下,写代码的团队在将服务交付给用户使用之后就不再对服务状态负责了。开发团队“把代码扔到墙那边”让运维团队去部署和支持。 这种情况会导致大量失衡。开发和运维的目标总是不一致 —— 开发希望用户体验到“最新最棒”的代码,但是运维想要的是变更尽量少的稳定系统。运维是这样假定的,任何变更都可能引发不稳定,而不做任何变更的系统可以一直保持稳定。(减少软件的变更次数并不是避免故障的唯一因素,认识到这一点很重要。例如,虽然你的 web 应用保持不变,但是当用户数量涨到十倍时,服务可能就会以各种方式出问题。) DevOps 理念认为通过合并这两个岗位就能够消灭争论。如果开发团队时刻都想把新代码部署上线,那么他们也必须对新代码引起的故障负责。就像亚马逊的 [Werner Vogels 说的][4]那样,“谁开发,谁运维”(生产环境)。但是开发人员已经有一大堆问题了。他们不断的被推动着去开发老板要的产品功能。再让他们去了解基础设施,包括如何部署、配置还有监控服务,这对他们的要求有点太多了。所以就需要 SRE 了。 -开发一个 web 应用的时候经常是很多人一起参与。有用户界面设计师,图形设计师,前端工程师,后端工程师,还有许多其他工种(视技术选型的具体情况而定)。如何管理写好的代码也是需求之一(例如部署,配置,监控)—— 这是 SRE 的专业领域。但是,就像前端工程师受益于后端领域的知识一样(例如从数据库获取数据的方法),SRE 理解部署系统的工作原理,知道如何满足特定的代码或者项目的具体需求。 +开发一个 web 应用的时候经常是很多人一起参与。有用户界面设计师、图形设计师、前端工程师、后端工程师,还有许多其他工种(视技术选型的具体情况而定)。如何管理写好的代码也是需求之一(例如部署、配置、监控)—— 这是 SRE 的专业领域。但是,就像前端工程师受益于后端领域的知识一样(例如从数据库获取数据的方法),SRE 理解部署系统的工作原理,知道如何满足特定的代码或者项目的具体需求。 所以 SRE 不仅仅是“写代码的运维工程师”。相反,SRE 是开发团队的成员,他们有着不同的技能,特别是在发布部署、配置管理、监控、指标等方面。但是,就像前端工程师必须知道如何从数据库中获取数据一样,SRE 也不是只负责这些领域。为了提供更容易升级、管理和监控的产品,整个团队共同努力。 @@ -37,7 +37,7 @@ DevOps 理念认为通过合并这两个岗位就能够消灭争论。如果开 让开发人员做 SRE 最显著的优点是,团队规模变大的时候也能很好的扩展。而且,开发人员将会全面地了解应用的特性。但是,许多初创公司的基础设施包含了各种各样的 SaaS 产品,这种多样性在基础设施上体现的最明显,因为连基础设施本身也是多种多样。然后你们在某个基础设施上引入指标系统、站点监控、日志分析、容器等等。这些技术解决了一部分问题,也增加了复杂度。开发人员除了要了解应用程序的核心技术(比如开发语言),还要了解上述所有技术和服务。最终,掌握所有的这些技术让人无法承受。 -另一种方案是聘请专家专职做 SRE。他们专注于发布部署、配置管理、监控和指标,可以节省开发人员的时间。这种方案的缺点是,SRE 的时间必须分配给多个不同的应用(就是说 SRE 需要贯穿整个工程部门)。 这可能意味着 SRE 没时间对任何应用深入学习,然而他们可以站在一个能看到服务全貌的高度,知道各个部分是怎么组合在一起的。 这个“ 三万英尺高的视角”可以帮助 SRE 从系统整体上考虑,哪些薄弱环节需要优先修复。 +另一种方案是聘请专家专职做 SRE。他们专注于发布部署、配置管理、监控和指标,可以节省开发人员的时间。这种方案的缺点是,SRE 的时间必须分配给多个不同的应用(就是说 SRE 需要贯穿整个工程部门)。 这可能意味着 SRE 没时间对任何应用深入学习,然而他们可以站在一个能看到服务全貌的高度,知道各个部分是怎么组合在一起的。 这个“三万英尺高的视角”可以帮助 SRE 从系统整体上考虑,哪些薄弱环节需要优先修复。 有一个关键信息我还没提到:其他的工程师。他们可能很渴望了解发布部署的原理,也很想尽全力学会使用指标系统。而且,雇一个 SRE 可不是一件简单的事儿。因为你要找的是一个既懂系统管理又懂软件工程的人。(我之所以明确地说软件工程而不是说“能写代码”,是因为除了写代码之外软件工程还包括很多东西,比如编写良好的测试或文档。) @@ -54,7 +54,7 @@ via: https://opensource.com/article/18/10/sre-startup 作者:[Craig Sebenik][a] 选题:[lujun9972][b] 译者:[BeliteX](https://github.com/belitex) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2c856c59e27e11fa4911d6526be275b02f7ca1ae Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 21:38:47 +0800 Subject: [PATCH 0517/1143] PUB:20181019 What is an SRE and how does it relate to DevOps.md @belitex https://linux.cn/article-10288-1.html --- .../20181019 What is an SRE and how does it relate to DevOps.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20181019 What is an SRE and how does it relate to DevOps.md (100%) diff --git a/translated/talk/20181019 What is an SRE and how does it relate to DevOps.md b/published/20181019 What is an SRE and how does it relate to DevOps.md similarity index 100% rename from translated/talk/20181019 What is an SRE and how does it relate to DevOps.md rename to published/20181019 What is an SRE and how does it relate to DevOps.md From e08a8993b4170e9059029198241e2f96c115bb59 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 21:52:56 +0800 Subject: [PATCH 0518/1143] PRF:20181120 How To Change GDM Login Screen Background In Ubuntu.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @guevaraya 恭喜你完成了第一篇翻译! --- ...e GDM Login Screen Background In Ubuntu.md | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md b/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md index 71d9ec1fc5..90a63ca398 100644 --- a/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md +++ b/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md @@ -1,14 +1,17 @@ -如何更换Ubuntu系统的GDM登录界面背景 +如何更换 Ubuntu 系统的 GDM 登录界面背景 ====== -Ubuntu 18.04 LTS桌面系统在登录,锁屏和解锁状态下,我们会看到一个纯紫色的背景。它是GDM(GNOME Display Manager)从ubuntu 17.04版本开始使用的默认背景。有一些人可能会不喜欢这个纯色的背景,想换一个酷一点,更吸睛的!如果是这样,你找对地方了。这篇简文将会告诉你如何更换Ubuntu 18.04 LTS的GDM登录界面的背景。 -### 更换Ubuntu的登录界面背景 -这是Ubuntu 18.04 LTS桌面系统默认的登录界面 +Ubuntu 18.04 LTS 桌面系统在登录、锁屏和解锁状态下,我们会看到一个纯紫色的背景。它是 GDM(GNOME 显示管理器GNOME Display Manager)从 ubuntu 17.04 版本开始使用的默认背景。有一些人可能会不喜欢这个纯色的背景,想换一个酷一点、更吸睛的!如果是这样,你找对地方了。这篇短文将会告诉你如何更换 Ubuntu 18.04 LTS 的 GDM 登录界面的背景。 + +### 更换 Ubuntu 的登录界面背景 + +这是 Ubuntu 18.04 LTS 桌面系统默认的登录界面。 + ![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-1.png) -不管你喜欢还是不喜欢,你总是会不经意在登录,解屏/锁屏的时面对它。别担心!你可以随便更换一个你喜欢的图片。 +不管你喜欢与否,你总是会不经意在登录、解屏/锁屏的时面对它。别担心!你可以随便更换一个你喜欢的图片。 -在Ubuntu上更换桌面壁纸和用户的资料图像不难。我们可以点击鼠标就搞定了。但更换解屏/锁屏的背景则需要修改文件 **ubuntu.css** 位于 **/usr/share/gnome-shell/theme**。 +在 Ubuntu 上更换桌面壁纸和用户的资料图像不难。我们可以点击鼠标就搞定了。但更换解屏/锁屏的背景则需要修改文件 `ubuntu.css`,它位于 `/usr/share/gnome-shell/theme`。 修改这个文件之前,最好备份一下它。这样我们可以避免出现问题时可以恢复它。 @@ -16,57 +19,57 @@ Ubuntu 18.04 LTS桌面系统在登录,锁屏和解锁状态下,我们会看 $ sudo cp /usr/share/gnome-shell/theme/ubuntu.css /usr/share/gnome-shell/theme/ubuntu.css.bak ``` -修改文件ubuntu.css : +修改文件 `ubuntu.css`: ``` $ sudo nano /usr/share/gnome-shell/theme/ubuntu.css ``` -在文件中找到关键字 **“lockDialogGroup”** ,如下行: +在文件中找到关键字 `lockDialogGroup`,如下行: ``` #lockDialogGroup { - background: #2c001e url(resource:///org/gnome/shell/theme/noise-texture.png); - background-repeat: repeat; + background: #2c001e url(resource:///org/gnome/shell/theme/noise-texture.png); + background-repeat: repeat; } ``` + ![](https://www.ostechnix.com/wp-content/uploads/2018/11/ubuntu_css.png) -可以看到,GDM默认登录的背景图片是 **noise-texture.png** +可以看到,GDM 默认登录的背景图片是 `noise-texture.png`。 -现在修改为你自己的图片路径。也可以选择.jpg或.png格式的文件,两种格式的图片文件都是支持的。修改完成后的文件内容如下: +现在修改为你自己的图片路径。也可以选择 .jpg 或 .png 格式的文件,两种格式的图片文件都是支持的。修改完成后的文件内容如下: ``` #lockDialogGroup { - background: #2c001e url(file:///home/sk/image.png); - background-repeat: no-repeat; - background-size: cover; - background-position: center; + background: #2c001e url(file:///home/sk/image.png); + background-repeat: no-repeat; + background-size: cover; + background-position: center; } ``` -请注意ubuntu.css文件里这个关键字的修改,我把修改点加粗了. +请注意 `ubuntu.css` 文件里这个关键字的修改,我把修改点加粗了。 -你可能注意到,我原来的“… **url(resource:///org/gnome/shell/theme/noise-texture.png);** ” 修改为“ **…url(file:///home/sk/image.png);”**。也就是说,你可以把“… **url(resource** …” 修改为to “… **url(file**..”。 +你可能注意到,我把原来的 `... url(resource:///org/gnome/shell/theme/noise-texture.png);` 修改为 `... url(file:///home/sk/image.png);`。也就是说,你可以把 `... url(resource ...` 修改为 `.. url(file ...`。 -同时,你可以把参数“background-repeat:” 的值 **“repeat”** 修改为 **“no-repeat”** 来增加多行。你可以直接复制上面几行的修改到你的ubuntu.css文件,对应的修改为你的图片路径。 +同时,你可以把参数 `background-repeat:` 的值 `repeat` 修改为 `no-repeat`,并增加另外两行。你可以直接复制上面几行的修改到你的 `ubuntu.css` 文件,对应的修改为你的图片路径。 修改完成后,保存和关闭此文件。然后系统重启生效。 -下面是GDM登录界面的最新背景图片: +下面是 GDM 登录界面的最新背景图片: + ![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-2.png) ![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-3.png) -是不是很酷,你都看到了,更换GDM登录的默认背景很简单。你只需要修改ubuntu.css 文件中图片的路径然后重启系统。是不是很简单也很有意思. +是不是很酷,你都看到了,更换 GDM 登录的默认背景很简单。你只需要修改 `ubuntu.css` 文件中图片的路径然后重启系统。是不是很简单也很有意思. -你可以修改 **/usr/share/gnome-shell/theme** 目录下的文件 **gdm3.css** ,具体修改内容和修改结果和上面一样。同时记得修改前备份要修改的文件。 +你可以修改 `/usr/share/gnome-shell/theme` 目录下的文件 `gdm3.css` ,具体修改内容和修改结果和上面一样。同时记得修改前备份要修改的文件。 就这些了。如果有好的东东再分享了,请大家关注! -后会有期 - - +后会有期。 -------------------------------------------------------------------------------- @@ -75,7 +78,7 @@ via: https://www.ostechnix.com/how-to-change-gdm-login-screen-background-in-ubun 作者:[SK][a] 选题:[lujun9972][b] 译者:[Guevaraya](https://github.com/guevaraya) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6ec2eac76ce4bfb85a60114340eb98b183beae77 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 21:54:52 +0800 Subject: [PATCH 0519/1143] PUB:20181120 How To Change GDM Login Screen Background In Ubuntu.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @guevaraya 本文首发地址: https://linux.cn/article-10289-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/guevaraya 请注册领取您的 LCCN : https://lctt.linux.cn/ --- ...120 How To Change GDM Login Screen Background In Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181120 How To Change GDM Login Screen Background In Ubuntu.md (100%) diff --git a/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md b/published/20181120 How To Change GDM Login Screen Background In Ubuntu.md similarity index 100% rename from translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md rename to published/20181120 How To Change GDM Login Screen Background In Ubuntu.md index 90a63ca398..9fbf743381 100644 --- a/translated/tech/20181120 How To Change GDM Login Screen Background In Ubuntu.md +++ b/published/20181120 How To Change GDM Login Screen Background In Ubuntu.md @@ -1,6 +1,8 @@ 如何更换 Ubuntu 系统的 GDM 登录界面背景 ====== +![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-3.png) + Ubuntu 18.04 LTS 桌面系统在登录、锁屏和解锁状态下,我们会看到一个纯紫色的背景。它是 GDM(GNOME 显示管理器GNOME Display Manager)从 ubuntu 17.04 版本开始使用的默认背景。有一些人可能会不喜欢这个纯色的背景,想换一个酷一点、更吸睛的!如果是这样,你找对地方了。这篇短文将会告诉你如何更换 Ubuntu 18.04 LTS 的 GDM 登录界面的背景。 ### 更换 Ubuntu 的登录界面背景 @@ -61,8 +63,6 @@ $ sudo nano /usr/share/gnome-shell/theme/ubuntu.css ![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-2.png) -![](https://www.ostechnix.com/wp-content/uploads/2018/11/GDM-login-screen-3.png) - 是不是很酷,你都看到了,更换 GDM 登录的默认背景很简单。你只需要修改 `ubuntu.css` 文件中图片的路径然后重启系统。是不是很简单也很有意思. 你可以修改 `/usr/share/gnome-shell/theme` 目录下的文件 `gdm3.css` ,具体修改内容和修改结果和上面一样。同时记得修改前备份要修改的文件。 From d76cd1396578821a8038cc57bbbf9e349bd43fd0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 22:11:14 +0800 Subject: [PATCH 0520/1143] PRF:20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md @geekpi --- ...nting Platform for Open Source Software.md | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/translated/talk/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md b/translated/talk/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md index 3d4c9a2702..d04ccd34c7 100644 --- a/translated/talk/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md +++ b/translated/talk/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md @@ -1,34 +1,35 @@ IssueHunt:一个新的开源软件打赏平台 ====== -许多开源开发者和公司都在努力解决的问题之一就是资金问题。社区中有一种假想,甚至是期望,必须免费提供自由和开源软件。但即使是 FOSS 也需要资金来继续开发。如果我们不建立让软件持续开发的系统,我们怎能期待更高质量的软件? -我们已经写了一篇关于[开源资金平台][1]的文章来试图解决这个缺点,截至今年 7 月,市场上出现了一个新的竞争者,旨在帮助填补这个空白:[IssueHunt][2] 。 +![IssueHunt][4] + +许多开源开发者和公司都在努力解决的问题之一就是资金问题。社区中有一种假想,甚至是期望,必须免费提供自由开源软件(FOSS)。但即使是 FOSS 也需要资金来继续开发。如果我们不建立让软件持续开发的系统,我们怎能期待更高质量的软件? + +我们已经写了一篇关于[开源资金平台][1]的文章来试图解决这个缺点,截至今年 7 月,市场上出现了一个新的竞争者,旨在帮助填补这个空白:[IssueHunt][2]。 ### IssueHunt: 开源软件打赏平台 ![IssueHunt website][3] -IssueHunt 提供了一种服务,支付自由开发者对开源代码的贡献。它通过所谓的赏金来实现:给予解决特定问题的任何人财务奖励。这些奖励的资金来自任何愿意捐赠以修复任何特定 bug 或添加功能的人。 +IssueHunt 提供了一种服务,对自由开发者的开源代码贡献进行支付。它通过所谓的赏金来实现:给予解决特定问题的任何人财务奖励。这些奖励的资金来自任何愿意捐赠以修复任何特定 bug 或添加功能的人。 如果你想修复的某个开源软件存在问题,你可以根据自己选择的方式提供奖励金额。 想要自己的产品被争抢解决么?在 IssueHunt 上向任何解决问题的人提供奖金就好了。就这么简单。 -如果你是程序员,则可以浏览未解决的问题。解决这个问题(如果你可以的话),在 GitHub 存储库上提交 pull request,如果你的 pull request 被合并,那么你就会得到了钱。 +如果你是程序员,则可以浏览未解决的问题。解决这个问题(如果你可以的话),在 GitHub 存储库上提交拉取请求,如果你的拉取请求被合并,那么你就会得到了钱。 #### IssueHunt 最初是 Boostnote 的内部项目 -![IssueHunt][4] - 当笔记应用 [Boostnote][5] 背后的开发人员联系社区为他们的产品做出贡献时,该产品出现了。 在使用 IssueHunt 的前两年,Boostnote 通过数百名贡献者和压倒性的捐款收到了超过 8,400 个 Github star。 该产品非常成功,团队决定将其开放给社区的其他成员。 -今天,[列表中在使用这个服务的项目][6]提供了数千美元的赏金。 +如今,[列表中在使用这个服务的项目][6]提供了数千美元的赏金。 -Boostnote 号称有 [$2,800 的总赏金] [7],而 Settings Sync,以前称为 Visual Studio Code Settings Sync,提供了[超过 $1,600 的赏金][8]。 +Boostnote 号称有 [$2,800 的总赏金][7],而 Settings Sync,以前称为 Visual Studio Code Settings Sync,提供了[超过 $1,600 的赏金][8]。 还有其他服务提供类似于 IssueHunt 在此提供的内容。也许最引人注目的是 [Bountysource][9],它提供与 IssueHunt 类似的赏金服务,同时还提供类似于 [Librepay][10] 的订阅支付处理。 @@ -36,7 +37,7 @@ Boostnote 号称有 [$2,800 的总赏金] [7],而 Settings Sync,以前称为 在撰写本文时,IssueHunt 还处于起步阶段,但我非常高兴看到这个项目在这些年里的成果。 -我不了解你,但我非常乐意为 FOSS 付款。如果产品质量高,并为我的生活增添价值,那么我很乐意向开发者支付产品费用。特别是 FOSS 的开发者正在创造尊重我自由的产品。 +我不知道你会怎么看,但我非常乐意为 FOSS 付款。如果产品质量高,并为我的生活增添价值,那么我很乐意向开发者支付产品费用。特别是 FOSS 的开发者正在创造尊重我自由的产品。 话虽如此,我一定会关注 IssueHunt 的继续前进,我可以用自己的钱或者在需要贡献的地方传播这个它来支持社区。 @@ -49,15 +50,15 @@ via: https://itsfoss.com/issuehunt/ 作者:[Phillip Prado][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/phillip/ [1]: https://itsfoss.com/open-source-funding-platforms/ [2]: https://issuehunt.io -[3]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/issuehunt-website.png -[4]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/09/issuehunt.jpg +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/09/issuehunt-website.png?w=799&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/09/issuehunt.jpg?w=800&ssl=1 [5]: https://itsfoss.com/boostnote-linux-review/ [6]: https://issuehunt.io/repos [7]: https://issuehunt.io/repos/53266139 From 801128950a1cb99f6e7e0859ed9b7abeffa509e7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 28 Nov 2018 22:11:36 +0800 Subject: [PATCH 0521/1143] PUB:20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md @geekpi https://linux.cn/article-10290-1.html --- ...unt- A New Bounty Hunting Platform for Open Source Software.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md (100%) diff --git a/translated/talk/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md b/published/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md similarity index 100% rename from translated/talk/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md rename to published/20180921 IssueHunt- A New Bounty Hunting Platform for Open Source Software.md From 29d1e44c56f9f11feb19caf806f3a4cae230daa5 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Wed, 28 Nov 2018 22:59:41 +0800 Subject: [PATCH 0522/1143] Update 20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译 --- ...rsonal Email setup - Notmuch, mbsync, postfix and dovecot.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md index 2eabd299d7..b239209c1b 100644 --- a/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md +++ b/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @@ -1,3 +1,5 @@ +translating by lixinyuxx + My personal Email setup - Notmuch, mbsync, postfix and dovecot ====== I've been using personal email setup for quite long and have not documented it anywhere. Recently when I changed my laptop (a post is pending about it) I got lost trying to recreate my local mail setup. So this post is a self documentation so that I don't have to struggle again to get it right. From dc3e2893b39f4225278dd31ba8355000cd272c33 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Wed, 28 Nov 2018 23:03:56 +0800 Subject: [PATCH 0523/1143] Update 20180101 27 open solutions to everything in education.md --- .../20180101 27 open solutions to everything in education.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180101 27 open solutions to everything in education.md b/sources/tech/20180101 27 open solutions to everything in education.md index ccf7cea523..eeba3692e4 100644 --- a/sources/tech/20180101 27 open solutions to everything in education.md +++ b/sources/tech/20180101 27 open solutions to everything in education.md @@ -1,3 +1,5 @@ +translating by lixinyuxx + 27 open solutions to everything in education ====== ![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo) From cf36ddcdb625193d01a821ee8504f9971d14db29 Mon Sep 17 00:00:00 2001 From: chenxinlong Date: Thu, 29 Nov 2018 00:29:25 +0800 Subject: [PATCH 0524/1143] translating --- ...0181124 How To Configure IP Address In Ubuntu 18.04 LTS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md b/sources/tech/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md index 61d10fdba9..b1ba4ebd97 100644 --- a/sources/tech/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md +++ b/sources/tech/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chenxinlong) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (How To Configure IP Address In Ubuntu 18.04 LTS) @@ -7,6 +7,8 @@ [#]: author: (SK https://www.ostechnix.com/author/sk/) [#]: url: ( ) +翻译中 ... + How To Configure IP Address In Ubuntu 18.04 LTS ====== From a0acd4811464543f62a33e1263d0d9d17e2363da Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Wed, 28 Nov 2018 17:00:18 +0000 Subject: [PATCH 0525/1143] Revert "translating by Flowsnow" This reverts commit 929a0eb9cc60cd9f4cd307962bb54b24afe982f3. --- sources/tech/20180725 Build an interactive CLI with Node.js.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/tech/20180725 Build an interactive CLI with Node.js.md b/sources/tech/20180725 Build an interactive CLI with Node.js.md index f240e51efd..6ec13f1cfc 100644 --- a/sources/tech/20180725 Build an interactive CLI with Node.js.md +++ b/sources/tech/20180725 Build an interactive CLI with Node.js.md @@ -1,5 +1,3 @@ -translating by Flowsnow - Build an interactive CLI with Node.js ====== From 42c0159af34928ec769e53a98430d0f0f00e987e Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 29 Nov 2018 08:31:05 +0800 Subject: [PATCH 0526/1143] =?UTF-8?q?=E6=B7=BB=E5=8A=A0metadata=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 选题模板.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/选题模板.txt b/选题模板.txt index a7cd92e614..918dd4025e 100644 --- a/选题模板.txt +++ b/选题模板.txt @@ -4,6 +4,14 @@ 正文内容: + [#]: collector: (选题人github id) + [#]: translator: (译者github id) + [#]: reviewer: (校对人github id) + [#]: publisher: (发布人github id) + [#]: subject: (标题) + [#]: via: (原文地址) + [#]: author: ([作者名](作者介绍地址)) + [#]: url: (译文发布地址) 标题 ======= From b60472ed8b130a4b5fbc30f1b95e183dda21817f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 29 Nov 2018 08:43:22 +0800 Subject: [PATCH 0527/1143] =?UTF-8?q?Update=20=E9=80=89=E9=A2=98=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 选题模板.txt | 100 +++++++++++++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 43 deletions(-) diff --git a/选题模板.txt b/选题模板.txt index 918dd4025e..4515fe78ab 100644 --- a/选题模板.txt +++ b/选题模板.txt @@ -1,51 +1,65 @@ -选题标题格式: +选题标题格式: - 原文日期 标题.md +``` +原文日期 标题.md +``` -正文内容: +其中: - [#]: collector: (选题人github id) - [#]: translator: (译者github id) - [#]: reviewer: (校对人github id) - [#]: publisher: (发布人github id) - [#]: subject: (标题) - [#]: via: (原文地址) - [#]: author: ([作者名](作者介绍地址)) - [#]: url: (译文发布地址) - 标题 - ======= - - ### 子一级标题 - - 正文 - - #### 子二级标题 - - 正文内容 - - ![](图片地址) - - ### 子一级标题 - - 正文内容 : I have a [dream][1]。 +- 原文日期为该文章发表时的日期,采用 8 位数字表示 +- 标题需去除特殊字符,使用 `_` 替换。 - -------------------------------------------------------------------------------- - - via: 原文地址 - - 作者:[作者名][a] - 译者:[译者ID](https://github.com/译者ID) - 校对:[校对者ID](https://github.com/校对者ID) - - 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - - [a]: 作者介绍地址 - [1]: 引文链接地址 +正文内容: -说明: -1. 标题层级很多时从 “##” 开始 -2. 引文链接地址在下方集中写 +``` +[#]: collector: (选题人 GitHub ID) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (文章标题) +[#]: via: (原文 URL) +[#]: author: (作者名 作者链接 URL) +[#]: url: ( ) + +标题 +======= + +### 子一级标题 + +正文 + +#### 子二级标题 + +正文内容 + +![][1] + +### 子一级标题 + +正文内容 : I have a [dream][2]。 + +-------------------------------------------------------------------------------- + +via: 原文 链接 URL + +作者:[作者名][a] +译者:[选题 ID][b] +译者:[译者 ID](https://github.com/译者 ID) +校对:[校对 ID](https://github.com/校对 ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: 作者链接 URL +[b]: 选题链接 URL +[1]: 图片链接地址 +[2]: 文内链接地址 +``` + +说明: + +1. 标题层级很多时从 `##` 开始 +2. 图片链接和引文链接地址在下方集中写 3. 因为 Windows 系统文件名有限制,所以文章名不要有特殊符号,如 `\/:*"<>|`,同时也不推荐全大写,或者其它不利阅读的格式 4. 正文格式参照中文排版指北(https://github.com/LCTT/TranslateProject/blob/master/%E4%B8%AD%E6%96%87%E6%8E%92%E7%89%88%E6%8C%87%E5%8C%97.md) -5. 我们使用的 markdown 语法和 github 一致,具体语法可参见 https://github.com/guodongxiaren/README 。而实际中使用的都是基本语法,比如链接、包含图片、标题、列表、字体控制和代码高亮。 +5. 我们使用的 markdown 语法和 GitHub 一致。而实际中使用的都是基本语法,比如链接、包含图片、标题、列表、字体控制和代码高亮。 6. 选题的内容分为两类: 干货和湿货。干货就是技术文章,比如针对某种技术、工具的介绍、讲解和讨论。湿货则是和技术、开发、计算机文化有关的文章。选题时主要就是根据这两条来选择文章,文章需要对大家有益处,篇幅不宜太短,可以是系列文章,也可以是长篇大论,但是文章要有内容,不能有严重的错误,最好不要选择已经有翻译的原文。 From 128304c82cf7086e231fe7d431e58c3c17ac3f30 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 29 Nov 2018 08:46:07 +0800 Subject: [PATCH 0528/1143] translated --- ...ent Wallpaper for Each Monitor in Linux.md | 91 ------------------- ...ent Wallpaper for Each Monitor in Linux.md | 89 ++++++++++++++++++ 2 files changed, 89 insertions(+), 91 deletions(-) delete mode 100644 sources/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md create mode 100644 translated/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md diff --git a/sources/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md b/sources/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md deleted file mode 100644 index d9c4498c24..0000000000 --- a/sources/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md +++ /dev/null @@ -1,91 +0,0 @@ -translating----geekpi - -How to Set Different Wallpaper for Each Monitor in Linux -====== -**Brief: If you want to display different wallpapers on multiple monitors on Ubuntu 18.04 or any other Linux distribution with GNOME, MATE or Budgie desktop environment, this nifty tool will help you achieve this.** - -Multi-monitor setup often leads to multiple issues on Linux but I am not going to discuss those issues in this article. I have rather a positive article on multiple monitor support on Linux. - -If you are using multiple monitor, perhaps you would like to setup a different wallpaper for each monitor. I am not sure about other Linux distributions and desktop environments, but Ubuntu with [GNOME desktop][1] doesn’t provide this functionality on its own. - -Fret not! In this quick tutorial, I’ll show you how to set a different wallpaper for each monitor on Linux distributions with GNOME desktop environment. - -### Setting up different wallpaper for each monitor on Ubuntu 18.04 and other Linux distributions - -![Different wallaper on each monitor in Ubuntu][2] - -I am going to use a nifty tool called [HydraPaper][3] for setting different backgrounds on different monitors. HydraPaper is a [GTK][4] based application to set different backgrounds for each monitor in [GNOME desktop environment][5]. - -It also supports on [MATE][6] and [Budgie][7] desktop environments. Which means Ubuntu MATE and [Ubuntu Budgie][8] users can also benefit from this application. - -#### Install HydraPaper on Linux using FlatPak - -HydraPaper can be installed easily using [FlatPak][9]. Ubuntu 18.04 already provides support for FlatPaks so all you need to do is to download the application file and double click on it to open it with the GNOME Software Center. - -You can refer to this article to learn [how to enable FlatPak support][10] on your distribution. Once you have the FlatPak support enabled, just download it from [FlatHub][11] and install it. - -[Download HydraPaper][12] - -#### Using HydraPaper for setting different background on different monitors - -Once installed, just look for HydraPaper in application menu and start the application. You’ll see images from your Pictures folder here because by default the application takes images from the Pictures folder of the user. - -You can add your own folder(s) where you keep your wallpapers. Do note that it doesn’t find images recursively. If you have nested folders, it will only show images from the top folder. - -![Setting up different wallpaper for each monitor on Linux][13] - -Using HydraPaper is absolutely simple. Just select the wallpapers for each monitor and click on the apply button at the top. You can easily identify external monitor(s) termed with HDMI. - -![Setting up different wallpaper for each monitor on Linux][14] - -You can also add selected wallpapers to ‘Favorites’ for quick access. Doing this will move the ‘favorite wallpapers’ from Wallpapers tab to Favorites tab. - -![Setting up different wallpaper for each monitor on Linux][15] - -You don’t need to start HydraPaper at each boot. Once you set different wallpaper for different monitor, the settings are saved and you’ll see your chosen wallpapers even after restart. This would be expected behavior of course but I thought I would mention the obvious. - -One big downside of HydraPaper is in the way it is designed to work. You see, HydraPaper combines your selected wallpapers into one single image and stretches it across the screens giving an impression of having different background on each display. And this becomes an issue when you remove the external display. - -For example, when I tried using my laptop without the external display, it showed me an background image like this. - -![Dual Monitor wallpaper HydraPaper][16] - -Quite obviously, this is not what I would expect. - -#### Did you like it? - -HydraPaper makes setting up different backgrounds on different monitors a painless task. It supports more than two monitors and monitors with different orientation. Simple interface with only the required features makes it an ideal application for those who always use dual monitors. - -How do you set different wallpaper for different monitor on Linux? Do you think HydraPaper is an application worth installing? - -Do share your views and if you find this article, please share it on various social media channels such as Twitter and [Reddit][17]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/wallpaper-multi-monitor/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[1]:https://www.gnome.org/ -[2]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/multi-monitor-wallpaper-setup-800x450.jpeg -[3]:https://github.com/GabMus/HydraPaper -[4]:https://www.gtk.org/ -[5]:https://itsfoss.com/gnome-tricks-ubuntu/ -[6]:https://mate-desktop.org/ -[7]:https://budgie-desktop.org/home/ -[8]:https://itsfoss.com/ubuntu-budgie-18-review/ -[9]:https://flatpak.org -[10]:https://flatpak.org/setup/ -[11]:https://flathub.org -[12]:https://flathub.org/apps/details/org.gabmus.hydrapaper -[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/different-wallpaper-each-monitor-hydrapaper-2-800x631.jpeg -[14]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/different-wallpaper-each-monitor-hydrapaper-1.jpeg -[15]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/different-wallpaper-each-monitor-hydrapaper-3.jpeg -[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/hydra-paper-dual-monitor-800x450.jpeg -[17]:https://www.reddit.com/r/LinuxUsersGroup/ diff --git a/translated/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md b/translated/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md new file mode 100644 index 0000000000..b0b698b764 --- /dev/null +++ b/translated/tech/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md @@ -0,0 +1,89 @@ +如何在 Linux 中为每个屏幕设置不同的壁纸 +====== +**简介:如果你想在 Ubuntu 18.04 或任何其他 Linux 发行版上使用 GNOME、MATE 或 Budgie 桌面环境在多个显示器上显示不同的壁纸,这个小工具将帮助你实现这一点。** + +多显示器设置通常会在 Linux 上出现多个问题,但我不打算在本文中讨论这些问题。我有一篇关于 Linux 上多显示器支持的文章。 + +如果你使用多台显示器,也许你想为每台显示器设置不同的壁纸。我不确定其他 Linux 发行版和桌面环境,但是 [GNOME 桌面][1] 的 Ubuntu 本身并不提供此功能。 + +不要烦恼!在本教程中,我将向你展示如何使用 GNOME 桌面环境为 Linux 发行版上的每个显示器设置不同的壁纸。 + +### 在 Ubuntu 18.04 和其他 Linux 发行版上为每个显示器设置不同的壁纸 + +![Different wallaper on each monitor in Ubuntu][2] + +我将使用一个名为 [HydraPaper][3] 的小工具在不同的显示器上设置不同的背景。HydraPaper 是一个基于 [GTK][4] 的应用,用于为 [GNOME 桌面环境][5]中的每个显示器设置不同的背景。 + +它还支持 [MATE][6] 和 [Budgie][7] 桌面环境。这意味着 Ubuntu MATE 和 [Ubuntu Budgie][8] 用户也可以从这个应用中受益。 + +#### 使用 FlatPak 在 Linux 上安装 HydraPaper + +使用 [FlatPak][9] 可以轻松安装 HydraPaper。Ubuntu 18.04已 经提供对 FlatPaks 的支持,所以你需要做的就是下载应用文件并双击在 GNOME 软件中心中打开它。 + +你可以参考这篇文章来了解如何在你的发行版[启用 FlatPak 支持][10]。启用 FlatPak 支持后,只需从 [FlatHub][11] 下载并安装即可。 + +[Download HydraPaper][12] + +#### 使用 HydraPaper 在不同的显示器上设置不同的背景 + +安装完成后,只需在应用菜单中查找 HydraPaper 并启动应用。你将在此处看到“图片”文件夹中的图像,因为默认情况下,应用会从用户的“图片”文件夹中获取图像。 + +你可以添加自己的文件夹来保存壁纸。请注意,它不会递归地查找图像。如果你有嵌套文件夹,它将只显示顶部文件夹中的图像。 + +![Setting up different wallpaper for each monitor on Linux][13] + +使用 HydraPaper 很简单。只需为每个显示器选择壁纸,然后单击顶部的应用按钮。你可以轻松地用 HDMI 标识来识别外部显示器。 + +![Setting up different wallpaper for each monitor on Linux][14] + +你还可以将选定的壁纸添加到“收藏夹”以便快速访问。这样做会将“最喜欢的壁纸”从“壁纸”选项卡移动到“收藏夹”选项卡。 + +![Setting up different wallpaper for each monitor on Linux][15] + +你不需要在每次启动时启动 HydraPaper。为不同的显示器设置不同的壁纸后,设置将被保存,即使重新启动后你也会看到所选择的壁纸。这当然是预期的行为,但我想特别提一下。 + +HydraPaper 的一大缺点在于它的设计工作方式。你可以看到,HydraPaper 将你选择的壁纸拼接成一张图像并将其拉伸到屏幕上,给人的印象是每个显示器上都有不同的背景。当你移除外部显示器时,这将成为一个问题。 + +例如,当我尝试使用没有外接显示器的笔记本电脑时,它向我展示了这样的背景图像。 + +![Dual Monitor wallpaper HydraPaper][16] + +很明显,这不是我所期望的。 + +#### 你喜欢它吗? + +HydraPaper 使得在不同的显示器上设置不同的背景变得很方便。它支持超过两个显示器和不同的显示器方向。只有所需功能的简单界面使其成为那些总是使用双显示器的人的理想应用。 + +如何在 Linux 上为不同的显示器设置不同的壁纸?你认为 HydraPaper 是值得安装的应用吗? + +请分享您的观点,另外如果你看到这篇文章,请在各种社交媒体渠道上分享,如 Twitter 和 [Reddit][17]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/wallpaper-multi-monitor/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[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/ +[1]:https://www.gnome.org/ +[2]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/multi-monitor-wallpaper-setup-800x450.jpeg +[3]:https://github.com/GabMus/HydraPaper +[4]:https://www.gtk.org/ +[5]:https://itsfoss.com/gnome-tricks-ubuntu/ +[6]:https://mate-desktop.org/ +[7]:https://budgie-desktop.org/home/ +[8]:https://itsfoss.com/ubuntu-budgie-18-review/ +[9]:https://flatpak.org +[10]:https://flatpak.org/setup/ +[11]:https://flathub.org +[12]:https://flathub.org/apps/details/org.gabmus.hydrapaper +[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/different-wallpaper-each-monitor-hydrapaper-2-800x631.jpeg +[14]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/different-wallpaper-each-monitor-hydrapaper-1.jpeg +[15]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/different-wallpaper-each-monitor-hydrapaper-3.jpeg +[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/05/hydra-paper-dual-monitor-800x450.jpeg +[17]:https://www.reddit.com/r/LinuxUsersGroup/ \ No newline at end of file From 8e26b8f937b9f4b9df8ae6ead43df6c21f8f61dd Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 29 Nov 2018 08:56:51 +0800 Subject: [PATCH 0529/1143] translating --- ...181112 A Free Guide for Setting Your Open Source Strategy.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md b/sources/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md index 2e2444287a..c0767c73ab 100644 --- a/sources/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md +++ b/sources/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md @@ -1,3 +1,5 @@ +translating---geekpi + A Free Guide for Setting Your Open Source Strategy ====== From 78abe8a55b6226c70df1581fed94e6b4c7393768 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Thu, 29 Nov 2018 10:15:49 +0800 Subject: [PATCH 0530/1143] heguangzhi translating --- ...multiple programming languages without losing your mind.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/talk/20181126 How to use multiple programming languages without losing your mind.md b/sources/talk/20181126 How to use multiple programming languages without losing your mind.md index 008c976f5b..2621d944ec 100644 --- a/sources/talk/20181126 How to use multiple programming languages without losing your mind.md +++ b/sources/talk/20181126 How to use multiple programming languages without losing your mind.md @@ -1,3 +1,5 @@ +heguangzhi Translating + [#]: collector: (lujun9972) [#]: translator: ( ) [#]: reviewer: ( ) @@ -63,7 +65,7 @@ via: https://opensource.com/article/18/11/multiple-programming-languages 作者:[Bart Copeland][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 04280de75060290bd08050425d1c0bc38594a697 Mon Sep 17 00:00:00 2001 From: guevaraya Date: Thu, 29 Nov 2018 10:32:20 +0800 Subject: [PATCH 0531/1143] Translating by Guevaraya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译此文章 --- .../20180226 -Getting to Done- on the Linux command line.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180226 -Getting to Done- on the Linux command line.md b/sources/tech/20180226 -Getting to Done- on the Linux command line.md index c325a0d884..321a3e3002 100644 --- a/sources/tech/20180226 -Getting to Done- on the Linux command line.md +++ b/sources/tech/20180226 -Getting to Done- on the Linux command line.md @@ -1,3 +1,5 @@ +Translating by Guevaraya + 'Getting to Done' on the Linux command line ====== From 30fab6c0b27e0192058e3b66baa37ff07a86b69e Mon Sep 17 00:00:00 2001 From: Yuqi Liu Date: Thu, 29 Nov 2018 11:04:50 +0800 Subject: [PATCH 0532/1143] Update 20180227 Emacs -1- Ditching a bunch of stuff and moving to Emacs and org-mode.md --- ...itching a bunch of stuff and moving to Emacs and org-mode.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20180227 Emacs -1- Ditching a bunch of stuff and moving to Emacs and org-mode.md b/sources/talk/20180227 Emacs -1- Ditching a bunch of stuff and moving to Emacs and org-mode.md index 501ba538b6..4227a0db28 100644 --- a/sources/talk/20180227 Emacs -1- Ditching a bunch of stuff and moving to Emacs and org-mode.md +++ b/sources/talk/20180227 Emacs -1- Ditching a bunch of stuff and moving to Emacs and org-mode.md @@ -1,3 +1,5 @@ +[#]: translator: (oneforalone) + Emacs #1: Ditching a bunch of stuff and moving to Emacs and org-mode ====== I’ll admit it. After over a decade of vim, I’m hooked on [Emacs][1]. From f9827ddd633e793b052c1cd234f339f374448358 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 29 Nov 2018 12:53:28 +0800 Subject: [PATCH 0533/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Easily=20Fund?= =?UTF-8?q?=20Open=20Source=20Projects=20With=20These=20Platforms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...en Source Projects With These Platforms.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/talk/20180320 Easily Fund Open Source Projects With These Platforms.md diff --git a/sources/talk/20180320 Easily Fund Open Source Projects With These Platforms.md b/sources/talk/20180320 Easily Fund Open Source Projects With These Platforms.md new file mode 100644 index 0000000000..8c02ca228b --- /dev/null +++ b/sources/talk/20180320 Easily Fund Open Source Projects With These Platforms.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Easily Fund Open Source Projects With These Platforms) +[#]: via: (https://itsfoss.com/open-source-funding-platforms/) +[#]: author: ([Ambarish Kumar](https://itsfoss.com/author/ambarish/)) +[#]: url: ( ) + +Easily Fund Open Source Projects With These Platforms +====== + +**Brief: We list out some funding platforms you can use to financially support open source projects. ** + +Financial support is one of the many ways to [help Linux and Open Source community][1]. This is why you see “Donate” option on the websites of most open source projects. + +While the big corporations have the necessary funding and resources, most open source projects are developed by individuals in their spare time. However, it does require one’s efforts, time and probably includes some overhead costs too. Monetary supports surely help drive the project development. + +If you would like to support open source projects financially, let me show you some platforms dedicated to open source and/or Linux. + +### Funding platforms for Open Source projects + +![Open Source funding platforms][2] + +Just to clarify, we are not associated with any of the funding platforms mentioned here. + +#### 1\. Liberapay + +[Gratipay][3] was probably the biggest platform for funding open source projects and people associated with the project, which got shut down at the end of the year 2017. However, there’s a fork – Liberapay that works as a recurrent donation platform for the open source projects and the contributors. + +[Liberapay][4] is a non-profit, open source organization that helps in a periodic donation to a project. You can create an account as a contributor and ask the people who would really like to help (usually the consumer of your products) to donate. + +To receive a donation, you will have to create an account on Liberapay, brief what you do and about your project, reasons for asking for the donation and what will be done with the money you receive. + +For someone who would like to donate, they would have to add money to their accounts and set up a period for payment that can be weekly, monthly or yearly to someone. There’s a mail triggered when there is not much left to donate. + +The currency supported are dollars and Euro as of now and you can always put up a badge on Github, your Twitter profile or website for a donation. + +#### 2\. Bountysource + +[Bountysource][5] is a funding platform for open source software that has a unique way of paying a developer for his time and work int he name of Bounties. + +There are basically two campaigns, bounties and salt campaign. + +Under the Bounties, users declare bounties aka cash prizes on open issues that they believe should be fixed or any new features which they want to see in the software they are using. A developer can then go and fix it to receive the cash prize. + +Salt Campaign is like any other funding, anyone can pay a recurring amount to a project or an individual working for an open source project for as long as they want. + +Bountysource accepts any software that is approved by Free Software Foundation or Open Source Initiatives. The bounties can be placed using PayPal, Bitcoin or the bounty itself if owned previously. Bountysource supports a no. of issue tracker currently like GitHub, Bugzilla, Google Code, Jira, Launchpad etc. + +#### 3\. Open Collective + +[Open Collective][6] is another popular funding initiative where a person who is willing to receive the donation for the work he is doing in Open Source world can create a page. He can submit the expense reports for the project he is working on. A contributor can add money to his account and pay him for his expenses. + +The complete process is transparent and everyone can track whoever is associated with Open Collective. The contributions are visible along with the unpaid expenses. There is also the option to contribute on a recurring basis. + +Open Collective currently has more than 500 collectives being backed up by more than 5000 users. + +The fact that it is transparent and you know what you are contributing to, drives more accountability. Some common example of collective include hosting costs, community maintenance, travel expenses etc. + +Though Open Collective keeps 10% of all the transactions, it is still a nice way to get your expenses covered in the process of contributing towards an open source project. + +#### 4\. Open Source Grants + +[Open Source Grants][7] is still in its beta stage and has not matured yet. They are looking for projects that do not have any stable funding and adds value to open source community. Most open source projects are run by a small community in a free time and they are trying to fund them so that the developers can work full time on the projects. + +They are equally searching for companies that want to help open source enthusiasts. The process of submitting a project is still being worked upon, and hopefully, in coming days we will see a working way of funding. + +### Final Words + +In the end, I would also like to mention [Patreon][8]. This funding platform is not exclusive to open source but is focused on creators of all kinds. Some projects like [elementary OS have created their accounts on Patreon][9] so that you can support the project on a recurring basis. + +Think Free Speech, not Free Beer. Your small contribution to a project can help it sustain in the long run. For the developers, the above platform can provide a good way to cover up their expenses. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-source-funding-platforms/ + +作者:[Ambarish 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/ambarish/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/help-linux-grow/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/03/Fund-Open-Source-projects.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/gratipay-open-source/ +[4]: https://liberapay.com/ +[5]: https://www.bountysource.com/ +[6]: https://opencollective.com/ +[7]: https://foundation.travis-ci.org/grants/ +[8]: https://www.patreon.com/ +[9]: https://www.patreon.com/elementary From 94f03125384537a0c7e78473a5bc1597159be404 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 29 Nov 2018 12:57:29 +0800 Subject: [PATCH 0534/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Turn=20an=20old?= =?UTF-8?q?=20Linux=20desktop=20into=20a=20home=20media=20center?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Linux desktop into a home media center.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20181128 Turn an old Linux desktop into a home media center.md diff --git a/sources/tech/20181128 Turn an old Linux desktop into a home media center.md b/sources/tech/20181128 Turn an old Linux desktop into a home media center.md new file mode 100644 index 0000000000..f87750b513 --- /dev/null +++ b/sources/tech/20181128 Turn an old Linux desktop into a home media center.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Turn an old Linux desktop into a home media center) +[#]: via: (https://opensource.com/article/18/11/old-linux-desktop-new-home-media-center) +[#]: author: ([Alan Formy-Duval](https://opensource.com/users/alanfdoss)) +[#]: url: ( ) + +Turn an old Linux desktop into a home media center +====== +Repurpose an outdated computer to browse the internet and watch videos on your big screen TV. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/migration_innovation_computer_software.png?itok=VCFLtd0q) + +My first attempt to set up an "entertainment PC" was back in the late 1990s, using a plain old desktop computer with a Trident ProVidia 9685 PCI graphics card. I used what was known as a "TV-out" card, which had an extra output to connect to a standard television set. The onscreen result didn't look very nice and there was no audio output. And it was ugly: I had an S-Video cable running across my living room floor to my 19" Sony Trinitron CRT TV set. + +I had the same sad result from Linux and Windows 98. After struggling with systems that never looked right, I gave up for a few years. Thankfully, today we have HDMI with its vastly better performance and standardized resolution, which makes an inexpensive home media center a reality. + +My new media center entertainment computer is actually my old Ubuntu Linux desktop, which I recently replaced with something faster. The computer became too slow for work, but its AMD Phenom II X4 965 processor at 3.4GHz and 8GB of RAM are good enough for general browsing and video streaming. + +Here are the steps I took to get the best possible performance out of this old system for its new role. + +### Hardware + +First, I removed unnecessary devices including a card reader, hard drives, DVD drive, and a rear-mounted USB card, and I added a PCI-Express WiFi card. I installed Ubuntu to a single solid-state drive (SSD), which can really improve the performance of any older system. + +### BIOS + +In the BIOS, I disabled all unused devices, such as floppy and IDE drive controllers. I disabled onboard video because I installed an NVidia GeForce GTX 650 PCI Express graphics card with an HDMI output. I also disabled onboard audio because the NVidia graphics card chipset provides audio. + +### Audio + +The Nvidia GeForce GTX audio device is listed in the GNOME Control Center's sound settings as a GK107 HDMI Audio Controller, so a single HDMI cable handles both audio and video. There's no need for an audio cable connected to the onboard audio output jack. + +![Sound settings screenshot][2] + +HDMI audio controller shown in GNOME sound settings. + +### Keyboard and mouse + +I have a wireless keyboard and mouse, both from Logitech. When I installed them, I plugged in both peripherals' USB receivers; they worked, but I often had signal-response problems. Then I discovered one was labeled a Unifying Receiver, which meant it can handle multiple Logitech input devices on its own. Logitech doesn't provide software to configure Unifying Receivers in Linux; fortunately, the open source utility [Solaar][3] does. Using a single receiver solved my input performance issues. + +![Solaar][5] + +Solaar Unifying Receiver interface. + +### Video + +It was initially hard to read fonts on my 47" flat-panel TV, so I enabled "Large Text" under Universal Access. I downloaded some wallpapers matching the TV's 1920x1080 resolution that look fantastic! + +### Final touches + +I needed to balance the computer's cooling needs with my desire for unimpeded entertainment. Since this is a standard ATX mini-tower computer, I made sure I had just enough fans with carefully configured temperature settings in the BIOS to reduce fan noise. I also placed the computer behind my entertainment console to further block fan noise but positioned so I can reach the power button. + +The result is a simple machine that is not overly loud and uses only two cables—AC power and HDMI. It should be able to run any mainstream or specialized media center Linux distribution. I don't expect to do too much high-end gaming because that may require more processing horsepower. + +![Showing Ubuntu Linux About page onscreen][7] + +Ubuntu Linux About page. + +![YouTube on the big screen][9] + +Testing a YouTube video on the big screen. + +I haven't yet installed a dedicated media center distribution of Linux like [Kodi][10]. For now, it is running Ubuntu Linux 18.04.1 LTS and is very stable. + +This was a fun challenge to make the best of what I already had rather than buying new hardware. This is just one benefit of open source software. Eventually, I will probably replace it with a smaller, quieter system with a media-center case or another small box, but for now, it meets my needs quite well. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/old-linux-desktop-new-home-media-center + +作者:[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 +[2]: https://opensource.com/sites/default/files/uploads/soundsettings.png (Sound settings screenshot) +[3]: https://pwr.github.io/Solaar/ +[5]: https://opensource.com/sites/default/files/uploads/solaar_interface.png (Solaar) +[7]: https://opensource.com/sites/default/files/uploads/finalresult1.png (Showing Ubuntu Linux About page onscreen) +[9]: https://opensource.com/sites/default/files/uploads/finalresult2.png (YouTube on the big screen) +[10]: https://kodi.tv/ From 1786f5ee925422a610b16c8433265d6d9a3f8d6d Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 29 Nov 2018 12:59:50 +0800 Subject: [PATCH 0535/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Building=20cust?= =?UTF-8?q?om=20documentation=20workflows=20with=20Sphinx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tom documentation workflows with Sphinx.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20181128 Building custom documentation workflows with Sphinx.md diff --git a/sources/tech/20181128 Building custom documentation workflows with Sphinx.md b/sources/tech/20181128 Building custom documentation workflows with Sphinx.md new file mode 100644 index 0000000000..7d9137fa40 --- /dev/null +++ b/sources/tech/20181128 Building custom documentation workflows with Sphinx.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Building custom documentation workflows with Sphinx) +[#]: via: (https://opensource.com/article/18/11/building-custom-workflows-sphinx) +[#]: author: ([Mark Meyer](https://opensource.com/users/ofosos)) +[#]: url: ( ) + +Building custom documentation workflows with Sphinx +====== +Create documentation the way that works best for you. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S) + +[Sphinx][1] is a popular application for creating documentation, similar to JavaDoc or Jekyll. However, Sphinx's reStructured Text input allows for a higher degree of customization than those other tools. + +This tutorial will explain how to customize Sphinx to suit your workflow. You can follow along using sample code on [GitHub][2]. + +### Some definitions + +Sphinx goes far beyond just enabling you to style text with predefined tags. It allows you to shape and automate your documentation by defining new roles and directives. A role is a single word element that usually is rendered inline in your documentation, while a directive can contain more complex content. These can be contained in a domain. + +A Sphinx domain is a collection of directives and roles as well as a few other things, such as an index definition. Your next Sphinx domain could be a specific programming language (Sphinx was developed to create Python's documentation). Or you might have a command line tool that implements the same command pattern (e.g., **tool \--args**) over and over. You can document it with a custom domain, adding directives and indexes along the way. + +Here's an example from our **recipe** domain: + +``` +The recipe contains `tomato` and `cilantro`. + +.. rcp:recipe:: TomatoSoup +  :contains: tomato cilantro salt pepper   + +  This recipe is a tasty tomato soup, combine all ingredients +  and cook. +``` + +Now that we've defined the recipe **TomatoSoup** , we can reference it anywhere in our documentation using the custom role **refef**. For example: + +``` +You can use the :rcp:reref:`TomatoSoup` recipe to feed your family. +``` + +This enables our recipes to show up in two indices: the first lists all recipes, and the second lists all recipes by ingredient. + +### What's in a domain? + +A Sphinx domain is a specialized container that ties together roles, directives, and indices, among other things. The domain has a name ( **rcp** ) to address its components in the documentation source. It announces its existence to Sphinx in the **setup()** method of the package. From there, Sphinx can find roles and directives, since these are part of the domain. + +This domain also serves as the central catalog of objects in this sample. Using initial data, it defines two variables, **objects** and **obj2ingredient**. These contain a list of all objects defined (all recipes) and a hash that maps a canonical ingredient name to the list of objects. + +``` +initial_data = { +    'objects': [],  # object list +    'obj2ingredient': {},  # ingredient -> [objects] +} +``` + +The way we name objects is common across our extension. For each object created, the canonical name is **rcp. .**, where **< typename>** is the Python type of the object, and **< objectname>** is the name the documentation writer gives the object. This enables the extension to use different object types that share the same name. + +Having a canonical name and central place for our objects is a huge advantage. Both our indices and our cross-referencing code use this feature. + +### Custom roles and directives + +In our example, **.. rcp:recipe::** indicates a custom directive. You might think it's overly specific to create custom syntax for these items, but it illustrates the degree of customization you can get in Sphinx. This provides rich markup that structures documents and leads to better docs. Specialization allows us to extract information from our docs. + +Our definition for this directive will provide minimal formatting, but it will be functional. + +``` +class RecipeNode(ObjectDescription): +  """A custom node that describes a recipe.""" + +  required_arguments = 1 + +  option_spec = { +    'contains': rst.directives.unchanged_required +  } +``` + +For this directive, **required_arguments** tells Sphinx to expect one parameter, the recipe name. **option_spec** lists the optional arguments, including their names. Finally, **has_content** specifies that there will be more reStructured Text as a child to this node. + +We also implement multiple methods: + + * **handle_signature()** implements parsing the signature of the directive and passes on the object's name and type to its superclass + * **add_taget_and_index()** adds a target (to link to) and an entry to the index for this node + + + +### Creating indices + +Both **IngredientIndex** and **RecipeIndex** are derived from Sphinx's **Index** class. They implement custom logic to generate a tuple of values that define the index. Note that **RecipeIndex** is a degenerate index that has only one entry. Extending it to cover more object types—and moving from a **RecipeDomain** to a **CookbookDomain** —is not yet part of the code. + +Both indices use the method **generate()** to do their work. This method combines the information from our domain, sorts it, and returns it in a list structure that will be accepted by Sphinx. See the [Sphinx Domain API][3] page for more information. + +The first time you visit the Domain API page, you may be a little overwhelmed by the structure. But our ingredient index is just a list of tuples, like **('tomato', 'TomatoSoup', 'test', 'rec-TomatoSoup',...)**. + +### Referencing recipes + +Adding cross-references is not difficult (but it's also not a given). Add an **XRefRole** to the domain and implement the method **resolve_xref()**. Having a custom role to reference a type allows us to unambiguously reference any object, even if two objects have the same name. If you look at the parameters of **resolve_xref()** in **Domain** , you'll see **typ** and **target**. These define the cross-reference type and its target name. We'll use **target** to resolve our destination from our domain's **objects** because we currently have only one type of node. + +We can add the cross-reference role to **RecipeDomain** in the following way: + +``` +roles = { +    'reref': XRefRole() +} +``` + +There's nothing for us to implement. Defining a working **resolve_xref()** and attaching an **XRefRole** to the domain is all you need to do. + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/building-custom-workflows-sphinx + +作者:[Mark Meyer][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ofosos +[b]: https://github.com/lujun9972 +[1]: http://www.sphinx-doc.org/en/master/ +[2]: https://github.com/ofosos/sphinxrecipes +[3]: https://www.sphinx-doc.org/en/master/extdev/domainapi.html#sphinx.domains.Index.generate From 33901e183468265ea4fb1c309146b74de58aaa33 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Thu, 29 Nov 2018 13:28:48 +0800 Subject: [PATCH 0536/1143] translated --- ...ming languages without losing your mind.md | 74 --------------- ...ming languages without losing your mind.md | 89 +++++++++++++++++++ 2 files changed, 89 insertions(+), 74 deletions(-) delete mode 100644 sources/talk/20181126 How to use multiple programming languages without losing your mind.md create mode 100644 translated/talk/20181126 How to use multiple programming languages without losing your mind.md diff --git a/sources/talk/20181126 How to use multiple programming languages without losing your mind.md b/sources/talk/20181126 How to use multiple programming languages without losing your mind.md deleted file mode 100644 index 2621d944ec..0000000000 --- a/sources/talk/20181126 How to use multiple programming languages without losing your mind.md +++ /dev/null @@ -1,74 +0,0 @@ -heguangzhi Translating - -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (How to use multiple programming languages without losing your mind) -[#]: via: (https://opensource.com/article/18/11/multiple-programming-languages) -[#]: author: (Bart Copeland https://opensource.com/users/bartcopeland) -[#]: url: ( ) - -How to use multiple programming languages without losing your mind -====== -A polyglot environment is a double-edged sword, bringing benefits along with complexities that may threaten the organization. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2) - -With all the different programming languages available today, many organizations have become digital polyglots. Open source opens up a world of languages and technology stacks developers can use to accomplish their tasks, including developing and supporting legacy and modern software applications. - -Polyglots can talk with millions more people than those who only speak their native language. In software environments, developers don't introduce new languages to achieve specifc ends, not to communicate better. Some languages are great for one task but not another, so working with multiple programming languages enables developers to use the right tool for the job. In this way, all development is polyglot; it's just the nature of the beast. - -The creation of a polyglot environment is often gradual and situational. For example, when an enterprise acquires a company, it takes on the company's technology stacks—including its programming languages. Or as tech leadership changes, new leaders may bring different technologies into the fold. Technologies also fall in and out of fashion, expanding the number of programming languages and technologies an organization has to maintain over time. - -A polyglot environment is a double-edged sword for enterprises, bringing benefits but also complexities and challenges. Ultimately, if the situation remains unchecked, polyglot will kill your enterprise. - -### Tricky technical tongue-twisters - -Where there are multiple different technologies—programming languages, legacy tools, and up-and-coming technology stacks—there is complexity. Engineering teams spend more time wrestling to retrofit programming languages with licenses, security, and dependencies. At the same time, management lacks oversight on code compliance and can't gauge risk. - -What happens is that enterprises have varying degrees of programming language quality and high variability in tooling support. It's hard to become an expert in one language when you're required to work with a dozen. There's a big difference in skill level between a person who speaks French and Italian fluently and a person who can string a few sentences together in eight languages. The same is true for developers and programming languages. - -The difficulties only increase with the addition of more programming languages, leading to a digital Tower of Babel. - -The answer is not to take away the tools your developers need for the job. Adding new programming languages builds their skill base and empowers them with the right equipment to fulfill their craft. So, you want to say "yes" to your developers, but as more and more programming languages are added to the enterprise, they impose a drag on your software development lifecycle (SDLC). At scale, all these languages and tools can kill the enterprise. - -There are three main issues enterprises should pay attention to: - - 1. **Visibility:** Teams come together for a project, then disband. Applications are released and never updated—why fix what's not broken? As a result, when a critical vulnerability is discovered, the enterprise may not have visibility into which applications are affected, which libraries those applications contain, or even what languages they were built with. This can result in costly "exploration projects" to ensure the vulnerability is properly addressed. - 2. **Updating or coding:** Some enterprises centralize the updating and fixing function in a single team. Others require that each "pizza team" manage its own development tools. In either case, the engineering team and management pay an opportunity cost: rather than coding new features, these teams are constantly updating and fixing libraries in their open source tools since they move so quickly. - 3. **Reinventing the wheel:** Since code dependencies and library versions are constantly being updated, the artifacts associated with the original build of an application may no longer be available when a vulnerability is found. As a result, many development cycles are wasted trying to recreate an environment in which the vulnerability can be fixed. - - - -Multiply each programming language in your organization by these three issues, and what started out as a molehill suddenly looks like Mount Everest. And just like a mountain climber, you won't survive without the proper equipment and tools. - -### Finding your Rosetta Stone - -A comprehensive solution that serves the needs of the enterprise and its individual stakeholders in the SDLC is in order. Enterprises can create this solution using these best practices: - - 1. Monitor code running in production and respond based on risk of flagged components (e.g., common vulnerabilities and exposures components) used in your applications. - 2. Receive regular updates to keep code current and bug-free. - 3. Use commercial open source support to get help with programming language versions and platforms that are near end-of-life and not supported by the community. - 4. Standardize specific programming language builds across your enterprise to enable consistent environments across teams and minimize dependencies. - 5. Set thresholds for when to trigger an update, alarm, or another kind of event based on dependencies. - 6. Create a single source of truth for your package management; this may require the assistance of a knowledgeable technology provider. - 7. Get smaller build distributions with only the packages you need, based on your specific criteria. - - - -Using these best practices, developers can maximize their time to create more value for the enterprise instead of doing basic tooling or build-engineering tasks. This will create code consistency in all environments in the software development life cycle (SDLC). It will also create greater efficiency and cost savings as fewer resources are needed to maintain programming languages and package distributions. This new way of operating will make the lives of both technical staff and management easier. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/11/multiple-programming-languages - -作者:[Bart Copeland][a] -选题:[lujun9972][b] -译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bartcopeland -[b]: https://github.com/lujun9972 diff --git a/translated/talk/20181126 How to use multiple programming languages without losing your mind.md b/translated/talk/20181126 How to use multiple programming languages without losing your mind.md new file mode 100644 index 0000000000..d5a0641897 --- /dev/null +++ b/translated/talk/20181126 How to use multiple programming languages without losing your mind.md @@ -0,0 +1,89 @@ +heguangzhi Translating + +[#]: collector: (lujun9972) +[#]: translator: (heguangzhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (How to use multiple programming languages without losing your mind) +[#]: via: (https://opensource.com/article/18/11/multiple-programming-languages) +[#]: author: (Bart Copeland https://opensource.com/users/bartcopeland) +[#]: url: ( ) + +How to use multiple programming languages without losing your mind +====== + +如何使用多种编程语言而又不失理智 +====== + +多语言编程环境是一把双刃剑,既带来好处,也带来可能威胁组织的复杂性。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2) + + +如今,随着各种不同的编程语言的出现,许多组织已经变成了数字多语种组织。开源打开了一个语言和技术堆栈的世界,开发人员可以使用这些语言和技术堆栈来完成他们的任务,包括开发、支持遗留和现代软件应用。 + +与那些只说母语的人相比,通晓多种语言的人可以与数百万人交谈。在软件环境中,开发人员不会引入新的语言来达到特定的目的,也不会更好地交流。一些语言对于一项任务来说很棒,但是对于另一项任务来说却不行,因此使用多种编程语言可以让开发人员使用合适的工具来完成这项任务。这样,所有的开发都是多语种的;这只是野兽的本性。 + + +多语种环境的创建通常是渐进的和情景化的。例如,当一家企业收购一家公司时,它承担了公司的技术堆栈——包括其编程语言。或者,随着技术领导的改变,新的领导者可能会将不同的技术纳入其中。技术也有过时的时候,随着时间的推移,增加了组织必须维护的编程语言和技术的数量。 + + +多语言环境对企业来说是一把双刃剑,既带来好处,也带来复杂性和挑战。最终,如果这种情况得不到控制,多语言将会扼杀你的企业。 + +### Tricky technical tongue-twisters +### 狡猾的技术绕口令 + +如果有多种不同的技术——编程语言、遗留的工具和新兴的技术堆栈——就有复杂性。工程师团队花更多的时间努力改进编程语言,包括许可证、安全性和依赖性。与此同时,管理层缺乏对代码合规性的监督,无法衡量风险。 + + +发生的情况是,企业有不同程度的编程语言质量和工具支持的高度可变性。当你需要和十几个人一起工作时,很难成为一种语言的专家。一个能流利地说法语和意大利语的人和一个能用八种语言串成几个句子的人在技能水平上有很大差异。开发人员和编程语言也是如此。 + + +随着更多编程语言的加入,困难只会增加,导致数字巴别塔的出现。 + + +答案是不要拿走开发人员工作所需的工具。添加新的编程语言可以建立他们的技能基础,并为他们提供合适的设备来完成他们的工作。所以,你想对你的开发者说“是”,但是随着越来越多的编程语言被添加到企业中,它们会拖累你的软件开发生命周期(SDLC)。在规模上,所有这些语言和工具都可能扼杀企业。 + + +企业应注意三个主要问题: + + + 1. **可见性:** 团队聚在一起进行项目,然后解散。应用程序已经发布,但从未更新——为什么要修复那些没有被破坏的东西?因此,当发现一个关键漏洞时,企业可能无法了解哪些应用程序受到影响,这些应用程序包含哪些库,甚至无法了解它们是用什么语言构建的。这可能导致昂贵的“勘探项目”,以确保漏洞得到适当解决。 + + 2. **更新或编码:** 一些企业将更新和修复功能集中在一个团队中。其他人要求每个“比萨团队”管理自己的开发工具。无论是哪种情况,工程团队和管理层都要付出机会成本:这些团队没有编码新特性,而是不断更新和修复开源工具中的库,因为它们移动得如此之快。 + + 3. **重新发明轮子:** 由于代码依赖性和库版本不断更新,当发现漏洞时,与应用程序原始版本相关联的工件可能不再可用。因此,许多开发周期都被浪费在试图重新创建一个可以修复漏洞的环境上。 + + +将你组织中的每种编程语言乘以这三个问题,开始时被认为是分子的东西突然看起来像珠穆朗玛峰。就像登山者一样,没有合适的设备和工具,你将无法生存。 + + +### 找到你的罗塞塔石碑 + + +一个全面的解决方案可以满足 SDLC 中企业及其个人利益相关者的需求。企业可以使用以下最佳实践创建解决方案: + + + 1. 监控生产中运行的代码,并根据应用程序中使用的标记组件(例如,常见漏洞和暴露组件)的风险做出响应。 + 2. 定期接收更新以保持代码的最新和无错误。 + 3. 使用商业开源支持来获得编程语言版本和平台的帮助,这些版本和平台已经接近尾声,并且不受社区支持。 + 4. 标准化整个企业中的特定编程语言构建,以实现跨团队的一致环境,并最大限度地减少依赖性。 + 5. 根据相关性设置何时触发更新、警报或其他类型事件的阈值。 + 6. 为您的包管理创建一个单一的真相来源;这可能需要知识渊博的技术提供商的帮助。 + 7. 根据您的特定标准,只使用您需要的软件包获得较小的构建分发。 + +使用这些最佳实践,开发人员可以最大限度地利用他们的时间为企业创造更多价值,而不是执行基本的工具或构建工程任务。这将在软件开发生命周期( SDLC )的所有环境中创建代码一致性。由于维护编程语言和软件包分发所需的资源更少,这也将提高效率和节约成本。这种新的操作方式将使技术人员和管理人员的生活更加轻松。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/multiple-programming-languages + +作者:[Bart Copeland][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bartcopeland +[b]: https://github.com/lujun9972 From 4addde62288e64711a8108ec17683b1061106afa Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Thu, 29 Nov 2018 13:32:03 +0800 Subject: [PATCH 0537/1143] Translating 7 command-line tools for writers. --- ...81119 7 command-line tools for writers - Opensource.com.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md index 4d2edb8472..74a03b9ab8 100644 --- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md +++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md @@ -11,9 +11,9 @@ ### 编辑器 -Yes, you _can_ do actual writing at the command line. I know writers who do their work using editors like [Nano][2], [Vim][3], [Emacs][4], and [Jove][5] in a terminal window. And those editors [aren't the only games in town][6]. Text editors are great because they (at a basic level, anyway) are easy to use and distraction free. They're perfect for tapping out a first draft of anything or even completing a long and complicated writing project. +没错,你_可以_在命令行进行真正的写作。我知道一些写作者会使用 [Nano][2]、[Vim][3]、[Emacs][4]、以及 [Jove][5] 等编辑器在终端窗口中进行工作。而这些编辑器并不是[aren't the only games in town][6]。文本编辑器的优势在于它们简单易用和专注。它们非常适合于编辑任何文本的初稿甚至完成一个漫长而复杂的写作项目。 -If you want a more word processor-like experience at the command line, take a look at [WordGrinder][7] . WordGrinder is a bare-bones word processor, but it has more than enough features for writing and publishing your work. It supports basic formatting and styles, and you can export your writing to formats like Markdown, ODT, LaTeX, and HTML. +如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下[WordGrinder][7]。WordGrinder 是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown, ODT, LaTeX, 以及 HTML等格式导出。 ### 拼写检查 From cb04d64df0a3fc74c9993a1ca2db776396acb1f9 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Thu, 29 Nov 2018 13:38:32 +0800 Subject: [PATCH 0538/1143] heguangzhi Translated --- ...e multiple programming languages without losing your mind.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/translated/talk/20181126 How to use multiple programming languages without losing your mind.md b/translated/talk/20181126 How to use multiple programming languages without losing your mind.md index d5a0641897..8c4a2ada5a 100644 --- a/translated/talk/20181126 How to use multiple programming languages without losing your mind.md +++ b/translated/talk/20181126 How to use multiple programming languages without losing your mind.md @@ -1,5 +1,3 @@ -heguangzhi Translating - [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: ( ) From 0142742198daa05e1c535e4a7c4e4202bbd7a079 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 29 Nov 2018 18:27:21 +0800 Subject: [PATCH 0539/1143] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9d0e3e2d77..f82354ba62 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -![待翻译](https://lctt.github.io/TranslateProject/badge/sources.svg) -![翻译中](https://lctt.github.io/TranslateProject/badge/translating.svg) -![待校正](https://lctt.github.io/TranslateProject/badge/translated.svg) -![已发布](https://lctt.github.io/TranslateProject/badge/published.svg) +[![待翻译](https://lctt.github.io/TranslateProject/badge/sources.svg)](https://lctt.github.io/new) +[![翻译中](https://lctt.github.io/TranslateProject/badge/translating.svg)](https://lctt.github.io/translating) +[![待校正](https://lctt.github.io/TranslateProject/badge/translated.svg)](https://github.com/LCTT/TranslateProject/tree/master/translated) +[![已发布](https://lctt.github.io/TranslateProject/badge/published.svg)](https://github.com/LCTT/TranslateProject/tree/master/published) [![Travis](https://img.shields.io/travis/LCTT/TranslateProject.svg)](https://travis-ci.com/LCTT/TranslateProject) [![GitHub contributors](https://img.shields.io/github/contributors/LCTT/TranslateProject.svg)](https://github.com/LCTT/TranslateProject/graphs/contributors) From 056c79db39fb9eac1a5f4e34c793fa521a3dea5c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 29 Nov 2018 18:50:52 +0800 Subject: [PATCH 0540/1143] PRF:20181126 How to use multiple programming languages without losing your mind.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @heguangzhi 这是第一篇采用新模板完成的译文。@lujun9972 --- ...ming languages without losing your mind.md | 50 +++++++------------ 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/translated/talk/20181126 How to use multiple programming languages without losing your mind.md b/translated/talk/20181126 How to use multiple programming languages without losing your mind.md index 8c4a2ada5a..7fa1207c5c 100644 --- a/translated/talk/20181126 How to use multiple programming languages without losing your mind.md +++ b/translated/talk/20181126 How to use multiple programming languages without losing your mind.md @@ -1,76 +1,60 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (How to use multiple programming languages without losing your mind) [#]: via: (https://opensource.com/article/18/11/multiple-programming-languages) [#]: author: (Bart Copeland https://opensource.com/users/bartcopeland) [#]: url: ( ) -How to use multiple programming languages without losing your mind -====== - 如何使用多种编程语言而又不失理智 ====== -多语言编程环境是一把双刃剑,既带来好处,也带来可能威胁组织的复杂性。 +> 多语言编程环境是一把双刃剑,既带来好处,也带来可能威胁组织的复杂性。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2) - -如今,随着各种不同的编程语言的出现,许多组织已经变成了数字多语种组织。开源打开了一个语言和技术堆栈的世界,开发人员可以使用这些语言和技术堆栈来完成他们的任务,包括开发、支持遗留和现代软件应用。 +如今,随着各种不同的编程语言的出现,许多组织已经变成了数字多语种组织digital polyglots。开源打开了一个语言和技术堆栈的世界,开发人员可以使用这些语言和技术堆栈来完成他们的任务,包括开发、支持过时的和现代的软件应用。 与那些只说母语的人相比,通晓多种语言的人可以与数百万人交谈。在软件环境中,开发人员不会引入新的语言来达到特定的目的,也不会更好地交流。一些语言对于一项任务来说很棒,但是对于另一项任务来说却不行,因此使用多种编程语言可以让开发人员使用合适的工具来完成这项任务。这样,所有的开发都是多语种的;这只是野兽的本性。 - -多语种环境的创建通常是渐进的和情景化的。例如,当一家企业收购一家公司时,它承担了公司的技术堆栈——包括其编程语言。或者,随着技术领导的改变,新的领导者可能会将不同的技术纳入其中。技术也有过时的时候,随着时间的推移,增加了组织必须维护的编程语言和技术的数量。 - +多语种环境的创建通常是渐进的和情景化的。例如,当一家企业收购一家公司时,它就承担了该公司的技术堆栈 —— 包括其编程语言。或者,随着技术领导的改变,新的领导者可能会将不同的技术纳入其中。技术也有过时的时候,随着时间的推移,增加了组织必须维护的编程语言和技术的数量。 多语言环境对企业来说是一把双刃剑,既带来好处,也带来复杂性和挑战。最终,如果这种情况得不到控制,多语言将会扼杀你的企业。 -### Tricky technical tongue-twisters -### 狡猾的技术绕口令 +### 棘手的技术绕口令 -如果有多种不同的技术——编程语言、遗留的工具和新兴的技术堆栈——就有复杂性。工程师团队花更多的时间努力改进编程语言,包括许可证、安全性和依赖性。与此同时,管理层缺乏对代码合规性的监督,无法衡量风险。 - - -发生的情况是,企业有不同程度的编程语言质量和工具支持的高度可变性。当你需要和十几个人一起工作时,很难成为一种语言的专家。一个能流利地说法语和意大利语的人和一个能用八种语言串成几个句子的人在技能水平上有很大差异。开发人员和编程语言也是如此。 +如果有多种不同的技术 —— 编程语言、过时的工具和新兴的技术堆栈 —— 就有复杂性。工程师团队花更多的时间努力改进编程语言,包括许可证、安全性和依赖性。与此同时,管理层缺乏对代码合规性的监督,无法衡量风险。 +发生的情况是,企业具有不同程度的编程语言质量和工具支持的高度可变性。当你需要和十几个人一起工作时,很难成为一种语言的专家。一个能流利地说法语和意大利语的人和一个能用八种语言串成几个句子的人在技能水平上有很大差异。开发人员和编程语言也是如此。 随着更多编程语言的加入,困难只会增加,导致数字巴别塔的出现。 - -答案是不要拿走开发人员工作所需的工具。添加新的编程语言可以建立他们的技能基础,并为他们提供合适的设备来完成他们的工作。所以,你想对你的开发者说“是”,但是随着越来越多的编程语言被添加到企业中,它们会拖累你的软件开发生命周期(SDLC)。在规模上,所有这些语言和工具都可能扼杀企业。 - +答案是不要拿走开发人员工作所需的工具。添加新的编程语言可以建立他们的技能基础,并为他们提供合适的设备来完成他们的工作。所以,你想对你的开发者说“是”,但是随着越来越多的编程语言被添加到企业中,它们会拖累你的软件开发生命周期(SDLC)。在规模上,所有这些语言和工具都可能扼杀企业。 企业应注意三个主要问题: - - 1. **可见性:** 团队聚在一起进行项目,然后解散。应用程序已经发布,但从未更新——为什么要修复那些没有被破坏的东西?因此,当发现一个关键漏洞时,企业可能无法了解哪些应用程序受到影响,这些应用程序包含哪些库,甚至无法了解它们是用什么语言构建的。这可能导致昂贵的“勘探项目”,以确保漏洞得到适当解决。 +1. **可见性:** 团队聚在一起执行项目,然后解散。应用程序已经发布,但从未更新 —— 为什么要修复那些没有被破坏的东西?因此,当发现一个关键漏洞时,企业可能无法了解哪些应用程序受到影响,这些应用程序包含哪些库,甚至无法了解它们是用什么语言构建的。这可能导致成本高昂的“勘探项目”,以确保漏洞得到适当解决。 - 2. **更新或编码:** 一些企业将更新和修复功能集中在一个团队中。其他人要求每个“比萨团队”管理自己的开发工具。无论是哪种情况,工程团队和管理层都要付出机会成本:这些团队没有编码新特性,而是不断更新和修复开源工具中的库,因为它们移动得如此之快。 +2. **更新或编码:** 一些企业将更新和修复功能集中在一个团队中。其他人要求每个“比萨团队”管理自己的开发工具。无论是哪种情况,工程团队和管理层都要付出机会成本:这些团队没有编码新特性,而是不断更新和修复开源工具中的库,因为它们移动得如此之快。 - 3. **重新发明轮子:** 由于代码依赖性和库版本不断更新,当发现漏洞时,与应用程序原始版本相关联的工件可能不再可用。因此,许多开发周期都被浪费在试图重新创建一个可以修复漏洞的环境上。 - - -将你组织中的每种编程语言乘以这三个问题,开始时被认为是分子的东西突然看起来像珠穆朗玛峰。就像登山者一样,没有合适的设备和工具,你将无法生存。 +3. **重新发明轮子:** 由于代码依赖性和库版本不断更新,当发现漏洞时,与应用程序原始版本相关联的工件可能不再可用。因此,许多开发周期都被浪费在试图重新创建一个可以修复漏洞的环境上。 +将你组织中的每种编程语言乘以这三个问题,开始时被认为是分子一样小的东西突然看起来像珠穆朗玛峰。就像登山者一样,没有合适的设备和工具,你将无法生存。 ### 找到你的罗塞塔石碑 - 一个全面的解决方案可以满足 SDLC 中企业及其个人利益相关者的需求。企业可以使用以下最佳实践创建解决方案: - - 1. 监控生产中运行的代码,并根据应用程序中使用的标记组件(例如,常见漏洞和暴露组件)的风险做出响应。 + 1. 监控生产中运行的代码,并根据应用程序中使用的标记组件(例如,常见漏洞和暴露组件)的风险做出响应。 2. 定期接收更新以保持代码的最新和无错误。 3. 使用商业开源支持来获得编程语言版本和平台的帮助,这些版本和平台已经接近尾声,并且不受社区支持。 4. 标准化整个企业中的特定编程语言构建,以实现跨团队的一致环境,并最大限度地减少依赖性。 5. 根据相关性设置何时触发更新、警报或其他类型事件的阈值。 - 6. 为您的包管理创建一个单一的真相来源;这可能需要知识渊博的技术提供商的帮助。 - 7. 根据您的特定标准,只使用您需要的软件包获得较小的构建分发。 + 6. 为您的包管理创建一个单一的可信来源;这可能需要知识渊博的技术提供商的帮助。 + 7. 根据您的特定标准,只使用您需要的软件包获得较小的构建版本。 -使用这些最佳实践,开发人员可以最大限度地利用他们的时间为企业创造更多价值,而不是执行基本的工具或构建工程任务。这将在软件开发生命周期( SDLC )的所有环境中创建代码一致性。由于维护编程语言和软件包分发所需的资源更少,这也将提高效率和节约成本。这种新的操作方式将使技术人员和管理人员的生活更加轻松。 +使用这些最佳实践,开发人员可以最大限度地利用他们的时间为企业创造更多价值,而不是执行基本的工具或构建工程任务。这将在软件开发生命周期(SDLC)的所有环境中创建代码一致性。由于维护编程语言和软件包分发所需的资源更少,这也将提高效率和节约成本。这种新的操作方式将使技术人员和管理人员的生活更加轻松。 -------------------------------------------------------------------------------- @@ -79,7 +63,7 @@ via: https://opensource.com/article/18/11/multiple-programming-languages 作者:[Bart Copeland][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d3a028d05f9127c2a37afb81ca11c2cac8f806af Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 29 Nov 2018 18:51:41 +0800 Subject: [PATCH 0541/1143] PUB:20181126 How to use multiple programming languages without losing your mind.md @heguangzhi https://linux.cn/article-10291-1.html --- ...multiple programming languages without losing your mind.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20181126 How to use multiple programming languages without losing your mind.md (98%) diff --git a/translated/talk/20181126 How to use multiple programming languages without losing your mind.md b/published/20181126 How to use multiple programming languages without losing your mind.md similarity index 98% rename from translated/talk/20181126 How to use multiple programming languages without losing your mind.md rename to published/20181126 How to use multiple programming languages without losing your mind.md index 7fa1207c5c..bbb310fa4e 100644 --- a/translated/talk/20181126 How to use multiple programming languages without losing your mind.md +++ b/published/20181126 How to use multiple programming languages without losing your mind.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (How to use multiple programming languages without losing your mind) [#]: via: (https://opensource.com/article/18/11/multiple-programming-languages) [#]: author: (Bart Copeland https://opensource.com/users/bartcopeland) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10291-1.html) 如何使用多种编程语言而又不失理智 ====== From 685e85da28fd2508bdfe799e4c5a3bb166b16023 Mon Sep 17 00:00:00 2001 From: MjSeven <33125422+MjSeven@users.noreply.github.com> Date: Thu, 29 Nov 2018 21:01:46 +0800 Subject: [PATCH 0542/1143] Delete 20180131 For your first HTML code lets help Batman write a love letter.md --- ...de lets help Batman write a love letter.md | 863 ------------------ 1 file changed, 863 deletions(-) delete mode 100644 sources/tech/20180131 For your first HTML code lets help Batman write a love letter.md diff --git a/sources/tech/20180131 For your first HTML code lets help Batman write a love letter.md b/sources/tech/20180131 For your first HTML code lets help Batman write a love letter.md deleted file mode 100644 index 18d911884c..0000000000 --- a/sources/tech/20180131 For your first HTML code lets help Batman write a love letter.md +++ /dev/null @@ -1,863 +0,0 @@ -Translating by MjSeven - - -For your first HTML code, let’s help Batman write a love letter -============================================================ - -![](https://cdn-images-1.medium.com/max/1000/1*kZxbQJTdb4jn_frfqpRg9g.jpeg) -[Image Credit][1] - -One fine night, your stomach refuses to digest the large Pizza you had at dinner, and you have to rush to the bathroom in the middle of your sleep. - -In the bathroom, while wondering why this is happening to you, you hear a heavy voice from the vent: “Hey, I am Batman.” - -What would you do? - -Before you panic and stand up in middle of the critical process, Batman says, “I need your help. I am a super geek, but I don’t know HTML. I need to write my love letter in HTML — would you do it for me?” - -Who could refuse a request from Batman, right? Let’s write Batman’s love letter in HTML. - -### Your first HTML file - -An HTML webpage is like other files on your computer. As a .doc file opens in MS Word, a .jpg file opens in Image Viewer, and a .html file opens in your Browser. - -So, let’s create a .html file. You can do this in Notepad, or any other basic editor, but I would recommend using VS Code instead. [Download and install VS Code here][2]. It’s free, and the only Microsoft Product I love. - -Create a directory in your system and name it “HTML Practice” (without quotes). Inside this directory, create one more directory called “Batman’s Love Letter” (without quotes). This will be our project root directory. That means that all our files related to this project will live here. - -Open VS Code and press ctrl+n to create a new file and ctrl+s to save the file. Navigate to the “Batman’s Love Letter” folder and name the file “loveletter.html” and click save. - -Now, if you open this file by double-clicking it from your file explorer, it will open in your default browser. I recommend using Firefox for web development, but Chrome is fine too. - -Let’s relate this process to something we are already familiar with. Remember the first time you got your hands on a computer? The first thing I did was open MS Paint and draw something. You draw something in Paint and save it as an image and then you can view that image in Image Viewer. Then if you want to edit that image again, you re-open it in Paint, edit it, and save it. - -Our current process is quite similar. As we use Paint to create and edit images, we use VS Code to create and edit our HTML files. And as we use Image Viewer to view the images, we use the Browser to view our HTML pages. - -### Your first Paragraph in HTML - -We have our blank HTML file, so here’s the first paragraph Batman wants to write in his love letter - -“After all the battles we fought together, after all the difficult times we saw together, and after all the good and bad moments we’ve been through, I think it’s time I let you know how I feel about you.” - -Copy the paragraph in your loveletter.html in VS Code. Enable word wrap by clicking View -> Toggle Word Wrap (alt+z). - -Save and open the file in your browser. If it’s already open, click refresh on your browser. - -Voila! That’s your first webpage! - -Our first paragraph is ready, but this is not the recommended way of writing a paragraph in HTML. We have a specific way to let the browser know that a text is a paragraph. - -If you wrap the text with `

` and `

`, then the browser will know that the text inside the `

` and `

` is a paragraph. Let’s do this: - -``` -

After all the battles we fought together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you.

-``` - -By writing the paragraph inside `

` and `

` you created an HTML element. A web page is collection of HTML elements. - -Let’s get some of the terminologies out of the way first: `

` is the opening tag, `

` is the closing tag, and “p” is the tag name. The text inside the opening and closing tag of an element is that element’s content. - -### The “style” attribute - -You will see that the text covers the entire width of the screen. - -We don’t want that. No one want’s to read such long lines. Let’s give a width of, say, 550px to our paragraph. - -We can do that by using the element’s “style” attribute. You can define an element’s style (for example, width in our case), inside its style attribute. The following line will create an empty style attribute on a “p” element: - -``` -

...

-``` - -You see that empty `""`? That’s where we will define the looks of the element. Right now we want to set the width to 550px. Let’s do that: - -``` -

- After all the battles we fought together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

-``` - -We set the “width” property to 550px separated by a colon “:” and ended by a semicolon “;”. - -Also, notice how we put the `

` and `

` in separate lines and the text content indented with one tab. Styling your code like this makes it more readable. - -### Lists in HTML - -Next, Batman wants to list some of the virtues of the person that he admires, like this: - -“ You complete my darkness with your light. I love: -- the way you see good in the worst things -- the way you handle emotionally difficult situations -- the way you look at Justice -I have learned a lot from you. You have occupied a special place in my heart over time.” - -This looks simple. - -Let’s go ahead and copy the required text below the `

:` - -``` -

- After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

-

- You complete my darkness with your light. I love: - - the way you see good in the worse - - the way you handle emotionally difficult situations - - the way you look at Justice - I have learned a lot from you. You have occupied a special place in my heart over the time. -

-``` - -Save and refresh your browser. - - -![](https://cdn-images-1.medium.com/max/1000/1*M0Ae5ZpRTucNyucfaaz4uw.jpeg) - -Woah! What happened here, where is our list? - -If you look closely, you will observe that line breaks are not displayed. We wrote the list items in new lines in our code, but those are displayed in a single line in the browser. - -If you want to insert a line break in HTML (newline) you have to mention it using `
`. Let’s use `
` and see how it looks: - -``` -

- After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

-

- You complete my darkness with your light. I love:
- - the way you see good in the worse
- - the way you handle emotionally difficult situations
- - the way you look at Justice
- I have learned a lot from you. You have occupied a special place in my heart over the time. -

-``` - -Save and refresh: - - -![](https://cdn-images-1.medium.com/max/1000/1*Mj4Sr_jUliidxFpEtu0pXw.jpeg) - -Okay, now it looks the way we want it to. - -Also, notice that we didn’t write a `
`. Some tags don’t need a closing tag, (and they’re called self-closing tags). - -One more thing: we didn’t use a `
` between the two paragraphs, but still the second paragraph starts from a new line. That’s because the “p” element automatically inserts a line break. - -We wrote our list using plain text, but there are two tags we can use for this same purpose: `
    ` and `
  • `. - -To get the naming out of the way: ul stands for Unordered List, and li stands for List Item. Let’s use these to display our list: - -``` -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - -``` -

    - You complete my darkness with your light. I love: -

      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -``` - -Before copying the code, notice the differences we made: - -* We removed all the `
    `, since each `
  • ` automatically displays in new line - -* We wrapped the individual list items between `
  • ` and `
  • `. - -* We wrapped the collection of all the list items between the `
      ` and `
    ` - -* We didn’t define the width of the “ul” element as we were doing with the “p” element. This is because “ul” is a child of “p” and “p” is already constrained to 550px, so “ul” won’t go beyond that. - -Let’s save the file and refresh the browser to see the results: - - -![](https://cdn-images-1.medium.com/max/1000/1*aPlMpYVZESPwgUO3Iv-qCA.jpeg) - -You will instantly notice that we get bullet points displayed before each list item. We don’t need to write that “-” before each list item now. - -On careful inspection, you will notice that the last line goes beyond 550px width. Why is that? Because a “ul” element is not allowed inside a “p” element in HTML. Let’s put the first and last lines in separate “p” elements: - -``` -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - -``` -

    - You complete my darkness with your light. I love: -

    -``` - -``` -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -``` - -``` -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -``` - -Save and reload. - -Notice that this time we defined the width of the “ul” element also. That’s because we have now moved our “ul” element out of the “p” element. - -Defining the width of all the elements of our letter can become cumbersome. We have a specific element for this purpose: the “div” element. A “div” element is a generic container which is used to group content so it can be easily styled. - -Let’s wrap our entire letter with a div element and give width:550px to that div element: - -``` -
    -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -
    -``` - -Great. Our code looks much cleaner now. - -### Headings in HTML - -Batman is quite happy looking at the results so far, and he wants a heading on the letter. He wants to make the heading: “Bat Letter”. Of course, you saw this name coming already, didn’t you? :D - -You can add heading using ht, h2, h3, h4, h5, and h6 tags, h1 is the biggest and main heading and h6 the smallest one. - - -![](https://cdn-images-1.medium.com/max/1000/1*Ud-NzfT-SrMgur1WX4LCkQ.jpeg) - -Let’s make the main heading using h1 and a subheading before second paragraph: - -``` -
    -

    Bat Letter

    -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - -``` -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -
    -``` - -Save, and reload. - - -![](https://cdn-images-1.medium.com/max/1000/1*rzyIl-gHug3nQChqfscU3w.jpeg) - -### Images in HTML - -Our letter is not complete yet, but before proceeding, one big thing is missing — a Bat logo. Have you ever seen anything Batman owns that doesn’t have a Bat logo? - -Nope. - -So, let’s add a Bat logo to our letter. - -Including an image in HTML is like including an image in a Word file. In MS Word you go to menu -> insert -> image -> then navigate to the location of the image -> select the image -> click on insert. - -In HTML, instead of clicking on the menu, we use `` tag to let the browser know that we need to load an image. We write the location and name of the file inside the “src” attribute. If the image is in the project root directory, we can simply write the name of the image file in the src attribute. - -Before we dive into coding this, download this Bat logo from [here][3]. You might want to crop the extra white space in the image. Copy the image in your project root directory and rename it “bat-logo.jpeg”. - -``` -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - -``` -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -
    -``` - -We included the img tag on line 3\. This tag is also a self-closing tag, so we don’t need to write ``. In the src attribute, we give the name of the image file. This name should be exactly same as your image’s name, including the extension (.jpeg) and its case. - -Save and refresh to see the result. - - -![](https://cdn-images-1.medium.com/max/1000/1*uMNWAISOACJlzDOONcrGXw.jpeg) - -Damn! What just happened? - -When you include an image using the img tag, by default the image will be displayed in its original resolution. In our case, the image is much wider than 550px. Let’s define its width using the style attribute: - -``` -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - -``` -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -
    -``` - -You will notice that this time we defined width with “%” instead of “px”. When we define a width in “%” it will occupy that % of the parent element’s width. So, 100% of 550px will give us 550px. - -Save and refresh to see the results. - -![](https://cdn-images-1.medium.com/max/1000/1*5c0ngx3BFVlyyP6UNtfYyg.jpeg) - -Fantastic! This brings a timid smile to Batman’s face :) - -### Bold and Italic in HTML - -Now Batman wants to confess his love in the last few paragraphs. He has this text for you to write in HTML: - -“I have a confession to make - -It feels like my chest  _does_  have a heart. You make my heart beat. Your smile brings a smile to my face, your pain brings pain to my heart. - -I don’t show my emotions, but I think this man behind the mask is falling for you.” - -While reading this you ask Batman, “Wait, who is this for?” and Batman replies: - -“It’s for Superman.” - - -![](https://cdn-images-1.medium.com/max/1000/1*UNDvfIZQJ1Q_goHc-F-IPA.jpeg) - -You: Oh! I was going to guess Wonder Woman. - -Batman: No, it’s Sups, please write “I love you Superman” at the end. - -Fine, let’s do it then: - -``` -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - -``` -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -

    I have a confession to make

    -

    - It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -

    -

    - I don't show my emotions, but I think this man behind the mask is falling for you. -

    -

    I love you Superman.

    -

    - Your not-so-secret-lover,
    - Batman -

    -
    -``` - -The letter is almost done, and Batman wants just two more changes. Batman wants the word “does” in the first sentence of the confession paragraph to be italic, and the sentence “I love you Superman” to be in bold. - -We use `` and `` to display text in italic and bold. Let’s update these changes: - -``` -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - -``` -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -

    I have a confession to make

    -

    - It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -

    -

    - I don't show my emotions, but I think this man behind the mask is falling for you. -

    -

    I love you Superman.

    -

    - Your not-so-secret-lover,
    - Batman -

    -
    -``` - - -![](https://cdn-images-1.medium.com/max/1000/1*6hZdQJglbHUcEEHzouk2eA.jpeg) - -### Styling in HTML - -There are three ways you can style or define the look of an HTML element: - -* Inline styling: We write styles using “style” attribute of the elements. This is what we have done up until now. This is not a good practice. - -* Embedded styling: We write all the styles within a “style” element wrapped by . - -* Linked stylesheet: We write styles of all the elements in a separate file with .css extension. This file is called Stylesheet. - -Let’s have a look at how we defined the inline style of the “div” until now: - -``` -
    -``` - -We can write this same style inside `` like this: - -``` -div{ - width:550px; -} -``` - -In embedded styling, the styles we write are separate from the elements. So we need a way to relate the element and its style. The first word “div” does exactly that. It lets the browser know that whatever style is inside the curly braces `{…}` belongs to the “div” element. Since this phrase determines which element to apply the style to, it’s called a selector. - -The way we write style remains same: property(width) and value(550px) separated by a colon(:) and ended by a semicolon(;). - -Let’s remove inline style from our “div” and “img” element and write it inside the ` -``` - -``` -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - -``` -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -

    I have a confession to make

    -

    - It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -

    -

    - I don't show my emotions, but I think this man behind the mask is falling for you. -

    -

    I love you Superman.

    -

    - Your not-so-secret-lover,
    - Batman -

    -
    -``` - -Save and refresh, and the result should remain the same. - -There is one big problem though — what if there is more than one “div” and “img” element in our HTML file? The styles that we defined for div and img inside the “style” element will apply to every div and img on the page. - -If you add another div in your code in the future, then that div will also become 550px wide. We don’t want that. - -We want to apply our styles to the specific div and img that we are using right now. To do this, we need to give our div and img element unique ids. Here’s how you can give an id to an element using its “id” attribute: - -``` -
    -``` - -and here’s how to use this id in our embedded style as a selector: - ``` -#letter-container{ - ... -} -``` - Notice the “#” symbol. It indicates that it is an id, and the styles inside {…} should apply to the element with that specific id only. - Let’s apply this to our code: - ``` - -``` - ``` -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -``` - ``` -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -

    I have a confession to make

    -

    - It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -

    -

    - I don't show my emotions, but I think this man behind the mask is falling for you. -

    -

    I love you Superman.

    -

    - Your not-so-secret-lover,
    - Batman -

    -
    -``` -Our HTML is ready with embedded styling. - -However, you can see that as we include more styles, the will get bigger. This can quickly clutter our main html file. - -So let’s go one step further and use linked styling by copying the content inside our style tag to a new file. - -Create a new file in the project root directory and save it as style.css: -``` -#letter-container{ - width:550px; -} -#header-bat-logo{ - width:100%; -} -``` - - -We don’t need to write `` in our CSS file. - -We need to link our newly created CSS file to our HTML file using the ``tag in our html file. Here’s how we can do that: - -``` - -``` - -We use the link element to include external resources inside your HTML document. It is mostly used to link Stylesheets. The three attributes that we are using are: - * rel: Relation. What relationship the linked file has to the document. The file with the .css extension is called a stylesheet, and so we keep rel=“stylesheet”. - * type: the Type of the linked file; it’s “text/css” for a CSS file. - * href: Hypertext Reference. Location of the linked file. - -There is no at the end of the link element. So, is also a self-closing tag. - -``` - -``` -If only getting a Girlfriend was so easy :D - -Nah, that’s not gonna happen, let’s move on. - -Here’s the content of our loveletter.html: - -``` - -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -

    I have a confession to make

    -

    - It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -

    -

    - I don't show my emotions, but I think this man behind the mask is falling for you. -

    -

    I love you Superman.

    -

    - Your not-so-secret-lover,
    - Batman -

    -
    -``` -and our style.css: - -``` -#letter-container{ - width:550px; -} -#header-bat-logo{ - width:100%; -} -``` - -Save both the files and refresh, and your output in the browser should remain the same. - -### A Few Formalities - -Our love letter is almost ready to deliver to Batman, but there are a few formal pieces remaining. - -Like any other programming language, HTML has also gone through many versions since its birth year(1990). The current version of HTML is HTML5. - -So, how would the browser know which version of HTML you are using to code your page? To tell the browser that you are using HTML5, you need to include `` at top of the page. For older versions of HTML, this line used to be different, but you don’t need to learn that because we don’t use them anymore. - -Also, in previous HTML versions, we used to encapsulate the entire document inside `` tag. The entire file was divided into two major sections: Head, inside ``, and Body, inside ``. This is not required in HTML5, but we still do this for compatibility reasons. Let’s update our code with ``, ``, `` and ``: - -``` - - - - - - -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -

    I have a confession to make

    -

    - It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -

    -

    - I don't show my emotions, but I think this man behind the mask is falling for you. -

    -

    I love you Superman.

    -

    - Your not-so-secret-lover,
    - Batman -

    -
    - - -``` - -The main content goes inside `` and meta information goes inside ``. So we keep the div inside `` and load the stylesheets inside ``. - -Save and refresh, and your HTML page should display the same as earlier. - -### Title in HTML - -This is the last change. I promise. - -You might have noticed that the title of the tab is displaying the path of the HTML file: - -![](https://cdn-images-1.medium.com/max/1000/1*PASKm4ji29hbcZXVSP8afg.jpeg) - -We can use `` tag to define a title for our HTML file. The title tag also, like the link tag, goes inside head. Let’s put “Bat Letter” in our title: - -``` -<!DOCTYPE html> -<html> -<head> - <title>Bat Letter - - - -
    -

    Bat Letter

    - -

    - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -

    -

    You are the light of my life

    -

    - You complete my darkness with your light. I love: -

    -
      -
    • the way you see good in the worse
    • -
    • the way you handle emotionally difficult situations
    • -
    • the way you look at Justice
    • -
    -

    - I have learned a lot from you. You have occupied a special place in my heart over the time. -

    -

    I have a confession to make

    -

    - It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -

    -

    - I don't show my emotions, but I think this man behind the mask is falling for you. -

    -

    I love you Superman.

    -

    - Your not-so-secret-lover,
    - Batman -

    -
    - - -``` - -Save and refresh, and you will see that instead of the file path, “Bat Letter” is now displayed on the tab. - -Batman’s Love Letter is now complete. - -Congratulations! You made Batman’s Love Letter in HTML. - -![](https://cdn-images-1.medium.com/max/1000/1*qC8qtrYtxAB6cJfm9aVOOQ.jpeg) - -### What we learned - -We learned the following new concepts: - * The structure of an HTML document - * How to write elements in HTML (

    ) - * How to write styles inside the element using the style attribute (this is called inline styling, avoid this as much as you can) - * How to write styles of an element inside (this is called embedded styling) - * How to write styles in a separate file and link to it in HTML using (this is called a linked stylesheet) - * What is a tag name, attribute, opening tag, and closing tag - * How to give an id to an element using id attribute - * Tag selectors and id selectors in CSS - We learned the following HTML tags: - *

    : for paragraphs - *
    : for line breaks - *

      ,
    • : to display lists - *
      : for grouping elements of our letter - *

      ,

      : for heading and sub heading - * : to insert an image - * , : for bold and italic text styling - * 包裹的 “style” 元素中编写所有样式。 + +* 链接样式表:我们在具有 .css 扩展名的单独文件中编写所有元素的样式。此文件称为样式表。 + +让我们来看看如何定义 “div” 的内联样式: + +``` +
      +``` + +我们可以在 `` 里面写同样的样式: + +``` +div{ + width:550px; +} +``` + +在嵌入式样式中,我们编写的样式是与元素分开的。所以我们需要一种方法来关联元素及其样式。第一个单词 “div” 就做了这样的活。它让浏览器知道花括号 `{...}` 里面的所有样式都属于 “div” 元素。由于这种语法确定要应用样式的元素,因此它称为一个选择器。 + +我们编写样式的方式保持不变:属性(宽度)和值(550px)用冒号(:)分隔,以分号(;)结束。 + +让我们从 “div” 和 “img” 元素中删除内联样式,将其写入 ` +``` + +``` +
      +

      Bat Letter

      + +

      + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +

      +``` + +``` +

      You are the light of my life

      +

      + You complete my darkness with your light. I love: +

      +
        +
      • the way you see good in the worse
      • +
      • the way you handle emotionally difficult situations
      • +
      • the way you look at Justice
      • +
      +

      + I have learned a lot from you. You have occupied a special place in my heart over the time. +

      +

      I have a confession to make

      +

      + It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +

      +

      + I don't show my emotions, but I think this man behind the mask is falling for you. +

      +

      I love you Superman.

      +

      + Your not-so-secret-lover,
      + Batman +

      +
      +``` + +保存并刷新,结果应保持不变。 + +但是有一个大问题,如果我们的 HTML 文件中有多个 “div” 和 “img” 元素该怎么办?这样我们在 “style” 元素中为 div 和 img 定义的样式就会应用于页面上的每个 div 和 img。 + +如果你在以后的代码中添加另一个 div,那么该 div 也将变为 550px 宽。我们并不希望这样。 + +我们想要将我们的样式应用于现在正在使用的特定 div 和 img。为此,我们需要为 div 和 img 元素提供唯一的 id。以下是使用 “id” 属性为元素赋予 id 的方法: + +``` +
      +``` + +以下是如何在嵌入式样式中将此 id 用作选择器: + +``` +#letter-container{ + ... +} +``` + +注意 “#” 符号。它表示它是一个 id,{...} 中的样式应该只应用于具有该特定 id 的元素。 + +让我们来应用它: + +``` + +``` + +``` +
      +

      Bat Letter

      + +

      + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +

      +``` + +``` +

      You are the light of my life

      +

      + You complete my darkness with your light. I love: +

      +
        +
      • the way you see good in the worse
      • +
      • the way you handle emotionally difficult situations
      • +
      • the way you look at Justice
      • +
      +

      + I have learned a lot from you. You have occupied a special place in my heart over the time. +

      +

      I have a confession to make

      +

      + It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +

      +

      + I don't show my emotions, but I think this man behind the mask is falling for you. +

      +

      I love you Superman.

      +

      + Your not-so-secret-lover,
      + Batman +

      +
      +``` + +HTML 已经准备好了嵌入式样式。 + +但是,你可以看到,随着我们包含越来越多的样式, 将变得很大。这可能很快会混乱我们的主 HTML 文件。 + +因此,让我们更进一步,通过将 style 标签内的内容复制到一个新文件来使用链接样式。 + +在项目根目录中创建一个新文件,将其另存为 style.css: + +``` +#letter-container{ + width:550px; +} +#header-bat-logo{ + width:100%; +} +``` + +我们不需要在 CSS 文件中写 ``。 + +我们需要使用 HTML 文件中的 `` 标签来将新创建的 CSS 文件链接到 HTML 文件。以下是我们如何做到这一点: + +``` + +``` + +我们使用 link 元素在 HTML 文档中包含外部资源,它主要用于链接样式表。我们使用的三个属性是: + +* rel:关系。链接文件与文档的关系。具有 .css 扩展名的文件称为样式表,因此我们保留 rel=“stylesheet”。 + +* type:链接文件的类型;对于一个 CSS 文件来说它是 “text/css”。 + +* href:超文本参考。链接文件的位置。 + +link 元素的结尾没有 。因此, 也是一个自闭合的标签。 + +``` + +``` + +如果只是得到一个女朋友,那么很容易:D + +可惜没有那么简单,让我们继续前进。 + +这是我们 loveletter.html 的内容: + +``` + +
      +

      Bat Letter

      + +

      + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +

      +

      You are the light of my life

      +

      + You complete my darkness with your light. I love: +

      +
        +
      • the way you see good in the worse
      • +
      • the way you handle emotionally difficult situations
      • +
      • the way you look at Justice
      • +
      +

      + I have learned a lot from you. You have occupied a special place in my heart over the time. +

      +

      I have a confession to make

      +

      + It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +

      +

      + I don't show my emotions, but I think this man behind the mask is falling for you. +

      +

      I love you Superman.

      +

      + Your not-so-secret-lover,
      + Batman +

      +
      +``` + +style.css 内容: + +``` +#letter-container{ + width:550px; +} +#header-bat-logo{ + width:100%; +} +``` + +保存文件并刷新,浏览器中的输出应保持不变。 + + +### 一些手续 + +我们的情书已经准备好给蝙蝠侠,但还有一些正式的片段。 + +与其他任何编程语言一样,HTML 自出生以来(1990 年)经历过许多版本,当前版本是 HTML5。 + +那么,浏览器如何知道你使用哪个版本的 HTML 来编写页面呢?要告诉浏览器你正在使用 HTML5,你需要在页面顶部包含 ``。对于旧版本的 HTML,这行不同,但你不需要了解它们,因为我们不再使用它们了。 + +此外,在之前的 HTML 版本中,我们曾经将整个文档封装在 `` 标签内。整个文件分为两个主要部分:Head 在 `` 里面,Body 在 `` 里面。这在 HTML5 中不是必须的,但由于兼容性原因,我们仍然这样做。让我们用 ``, ``, `` 和 `` 更新我们的代码: + +``` + + + + + + +
      +

      Bat Letter

      + +

      + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +

      +

      You are the light of my life

      +

      + You complete my darkness with your light. I love: +

      +
        +
      • the way you see good in the worse
      • +
      • the way you handle emotionally difficult situations
      • +
      • the way you look at Justice
      • +
      +

      + I have learned a lot from you. You have occupied a special place in my heart over the time. +

      +

      I have a confession to make

      +

      + It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +

      +

      + I don't show my emotions, but I think this man behind the mask is falling for you. +

      +

      I love you Superman.

      +

      + Your not-so-secret-lover,
      + Batman +

      +
      + + +``` + +主要内容在 `` 里面,元信息在 `` 里面。所以我们把 div 保存在 `` 里面并加载 `` 里面的样式表。 + +保存并刷新,你的 HTML 页面应显示与之前相同的内容。 + +### HTML 的标题 + +我发誓,这是最后一次改变。 + +你可能已经注意到选项卡的标题正在显示 HTML 文件的路径: + +![](https://cdn-images-1.medium.com/max/1000/1*PASKm4ji29hbcZXVSP8afg.jpeg) + +我们可以使用 `` 标签来定义 HTML 文件的标题。标题标签也像链接标签一样在 head 内部。让我们我们在标题中加上 “Bat Letter”: + +``` +<!DOCTYPE html> +<html> +<head> + <title>Bat Letter + + + +
      +

      Bat Letter

      + +

      + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +

      +

      You are the light of my life

      +

      + You complete my darkness with your light. I love: +

      +
        +
      • the way you see good in the worse
      • +
      • the way you handle emotionally difficult situations
      • +
      • the way you look at Justice
      • +
      +

      + I have learned a lot from you. You have occupied a special place in my heart over the time. +

      +

      I have a confession to make

      +

      + It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +

      +

      + I don't show my emotions, but I think this man behind the mask is falling for you. +

      +

      I love you Superman.

      +

      + Your not-so-secret-lover,
      + Batman +

      +
      + + +``` + +保存并刷新,你将看到在选项卡上显示的是 “Bat Letter” 而不是文件路径。 + +蝙蝠侠的情书现在已经完成。 + +恭喜!你用 HTML 制作了蝙蝠侠的情书。 + +![](https://cdn-images-1.medium.com/max/1000/1*qC8qtrYtxAB6cJfm9aVOOQ.jpeg) + +### 我们学到了什么 + +我们学习了以下新概念: + + * 一个 HTML 文档的结构 + + * 在 HTML 中如何写元素(\

      \

      ) + + * 如何使用 style 属性在元素内编写样式(这称为内联样式,尽可能避免这种情况) + + * 如何在 中编写元素的样式(这称为嵌入式样式) + + * 在 HTML 中如何使用 在单独的文件中编写样式并链接它(这称为链接样式表) + + * 什么是标签名称,属性,开始标签和结束标签 + + * 如何使用 id 属性为一个元素赋予 id + + * CSS 中的标签选择器和 id 选择器 + +我们学习了以下 HTML 标签: + + * \

      :用于段落 + + * \
      :用于换行 + + * \

        , \
      • :显示列表 + + * \
        :用于分组我们信件的元素 + + * \

        , \

        :用于标题和子标题 + + * \:用于插入图像 + + * \, \:用于粗体和斜体文字样式 + + * \ 包裹的 “style” 元素中编写所有样式。 - +* 内联样式:我们使用元素的 `style` 属性来编写样式。这是我们迄今为止使用的,但这不是一个好的实践。 +* 嵌入式样式:我们在由 `` 包裹的 “style” 元素中编写所有样式。 * 链接样式表:我们在具有 .css 扩展名的单独文件中编写所有元素的样式。此文件称为样式表。 -让我们来看看如何定义 “div” 的内联样式: +让我们来看看如何定义 `
        ` 的内联样式: ```
        @@ -484,9 +479,9 @@ div{ 在嵌入式样式中,我们编写的样式是与元素分开的。所以我们需要一种方法来关联元素及其样式。第一个单词 “div” 就做了这样的活。它让浏览器知道花括号 `{...}` 里面的所有样式都属于 “div” 元素。由于这种语法确定要应用样式的元素,因此它称为一个选择器。 -我们编写样式的方式保持不变:属性(宽度)和值(550px)用冒号(:)分隔,以分号(;)结束。 +我们编写样式的方式保持不变:属性(`width`)和值(`550px`)用冒号(`:`)分隔,以分号(`;`)结束。 -让我们从 “div” 和 “img” 元素中删除内联样式,将其写入 ` 将变得很大。这可能很快会混乱我们的主 HTML 文件。 +但是,你可以看到,随着我们包含越来越多的样式,`` 将变得很大。这可能很快会混乱我们的主 HTML 文件。 -因此,让我们更进一步,通过将 style 标签内的内容复制到一个新文件来使用链接样式。 +因此,让我们更进一步,通过将 ` 中编写元素的样式(这称为嵌入式样式) - - * 在 HTML 中如何使用 在单独的文件中编写样式并链接它(这称为链接样式表) - + * 如何在 `` 中编写元素的样式(这称为嵌入式样式) + * 在 HTML 中如何使用 `` 在单独的文件中编写样式并链接它(这称为链接样式表) * 什么是标签名称,属性,开始标签和结束标签 - * 如何使用 id 属性为一个元素赋予 id - * CSS 中的标签选择器和 id 选择器 我们学习了以下 HTML 标签: - * \

        :用于段落 - - * \
        :用于换行 - - * \

          , \
        • :显示列表 - - * \
          :用于分组我们信件的元素 - - * \

          , \

          :用于标题和子标题 - - * \:用于插入图像 - - * \, \:用于粗体和斜体文字样式 - - * \ + +        +                +                +        +
          + +    + +      +        +         

          +          +           

          +                +                 

            +                   
          • +                 

          +               
          +         
          +        +         

          +       
          +       
          +     
          +    +    +  + +``` + +This looks a lot more like HTML, and you can see it contains a number of HTML tags. After some preliminary tags and some particulars about displaying H2, H3, and H4 tags, you see a Table tag. This adds a graphical heading at the top of the page and uses some images already in the documentation files. + +After this, you get into the process of dissecting the various **submenuitem** tags, trying to create the nested listing structure as it appears in Scribus when you view the manual. One feature I did not try to duplicate is the ability to collapse and expand **submenuitem** areas. As you can imagine, it takes some time to sort through the number of nested lists you need to create, but when I finished, here is how it looked: + +![](https://opensource.com/sites/default/files/uploads/xml_scribusmenuinbrowser.png) + +This minimal editing to **menu.xml** does not interfere with Scribus' ability to show the manual in its own browser. I put this modified **menu.xml** file and the **scribus-manual.xsl** in the English documentation folder for 1.5.x versions of Scribus, so anyone using these versions can simply point their browser to the **menu.xml** file and it should show up just like you see above. + +A much bigger chore I took on a few years ago was to create a version of the ICD10 (International Classification of Diseases, version 10) when it came out. Many changes were made from the previous version (ICD9) to 10. These are important since these codes must be used for diagnostic purposes in medical practice. You can easily download XML files from the US [Centers for Medicare and Medicaid][2] website since it is public information, but—just as with the Scribus manual—these files are hard to use. + +Here is the beginning of the tabular listing of diseases: + +![](https://opensource.com/sites/default/files/uploads/xml_tabular_begin.png) + +One of the features I created was the color coding used in the listing shown here: + +![](https://opensource.com/sites/default/files/uploads/xml_tabular_body.png) + +As with **menu.xml** , the only editing I did in this **Tabular.xml** file was to add **** as the second line of the file. I started this project with the 2014 version, and I was quite pleased to find that the original **tabular.xsl** stylesheet worked perfectly when the 2016 version came out, which is the last one I worked on. The** Tabular.xml** file is 8.4MB, quite large for a plaintext file. It takes a few seconds to load into a browser, but once it's loaded, navigation is fast. + +While you may not often have to deal with an XML file in this way, if you do, I hope this article shows that your file can easily be turned into something much more usable. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/xml-browser + +作者:[Greg Pittman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-p +[b]: https://github.com/lujun9972 +[1]: https://www.scribus.net/ +[2]: https://www.cms.gov/ From 4aa8c8b3ab82d775ebb54d0bf892ce8b0725de0d Mon Sep 17 00:00:00 2001 From: Yixiang Zhao <674965440@qq.com> Date: Mon, 10 Dec 2018 21:45:46 +0800 Subject: [PATCH 0787/1143] =?UTF-8?q?=E6=8C=89=E7=85=A7=E6=96=B0=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=9A=84=E6=A0=BC=E5=BC=8F=E8=BF=9B=E8=A1=8C=E4=BA=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20181127 What the open source community means to me.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sources/talk/20181127 What the open source community means to me.md b/sources/talk/20181127 What the open source community means to me.md index ec4d8f7a6d..b092c1c33e 100644 --- a/sources/talk/20181127 What the open source community means to me.md +++ b/sources/talk/20181127 What the open source community means to me.md @@ -1,7 +1,5 @@ -translating by seriouszyx - [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (seriouszyx) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (What the open source community means to me) From 253f654fc962103f20e44a5422903e39a466209b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 10 Dec 2018 22:24:24 +0800 Subject: [PATCH 0788/1143] PRF:20181112 A Free, Secure And Cross-platform Password Manager.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @seriouszyx 翻译的很用心。 --- ...ure And Cross-platform Password Manager.md | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md b/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md index 35a1c44720..637bec8b63 100644 --- a/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md +++ b/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md @@ -1,5 +1,3 @@ -(本文共两处译注) - 一个免费、安全、跨平台的密码管理器 ====== @@ -7,17 +5,17 @@ 在这个现代化的互联网时代,你一定在许多网站上有多个账户,它可能是个人或官方邮箱账户、社交或专业网络账户、GitHub 账户和电子商务账户等。因此,对于不同的账户,你应该设置多个不同的密码。我相信你应该已经意识到为多个账户设置相同的密码是件疯狂又危险的事情。如果攻击者设法破解了你的一个账户,那么他/她很可能尝试使用相同的密码访问你的其他账户。所以,**强烈建议为不同的账户设置不同的密码**。 -不过,记住好几个密码是很困难的。你可以把它们写在纸上,但那也不是一个有效的方法,你可能会在一段时间后失去它们。这时密码管理器就派上用场了。密码管理器就像一个存储库,你可以在其中存储不同账户的所有密码,并用一个主密码将其锁定。这样,你需要记住的就只剩下主密码了。之前我们介绍过一个叫 [**KeeWeb**][1] 的开源密码管理器,今天,我们将介绍另外一款密码管理器———**Buttercup**。 +不过,记住好几个密码是很困难的。你可以把它们写在纸上,但那也不是一个有效的方法,你可能会在一段时间后失去它们。这时密码管理器就派上用场了。密码管理器就像一个存储库,你可以在其中存储不同账户的所有密码,并用一个主密码将其锁定。这样,你需要记住的就只剩下主密码了。之前我们介绍过一个叫 [KeeWeb][1] 的开源密码管理器,今天,我们将介绍另外一款密码管理器 ——— Buttercup。 ### 关于 Buttercup -Buttercup 是一个免费、开源、安全、跨平台的使用 **NodeJS** 编写的密码管理器。它可以帮助你将不同账户的所有登录凭证存储到加密存档中,该存档可以保存在本地系统或任何远程服务(如 DropBox、OwnCloud、NextCloud 和基于 WebDAV 的服务)中。它使用强大的 **256 位 AES 加密算法**,用主密码保存你的敏感数据。所以,除了拥有主密码的人以外,没有人可以访问你的登录信息。Buttercup 目前支持 Linux、Mac OS 和 Windows,还提供了一个浏览器扩展和移动应用程序。因此,你也可以在 Android 和 iOS 设备中的桌面应用程序和浏览器扩展程序中使用相同的存档。 +Buttercup 是一个自由、开源、安全、跨平台的密码管理器,使用 **NodeJS** 编写。它可以帮助你将不同账户的所有登录凭证存储到加密存档中,该存档可以保存在本地系统或任何远程服务(如 DropBox、OwnCloud、NextCloud 和基于 WebDAV 的服务)中。它使用强大的 **256 位 AES 加密算法**,用主密码保存你的敏感数据。所以,除了拥有主密码的人以外,没有人可以访问你的登录信息。Buttercup 目前支持 Linux、Mac OS 和 Windows,还提供了一个浏览器扩展和移动应用程序。因此,你也可以在 Android 和 iOS 设备中的桌面应用程序和浏览器扩展程序中使用相同的存档。 ### 安装 Buttercup 密码管理器 -(译注:此处没有找到合适的语言翻译)Buttercup 目前可作为 .deb、.rpm 软件包、便携式 AppImage 和用于 Linux 平台的 tar 归档文件使用。转到 [**releases pages**][2] 下载安装你想要的版本。 +Buttercup 目前在 Linux 平台上有 .deb、.rpm 软件包、可移植的 AppImage 和 tar 归档文件等安装包。转到其 [发布页][2] 下载安装你想要的版本。 -Buttercup 桌面应用程序在 [**AUR**][3] 中也可用,你可以使用 AUR 帮助程序(如 [**Yay**][4])在基于 Arch 的系统上安装,如下所示: +Buttercup 桌面应用程序在 [AUR][3] 中也可用,你可以使用 AUR 帮助程序(如 [Yay][4])在基于 Arch 的系统上安装,如下所示: ``` $ yay -S buttercup-desktop @@ -35,21 +33,23 @@ $ chmod +x buttercup-desktop-1.11.0-x86_64.AppImage $ ./buttercup-desktop-1.11.0-x86_64.AppImage ``` -运行此命令后,会提示是否要将 Buttercup AppImage 集成到你的系统中。如果选择“Yes”,则会将其添加到应用程序菜单并安装图标。如果不这样做,你仍然可以通过双击 AppImage 或在终端中使用上述命令启动应用程序。 +运行此命令后,会提示是否要将 Buttercup AppImage 集成到你的系统中。如果选择 “Yes”,则会将其添加到应用程序菜单并安装图标。如果不这样做,你仍然可以通过双击 AppImage 或在终端中使用上述命令启动应用程序。 ### 添加存档 第一次启动时,会看到下面的欢迎界面: + ![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-1.png) -我们还没有添加任何存档,所以让我们添加一个吧。单击“New Archive File”按钮,输入存档文件的名称,并选择它的保存位置。 +我们还没有添加任何存档,所以让我们添加一个吧。单击 “New Archive File” 按钮,输入存档文件的名称,并选择它的保存位置。 + ![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-2.png) -你可以随意命名。我把它命名为“mypass”,存档将以 **.bcup** 为扩展名保存在你选择的位置。 +你可以随意命名。我把它命名为 “mypass”,存档将以 .bcup 为扩展名保存在你选择的位置。 -如果你已经创建了一个,只需单击“Open Archive File”来选择它。 +如果你已经创建了一个,只需单击 “Open Archive File” 来选择它。 -接下来,buttercup 将提示你为新创建的存档输入主密码,建议提供一个强级别的密码,以保护存档不受未经授权的访问。 +接下来,Buttercup 将提示你为新创建的存档输入主密码,建议提供一个强级别的密码,以保护存档不会被未经授权访问。 ![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-3.png) @@ -57,7 +57,7 @@ $ ./buttercup-desktop-1.11.0-x86_64.AppImage 让我们继续在存档中添加账户的详细信息。 -### 在存档中添加条目(登陆凭证) +### 在存档中添加条目(登录凭证) 创建或打开存档后,你将看到下面的界面。 @@ -65,33 +65,33 @@ $ ./buttercup-desktop-1.11.0-x86_64.AppImage 它就像一个保险库,我们将保存不同账户的登录凭证。如你所见,我们并没有添加任何条目。让我们添加一些。 -点击右下角的“ADD ENTRY”按钮来添加新的条目,输入你想要保存的账户的信息。 +点击右下角的 “ADD ENTRY” 按钮来添加新的条目,输入你想要保存的账户的信息。 ![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-5-1.png) -在每个条目下面都有一个“ADD NEW FIELD”选项,可以用来添加其他的细节。只需点击它,然后添加要包含在条目中的字段。 +在每个条目下面都有一个 “ADD NEW FIELD” 选项,可以用来添加其他的细节。只需点击它,然后添加要包含在条目中的字段。 添加完所有条目后,你将在 Buttercup 界面的右侧窗格中看到它们。 ![][6] -### 添加新的群组 +### 添加新的分组 -你还可以将登陆的详细信息分组到不同的名称下,以便于识别。例如,你可以将所有邮箱账户分组到一个名为“my_mails”的名称下。默认情况下,你的登录详细信息将保存在“General”群组下。要创建新的群组,请点击“NEW GROUP”按钮并输入名称。在新的群组中创建新条目时,与上述的步骤相同,只需单击组名并开始添加条目。 +你还可以将登录的详细信息分组到不同的名称下,以便于识别。例如,你可以将所有邮箱账户分组到一个名为 “my_mails” 的名称下。默认情况下,你的登录详细信息将保存在 “General” 群组下。要创建新的群组,请点击 “NEW GROUP” 按钮并输入名称。在新的群组中创建新条目时,与上述的步骤相同,只需单击组名并开始添加条目。 -### 管理和访问登陆的详细信息 +### 管理和访问登录的详细信息 -存储在存档中的数据可以随时编辑、移动到其他组或彻底删除。例如,如果要将用户名或密码复制到剪切板,请右击该条目,然后选择“Copy to Clipboard”。 +存储在存档中的数据可以随时编辑、移动到其他组或彻底删除。例如,如果要将用户名或密码复制到剪切板,请右击该条目,然后选择 “Copy to Clipboard”。 ![][7] -(译注:没理解这个 in the future 的意思)要在将来编辑/修改数据,只需点击所选条目下的“Edit”按钮。 +要进一步编辑/修改数据,只需点击所选条目下的 “Edit” 按钮。 ### 在远程保存存档 默认情况下,Buttercup 会将数据保存在本地系统上。但是,你可以将它们保存在不同的远程服务(例如 Dropbox、OwnCloud、NextCloud 和基于 WebDAV 的服务)上。 -要连接这些服务,请点击 **File - > Connect Cloud Sources**。 +要连接这些服务,请点击 “File -> Connect Cloud Sources”。 ![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-8.png) @@ -107,13 +107,16 @@ Buttercup 允许你向其他密码管理器(例如 1Password、Lastpass 和 Ke ![][9] -Buttercup 是一个简单但成熟、功能齐全的密码管理器。多年来它一直在积极发展。如果你需要密码管理器,Buttercup 可能是个不错的选择。有关更多的详细信息,请参阅项目网站和 GitHub 页面。 +Buttercup 是一个简单但成熟、功能齐全的密码管理器。多年来它一直在积极开发。如果你需要密码管理器,Buttercup 可能是个不错的选择。有关更多的详细信息,请参阅项目网站和 GitHub 页面。 那就介绍到这里,希望它对你有用。更多的精彩内容即将到来,敬请关注! 谢谢! +### 资源 +- [Buttercup 网站](https://buttercup.pw/) +- [Buttercup GitHub 仓库](https://github.com/buttercup/buttercup-desktop) -------------------------------------------------------------------------------- @@ -122,13 +125,13 @@ via: https://www.ostechnix.com/buttercup-a-free-secure-and-cross-platform-passwo 作者:[SK][a] 选题:[lujun9972][b] 译者:[seriouszyx](https://github.com/seriouszyx) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.ostechnix.com/author/sk/ [b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/keeweb-an-open-source-cross-platform-password-manager/ +[1]: https://linux.cn/article-10211-1.html [2]: https://github.com/buttercup/buttercup-desktop/releases/latest [3]: https://aur.archlinux.org/packages/buttercup-desktop/ [4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ From b51ddad34e3b9f4655d3bc2ce5bc2ee4ac444bea Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 10 Dec 2018 22:26:04 +0800 Subject: [PATCH 0789/1143] PUB: 20181112 A Free, Secure And Cross-platform Password Manager.md @seriouszyx https://linux.cn/article-10331-1.html --- ...20181112 A Free, Secure And Cross-platform Password Manager.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181112 A Free, Secure And Cross-platform Password Manager.md (100%) diff --git a/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md b/published/20181112 A Free, Secure And Cross-platform Password Manager.md similarity index 100% rename from translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md rename to published/20181112 A Free, Secure And Cross-platform Password Manager.md From 07a7d22341595b95d8c6ec203b05b591349c0055 Mon Sep 17 00:00:00 2001 From: alim0x Date: Mon, 10 Dec 2018 22:47:00 +0800 Subject: [PATCH 0790/1143] [translating]DevOps is for everyone --- sources/talk/20181121 DevOps is for everyone.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20181121 DevOps is for everyone.md b/sources/talk/20181121 DevOps is for everyone.md index 075046f615..256a4e9fc3 100644 --- a/sources/talk/20181121 DevOps is for everyone.md +++ b/sources/talk/20181121 DevOps is for everyone.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (alim0x) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (DevOps is for everyone) From b71990694ae6cf5f3c85525c3d5fbeb0a1991cd1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 11 Dec 2018 08:59:51 +0800 Subject: [PATCH 0791/1143] translated --- ...le Formats with SoundConverter in Linux.md | 92 ------------------ ...le Formats with SoundConverter in Linux.md | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md create mode 100644 translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md diff --git a/sources/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/sources/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md deleted file mode 100644 index d77062526b..0000000000 --- a/sources/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (Easily Convert Audio File Formats with SoundConverter in Linux) -[#]: via: (https://itsfoss.com/sound-converter-linux/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: url: ( ) - -Easily Convert Audio File Formats with SoundConverter in Linux -====== - -**If you are looking for converting audio file formats to wav, mp3, ogg or any other format, SoundConverter is the tool you need in Linux.** - -![Audio Converter in Linux][1] - -So recently I purchased some DRM-free music. I got it from [SaReGaMa][2], the oldest and the largest music labels in India. The downloaded files were in HD quality and in WAV format. - -Unfortunately, Rhythmbox doesn’t play the WAV files. On top of that, a single file was around 70 MB in size. Imagine transferring such large music files to smartphones. It would eat up a lot of space unnecessarily. - -So I thought it was time to convert the WAV files to MP3, the evergreen and the most popular music file format. - -And for this task, I needed an audio converter in Linux. In this quick tutorial, I’ll show you how can you convert your audio files from one format to another easily with a GUI tool called SoundCoverter. - -### Installing SoundConverter in Linux - -[SoundConverter][3] is a popular free and open source software. It should be available in the official repository of most Linux distributions. - -Ubuntu/Linux Mint users can simply search for SoundConverter in the software center and install it from there. - -![SoundConverter application in Software Center of Ubuntu][4]SoundConverter can be installed from Software Center - -Alternatively, you can use the command line way. In Debian and Ubuntu based systems, you can use the following command: - -``` -sudo apt install soundconverter -``` - -For Arch, Fedora and other non-Debian based distributions, you can use the software center or the package manager of your distribution. - -### Using SoundConverter to convert audio file formats in Linux - -Once you have installed SoundConverter, search for it in the menu and start it. - -The default interface looks like this and it cannot be more simple than this: - -![SoundConverter application interface in Linux][5]Simple Interface - -Converting audio file format is as easy as selecting the file and clicking on convert. - -However, I would advise you to check the default settings at least on the first run. By default it converts the audio file to OGG file format and you may not want that. - -![Preferences in SoundConverter][6]Default output settings can be changed in Preferences - -To change the default output settings, click on the Preferences icon visible on the interface. You’ll see plenty of options to change here. - -You can change the default output format, bitrate, quality etc. You can also choose if you want to keep the converted files in the same folder as the original or not. - -There is also an option of automatically deleting the original file after conversion. I don’t think you should use that option. - -You can also change the output file name. By default, it will just change the suffix but you can also choose to name it based on track number, title, artist etc. For that to happen, you should have proper metadata on the original file. - -Speaking of metadata, have you heard of [MusicBrainz Picard][7]? This tool helps you automatically updates the metadata of your local music files. - -### Conclusion - -I have discussed [recording audio in Linux][8] previously with a similar tiny application. Such nifty tools actually make life easier with their focused aim of completing a certain task. You may use full-fledged and a lot better audio editing tool like [Audacity][9] but that may be complicated to use for smaller tasks like converting audio file formats. - -I hope you like SoundConverter. If you use some other tool, do mention that in the comments and I may cover it here on It’s FOSS. Enjoy! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/sound-converter-linux/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Convert-audio-file-format-linux.png?resize=800%2C450&ssl=1 -[2]: https://en.wikipedia.org/wiki/Saregama -[3]: http://soundconverter.org/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-software-center.png?ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux.jpeg?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux-preferences.jpeg?resize=800%2C431&ssl=1 -[7]: https://itsfoss.com/musicbrainz-picard/ -[8]: https://itsfoss.com/record-streaming-audio/ -[9]: https://www.audacityteam.org/ diff --git a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md new file mode 100644 index 0000000000..0ad348edb0 --- /dev/null +++ b/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md @@ -0,0 +1,94 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Easily Convert Audio File Formats with SoundConverter in Linux) +[#]: via: (https://itsfoss.com/sound-converter-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: url: ( ) + +在 Linux 中使用 SoundConverter 轻松转换音频文件格式 +====== + +**如果你正在寻找将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中需要的工具。** + +![Audio Converter in Linux][1] + +最近我购买了一些没有 DRM 的音乐。我是从 [SaReGaMa][2] 那里买的,这是一家印度历史最悠久,规模最大的音乐品牌。下载的文件采用高清质量的 WAV 格式。 + +不幸的是,Rhythmbox 无法播放 WAV。最重要的是,单个文件大小约为 70MB。想象一下,将这么大的音乐传输到智能手机。它会不必要地占用大量空间。 + +所以我认为是时候将 WAV 文件转换为 MP3,这个长青且最流行的音乐文件格式。 + +为此,我需要一个在 Linux 中的音频转换器。在这个教程中,我将向你展示如何使用名为 SoundCoverter 的 GUI 工具轻松地将音频文件从一种格式转换为另一种格式。 + +### 在 Linux 中安装 SoundConverter + +[SoundConverter][3] 是一款流行的免费开源软件。它应该可以在大多数 Linux 发行版的官方仓库中找到。 + +Ubuntu/Linux Mint 用户只需在软件中心搜索 SoundConverter 并从那里安装即可。 + +![SoundConverter application in Software Center of Ubuntu][4] +SoundConverter 可以从软件中心安装 + +或者,你可以使用命令行方式。在基于 Debian 和 Ubuntu 的系统中,你可以使用以下命令: + +``` +sudo apt install soundconverter +``` + +在 Arch、Fedora 和其他非基于 Debian 的发行版中,你可以使用你的发行版的软件中心或软件包管理器。 + +### 在 Linux 中使用 SoundConverter 转换音频文件格式 + +安装完 SoundConverter 后,在菜单中搜索并启动它。 + +默认界面看起来像这样,它不能比这简单: + +![SoundConverter application interface in Linux][5]Simple Interface + +转换音频文件格式只要选择文件并单击转换。 + +但是,我建议你至少在第一次运行时检查下默认设置。默认情况下,它会将音频文件转换为 OGG 文件格式,你可能不希望这样。 + +![Preferences in SoundConverter][6] +可以在“首选项”中更改默认输出设置 + +要更改默认输出设置,请单击界面上的“首选项”图标。你会在这里看到很多可更改的选择。 + +你可以更改默认输出格式、比特率、质量等。你还可以选择是否要将转换后的文件保存在与原始文件相同的文件夹中。 + +转换后还可以选择自动删除原始文件。我不认为你应该使用那个选项。 + +你还可以更改输出文件名。默认情况下,它只会更改后缀,但你也可以选择根据曲目编号、标题、艺术家等进行命名。为此,原始文件中应包含适当的元数据。 + +说到元数据,你听说过 [MusicBrainz Picard][7]吗?此工具可帮助你自动更新本地音乐文件的元数据。 + +### 总结 + +我之前用讨论过用一个小程序[在 Linux 中录制音频][8]。这些很棒的工具通过专注某个特定的任务使得生活更轻松。你可以使用成熟和更好的音频编辑工具,如 [Audacity][9],但对于较小的任务,如转换音频文件格式,它可能用起来很复杂。 + +我希望你喜欢 SoundConverter。如果你使用其他工具,请在评论中提及,我会在 FOSS 中提及。使用开心! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sound-converter-linux/ + +作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Convert-audio-file-format-linux.png?resize=800%2C450&ssl=1 +[2]: https://en.wikipedia.org/wiki/Saregama +[3]: http://soundconverter.org/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-software-center.png?ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux.jpeg?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux-preferences.jpeg?resize=800%2C431&ssl=1 +[7]: https://itsfoss.com/musicbrainz-picard/ +[8]: https://itsfoss.com/record-streaming-audio/ +[9]: https://www.audacityteam.org/ \ No newline at end of file From 0cc97d4d35429b73e226914ad0874e2d98edcccb Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 11 Dec 2018 09:02:11 +0800 Subject: [PATCH 0792/1143] translating --- ...81205 Bring some color to your Linux terminal with lolcat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md index 740e95c3bf..3e070414ae 100644 --- a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md +++ b/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (Bring some color to your Linux terminal with lolcat) From dad4389513a2bc7c0d212d38c74cfc63bb8f99f8 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 11 Dec 2018 11:44:27 +0800 Subject: [PATCH 0793/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Snake=20your=20?= =?UTF-8?q?way=20across=20your=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ake your way across your Linux terminal.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/tech/20181210 Snake your way across your Linux terminal.md diff --git a/sources/tech/20181210 Snake your way across your Linux terminal.md b/sources/tech/20181210 Snake your way across your Linux terminal.md new file mode 100644 index 0000000000..5ae452dcf5 --- /dev/null +++ b/sources/tech/20181210 Snake your way across your Linux terminal.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Snake your way across your Linux terminal) +[#]: via: (https://opensource.com/article/18/12/linux-toy-snake) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Snake your way across your Linux terminal +====== +Python isn't the only snake you'll find at the Linux command line with this classic 1970s game remake. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-snake.png?itok=oNhqUTDu) + +Welcome back to the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. It's hard to say exactly, but my definition is anything that helps you have fun at the terminal. + +We've been on a roll with games over the weekend, and it was fun, so let's look at one more game today, Snake! + +Snake is an oldie but goodie; versions of it have been around seemingly forever. The first version I remember playing was one called [Nibbles][1] that came packaged with [QBasic][2] in the 1990s, and was probably pretty important to my understanding of what a programming language even was. Here I had the source code to a game that I could modify and just see what happens, and maybe learn something about what all of those funny little words that made up a programming language were all about. + +Today's [Snake][3] is written in Go, and while it's simple, it's just as much fun as the original. Like most simple old games, there are a ton of versions to choose from. In Snake's case, there's even a version in the classic [bsdgames][4] package that's almost certainly packaged for your distribution. + +But what I like about this version of Snake is that it's packaged for Docker so I can easily run it in one line from my terminal without worrying about anything disto-specific. That, and it makes use of 15 randomized food emojis for the snake to eat. I'm a sucker for food emojis. Anyway, give it a try using: + +``` +$ docker run -ti dyego/snake-game +``` + +This Snake is licensed as open source under an MIT license, and you can check out the source code [on GitHub][3]. +![](https://opensource.com/sites/default/files/uploads/linux-toy-snake-animated.gif) +Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [Powers of two, powers of Linux: 2048 at the command line][5], and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-snake + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Nibbles_(video_game) +[2]: https://en.wikipedia.org/wiki/QBasic +[3]: https://github.com/DyegoCosta/snake-game +[4]: https://github.com/vattam/BSDGames +[5]: https://opensource.com/article/18/12/linux-toy-2048 From 95fe23b0b6775885bd206bc5f84816d4111d411c Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 11 Dec 2018 11:47:47 +0800 Subject: [PATCH 0794/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20get?= =?UTF-8?q?=20started=20in=20AI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20181210 How to get started in AI.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20181210 How to get started in AI.md diff --git a/sources/tech/20181210 How to get started in AI.md b/sources/tech/20181210 How to get started in AI.md new file mode 100644 index 0000000000..b0ac291557 --- /dev/null +++ b/sources/tech/20181210 How to get started in AI.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to get started in AI) +[#]: via: (https://opensource.com/article/18/12/how-get-started-ai) +[#]: author: (Gordon Haff https://opensource.com/users/ghaff) + +How to get started in AI +====== +Before you can begin working in artificial intelligence, you need to acquire some human intelligence. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain-think-ai-intelligence-ccby.png?itok=C-gK01E_) + +I've both asked and been asked about the best way to learn more about artificial intelligence (AI). What should I read? What should I watch? I'll get to that. But, first, it's useful to break down this question, given that AI covers a lot of territory. + +One important distinction to draw is between the research side of AI and the applied side. Cassie Kozyrkov of Google [drew this distinction][1] in a talk at the recent O'Reilly Artificial Intelligence Conference in London, and it's a good one. + +Research AI is rather academic in nature and requires a heavy dose of math across a variety of disciplines before you even get to those parts that are specific to AI. This aspect of AI focuses on the algorithms and tools that drive the state of AI forward. For example, what neural network structures might improve vision recognition results? How might we make unsupervised learning a more generally useful approach? Can we find ways to understand better how deep learning pipelines come up with the answers they do? + +Applied AI, on the other hand, is more about using existing tools to obtain useful results. Open source has played a big role here in providing free and often easy-to-use software in a variety of languages. Public cloud providers have also devoted a lot of attention to providing machine learning services, models, and datasets that make the onramp to getting started with AI much simpler than it would be otherwise. + +I'll add at this point that applied AI practitioners shouldn't treat their tools as some sort of black box that spits out answers for mysterious reasons. At a minimum, they need to understand the limits and potential biases of different techniques, models, and data collection approaches. It's just that they don't necessarily need to delve deeply into all the theory underpinning every part of their toolchain. + +Although it's probably less important for working in AI on a day-to-day basis, it's also useful to understand the broader context of AI. It goes beyond the narrow scope of deep learning on neural networks that have been so important to the gains made in reinforcement learning and supervised learning to date. For example, AI is often viewed as a way to augment (rather than replace) human judgment and decisions. But the handoff between machine and human has its own pitfalls. + +With that background, here are some study areas and resources you may find useful. + +### Research AI + +In a lot of respects, a list of resources for research AI mirror those in an undergraduate (or even graduate) computer science program that's focused on AI. The main difference is that the syllabus you draw up may be more interdisciplinary than more traditionally focused university curricula. + +Where you start will depend on your computer science and math background. + +If it's minimal or rusty, but you still want to develop a deep understanding of AI fundamentals, you'll benefit from taking some math courses to start. There are many options on massive online open courses (MOOCs) like the nonprofit [edX][2] platform and [Coursera][3]. (Both platforms charge for certifications, but edX makes all the content available for free to people just auditing the course.) + +Typical foundational courses could include: + ++ [MIT's Calculus courses][22], starting with differentiation ++ [Linear Algebra][23] (University of Texas) ++ Probability and statistics, such as MIT's [Probability—The Science of Uncertainty and Data][24] + + +To get deeper into AI from a research perspective, you'll probably want to get into all these areas of mathematics and more. But the above should give you an idea of the general branches of study that are probably most important before delving into machine learning and AI proper. + +In addition to MOOCs, resources such as [MIT OpenCourseWare][4] provide the syllabus and various supporting materials for a wide range of mathematics and computer science courses. + +With the foundations in place, you can move onto more specialized courses in AI proper. Andrew Ng's AI MOOC, from when he was teaching at Stanford, was one of the early courses to popularize the whole online course space. Today, his [Neural Networks and Deep Learning][5] is part of the Deep Learning specialization at Coursera. There are corresponding programs on edX. For example, Columbia offers an [Artificial Intelligence MicroMasters][6]. + +In addition to courses, a variety of textbooks and other learning material are also available online. These include: + + * [Neural Networks and Deep Learning][7] + * [Deep Learning][8] from MIT Press by Ian Goodfellow and Yoshua Bengio and Aaron Courville + +### Applied AI + +Applied AI is much more focused on using available tools than building new ones. Some appreciation of the mathematical underpinnings, especially statistics, is still useful—arguably even necessary—but you won't be majoring in that aspect of AI to the same degree you would in a research mode. + +Programming is a core skill here. While different programming languages can come into play, a lot of libraries and toolsets—such as [PyTorch][9]—rely on Python, so that's a good skill to have. Especially if you have some level of programming background, MIT's [Introduction to Computer Science and Programming Using Python][10], based on its on-campus 6.001 course, is a good primer. If you're truly new to programming, Charles Severance's [Programming for Everybody (Getting Started with Python)][11] from the University of Michigan doesn't toss you into the deep end of the pool the way the MIT course does. + +[The R programming language][12] is also a useful skill to add to your toolbox. While it's less used in machine learning (ML) per se, it's common for a variety of other data science tasks, and applied AI/ML and data science often blend in practice. For example, many tasks associated with organizing and cleaning data apply equally whatever analysis techniques you'll eventually use. A MOOC sequence like Harvard's [Data Science certificate][13] is an example of a set of courses that provide a good introduction to working with data. + +Another open source software library you're likely to encounter if you do any work with AI is [TensorFlow][14]. It was originally developed by researchers and engineers from the Google Brain team within Google's AI organization. [Google offers a variety of tutorials][15] to get started with TensorFlow using the high-level Keras API. You can run TensorFlow locally as well as online in Google Cloud. + +In general, all of the big public cloud providers offer online datasets and ML services that can be an easy way to get started. However, especially as you move beyond "play" datasets and applications, you need to start thinking seriously about the degree to which you want to be locked into a single provider. + +Datasets for your exploratory learning projects are available from many different sources. In addition to the public cloud providers, [Kaggle][16] is another popular source and also a good learning resource more broadly. Government data is also increasingly available in digital form. The US Federal Government's [Data.gov][17] claims over 300,000 datasets. State and local governments also publish data on everything from restaurant health ratings to dogs' names. + +### Miscellany + +I'll close by noting that AI is a broad topic that isn't just about math, programming, and data. AI as a whole touches many other fields, including cognitive psychology, linguistics, game theory, operations research, and control systems. Indeed, a concern among at least some AI researchers today is that the field has become too fixated on a small number of techniques that have become powerful and interesting only quite recently because of the intersection of processing power and big data. Many longstanding problems in understanding how humans learn and reason remain largely unsolved. Developing at least some appreciation for these broader problem spaces will better enable you to place AI within a broader context. + +One of my favorite examples is the [Humans and Autonomy Lab][18] at Duke. The work in this lab touches on all the challenges of humans working with machines, such as how autopilots can create ["Children of the Magenta"][19] who are unable to take control quickly if the automation fails. A basic brain-science course, such as MIT's [Introduction to Psychology][20], provides some useful context for the relationship between human intelligence and machine intelligence. Another course in a similar vein, but taught by the late Marvin Minsky from MIT's Electrical Engineering and Computer Science department, is [The Society of Mind][21]. + +If there's one key challenge to learning about AI, it's not that raw materials and tools aren't readily available. It's that there are so many of them. My objective hasn't been to give you a comprehensive set of pointers. Rather, it's been to both point out the different paths you can take and provide you with some possible starting points. Happy learning! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/how-get-started-ai + +作者:[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://www.youtube.com/watch?v=RLtI7r3QUyY +[2]: https://www.edx.org/ +[3]: https://www.coursera.org/ +[4]: https://ocw.mit.edu/index.htm +[5]: https://www.coursera.org/learn/neural-networks-deep-learning +[6]: https://www.edx.org/micromasters/columbiax-artificial-intelligence +[7]: http://neuralnetworksanddeeplearning.com/ +[8]: http://www.deeplearningbook.org/ +[9]: https://pytorch.org/ +[10]: https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python +[11]: https://www.coursera.org/learn/python +[12]: https://www.r-project.org/about.html +[13]: https://www.edx.org/professional-certificate/harvardx-data-science +[14]: https://www.tensorflow.org/ +[15]: https://www.tensorflow.org/tutorials/ +[16]: https://www.kaggle.com/ +[17]: https://www.data.gov/ +[18]: https://hal.pratt.duke.edu/ +[19]: https://99percentinvisible.org/episode/children-of-the-magenta-automation-paradox-pt-1/ +[20]: https://ocw.mit.edu/courses/brain-and-cognitive-sciences/9-00sc-introduction-to-psychology-fall-2011/ +[21]: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-868j-the-society-of-mind-fall-2011/ +[22]: https://www.edx.org/course/calculus-1a-differentiation +[23]: https://www.edx.org/course/linear-algebra-foundations-to-frontiers +[24]: https://courses.edx.org/courses/course-v1:MITx+6.431x+3T2018/course/ From 7e96a46a1b62c2b7fb76166bd8e31187361a8ea1 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 11 Dec 2018 11:51:23 +0800 Subject: [PATCH 0795/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20McFly=20?= =?UTF-8?q?=E2=80=93=20A=20Replacement=20To=20=E2=80=98Ctrl+R=E2=80=99=20B?= =?UTF-8?q?ash=20History=20Search=20Feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To ‘Ctrl-R- Bash History Search Feature.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20181210 McFly - A Replacement To ‘Ctrl-R- Bash History Search Feature.md diff --git a/sources/tech/20181210 McFly - A Replacement To ‘Ctrl-R- Bash History Search Feature.md b/sources/tech/20181210 McFly - A Replacement To ‘Ctrl-R- Bash History Search Feature.md new file mode 100644 index 0000000000..4c1da08110 --- /dev/null +++ b/sources/tech/20181210 McFly - A Replacement To ‘Ctrl-R- Bash History Search Feature.md @@ -0,0 +1,160 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (McFly – A Replacement To ‘Ctrl+R’ Bash History Search Feature) +[#]: via: (https://www.ostechnix.com/mcfly-a-replacement-to-ctrlr-bash-history-search-feature/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +McFly – A Replacement To ‘Ctrl+R’ Bash History Search Feature +====== +![](https://www.ostechnix.com/wp-content/uploads/2018/12/mcfly-720x340.png) +If you spend a lot of time on CLI mode, you should definitely used or heard about **reverse search** function in BASH. The keyboard shortcut to do reverse search in Bash is **Ctrl+r**. Using bash reverse search, we can bring up all commands which we used previously executed without having to re-type them every time. You can, of course, use UP/DOWN arrows to search your bash history. However, Ctrl+r will make this process much easier and faster. Today, I Stumbled upon a replacement to ‘Ctrl+r’ Bash history search feature. Meet **“McFly”** , a simple tool written in **Rust** programming language that replaces the default Ctrl+r Bash history search with an intelligent search engine. All command suggestions made by McFly are prioritized in real time with a small **neural network**. + +McFly rebinds Ctrl+r functionality to bring up all recently executed commands from your Bash history. It augments your shell history by tracking the following: + + * Command exit status, + * timestamp (When you run the command), + * and execution directory (Where you run the command). + + + +It saves all tracking details in a SQLite database. Since it tracks the command’s historical exit status, you can simply ignore the old failed commands. Cool, yeah? + +When suggesting a command, McFly considers the following facts: + + * On which directory you ran the command. You’re likely to repeat that command in the same directory in future. + * What commands you typed before the command. + * How often you run the command. + * When you last ran the command. + * If you’ve selected the command in McFly before. + * The command’s historical exit status. Because, you probably don’t want to run old failed commands, right? + + + +McFly maintains your default Bash history file, so you can stop using McFly at any time. McFly is not just for BASH, it is also extendable for other shells as well. + +### Installing McFly + +McFly can be installed using Linuxbrew on Linux. If you haven’t installed Linuxbrew yet, refer the following link. + +[Linuxbrew – A Common Package Manager For Linux And Mac OS X][1] + +Once Linuxbrew installed, run the following commands to install McFly: + +``` +$ brew tap cantino/mcfly https://github.com/cantino/mcfly + +$ brew install mcfly +``` + +After the installation is completed, you will see the following output. + +``` +==> Installing mcfly from cantino/mcfly +==> Downloading https://github.com/cantino/mcfly/releases/download/v0.2.5/mcfly-v0 +==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.c +######################################################################## 100.0% +==> ONE MORE STEP! Edit ~/.bashrc and add the following: + +if [ -f $(brew --prefix)/opt/mcfly/mcfly.bash ]; then +. $(brew --prefix)/opt/mcfly/mcfly.bash +fi +🍺 /home/linuxbrew/.linuxbrew/Cellar/mcfly/v0.2.5: 4 files, 3.5MB, built in 33 seconds +``` +![](https://www.ostechnix.com/wp-content/uploads/2018/12/install-mcfly.png) +As you can see, we need to do one more step before start using McFly. + +Add the following lines to your **~/.bashrc** file: + +``` +if [ -f $(brew --prefix)/opt/mcfly/mcfly.bash ]; then +. $(brew --prefix)/opt/mcfly/mcfly.bash +fi +``` + +Finally, run the following command to take effects changes: + +``` +$ source ~/.bashrc +``` + +Your BASH history will be imported to McFly database when you run this command for the first time. It will take a few moments depending upon size of your bash history file. Once the import is done, you will see the following message. + +``` +McFly: Importing Bash history for the first time. This may take a minute or two...done. +``` + +You can now start using McFly. + + +### Usage + +To search through your command history, just type ‘mcfly search’ followed by the part of the command name and hit ENTER key. Mcfly will display the command suggestions based on the search query you just type. + +``` +$ mcfly search +``` + +For instance, I type the following command: + +``` +$ mcfly search mk +``` + +Here is the sample output from my Ubuntu machine: + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/mcfly-command-1.png) + +As you can see, I have used ‘mkdir’ command two times. If you want to run a command from the list of suggestions, just use **UP/DOWN** arrows to select it and hit ENTER to run it immediately. If you want to edit a command, choose it and hit **TAB** key to bring it back to your Terminal and then edit before running it. To delete the selected command from the history, just press **F2**. + +Alternatively, type the following command to open the history search and then type any command or part of the command to view the suggestions from your history. + +``` +$ mcfly search +``` + +McFly will display the command suggestions as you type. + +Here is a short video demonstration of McFly: +![](https://www.ostechnix.com/wp-content/uploads/2018/12/mcfly-demo.gif) +View help: + +``` +$ mcfly --help +``` + + +### Remove McFly + +Don’t like McFly, no problem! Remove it using the following commands: + +``` +$ brew uninstall mcfly + +$ brew untap cantino/mcfly +``` + +Finally, remove the lines which we added earlier from **~/.bashrc** file. + +And, that’s all for now. More good stuffs to come. Stay tuned! + +Cheers! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/mcfly-a-replacement-to-ctrlr-bash-history-search-feature/ + +作者:[SK][a] +选题:[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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/linuxbrew-common-package-manager-linux-mac-os-x/ From 8f8020834752d49289f78b3123a353439f3e3f2d Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 11 Dec 2018 12:13:30 +0800 Subject: [PATCH 0796/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Four=20Easy=20W?= =?UTF-8?q?ays=20to=20Search=20Or=20Find=20Files=20And=20Folders=20in=20Li?= =?UTF-8?q?nux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...arch Or Find Files And Folders in Linux.md | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md diff --git a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md new file mode 100644 index 0000000000..8dde618420 --- /dev/null +++ b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux) +[#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/) +[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) + +Four Easy Ways to Search Or Find Files And Folders in Linux +====== + +Linux admins can’t able to leave a day without performing a file search as this one of the activity for their routine. + +It’s good to know all the file search stuffs because it would help you in many ways when you are working on headless server. + +These commands are not complicate to remember because these are using a standard syntax. + +This can be performed through Four Linux commands and each command has their own unique feature. + +### Method-1: Search Files And Folders in Linux Using find Command + +Find command is widely used and very famous command to search files and folders in Linux. It searches given files in the current directory and recursively through its sub-directories based on the search criteria. + +It allow users to perform all kind of file searches based on the criteria lie by size, name, owner, group, type, permissions, date, and other criteria. + +Run the following command to find a given file in system. + +``` +# find / -iname "sshd_config" +/etc/ssh/sshd_config +``` + +Run the following command to find a given folder in system. To search a folder in Linux we need to use `-type` parameter. + +``` +# find / -type d -iname "ssh" +/usr/lib/ssh +/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh +/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh +/etc/ssh +``` + +Use wildcard option to search set of files on your system. We are going to search all files available in the system with `.config` extension. + +``` +# find / -name "*.config" +/usr/lib/mono/gac/avahi-sharp/1.0.0.0__4d116c78973743f5/avahi-sharp.dll.config +/usr/lib/mono/gac/avahi-ui-sharp/0.0.0.0__4d116c78973743f5/avahi-ui-sharp.dll.config +/usr/lib/python2.7/config/Setup.config +/usr/share/git/mw-to-git/t/test.config +/var/lib/lightdm/.config +/home/daygeek/.config +/root/.config +/etc/skel/.config +``` + +Use the following command format to find an empty files and folders in system. + +``` +# find / -empty +``` + +Use the following command combination to find all files containing specific text on Linux. + +``` +# find / -type f -exec grep "Port 22" '{}' \; -print +# find / -type f -print | xargs grep "Port 22" +# find / -type f | xargs grep 'Port 22' +# find / -type f -exec grep -H 'Port 22' {} \; +``` + +### Method-2: Search Files And Folders in Linux Using locate command + +locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system. + +It uses a database rather than hunting individual directory paths to get a given file. + +locate command doesn’t pre-installed in most of the distributions so, use your distribution package manager to install it. + +The database is updated regularly through cron, however we can manually update it by running the following command. + +``` +$ sudo updatedb +``` + +Simply run the following command to list the given file or folder. There is no specific options need to be specified in locate command to print file or folder. + +To search `ssh` folder in system. + +``` +# locate --basename '\ssh' +/etc/ssh +/usr/bin/ssh +/usr/lib/ssh +/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh +/usr/lib/go/src/cmd/go/testdata/failssh/ssh +/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh +``` + +To search `ssh_config` file in system. + +``` +# locate --basename '\sshd_config' +/etc/ssh/sshd_config +``` + +### Method-3: Search Files in Linux Using which command + +TThe which command returns the full path of the executable that would have been executed when the command had been entered in terminal. + +It’s very useful when you want to create a desktop shortcut or symbolic link for executable files. + +Which command searches the directories listed in the current user’s PATH environment variable not for all the users. I mean, when you are logged in your own account and you can’t able to search for root user file or directory. + +Run the following command to print the full path of the vim executable file location. + +``` +# which vi +/usr/bin/vi +``` + +Alternatively, it’s allowing user to perform multiple file search in one shot. + +``` +# which -a vi sudo +/usr/bin/vi +/bin/vi +/usr/bin/sudo +/bin/sudo +``` + +### Method-4: Search Files in Linux Using whereis command + +The whereis command used to search the binary, source, and man page files for a given command. + +``` +# whereis vi +vi: /usr/bin/vi /usr/share/man/man1/vi.1p.gz /usr/share/man/man1/vi.1.gz +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/ + +作者:[Prakash Subramanian][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/prakash/ +[b]: https://github.com/lujun9972 From 512e039533da3e82b93ff6f58f596fd5a53256a1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 12:48:01 +0800 Subject: [PATCH 0797/1143] PRF:20181121 10 ways to give thanks to open source and free software maintainers.md @geekpi --- ...en source and free software maintainers.md | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md b/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md index 5dcda79b9e..9f3b5b970f 100644 --- a/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md +++ b/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (10 ways to give thanks to open source and free software maintainers) [#]: via: (https://opensource.com/article/18/11/ways-give-thanks-open-source) @@ -8,39 +8,41 @@ [#]: url: ( ) 感谢开源和自由软件维护者的 10 种方法 -====== -如何表达你的感激之情。 -![](https://opensource.com/users/moshez) +======= -每天,我都使用高质量的软件,这些软件由没有要求付款的人开发和维护,他们尊重我的自由,并且慷慨地付出时间和精力。 +> 如何表达你的感激之情。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE) + +每天,我使用的那些高质量的软件 —— 开发和维护这些软件的人不需要我为之付款,他们尊重我的自由,并且慷慨地付出时间和精力。 在这个感恩的季节,我鼓励那些也使用和欣赏开源和自由软件维护者工作的人表达你的感激之情。以下是十种方法: ### 容易做到的 - 1. 发送电子邮件,感谢开发人员。具体点说,告诉他们你使用他们的什么软件以及你如何获益的。 - 2. 使用你最喜爱的社交媒体平台宣传它。 - 3. 写一篇关于你最喜欢的软件的博客文章。 +1、发送电子邮件感谢开发人员。具体点说,告诉他们你使用他们的什么软件以及它是如何帮助了你。 +2、使用你最喜爱的社交媒体平台宣传它。 +3、写一篇关于你最喜欢的软件的博客文章。 ### 捐款 - 4. 如果你最喜欢的开源项目接受捐款,请汇款。 - 5. 如果你受雇于使用开源软件的公司,看你是否可以说服管理层赞助某些项目。 - 6. 提供最高设置额度的捐款。社交动机能做的不可思议! +4、如果你最喜欢的开源项目接受捐款,请汇款。 +5、如果你受雇于使用开源软件的公司,看你是否可以说服管理层赞助某些项目。 +6、尽你所能地捐款。社交动机能做的不可思议! ### 花费时间 - 7. 帮助查看补丁。 - 8. 帮助分类 bug。 - 9. 回答 IRC、邮件列表或 [Stack Overflow][1] 中的问题。 +7、帮助审查补丁。 +8、帮助分类 bug。 +9、回答 IRC、邮件列表或 [Stack Overflow][1] 中的问题。 -**10. 额外的:**如果你像我一样,你在某个时候对开源社区的其他人说了一些严厉的话。承诺做得更好:用善良和开放沟通。感谢的最好方式是让开源社区成为人们能舒适沟通的地方。 +**10、额外的:**如果你像我一样,你在某个时候对开源社区的其他人说了一些严厉的话。承诺做得更好:用善良和开放沟通。感谢的最好方式是让开源社区成为人们能舒适沟通的地方。 -------------------------------------------------------------------------------- @@ -49,10 +51,10 @@ via: https://opensource.com/article/18/11/ways-give-thanks-open-source 作者:[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/) 荣誉推出 [a]: https://opensource.com/users/moshez [b]: https://github.com/lujun9972 -[1]: https://meta.stackoverflow.com/ \ No newline at end of file +[1]: https://meta.stackoverflow.com/ From b63e87093936d6aff9f034a5da6953458f467613 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 12:48:54 +0800 Subject: [PATCH 0798/1143] PUB:20181121 10 ways to give thanks to open source and free software maintainers.md @geekpi https://linux.cn/article-10333-1.html --- ...ive thanks to open source and free software maintainers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20181121 10 ways to give thanks to open source and free software maintainers.md (96%) diff --git a/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md b/published/20181121 10 ways to give thanks to open source and free software maintainers.md similarity index 96% rename from translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md rename to published/20181121 10 ways to give thanks to open source and free software maintainers.md index 9f3b5b970f..4a70429555 100644 --- a/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md +++ b/published/20181121 10 ways to give thanks to open source and free software maintainers.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (10 ways to give thanks to open source and free software maintainers) [#]: via: (https://opensource.com/article/18/11/ways-give-thanks-open-source) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10333-1.html) 感谢开源和自由软件维护者的 10 种方法 ======= From a0f1995061a808b012981aa58bde51737029454f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 13:05:22 +0800 Subject: [PATCH 0799/1143] PRF:20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md @oneforalone --- ...emails to org-mode and org-mode syncing.md | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md b/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md index 976979192f..f9e423899d 100644 --- a/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md +++ b/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md @@ -1,55 +1,56 @@ -Emacs #4:使用org-mode自动管理邮件及同步文档 +Emacs 系列(四):使用 Org 模式自动管理邮件及同步文档 ====== -这是 [Emacs 和 org-mode 系类][4]的第四篇。 -至今为止,你已经见识到了 org-mode 的强大和高效,如果你像我一样,你可能会想: +这是 [Emacs 和 Org 模式系列][4]的第四篇。 -“我真的很想让它在我所有的设备上同步。” +至今为止,你已经见识到了 Org 模式的强大和高效,如果你像我一样,你可能会想: + +> “我真的很想让它在我所有的设备上同步。” 或者是说: -“我能在 org-mode 中转发邮件吗?” +> “我能在 Org 模式中转发邮件吗?” 答案当然是肯定的,因为这就是 Emacs。 ### 同步 -由于 org-mode 只使用文本文件,所以使用任意工具都可以很容易地实现同步。我使用的是 git 的 git-remote-gcrypt。由于 git-remote-gcrypt 的一些限制,每台机器都倾向于推到自己的分支,并使用命令来控制。每台机子都会先合并其他所有的 branch 然后再将合并后的结果 push 到 master 上。cron 作业可以实现将机器上的 branch push 上去,而 elisp 会协调这一切--确保在同步之前保存缓冲区,在同步之后从磁盘刷新缓冲区,等等。 +由于 Org 模式只使用文本文件,所以使用任意工具都可以很容易地实现同步。我使用的是 git 的 `git-remote-gcrypt`。由于 `git-remote-gcrypt` 的一些限制,每台机器都倾向于推到自己的分支,并使用命令来控制。每台机器都会先合并其它所有的分支,然后再将合并后的结果推送到主干上。cron 作业可以实现将机器上的分支推送上去,而 elisp 会协调这一切 —— 确保在同步之前保存缓冲区,在同步之后从磁盘刷新缓冲区,等等。 这篇文章的代码有点多,所以我将把它链接到 github 上,而不是写在这里。 -我有一个用来存放我所有的 org-stuff 的目录 $HOME/org,在 ~/org 目录下有个 [Makefile][2] 文件来处理同步。该文件定义了一下目标: - * push: 添加,提交和 push 到以主机命名的 branch 上 - * fetch: 一个简单的 git fetch - * sync: 添加,提交和 pull 远程的修改,合并并将其 push 到以主机命名的 branch 和 master 上(假设合并成功) +我有一个用来存放我所有的 Org 模式的文件的目录 `$HOME/org`,在 `~/org` 目录下有个 [Makefile][2] 文件来处理同步。该文件定义了以下目标: + * `push`: 添加、提交和推送到以主机命名的分支上 + * `fetch`: 一个简单的 `git fetch` 操作 + * `sync`: 添加、提交和拉取远程的修改,合并,并(假设合并成功)将其推送到以主机命名的分支和主干上 现在,在我的用户 crontab 中有这个: -``` -*/15 * * * * make -C $HOME/org push fetch 2>&1 | logger --tag 'orgsync' ``` -[accompanying elisp code][3] 定义了一个快捷键(C-c s)来调用同步。多亏了 cronjob,只要文件被保存 -- 即使我没有在另一个 boxen 上同步 -- 它们也会被 pull 进来。 +*/15 * * * * make -C $HOME/org push fetch 2>&1 | logger --tag 'orgsync' +``` + +[与之相关的 elisp 代码][3] 定义了一个快捷键(`C-c s`)来调用同步。多亏了 cronjob,只要文件被保存 —— 即使我没有在另一个机器上同步 —— 它们也会被拉取进来。 我发现这个设置非常好用。 -### 用 org-mode 发邮件 +### 用 Org 模式发邮件 -在继续下去之前,首先要问自己一下:你真的需要它吗? 我用的是带有 [mu4e][4] 的 org-mode,而且它集成的也很好;任何组织任务都可以通过 message-id 链接到电子邮件,这很理想 -- 它可以让一个人做一些事情,比如提醒他在一周内回复一条消息。 +在继续下去之前,首先要问自己一下:你真的需要它吗? 我用的是带有 [mu4e][4] 的 Org 模式,而且它集成的也很好;任何 Org 模式的任务都可以通过 `Message-id` 链接到电子邮件,这很理想 —— 它可以让一个人做一些事情,比如提醒他在一周内回复一条消息。 -然而,org 不仅仅只有提醒。它还是一个知识库、创作系统等,但是并不是我所有的邮件客户端都使用 mu4e。(注意:像 MobileOrg 是存在于移动设备中)。我并没有像我想的那样经常使用它,但是它有它的用途,所以我认为我也应该在这里记录它。 +然而,Org 模式不仅仅只有提醒。它还是一个知识库、创作系统等,但是并不是我所有的邮件客户端都使用 mu4e。(注意:移动设备中有像 MobileOrg 这样的应用)。我并没有像我想的那样经常使用它,但是它有它的用途,所以我认为我也应该在这里记录它。 -现在我不仅想处理纯文本电子邮件。我希望能够处理附件、HTML 邮件等。这听起来很快就有问题了 -- 但是通过使用 ripmime 和 pandoc 这样的工具,情况还不错。 +现在我不仅想处理纯文本电子邮件。我希望能够处理附件、HTML 邮件等。这听起来很快就有问题了 —— 但是通过使用 ripmime 和 pandoc 这样的工具,情况还不错。 -第一步就是要用某些方法将获取到的邮件放入指定的文件夹下。扩展名,特殊用户等。然后我用 [fetchmail configuration][5] 来将它 pull 下来并运行我自己的 [insorgmail][6] 脚本。 +第一步就是要用某些方法将获取到的邮件放入指定的文件夹下。扩展名、特殊用户等。然后我用一个 [fetchmail 配置][5] 来将它拉取下来并运行我自己的 [insorgmail][6] 脚本。 -这个脚本就是处理所有有趣的部分了。它从 ripmime 开始处理消息,用 pandoc 将HTML 的部分转换为 org 格式。 org 的层次结构是用来尽可能最好地表示 email 的结构。使用HTML和其他工具时,email 可能会变得相当复杂,但我发现这对于我来说是可以接受的。 +这个脚本就是处理所有有趣的部分了。它开始用 ripmime 处理消息,用 pandoc 将 HTML 的部分转换为 Org 模式的格式。 Org 模式的层次结构是用来尽可能最好地表示 email 的结构。使用 HTML 和其他工具时,email 可能会变得相当复杂,但我发现这对于我来说是可以接受的。 ### 下一篇 -我最后一篇关于 org-mode 的文章将讨论如何使用它来编写文档和准备幻灯片 -- 我发现自己对 org-mode 的使用非常满意,但这需要一些调整。 - +我最后一篇关于 Org 模式的文章将讨论如何使用它来编写文档和准备幻灯片 —— 我发现自己对 Org 模式的使用非常满意,但这需要一些调整。 -------------------------------------------------------------------------------- @@ -58,7 +59,7 @@ via: http://changelog.complete.org/archives/9898-emacs-4-automated-emails-to-org 作者:[John Goerzen][a] 译者:[oneforalone](https://github.com/oneforalone) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ae2ef44957c77ae0c7be98a6d00e9ee0a992960 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 13:05:54 +0800 Subject: [PATCH 0800/1143] PUB:20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md @oneforalone https://linux.cn/article-10334-1.html --- ...Emacs -4- Automated emails to org-mode and org-mode syncing.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md (100%) diff --git a/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md b/published/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md similarity index 100% rename from translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md rename to published/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md From 9ac1bda1d33cffb7a66f24710793aad8895e6953 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Tue, 11 Dec 2018 13:07:38 +0800 Subject: [PATCH 0801/1143] Translating by qhwdw --- ...ction to Quantum Computing with Open Source Cirq Framework.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md index 8cec20916d..ee35ef36ec 100644 --- a/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md +++ b/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md @@ -1,3 +1,4 @@ +Translating by qhwdw An Introduction to Quantum Computing with Open Source Cirq Framework ====== As the title suggests what we are about to begin discussing, this article is an effort to understand how far we have come in Quantum Computing and where we are headed in the field in order to accelerate scientific and technological research, through an Open Source perspective with Cirq. From 8ec35df76d59af461f39a5dc01ba277d17c3d3ed Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Tue, 11 Dec 2018 15:02:29 +0800 Subject: [PATCH 0802/1143] hankchow translating --- .../20181205 Bash Variables- Environmental and Otherwise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md b/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md index 11397f9b80..4df8c10143 100644 --- a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md +++ b/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (Bash Variables: Environmental and Otherwise) From e0f4674f9b120cb5f4c468db414864fb549aa89b Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Tue, 11 Dec 2018 17:02:12 +0800 Subject: [PATCH 0803/1143] translated --- ...04 Have a cow at the Linux command line.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) rename {sources => translated}/tech/20181204 Have a cow at the Linux command line.md (59%) diff --git a/sources/tech/20181204 Have a cow at the Linux command line.md b/translated/tech/20181204 Have a cow at the Linux command line.md similarity index 59% rename from sources/tech/20181204 Have a cow at the Linux command line.md rename to translated/tech/20181204 Have a cow at the Linux command line.md index a396c0ce14..ef08209828 100644 --- a/sources/tech/20181204 Have a cow at the Linux command line.md +++ b/translated/tech/20181204 Have a cow at the Linux command line.md @@ -1,5 +1,3 @@ -heguangzhi Translating - [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: ( ) @@ -9,26 +7,28 @@ heguangzhi Translating [#]: author: (Jason Baker https://opensource.com/users/jason-baker) [#]: url: ( ) -Have a cow at the Linux command line + +在Linux命令行上拥有一头奶牛 ====== -Bring a bovine voice to your terminal output with the cowsay utility. + +使用 cowsay 实用程序将牛的声音带到你的终端输出。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cowsay.png?itok=RA4NDbrY) -Welcome to the fourth day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. +欢迎来到 Linux 命令行玩具第四天。如果这是你第一次访问这个系列,你可能会问自己,什么是命令行玩具。我们也在考虑这一点,但是一般来说,这可能是一个游戏,或者任何简单的娱乐,可以帮助你在终端玩得开心。 -Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. Because just about everyone who I’ve mentioned this series to has asked me about it already, today’s selection is an obligatory one. +你们中的一些人以前会看过我们日历上的各种选项,但是我们希望每个人都至少有一个新的选项。因为几乎所有我提到这个系列的人都已经问过我了,今天的选项是必须的。 -You didn’t think we’d make it through this series without mentioning cowsay, did you? +你不认为我们会在不提及 cowsay 的情况下完成这个系列,是吗? -Cowsay is an udderly fantastic utility that takes text and outputs it as the spoken text of an ASCII-art bovine. +Cowsey 是一个神奇的实用程序,它将文本作为ASCII艺术牛的口语文本输出。 -You’ll likely find cowsay packaged in your default repositories, and perhaps even already installed. For me, in Fedora, all it took to install was: +你可能会发现 cowsey 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装: ``` $ sudo dnf install -y cowsay ``` - -Then, invoke it with cowsay followed by your message. Perhaps you’d like to pipe in the [fortune][1] [utility][1] we talked about yesterday. +然后,用 cowsey 调用它,然后是你的消息。也许你想到昨天我们谈到的 [幸运][1] [应用][1]。 ``` $ fortune | cowsay @@ -43,7 +43,7 @@ $ fortune | cowsay                 ||     || ``` -That’s it! **Cowsay** ships with few variations, called cow files, that can usually be found in **/usr/share/cowsay.** To see the cow file options available on your system, use **-l** flag after cowsay. Then, use the **-f** flag to try one out. +就这样!**CowSay** 几乎没有变化,称为 cow 文件,通常可以在 **/usr/share/cowsay** ,要查看系统上可用的 cow 文件选项,请在 cowsay 之后使用 **-l** 。然后,用 **-f** 试试其中之一。 ``` $ cowsay -f dragon "Run for cover, I feel a sneeze coming on." @@ -68,10 +68,10 @@ $ cowsay -f dragon "Run for cover, I feel a sneeze coming on."                ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~                                                                   /.-~ ``` +我对 **cowsay** 的真正不满是,我今天没有足够的时间来为牛的挤奶。牛排太高了,我可能会开个玩笑。 -My real beef with **cowsay** is that I don’t have enough time today to really milk the cow puns for all they are worth. The steaks are just too high, and I might butcher the joke. +更严重的是,我已经完全忘记了 **cowsay** 直到我在学习可翻译的剧本时再次遇到它。如果你碰巧安装了 **cowyay**,当你运行脚本时,你会从一系列奶牛身上获得产出。例如,运行本脚本: -On a more serious note, I had completely forgotten about **cowsay** until I re-encountered it when learning Ansible playbooks. If you happen to have **cowsay** installed, when you run a playbook, you’ll get your output from a series of cows. For example, running this playbook: ``` - hosts: @@ -79,8 +79,7 @@ On a more serious note, I had completely forgotten about **cowsay** until I re-e   tasks:     - action: ping ``` - -Might give you the following: +可能会给你以下信息: ``` $ ansible-playbook playbook.yml @@ -124,14 +123,14 @@ ok: [localhost] localhost                  : ok=2    changed=0    unreachable=0    failed=0   ``` - -**Cowsay** is available under a GPLv3 license, and you can find the Perl [source code][2] on GitHub. I’ve also seen versions floating around in other languages, so take a look around for other variants; here’s [one in R][3], for example. Implementing your own version in your language of choice might even be a fun programming learning task. +**Cowsay** 在GPLV3许可证下可用,您可以在 GitHub 上找到 Perl [源代码][2]。我也见过其他语言的版本,所以看看其他变体;例如,这是 [R语言][3] 。用你选择的语言实现你自己的版本可能是一项有趣的编程学习任务。 Now that **cowsay** is out of the way, we can move on to greener pastures. +既然 **cowsay** 不碍事了,我们可以去更绿色的牧场了。 -Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. +你有最喜欢的命令行玩具吗,你认为我应该对它进行分析?这个系列的日历大部分都填好了,但我还有一些地方。在下面的评论中让我知道,梦幻篮球来看看。如果有空间,梦幻篮球会尝试把它包括进去。如果没有,但是我收到了一些好的意见书,梦幻篮球在结尾做了一个荣誉提名的总结。 -Check out yesterday's toy, [How to bring good fortune to your Linux terminal][1], and check back tomorrow for another! +看看昨天的玩具,[如何给你的Linux终端带来好运][1],明天再来看看另一个! -------------------------------------------------------------------------------- @@ -139,7 +138,7 @@ via: https://opensource.com/article/18/12/linux-toy-cowsay 作者:[Jason Baker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 723eb145691c2ce7dcf081796f75af9b5fe69fa0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 17:56:43 +0800 Subject: [PATCH 0804/1143] PRF:20181112 The Source History of Cat.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @name1e5s 翻译的很棒!这个系列的文章值得字斟字酌地翻译。 --- .../20181112 The Source History of Cat.md | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/translated/talk/20181112 The Source History of Cat.md b/translated/talk/20181112 The Source History of Cat.md index 3644ce161e..155f5e928e 100644 --- a/translated/talk/20181112 The Source History of Cat.md +++ b/translated/talk/20181112 The Source History of Cat.md @@ -1,28 +1,29 @@ -The Source History of Cat +Cat 命令的源码历史 ====== -以前我和我的一些亲戚争论过计算机科学的学位值不值得读。当时我正在上大学,并要决定是不是该主修计算机。我姨和我一表姐觉得我不应该主修计算机。她们承认知道如何编程肯定是很有用且对自己有利的一件事,但是她们认为计算机科学现在发展的如此迅速以至于我学的东西几乎马上就过时了。建议我更好是把编程作为辅业,选择一个基础原理可以受用终身的领域主修,比如经济学或物理学。 -我知道我姨和我表姐说的不对,并决定主修计算机科学。(对不住啊!)平常人可能会觉得像计算机科学领域和软件工程专业每隔几年就完全和之前不一样了。其原因很容易理解。我们有了个人电脑,然后有了互联网,有了手机,之后还有了机器学习…… 科技总是在更新,支撑科技发展的原理和技能当然也在改变。当然,最惊人的是其实原理的改变竟然如此之小。我敢肯定,大多数人在知道了他们电脑里一些重要的软件的历史是多么久远时他们一定会深感震惊。当然我不是说那些刷版本号的浮夸软件 —— 我电脑上的 Firefox 浏览器副本,可能是我用的最多的软件,可能才更新不到两周。如果你看了比如 `grep` 的手册页,你就会发现他在 2010 年后就没有过更新了(至少在 MacOS 上如此)。初版 `grep` 是在 1974 年写就的,那时可以算是计算机世界的侏罗纪了。直到现在,人们(还有程序)仍然依赖 `grep` 来完成日常工作。 +以前我和我的一些亲戚争论过计算机科学的学位值不值得读。当时我正在上大学,并要决定是不是该主修计算机。我姨和我表姐觉得我不应该主修计算机。她们承认知道如何编程肯定是很有用且对自己有利的一件事,但是她们认为计算机科学现在发展的如此迅速以至于我学的东西几乎马上就过时了。建议我更好是把编程作为辅业,选择一个基础原理可以受用终身的领域主修,比如经济学或物理学。 -我姨和我表姐认为计算机技术就像一系列日渐精致的沙堡,在潮水抹净沙滩后新的沙堡完全取代旧的。但事实上,在很多领域上,我们都是不断积累能够解决问题的程序。我们可能不得不偶尔修改这些程序以避免软件无法使用,但大多数情况下我们都可以不修改。 `grep` 是一个简单的程序,可以解决一个仍然存在的问题,所以它能够存活下来。 大多数应用程序编程都是在非常高的级别上完成的,他们建立在解决了旧问题的程序的金字塔上。 30年或40年前的想法和概念,远非过时,在很多情况下他们依然在您的笔记本电脑上软件中存在着。 +我知道我姨和我表姐说的不对,并决定主修计算机科学。(对不住啊!)平常人可能会觉得像计算机科学领域和软件工程专业每隔几年就完全和之前不一样了。其原因很容易理解。我们有了个人电脑,然后有了互联网,有了手机,之后还有了机器学习…… 科技总是在更新,支撑科技发展的原理和技能当然也在改变。当然,最惊人的是其实原理的改变竟然如此之小。我敢肯定,大多数人在知道了他们电脑里一些重要的软件的历史是多么久远时他们一定会深感震惊。当然我不是说那些刷版本号的浮夸软件 —— 我电脑上的 Firefox 浏览器副本,可能是我用的最多的软件,可能两周前就更新过。如果你看了比如 `grep` 的手册页,你就会发现它在 2010 年后就没有过更新了(至少在 MacOS 上如此)。初版 `grep` 是在 1974 年写就的,那时可以算是计算机世界的侏罗纪了。直到现在,人们(还有程序)仍然依赖 `grep` 来完成日常工作。 -我想追溯这样的老程序自第一次写就以来改变了多少回很有趣。 `cat`可能是所有 Unix 实用程序中最简单的,因此我们以它为例。 Ken Thompson于 1969 年编写了 `cat` 的原始实现。如果我告诉别人我的电脑上安了个 1969 年的程序,这准确吗?我们电脑上的程序多大了? +我姨和我表姐认为计算机技术就像一系列日渐精致的沙堡,在潮水抹净沙滩后新的沙堡完全取代旧的。但事实上,在很多领域上,我们都是不断积累能够解决问题的程序。我们可能不得不偶尔修改这些程序以避免软件无法使用,但大多数情况下我们都可以不修改。`grep` 是一个简单的程序,可以解决一个仍然存在的需求,所以它能够存活下来。 大多数应用程序编程都是在非常高的级别上完成的,它们建立在解决了旧问题的旧程序的金字塔上。 30 年或 40 年前的思路和概念,远非过时,在很多情况下它们依然在您的笔记本电脑上软件中存在着。 + +我想追溯这样的老程序自第一次写就以来改变了多少回很有趣。 `cat` 可能是所有 Unix 实用程序中最简单的,因此我们以它为例。Ken Thompson 于 1969 年编写了 `cat` 的原始实现。如果我告诉别人我的电脑上安装了个来自 1969 年的程序,这准确吗?我们电脑上的程序多大了? 感谢这种[这种][1]仓库,我们可以完整的看到 `cat` 自 1969 年后是如何发展的。我会先聚焦于可以算得上是我的 MacBook 上的 `cat` 的祖先的 `cat` 实现。随着我们从 Unix 上的第一版 `cat` 追踪到现在 MacOS 上的 `cat`,你会发现,这个程序被重写的次数比你想的还要多 —— 但是直到现在它运行的方式和五十年前多少是完全一致的。 ### 研究 Unix -Ken Thompson 和 Dennis Ritchie 在 PDP 7 上开始写 Unix。那还是 1969 年,C 还没被发明出来,因此所有早期的 Unix 软件都是用 PDP 7 汇编实现的。他们使用的汇编种类是 Unix 特有的,Ken Thompson 在 DEC,也就是 PDP 7 的厂商提供的汇编器之上加了些特性,实现了自己的汇编器。Thompson 的更改在[最初的 Unix 程序员手册][2]的 `as`(也就是汇编器)条目下均有所记录。 +Ken Thompson 和 Dennis Ritchie 在 PDP 7 上开始写 Unix。那还是 1969 年,C 还没被发明出来,因此所有早期的 Unix 软件都是用 PDP 7 汇编实现的。他们使用的汇编种类是 Unix 特有的,Ken Thompson 在 DEC(PDP 7 的厂商)提供的汇编器之上加了些特性,实现了自己的汇编器。Thompson 的更改在[最初的 Unix 程序员手册][2]的 `as`(也就是汇编器)条目下均有所记录。 -因此,[最初的][3] `cat` 也是使用 PDP 7 汇编实现的。 我添加了一些注释,试图解释每条指令的作用,但除非你理解 Thompson 在编写汇编器时加的特性,否则程序仍然很难理解。在那些特性中有两个很重要:其一是 `;` 这个字符可以在一行中用来分隔多条语句,它多出现于在使用 `sys` 指令时将系统调用的多个参数放在同一行上。其二是, Thompson 的汇编器支持使用 0 到 9 作为“临时标签”,也就是在程序内可以重用的标签。因此。就如 Unix 程序员手册中所说:“对程序员的想象力和汇编程序的符号空间的要求都降低了”。在任何给定的指令内,你都可以使用 `nf` 和 `nb` 来引用下一个或最近的临时标签 `n`。 例如,如果存在标记为 `1:` 的代码块,你就可以使用指令 `jmp 1b` 从下游代码跳回该块。 (但是你不使用 `jmp 1f` 的话就没法从上面的代码跳到这里。) +因此,[最初的][3] `cat` 也是使用 PDP 7 汇编实现的。 我添加了一些注释,试图解释每条指令的作用,但除非你理解 Thompson 在编写汇编器时加的特性,否则程序仍然很难理解。在那些特性中有两个很重要:其一是 `;` 这个字符可以在一行中用来分隔多条语句,它多出现于在使用 `sys` 指令时将系统调用的多个参数放在同一行上。其二是, Thompson 的汇编器支持使用 0 到 9 作为“临时标签”,这是在程序内可以重用的标签。因此。就如 Unix 程序员手册中所说:“对程序员的想象力和汇编程序的符号空间的要求都降低了”。在任何给定的指令内,你都可以使用 `nf` 和 `nb` 来引用下一个或最近的临时标签 `n`。 例如,如果存在标记为 `1:` 的代码块,你就可以使用指令 `jmp 1b` 从下游代码跳回该块。 (但是你不使用 `jmp 1f` 的话就没法从上面的代码跳到这里。) -初版 `cat` 最有趣的就是它包含着我们应该认识的符号。有一块指令快标记为 `getc`,还有一个标记为 `putc`,可以看到这两个符号比 C 标准还古老。第一版的 `cat` 函数实际上已经包含了这两个函数的实现。这个 `cat` 实现做了缓存,这样他就不需要一次只读写一个字母。 +初版 `cat` 最有趣的就是它包含着我们应该认识的符号。有一块指令块标记为 `getc`,还有一个标记为 `putc`,可以看到这两个符号比 C 标准还古老。第一版的 `cat` 函数实际上已经包含了这两个函数的实现。该实现做了输入缓存,这样它就不需要一次只读写一个字母。 `cat` 的第一个版本并没有持续多久。 Ken Thompson 和 Dennis Ritchie 说服贝尔实验室购买了 PDP 11,这样他们就能够继续扩展和改进 Unix。 PDP 11 的指令集和之前不一样,因此必须重写 `cat`。 我也注释了[这个第二版][4] `cat`。 它为新的指令集使用新的汇编程序助记符,并利用了 PDP 11 的各种[寻址模式][5]。(如果你对源代码中的括号和美元符号感到困惑,那是因为这些符号用于指示不同的寻址模式。)但它也使用 `;` 字符和临时标签,和 `cat` 的第一个版本一样,这意味着当把 `as` 移植到 PDP 11 上时,必须要保留这些功能。 -`cat` 的第二个版本比第一个版本简单得多。 它也更有 Unix 味儿,它不只是依靠参数列表,一旦没给参数列表,它将从 `stdin` 读取数据,这也就是今天 `cat` 仍在做的事情。 你也也可以在此版本的 `cat` 中以 `-` 为参数,以表示它应该从`stdin`读取。 +`cat` 的第二个版本比第一个版本简单得多。 它也更有 Unix 味儿,它不只是依靠参数列表,一旦没给参数列表,它将从 `stdin` 读取数据,这也就是今天 `cat` 仍在做的事情。 你也可以在此版本的 `cat` 中以 `-` 为参数,以表示它应该从`stdin`读取。 -在 1973 年,为了准备发布第四版 Unix,大部分代码都用 C 语言重写了。但是 `cat` 似乎在之后一段时间内并没有使用 C 重写。 [`cat` 的第一个 C 语言实现][6]出现在第七版 Unix 中。 这个实现非常有趣,因为它很简单。 在所有要以后的实现中,这个实现和在 K&R 的 C语言教科书中用作教学示范的理想化 `cat` 最相似。这个程序的核心就是经典的两行: +在 1973 年,为了准备发布第四版 Unix,大部分代码都用 C 语言重写了。但是 `cat` 似乎在之后一段时间内并没有使用 C 重写。 [cat 的第一个 C 语言实现][6]出现在第七版 Unix 中。 这个实现非常有趣,因为它很简单。 在所有以后的实现中,这个实现和在 K&R 的 C 语言教科书中用作教学示范的理想化 `cat` 最相似。这个程序的核心就是经典的两行: ``` while ((c = getc(fi)) != EOF) @@ -33,33 +34,33 @@ while ((c = getc(fi)) != EOF) ### BSD -在第七版之后,Unix 出现了了各种衍生品和分支。 MacOS 建立于 Darwin 之上,而 Darwin 又源自 Berkeley Software Distribution(BSD),因此 BSD 是我们最感兴趣的Unix 分支。 BSD 最初只是 Unix 中的实用程序和附加组件的集合,但它最终成为了一个完整的操作系统。直到第四版 BSD,人称 4BSD,为一大堆新标志添加了支持之前,BSD 似乎还是依赖于最初的 `cat` 实现的。`cat` 的 [4BSD 实现][7] 显然是从原始实现中衍生出来的,尽管它添加了一个新函数来实现新标志触发的行为。按照已经在文件中使用由用于标记输入是从`stdin`还是文件读取的 `fflg` 变量指定的命名约定。被新添加的 `nflg`,`bflg`,`vflg`,`sflg`,`eflg`和`tflg` 保存了下来,这些变量记录了在调用程序时是否使用了这些新标志。这些是最后一批添加到 `cat` 的命令行标志。如今 `cat` 的手册页列出了这些标志,没有其他的标志了,至少在Mac OS上是如此。 4BSD 于1980年发布,因此这套标志已有 38 年历史。 +在第七版 Unix 之后,Unix 出现了各种衍生品和分支。 MacOS 建立于 Darwin 之上,而 Darwin 又源自伯克利软件分发版Berkeley Software Distribution(BSD),因此 BSD 是我们最感兴趣的 Unix 分支。 BSD 最初只是 Unix 中的实用程序和附加组件的集合,但它最终成为了一个完整的操作系统。直到第四版 BSD,人称 4BSD,为一大堆新标志添加了支持之前,BSD 似乎还是依赖于最初的 `cat` 实现的。`cat` 的 [4BSD 实现][7] 显然是从原始实现中衍生出来的,尽管它添加了一个新函数来实现由新标志触发的行为。已经在文件中使用的 `fflg` 变量(用于标记输入是从 `stdin` 还是文件读取的)的命名约定,被新添加的 `nflg`、`bflg`、`vflg`、`sflg`、`eflg` 和 `tflg` 沿袭了下来,这些变量记录了在调用程序时是否使用了这些新标志。这些是最后一批添加到 `cat` 的命令行标志。如今 `cat` 的手册页列出了这些标志,没有其他的标志了,至少在 Mac OS 上是如此。 4BSD 于 1980 年发布,因此这套标志已有 38 年历史。 -`cat` 最后一次被完全重写是在 BSD NET/2 上,其目的是通过替换全部 AT&T 发布的 Unix 源代码来规避许可证问题。BSD Net/2 在 1991 年发布。这一版本的 `cat` 是由 Kevin Fall 重写的。 Kevin Fall 于 1988 年毕业于加州大学伯克利分校并在下一年成为计算机系统研究组(CSRG)的组员,Fall 和我说当时使用 AT&T 代码的 Unix 工具被列在了 CSRG 的墙上,组员需要从中选出他们想要重写的工具; Fall 选了 `cat` 以及 `mknod`。 MacOS 系统内自带的 `cat` 实现源码的最上面还有着他的名字。他的这一版 `cat`,尽管平淡无奇,在今天还是被无数人使用着。 +`cat` 最后一次被完全重写是在 BSD NET/2 上,其目的是通过替换 AT&T 发布的全部 Unix 源代码来规避许可证问题。BSD Net/2 在 1991 年发布。这一版本的 `cat` 是由 Kevin Fall 重写的。 Kevin Fall 于 1988 年毕业于加州大学伯克利分校并在下一年成为计算机系统研究组Computer Systems Research Group(CSRG)的组员,Fall 和我说当时使用 AT&T 代码的 Unix 工具被列在了 CSRG 的墙上,组员需要从中选出他们想要重写的工具; Fall 选了 `cat` 以及 `mknod`。 MacOS 系统内自带的 `cat` 实现源码的最上面还有着他的名字。他的这一版 `cat`,尽管平淡无奇,在今天还是被无数人使用着。 -[Fall的原始 `cat `实现][8] 比我们迄今为止看到的程序都要长。 除了支持 `-?` 帮助标志外,它没有增加任何新功能。 从概念上讲,它与 4BSD 的实现非常相似。 它长是因为 Fall 将实现分为 “原始” 模式和 “熟” 模式。 “原始” 模式是 `cat ` 的经典实现; 它一个字符一个字符的打印文件。 “熟” 模式是带有所有 4BSD 命令行选项的 `cat`。 如此区别不无道理,但这么办也扩充了实现规模,因此乍一看其源码似乎比实际上更复杂。文件末尾还有一个奇特的错误处理函数,进一步地增加了实现的长度。 +[Fall 的原始 cat 实现][8] 比我们迄今为止看到的版本都要长。 除了支持 `-?` 帮助标志外,它没有增加任何新功能。 从概念上讲,它与 4BSD 的实现非常相似。 它长是因为 Fall 将实现分为 “原始” 模式和 “加工” 模式。 “原始” 模式是 `cat` 的经典实现;它一个字符一个字符的打印文件。 “加工” 模式是带有所有 4BSD 命令行选项的 `cat`。 如此区别不无道理,但这么办也扩充了实现规模,因此乍一看其源码似乎比实际上更复杂。文件末尾还有一个奇特的错误处理函数,进一步地增加了实现的长度。 ### MacOS -在 2001 年,苹果发布了 MacOS X。这一发布对苹果意义重大。因为苹果花了很多年时间来尝试并且取代现有的过时操作系统(经典的Mac OS),但是都失败了。 在 Mac OS X 之前苹果两次尝试在内部创建一个新的操作系统,但两者都无疾而终。 最后,苹果收购了史蒂夫 · 乔布斯的 NeXT 公司,后者开发了一个名为 NeXTSTEP 的操作系统和面向对象编程框架。 苹果将 NeXTSTEP 作为Mac OS X的基础。因为 NeXTSTEP 部分基于 BSD,使以 NeXTSTEP 为基础的 Mac OS X的自然就把 BSD 系的代码直接带入苹果宇宙的中心。 +在 2001 年,苹果发布了 MacOS X。这一发布对苹果意义重大。因为苹果用了多年的时间尝试以取代其现有的老旧操作系统(经典的 Mac OS),但是都失败了。 在 Mac OS X 之前苹果两次尝试在内部创建一个新的操作系统,但两者都无疾而终。 最后,苹果收购了史蒂夫·乔布斯的 NeXT 公司,后者开发了一个名为 NeXTSTEP 的操作系统和面向对象编程框架。 苹果将 NeXTSTEP 作为 Mac OS X 的基础。因为 NeXTSTEP 部分基于 BSD,使以 NeXTSTEP 为基础的 Mac OS X 的自然就把 BSD 系的代码直接带入苹果宇宙的中心。 -因此,Mac OS X的第一个版本包含了从 NetBSD 项目中提取的 `cat` 的[实现][9]。如今仍在开发中的 NetBSD 最初是 386BSD 的分支,而后者又直接基于 BSD Net/2。所以Mac OS X里面的第一个 `cat` 的实现就是 Kevin Fall的 `cat`。唯一改变的是,Fall 的错误处理函数 `err()` 被 `err.h` 提供的`err()` 函数取代了。 `err.h` 是 C 标准库的 BSD 扩展。 +因此,Mac OS X 的非常早期的第一个版本包含了从 NetBSD 项目中提取的 `cat` 的[实现][9]。如今仍保持开发的 NetBSD 最初是 386BSD 的分支,而后者又直接基于 BSD Net/2。所以 Mac OS X 里面的第一个 `cat` 的实现就是 Kevin Fall 的 `cat`。唯一改变的是,Fall 的错误处理函数 `err()` 被 `err.h` 提供的 `err()` 函数取代了。 `err.h` 是 C 标准库的 BSD 扩展。 -之后不久,`cat` 的 NetBSD 实现被换成了 FreeBSD 中的 `cat` 实现。 [根据维基百科][10],苹果在Mac OS X 10.3(Panther) 中开始使用 FreeBSD 的实现而不是 NetBSD 的实现。但根据苹果自己开源的版本,`cat` 的Mac OS X实现在2007年发布的 Mac OS X 10.5(Leopard) 之前没有被替换。苹果为 Leopard 替换的的 [FreeBSD 实现][11]与今天苹果计算机上的实现相同。截至 2018 年,此实现仍未被更新或修改。 +之后不久,这里的 `cat` 的 NetBSD 实现被换成了 FreeBSD 中的 `cat` 实现。 [根据维基百科][10],苹果在 Mac OS X 10.3(Panther)中开始使用 FreeBSD 的实现而不是 NetBSD 的实现。但根据苹果自己开源的版本,`cat` 的 Mac OS X 实现在 2007 年发布的 Mac OS X 10.5(Leopard)之前没有被替换。苹果为 Leopard 替换的的 [FreeBSD 实现][11]与今天苹果计算机上的实现相同。截至 2018 年,2007 年以来的这个实现仍未被更新或修改。 -所以Mac OS 上的 `cat` 已经很老了。实际上,这一实现在 2007 年在 MacOS X 上露面两年前就被发布了。 [这个 2005 年的修改][12] 在 FreeBSD 的 Github 镜像中可见,是在苹果将其合并入 Mac OS X 前对 FreeBSD 的 `cat` 实现进行的最后一次更改。所以 Mac OS X 的没有与 FreeBSD 的 `cat` 实现保持同步的 `cat`实现,如今 13 岁了。对于软件修改了多少代码才能仍是算是同一软件这一话题有着旷日持久的争论。不过,在这种情况下,源文件自 2005 年以来根本没有变化。 +所以 Mac OS 上的 `cat` 已经很老了。实际上,这一实现在 2007 年在 MacOS X 上露面两年前就被发布了。 [这个 2005 年的修改][12] 在 FreeBSD 的 Github 镜像中可见,是在苹果将其合并入 Mac OS X 前对 FreeBSD 的 `cat` 实现进行的最后一次更改。所以 Mac OS X 中的实现没有与 FreeBSD 的 `cat` 实现保持同步,它如今已经 13 岁了。对于软件修改了多少代码才能仍是算是同一软件这一话题有着旷日持久的争论。不过,在这种情况下,源文件自 2005 年以来根本没有变化。 -现在 Mac OS 使用的 `cat` 实现与 Fall 1991年为 BSD Net/2 版本编写的实现没有什么不同。最大的区别是添加了一个全新的功能来提供 Unix 域套接字支持。FreeBSD 开发人员似乎将 Fall 的 `raw_args()` 函数和 `cook_args()` 函数组合成一个名为`scanfiles()`的函数。要没有的话,程序的核心就仍是 Fall 的代码。 +现在 Mac OS 使用的 `cat` 实现与 Fall 1991 年为 BSD Net/2 版本编写的实现没有什么不同。最大的区别是添加了一个全新的功能来提供 Unix 域套接字支持。FreeBSD 开发人员似乎将 Fall 的 `raw_args()` 函数和 `cook_args()` 函数组合成一个名为`scanfiles()` 的函数。否则,程序的核心就仍是 Fall 的代码。 -我问过 Fall 对编写如今被数以百万计的苹果用户直接或者通过依赖 `cat` 的程序间接使用的 `cat` 实现有何感想。Fall,如今是最新版 TCP/IP 详解的顾问和合著者,说,当人们从了解他对 `cat` 所做的的工作中收获颇丰时,他感到很惊讶。 Fall 在计算机领域有着悠久的职业生涯,曾参与许多备受瞩目的项目,但似乎很多人仍对他在 1989 年重写 `cat` 的那六个月的工作感到最为兴奋。 +我问过 Fall 对编写了如今被数以百万计的苹果用户(直接或者间接通过依赖 `cat` 的某些程序)使用的 `cat` 实现有何感想。Fall,如今是一位顾问,也是最新版《TCP/IP 详解》的合著者,他说,当人们从了解他对 `cat` 所做的工作中收获颇丰时,他感到很惊讶。 Fall 在计算机领域有着悠久的职业生涯,曾参与许多备受瞩目的项目,但似乎很多人仍对他在 1989 年重写 `cat` 的那六个月的工作感到最为兴奋。 ### 百年老程序 -在宏伟的发明史中,计算机并不是一项古老的发明。我们已经习惯了百年的照片甚至是百年的视频短片。但是计算机程序不一样 - 它们代表着高科技和新技术。至少,他们是现代的技术造出来的。随着计算行业的成熟,我们有朝一日会发现自己正在使用有着接近百年历史的程序吗? +在宏伟的发明史中,计算机并不是一项古老的发明。我们已经习惯了百年的照片甚至是百年的视频短片。但是计算机程序不一样 —— 它们代表着高科技和新技术。至少,他们是现代的技术造出来的。随着计算行业的成熟,我们有朝一日会发现自己正在使用有着接近百年历史的程序吗? -计算机硬件可能会发生较大的变化,使得我们也许无法让现在编译的可执行文件在一个世纪后的硬件上运行。也许编程语言设计的进步让未来没有人能理解 C 语言,`cat` 将来也可能也被别的语言重写很久了。 (尽管 C已经存在了五十年了,而且它似乎不会很快就被替换掉。)但除此之外,为什么不永远使用我们现在的 `cat`? +计算机硬件可能会发生较大的变化,使得我们也许无法让现在编译的可执行文件在一个世纪后的硬件上运行。也许编程语言设计的进步让未来没有人能理解 C 语言,`cat` 将来也可能也被别的语言重写很久了。 (尽管 C 已经存在了五十年了,而且它似乎不会很快就被替换掉。)但除此之外,为什么不永远使用我们现在的 `cat`? -我认为 `cat` 的历史表明,计算机科学中的一些想法确实非常持久。事实上,对于 `cat`,这个想法和程序本身都很古老。不准确地说,我的电脑上的 `cat` 来自1969 年。但我也可以说我的计算机上的 `cat` 来自1989 年,当时 Fall 写了他的 `cat` 实现。许多其他软件也同样古老。因此,也许我们不应该把计算机科学和软件开发视为不断破坏现状和发明新事物的领域。我们的计算机系统是由诸多历史文物构建的。有时,我们可能会花费更多时间在理解和维护这些历史文物上,而不是花在编写新代码上。 +我认为 `cat` 的历史表明,计算机科学中的一些想法确实非常持久。事实上,对于 `cat`,这个想法和程序本身都很古老。不准确地说,我的电脑上的 `cat` 来自 1969 年。但我也可以说我的计算机上的 `cat` 来自1989 年,当时 Fall 写了他的 `cat` 实现。许多其他软件也同样古老。因此,也许我们不应该把计算机科学和软件开发视为不断破坏现状和发明新事物的领域。我们的计算机系统是由诸多历史文物构建的。有时,我们可能会花费更多时间在理解和维护这些历史文物上,而不是花在编写新代码上。 如果你喜欢本文,你可能更喜欢两周来一篇更新!在推特上关注 [@TwoBitHistory][13] 或者订阅这个 [RSS 源][14] 以保证接受到新的文章。 @@ -71,7 +72,7 @@ via: https://twobithistory.org/2018/11/12/cat.html 作者:[Two-Bit History][a] 选题:[lujun9972][b] 译者:[name1e5s](https://github.com/name1e5s) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 87ba3f9da6b69c80eb1d5af7da8b3d44f5ee8b37 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 21:37:48 +0800 Subject: [PATCH 0805/1143] PRF:20180226 -Getting to Done- on the Linux command line.md @guevaraya --- ...ting to Done- on the Linux command line.md | 88 +++++++++++-------- 1 file changed, 49 insertions(+), 39 deletions(-) diff --git a/translated/tech/20180226 -Getting to Done- on the Linux command line.md b/translated/tech/20180226 -Getting to Done- on the Linux command line.md index 2e06c51dce..61a0307055 100644 --- a/translated/tech/20180226 -Getting to Done- on the Linux command line.md +++ b/translated/tech/20180226 -Getting to Done- on the Linux command line.md @@ -1,103 +1,111 @@ -享受Linux下命令行全操作 +在 Linux 命令行下进行时间管理 ====== +> 学习如何在命令行下用这些方法自己组织待办事项。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah) -很多文章讨论关于命令行下如何做事情。有多少文章要么用晦涩的方式介绍 `ls` ,要么介绍关于 Sed 和 Awk 一些有意思的正则表达式,要么就是介绍一大堆的 perl 脚本是如何解析的?这些都不是命令行操作的重点。 -本文章是关于[享受命令行全操作][1],在我们不需要图形桌面,网络浏览器或网络连接情况下,用命令行操作能完成实际事务的跟踪。为了达到这一点,我们将介绍四个途径跟踪你的待办清单:纯文件文件,Todo.txt,TaskWarrior,Org-mode。 +关于如何在命令行下进行时间管理getting things done(GTD)有很多讨论。不知有多少文章在讲使用 ls 晦涩的选项、配合 Sed 和 Awk 的一些神奇的正则表达式,以及用 Perl 解析一大堆的文本。但这些都不是问题的重点。 -### 纯文本 +本文章是关于“[如何完成][1]”,在我们不需要图形桌面、网络浏览器或网络连接情况下,用命令行操作能实际完成事务的跟踪。为了达到这一点,我们将介绍四种跟踪待办事项的方式:纯文件文件、Todo.txt、TaskWarrior 和 Org 模式。 -![plaintext][3] +### 简单纯文本 -我喜欢用 Vim ,其实你也可以喜欢 Nano。 +![纯文本][3] -最直接管理管理你的待办清单的方式就是用纯文本文件来编辑。只需要打开一个空文件,每一行添加一个任务。当任务完成后,删除这一行,简单有效,不用再关心这一行之前干什么用的了。不过这个方法也有缺点,一点你删除一行并保存了文件,它就是永远消失了。如果你想知道本周或者上周都做了哪些事情,就成了问题。使用简单文本文件很方便却也容易导致混乱。 +*我喜欢用 Vim,其实你也可以用 Nano。* + +最直接管理你的待办事项的方式就是用纯文本文件来编辑。只需要打开一个空文件,每一行添加一个任务。当任务完成后,删除这一行。简单有效,无论你用它做什么都没关系。不过这个方法也有两个缺点,一但你删除一行并保存了文件,它就是永远消失了。如果你想知道本周或者上周都做了哪些事情,就成了问题。使用简单文本文件很方便却也容易导致混乱。 ### Todo.txt: 纯文件的升级版 +![todo.txt 截屏][5] -![todo.txt screen][5] +*整洁,有条理,易用* -整洁,有条理,易用 - -这就是我们要说的 [Todo.txt][6] 格式文件和应用程序。安装可从 GitHub [下载][7]最新的版本解压后并执行命令 `sudo make install` +这就是我们要说的 [Todo.txt][6] 文件格式和应用程序。安装很简单,可从 GitHub [下载][7]最新的版本解压后并执行命令 `sudo make install` 。 ![安装 todo.txt][9] -也可以从 Git 克隆一个。 +*也可以从 Git 克隆一个。* -Todo.txt 可以很容易的增加新任务,并能显示任务列表和已完成任务的标记: +Todo.txt 可以很容易的增加新任务,并能显示任务列表和已完成任务的标记: -||| +| 命令 | 说明 | | ------------- |:-------------| -| `todo.sh add "某任务"` | 增加 "某任务" 到你的待办列表 | +| `todo.sh add "某任务"` | 增加 “某任务” 到你的待办列表 | | `todo.sh ls` | 显示所有的任务 | | `todo.sh ls due:2018-02-15` | 显示2018-02-15之前的所有任务 | | `todo.sh do 3` | 标记任务3 为已完成任务 | -清单实际上仍然是纯文本,你可以用你喜欢的编辑器遵循[正确的格式][10]编辑它。 - -应用程序同时也内置了一个强大的帮助。 +这个清单实际上仍然是纯文本,你可以用你喜欢的编辑器遵循[正确的格式][10]编辑它。 +该应用程序同时也内置了一个强大的帮助系统。 ![在 todo.txt 中语法高亮][12] -你可以使用语法高亮的功能 - -此外,还有许多附加组件可供选择,以及编写自己的附件组件规范。甚至有浏览器组件,移动设备应用程序和桌面应用程序支持 Todo.txt 的格式。 +*你可以使用语法高亮的功能* +此外,还有许多附加组件可供选择,以及编写自己的附件组件规范。甚至有浏览器组件、移动设备应用程序和桌面应用程序支持 Todo.txt 的格式。 ![GNOME extensions in todo.txt][14] -GNOME的扩展组件 +*GNOME的扩展组件* -Todo.txt 最大的缺点是缺少自动或内置的同步机制。大多数(不是全部)的浏览器扩展程序和移动应用程序需要用 Dropbox 实现桌面系统和应用程序直接的数据同步。如果你想内置同步机制,我们也有…… +Todo.txt 最大的缺点是缺少自动或内置的同步机制。大多数(不是全部)的浏览器扩展程序和移动应用程序需要用 Dropbox 实现桌面系统和应用程序直接的数据同步。如果你想内置同步机制,我们有…… ### Taskwarrior: 现在我们用 Python 做事了 -[Taskwarrior][15] 是一个与Todo.txt 有许多相同功能的 Python 工具。但不同的是它的数据保存在数据库里并具有内置的数据同步功能。它还可以跟踪即将要做的任务,可以提醒某个任务持续了多久,可以提醒你一些重要的事情应该马上去做。 +![Taskwarrior][25] -[安装][16] Taskwarrior 可以通过通过发行版自带的包管理器,或通过 Python 命令 `pip`安装,或者用源码编译。用法也和 Todo.txt 的命令完全一样: +*花哨吗?* -||| +[Taskwarrior][15] 是一个与 Todo.txt 有许多相同功能的 Python 工具。但不同的是它的数据保存在数据库里并具有内置的数据同步功能。它还可以跟踪即将要做的任务,可以提醒某个任务持续了多久,可以提醒你一些重要的事情应该马上去做。 + +![][26] + +*看起来不错* + +[安装][16] Taskwarrior 可以通过通过发行版自带的包管理器,或通过 Python 命令 `pip` 安装,或者用源码编译。用法也和 Todo.txt 的命令完全一样: + +| 命令 | 说明 | | ------------- |:-------------| -| `task add "某任务"` | 增加 "某任务" 到任务清单 | +| `task add "某任务"` | 增加 “某任务” 到任务清单 | | `task list` | 列出所有任务 | -| `task list due ``:today` |列出截止今天的任务 | +| `task list due ``:today` | 列出截止今天的任务 | | `task do 3` | 标记编号是3的任务为完成状态 | Taskwarrior 还有漂亮的文本用户界面。 ![Taskwarrior in Vit][18] -我喜欢 Vit, 它的设计灵感来自 Vim. +*我喜欢 Vit, 它的设计灵感来自 Vim* -不同于 Todo.txt,Taskwarrior 可以和本地或远程服务器同步信息。如果你希望运行自己的同步服务器可以使用名为 `taskd` 的基础服务器,如果不使用自己的服务器也有好几个可用服务器。 +不同于 Todo.txt,Taskwarrior 可以和本地或远程服务器同步信息。如果你希望运行自己的同步服务器可以使用名为 `taskd` 的非常基本的服务器,如果不使用自己的服务器也有好几个可用服务器。 -Taskwarriot 还拥有一个蓬勃发展的插件和扩展生态系统,这和移动和桌面系统的应用生态类似。 +Taskwarriot 还拥有一个蓬勃发展的插件和扩展生态系统,以及移动和桌面系统的应用。 ![GNOME in Taskwarrior ][20] -在 GNOME 下的 Taskwarrior 看起来还是很漂亮的。 +*在 GNOME 下的 Taskwarrior 看起来还是很漂亮的。* Taskwarrior 有一个唯一的缺点,你是不能直接修改待办任务的,这和其他的工具不一样。你只能把任务清单按照格式导出,然后修改导出文件后,重新再导入,这样相对于编辑器直接编辑任务还是挺麻烦的。 -谁能给我们带来最大的希望呢...... +谁能给我们带来最大的希望呢…… -### Emacs Org-mode: 牛逼的任务收割机 +### Emacs Org 模式:牛X的任务收割机 ![Org-mode][22] -Emacs 具有所有优点。 +*Emacs 啥都有* -Emacs [Org-mode][23] 是目前为止最强大,最灵活的开源待办任务管理器。它支持多文件,使用纯文本,高度定制和自动识别日期,截止日期和任务计划。相对于我们这里介绍的其他工具,它的配置也更复杂一些。但是一旦配置好,她可以比其他工具完成更多功能。如果你是熟悉或者是 [Bullet Journals][24] 的粉丝,Org-mode 可能是在桌面程序里最像[Bullet Journals][24]的了。 +Emacs [Org 模式][23] 是目前为止最强大、最灵活的开源待办事项管理器。它支持多文件、使用纯文本、高度可定制、自动识别日期、截止日期和任务计划。相对于我们这里介绍的其他工具,它的配置也更复杂一些。但是一旦配置好,它可以比其他工具完成更多功能。如果你是熟悉或者是 [Bullet Journals][24] 的粉丝,Org 模式可能是在桌面程序里最像[Bullet Journals][24] 的了。 -Org-mode 可以运行在任何 Emacs 运行的地方,一些移动应用程序可以和它很好交互。但是不幸的是,目前没有桌面程序或浏览器插件支持Org-mode。尽管如此,Org-mode仍然是跟踪待办事项最好的应用程序之一,因为他确实很强大。 +Emacs 能运行,Org 模式就能运行,一些移动应用程序可以和它很好交互。但是不幸的是,目前没有桌面程序或浏览器插件支持 Org 模式。尽管如此,Org 模式仍然是跟踪待办事项最好的应用程序之一,因为它确实很强大。 ### 选择适合自己的工具 -最后,这些程序目的是帮助你跟踪待办事务并确保不会忘记做某个事情。这些程序的基础功能都大同小异,那一款适合你取决于多种因素。有的人需要自带同步功能,有的人需要一个移动客户端,有的人要必须支持插件。不管你选择什么,请记住程序本身不会让你更有调理,但是可以帮助你。 +最后,这些程序目的是帮助你跟踪待办事项,并确保不会忘记做某个事情。这些程序的基础功能都大同小异,那一款适合你取决于多种因素。有的人需要自带同步功能,有的人需要一个移动客户端,有的人要必须支持插件。不管你选择什么,请记住程序本身不会让你更有调理,但是可以帮助你。 -------------------------------------------------------------------------------- @@ -105,7 +113,7 @@ via: https://opensource.com/article/18/2/getting-to-done-agile-linux-command-lin 作者:[Kevin Sonney][a] 译者:[guevaraya](https://github.com/guevaraya) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -126,3 +134,5 @@ via: https://opensource.com/article/18/2/getting-to-done-agile-linux-command-lin [22]:https://opensource.com/sites/default/files/u128651/emacs-org-mode.png (Org-mode) [23]:https://orgmode.org/ [24]:http://bulletjournal.com/ +[25]:https://opensource.com/sites/default/files/u128651/taskwarrior.png +[26]:https://opensource.com/sites/default/files/u128651/taskwarrior-complains.png From 2913f24c2d37091dcf73670762c142f8766c160a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 21:38:19 +0800 Subject: [PATCH 0806/1143] PUB:20180226 -Getting to Done- on the Linux command line.md @guevaraya https://linux.cn/article-10335-1.html --- .../20180226 -Getting to Done- on the Linux command line.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180226 -Getting to Done- on the Linux command line.md (100%) diff --git a/translated/tech/20180226 -Getting to Done- on the Linux command line.md b/published/20180226 -Getting to Done- on the Linux command line.md similarity index 100% rename from translated/tech/20180226 -Getting to Done- on the Linux command line.md rename to published/20180226 -Getting to Done- on the Linux command line.md From d29de3e5f41e4860dca355759f5c05de75ed9d4b Mon Sep 17 00:00:00 2001 From: GraveAccent Date: Tue, 11 Dec 2018 23:04:16 +0800 Subject: [PATCH 0807/1143] GraveAccent translated 20180422... --- ...icks For Data Scientists - kade killary.md | 526 ------------------ ...icks For Data Scientists - kade killary.md | 469 ++++++++++++++++ 2 files changed, 469 insertions(+), 526 deletions(-) delete mode 100644 sources/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md create mode 100644 translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md diff --git a/sources/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md b/sources/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md deleted file mode 100644 index 2e1abf248f..0000000000 --- a/sources/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md +++ /dev/null @@ -1,526 +0,0 @@ -GraveAccent翻译中 Command Line Tricks For Data Scientists • kade killary -====== - -![](https://i.imgur.com/0mzQMcB.png) - -For many data scientists, data manipulation begins and ends with Pandas or the Tidyverse. In theory, there is nothing wrong with this notion. It is, after all, why these tools exist in the first place. Yet, these options can often be overkill for simple tasks like delimiter conversion. - -Aspiring to master the command line should be on every developer’s list, especially data scientists. Learning the ins and outs of your shell will undeniably make you more productive. Beyond that, the command line serves as a great history lesson in computing. For instance, awk - a data-driven scripting language. Awk first appeared in 1977 with the help of [Brian Kernighan][1], the K in the legendary [K&R book][2]. Today, some near 50 years later, awk remains relevant with [new books][3] still appearing every year! Thus, it’s safe to assume that an investment in command line wizardry won’t depreciate any time soon. - -### What We’ll Cover - - * ICONV - * HEAD - * TR - * WC - * SPLIT - * SORT & UNIQ - * CUT - * PASTE - * JOIN - * GREP - * SED - * AWK - - - -### ICONV - -File encodings can be tricky. For the most part files these days are all UTF-8 encoded. To understand some of the magic behind UTF-8, check out this [excellent video][4]. Nonetheless, there are times where we receive a file that isn’t in this format. This can lead to some wonky attempts at swapping the encoding schema. Here, `iconv` is a life saver. Iconv is a simple program that will take text in one encoding and output the text in another. -``` -# Converting -f (from) latin1 (ISO-8859-1) -# -t (to) standard UTF_8 - -iconv -f ISO-8859-1 -t UTF-8 < input.txt > output.txt - -``` - - * Useful options: - - * `iconv -l` list all known encodings - * `iconv -c` silently discard characters that cannot be converted - - - -### HEAD - -If you are a frequent Pandas user then `head` will be familiar. Often when dealing with new data the first thing we want to do is get a sense of what exists. This leads to firing up Pandas, reading in the data and then calling `df.head()` \- strenuous, to say the least. Head, without any flags, will print out the first 10 lines of a file. The true power of `head` lies in testing out cleaning operations. For instance, if we wanted to change the delimiter of a file from commas to pipes. One quick test would be: `head mydata.csv | sed 's/,/|/g'`. -``` -# Prints out first 10 lines - -head filename.csv - -# Print first 3 lines - -head -n 3 filename.csv - -``` - - * Useful options: - - * `head -n` print a specific number of lines - * `head -c` print a specific number of bytes - - - -### TR - -Tr is analogous to translate. This powerful utility is a workhorse for basic file cleaning. An ideal use case is for swapping out the delimiters within a file. -``` -# Converting a tab delimited file into commas - -cat tab_delimited.txt | tr "\t" "," comma_delimited.csv - -``` - -Another feature of `tr` is all the built in `[:class:]` variables at your disposal. These include: -``` -[:alnum:] all letters and digits -[:alpha:] all letters -[:blank:] all horizontal whitespace -[:cntrl:] all control characters -[:digit:] all digits -[:graph:] all printable characters, not including space -[:lower:] all lower case letters -[:print:] all printable characters, including space -[:punct:] all punctuation characters -[:space:] all horizontal or vertical whitespace -[:upper:] all upper case letters -[:xdigit:] all hexadecimal digits - -``` - -You can chain a variety of these together to compose powerful programs. The following is a basic word count program you could use to check your READMEs for overuse. -``` -cat README.md | tr "[:punct:][:space:]" "\n" | tr "[:upper:]" "[:lower:]" | grep . | sort | uniq -c | sort -nr - -``` - -Another example using basic regex: -``` -# Converting all upper case letters to lower case - -cat filename.csv | tr '[A-Z]' '[a-z]' - -``` - - * Useful options: - - * `tr -d` delete characters - * `tr -s` squeeze characters - * `\b` backspace - * `\f` form feed - * `\v` vertical tab - * `\NNN` character with octal value NNN - - - -### WC - -Word count. Its value is primarily derived from the `-l` flag, which will give you the line count. -``` -# Will return number of lines in CSV - -wc -l gigantic_comma.csv - -``` - -This tool comes in handy to confirm the output of various commands. So, if we were to convert the delimiters within a file and then run `wc -l` we would expect the total lines to be the same. If not, then we know something went wrong. - - * Useful options: - - * `wc -c` print the byte counts - * `wc -m` print the character counts - * `wc -L` print length of longest line - * `wc -w` print word counts - - - -### SPLIT - -File sizes can range dramatically. And depending on the job, it could be beneficial to split up the file - thus `split`. The basic syntax for split is: -``` -# We will split our CSV into new_filename every 500 lines - -split -l 500 filename.csv new_filename_ - -# filename.csv -# ls output -# new_filename_aaa -# new_filename_aab -# new_filename_aac - -``` - -Two quirks are the naming convention and lack of file extensions. The suffix convention can be numeric via the `-d` flag. To add file extensions, you’ll need to run the following `find` command. It will change the names of ALL files within the current directory by appending `.csv`, so be careful. -``` -find . -type f -exec mv '{}' '{}'.csv \; - -# ls output -# filename.csv.csv -# new_filename_aaa.csv -# new_filename_aab.csv -# new_filename_aac.csv - -``` - - * Useful options: - - * `split -b` split by certain byte size - * `split -a` generate suffixes of length N - * `split -x` split using hex suffixes - - - -### SORT & UNIQ - -The preceding commands are obvious: they do what they say they do. These two provide the most punch in tandem (i.e. unique word counts). This is due to `uniq`, which only operates on duplicate adjacent lines. Thus, the reason to `sort` before piping the output through. One interesting note is that `sort -u` will achieve the same results as the typical `sort file.txt | uniq` pattern. - -Sort does have a sneakily useful ability for data scientists: the ability to sort an entire CSV based on a particular column. -``` -# Sorting a CSV file by the second column alphabetically - -sort -t"," -k2,2 filename.csv - -# Numerically - -sort -t"," -k2n,2 filename.csv - -# Reverse order - -sort -t"," -k2nr,2 filename.csv - -``` - -The `-t` option here is to specify the comma as our delimiter. More often than not spaces or tabs are assumed. Furthermore, the `-k` flag is for specifying our key. The syntax for this is `-km,n`, with `m` being the starting field and `n` being the last. - - * Useful options: - - * `sort -f` ignore case - * `sort -r` reverse sort order - * `sort -R` scramble order - * `uniq -c` count number of occurrences - * `uniq -d` only print duplicate lines - - - -### CUT - -Cut is for removing columns. To illustrate, if we only wanted the first and third columns. -``` -cut -d, -f 1,3 filename.csv - -``` - -To select every column other than the first. -``` -cut -d, -f 2- filename.csv - -``` - -In combination with other commands, `cut` serves as a filter. -``` -# Print first 10 lines of column 1 and 3, where "some_string_value" is present - -head filename.csv | grep "some_string_value" | cut -d, -f 1,3 - -``` - -Finding out the number of unique values within the second column. -``` -cat filename.csv | cut -d, -f 2 | sort | uniq | wc -l - -# Count occurences of unique values, limiting to first 10 results - -cat filename.csv | cut -d, -f 2 | sort | uniq -c | head - -``` - -### PASTE - -Paste is a niche command with an interesting function. If you have two files that you need merged, and they are already sorted, `paste` has you covered. -``` -# names.txt -adam -john -zach - -# jobs.txt -lawyer -youtuber -developer - -# Join the two into a CSV - -paste -d ',' names.txt jobs.txt > person_data.txt - -# Output -adam,lawyer -john,youtuber -zach,developer - -``` - -For a more SQL_-esque variant, see below. - -### JOIN - -Join is a simplistic, quasi-tangential, SQL. The largest differences being that `join` will return all columns and matches can only be on one field. By default, `join` will try and use the first column as the match key. For a different result, the following syntax is necessary: -``` -# Join the first file (-1) by the second column -# and the second file (-2) by the first - -join -t"," -1 2 -2 1 first_file.txt second_file.txt - -``` - -The standard join is an inner join. However, an outer join is also viable through the `-a` flag. Another noteworthy quirk is the `-e` flag, which can be used to substitute a value if a missing field is found. -``` -# Outer join, replace blanks with NULL in columns 1 and 2 -# -o which fields to substitute - 0 is key, 1.1 is first column, etc... - -join -t"," -1 2 -a 1 -a2 -e ' NULL' -o '0,1.1,2.2' first_file.txt second_file.txt - -``` - -Not the most user-friendly command, but desperate times, desperate measures. - - * Useful options: - - * `join -a` print unpairable lines - * `join -e` replace missing input fields - * `join -j` equivalent to `-1 FIELD -2 FIELD` - - - -### GREP - -Global search for a regular expression and print, or `grep`; likely, the most well known command, and with good reason. Grep has a lot of power, especially for finding your way around large codebases. Within the realm of data science, it acts as a refining mechanism for other commands. Although its standard usage is valuable as well. -``` -# Recursively search and list all files in directory containing 'word' - -grep -lr 'word' . - -# List number of files containing word - -grep -lr 'word' . | wc -l - -``` - -Count total number of lines containing word / pattern. -``` -grep -c 'some_value' filename.csv - -# Same thing, but in all files in current directory by file name - -grep -c 'some_value' * - -``` - -Grep for multiple values using the or operator - `\|`. -``` -grep "first_value\|second_value" filename.csv - -``` - - * Useful options - - * `alias grep="grep --color=auto"` make grep colorful - * `grep -E` use extended regexps - * `grep -w` only match whole words - * `grep -l` print name of files with match - * `grep -v` inverted matching - - - -### THE BIG GUNS - -Sed and Awk are the two most powerful commands in this article. For brevity, I’m not going to go into exhausting detail about either. Instead, I will cover a variety of commands that prove their impressive might. If you want to know more, [there is a book][5] just for that. - -### SED - -At its core `sed` is a stream editor. It excels at substitutions, but can also be leveraged for all out refactoring. - -The most basic `sed` command consists of `s/old/new/g`. This translates to search for old value, replace with new globally. Without the `/g` our command would terminate after the first occurrence. - -To get a quick taste of the power lets dive into an example. In this scenario you’ve been given the following file: -``` -balance,name -$1,000,john -$2,000,jack - -``` - -The first thing we may want to do is remove the dollar signs. The `-i` flag indicates in-place. The `''` is to indicate a zero-length file extension, thus overwriting our initial file. Ideally, you would test each of these individually and then output to a new file. -``` -sed -i '' 's/\$//g' data.txt - -# balance,name -# 1,000,john -# 2,000,jack - -``` - -Next up, the commas in our `balance` column values. -``` -sed -i '' 's/\([0-9]\),\([0-9]\)/\1\2/g' data.txt - -# balance,name -# 1000,john -# 2000,jack - -``` - -Lastly, Jack up and decided to quit one day. So, au revoir, mon ami. -``` -sed -i '' '/jack/d' data.txt - -# balance,name -# 1000,john - -``` - -As you can see, `sed` packs quite a punch, but the fun doesn’t stop there. - -### AWK - -The best for last. Awk is much more than a simple command: it is a full-blown language. Of everything covered in this article, `awk` is by far the coolest. If you find yourself impressed there are loads of great resources - see [here][6], [here][7] and [here][8]. - -Common use cases for `awk` include: - - * Text processing - * Formatted text reports - * Performing arithmetic operations - * Performing string operations - - - -Awk can parallel `grep` in its most nascent form. -``` -awk '/word/' filename.csv - -``` - -Or with a little more magic the combination of `grep` and `cut`. Here, `awk` prints the third and fourth column, tab separated, for all lines with our word. `-F,` merely changes our delimiter to a comma. -``` -awk -F, '/word/ { print $3 "\t" $4 }' filename.csv - -``` - -Awk comes with a lot of nifty variables built-in. For instance, `NF` \- number of fields - and `NR` \- number of records. To get the fifty-third record in a file: -``` -awk -F, 'NR == 53' filename.csv - -``` - -An added wrinkle is the ability to filter based off of one or more values. The first example, below, will print the line number and columns for records where the first column equals string. -``` -awk -F, ' $1 == "string" { print NR, $0 } ' filename.csv - -# Filter based off of numerical value in second column - -awk -F, ' $2 == 1000 { print NR, $0 } ' filename.csv - -``` - -Multiple numerical expressions: -``` -# Print line number and columns where column three greater -# than 2005 and column five less than one thousand - -awk -F, ' $3 >= 2005 && $5 <= 1000 { print NR, $0 } ' filename.csv - -``` - -Sum the third column: -``` -awk -F, '{ x+=$3 } END { print x }' filename.csv - -``` - -The sum of the third column, for values where the first column equals “something”. -``` -awk -F, '$1 == "something" { x+=$3 } END { print x }' filename.csv - -``` - -Get the dimensions of a file: -``` -awk -F, 'END { print NF, NR }' filename.csv - -# Prettier version - -awk -F, 'BEGIN { print "COLUMNS", "ROWS" }; END { print NF, NR }' filename.csv - -``` - -Print lines appearing twice: -``` -awk -F, '++seen[$0] == 2' filename.csv - -``` - -Remove duplicate lines: -``` -# Consecutive lines -awk 'a !~ $0; {a=$0}'] - -# Nonconsecutive lines -awk '! a[$0]++' filename.csv - -# More efficient -awk '!($0 in a) {a[$0];print} - -``` - -Substitute multiple values using built-in function `gsub()`. -``` -awk '{gsub(/scarlet|ruby|puce/, "red"); print}' - -``` - -This `awk` command will combine multiple CSV files, ignoring the header and then append it at the end. -``` -awk 'FNR==1 && NR!=1{next;}{print}' *.csv > final_file.csv - -``` - -Need to downsize a massive file? Welp, `awk` can handle that with help from `sed`. Specifically, this command breaks one big file into multiple smaller ones based on a line count. This one-liner will also add an extension. -``` -sed '1d;$d' filename.csv | awk 'NR%NUMBER_OF_LINES==1{x="filename-"++i".csv";}{print > x}' - -# Example: splitting big_data.csv into data_(n).csv every 100,000 lines - -sed '1d;$d' big_data.csv | awk 'NR%100000==1{x="data_"++i".csv";}{print > x}' - -``` - -### CLOSING - -The command line boasts endless power. The commands covered in this article are enough to elevate you from zero to hero in no time. Beyond those covered, there are many utilities to consider for daily data operations. [Csvkit][9], [xsv][10] and [q][11] are three of note. If you’re looking to take an even deeper dive into command line data science, then look no further than [this book][12]. It’s also available online [for free][13]! - --------------------------------------------------------------------------------- - -via: http://kadekillary.work/post/cli-4-ds/ - -作者:[Kade Killary][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://kadekillary.work/authors/kadekillary -[1]:https://en.wikipedia.org/wiki/Brian_Kernighan -[2]:https://en.wikipedia.org/wiki/The_C_Programming_Language -[3]:https://www.amazon.com/Learning-AWK-Programming-cutting-edge-text-processing-ebook/dp/B07BT98HDS -[4]:https://www.youtube.com/watch?v=MijmeoH9LT4 -[5]:https://www.amazon.com/sed-awk-Dale-Dougherty/dp/1565922255/ref=sr_1_1?ie=UTF8&qid=1524381457&sr=8-1&keywords=sed+and+awk -[6]:https://www.amazon.com/AWK-Programming-Language-Alfred-Aho/dp/020107981X/ref=sr_1_1?ie=UTF8&qid=1524388936&sr=8-1&keywords=awk -[7]:http://www.grymoire.com/Unix/Awk.html -[8]:https://www.tutorialspoint.com/awk/index.htm -[9]:http://csvkit.readthedocs.io/en/1.0.3/ -[10]:https://github.com/BurntSushi/xsv -[11]:https://github.com/harelba/q -[12]:https://www.amazon.com/Data-Science-Command-Line-Time-Tested/dp/1491947853/ref=sr_1_1?ie=UTF8&qid=1524390894&sr=8-1&keywords=data+science+at+the+command+line -[13]:https://www.datascienceatthecommandline.com/ diff --git a/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md b/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md new file mode 100644 index 0000000000..a02057f65a --- /dev/null +++ b/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md @@ -0,0 +1,469 @@ +数据科学家的命令行技巧 +====== + +![](https://i.imgur.com/0mzQMcB.png) + +对于许多数据科学家来说,数据操作始于和结束于 Pandas 或 Tidyverse。从理论上讲,这样做没有任何问题。毕竟,这就是这些工具存在的原因。然而,对于像分隔符转换这样的简单任务,这些工具是大材小用了。 + +立志掌握命令行应该在每个开发人员的清单上,特别是数据科学家。学习 shell 的来龙去脉将无可否认地提高你的生产力。除此之外,命令行还是计算领域的一个重要历史课程。例如,awk - 一种数据驱动的脚本语言。1977年,在传奇的 [K&R 书][2]中 K 即 [Brain Kernighan][1] 的帮助下,Awk 首次出现。今天,大约五十年过去了,awk 仍然和每年出现的[新书][3]相关。因此,可以安全地假设对命令行魔法的投资不会很快贬值。 + +### 我们将涵盖什么 + + * ICONV + * HEAD + * TR + * WC + * SPLIT + * SORT & UNIQ + * CUT + * PASTE + * JOIN + * GREP + * SED + * AWK + + + +### ICONV + +文件编码可能会很棘手。现在大部分文件都是 UTF-8 编码的。要了解 UTF-8 背后的一些魔力,请查看这个出色的[视频][4]。尽管如此,有时我们收到的文件不是这种格式。这可能引起对改变编码模式的一些不靠谱尝试。这里,iconv 是一个拯救者。Iconv 是一个简单的程序,它将获取采用一种编码的文本并输出采用另一种编码的文本。 +``` +# Converting -f (from) latin1 (ISO-8859-1) +# -t (to) standard UTF_8 + +iconv -f ISO-8859-1 -t UTF-8 < input.txt > output.txt +``` + + * 实用选项: + + * `iconv -l` 列出所有已知编码 + * `iconv -c` 默默丢弃无法转换的字符 + + + +### HEAD + +如果你是一个频繁的 Pandas 用户,那么会很熟悉 `head`。通常在处理新数据时,我们想做的第一件事就是了解其内容。这导致启动 Pandas,读取数据然后调用 `df.head()` \- 这至少是费劲的。没有任何标志的 Head 将打印出文件的前10行。`head` 的真正力量在于测试出来干净利落的操作。例如,如果我们想将文件的分隔符从逗号更改为管道。一个快速测试将是:`head mydata.csv | sed 's/,/|/g'`。 +```bash +# Prints out first 10 lines +head filename.csv + +# Print first 3 lines +head -n 3 filename.csv +``` + + * 实用选项: + + * `head -n` 打印特定行数 + * `head -c` 打印具体的字节数 + + + +### TR + +Tr 类似于翻译。这个功能强大的实用程序是基本文件清理的主力。理想的用例是交换文件中的分隔符。 +```bash +# Converting a tab delimited file into commas +cat tab_delimited.txt | tr "\t" "," comma_delimited.csv +``` + +`tr` 另一个功能是在你支配中的内建 `[:class:]` 变量(POSIX 字符类)。这些包括了: + +``` +[:alnum:] all letters and digits +[:alpha:] all letters +[:blank:] all horizontal whitespace +[:cntrl:] all control characters +[:digit:] all digits +[:graph:] all printable characters, not including space +[:lower:] all lower case letters +[:print:] all printable characters, including space +[:punct:] all punctuation characters +[:space:] all horizontal or vertical whitespace +[:upper:] all upper case letters +[:xdigit:] all hexadecimal digits +``` + +你可以将这些连接在一起以组成强大的程序。以下是一个基本的字数统计程序,可用于检查自述文件是否过度使用。 +``` +cat README.md | tr "[:punct:][:space:]" "\n" | tr "[:upper:]" "[:lower:]" | grep . | sort | uniq -c | sort -nr +``` + +另一个使用基本正则表达式的例子: +``` +# Converting all upper case letters to lower case +cat filename.csv | tr '[A-Z]' '[a-z]' +``` + + * 实用选项: + + * `tr -d` 删除字符 + * `tr -s` 压缩字符 + * `\b` 退格 + * `\f` 换页 + * `\v` 垂直制表符 + * `\NNN` 八进制字符 + + + +### WC + +单词数量。它的值主要来自 `-l` 标志,它会给你提供行数。 +``` +# Will return number of lines in CSV +wc -l gigantic_comma.csv +``` + +这个工具可以方便地确认各种命令的输出。所以,如果我们在转换文件中的分隔符之后运行 `wc -l`,我们会期待总行数是一样的,如果不一致,我们就知道有地方出错了。 + + * 实用选项: + + * `wc -c` 打印字节数 + * `wc -m` 打印字符数 + * `wc -L` 打印最长行的长度 + * `wc -w` 打印单词数量 + + + +### SPLIT + +文件大小的范围可以很广。取决于任务,拆分文件可以是有益的,所以使用 `split` 吧。split的基本语法是: +```bash +# We will split our CSV into new_filename every 500 lines +split -l 500 filename.csv new_filename_ +# filename.csv +# ls output +# new_filename_aaa +# new_filename_aab +# new_filename_aa +``` + +两个奇怪的地方是命名约定和缺少文件扩展名。后缀约定可以通过 `-d` 标志变为数字。要添加文件扩展名,你需要运行以下 `find` 命令。它将通过附加 `.csv`更改当前目录中所有文件的名称,所以小心了。 +```bash +find . -type f -exec mv '{}' '{}'.csv \; +# ls output +# filename.csv.csv +# new_filename_aaa.csv +# new_filename_aab.csv +# new_filename_aac.csv +``` + + * 实用选项: + + * `split -b` 按特定字节大小分割 + * `split -a` 生成长度为 N 的后缀 + * `split -x` 使用十六进制后缀分割 + + + +### SORT & UNIQ + +以上两个命令很明显:他们的作用就是字面意思。这两者结合起来可以提供最强大的冲击 (i.e. 单独单词数量)。这是由于 `uniq` 只作用于重复的相邻行。这也是在输出前 `sort` 的原因。一个有趣的纪录是 `sort -u` 会达到和典型的 `sort file.txt | uniq` 模式一样的结果。 + +Sort 对数据科学家来说确实具有潜在的有用能力:能够根据特定列对整个 CSV 进行排序。 +```bash +# Sorting a CSV file by the second column alphabetically +sort -t"," -k2,2 filename.csv + +# Numerically +sort -t"," -k2n,2 filename.csv + +# Reverse order +sort -t"," -k2nr,2 filename.csv +``` + +这里的 `-t` 选项将逗号指定为分隔符。通常假设分隔符是空格或制表符。此外,`-k` 标志是为了确定我们的 key。这里的语法是 `-km,n`,`m` 作为开始列,`n` 作为结束列。 + + * 实用选项: + + * `sort -f` 忽略大小写 + * `sort -r` 反向排序 + * `sort -R` 乱序 + * `uniq -c` 统计出现次数 + * `uniq -d` 只打印重复行 + + + +### CUT + +Cut 用于删除列。为了演示,如果我们只想删除第一和第三列。 +```bash +cut -d, -f 1,3 filename.csv +``` + +选择除了第一行外的所有行。 +```bash +cut -d, -f 2- filename.csv +``` + +结合其他命令,将`cut` 用作过滤器。 +```bash +# Print first 10 lines of column 1 and 3, where "some_string_value" is present +head filename.csv | grep "some_string_value" | cut -d, -f 1,3 +``` + +查出第二列中唯一值的数量。 +```bash +cat filename.csv | cut -d, -f 2 | sort | uniq | wc -l + +# Count occurences of unique values, limiting to first 10 results +cat filename.csv | cut -d, -f 2 | sort | uniq -c | head +``` + +### PASTE + +Paste 是一个带有趣味性功能的粘贴命令。如果你有两个需要合并的文件,并且它们已经排序了,`paste` 帮你解决了接下来的步骤。 +```bash +# names.txt +adam +john +zach + +# jobs.txt +lawyer +youtuber +developer + +# Join the two into a CSV +paste -d ',' names.txt jobs.txt > person_data.txt + +# Output +adam,lawyer +john,youtuber +zach,developer +``` + +查看更多 SQL_-esque 变种,见下文。 + +### JOIN + +Join 是一个简单准切向的 SQL。最大的区别是 `join` 将返回所有列以及只能在一个字段上匹配。默认情况下,`join` 将尝试使用第一列作为匹配键。为了获得不同结果,必须使用以下语法: +```bash +# Join the first file (-1) by the second column +# and the second file (-2) by the first +join -t "," -1 2 -2 1 first_file.txt second_file.txt +``` + +标准的 join 是内连接。然而,外连接通过 `-a` 标志也是可行的。另一个值得一提的技巧是 `-q` 标志,如果发现有缺失的字段,可用于替换值。 +```bash +# Outer join, replace blanks with NULL in columns 1 and 2 +# -o which fields to substitute - 0 is key, 1.1 is first column, etc... +join -t"," -1 2 -a 1 -a2 -e ' NULL' -o '0,1.1,2.2' first_file.txt second_file.txt +``` + +不是最用户友好的命令,而是绝望时刻的绝望措施。 + + * 实用选项: + + * `join -a` 打印不可配对的行 + * `join -e` 替换丢失的输入字段 + * `join -j` 相当于 `-1 FIELD -2 FIELD` + + + +### GREP + +用正则表达式全局搜索并且打印,或者 `grep`,可能是最有名的命令并且有充分的理由。Grep 很强大,特别适合在大型代码库中找到路径。在数据科学的王国里,它充当其他命令的提炼机制。虽然它的标准用途也很有价值。 +``` +# Recursively search and list all files in directory containing 'word' + +grep -lr 'word' . + +# List number of files containing word + +grep -lr 'word' . | wc -l + +``` + +计算包含单词或模式的总行数。 +``` +grep -c 'some_value' filename.csv + +# Same thing, but in all files in current directory by file name + +grep -c 'some_value' * +``` + +使用 or 运算符 - `\|` 为多个值 Grep。 +``` +grep "first_value\|second_value" filename.csv +``` + + * 实用选项: + + * `alias grep="grep --color=auto"` 使 grep 丰富多彩 + * `grep -E` 使用扩展的 regexp + * `grep -w` 只匹配整个单词 + * `grep -l` 打印匹配的文件名 + * `grep -v` 倒置匹配 + + + +### 大人物们 + +Sed 和 Awk 是本文中最强大的两个命令。为简介起见,我不打算详细讨论这两个命令。相反,我将介绍各种能证明其令人印象深刻的力量的命令。如果你想了解更多,[这儿就有一本书][5]是关于它们的。 + +### SED + +`sed` 本质上是一个流编辑器。它擅长替换,但也可以用于所有输出重构。 + +最基本的 `sed` 命令由 `s/old/new/g` 组成。这转换为搜索旧值,全局替换为新值。 如果没有 `/g`,我们的命令将在旧值第一次出现后终止。 + +为了快速了解它的功能,我们可以深入了解一个例子。 在以下情景中,你已获得以下文件: +``` +balance,name +$1,000,john +$2,000,jack +``` + +我们可能想要做的第一件事是删除美元符号。`-i` 标志表示原位。`''` 表示零长度文件扩展名,从而覆盖我们的初始文件。理想情况下,你可以单独测试每个,然后输出到新文件。 +``` +sed -i '' 's/\$//g' data.txt +# balance,name +# 1,000,john +# 2,000,jack +``` + +接下来, `blance` 列的逗号。 +``` +sed -i '' 's/\([0-9]\),\([0-9]\)/\1\2/g' data.txt +# balance,name +# 1000,john +# 2000,jack +``` + +最后杰克有一天决定退出。所以,再见了,我的朋友。 +``` +sed -i '' '/jack/d' data.txt +# balance,name +# 1000,john +``` + +正如你所看到的,`sed` 有很多强大的功能,但乐趣并不止于此。 + +### AWK + +最好的留在最后。Awk 不仅仅是一个简单的命令:它是一个成熟的语言。在本文中涉及的所有内容中,`awk` 是目前为止最酷的。如果你发现自己对其印象深刻,这里有很多很棒的资源 - 看 [这里][6], [这里][7] 和 [这里][8]。 + +`awk` 的常见用例包括: + + * 文字处理 + * 格式化文本报告 + * 执行算术运算 + * 执行字符串操作 + + + +Awk 可以以最原生的形式并行 `grep`。 +``` +awk '/word/' filename.csv +``` + +或者更加神奇:将 `grep` 和 `cut` 组合起来。在这里,`awk` 打印第三和第四列,用 tab 分隔,对于所有带我们指定单词的行。`-F,` 只是改变我们的分隔符为逗号。 +```bash +awk -F, '/word/ { print $3 "\t" $4 }' filename.csv +``` + +Awk 内置了许多精巧的变量。比如,`NF` \- 字段数 - 和 `NR` \- 记录数。要获取文件中的第53条记录: +```bash +awk -F, 'NR == 53' filename.csv +``` + +增加的代码是基于一个或多个值进行过滤的能力。下面的第一个示例将打印第一列等于给定字符串的记录的行号和列。 +```bash +awk -F, ' $1 == "string" { print NR, $0 } ' filename.csv + +# Filter based off of numerical value in second column +awk -F, ' $2 == 1000 { print NR, $0 } ' filename.csv +``` + +多个数值表达式: +```bash +# Print line number and columns where column three greater +# than 2005 and column five less than one thousand + +awk -F, ' $3 >= 2005 && $5 <= 1000 { print NR, $0 } ' filename.csv +``` + +求出第三列的总和: +```bash +awk -F, '{ x+=$3 } END { print x }' filename.csv +``` + +在第一列等于 “something”的那些行,求出第三列值的总和。 +```bash +awk -F, '$1 == "something" { x+=$3 } END { print x }' filename.csv +``` + +获取文件的尺寸: +```bash +awk -F, 'END { print NF, NR }' filename.csv + +# Prettier version +awk -F, 'BEGIN { print "COLUMNS", "ROWS" }; END { print NF, NR }' filename.csv +``` + +打印出现了两次的行: +```bash +awk -F, '++seen[$0] == 2' filename.csv +``` + +删除重复的行: +```bash +# Consecutive lines +awk 'a !~ $0; {a=$0}'] + +# Nonconsecutive lines +awk '! a[$0]++' filename.csv + +# More efficient +awk '!($0 in a) {a[$0];print} +``` + +使用内置函数 `gsub()` 替换多个值。 +```bash +awk '{gsub(/scarlet|ruby|puce/, "red"); print}' +``` + +这个 `awk` 命令将组合多个 CSV 文件,忽略标题,然后在最后附加它。 +```bash +awk 'FNR==1 && NR!=1{next;}{print}' *.csv > final_file.csv +``` + +需要缩小一个庞大的文件? `awk` 可以在 `sed` 的帮助下处理它。具体来说,该命令根据行数将一个大文件分成多个较小的文件。这个 one-liner 也将增加一个扩展。 +```bash +sed '1d;$d' filename.csv | awk 'NR%NUMBER_OF_LINES==1{x="filename-"++i".csv";}{print > x}' + +# Example: splitting big_data.csv into data_(n).csv every 100,000 lines +sed '1d;$d' big_data.csv | awk 'NR%100000==1{x="data_"++i".csv";}{print > x}' +``` + +### 结语 + +命令行拥有无穷无尽的力量。本文中介绍的命令足以将你从一无所知提升到英雄人物。除了涵盖的内容之外,还有许多实用程序需要考虑用于日常数据操作。[Csvkit][9], [xsv][10] 还有 [q][11] 是需要记住的三个。如果你希望更深入地了解命令行数据科学,查看[这本书][12]。它也可以[免费][13]在线获得! + +-------------------------------------------------------------------------------- + +via: http://kadekillary.work/post/cli-4-ds/ + +作者:[Kade Killary][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[GraveAccent](https://github.com/graveaccent) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://kadekillary.work/authors/kadekillary +[1]:https://en.wikipedia.org/wiki/Brian_Kernighan +[2]:https://en.wikipedia.org/wiki/The_C_Programming_Language +[3]:https://www.amazon.com/Learning-AWK-Programming-cutting-edge-text-processing-ebook/dp/B07BT98HDS +[4]:https://www.youtube.com/watch?v=MijmeoH9LT4 +[5]:https://www.amazon.com/sed-awk-Dale-Dougherty/dp/1565922255/ref=sr_1_1?ie=UTF8&qid=1524381457&sr=8-1&keywords=sed+and+awk +[6]:https://www.amazon.com/AWK-Programming-Language-Alfred-Aho/dp/020107981X/ref=sr_1_1?ie=UTF8&qid=1524388936&sr=8-1&keywords=awk +[7]:http://www.grymoire.com/Unix/Awk.html +[8]:https://www.tutorialspoint.com/awk/index.htm +[9]:http://csvkit.readthedocs.io/en/1.0.3/ +[10]:https://github.com/BurntSushi/xsv +[11]:https://github.com/harelba/q +[12]:https://www.amazon.com/Data-Science-Command-Line-Time-Tested/dp/1491947853/ref=sr_1_1?ie=UTF8&qid=1524390894&sr=8-1&keywords=data+science+at+the+command+line +[13]:https://www.datascienceatthecommandline.com/ From 5c307e68ac0a41dd69a486fa03a7853a7a4d261c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 23:10:44 +0800 Subject: [PATCH 0808/1143] PRF:20181204 3 implications of serverless.md @HankChow --- .../20181204 3 implications of serverless.md | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/translated/talk/20181204 3 implications of serverless.md b/translated/talk/20181204 3 implications of serverless.md index 866e48fdd7..d2a097f898 100644 --- a/translated/talk/20181204 3 implications of serverless.md +++ b/translated/talk/20181204 3 implications of serverless.md @@ -1,31 +1,30 @@ 无服务器架构的三个意义 ====== -对于无服务器Serverless架构,什么时候该用,什么时候不该用呢? + +> 以及,对于无服务器Serverless架构,什么时候该用,什么时候不该用呢? ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR) 如果将如今互联网体验中最方便实用的那一部分去掉,那么留下来的基本就是客户端-服务端client-server模式了。这一个模式在互联网建立初期就已经在使用了,直到目前都没有太大的变化,也就是说,这个模式仍然在为我们服务。 -那么,当人们谈论无服务器架构的时候,到底是指什么呢?其实,无服务器架构并不是说不使用服务器了。恰恰相反,客户端-服务端模式仍然在其中发挥着重要的作用。 +那么,当人们谈论无服务器Serverless架构的时候,到底是指什么呢?其实,无服务器架构并不是说不使用服务器了。恰恰相反,客户端-服务端模式仍然在其中发挥着重要的作用。 无服务器架构实际上指的是能够让开发者在不需要关心服务器上架、为操作系统打补丁、创建容器镜像这些工作的情况下,就能够完成编码、部署和创建应用这一整套流程的架构。 ### 无服务器架构的三个重要意义 - 1. 一些缺乏开发经验的人员现在要参与到开发工作中来了。无服务器架构能够让他们尽量只学习必要的工作内容,把更多的时间放在更具创造性的开发工作中。 - 2. 开发者不再需要重复造轮子。运行和维护服务器、为操作系统打补丁、创建容器等这一系列工作,都可以由更专业的无服务器架构提供商来完成。 - 3. 最现实的一点是,如果不使用无服务器架构,那么在服务器管理方面,总需要有一个作最终决策的人。当服务器发生崩溃时,或是需要在服务器上执行某些操作时,总是需要这样一个统领全局的人来作出决策。因此最佳的方案是使用无服务器架构。 - - +1. 一些缺乏开发经验的人员现在要参与到开发工作中来了。无服务器架构能够让他们尽量只学习必要的工作内容,把更多的时间放在更具创造性的开发工作中。 +2. 开发者不再需要重复造轮子。运行和维护服务器、为操作系统打补丁、创建容器等这一系列工作,都可以由更专业的无服务器架构提供商来完成。 +3. 最现实的一点是,如果不使用无服务器架构,那么在服务器管理方面,总需要有一个作最终决策的人。当服务器发生崩溃时,或是需要在服务器上执行某些操作时,总是需要这样一个统领全局的人来作出决策。因此最佳的方案是使用无服务器架构。 ### 什么时候该用或者不该用无服务器架构? 听起来无服务器架构是个好东西。但事实上,无服务器架构并不是万能的,在使用之前还需要考虑以下这些因素: - 1. 成本 - 2. 使用范围 - 3. 时间 - 4. 控制方式 +1. 成本 +2. 使用范围 +3. 时间 +4. 控制方式 其中值得注意的是控制方式。现在已经有一些项目为开发者提供了操作和控制无服务器架构计算环境的工具了,[Apache OpenWhisk][1] 就是其中之一。 @@ -40,7 +39,7 @@ via: https://opensource.com/article/18/12/serverless-podcast-command-line-heros 作者:[Jen Wike Huger][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 837b4d6256bbfc94b66ba34d0da675571de55e5f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 11 Dec 2018 23:11:36 +0800 Subject: [PATCH 0809/1143] PUB:20181204 3 implications of serverless.md @HankChow https://linux.cn/article-10336-1.html --- .../talk => published}/20181204 3 implications of serverless.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20181204 3 implications of serverless.md (100%) diff --git a/translated/talk/20181204 3 implications of serverless.md b/published/20181204 3 implications of serverless.md similarity index 100% rename from translated/talk/20181204 3 implications of serverless.md rename to published/20181204 3 implications of serverless.md From 86f0fbcdf31f22860b95fd340eadf58743e5d358 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 12 Dec 2018 09:28:28 +0800 Subject: [PATCH 0810/1143] translated --- ...ux- Features, Download and Installation.md | 86 ------------------- ...ux- Features, Download and Installation.md | 86 +++++++++++++++++++ 2 files changed, 86 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md create mode 100644 translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md diff --git a/sources/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/sources/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md deleted file mode 100644 index b21790181a..0000000000 --- a/sources/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (SMPlayer in Linux: Features, Download and Installation) -[#]: via: (https://itsfoss.com/smplayer/) -[#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/) -[#]: url: ( ) - -SMPlayer in Linux: Features, Download and Installation -====== - -One of the [things you’ll notice after a fresh install of Ubuntu][1], or pretty much any other Linux distribution, is this message when you try to play certain video files. - -![][2] -Default media player is not good with codecs - -It means that the [codecs needed][3] to play the media are not installed on the system. Now, due to some copyright issues, some Linux based operating systems cannot pre-pack the codecs in the installation media. But they do allow you to download and install the codecs with just a click, or you could just install a media player which has all the multimedia codecs, to begin with. Checkout [SMPlayer][4]. - -### Meet SMPlayer: A Better Media Player for Linux - -SMPlayer is a free and open-source media player built on the powerful [MPlayer][5] media engine. SMPlayer is capable of playing avi, mp4, mkv, mpeg, mov, divx, h.264 and pretty much any other major media format out there. And the cherry on top is, it can play [YouTube][6] videos too, ad-free. - -![SMPlayer default interface][7] - -SMPlayer is a complete media solution. It is cross-platform, so available on all the operating systems. If you have a dual boot, you can install it on your Windows and Linux OS to get a uniform experience on both the systems. It also supports convertible laptops with touch support. - -You can play YouTube on SMPlayer too. I know it’s impractical to copy-paste the video URL and play on an external player every time. But SMPlayer is particularly useful when you are watching comparatively lengthy videos. SMPlayer plays YouTube videos in a very good quality and I felt the videos play out much better than the in-browser videos. And by playing the lengthier videos on SMPlayer, you can stay clear of the mid-roll ads that pop up on the lengthier videos. - -If you’re watching a movie which doesn’t have subtitles, You can directly download the subtitles through SMPlayer. It comes with [opensubtitles.org][8] integration. So none of that, open the browser, search for subtitles, download the appropriate ones, unzip, place them in the video folder and connect the subtitles to the movie. No Sir! SMPlayer at your service. - -![Automatic subtitle download in SMPlayer][9] - -SMPlayer is available in more than 30 languages and it is highly customizable. It has both applications theming and a ton of icon sets in it. - -If you feel that the default interface of SMPlayer doesn’t look good, in a few clicks you can make it look like this: - -![SMPlayer skin change][10] - -SMPlayer comes with a lot of tools and features for the power users. It has an equalizer, video speed controls, aspect ratio and zoom controls, video filters, screenshot ripping and lot more. - -All in all, I really liked SMPlayer. It has a lot to offer in a small and lightweight package. I think it is a must have video player on your Linux PC. Along with playing all the media formats easily it also provides a ton of power controls. - -### Installing SMPlayer on Linux - -SMPlayer should be available in the software center of all major Linux distributions. You can search for it and install it from there itself. - -On Ubuntu/ Linux Mint/ Elementary OS, you can also install SMPlayer by running the following command in the terminal - -``` -sudo apt install smplayer -``` - -Alternatively, you can download the package for Fedora, Arch Linux, OpenSUSE and Debian [here.][11] - -### Wrapping Up - -There are a good number of full-fledged media players out there like the VLC media player. SMPlayer is one of the best ones with a full functionality and great add-on benefits. I’ll consider it one of the [must-have applications for Linux][12]. - -Do give it a try and share your thoughts with us in the comments section below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/smplayer/ - -作者:[Aquil Roshan;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/aquil/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-warning.jpg?fit=800%2C450&ssl=1 -[3]: https://packages.ubuntu.com/trusty/ubuntu-restricted-extras -[4]: https://www.smplayer.info/ -[5]: http://www.mplayerhq.hu/design7/news.html -[6]: https://www.youtube.com/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-coco.jpg?fit=800%2C450&ssl=1 -[8]: https://www.opensubtitles.org/en/search -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-icon-packs.jpg?fit=800%2C450&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-theme.jpg?fit=800%2C450&ssl=1 -[11]: https://software.opensuse.org/download.html?project=home%3Asmplayerdev&package=smplayer -[12]: https://itsfoss.com/essential-linux-applications/ diff --git a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md new file mode 100644 index 0000000000..be826fc446 --- /dev/null +++ b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (SMPlayer in Linux: Features, Download and Installation) +[#]: via: (https://itsfoss.com/smplayer/) +[#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/) +[#]: url: ( ) + +Linux 中的 SMPlayer:功能,下载和安装 +====== + +当你要播放视频时,你会在[全新安装的 Ubuntu][1],或其他许多发行版中,会注意到一个消息: + +![][2] +默认媒体播放器没有适合的编解码器 + +这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。了解一下 [SMPlayer][4]。 + +### 认识 SMPlayer:适用于 Linux 的更好的媒体播放器 + +SMPlayer 是一款免费的开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。 + +![SMPlayer default interface][7] + +SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。 + +你也可以在 SMPlayer 上播放 YouTube。我知道每次复制粘贴视频 URL 并在外部播放器上播放是不切实际的。但是当你观看相对较长的视频时,SMPlayer 特别有用。SMPlayer 以相当好的质量播放 YouTube 视频,我觉得比在浏览器中播放得更好。通过在 SMPlayer 上播放较长的视频,你可以远离视频中间弹出的插播广告。 + +如果你在观看没有字幕的电影,你可以直接通过 SMPlayer 下载字幕。它集成了 [opensubtitles.org][8]。所以,打开浏览器,搜索字幕,下载相应的字幕,解压缩,将它们放在视频文件夹中并将字幕连接到电影,这些都不需要!SMPlayer 会为你服务。 + +![Automatic subtitle download in SMPlayer][9] + +SMPlayer 支持 30 多种语言,并可高度自定义。它还有应用主题和大量的图标集。 + +如果你觉得 SMPlayer 的默认界面看起来不太好,只需点击几下,它就可以看起来像这样: + +![SMPlayer skin change][10] + +SMPlayer 为高级用户提供了许多工具和功能。它有均衡器、视频速度控制、宽高比和缩放控制、视频过滤器、屏幕截图等等。 + +总而言之,我真的很喜欢 SMPlayer。它在一个小巧轻量级的安装包中提供了很多功能。我认为它是 Linux PC 上必备的视频播放器。除了轻松播放所有媒体格式外,它还提供了大量的控制。 + +### 在 Linux 上安装 SMPlayer + +SMPlayer 应该可在所有主要 Linux 发行版的软件中心获取。你可以搜索它并从那里安装它。 + +在 Ubuntu/ Linux Mint/ Elementary OS 上,你还可以通过在终端中运行以下命令来安装 SMPlayer + +``` +sudo apt install smplayer +``` + +或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包 + +### 总结 + +有很多像 VLC 媒体播放器那样成熟的播放器。SMPlayer 是拥有完整功能和插件优势的最佳产品之一。我认为它是[必备 Linux 应用][12]之一。 + +请尝试一下并在下面的评论栏与我们分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/smplayer/ + +作者:[Aquil Roshan;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/aquil/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-warning.jpg?fit=800%2C450&ssl=1 +[3]: https://packages.ubuntu.com/trusty/ubuntu-restricted-extras +[4]: https://www.smplayer.info/ +[5]: http://www.mplayerhq.hu/design7/news.html +[6]: https://www.youtube.com/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-coco.jpg?fit=800%2C450&ssl=1 +[8]: https://www.opensubtitles.org/en/search +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-icon-packs.jpg?fit=800%2C450&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-theme.jpg?fit=800%2C450&ssl=1 +[11]: https://software.opensuse.org/download.html?project=home%3Asmplayerdev&package=smplayer +[12]: https://itsfoss.com/essential-linux-applications/ \ No newline at end of file From e241040dd6c6aa7f2c1e52f8015e9383c15d102e Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 12 Dec 2018 09:32:00 +0800 Subject: [PATCH 0811/1143] translating --- ...ur Easy Ways to Search Or Find Files And Folders in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md index 8dde618420..f28649013b 100644 --- a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md +++ b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ab0558683312b3c62fedacc1b08127d90a6cbc25 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 13:03:09 +0800 Subject: [PATCH 0812/1143] PRF:20181128 OpenSnitch - an Application Firewall for Linux -Review.md @qhwdw --- ... Application Firewall for Linux -Review.md | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md b/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md index 229b5b89c1..9cfe0afa34 100644 --- a/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md +++ b/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md @@ -1,13 +1,13 @@ [#]: collector: "lujun9972" [#]: translator: "qhwdw" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: subject: "OpenSnitch – an Application Firewall for Linux [Review]" [#]: via: "https://itsfoss.com/opensnitch-firewall-linux/" -[#]: author: "[John Paul](https://itsfoss.com/author/john/)" +[#]: author: "John Paul https://itsfoss.com/author/john/" [#]: url: " " -OpenSnitch – 一个 Linux 上的应用程序防火墙 +OpenSnitch:一个 Linux 上的应用程序防火墙 ====== 不能因为 Linux 比 Windows 更安全,就可以在 Linux 上放松警惕。Linux 上可以使用的防火墙很多,它们可以让你的 Linux 系统更安全。今天,我们将带你了解一个这样的防火墙工具,它就是 OpenSnitch。 @@ -20,9 +20,11 @@ OpenSnitch – 一个 Linux 上的应用程序防火墙 OpenSnitch 所做的主要事情就是跟踪你机器上安装的应用程序所发起的互联网请求。OpenSnitch 允许你去创建规则以同意或阻止那个应用程序发起的互联网访问。当一个应用程序尝试去访问互联网而没有相应的访问规则存在时,就会出现一个对话框,这个对话框让你去选择允许还是阻止那个连接。 -你也可以决定这个新规则是应用到进程上、精确的 URL 上、域名上、单个实例上,以及本次会话还是永久有效。 +你也可以决定这个新规则是应用到进程上、具体的 URL 上、域名上、单个实例上,以及本次会话还是永久有效。 -![OpenSnitch firewall app in Linux][5]OpenSnatch 规则请求 +![OpenSnitch firewall app in Linux][5] + +*OpenSnatch 规则请求* 你创建的所有规则都保存为 [JSON 文件][6],如果以后需要修改它,就可以去修改这个文件。比如说,你错误地阻止了一个应用程序。 @@ -33,17 +35,17 @@ OpenSnitch 也有一个漂亮的、一目了然的图形用户界面: * 属主用户是谁 * 使用哪个端口 - - 如果你愿意,也可以将这些信息导出到一个 CSV 文件中。 OpenSnitch 遵循 GPL v3 许可证使用。 -![OpenSnitch firewall interface][7]OpenSnitch 进程标签页 +![OpenSnitch firewall interface][7] + +*OpenSnitch 进程标签页* ### 在 Linux 中安装 OpenSnitch -[OpenSnitch GitHub 页面][8] 上的安装介绍是针对 Ubuntu 用户的。如果你使用的是其它发行版,你需要调整一下相关的命令。据我所知,这个应用程序仅打包到 [Arch User Repository][9] 中。 +[OpenSnitch GitHub 页面][8] 上的安装介绍是针对 Ubuntu 用户的。如果你使用的是其它发行版,你需要调整一下相关的命令。据我所知,这个应用程序仅在 [Arch User Repository][9] 中打包了。 在你开始之前,你必须正确安装了 Go,并且已经定义好了 `$GOPATH` 环境变量。 @@ -67,7 +69,7 @@ go get github.com/evilsocket/opensnitch cd $GOPATH/src/github.com/evilsocket/opensnitch ``` -如果没有正确设置 `$GOPATH` 环境变量,运行上面的命令时将会出现一个 “no such folder found” 的错误信息。只需要进入到你刚才克隆仓库位置的 “evilsocket/opensnitch” 文件夹中即可。 +如果没有正确设置 `$GOPATH` 环境变量,运行上面的命令时将会出现一个 “no such folder found” 的错误信息。只需要进入到你刚才克隆仓库位置的 `evilsocket/opensnitch` 文件夹中即可。 现在,我们构建并安装它。 @@ -77,7 +79,7 @@ make sudo make install ``` -如果出现 “`dep` command could not be found” 的错误信息,在 `PATH` 中添加 `GOPATH/bin` 即可。 +如果出现 “dep command could not be found” 的错误信息,在 `$PATH` 中添加 `$GOPATH/bin` 即可。 安装完成后,我们将要启动它的守护程序和图形用户界面。 @@ -90,7 +92,8 @@ opensnitch-ui ``` ![OpenSnitch firewall interface][10] -运行在 Manjaro 上的 OpenSnitch + +*运行在 Manjaro 上的 OpenSnitch* ### 使用体验 @@ -98,7 +101,7 @@ opensnitch-ui 不幸的是,我安装之后,不能启动图形用户界面。因此,我手动去运行最后三个步骤。一切似乎很顺利。如果我想让 Firefox 去访问 Manjaro 的网站,对话框就会弹出来询问我。 -有趣的是,当我运行一个 [AUR 工具][11] `yay` 去更新我的系统时,弹出对话框要求了 `yay`、`pacman`、`pamac`、和 `git` 的访问规则。后来,我关闭并重启动 GUI,因为它是活动的。当我重启动它时,它不再要求我去创建规则了。我安装了 Falkon,而 OpenSnitch 并没有询问我去授予它任何权限。它甚至在 OpenSnitch 的 GUI 中没有列出 Falkon。我重新安装了 OpenSnitch 后,这个问题依旧存在。 +有趣的是,当我运行一个 [AUR 工具][11] `yay` 去更新我的系统时,弹出对话框要求了 `yay`、`pacman`、`pamac`、和 `git` 的访问规则。后来,我关闭并重启动 GUI,因为它当前是激活的。当我重启动它时,它不再要求我去创建规则了。我安装了 Falkon,而 OpenSnitch 并没有询问我去授予它任何权限。它甚至在 OpenSnitch 的 GUI 中没有列出 Falkon。我重新安装了 OpenSnitch 后,这个问题依旧存在。 然后,我转到 Ubuntu Mate 上安装 OpenSnitch,因为安装介绍就是针对 Ubuntu 所写的,进展很顺利。但是,我遇到了几个问题。我调整了一下上面介绍的安装过程以解决我遇到的问题。 @@ -106,7 +109,9 @@ opensnitch-ui GUI 也有一点需要去改进。由于某些原因,每次窗口都被放在顶部。而且不能通过设置来修改这个问题。如果能够从 GUI 中改变规则将是一个不错的选择。 -![][12]OpenSnitch 的 hosts 标签 +![][12] + +*OpenSnitch 的 hosts 标签* ### 对 OpenSnitch 的最后意见 @@ -125,7 +130,7 @@ via: https://itsfoss.com/opensnitch-firewall-linux/ 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d58835965df2e398c02e29d85babd8e1f7ac94d8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 13:04:11 +0800 Subject: [PATCH 0813/1143] PUB:20181128 OpenSnitch - an Application Firewall for Linux -Review.md @qhwdw https://linux.cn/article-10337-1.html --- ... OpenSnitch - an Application Firewall for Linux -Review.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181128 OpenSnitch - an Application Firewall for Linux -Review.md (99%) diff --git a/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md b/published/20181128 OpenSnitch - an Application Firewall for Linux -Review.md similarity index 99% rename from translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md rename to published/20181128 OpenSnitch - an Application Firewall for Linux -Review.md index 9cfe0afa34..996f905ddc 100644 --- a/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md +++ b/published/20181128 OpenSnitch - an Application Firewall for Linux -Review.md @@ -1,11 +1,11 @@ [#]: collector: "lujun9972" [#]: translator: "qhwdw" [#]: reviewer: "wxy" -[#]: publisher: " " +[#]: publisher: "wxy" [#]: subject: "OpenSnitch – an Application Firewall for Linux [Review]" [#]: via: "https://itsfoss.com/opensnitch-firewall-linux/" [#]: author: "John Paul https://itsfoss.com/author/john/" -[#]: url: " " +[#]: url: "https://linux.cn/article-10337-1.html" OpenSnitch:一个 Linux 上的应用程序防火墙 ====== From 390bdf2579df7a7ae2631ff5ba2ecf877af3d60b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 13:29:33 +0800 Subject: [PATCH 0814/1143] PRF:20180221 12 useful zypper command examples.md @cycoe --- ...80221 12 useful zypper command examples.md | 92 ++++++++++--------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/translated/tech/20180221 12 useful zypper command examples.md b/translated/tech/20180221 12 useful zypper command examples.md index 018c5da7c3..356c55becc 100644 --- a/translated/tech/20180221 12 useful zypper command examples.md +++ b/translated/tech/20180221 12 useful zypper command examples.md @@ -1,10 +1,11 @@ 12 条实用的 zypper 命令范例 ====== -zypper 是 Suse Linux 系统的包和补丁管理器,你可以根据下面的 12 条附带输出示例的实用范例来学习 zypper 命令的使用。 + +`zypper` 是 Suse Linux 系统的包和补丁管理器,你可以根据下面的 12 条附带输出示例的实用范例来学习 `zypper` 命令的使用。 ![zypper 命令示例][1] -Suse Linux 使用 zypper 进行包管理,其是一个由 [ZYpp 包管理引擎][2]提供技术支持的包管理系统。在此篇文章中我们将分享 12 条附带输出示例的实用 zypper 命令,能帮助你处理日常的系统管理任务。 +Suse Linux 使用 `zypper` 进行包管理,其是一个由 [ZYpp 包管理引擎][2]提供的包管理系统。在此篇文章中我们将分享 12 条附带输出示例的实用 `zypper` 命令,能帮助你处理日常的系统管理任务。 不带参数的 `zypper` 命令将列出所有可用的选项,这比参考详细的 man 手册要容易上手得多。 @@ -18,12 +19,12 @@ root@kerneltalks # zypper --help, -h 帮助 --version, -V 输出版本号 --promptids 输出 zypper 用户提示符列表 - --config, -c 使用制定的配置文件来替代默认的 + --config, -c 使用指定的配置文件来替代默认的 --userdata 在历史和插件中使用的用户自定义事务 id --quiet, -q 忽略正常输出,只打印错误信息 --verbose, -v 增加冗长程度 --color - --no-color 是否启用彩色模式如果 tty 支持 + --no-color 是否启用彩色模式,如果 tty 支持的话 --no-abbrev, -A 表格中的文字不使用缩写 --table-style, -s 表格样式(整型) --non-interactive, -n 不询问任何选项,自动使用默认答案 @@ -43,7 +44,7 @@ root@kerneltalks # zypper --gpg-auto-import-keys 自动信任并导入新仓库的签名密钥 --plus-repo, -p 使用附加仓库 --plus-content 另外使用禁用的仓库来提供特定的关键词 - 尝试 '--plus-content debug' 选项来启用仓库 + 尝试使用 '--plus-content debug' 选项来启用仓库 --disable-repositories 不从仓库中读取元数据 --no-refresh 不刷新仓库 --no-cd 忽略 CD/DVD 中的仓库 @@ -55,11 +56,11 @@ root@kerneltalks # zypper --disable-system-resolvables 不读取已安装包 - 命令: + 命令: help, ? 打印帮助 shell, sh 允许多命令 - 仓库管理: + 仓库管理: repos, lr 列出所有自定义仓库 addrepo, ar 添加一个新仓库 removerepo, rr 移除指定仓库 @@ -68,14 +69,14 @@ root@kerneltalks # zypper refresh, ref 刷新所有仓库 clean 清除本地缓存 - 服务管理: + 服务管理: services, ls 列出所有自定义服务 addservice, as 添加一个新服务 modifyservice, ms 修改指定服务 removeservice, rs 移除指定服务 refresh-services, refs 刷新所有服务 - 软件管理: + 软件管理: install, in 安装包 remove, rm 移除包 verify, ve 确认包依赖的完整性 @@ -83,7 +84,7 @@ root@kerneltalks # zypper install-new-recommends, inr 安装由已安装包建议一并安装的新包 - 更新管理: + 更新管理: update, up 更新已安装包至更新版本 list-updates, lu 列出可用更新 patch 安装必要的补丁 @@ -91,7 +92,7 @@ root@kerneltalks # zypper dist-upgrade, dup 进行发行版更新 patch-check, pchk 检查补丁 - 查询: + 查询: search, se 查找符合匹配模式的包 info, if 展示特定包的完全信息 patch-info 展示特定补丁的完全信息 @@ -103,27 +104,28 @@ root@kerneltalks # zypper products, pd 列出所有可用的产品 what-provides, wp 列出提供特定功能的包 - 包锁定: + 包锁定: addlock, al 添加一个包锁定 removelock, rl 移除一个包锁定 locks, ll 列出当前的包锁定 cleanlocks, cl 移除无用的锁定 - 其他命令: + 其他命令: versioncmp, vcmp 比较两个版本字符串 targetos, tos 打印目标操作系统 ID 字符串 licenses 打印已安装包的证书和 EULAs 报告 download 使用命令行下载指定 rpm 包到本地目录 source-download 下载所有已安装包的源码 rpm 包到本地目录 - 子命令: + 子命令: subcommand 列出可用子命令 输入 'zypper help ' 来获得特定命令的帮助。 ``` -##### 如何使用 zypper 安装包 -`zypper` 通过 `in` 或 `install` 开关来在你的系统上安装包。它的用法与 [yum package installation][3] 相同。你只需要提供包名作为参数,包管理器(此处是 zypper)就会处理所有的依赖并与你指定的包一并安装。 +### 如何使用 zypper 安装包 + +`zypper` 通过 `in` 或 `install` 子命令来在你的系统上安装包。它的用法与 [yum 软件包安装][3] 相同。你只需要提供包名作为参数,包管理器(此处是 `zypper`)就会处理所有的依赖并与你指定的包一并安装。 ``` # zypper install telnet @@ -147,11 +149,11 @@ Checking for file conflicts: ................................................... 以上是我们安装 `telnet` 包时的输出,供你参考。 -推荐阅读 : [在 YUM 和 APT 系统中安装包][3] +推荐阅读:[在 YUM 和 APT 系统中安装包][3] -##### 如何使用 zypper 移除包 +### 如何使用 zypper 移除包 -要在 Suse Linux 中擦除或移除包,使用 `zypper` 命令附带 `remove` 或 `rm` 开关。 +要在 Suse Linux 中擦除或移除包,使用 `zypper` 附带 `remove` 或 `rm` 子命令。 ``` root@kerneltalks # zypper rm telnet @@ -167,13 +169,14 @@ After the operation, 113.3 KiB will be freed. Continue? [y/n/...? shows all options] (y): y (1/1) Removing telnet-1.2-165.63.x86_64 ..........................................................................................................................[done] ``` + 我们在此处移除了先前安装的 telnet 包。 -##### 使用 zypper 检查依赖或者认证已安装包的完整性 +### 使用 zypper 检查依赖或者认证已安装包的完整性 有时可以通过强制忽略依赖关系来安装软件包。`zypper` 使你能够扫描所有已安装的软件包并检查其依赖性。如果缺少任何依赖项,它将提供你安装或重新安装它的机会,从而保持已安装软件包的完整性。 -使用附带 `verify` 或 `ve` 开关的 `zypper` 命令来检查已安装包的完整性。 +使用附带 `verify` 或 `ve` 子命令的 `zypper` 命令来检查已安装包的完整性。 ``` root@kerneltalks # zypper ve @@ -184,9 +187,10 @@ Reading installed packages... Dependencies of all installed packages are satisfied. ``` + 在上面的输出中,你能够看到最后一行说明已安装包的所有依赖都已安装完全,并且无需更多操作。 -##### 如何在 Suse Linux 中使用 zypper 下载包 +### 如何在 Suse Linux 中使用 zypper 下载包 `zypper` 提供了一种方法使得你能够将包下载到本地目录而不去安装它。你可以在其他具有同样配置的系统上使用这个已下载的软件包。包会被下载至 `/var/cache/zypp/packages///` 目录。 @@ -206,13 +210,14 @@ total 52 -rw-r--r-- 1 root root 53025 Feb 21 03:17 telnet-1.2-165.63.x86_64.rpm ``` + 你能看到我们使用 `zypper` 将 telnet 包下载到了本地。 -推荐阅读 : [在 YUM 和 APT 系统中只下载包而不安装][4] +推荐阅读:[在 YUM 和 APT 系统中只下载包而不安装][4] -##### 如何使用 zypper 列出可用包更新 +### 如何使用 zypper 列出可用包更新 -`zypper` 允许你浏览已安装包的所有可用更新,以便你可以提前计划更新活动。使用 `list-updates` 或 `lu` 开关来显示已安装包的所有可用更新。 +`zypper` 允许你浏览已安装包的所有可用更新,以便你可以提前计划更新活动。使用 `list-updates` 或 `lu` 子命令来显示已安装包的所有可用更新。 ``` root@kerneltalks # zypper lu @@ -229,11 +234,12 @@ v | SLE-Module-Containers12-Updates | containerd | 0.2.5+gitr6 v | SLES12-SP3-Updates | crash | 7.1.8-4.3.1 | 7.1.8-4.6.2 | x86_64 v | SLES12-SP3-Updates | rsync | 3.1.0-12.1 | 3.1.0-13.10.1 | x86_64 ``` + 输出特意被格式化以便于阅读。每一列分别代表包所属仓库名称、包名、已安装版本、可用的更新版本和架构。 -##### 在 Suse Linux 中列出和安装补丁 +### 在 Suse Linux 中列出和安装补丁 -使用 `list-patches` 或 `lp` 开关来显示你的 Suse Linux 系统需要被应用的所有可用补丁。 +使用 `list-patches` 或 `lp` 子命令来显示你的 Suse Linux 系统需要被应用的所有可用补丁。 ``` root@kerneltalks # zypper lp @@ -262,7 +268,7 @@ Found 37 applicable patches: ##### 如何使用 zypper 更新包 -要使用 zypper 更新包,使用 `update` 或 `up` 开关后接包名。在上述列出的更新命令中,我们知道在我们的服务器上 `rsync` 包更新可用。让我们现在来更新它吧! +要使用 `zypper` 更新包,使用 `update` 或 `up` 子命令后接包名。在上述列出的更新命令中,我们知道在我们的服务器上 `rsync` 包更新可用。让我们现在来更新它吧! ``` root@kerneltalks # zypper update rsync @@ -284,9 +290,9 @@ Checking for file conflicts: ................................................... (1/1) Installing: rsync-3.1.0-13.10.1.x86_64 .....................................................................................................................[done] ``` -##### 在 Suse Linux 上使用 zypper 查找包 +### 在 Suse Linux 上使用 zypper 查找包 -如果你不确定包的全名也不要担心。你可以使用 zypper 附带 `se` 或 `search` 开关并提供查找字符串来查找包。 +如果你不确定包的全名也不要担心。你可以使用 `zypper` 附带的 `se` 或 `search` 子命令并提供查找字符串来查找包。 ``` root@kerneltalks # zypper se lvm @@ -303,14 +309,15 @@ S | Name | Summary | Type | llvm-devel | Header Files for LLVM | package | lvm2 | Logical Volume Manager Tools | srcpackage i+ | lvm2 | Logical Volume Manager Tools | package - | lvm2-devel | Development files for LVM2 | package - + | lvm2-devel | Development files for LVM2 | package ``` -在上述示例中我们查找了 `lvm` 字符串并得到了如上输出列表。你能在 zypper install/remove/update 命令中使用 `Name` 字段的名字。 -##### 使用 zypper 检查已安装包信息 +在上述示例中我们查找了 `lvm` 字符串并得到了如上输出列表。你能在 `zypper install/remove/update` 命令中使用 `Name` 字段的名字。 + +### 使用 zypper 检查已安装包信息 + +你能够使用 `zypper` 检查已安装包的详细信息。`info` 或 `if` 子命令将列出已安装包的信息。它也可以显示未安装包的详细信息,在该情况下,`Installed` 参数将返回 `No` 值。 -你能够使用 zypper 检查已安装包的详细信息。`info` 或 `if` 开关将列出已安装包的信息。它也可以显示未安装包的详细信息,在该情况下,`Installed` 参数将返回 `No` 值。 ``` root@kerneltalks # zypper info rsync Refreshing service 'SMT-http_smt-ec2_susecloud_net'. @@ -343,9 +350,9 @@ Description : for backups and mirroring and as an improved copy command for everyday use. ``` -##### 使用 zypper 列出仓库 +### 使用 zypper 列出仓库 -使用 zypper 命令附带 `lr` 或 `repos` 开关列出仓库。 +使用 `zypper` 命令附带 `lr` 或 `repos` 子命令列出仓库。 ``` root@kerneltalks # zypper lr @@ -364,7 +371,7 @@ Repository priorities are without effect. All enabled repositories share the sam 此处你需要检查 `enabled` 列来确定哪些仓库是已被启用的而哪些没有。 -##### 在 Suse Linux 中使用 zypper 添加或移除仓库 +### 在 Suse Linux 中使用 zypper 添加或移除仓库 要添加仓库你需要仓库或 .repo 文件的 URI,否则你会遇到如下错误。 @@ -390,16 +397,17 @@ Priority : 99 (default priority) Repository priorities are without effect. All enabled repositories share the same priority. ``` -在 Suse 中使用附带 `addrepo` 或 `ar` 开关的 `zypper` 命令添加仓库,后接 URI 以及你需要提供一个别名。 +在 Suse 中使用附带 `addrepo` 或 `ar` 子命令的 `zypper` 命令添加仓库,后接 URI 以及你需要提供一个别名。 + +要在 Suse 中移除一个仓库,使用附带 `removerepo` 或 `rr` 子命令的 `zypper` 命令。 -要在 Suse 中移除一个仓库,使用附带 `removerepo` 或 `rr` 开关的 `zypper` 命令。 ``` root@kerneltalks # zypper removerepo nVidia-Driver-SLE12-SP3 Removing repository 'nVidia-Driver-SLE12-SP3' ....................................................................................................................[done] Repository 'nVidia-Driver-SLE12-SP3' has been removed. ``` -##### 清除 zypper 本地缓存 +### 清除 zypper 本地缓存 使用 `zypper clean` 命令清除 zypper 本地缓存。 @@ -414,7 +422,7 @@ via: https://kerneltalks.com/commands/12-useful-zypper-command-examples/ 作者:[KernelTalks][a] 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 75a1fa3916397b14659ad58463dff7180b544507 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 13:29:57 +0800 Subject: [PATCH 0815/1143] PUB:20180221 12 useful zypper command examples.md @cycoe https://linux.cn/article-10338-1.html --- .../20180221 12 useful zypper command examples.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180221 12 useful zypper command examples.md (100%) diff --git a/translated/tech/20180221 12 useful zypper command examples.md b/published/20180221 12 useful zypper command examples.md similarity index 100% rename from translated/tech/20180221 12 useful zypper command examples.md rename to published/20180221 12 useful zypper command examples.md From 553d2fe37ed1e0912c83689382de3185187bbc8b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 13:31:01 +0800 Subject: [PATCH 0816/1143] PRF:20180221 12 useful zypper command examples.md --- published/20180221 12 useful zypper command examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20180221 12 useful zypper command examples.md b/published/20180221 12 useful zypper command examples.md index 356c55becc..94397cd964 100644 --- a/published/20180221 12 useful zypper command examples.md +++ b/published/20180221 12 useful zypper command examples.md @@ -266,7 +266,7 @@ Found 37 applicable patches: 你可以通过发出 `zypper patch` 命令安装所有需要的补丁。 -##### 如何使用 zypper 更新包 +### 如何使用 zypper 更新包 要使用 `zypper` 更新包,使用 `update` 或 `up` 子命令后接包名。在上述列出的更新命令中,我们知道在我们的服务器上 `rsync` 包更新可用。让我们现在来更新它吧! From 33aa734db5ee947793bf10c3df19115dc3d4dfeb Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Wed, 12 Dec 2018 13:38:58 +0800 Subject: [PATCH 0817/1143] Translating 7 command-line tools for writers. --- ...119 7 command-line tools for writers - Opensource.com.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md index 8feec80f41..ead46909ff 100644 --- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md +++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md @@ -33,11 +33,11 @@ ### 其他工具 -Sometimes you just can't find the right synonym for a word. But you don't need to grab a "dead tree" thesaurus or go to a dedicated website to perfect your word choice. Just run [Aiksaurus][16] against the word you want to replace, and it does the work for you. This utility's main drawback, though, is that it supports English only. +有时候你找不到一个单词的恰当的同义词。但你不需要去呆板的词库中抓取或者去专门的网站完善你的单词完整。仅仅需要对你想要替换的单词运行[Aiksaurus][16],然后它就会为你完成这个工作。但是,这个程序最大的缺点是它只支持英语。 -Even writers with few (if any) technical skills are embracing [Markdown][17] to quickly and easily format their work. Sometimes, though, you need to convert files formatted with Markdown to something else. That's where [Pandoc][18] comes in. You can use it to convert your documents to HTML, Word, LibreOffice Writer, LaTeX, EPUB, and other formats. You can even use Pandoc to produce books and [research papers][19]. +即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用Markdown格式的文件转换成其他格式。这就是[Pandoc][18]的用武之地。你可以用它来将你的文档转换成 HTML, Word, LibreOffice Writer, LaTeX, EPUB以及其他格式。你甚至可以用Pandoc来生成书籍和[研究论文][19]。 -Do you have a favorite command-line tool for writing? Share it with the Opensource.com community by leaving a comment. +你有一个最喜欢的命令行写作工具吗?在Opensource.com社区发表评论分享它。 -------------------------------------------------------------------------------- From 637b4c71b5870042ac3df0104aea6617f3c25e6c Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 12 Dec 2018 14:29:15 +0800 Subject: [PATCH 0818/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Open=20source?= =?UTF-8?q?=20DIY=20ethics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20181209 Open source DIY ethics.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/talk/20181209 Open source DIY ethics.md diff --git a/sources/talk/20181209 Open source DIY ethics.md b/sources/talk/20181209 Open source DIY ethics.md new file mode 100644 index 0000000000..2c249d33af --- /dev/null +++ b/sources/talk/20181209 Open source DIY ethics.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source DIY ethics) +[#]: via: (https://arp242.net/weblog/diy.html) +[#]: author: (Martin Tournoij https://arp242.net/) + +Open source DIY ethics +====== + +I moved to New Zealand last week, and as a proper Dutch person one of the first things I did after arriving was getting a bicycle. + +I was recommended [a great place][1] where they collect old bikes and provide people with the parts and tools to fix up the bikes. Want a bike? Choose one, fix it, and it’s yours. There are helpful and knowledgable volunteers who will gladly help you and explain how things work, but in the end you’ll have to fix your own bike; they’re not going to do it for you. + +I like this DIY attitude; I built my own fixie (which I unfortunately couldn’t bring) years ago and had been maintaining it myself ever since, but there are many different aspects I never touched on (different brake systems, gears, etc.) and fixing my bike with some help and explanation was a useful experience which taught me a thing or two that I’ll be sure to use in the future. + +My attitude to open source projects tends to be similar: I’ll gladly assist you or explain things, but you will have to do the work. This is especially true when it comes to feature requests or very specific scenarios. + +Open source software is fundamentally a [DIY ethic][2] for many – though not all – people who participate in it. It certainly is for me. I just fix stuff I want myself. Since I take some amount of pride in my work and want things to work well for others I’ll also gladly fix most bugs that are reported, but sometimes people will post an enhancement or feature request and just expect me to implement it. It’s sometimes even combined with a “but project X does it!”-comment. Well, feck off and use project X then (I don’t actually say this, just think it). + +I’ve seen more than a few people get frustrated by this attitude especially — though hardly exclusively — in the OpenBSD and suckless communities ([recent example that prompted this post][3]), partly because it’s not infrequently communicated in a somewhat unhelpful fashion (the OpenBSD saying is “shut up and hack”), but also because some people seem to misunderstand what it means to be a maintainer of an open source project. Open source software isn’t a service I provide to the world; it’s something I DIY’d myself and make available to the world because why not? + +Some open source software is supported by companies. Only about [14% of the contributions to the Linux kernel are not affiliated with a company][4]. I don’t think this matters: these are companies who are DIY-ing as well. + +Are there people who contribute to open source for other reasons? Sure. Some do because they really believe in [Free Software][5], or because they like programming as a hobby. But those are not the majority. + +Not all contributions that aren’t code are useless. Sometimes someone will have a great idea for an enhancement or feature that I hadn’t thought of myself and this can be a very valuable contribution. But those types of constructive contributions are usually easy to recognize: they consist of more than just a single paragraph, are respectful, show a clear understanding of what the project is supposed to do, if they don’t understand a certain aspect they’ll ask instead of bombastically claiming that it’s “broken”, and perhaps most importantly, they show a willingness to constructively contribute, rather than just trying to tell you how to run your project. + +This attitude isn’t limited to open source; to quote Neil Gaiman when talking about A Song of Ice and Fire fans demanding George R.R. Martin work harder on the next instalment of the series: “[George R.R. Martin is not your bitch][6]”. + +I can’t help George with his next book, but I can help with software projects, which is really neat. Not everyone is a computer programmer, but the vast majority of projects I’ve worked on are used exclusively by programmers. + +In the two months that it took me to finish this post (cleaning up drafts always takes forever) there have been a number of incidents in various communities that touched upon a mismatch in expectations between open source authors/maintainers and the users. “It’s not fun anymore, you get nothing from maintaining a popular package”, to quote one maintainer, or “I’m frustrated because I can’t handle the volume of emails” to quote another. + +The situation would be vastly improved if more people start seeing and treating open source more like the DIY that it is and assume responsibility for that bug you’ve encountered or enhancement you want, rather than offloading all responsibility to the maintainer. This won’t fix everything, but it’s a good start. Note that plenty of people — including myself — already do this. + +Both authors and users will benefit; authors will be frustrated less with “entitled” users, and users will be frustrated less by “rude” authors, and in the end the software will work better as users will be more willing to spend some time fixing stuff themselves, rather than just expecting other people to do it for them. + + +-------------------------------------------------------------------------------- + +via: https://arp242.net/weblog/diy.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://www.facebook.com/TheCrookedSpoke +[2]: https://en.wikipedia.org/wiki/DIY_ethic +[3]: https://www.reddit.com/r/suckless/comments/9mhwg8/why_does_sts_latency_suck_so_bad/e7fu9sj/ +[4]: https://www.linux.com/publications/linux-kernel-development-how-fast-it-going-who-doing-it-what-they-are-doing-and-who-0 +[5]: https://www.gnu.org/philosophy/free-sw.html +[6]: http://journal.neilgaiman.com/2009/05/entitlement-issues.html +[7]: mailto:martin@arp242.net +[8]: https://github.com/Carpetsmoker/arp242.net/issues/new From 031716bec70f3dac5ae989a7404c54c8f30ddab9 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 12 Dec 2018 14:33:55 +0800 Subject: [PATCH 0819/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Winterize=20you?= =?UTF-8?q?r=20Bash=20prompt=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...211 Winterize your Bash prompt in Linux.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20181211 Winterize your Bash prompt in Linux.md diff --git a/sources/tech/20181211 Winterize your Bash prompt in Linux.md b/sources/tech/20181211 Winterize your Bash prompt in Linux.md new file mode 100644 index 0000000000..bae5837a2c --- /dev/null +++ b/sources/tech/20181211 Winterize your Bash prompt in Linux.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Winterize your Bash prompt in Linux) +[#]: via: (https://opensource.com/article/18/12/linux-toy-bash-prompt) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Winterize your Bash prompt in Linux +====== +Your Linux terminal probably supports Unicode, so why not take advantage of that and add a seasonal touch to your prompt? +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-bash-prompt.png?itok=HK_kVn37) + +Hello once again for another installment of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is? Really, we're keeping it pretty open-ended: It's anything that's a fun diversion at the terminal, and we're giving bonus points for anything holiday-themed. + +Maybe you've seen some of these before, maybe you haven't. Either way, we hope you have fun. + +Today's toy is super-simple: It's your Bash prompt. Your Bash prompt? Yep! We've got a few more weeks of the holiday season left to stare at it, and even more weeks of winter here in the northern hemisphere, so why not have some fun with it. + +Your Bash prompt currently might be a simple dollar sign ( **$** ), or more likely, it's something a little longer. If you're not sure what makes up your Bash prompt right now, you can find it in an environment variable called $PS1. To see it, type: + +``` +echo $PS1 +``` + +For me, this returns: + +``` +[\u@\h \W]\$ +``` + +The **\u** , **\h** , and **\W** are special characters for username, hostname, and working directory. There are others you can use as well; for help building out your Bash prompt, you can use [EzPrompt][1], an online generator of PS1 configurations that includes lots of options including date and time, Git status, and more. + +You may have other variables that make up your Bash prompt set as well; **$PS2** for me contains the closing brace of my command prompt. See [this article][2] for more information. + +To change your prompt, simply set the environment variable in your terminal like this: + +``` +$ PS1='\u is cold: ' +jehb is cold: +``` + +To set it permanently, add the same code to your **/etc/bashrc **using your favorite text editor. + +So what does this have to do with winterization? Well, chances are on a modern machine, your terminal support Unicode, so you're not limited to the standard ASCII character set. You can use any emoji that's a part of the Unicode specification, including a snowflake ❄, a snowman ☃, or a pair of skis 🎿. You've got plenty of wintery options to choose from. + +``` +🎄 Christmas Tree +🧥 Coat +🦌 Deer +🧤 Gloves +🤶 Mrs. Claus +🎅 Santa Claus +🧣 Scarf +🎿 Skis +🏂 Snowboarder +❄ Snowflake +☃ Snowman +⛄ Snowman Without Snow +🎁 Wrapped Gift +``` + +Pick your favorite, and enjoy some winter cheer. Fun fact: modern filesystems also support Unicode characters in their filenames, meaning you can technically name your next program **"❄❄❄❄❄.py"**. That said, please don't. + +Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [Snake your way across your Linux terminal][3], and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-bash-prompt + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: http://ezprompt.net/ +[2]: https://access.redhat.com/solutions/505983 +[3]: https://opensource.com/article/18/12/linux-toy-snake From af31f90e72396bd52ca3e62f0ad16b1f31a96fb5 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 12 Dec 2018 14:53:28 +0800 Subject: [PATCH 0820/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Inst?= =?UTF-8?q?all=20Putty=20on=20Ubuntu=20and=20Other=20Linux=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on Ubuntu and Other Linux Distributions.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..1b92a73645 --- /dev/null +++ b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/putty-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Install Putty on Ubuntu and Other Linux Distributions +====== + +If I am not wrong, [Putty][1] is perhaps the most popular SSH client for Windows. + +In IT companies, the development environment is usually on a remote Linux system while the developers use Windows as their local system. Putty is used for connecting to the remote Linux system from the Windows machine. + +Putty is not limited to Windows only. You can also use this open source software on Linux and macOS. + +But wait! Why would you use a separate SSH client on Linux when you already have the ‘real’ Linux terminal with you? There are several reasons why you would want to use Putty on Linux. + + * You have used Putty for so long on Windows that you are more comfortable with it. + * You find it difficult to manually edit SSH config file to save the various SSH sessions. You prefer Putty’s graphical way of storing SSH connection. + * You want to debug by connecting to raw sockets and serial ports. + + + +Whatever may be the reason, if you want to use Putty on Ubuntu or any other Linux, you can certainly do so. Let me show you how to do that. + +### Installing Putty on Ubuntu Linux + +![Installing Putty on Linux][2] + +The good news for the Ubuntu users is that Putty is available in the universe repository of Ubuntu. + +To install Putty on Ubuntu, you should first make sure that the universe repository is enabled. + +``` +sudo add-apt-repository universe +``` + +Once you have the universe repository enabled, you should update Ubuntu with this command: + +``` +sudo apt update +``` + +After this, you can install Putty with this command: + +``` +sudo apt install putty +``` + +Once installed, you can start Putty by finding it in the menu. + +As you can see in the screenshot below, the Linux version of Putty looks the same as the Windows version. That’s a relief because you won’t have to fiddle around trying to find your way through a new and changed settings. + +![Putty in Linux][3] + +When you enter the remote system’s [hostname][4] or IP address and connect to it, Putty will utilize the already saved SSH keys in your home directory. + +![Using Putty in Ubuntu Linux][5] + +### Installing Putty on other Linux distributions + +[Putty is available for Debian][6] so you just need to use apt-get or aptitude for installing it. + +``` +sudo apt-get install putty +``` + +Putty is also available for Fedora/Red Hat and can be installed using the default package manager. + +``` +sudo dnf install putty +``` + +You can also easily install Putty in Arch Linux based distributions. + +``` +sudo pacman -S putty +``` + +Remember that Putty is an open source software. You can also install it via source code if you really want to. You can get the source code of Putty from the link below. + +[Download Putty Source Code][8] + +I would always prefer the native Linux terminal over an SSH client like Putty. I feel more at home with the GNOME terminal or [Terminator][7]. However, it’s up to an individual’s choice to use the default terminal or Putty in Linux + +What do you use for managing multiple SSH connections on Linux? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/putty-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.putty.org/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Putty-linux.png?resize=800%2C450&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu.jpeg?resize=800%2C503&ssl=1 +[4]: https://itsfoss.com/change-hostname-ubuntu/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1 +[6]: https://packages.debian.org/jessie/putty +[7]: https://launchpad.net/terminator +[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html From cbd0d1640a89fcf704439c480f0fdd65feece0f4 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 12 Dec 2018 15:02:08 +0800 Subject: [PATCH 0821/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Benc?= =?UTF-8?q?hmark=20Linux=20Commands=20And=20Programs=20From=20Commandline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Commands And Programs From Commandline.md | 265 ++++++++++++++++++ 1 file changed, 265 insertions(+) create mode 100644 sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md diff --git a/sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md b/sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md new file mode 100644 index 0000000000..3962e361f3 --- /dev/null +++ b/sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md @@ -0,0 +1,265 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Benchmark Linux Commands And Programs From Commandline) +[#]: via: (https://www.ostechnix.com/how-to-benchmark-linux-commands-and-programs-from-commandline/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +How To Benchmark Linux Commands And Programs From Commandline +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/benchmark-720x340.png) + +A while ago, I have written a guide about the [**alternatives to ‘top’, the command line utility**][1]. Some of the users asked me which one among those tools is best and on what basis (like features, contributors, years active, page requests etc.) I compared those tools. They also asked me to share the bench-marking results If I have any. Unfortunately, I didn’t even know how to benchmark programs at that time. While searching for some simple and easy to use bench-marking tools to compare the Linux programs, I stumbled upon two utilities named **‘Bench’** and **‘Hyperfine’**. These are simple and easy-to-use command line tools to benchmark Linux commands and programs on Unix-like systems. + +### 1\. Bench Tool + +The **‘Bench’** utility benchmarks one or more given commands/programs using **Haskell’s criterion** library and displays the output statistics in an easy-to-understandable format. This tool can be helpful where you need to compare similar programs based on the bench-marking result. We can also export the results to HTML format or CSV or templated output. + +#### Installing Bench Utility + +The bench utility can be installed in three methods. + +**1\. Using Linuxbrew** + +We can install Bench utility using Linuxbrew package manager. If you haven’t installed Linuxbrew yet, refer the following link. + +After installing Linuxbrew, run the following command to install Bench: + +``` +$ brew install bench +``` + +**2\. Using Haskell’s stack tool** + +First, install Haskell as described in the following link. + +And then, run the following commands to install Bench. + +``` +$ stack setup + +$ stack install bench +``` + +The ‘stack’ will install bench to **~/.local/bin** or something similar. Make sure that the installation directory is on your executable search path before using bench tool. You will be reminded to do this even if you forgot. + +**3\. Using Nix package manager** + +Another way to install Bench is using **Nix** package manager. Install Nix as shown in the below link. + +After installing Nix, install Bench tool using command: + +``` +$ nix-env -i bench +``` + +#### Benchmark Linux Commands And Programs Using Bench + +It is time to start benchmarking the programs. + +For instance, let me show you the benchmark result of ‘ls -al’ command. + +``` +$ bench 'ls -al' +``` + +**Sample output:** + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-1.png) + +You must quote the commands when you use flags/options with them. + +Similarly, you can benchmark any programs installed in your system. The following commands shows the benchmarking result of ‘htop’ and ‘ptop’ programs. + +``` +$ bench htop + +$ bench ptop +``` +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-2-1.png) +Bench tool can benchmark multiple programs at once as well. Here is the benchmarking result of ls, htop, ptop programs. + +``` +$ bench ls htop ptop +``` + +Sample output: +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-3.png) + +We can also export the benchmark result to a HTML like below. + +``` +$ bench htop --output example.html +``` + +To export the result to CSV, just run: + +``` +$ bench htop --csv FILE +``` + +View help section: + +``` +$ bench --help +``` + +### **2. Hyperfine Benchmark Tool + +** + +**Hyperfine** is yet another command line benchmarking tool inspired by the ‘Bench’ tool which we just discussed above. It is free, open source, cross-platform benchmarking program and written in **Rust** programming language. It has few additional features compared to the Bench tool as listed below. + + * Statistical analysis across multiple runs. + * Support for arbitrary shell commands. + * Constant feedback about the benchmark progress and current estimates. + * Perform warmup runs before the actual benchmark. + * Cache-clearing commands can be set up before each timing run. + * Statistical outlier detection. + * Export benchmark results to various formats, such as CSV, JSON, Markdown. + * Parameterized benchmarks. + + + +#### Installing Hyperfine + +We can install Hyperfine using any one of the following methods. + +**1\. Using Linuxbrew** + +``` +$ brew install hyperfine +``` + +**2\. Using Cargo** + +Make sure you have installed Rust as described in the following link. + +After installing Rust, run the following command to install Hyperfine via Cargo: + +``` +$ cargo install hyperfine +``` + +**3\. Using AUR helper programs** + +Hyperfine is available in [**AUR**][2]. So, you can install it on Arch-based systems using any helper programs, such as [**YaY**][3], like below. + +``` +$ yay -S hyperfine +``` + +**4\. Download and install the binaries** + +Hyperfine is available in binaries for Debian-based systems. Download the latest .deb binary file from the [**releases page**][4] and install it using ‘dpkg’ package manager. As of writing this guide, the latest version was **1.4.0**. + +``` +$ wget https://github.com/sharkdp/hyperfine/releases/download/v1.4.0/hyperfine_1.4.0_amd64.deb + +$ sudo dpkg -i hyperfine_1.4.0_amd64.deb + +$ sudo apt install -f +``` + +#### Benchmark Linux Commands And Programs Using Hyperfine + +To run a benchmark using Hyperfine, simply run it along with the program/command as shown below. + +``` +$ hyperfine 'ls -al' +``` + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/hyperfine-1.png) + +Benchmark multiple commands/programs: + +``` +$ hyperfine htop ptop +``` + +Sample output: + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/hyperfine-2.png) + +As you can see at the end of the output, Hyperfine mentiones – **‘htop ran 1.96 times faster than ptop’** , so we can immediately conclude htop performs better than Ptop. This will help you to quickly find which program performs better when benchmarking multiple programs. We don’t get this detailed output in Bench utility though. + +Hyperfine will automatically determine the number of runs to perform for each command. By default, it will perform at least **10 benchmarking runs**. If you want to set the **minimum number of runs** (E.g 5 runs), use the `-m` **/`--min-runs`** option like below: + +``` +$ hyperfine --min-runs 5 htop ptop +``` + +Or, + +``` +$ hyperfine -m 5 htop ptop +``` + +Similarly, to perform **maximum number of runs** for each command, the command would be: + +``` +$ hyperfine --max-runs 5 htop ptop +``` + +Or, + +``` +$ hyperfine -M 5 htop ptop +``` + +We can even perform **exact number of runs** for each command using the following command: + +``` +$ hyperfine -r 5 htop ptop +``` + +As you may know, if the program execution time is limited by disk I/O, the benchmarking results can be heavily influenced by disk caches and whether they are cold or warm. Luckily, Hyperfine has the options to perform a certain number of program executions before performing the actual benchmark. + +To perform NUM warmup runs (E.g 3) before the actual benchmark, use the **`-w`/**`--warmup` option like below: + +``` +$ hyperfine --warmup 3 htop +``` + +Just like Bench utility, Hyperfine also allows us to export the benchmark results to a given file. We can export the results to CSV, JSON, and Markdown formats. + +For instance, to export the results in Markdown format, use the following command: + +``` +$ hyperfine htop ptop --export-markdown +``` + +For more options and usage details, refer the help secion: + +``` +$ hyperfine --help +``` + +And, that’s all for now. If you ever be in a situation where you need to benchmark similar and alternative programs, these tools might help to compare how they performs and share the details with your peers and colleagues. + +More good stuffs to come. Stay tuned! + +Cheers! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-benchmark-linux-commands-and-programs-from-commandline/ + +作者:[SK][a] +选题:[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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/some-alternatives-to-top-command-line-utility-you-might-want-to-know/ +[2]: https://aur.archlinux.org/packages/hyperfine +[3]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/ +[4]: https://github.com/sharkdp/hyperfine/releases From 86a7efd9b6c3c9bcdb86f8612d5bbc35eb3c6d13 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 16:41:41 +0800 Subject: [PATCH 0822/1143] PUB:20181112 The Source History of Cat.md @name1e5s https://linux.cn/article-10339-1.html --- .../talk => published}/20181112 The Source History of Cat.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20181112 The Source History of Cat.md (100%) diff --git a/translated/talk/20181112 The Source History of Cat.md b/published/20181112 The Source History of Cat.md similarity index 100% rename from translated/talk/20181112 The Source History of Cat.md rename to published/20181112 The Source History of Cat.md From 7b4f45a854945e41a86ad4080fd8d5382c0c8a37 Mon Sep 17 00:00:00 2001 From: darksun Date: Wed, 12 Dec 2018 17:39:10 +0800 Subject: [PATCH 0823/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20Ways=20To?= =?UTF-8?q?=20Check=20Laptop=20Battery=20Status=20And=20Level=20From=20Lin?= =?UTF-8?q?ux=20Terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ry Status And Level From Linux Terminal.md | 257 ++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md diff --git a/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md new file mode 100644 index 0000000000..631efa91f9 --- /dev/null +++ b/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md @@ -0,0 +1,257 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 Ways To Check Laptop Battery Status And Level From Linux Terminal) +[#]: via: (https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +5 Ways To Check Laptop Battery Status And Level From Linux Terminal +====== + +We can easily check the battery status through GUI such as current battery percentage, whether it’s charging or not charging and how long it will be usable without charging, but we can’t able to check the battery health and other related information. + +In this scenario what will be the solutions. + +Yes, we have few utilities available for this in Linux and it can be achieved through command line. + +We are going to discuss about this topic today through this article and i will try to cover possible information i can. + +Checking your battery health monthly once is something good. It will help you to identify whether we are facing any battery or charge related issues. + +Also, we can see battery model name, power source, vendor and battery technology, etc,. + +Power management is a feature that turns off the power or switches system’s components to a low-power state when inactive. + +### Following Utilities are available in Linux to Check Battery Status. + + * `upower`: upower is a command line tool which provides an interface to enumerate power sources on the system. + * `acpi`: acpi Shows information from the /proc or the /sys filesystem, such as battery status or thermal information. + * `batstat`: batstat is a command line tool to print battery status for linux. + * `tlp`: TLP brings you the benefits of advanced power management for Linux without changing any configuration. + * `class file`: The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures. + + + +### How to Check Laptop Battery Status Using upower Command? + +[upower][1] is a command line tool that provides an interface to enumerate power sources on the system. It control the latency of different operations on your computer, which enables you to save significant amounts of power. + +Just run the following command to get the battery and it’s related information on Linux. + +``` +$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 + native-path: BAT0 + vendor: SMP + model: L14M4P23 + serial: 756 + power supply: yes + updated: Monday 03 December 2018 07:56:18 PM IST (95 seconds ago) + has history: yes + has statistics: yes + battery + present: yes + rechargeable: yes + state: discharging + warning-level: none + energy: 28.23 Wh + energy-empty: 0 Wh + energy-full: 52.26 Wh + energy-full-design: 60 Wh + energy-rate: 10.714 W + voltage: 14.819 V + time to empty: 2.6 hours + percentage: 54% + capacity: 87.1% + technology: lithium-ion + icon-name: 'battery-good-symbolic' + History (charge): + 1543847178 54.000 discharging + History (rate): + 1543847178 10.714 discharging +``` + +To check the specific information about battery, use the following format. + +``` +$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty" + state: discharging + time to empty: 2.1 hours + percentage: 43% +``` + +It’s same as above, but it’s taken after power cable plugged in, that’s why the state showing charging. + +``` +$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty" + state: charging + percentage: 41% +``` + +### How to Check Laptop Battery Status Using TLP Command? + +TLP is a free opensource feature-rich command line tool which optimize laptop battery without making any configuration change. + +TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfil your specific requirements. + +TLP package is available in most of the Linux distribution official repository such as Arch, Debian, Fedora, Gentoo, openSUSE, etc. Use your distribution Package Manager to install the TLP utility. + +Just run the following command to get the battery and it’s related information on Linux. + +``` +$ sudo tlp-stat -b +--- TLP 1.1 -------------------------------------------- + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 52260 [mWh] +/sys/class/power_supply/BAT0/energy_now = 21950 [mWh] +/sys/class/power_supply/BAT0/power_now = 10923 [mW] +/sys/class/power_supply/BAT0/status = Discharging + +Charge = 42.0 [%] +Capacity = 87.1 [%] +``` + +To see other information as well. + +``` +$ sudo tlp-stat -s +--- TLP 1.1 -------------------------------------------- + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 07:16:12 IST, 4362 sec(s) ago +Mode = battery +Power source = battery +``` + +### How to Check Laptop Battery Status Using ACPI Command? + +ACPI stands for Advanced Configuration and Power Interface modules are kernel modules for different ACPI parts. They enable special ACPI functions or add information to /proc or /sys. These information can be parsed by acpid for events or other monitoring applications. + +``` +$ acpi +Battery 0: Charging, 43%, 01:05:11 until charged +``` + +To see battery capacity. + +``` +$ acpi -i +Battery 0: Charging, 43%, 01:05:07 until charged +Battery 0: design capacity 3817 mAh, last full capacity 3324 mAh = 87% +``` + +To see more details about battery and related information. + +``` +$ acpi -V +Battery 0: Charging, 43%, 01:05:07 until charged +Battery 0: design capacity 3815 mAh, last full capacity 3323 mAh = 87% +Adapter 0: on-line +Cooling 0: Processor 0 of 10 +Cooling 1: Processor 0 of 10 +Cooling 2: Processor 0 of 10 +Cooling 3: iwlwifi 0 of 19 +Cooling 4: Processor 0 of 10 +Cooling 5: iwlwifi no state information available +Cooling 6: Processor 0 of 10 +Cooling 7: Processor 0 of 10 +Cooling 8: Processor 0 of 10 +Cooling 9: intel_powerclamp no state information available +Cooling 10: x86_pkg_temp no state information available +Cooling 11: Processor 0 of 10 +``` + +### How to Check Laptop Battery Status Using Batstat Command? + +batstat is a command line tool to print battery status in linux terminal. + +``` +Status: Charging +Max energy: 50.00 Wh +Energy left: 24.50 Wh +Power Consumption: 26.40 W +Percentage left: 49.00% +Average power Consumption: 0.00 W +Time elapsed: 0: 0:12 since 49.00% += Time ======== Percent ============================================ + 0: 0: 0 49.00% +``` + +### How to Check Laptop Battery Status Using sysfs filesystem? + +The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures. The files under sysfs provide information about devices, kernel modules, filesystems, and other kernel components. + +The sysfs filesystem is commonly mounted at /sys. Typically, it is mounted automatically by the system, but it can also be mounted manually using a command such as `mount -t sysfs sysfs /sys` + +Many of the files in the sysfs filesystem are read-only, but some files are writable, allowing kernel variables to be changed. To avoid redundancy, symbolic links are heavily used to connect entries across the filesystem tree. + +``` +$ cat /sys/class/power_supply/BAT0/* +0 +51 +Normal +0 +cat: /sys/class/power_supply/BAT0/device: Is a directory +52260000 +60000000 +26660000 +SMP +L14M4P23 +cat: /sys/class/power_supply/BAT0/power: Is a directory +27656000 +1 + 756 +Charging +cat: /sys/class/power_supply/BAT0/subsystem: Is a directory +Li-ion +Battery +POWER_SUPPLY_NAME=BAT0 +POWER_SUPPLY_STATUS=Charging +POWER_SUPPLY_PRESENT=1 +POWER_SUPPLY_TECHNOLOGY=Li-ion +POWER_SUPPLY_CYCLE_COUNT=0 +POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14800000 +POWER_SUPPLY_VOLTAGE_NOW=15840000 +POWER_SUPPLY_POWER_NOW=27656000 +POWER_SUPPLY_ENERGY_FULL_DESIGN=60000000 +POWER_SUPPLY_ENERGY_FULL=52260000 +POWER_SUPPLY_ENERGY_NOW=26660000 +POWER_SUPPLY_CAPACITY=51 +POWER_SUPPLY_CAPACITY_LEVEL=Normal +POWER_SUPPLY_MODEL_NAME=L14M4P23 +POWER_SUPPLY_MANUFACTURER=SMP +POWER_SUPPLY_SERIAL_NUMBER= 756 +14800000 +15840000 +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://upower.freedesktop.org/ From a18c3bd5362477bfd419a04a3fb46e2f04054b0d Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 12 Dec 2018 20:02:01 +0800 Subject: [PATCH 0824/1143] =?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/20180710 Users, Groups, and Other Linux Beasts.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md b/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md index 6083111a32..ad5be702d8 100644 --- a/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md +++ b/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md @@ -1,3 +1,5 @@ +Translating by MjSeven + Users, Groups, and Other Linux Beasts ====== From 17b9c0017c82f2ef1fad76789761b8574d328501 Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 12 Dec 2018 20:50:13 +0800 Subject: [PATCH 0825/1143] Delete 20181121 How to swap Ctrl and Caps Lock keys in Linux.md --- ...o swap Ctrl and Caps Lock keys in Linux.md | 113 ------------------ 1 file changed, 113 deletions(-) delete mode 100644 sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md diff --git a/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md deleted file mode 100644 index c9f24938ff..0000000000 --- a/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md +++ /dev/null @@ -1,113 +0,0 @@ -Translating by jlztan - -How to swap Ctrl and Caps Lock keys in Linux -====== -Linux desktop environments make it easy to set up your keyboard as you want it. Here's how. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K) - -For many people who've been computer users for (let's just say) "quite some time now," the Ctrl and Caps Lock keys have been in the wrong place since shortly after the first PC keyboards rolled off the production line. For me, the correct positioning appears in this image of a vintage 1995 Sun Workstation keyboard. (Forgive me for the blurriness of the image; it was taken with a Minox spy camera in low light.) - -If you're interested, you can read about the [history of the Ctrl key location][1]. I'm not going to discuss the various rationales for placing the Ctrl key next to the "a" key versus below the Shift key; I'm not going to comment on the overall uselessness of the Caps Lock key (whoops); and I'm not going to argue with those who advocate using the heel of the hand to activate the Ctrl key, even though it's impossible to do on some laptop keyboards where the keys are inset below the level of the wrist rest (whoops). - -Rather, I'm going to assume I'm not the only one who prefers the Ctrl key next to the "a" and describe how to use the wonderful flexibility that comes with Linux to swap the Ctrl and Caps Lock keys on various desktop environments. Note that this kind of advice seems to have a limited shelf life, as tools for tweaking desktop settings change fairly often. But I hope this offers a good place for you to start. - -### With GNOME 3 - -[GNOME 3][2] desktop environment users can use the [Tweaks][3] tool to swap their Caps Lock and Ctrl keys, as you can see below. -![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png) -Here's how to do it: - - 1. Install the Tweaks tool from your distribution's repositories. - 2. Start the Tweaks application. - 3. Select "Keyboard & Mouse" from the left-hand menu. - 4. Click "Additional Layout Options". - 5. Click "Ctrl position" on the window that opens and choose "Swap Ctrl and Caps Lock." - - - -That's it! By the way, you can do lots of cool stuff with the Tweaks tool. For example, I set my right Ctrl key to be a Compose key, which allows me to type all sorts of characters with keyboard shortcuts—such as ç, é, ô, and ñ and with the keystrokes Compose+c+Comma; Compose+e+Right quote; Compose+o+Circumflex; and Compose+n+Tilde. - -### With KDE - -I don't use [KDE][4], but item 5 in this article about [KDE tweaks that will change your life][5] by my colleague Seth Kenlon will show you how to remap your keys. - -### With Xfce - -As far as I can tell, the [Xfce][6] desktop environment doesn't have a handy tool for managing these kinds of settings. However, the **ctrl:swapcaps** option to the **setxkbmap** command will help you make these changes. This type of modification has two parts: - - 1. Figuring out the command's usage; - 2. Figuring out where to invoke the command so it is activated as the desktop comes up. - - - -The first part is pretty straightforward: the command is: - -``` -/usr/bin/setxkbmap -option "ctrl:nocaps" -``` - -It's worth executing this in a terminal window to make sure the results are what you expect. - -Assuming it works, where should you invoke the command? That requires some experimentation; one possibility is in the file **.profile** in the user's home directory. Another option is to add the command to the autostart facility in Xfce (look for "Session and Startup" in the Settings Manager). - -Another possibility is to use the same option in the file / **etc/default/keyboard** , which might end up looking like this: - -``` -# KEYBOARD CONFIGURATION FILE - -# Consult the keyboard(5) manual page. - -XKBMODEL="pc105" -XKBLAYOUT="us" -XKBVARIANT="" -XKBOPTIONS="ctrl:swapcaps" - -BACKSPACE="guess" -``` - -Note that this kind of change will affect all users, so if you share your computer, be prepared to do some explaining. Also, system updates may overwrite this file, so you'll need to edit it again if your setup stops working. Putting the same information in the file **.keyboard** in the user's home directory might accomplish the same task on the user's behalf. - -Finally, note that these kinds of changes require you to restart Xfce (except when running the command on the command line in the terminal window, but that won't stick past the end of the session). - -### With LXQt and other desktop environments - -I haven't tried [LXQt][7], but if my memory serves from [LXDE][8], I would try the same recipe used above for Xfce. I'd also expect that the Xfce recipe could work for other Linux desktop environments, but, of course, your favorite search engine is always your friend. - -### The console - -I haven't tried this, as I have very few opportunities to interact with the console (what you see on a server or when your window system doesn't come up properly). The recipes presented above affect the terminal window in the way one would hope, i.e., consistently with other applications. - -However, if the file **/etc/default/keyboard** or **~/.keyboard** has already been edited (as described above), the utility **setupcon** is intended to change the console keyboard setup so it functions the same way.** **This [StackExchange article][9], [this other one][10], and [this third one][11] give some ideas on how to effect these changes from both of these files. The third article also talks about using **dumpkeys** and **loadkeys**. It's also worthwhile to read [the setupcon man page][12] — it's short and to the point, and combined with the comments from the StackExchange articles, should be enough to get a solution in place. - -Finally, it's worth emphasizing here the point mentioned in the StackExchange articles - configuring the console IS NOT THE SAME as configuring terminal windows; the latter are configured through the desktop manager as described previously. - -### When all else fails - -The manual pages for **setxkbmap** , **xkeyboard-config** , **keyboard** , **console-setup** , and **setupcon** are all useful references. Or, if you don't like reading manual pages, there's [this great article][13]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard - -作者:[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://en.wikipedia.org/wiki/Control_key -[2]: https://www.gnome.org/gnome-3/ -[3]: https://wiki.gnome.org/Apps/Tweaks -[4]: https://www.kde.org/ -[5]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life -[6]: https://www.xfce.org/ -[7]: https://lxqt.org/ -[8]: https://lxde.org/ -[9]: https://askubuntu.com/questions/485454/how-to-remap-keys-on-a-user-level-both-with-and-without-x -[10]: https://unix.stackexchange.com/questions/198791/how-do-i-permanently-change-the-console-tty-font-type-so-it-holds-after-reboot -[11]: https://superuser.com/questions/290115/how-to-change-console-keymap-in-linux -[12]: http://man.he.net/man1/setupcon -[13]: http://www.noah.org/wiki/CapsLock_Remap_Howto From 9bbd1ddbee79db7f99933b4eb05f10f64c2fbcae Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 12 Dec 2018 20:59:10 +0800 Subject: [PATCH 0826/1143] Create 20181121 How to swap Ctrl and Caps Lock keys in Linux.md --- ...o swap Ctrl and Caps Lock keys in Linux.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md diff --git a/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md new file mode 100644 index 0000000000..cf1c56e908 --- /dev/null +++ b/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md @@ -0,0 +1,108 @@ +在 Linux 下交换 Ctrl 与 Caps Lock 键 +====== + +Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K) + +对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久,Ctrl 和 Caps Lock 键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。) + +感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,不评论 Caps Lock 键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上也不可能这样做,因为有的键会位于腕托以下。 + +相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人,并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和 Caps Lock 键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。 + +### GNOME 3 + +[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换 Caps Lock 和 Ctrl 键,如下所示。![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png) + +具体步骤如下: + + 1. 从你的 Linux 发行版的软件仓库安装 Tweaks 工具。 + 2. 启动 Tweaks 程序。 + 3. 从左侧菜单中选择“Keyboard & Mouse”。 + 4. 单击“Additional Layout Options”。 + 5. 在打开的窗口中单击“Ctrl position”,然后选择“Swap Ctrl and Caps Lock”。 + +完成!顺便说一句,你可以使用 Tweaks 工具做很多很酷的事情。例如,我将我的右 Ctrl 键设置为 Compose 键,这让我可以使用键盘快捷键打出各种字符,例如通过 `Compose+c+,`、`Compose+e+'`、`Compose+O+^` 以及 `Compose+n+~` 分别键入 ç、é、ô 和 ñ。 + +### KDE + +我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [KDE tweaks that will change your life][5] 这篇文章的第 5 项演示了如何重新映射按键。 + +### Xfce + +据我所知,[Xfce][6] 桌面环境没有一个方便的工具来管理这些(指交换按键)设置。 但是,`setxkbmap` 命令的 `ctrl:swapcaps` 选项可以帮助你完成交换按键的修改。这个修改包含两部分: + + 1. 弄清楚命令的用法; + 2. 找出调用命令的位置,以便在桌面启动时激活它。 + +第一部分非常简单,命令是: + +``` +/usr/bin/setxkbmap -option "ctrl:nocaps" +``` + +在终端窗口中执行此命令,以确保结果符合你的预期。 + +假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置(在设置管理器中查找“Session and Startup”)里。 + +还有一种可能性是在文件 `/etc/default/keyboard` 中使用相同的选项,最终可能看起来像这样: + +``` +# KEYBOARD CONFIGURATION FILE + +# Consult the keyboard(5) manual page. + +XKBMODEL="pc105" +XKBLAYOUT="us" +XKBVARIANT="" +XKBOPTIONS="ctrl:swapcaps" + +BACKSPACE="guess" +``` + +注意,这个更改将影响所有用户,因此如果你和其他人共享计算机,请准备好进行一些说明。此外,系统更新可能会覆盖此文件,因此如果你的设置失效了,就需要再次编辑它。将相同的信息放在用户主目录中的 `.keyboard` 文件内,可以为每个用户进行设置。 + +最后请注意,这些更改需要重新启动 Xfce(除非在终端窗口中的命令行上运行,但这在会话结束之后便会失效)。 + +### LXQt 和其他桌面环境 + +我没有用过 [LXQt][7],但根据我使用 [LXDE][8] 的经验,我会尝试上面用于 Xfce 的方法。我也希望适用于 Xfce 的方法可以用于其他 Linux 桌面环境。当然了,在其他桌面环境上遇到问题的时候,可以通过你最喜欢的搜索引擎来查找解决办法。 + +### 控制台 + +我没有在控制台上进行过尝试,因为我很少有机会与控制台(你在服务器上看到的或你的窗口系统没有正确显示时出现的界面)进行交互。上面给出的方法以人们希望的方式(即与其他应用程序一致)调整终端窗口。 + +但是,如果像上面一样已经编辑了 `/etc/default/keyboard` 文件或 `〜/.keyboard`,则实用程序 `setupcon` 可以用于更改控制台的键盘设置,以便实现相同的功能。[链接 1][9]、[链接 2][10] 和 [链接 3][11] 给出了一些关于如何从这两个文件实现这些更改的想法。第三个链接还讨论了使用 `dumpkeys` 和 `loadkeys` 来实现想要的效果。[setupcon 的手册][12] 简短而重要,值得阅读,再结合上面 StackExchange 问题的一些评论,应该足以得到一个解决办法。 + +### 其他环境 + +最后,上面 StackExchange 的链接中提到的这一点值得强调--配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。 + +`setxkbmap`、`xkeyboard-config`、`keyboard`、`console-setup` 和 `setupcon` 命令的手册都是有用的参考资料。或者,如果你不喜欢阅读手册,可以看一下 [这篇极好的文章][13]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[jlztan](https://github.com/jlztan) +校对:[校对者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://en.wikipedia.org/wiki/Control_key +[2]: https://www.gnome.org/gnome-3/ +[3]: https://wiki.gnome.org/Apps/Tweaks +[4]: https://www.kde.org/ +[5]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life +[6]: https://www.xfce.org/ +[7]: https://lxqt.org/ +[8]: https://lxde.org/ +[9]: https://askubuntu.com/questions/485454/how-to-remap-keys-on-a-user-level-both-with-and-without-x +[10]: https://unix.stackexchange.com/questions/198791/how-do-i-permanently-change-the-console-tty-font-type-so-it-holds-after-reboot +[11]: https://superuser.com/questions/290115/how-to-change-console-keymap-in-linux +[12]: http://man.he.net/man1/setupcon +[13]: http://www.noah.org/wiki/CapsLock_Remap_Howto From 7fe51f3b2e9ba1ea5d451aa245ca7df745116d44 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Wed, 12 Dec 2018 21:39:29 +0800 Subject: [PATCH 0827/1143] Translated by qhwdw --- ...mputing with Open Source Cirq Framework.md | 229 ------------------ ...mputing with Open Source Cirq Framework.md | 228 +++++++++++++++++ 2 files changed, 228 insertions(+), 229 deletions(-) delete mode 100644 sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md create mode 100644 translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md diff --git a/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md deleted file mode 100644 index ee35ef36ec..0000000000 --- a/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md +++ /dev/null @@ -1,229 +0,0 @@ -Translating by qhwdw -An Introduction to Quantum Computing with Open Source Cirq Framework -====== -As the title suggests what we are about to begin discussing, this article is an effort to understand how far we have come in Quantum Computing and where we are headed in the field in order to accelerate scientific and technological research, through an Open Source perspective with Cirq. - -First, we will introduce you to the world of Quantum Computing. We will try our best to explain the basic idea behind the same before we look into how Cirq would be playing a significant role in the future of Quantum Computing. Cirq, as you might have heard of recently, has been breaking news in the field and in this Open Science article, we will try to find out why. - - - -Before we start with what Quantum Computing is, it is essential to get to know about the term Quantum, that is, a [subatomic particle][1] referring to the smallest known entity. The word [Quantum][2] is based on the Latin word Quantus, meaning, “how little”, as described in this short video: - - - -It will be easier for us to understand Quantum Computing by comparing it first to Classical Computing. Classical Computing refers to how today’s conventional computers are designed to work. The device with which you are reading this article right now, can also be referred to as a Classical Computing Device. - -### Classical Computing - -Classical Computing is just another way to describe how a conventional computer works. They work via a binary system, i.e, information is stored using either 1 or 0. Our Classical computers cannot understand any other form. - -In literal terms inside the computer, a transistor can be either on (1) or off (0). Whatever information we provide input to, is translated into 0s and 1s, so that the computer can understand and store that information. Everything is represented only with the help of a combination of 0s and 1s. - - - -### Quantum Computing - -Quantum Computing, on the other hand, does not follow an “on or off” model like Classical Computing. Instead, it can simultaneously handle multiple states of information with help of two phenomena called [superimposition and entanglement][3], thus accelerating computing at a much faster rate and also facilitating greater productivity in information storage. - -Please note that superposition and entanglement are [not the same phenomena][4]. - - - -![][5] - -So, if we have bits in Classical Computing, then in the case of Quantum Computing, we would have qubits (or Quantum bits) instead. To know more about the vast difference between the two, check this [page][6] from where the above pic was obtained for explanation. - -Quantum Computers are not going to replace our Classical Computers. But, there are certain humongous tasks that our Classical Computers will never be able to accomplish and that is when Quantum Computers would prove extremely resourceful. The following video describes the same in detail while also describing how Quantum Computers work: - - - -A comprehensive video on the progress in Quantum Computing so far: - - - -### Noisy Intermediate Scale Quantum - -According to the very recently updated research paper (31st July 2018), the term “Noisy” refers to inaccuracy because of producing an incorrect value caused by imperfect control over qubits. This inaccuracy is why there will be serious limitations on what Quantum devices can achieve in the near term. - -“Intermediate Scale” refers to the size of Quantum Computers which will be available in the next few years, where the number of qubits can range from 50 to a few hundred. 50 qubits is a significant milestone because that’s beyond what can be simulated by [brute force][7] using the most powerful existing digital [supercomputers][8]. Read more in the paper [here][9]. - -With the advent of Cirq, a lot is about to change. - -### What is Cirq? - -Cirq is a python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits that we just talked about. In other words, Cirq can address challenges to improve accuracy and reduce noise in Quantum Computing. - -Cirq does not necessarily require an actual Quantum Computer for execution. Cirq can also use a simulator-like interface to perform Quantum circuit simulations. - -Cirq is gradually grabbing a lot of pace, with one of its first users being [Zapata][10], formed last year by a [group of scientists][11] from Harvard University focused on Quantum Computing. - -### Getting started with Cirq on Linux - -The developers of the Open Source [Cirq library][12] recommend the installation in a [virtual python environment][13] like [virtualenv][14]. The developers’ installation guide for Linux can be found [here][15]. - -However, we successfully installed and tested Cirq directly for Python3 on an Ubuntu 16.04 system via the following steps: - -#### Installing Cirq on Ubuntu - -![Cirq Framework for Quantum Computing in Linux][16] - -First, we would require pip or pip3 to install Cirq. [Pip][17] is a tool recommended for installing and managing Python packages. - -For Python 3.x versions, Pip can be installed with: -``` -sudo apt-get install python3-pip - -``` - -Python3 packages can be installed via: -``` -pip3 install - -``` - -We went ahead and installed the Cirq library with Pip3 for Python3: -``` -pip3 install cirq - -``` - -#### Enabling Plot and PDF generation (optional) - -Optional system dependencies not install-able with pip can be installed with: -``` -sudo apt-get install python3-tk texlive-latex-base latexmk - -``` - - * python3-tk is Python’s own graphic library which enables plotting functionality. - * texlive-latex-base and latexmk enable PDF writing functionality. - - - -Later, we successfully tested Cirq with the following command and code: -``` -python3 -c 'import cirq; print(cirq.google.Foxtail)' - -``` - -We got the resulting output as: - -![][18] - -#### Configuring Pycharm IDE for Cirq - -We also configured a Python IDE [PyCharm on Ubuntu][19] to test the same results: - -Since we installed Cirq for Python3 on our Linux system, we set the path to the project interpreter in the IDE settings to be: -``` -/usr/bin/python3 - -``` - -![][20] - -In the output above, you can note that the path to the project interpreter that we just set, is shown along with the path to the test program file (test.py). An exit code of 0 shows that the program has finished executing successfully without errors. - -So, that’s a ready-to-use IDE environment where you can import the Cirq library to start programming with Python and simulate Quantum circuits. - -#### Get started with Cirq - -A good place to start are the [examples][21] that have been made available on Cirq’s Github page. - -The developers have included this [tutorial][22] on GitHub to get started with learning Cirq. If you are serious about learning Quantum Computing, they recommend an excellent book called [“Quantum Computation and Quantum Information” by Nielsen and Chuang][23]. - -#### OpenFermion-Cirq - -[OpenFermion][24] is an open source library for obtaining and manipulating representations of fermionic systems (including Quantum Chemistry) for simulation on Quantum Computers. Fermionic systems are related to the generation of [fermions][25], which according to [particle physics][26], follow [Fermi-Dirac statistics][27]. - -OpenFermion has been hailed as [a great practice tool][28] for chemists and researchers involved with [Quantum Chemistry][29]. The main focus of Quantum Chemistry is the application of [Quantum Mechanics][30] in physical models and experiments of chemical systems. Quantum Chemistry is also referred to as [Molecular Quantum Mechanics][31]. - -The advent of Cirq has now made it possible for OpenFermion to extend its functionality by providing routines and tools for using Cirq to compile and compose circuits for Quantum simulation algorithms. - -#### Google Bristlecone - -On March 5, 2018, Google presented [Bristlecone][32], their new Quantum processor, at the annual [American Physical Society meeting][33] in Los Angeles. The [gate-based superconducting system][34] provides a test platform for research into [system error rates][35] and [scalability][36] of Google’s [qubit technology][37], along-with applications in Quantum [simulation][38], [optimization][39], and [machine learning.][40] - -In the near future, Google wants to make its 72 qubit Bristlecone Quantum processor [cloud accessible][41]. Bristlecone will gradually become quite capable to perform a task that a Classical Supercomputer would not be able to complete in a reasonable amount of time. - -Cirq would make it easier for researchers to directly write programs for Bristlecone on the cloud, serving as a very convenient interface for real-time Quantum programming and testing. - -Cirq will allow us to: - - * Fine tune control over Quantum circuits, - * Specify [gate][42] behavior using native gates, - * Place gates appropriately on the device & - * Schedule the timing of these gates. - - - -### The Open Science Perspective on Cirq - -As we all know Cirq is Open Source on GitHub, its addition to the Open Source Scientific Communities, especially those which are focused on Quantum Research, can now efficiently collaborate to solve the current challenges in Quantum Computing today by developing new ways to reduce error rates and improve accuracy in the existing Quantum models. - -Had Cirq not followed an Open Source model, things would have definitely been a lot more challenging. A great initiative would have been missed out and we would not have been one step closer in the field of Quantum Computing. - -### Summary - -To summarize in the end, we first introduced you to the concept of Quantum Computing by comparing it to existing Classical Computing techniques followed by a very important video on recent developmental updates in Quantum Computing since last year. We then briefly discussed Noisy Intermediate Scale Quantum, which is what Cirq is specifically built for. - -We saw how we can install and test Cirq on an Ubuntu system. We also tested the installation for usability on an IDE environment with some resources to get started to learn the concept. - -Finally, we also saw two examples of how Cirq would be an essential advantage in the development of research in Quantum Computing, namely OpenFermion and Bristlecone. We concluded the discussion by highlighting some thoughts on Cirq with an Open Science Perspective. - -We hope we were able to introduce you to Quantum Computing with Cirq in an easy to understand manner. If you have any feedback related to the same, please let us know in the comments section. Thank you for reading and we look forward to see you in our next Open Science article. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/qunatum-computing-cirq-framework/ - -作者:[Avimanyu Bandyopadhyay][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/avimanyu/ -[1]:https://en.wikipedia.org/wiki/Subatomic_particle -[2]:https://en.wikipedia.org/wiki/Quantum -[3]:https://www.clerro.com/guide/491/quantum-superposition-and-entanglement-explained -[4]:https://physics.stackexchange.com/questions/148131/can-quantum-entanglement-and-quantum-superposition-be-considered-the-same-phenom -[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/bit-vs-qubit.jpg -[6]:http://www.rfwireless-world.com/Terminology/Difference-between-Bit-and-Qubit.html -[7]:https://en.wikipedia.org/wiki/Proof_by_exhaustion -[8]:https://www.explainthatstuff.com/how-supercomputers-work.html -[9]:https://arxiv.org/abs/1801.00862 -[10]:https://www.xconomy.com/san-francisco/2018/07/19/google-partners-with-zapata-on-open-source-quantum-computing-effort/ -[11]:https://www.zapatacomputing.com/about/ -[12]:https://github.com/quantumlib/Cirq -[13]:https://itsfoss.com/python-setup-linux/ -[14]:https://virtualenv.pypa.io -[15]:https://cirq.readthedocs.io/en/latest/install.html#installing-on-linux -[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-framework-linux.jpeg -[17]:https://pypi.org/project/pip/ -[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-test-output.jpg -[19]:https://itsfoss.com/install-pycharm-ubuntu/ -[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-tested-on-pycharm.jpg -[21]:https://github.com/quantumlib/Cirq/tree/master/examples -[22]:https://github.com/quantumlib/Cirq/blob/master/docs/tutorial.md -[23]:http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf -[24]:http://openfermion.org -[25]:https://en.wikipedia.org/wiki/Fermion -[26]:https://en.wikipedia.org/wiki/Particle_physics -[27]:https://en.wikipedia.org/wiki/Fermi-Dirac_statistics -[28]:https://phys.org/news/2018-03-openfermion-tool-quantum-coding.html -[29]:https://en.wikipedia.org/wiki/Quantum_chemistry -[30]:https://en.wikipedia.org/wiki/Quantum_mechanics -[31]:https://ocw.mit.edu/courses/chemical-engineering/10-675j-computational-quantum-mechanics-of-molecular-and-extended-systems-fall-2004/lecture-notes/ -[32]:https://techcrunch.com/2018/03/05/googles-new-bristlecone-processor-brings-it-one-step-closer-to-quantum-supremacy/ -[33]:http://meetings.aps.org/Meeting/MAR18/Content/3475 -[34]:https://en.wikipedia.org/wiki/Superconducting_quantum_computing -[35]:https://en.wikipedia.org/wiki/Quantum_error_correction -[36]:https://en.wikipedia.org/wiki/Scalability -[37]:https://research.googleblog.com/2015/03/a-step-closer-to-quantum-computation.html -[38]:https://research.googleblog.com/2017/10/announcing-openfermion-open-source.html -[39]:https://research.googleblog.com/2016/06/quantum-annealing-with-digital-twist.html -[40]:https://arxiv.org/abs/1802.06002 -[41]:https://www.computerworld.com.au/article/644051/google-launches-quantum-framework-cirq-plans-bristlecone-cloud-move/ -[42]:https://en.wikipedia.org/wiki/Logic_gate diff --git a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md new file mode 100644 index 0000000000..289a62de15 --- /dev/null +++ b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md @@ -0,0 +1,228 @@ +量子计算的开源框架 Cirq 介绍 +====== +我们即将讨论的内容正如标题所示,本文通过使用 Cirq 的一个开源视角,尝试去了解我们已经在量子计算领域取得多大的成就,和该领域的发展方向,以加快科学和技术研究。 + +首先,我们将引领你进入量子计算的世界。在我们深入了解 Cirq 在未来的量子计算中扮演什么样的重要角色之前,我们将尽量向你解释其背后的基本概念。Cirq,你最近可能听说过,在这个领域中已经发生了重大新闻,在 Open Science 上的文章中,我们将去尝试找出答案。 + + + +在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2] 这个词来自拉丁语 Quantus,意思是 “非常小”,在下面的短视频链接中有描述: + + + +为了易于我们理解量子计算,我们将量子计算与传统计算Classical Computing(也译做经典计算)进行比较。传统计算是指设计用于工作的、我们正在使用的传统计算机,正如你现在用于阅读本文的设备,就是我们所谓的传统计算设备。 + +### 传统计算 + +传统计算是描述传统计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。传统计算机不会理解除 1 或 0 之外的任何其它东西。 + +直白来说,在计算机内部一个晶体管只能是开(1)或关(0)。我们输入的任何信息都被转换为无数个 1 和 0,所以计算机只能理解和存储 1 和 0。所有的东西都只能用无数个 1 和 0 的组合来表示。 + + + +### 量子计算 + +然而,量子计算不再像传统计算那样遵循 “开或关” 的模式。而是,借助量子的名为 [叠加和纠缠][3] 的两个现象,能同时处理信息的多个状态,因此能以更快的速率加速计算,并且在信息存储方面效率更高。 + +请注意,叠加和纠缠 [不是同一个现象][4]。 + + + +![][5] + +就像在传统计算中,我们有比特bit,在量子计算中,我们相应也有量子比特qubits(或 Quantum bits)。想了解它们二者之间的巨大差异之处,请查看这个 [页面][6],从那里的图片中可以得到答案。 + +量子计算机并不是来替代我们的传统计算机的。但是,有一些非常巨大的任务用我们的传统计算机是无法完成的,而那些正是量子计算机大显身手的好机会。下面链接的视频详细描述了上述情况,同时也描述了量子计算机的原理。 + + + +下面的视频全面描述了量子计算领域到目前为止的最新进展: + + + +### 嘈杂中型量子 + +根据最新更新的(2018 年 7 月 31 日)研究论文,术语 “Noisy” 是指由于对量子比特未能完全控制所产生的不准确性。正是这种不准确性严重制约了量子设备短期内实现其目标。 + +“中型” 指的是在接下来的几年中,量子计算机将要实现的规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力][7] 模拟能力。更多信息请阅读 [这里的][9] 论文。 + +随着 Cirq 出现,许多事情将会发生变化。 + +### Cirq 是什么? + +Cirq 是一个 python 框架,它用于创建、编辑和调用我们前面讨论的嘈杂中型量子(NISQ)。换句话说,Cirq 能够解决挑战,去改善精确度和降低量子计算中的噪声。 + +Cirq 并不需要必须有一台真实的量子计算机。Cirq 能够使用一个类似模拟器的界面去执行量子电路模拟。 + +Cirq 的前进步伐越来越快了,[Zapata][10] 是使用它的首批用户之一,Zapata 是由来自哈佛大学的一群专注于量子计算的科学家在去年成立的。 + +### Linux 上使用 Cirq 入门 + +开源的 [Cirq 库][12] 开发者建议将它安装在像 [virtualenv][14] 这样的一个 [虚拟 python 环境][13] 中。在 Linux 上的开发者安装指南可以在 [这里][15] 找到。 + +但我们在 Ubuntu 16.04 的系统上成功地安装和测试了 Python3 的 Cirq 库,安装步骤如下: + +#### 在 Ubuntu 上安装 Cirq + +![Cirq Framework for Quantum Computing in Linux][16] + +首先,我们需要 pip 或 pip3 去安装 Cirq。[Pip][17] 是推荐用于安装和管理 Python 包的工具。 + +对于 Python 3.x 版本,Pip 能够用如下的命令来安装: +``` +sudo apt-get install python3-pip + +``` + +Python3 包能够通过如下的命令来安装: +``` +pip3 install + +``` + +我们继续去使用 Pip3 为 Python3 安装 Cirq 库: +``` +pip3 install cirq + +``` + +#### 启用 Plot 和 PDF 生成(可选) + +可选系统的依赖没有安装的,可以使用 pip 去安装它: +``` +sudo apt-get install python3-tk texlive-latex-base latexmk + +``` + + * python3-tk 是 Python 自有的启用了绘图功能的图形库 + * texlive-latex-base 和 latexmk 启动了 PDF 输出功能。 + + + +最后,我们使用如下的命令和代码成功测试了 Cirq: +``` +python3 -c 'import cirq; print(cirq.google.Foxtail)' + +``` + +我们得到的输出如下图: + +![][18] + +#### 为 Cirq 配置 Pycharm IDE + +我们也配置了一个 Python IDE [PyCharm][19] 去测试同样的结果: + +因为在我们的 Linux 系统上为 Python3 安装了 Cirq,我们在 IDE 中配置项目解释器路径: +``` +/usr/bin/python3 + +``` + +![][20] + +在上面的输出中,你可能注意到我们刚设置的项目解释器路径与测试程序文件(test.py)的路径显示在一起。退出代码 0 表示程序已经成功退出,没有错误。 + +因此,那是一个现成的 IDE 环境,你可以导入 Cirq 库去开始使用 Python 去编程和模拟量子电路。 + +#### Cirq 使用入门 + +Criq 入门的一个好的开端就是它 GitHub 页面上的 [示例][21]。 + +Cirq 的开发者在 GitHub 上已经放了学习 [教程][22]。如果你想认真地学习量子计算,他们推荐你去看一本非常好的书,它是[由 Nielsen 和 Chuang 写的名为 “量子计算和量子信息“][23]。 + +#### OpenFermion-Cirq + +[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵表示费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米— 狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。 + +OpenFermion 被称为从事 [量子化学][29] 的化学家和研究人员的 [一个极好的实践工具][28]。量子化学主要专注于 [量子力学][30] 在物理模型和化学系统实验中的应用。量子化学也被称为 [分子量子力学][31]。 + +Cirq 的出现使 OpenFermion 通过提供程序和工具去扩展功能成为了可能,通过使用 Cirq 可以去编译和构造仿真量子电路。 + +#### Google Bristlecone + +2018 年 3 月 5 日,在洛杉矶举行的一年一度的 [美国物理学会会议][33] 上,Google 发布了 [Bristlecone][32],这是他们的最新的量子处理器。这个 [基于门的超导系统][34] 为 Google 提供了一个测试平台,用以研究 [量子比特技术][37] 的 [系统错误率][35] 和 [扩展性][36] ,以及在量子 [仿真][38]、[优化][39]、和 [机器学习][40] 方面的应用。 + +Google 希望在不久的将来,能够制造出它的 [云可访问][41] 的 72 个量子比特的 Bristlecone 量子处理器。Bristlecone 将越来越有能力完成一个传统超级计算机无法在合理时间内完成的任务。 + +Cirq 将让研究人员直接在云上为 Bristlecone 写程序变得很容易,它提供了一个非常方便的、实时的、量子编程和测试的接口。 + +Cirq 将允许我们去: + + * 量子电路的微调管理 + * 使用原生门去指定 [门][42] 行为 + * 在设备上放置适当的门 + * 并调度这个门的时刻 + + + +### Open Science 关于 Cirq 的观点 + +我们知道 Cirq 是在 GitHub 上开源的,它除了在 Open Science 社区之外,特别是那些专注于量子研究的人们,都可以高效率地合作,通过开发新方法,去降低现有量子模型中的错误率和提升精确度,以解决目前在量子计算中所面临的挑战。 + +如果 Cirq 不走开源模型的路线,事情可能变得更具挑战。一个伟大的创举可能就此错过,我们可能在量子计算领域止步不前。 + +### 总结 + +最后我们总结一下,我们首先通过与传统计算相比较,介绍了量子计算的概念,然后是一个非常重要的视频来介绍了自去年以来量子计算的最新发展。接着我们简单讨论了嘈杂中型量子,也就是为什么要特意构建 Cirq 的原因所在。 + +我们看了如何在一个 Ubuntu 系统上安装和测试 Cirq。我们也在一个更好用的 IDE 环境中做了安装测试,并使用一些资源去开始学习有关概念。 + +最后,我们看了两个示例 OpenFermion 和 Bristlecone,介绍了在量子计算中,Cirq 在开发研究中具有什么样的基本优势。最后我们以 Open Science 社区的视角对 Cirq 进行了一些精彩的思考,结束了我们的话题。 + +我们希望能以一种易于理解的方式向你介绍量子计算框架 Cirq 的使用。如果你有与此相关的任何反馈,请在下面的评论区告诉我们。感谢阅读,希望我们能在 Open Science 的下一篇文章中再见。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/qunatum-computing-cirq-framework/ + +作者:[Avimanyu Bandyopadhyay][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/avimanyu/ +[1]:https://en.wikipedia.org/wiki/Subatomic_particle +[2]:https://en.wikipedia.org/wiki/Quantum +[3]:https://www.clerro.com/guide/491/quantum-superposition-and-entanglement-explained +[4]:https://physics.stackexchange.com/questions/148131/can-quantum-entanglement-and-quantum-superposition-be-considered-the-same-phenom +[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/bit-vs-qubit.jpg +[6]:http://www.rfwireless-world.com/Terminology/Difference-between-Bit-and-Qubit.html +[7]:https://en.wikipedia.org/wiki/Proof_by_exhaustion +[8]:https://www.explainthatstuff.com/how-supercomputers-work.html +[9]:https://arxiv.org/abs/1801.00862 +[10]:https://www.xconomy.com/san-francisco/2018/07/19/google-partners-with-zapata-on-open-source-quantum-computing-effort/ +[11]:https://www.zapatacomputing.com/about/ +[12]:https://github.com/quantumlib/Cirq +[13]:https://itsfoss.com/python-setup-linux/ +[14]:https://virtualenv.pypa.io +[15]:https://cirq.readthedocs.io/en/latest/install.html#installing-on-linux +[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-framework-linux.jpeg +[17]:https://pypi.org/project/pip/ +[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-test-output.jpg +[19]:https://itsfoss.com/install-pycharm-ubuntu/ +[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-tested-on-pycharm.jpg +[21]:https://github.com/quantumlib/Cirq/tree/master/examples +[22]:https://github.com/quantumlib/Cirq/blob/master/docs/tutorial.md +[23]:http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf +[24]:http://openfermion.org +[25]:https://en.wikipedia.org/wiki/Fermion +[26]:https://en.wikipedia.org/wiki/Particle_physics +[27]:https://en.wikipedia.org/wiki/Fermi-Dirac_statistics +[28]:https://phys.org/news/2018-03-openfermion-tool-quantum-coding.html +[29]:https://en.wikipedia.org/wiki/Quantum_chemistry +[30]:https://en.wikipedia.org/wiki/Quantum_mechanics +[31]:https://ocw.mit.edu/courses/chemical-engineering/10-675j-computational-quantum-mechanics-of-molecular-and-extended-systems-fall-2004/lecture-notes/ +[32]:https://techcrunch.com/2018/03/05/googles-new-bristlecone-processor-brings-it-one-step-closer-to-quantum-supremacy/ +[33]:http://meetings.aps.org/Meeting/MAR18/Content/3475 +[34]:https://en.wikipedia.org/wiki/Superconducting_quantum_computing +[35]:https://en.wikipedia.org/wiki/Quantum_error_correction +[36]:https://en.wikipedia.org/wiki/Scalability +[37]:https://research.googleblog.com/2015/03/a-step-closer-to-quantum-computation.html +[38]:https://research.googleblog.com/2017/10/announcing-openfermion-open-source.html +[39]:https://research.googleblog.com/2016/06/quantum-annealing-with-digital-twist.html +[40]:https://arxiv.org/abs/1802.06002 +[41]:https://www.computerworld.com.au/article/644051/google-launches-quantum-framework-cirq-plans-bristlecone-cloud-move/ +[42]:https://en.wikipedia.org/wiki/Logic_gate From 3052a1e4400cb3d81cb9d16f616cf8dec0ea7e89 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 22:59:41 +0800 Subject: [PATCH 0828/1143] PRF:20180404 Emacs -5- Documents and Presentations with org-mode.md @oneforalone --- ...cuments and Presentations with org-mode.md | 79 ++++++++++--------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md b/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md index ad420da202..9ed04db2cb 100644 --- a/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md +++ b/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md @@ -1,59 +1,58 @@ -Emacs #5: org-mode 之文档与 Presentations +Emacs 系列(五):org 模式之文档与演示稿 ====== -### 1 org-mode 的输出 +这是 [Emacs 和 Org 模式系列][20]的第五篇。 + +这篇博文是由 Org 模式的源文件生成的,其有几种格式:[博客页面][21]、[演示稿][22] 和 [PDF 文档][23]。 + +### 1 Org 模式的输出 #### 1.1 背景 -org-mode 不仅仅只是一个议程生成程序, 它也能输出许多不同的格式: LaTeX,PDF,Beamer,iCalendar(议程),HTML,Markdown,ODT,普通文本,帮助页面(man pages)和其它更多的复杂的格式,比如说网页文件。 +Org 模式不仅仅只是一个议程生成程序,它也能输出许多不同的格式: LaTeX、PDF、Beamer、iCalendar(议程)、HTML、Markdown、ODT、普通文本、手册页和其它更多的复杂的格式,比如说网页文件。 -这也不只是一些事后的想法,这是 org-mode 的设计核心部分并且集成的很好。 +这也不只是一些事后的想法,这是 Org 模式的设计核心部分并且集成的很好。 -一个文件可以同时是源代码,自动生成的输出,任务列表,文档和 presentation。 +这一个文件可以同时是源代码、自动生成的输出、任务列表、文档和展示。 -有些人将 org-mode 作为他们首选的标记格式,甚至对于 LaTeX 文档也是如此。org-mode 手册中的 [section on exporting][13] 有更详细的介绍。 +有些人将 Org 模式作为他们首选的标记格式,甚至对于 LaTeX 文档也是如此。Org 模式手册中的 [输出一节][13] 有更详细的介绍。 #### 1.2 开始 -对于任意的 org-mode 的文档,只要按下 C-c C-e键,就会弹出一个让你选择多种输出格式和选项的菜单。这些选项通常是次键选择,所以很容易设置和执行。例如:要输出一个 PDF 文档,按 C-c C-e l p,要输出 HMTL 格式的, 按 C-c C-e h h。 +对于任意的 Org 模式的文档,只要按下 `C-c C-e` 键,就会弹出一个让你选择多种输出格式和选项的菜单。这些选项通常是次键选择,所以很容易设置和执行。例如:要输出一个 PDF 文档,按 `C-c C-e l p`,要输出 HMTL 格式的, 按 `C-c C-e h h`。 对于所有的输出选项,都有许多可用的设置;详情参见手册。事实上,使用 LaTeX 格式相当于同时使用 LaTeX 和 HTML 模式,在不同的模式中插入任意的前言和设置等。 #### 1.3 第三方插件 -[ELPA][19] 中也包含了许多额外的输出格式,详情参见 [ELPA][19]. +[ELPA][19] 中也包含了许多额外的输出格式,详情参见 [ELPA][19]。 -### 2 org-mode 的 Beamer 演示 +### 2 Org 模式的 Beamer 演示 #### 2.1 关于 Beamer -[Beamer][14] 是一个生成 presentation 的 LaTeX 环境. 它包括了一下特性: +[Beamer][14] 是一个生成演示稿的 LaTeX 环境. 它包括了以下特性: -* 在 presentation 中自动生成结构化的元素(例如 [the Marburg theme][1])。 在 presentation 时,这个特性可以为观众提供了视觉参考。 +* 在演示稿中自动生成结构化的元素(例如 [Marburg 主题][1])。 在演示稿中,这个特性可以为观众提供了视觉参考。 +* 对组织演示稿有很大的帮助。 +* 主题 +* 完全支持 LaTeX -* 对组织 presentation 有很大的帮助。 +#### 2.2 Org 模式中 Beamer 的优点 -* 主题 - -* 完全支持 LaTeX - -#### 2.2 org-mode 中 Beamer 的优点 - -在 org-mode 中用 Beamer 有很多好处,总的来说: - -* org-mode 很简单而且对可视化支持的很好,同时改变结构可以快速的重组你的材料。 +在 Org 模式中用 Beamer 有很多好处,总的来说: +* Org 模式很简单而且对可视化支持的很好,同时改变结构可以快速的重组你的材料。 * 与 org-babel 绑定在一起,实时语法高亮源码和内嵌结果。 - * 语法通常更容易使用。 -我已经完全用 org-mode 和 beamer 替换掉 LibreOffice/Powerpoint/GoogleDocs 的使用。事实上,当我必须使用其中一种工具时,这是相当令人沮丧的,因为它们在可视化表示结构方面远远比不上 org-mode。 +我已经完全用 Org 模式和 beamer 替换掉使用 LibreOffice/Powerpoint/GoogleDocs。事实上,当我必须使用其中一种工具时,这是相当令人沮丧的,因为它们在可视化表示演讲稿结构方面远远比不上 Org 模式。 #### 2.3 标题层次 -org-mode 的 Beamer 会将你文档中的部分(文中定义了标题的)转换成幻灯片。当然,问题是:哪些部分?这是由 H [export setting][15](org-export-headline-levels)决定的。 +Org 模式的 Beamer 会将你文档中的部分(文中定义了标题的)转换成幻灯片。当然,问题是:哪些部分?这是由 H [输出设置][15](`org-export-headline-levels`)决定的。 -针对不同的人,有许多不同的方法。我比较喜欢我的 presentation 这样: +针对不同的人,有许多不同的方法。我比较喜欢我的演示稿这样: ``` #+OPTIONS: H:2 @@ -64,7 +63,7 @@ org-mode 的 Beamer 会将你文档中的部分(文中定义了标题的)转 #### 2.4 主题和配置 -你可以在 org 文件的顶部来插入几行来配置 Beamer 和 LaTeX。在本文中,例如,你可以这样定义: +你可以在 Org 模式的文件顶部来插入几行来配置 Beamer 和 LaTeX。在本文中,例如,你可以这样定义: ``` #+TITLE: Documents and presentations with org-mode @@ -96,13 +95,13 @@ org-mode 的 Beamer 会将你文档中的部分(文中定义了标题的)转 #+BEAMER_HEADER: \setlength{\parskip}{\smallskipamount} ``` -在这里, aspectratio=169 将纵横比设为 16:9, 其它部分都是标准的 LaTeX/Beamer 配置。 +在这里,`aspectratio=169` 将纵横比设为 16:9, 其它部分都是标准的 LaTeX/Beamer 配置。 #### 2.6 缩小 (适应屏幕) 有时你会遇到一些非常大的代码示例,你可能更倾向与将幻灯片缩小以适应它们。 -只要按下 C-c C-c p 将 BEAMER_opt属性设为 shrink=15\.(或者设为更大的 shrink 值)。上一张幻灯片就用到了这个。 +只要按下 `C-c C-c p` 将 `BEAMER_opt` 属性设为 `shrink=15`\。(或者设为更大的 shrink 值)。上一张幻灯片就用到了这个。 #### 2.7 效果 @@ -114,28 +113,24 @@ org-mode 的 Beamer 会将你文档中的部分(文中定义了标题的)转 #### 3.1 交互式的 Emacs 幻灯片 -使用 [org-tree-slide package][17] 这个插件的话, 就可以在 Emacs 的右侧显示幻灯片了。 只要按下 M-x,然后输入 org-tree-slide-mode,回车,然后你就可以用 C-> 和 C-< 在幻灯片之间切换了。 +使用 [org-tree-slide][17] 这个插件的话,就可以在 Emacs 的右侧显示幻灯片了。 只要按下 `M-x`,然后输入 `org-tree-slide-mode`,回车,然后你就可以用 `C->` 和 `C-<` 在幻灯片之间切换了。 -你可能会发现 C-c C-x C-v (即 org-toggle-inline-images)有助于使系统显示内嵌的图像。 +你可能会发现 `C-c C-x C-v` (即 `org-toggle-inline-images`)有助于使系统显示内嵌的图像。 #### 3.2 HTML 幻灯片 -有许多方式可以将 org-mode 的 presentation 导出为 HTML,并有不同级别的 JavaScript 集成。有关详细信息,请参见 org-mode 的 wiki 中的 [non-beamer presentations section][18]。 +有许多方式可以将 Org 模式的演讲稿导出为 HTML,并有不同级别的 JavaScript 集成。有关详细信息,请参见 Org 模式的 wiki 中的 [非 beamer 演讲稿一节][18]。 ### 4 更多 #### 4.1 本文中的附加资源 * [orgmode.org beamer tutorial][2] - * [LaTeX wiki][3] - * [Generating section title slides][4] - * [Shrinking content to fit on slide][5] - -* 很棒的资源: refcard-org-beamer 详情参见其 [Github repo][6] 中的 PDF 和 .org 文件。 - +* 很棒的资源: refcard-org-beamer + * 详情参见其 [Github repo][6] 中的 PDF 和 .org 文件。 * 很漂亮的主题: [Theme matrix][7] #### 4.2 下一个 Emacs 系列 @@ -148,9 +143,9 @@ mu4e 邮件! via: http://changelog.complete.org/archives/9900-emacs-5-documents-and-presentations-with-org-mode 作者:[John Goerzen][a] -译者:[oneforalone](https://github.com/oneforalone) -校对:[校对者ID](https://github.com/校对者ID) 选题:[lujun9972](https://github.com/lujun9972) +译者:[oneforalone](https://github.com/oneforalone) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -174,3 +169,9 @@ via: http://changelog.complete.org/archives/9900-emacs-5-documents-and-presentat [17]:https://orgmode.org/worg/org-tutorials/non-beamer-presentations.html#org-tree-slide [18]:https://orgmode.org/worg/org-tutorials/non-beamer-presentations.html [19]:https://www.emacswiki.org/emacs/ELPA +[20]:https://changelog.complete.org/archives/tag/emacs2018 +[21]:https://github.com/jgoerzen/public-snippets/blob/master/emacs/emacs-org-beamer/emacs-org-beamer.org +[22]:http://changelog.complete.org/archives/9900-emacs-5-documents-and-presentations-with-org-mode +[23]:https://github.com/jgoerzen/public-snippets/raw/master/emacs/emacs-org-beamer/emacs-org-beamer.pdf +[24]:https://github.com/jgoerzen/public-snippets/raw/master/emacs/emacs-org-beamer/emacs-org-beamer-document.pdf + From 8b00b53b68563c53f5638f657a0928b5c9321a02 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 23:00:14 +0800 Subject: [PATCH 0829/1143] PUB:20180404 Emacs -5- Documents and Presentations with org-mode.md @oneforalone https://linux.cn/article-10340-1.html --- ...0180404 Emacs -5- Documents and Presentations with org-mode.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180404 Emacs -5- Documents and Presentations with org-mode.md (100%) diff --git a/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md b/published/20180404 Emacs -5- Documents and Presentations with org-mode.md similarity index 100% rename from translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md rename to published/20180404 Emacs -5- Documents and Presentations with org-mode.md From 72e45075741d7dec39dff3c040df4d19295d82ca Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 12 Dec 2018 23:01:02 +0800 Subject: [PATCH 0830/1143] PRF:20180404 Emacs -5- Documents and Presentations with org-mode.md --- ...80404 Emacs -5- Documents and Presentations with org-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20180404 Emacs -5- Documents and Presentations with org-mode.md b/published/20180404 Emacs -5- Documents and Presentations with org-mode.md index 9ed04db2cb..5082ec2fc9 100644 --- a/published/20180404 Emacs -5- Documents and Presentations with org-mode.md +++ b/published/20180404 Emacs -5- Documents and Presentations with org-mode.md @@ -1,4 +1,4 @@ -Emacs 系列(五):org 模式之文档与演示稿 +Emacs 系列(五):Org 模式之文档与演示稿 ====== 这是 [Emacs 和 Org 模式系列][20]的第五篇。 From 736866a3ca27f2edb8191feaf85029b086ca3e5d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 13 Dec 2018 08:54:41 +0800 Subject: [PATCH 0831/1143] translated --- ... a containerized machine learning model.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) rename {sources => translated}/tech/20181102 Create a containerized machine learning model.md (59%) diff --git a/sources/tech/20181102 Create a containerized machine learning model.md b/translated/tech/20181102 Create a containerized machine learning model.md similarity index 59% rename from sources/tech/20181102 Create a containerized machine learning model.md rename to translated/tech/20181102 Create a containerized machine learning model.md index d0a57d0b72..7c48ba6af7 100644 --- a/sources/tech/20181102 Create a containerized machine learning model.md +++ b/translated/tech/20181102 Create a containerized machine learning model.md @@ -7,46 +7,46 @@ [#]: author: (Sven Bösiger) [#]: url: ( ) -Create a containerized machine learning model +创建一个容器化的机器学习模型 ====== ![](https://fedoramagazine.org/wp-content/uploads/2018/10/machinelearning-816x345.jpg) -After data scientists have created a machine learning model, it has to be deployed into production. To run it on different infrastructures, using containers and exposing the model via a REST API is a common way to deploy a machine learning model. This article demonstrates how to roll out a [TensorFlow][1] machine learning model, with a REST API delivered by [Connexion][2] in a container with [Podman][3]. +数据科学家在创建机器学习模型后,必须将其部署到生产中。要在不同的基础架构上运行它,使用容器并通过 REST API 公开模型是部署机器学习模型的常用方法。本文演示了如何在 [Podman][3] 容器中使用 [Connexion][2] 推出使用 REST API 的 [TensorFlow][1] 机器学习模型。 -### Preparation +### 准备 -First, install Podman with the following command: +首先,使用以下命令安装 Podman: ``` sudo dnf -y install podman ``` -Next, create a new folder for the container and switch to that directory. +接下来,为容器创建一个新文件夹并切换到该目录。 ``` mkdir deployment_container && cd deployment_container ``` -### REST API for the TensorFlow model +### TensorFlow 模型的 REST API -The next step is to create the REST-API for the machine learning model. This [github repository][4] contains a pretrained model, and well as the setup already configured for getting the REST API working. +下一步是为机器学习模型创建 REST API。这个 [github 仓库][4]包含一个预训练模型,以及能让 REST API 工作的设置。 -Clone this in the deployment_container directory with the command: +使用以下命令在 deployment_container 目录中克隆它: ``` git clone https://github.com/svenboesiger/titanic_tf_ml_model.git ``` -#### prediction.py & ml_model/ +#### prediction.py 和 ml_model/ -The [prediction.py][5] file allows for a Tensorflow prediction, while the weights for the 20x20x20 neural network are located in folder [ml_model/][6]. +[prediction.py][5] 能进行 Tensorflow 预测,而 20x20x20 神经网络的权重位于文件夹 [ml_model/][6] 中。 #### swagger.yaml -The file swagger.yaml defines the API for the Connexion library using the [Swagger specification][7]. This file contains all of the information necessary to configure your server to provide input parameter validation, output response data validation, URL endpoint definition. +swagger.yaml 使用 [Swagger规范][7] 定义 Connexion 库的 API。此文件包含让你的服务器提供输入参数验证、输出响应数据验证、URL 端点定义所需的所有信息。 -As a bonus Connexion will provide you also with a simple but useful single page web application that demonstrates using the API with JavaScript and updating the DOM with it. +额外地,Connexion 还将给你提供一个简单但有用的单页 Web 应用,它演示了如何使用 Javascript 调用 API 和更新 DOM。 ``` swagger: "2.0" @@ -85,9 +85,9 @@ definitions: type: object ``` -#### server.py & requirements.txt +#### server.py 和 requirements.txt -[server.py][8] defines an entry point to start the Connexion server. +[server.py][8] 定义了启动 Connexion 服务器的入口点。 ``` import connexion @@ -100,7 +100,7 @@ if __name__ == '__main__': app.run(debug=True) ``` -[requirements.txt][9] defines the python requirements we need to run the program. +[requirements.txt][9] 定义了运行程序所需的 python 包。 ``` connexion @@ -108,9 +108,9 @@ tensorflow pandas ``` -### Containerize! +### 容器化! -For Podman to be able to build an image, create a new file called “Dockerfile” in the **deployment_container** directory created in the preparation step above: +为了让 Podman 构建映像,请在上面的准备步骤中创建的 **deployment_container** 目录中创建一个名为 “Dockerfile” 的新文件: ``` FROM fedora:28 @@ -143,25 +143,25 @@ WORKDIR /titanic_tf_ml_model CMD python3 server.py ``` -Next, build the container image with the command: +接下来,使用以下命令构建容器镜像: ``` podman build -t ml_deployment . ``` -### Run the container +### 运行容器 -With the Container image built and ready to go, you can run it locally with the command: +随着容器镜像的构建和准备就绪,你可以使用以下命令在本地运行它: ``` podman run -p 5000:5000 ml_deployment ``` -Navigate to [http://0.0.0.0:5000/ui][10] in your web browser to access the Swagger/Connexion UI and to test-drive the model: +在 Web 浏览器中输入 [http://0.0.0.0:5000/ui][10] 访问 Swagger/Connexion UI 并测试模型: ![][11] -Of course you can now also access the model with your application via the REST-API. +当然,你现在也可以在应用中通过 REST API 访问模型。 -------------------------------------------------------------------------------- @@ -170,7 +170,7 @@ via: https://fedoramagazine.org/create-containerized-machine-learning-model/ 作者:[Sven Bösiger][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/) 荣誉推出 @@ -187,4 +187,4 @@ via: https://fedoramagazine.org/create-containerized-machine-learning-model/ [8]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/server.py [9]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/requirements.txt [10]: http://0.0.0.0:5000/ -[11]: https://fedoramagazine.org/wp-content/uploads/2018/10/Screenshot-from-2018-10-27-14-46-56-682x1024.png +[11]: https://fedoramagazine.org/wp-content/uploads/2018/10/Screenshot-from-2018-10-27-14-46-56-682x1024.png \ No newline at end of file From b55ab150a61b9565351f2fe07954dae308e46c42 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 13 Dec 2018 08:57:51 +0800 Subject: [PATCH 0832/1143] translating --- ... to Install Putty on Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md index 1b92a73645..2c7805cbf2 100644 --- a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f19890e1e5f4d31e7e206f08af46986a338bbd28 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 13 Dec 2018 12:09:12 +0800 Subject: [PATCH 0833/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Top=205=20confi?= =?UTF-8?q?guration=20management=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...12 Top 5 configuration management tools.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20181212 Top 5 configuration management tools.md diff --git a/sources/tech/20181212 Top 5 configuration management tools.md b/sources/tech/20181212 Top 5 configuration management tools.md new file mode 100644 index 0000000000..72aebb209a --- /dev/null +++ b/sources/tech/20181212 Top 5 configuration management tools.md @@ -0,0 +1,122 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 5 configuration management tools) +[#]: via: (https://opensource.com/article/18/12/configuration-management-tools) +[#]: author: (Marco Bravo https://opensource.com/users/marcobravo) + +Top 5 configuration management tools +====== +Learn about configuration management tools and figure out which will work best for your DevOps organization. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M) + +DevOps is evolving and gaining traction as organizations discover how it enables them to produce better applications and reduce their software products' time to market. + +[DevOps' core values][1] are Culture, Automation, Measurement, and Sharing (CAMS), and an organization's adherence to them influences how successful it is. + + * **Culture** brings people and processes together; + * **Automation** creates a fabric for DevOps; + * **Measurement** permits improvements; and + * **Sharing** enables the feedback loop in the CAMS cycle. + + + +Another DevOps concept is the idea that almost everything can be managed in code: servers, databases, networks, log files, application configurations, documentation, automated tests, deployment processes, and more. + +In this article, I'll focus on one aspect of automation: Configuration management. As part of [Infrastructure as Code][2] (IaC), configuration management tools enable the use of tested and proven software development practices for managing and provisioning data centers through plaintext definition files. + +By manipulating simple configuration files, a DevOps team can use application development best practices, such as version control, testing, small deployments, and design patterns. In short, this means code can be written to provision and manage an infrastructure as well as automate processes. + +### Why use configuration management tools? + +Configuration management tools enable changes and deployments to be faster, repeatable, scalable, predictable, and able to maintain the desired state, which brings controlled assets into an expected state. + +Some advantages of using configuration management tools include: + + * Adherence to coding conventions that make it easier to navigate code + * Idempotency, which means that the end state remains the same, no matter how many times the code is executed + * Distribution design to improve managing large numbers of remote servers + + + +Some configuration management tools use a pull model, in which an agent installed on the servers runs periodically to pull the latest definitions from a central repository and apply them to the server. Other tools use a push model, where a central server triggers updates to managed servers. + +### Top 5 configuration management tools + +There are a variety of configuration management tools available, and each has specific features that make it better for some situations than others. Yet the top five configuration management tools, presented below in alphabetical order, have several things in common that I believe are essential for DevOps success: all have an open source license, use externalized configuration definition files, run unattended, and are scriptable. All of the descriptions are based on information from the tools' software repositories and websites. + +#### Ansible + +"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications—automate in a language that approaches plain English, using SSH, with no agents to install on remote systems." —[GitHub repository][3] + +Ansible is one of my favorite tools; I started using it several years ago and fell in love with it. You can use Ansible to execute the same command for a list of servers from the command line. You can also use it to automate tasks using "playbooks" written into a YAML file, which facilitate communication between teams and non-technical people. Its main advantages are that it is simple, agentless, and easy to read (especially for non-programmers). + +Because agents are not required, there is less overhead on servers. An SSH connection is necessary when running in push mode (which is the default), but pull mode is available if needed. [Playbooks][4] can be written with a minimal set of commands or they can be scaled for more elaborate automation tasks that could include roles, variables, and modules written by other people. + +You can combine Ansible with other tools to create a central console to control processes. Those tools include Ansible Works (AWX), Jenkins, RunDeck, and [ARA][5], which offers [traceability when running playbooks][6]. + +### CFEngine + +"CFEngine 3 is a popular open source configuration management system. Its primary function is to provide automated configuration and maintenance of large-scale computer systems." —[GitHub repository][7] + +CFEngine was introduced by Mark Burgess in 1993 as a scientific approach to automated configuration management. The goal was to deal with the entropy in computer systems' configuration and resolve it with end-state "convergence." Convergence means a desired end-state and elaborates on idempotence as a capacity to reach the desired end-state. Burgess' research evolved in 2004 when he proposed the [Promise theory][8] as a model of voluntary cooperation between agents. + +The current version of CFEngine incorporates Promise theory and uses agents running on each server that pull the configuration from a central repository. It requires some expert knowledge to deal with configurations, so it's best suited for technical people. + +### Chef + +"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure." —[GitHub repository][9] + +Chef uses "recipes" written in Ruby to keep your infrastructure running up-to-date and compliant. The recipes describe a series of resources that should be in a particular state. Chef can run in client/server mode or in a standalone configuration named [chef-solo][10]. It has good integration with the major cloud providers to automatically provision and configure new machines. + +Chef has a solid user base and provides a full toolset to allow people with different technical backgrounds and skills to interact around the recipes. But, at its base, it is more technically oriented tool. + +### Puppet + +"Puppet, an automated administrative engine for your Linux, Unix, and Windows systems, performs administrative tasks (such as adding users, installing packages, and updating server configurations) based on a centralized specification." —[GitHub repository][11] + +Conceived as a tool oriented toward operations and sysadmins, Puppet has consolidated as a configuration management tool. It usually works in a client-server architecture, and an agent communicates with the server to fetch configuration instructions. + +Puppet uses a declarative language or Ruby to describe the system configuration. It is organized in modules, and manifest files contain the desired-state goals to keep everything as required. Puppet uses the push model by default, and the pull model can be configured. + +### Salt + +"Software to automate the management and configuration of any infrastructure or application at scale." — [GitHub repository][12] + +Salt was created for high-speed data collection and scale beyond tens of thousands of servers. It uses Python modules to handle configuration details and specific actions. These modules manage all of Salt's remote execution and state management behavior. Some level of technical skills are required to configure the modules. + +Salt uses a client-server topology (with the Salt master as server and Salt minions as clients). Configurations are kept in Salt state files, which describe everything required to keep a system in the desired state. + +### Conclusion + +The landscape of DevOps tools is evolving all the time, and it is important to keep an eye on the changes. I hope this article will encourage you to explore these concepts and tools further. If so, the Cloud Native Computing Foundation (CNCF) maintains a good reference in the [Cloud Native Landscape Project][13]. + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/configuration-management-tools + +作者:[Marco Bravo][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://www.oreilly.com/learning/why-use-terraform +[2]: https://www.oreilly.com/library/view/infrastructure-as-code/9781491924334/ch04.html +[3]: https://github.com/ansible/ansible +[4]: https://opensource.com/article/18/8/ansible-playbooks-you-should-try +[5]: https://github.com/openstack/ara +[6]: https://opensource.com/article/18/5/analyzing-ansible-runs-using-ara +[7]: https://github.com/cfengine/core +[8]: https://en.wikipedia.org/wiki/Promise_theory +[9]: https://github.com/chef/chef +[10]: https://docs.chef.io/chef_solo.html +[11]: https://github.com/puppetlabs/puppet +[12]: https://github.com/saltstack/salt +[13]: https://github.com/cncf/landscape From 0aa789c045caa50a8d1ddf082c75098212df9a60 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 13 Dec 2018 12:10:55 +0800 Subject: [PATCH 0834/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Patch=20into=20?= =?UTF-8?q?The=20Matrix=20at=20the=20Linux=20command=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to The Matrix at the Linux command line.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/tech/20181212 Patch into The Matrix at the Linux command line.md diff --git a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md b/sources/tech/20181212 Patch into The Matrix at the Linux command line.md new file mode 100644 index 0000000000..c07e71fc28 --- /dev/null +++ b/sources/tech/20181212 Patch into The Matrix at the Linux command line.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Patch into The Matrix at the Linux command line) +[#]: via: (https://opensource.com/article/18/12/linux-toy-cmatrix) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Patch into The Matrix at the Linux command line +====== +Recreate the classic look and feel of everyone's favorite 1990s sci-fi movie code scroller with cmatrix. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr) + +You've found your way to today's entry from the Linux command-line toys advent calendar. If this is your first visit to the series, you might be wondering what a command-line toy even is? It's anything that's an entertaining diversion at the terminal, be it a game, a fun utility, or a simple distraction. + +Some of these are classics, and some are completely new (at least to me), but I hope all of you find something you enjoy in this series. + +As we come to the close of another year, it's a good time for looking back, and looking forward. What will 2019 hold for you? What does it mean to be 2019? + +I'm reminded that 2019 will mark the twentieth anniversary of one of my favorite science fiction movies from my teenage years, that at the time had me thinking a lot about what the future would hold: [The Matrix][1]. For a computer nerd kid like me, it was the ultimate story of a computer programmer rising up and becoming an action hero in a virtual universe by tapping into the power of his mind. + +At the time, there was no movie that seemed more futuristic to me; both in the story itself, and in the mesmerizing special effects. Realizing that it was filmed over twenty years ago doesn't change that in my mind. + +Bringing it back to our command-line toy for today, let's recreate the downward flowing code of the Matrix at our terminal with **cmatrix**. **cmatrix** was an easy install for me, packaged for Fedora, so installing it took simply: + +``` +$ dnf install cmatrix +``` + +Then, just type **cmatrix **at your terminal to run. +![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif) +You can find the source code for **** **cmatrix** [on GitHub][2] under a GPL license. + +Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [Winterize your Bash prompt in Linux][3], and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-cmatrix + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/The_Matrix +[2]: https://github.com/abishekvashok/cmatrix +[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt From 28f5cd2500dcdbba06bced3225f95d5fef3a2f61 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 13 Dec 2018 12:21:33 +0800 Subject: [PATCH 0835/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20What=20is=20PPA?= =?UTF-8?q?=3F=20Everything=20You=20Need=20to=20Know=20About=20PPA=20in=20?= =?UTF-8?q?Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing You Need to Know About PPA in Linux.md | 315 ++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md diff --git a/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md b/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md new file mode 100644 index 0000000000..194dc31ef3 --- /dev/null +++ b/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md @@ -0,0 +1,315 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What is PPA? Everything You Need to Know About PPA in Linux) +[#]: via: (https://itsfoss.com/ppa-guide/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +What is PPA? Everything You Need to Know About PPA in Linux +====== + +**Brief: An in-depth article that covers almost all the questions around using PPA in Ubuntu and other Linux distributions.** + +If you have been using Ubuntu or some other Linux distribution based on Ubuntu such as Linux Mint, Linux Lite, Zorin OS etc, you may have come across three magical lines of this sort: + +``` +sudo add-apt-repository ppa:dr-akulavich/lighttable +sudo apt-get update +sudo apt-get install lighttable-installer +``` + +A number of websites suggest these kind of lines to [install applications in Ubuntu][1]. This is what is called installing an application using PPA. + +But what is PPA? Why is it used? Is it safe to use PPA? How to properly use PPA? How to delete a PPA? + +I’ll answer all of the above questions in this detailed guide. Even if you already know a few things about PPAs, I am sure this article will still add to your knowledge. + +Do note that I am writing this article using Ubuntu. Therefore I’ll use the term Ubuntu almost everywhere but the explanations and steps are also applicable to other Debian/Ubuntu based distributions. + +### What is PPA? Why is it used? + +![Everything you need to know about PPA in Ubuntu Linux][2] + +PPA stands for Personal Package Archive. + +Does that make sense? Probably not. + +Before you understand PPA, you should know the concept of repositories in Linux. I won’t go into details here though. + +#### Concept of repositories and package management + +A repository is a collection of files that has information about various software, their versions and some other details like the checksum. Each Ubuntu version has its own official set of four repositories: + + * **Main** – Canonical-supported free and open-source software. + + * **Universe** – Community-maintained free and open-source software. + + * **Restricted** – Proprietary drivers for devices. + + * **Multiverse** – Software restricted by copyright or legal issues. + + + + +You can see such repositories for all Ubuntu versions [here][3]. You can browse through them and also go to the individual repositories. For example, Ubuntu 16.04 main repository can be found [here][4]. + +So basically it’s a web URL that has information about the software. How does your system know where are these repositories? + +This information is stored in the sources.list file in the directory /etc/apt. If you look at its content, you’ll see that it has the URL of the repositories. The lines with # at the beginning are ignored. + +Now when you run the command sudo apt update, your system uses [APT tool][5] to check against the repo and stores the information about the software and their version in a cache. When you use the command sudo apt install package_name, it uses the information to get that package from the URL where the actual software is stored. + +If the repository doesn’t have the information about a certain package, you’ll see an error like: + +``` +E: Unable to locate package +``` + +At this point, I recommend reading my [guide to using apt commands][6]. This will give you a much better understanding of apt commands, update etc. + +So this was about repositories. But what is PPA? How does it enter into the picture? + +#### Why is PPA used? + +As you can see, Ubuntu controls what software and more importantly which version of a software you get on your system. But imagine if a software developer releases a new version of the software. + +Ubuntu won’t make it available immediately. There is a procedure to check if the new version of the software is compatible with the system or not. This ensures the stability of the system. + +But this also means that it will be some weeks or in some cases, some months before it is made available by Ubuntu. Not everyone would want to wait that long to get their hands on the new version of their favorite software. + +Similarly, suppose someone develops a software and wants Ubuntu to include that software in the official repositories. It again will take months before Ubuntu makes a decision and includes it in the official repositories. + +Another case would be during beta testing. Even if a stable version of the software is available in the official repositories, a software developer may want some end users to test their upcoming release. How do they enable the end user to beta test the upcoming release? + +Enter PPA! + +### How to use PPA? How does PPA work? + +[PPA][7], as I already told you, means Personal Package Archive. Mind the word ‘Personal’ here. That gives the hint that this is something exclusive to a developer and is not officially endorsed by the distribution. + +Ubuntu provides a platform called Launchpad that enables software developers to create their own repositories. An end user i.e. you can add the PPA repository to your sources.list and when you update your system, your system would know about the availability of this new software and you can install it using the standard sudo apt install command like this. + +`sudo add-apt-repository ppa:dr-akulavich/lighttable` +`sudo apt-get update` +`sudo apt-get install lighttable-installer` + +To summarize: + + * sudo add-apt-repository <– This command adds the PPA repository to the list. + * sudo apt-get update <– This command updates the list of the packages that can be installed on the system. + * sudo apt-get install <– This command installs the package. + + + +You see that it is important to use the command sudo apt update or else your system will not know when a new package is available. + +Now let’s take a look at the first command in a bit more detail. + +``` +sudo add-apt-repository ppa:dr-akulavich/lighttable +``` + +You would notice that this command doesn’t have a URL to the repository. This is because the tool has been designed to abstract the information about URL from you. + +Just a small note. If you add ppa:dr-akulavich/lighttable, you get Light Table. But if you add ppa:dr-akulavich, you’ll get all the repository or packages mentioned in the ‘upper repository’. It’s hierarchical. + +Basically, when you add a PPA using add-apt-repository, it will do the same action as if you manually run these commands: + +``` +deb http://ppa.launchpad.net/dr-akulavich/lighttable/ubuntu YOUR_UBUNTU_VERSION_HERE main +deb-src http://ppa.launchpad.net/dr-akulavich/lighttable/ubuntu YOUR_UBUNTU_VERSION_HERE main +``` + +The above two lines are the traditional way to add any repositories to your sources.list. But PPA does it automatically for you, without wondering about the exact repository URL and operating system version. + +One important thing to not here is that when you use PPA, it doesn’t change your original sources.list. Instead, it creates two files in /etc/apt/sources.d directory, a list and a back up file with suffix ‘save’. + +![Using a PPA in Ubuntu][8]PPA create separate sources.list + +The files with suffix ‘list’ has the command that adds the information about the repository. + +![PPA add repository information][9]Content of source.list of a PPA + +This is a safety measure to ensure that adding PPAs don’t mess with the original sources.list. It also helps in removing the PPA. + +#### Why PPA? Why not DEB packages? + +You may ask why should you use PPA when it involves using command line which might not be preferred by everyone. Why not just distribute a DEB package that can be installed graphically? + +The answer lies in the update procedure. If you install a software using a DEB package, there is no guarantee that the installed software will be updated to a newer version when you run sudo apt update && sudo apt upgrade. + +It’s because the apt upgrade procedure relies on the sources.list. If there is no entry for a software, it doesn’t get the update via the standard software updater. + +So does it mean software installed using DEB never gets an update? No, not really. It depends on how the package was created. + +Some developers automatically add an entry to the sources.list and then it is updated like a regular software. Google Chrome is one such example. + +Some software would notify you of availability of a new version when you try to run it. You’ll have to download the new DEB package and run it again to update the current software to a newer version. Oracle Virtual Box is an example in this case. + +For the rest of the DEB packages, you’ll have to manually look for an update and this is not convenient, especially if your software is meant for beta testers. You need to add more updates frequently. This is where PPA come to the rescue. + +#### Offical PPA vs unofficial PPA + +You may also hear the term official PPA or unofficial PPA. What’s the difference? + +When developers create PPA for their software, it is called the official PPA. Quite obviously because it is coming from none other than the project developers. + +But at times, individuals create PPA of projects that were created by other developers. + +Why would someone do that? Because many developers just provide the source code of the software and you know that [installing software from source code in Linux][10] is a pain and not everyone could or would do that. + +This is why volunteers take it upon themselves to create a PPA from those source code so that other users can install the software easily. After all, using those 3 lines is a lot easier than battling the source code installation. + +#### Make sure that a PPA is available for your distribution version + +When it comes to using PPA in Ubuntu or any other Debian based distribution, there are a few things you should keep in mind. + +Not every PPA is available for your particular version. You should know [which Ubuntu version][11] you are using. The codename of the release is important because when you go to the webpage of a certain PPA, you can see which Ubuntu versions are supported by the PPA. + +For other Ubuntu-based distributions, you can check the content of /etc/os-release to [find out the Ubuntu version][11] information. + +![Verify PPA availability for Ubuntu version][12]Check if PPA is available for your Ubuntu version + +How to know the PPA url? Simply search on the internet with the PPA name like ppa:dr-akulavich/lighttable and you’ll get the first result from [Launchpad][13], the official platform for hosting PPA. You can also go to Launchpad and search for the required PPA directly there. + +If you don’t verify and add the PPA, you may see an error like this when you try to install a software not available for your version. + +``` +E: Unable to locate package +``` + +What’s worse is that since it has been added to your source.list, each time you run software updater, you’ll see an error “[Failed to download repository information][14]“. + +![Failed to download repository information Ubuntu 13.04][15] + +If you run sudo apt update in the terminal, the error will have more details about which repository is causing the trouble. You can see something like this in the end of the output of sudo apt update: + +``` +W: Failed to fetch http://ppa.launchpad.net/venerix/pkg/ubuntu/dists/raring/main/binary-i386/Packages  404  Not Found +E: Some index files failed to download. They have been ignored, or old ones used instead. +``` + +Which is self-explanatory because the system cannot find the repository for your version. Remember what we saw earlier about repository structure? APT will try to look for software information in the place /ubuntu/dists/Ubuntu_Version + +And if the PPA for the specific version is not available, it will never be able to open the URL and you get the famous 404 error. + +#### Why are PPAs not available for all the Ubuntu release versions? + +It is because someone has to compile the software and create a PPA out of it on the specific versions. Considering that a new Ubuntu version is released every six months, it’s a tiresome task to update the PPA for every Ubuntu release. Not all developers have time to do that. + +#### How to install the application if PPA is not available for your version? + +It is possible that though the PPA is not available for your Ubuntu version, you could still download the DEB file and install the application + +Let’s say that you go to the Light Table PPA. Using the knowledge about PPA you just learned, you realize that the PPA is not available for your specific Ubuntu release. + +What you can do is to click on the ‘View package details’. + +![Get DEB file from PPA][16] + +And in here, you can click on a package to reveal more details. You’ll also find the source code and the DEB file of the package here. + +![Download DEB file from PPA][17] + +I advise [using Gdebi to install these DEB files][18] instead of the Software Center because Gdebi is a lot better at handling dependencies. + +Do note that the package installed this way might not get any future updates. + +I think you have read enough about adding PPAs. How about removing a PPA and the software installed by it? + +### How to delete PPA? + +I have written about [deleting PPA][19] in the past. I am going to describe the same methods here as well. + +I advise deleting the software that you installed from a PPA before removing the PPA. If you just remove the PPA, the installed software remains in the system but it won’t get any updates. You wouldn’t want that, would you? + +So, the question comes, how to know which application was installed by which PPA? + +#### Find packages installed by a PPA and remove them + +Ubuntu Software Center doesn’t help here. You’ll have to use Synaptic package manager here which has more advanced features. + +You can install Synaptic from Software Center or use the command below: + +``` +sudo apt install synaptic +``` + +Once installed, start Synaptic package manager and select Origin. You’ll see various repositories added to the system. PPA entries will be labeled with prefix PPA. Click on them to see the packages that are available by the PPA. Installed software will have appropriate symbol before it. + +![Managing PPA with Synaptic package manager][20]Find packages installed via a PPA + +Once you have found the packages, you can delete them from Synaptic itself. Otherwise, you always have the option to use the command line: + +``` +sudo apt remove package_name +``` + +Once you have removed the packages installed by a PPA, you can continue to remove the PPA from your sources.list. + +#### Remove a PPA graphically + +Go to Software & Updates and then go to tab Other Software. Look for the PPA that you want to remove: + +![Delete a PPA from Software Source][21] + +You have two options here. Either you deselect the PPA or you choose the Remove option. + +The difference is that when you deselect a PPA entry, your system will comment out the repository entry in its ppa_name.list file in /etc/apt/sources.list.d but if you choose the Remove option, it will delete the repository entry from its ppa_name.list file in /etc/apt/sources.list.d directory. + +In both the cases, the files ppa_name.list remains in the said directory, even if it is empty. + +### Is it safe to use PPA? + +It is a subjective question. Purists abhor PPA because most of the time PPAs are from third-party developers. But at the same time, PPAs are popular in the Debian/Ubuntu world as they provide an easier installation option. + +As far as the security is concerned, it’s less likely that you use a PPA and your Linux system is hacked or injected with malware. I don’t recall such an incident ever happened so far. + +Official PPAs can be used without thinking twice. Using unofficial PPA is entirely your decision. + +As a rule of thumb, you should avoid installing a program via a third party PPA if it the program requires sudo access to run. + +### What do you think about using PPA? + +I know it’s a long read but I wanted to give you a better understanding of PPA. I hope this detailed guide answered most of your questions about using PPA. + +If you have more questions about PPA, please feel free to ask in the comment section. + +If you notice any technical or grammatical error or if you have suggestions for improving this article, please let me know. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ppa-guide/ + +作者:[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/remove-install-software-ubuntu/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/what-is-ppa.png?resize=800%2C450&ssl=1 +[3]: http://archive.ubuntu.com/ubuntu/dists/ +[4]: http://archive.ubuntu.com/ubuntu/dists/xenial/main/ +[5]: https://wiki.debian.org/Apt +[6]: https://itsfoss.com/apt-command-guide/ +[7]: https://launchpad.net/ubuntu/+ppas +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/01/ppa-sources-list-files.png?resize=800%2C259&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/01/content-of-ppa-list.png?ssl=1 +[10]: https://itsfoss.com/install-software-from-source-code/ +[11]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/12/verify-ppa-availibility-version.jpg?resize=800%2C481&ssl=1 +[13]: https://launchpad.net/ +[14]: https://itsfoss.com/failed-to-download-repository-information-ubuntu-13-04/ +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2013/04/Failed-to-download-repository-information-Ubuntu-13.04.png?ssl=1 +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/deb-from-ppa.jpg?resize=800%2C483&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/deb-from-ppa-2.jpg?resize=800%2C477&ssl=1 +[18]: https://itsfoss.com/gdebi-default-ubuntu-software-center/ +[19]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/01/ppa-synaptic-manager.jpeg?resize=800%2C394&ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2012/08/Delete-a-PPA.jpeg?ssl=1 From 13ff6637819c36727ddefbb0ce96c75599111d26 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Thu, 13 Dec 2018 12:38:47 +0800 Subject: [PATCH 0836/1143] Translating by qhwdw --- sources/tech/20180911 Know Your Storage- Block, File - Object.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180911 Know Your Storage- Block, File - Object.md b/sources/tech/20180911 Know Your Storage- Block, File - Object.md index 24f179d9d5..0b7c2cc338 100644 --- a/sources/tech/20180911 Know Your Storage- Block, File - Object.md +++ b/sources/tech/20180911 Know Your Storage- Block, File - Object.md @@ -1,3 +1,4 @@ +Translating by qhwdw Know Your Storage: Block, File & Object ====== From ccd64b8fa7072bde0c70959003aa18b5198046ed Mon Sep 17 00:00:00 2001 From: qhwdw Date: Thu, 13 Dec 2018 12:42:49 +0800 Subject: [PATCH 0837/1143] Translating by qhwdw --- sources/tech/20181210 How to get started in AI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181210 How to get started in AI.md b/sources/tech/20181210 How to get started in AI.md index b0ac291557..0dfb5761aa 100644 --- a/sources/tech/20181210 How to get started in AI.md +++ b/sources/tech/20181210 How to get started in AI.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qhwdw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f2dfbd01027a7b24d6e0d856d9fc21220b9d1cfa Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Thu, 13 Dec 2018 13:24:19 +0800 Subject: [PATCH 0838/1143] Check translation of 7 command-line tools for writers. --- ...line tools for writers - Opensource.com.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md index ead46909ff..2073fd9279 100644 --- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md +++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md @@ -1,9 +1,9 @@ 给写作者们的 7 个命令行工具 | Opensource.com ====== -扔掉你的打字机,然后使用这些开源工具在命令行上编辑吧。 +扔掉你的打字机,然后使用这些开源工具在命令行上写作吧。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE) -对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文本编辑器上编辑文本。但是还有很多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。 +对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文本编辑器上编辑文本。但是还有许多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。 在使用图形界面写作的世界同样有命令行工具的一席之地。这些命令行工具可以帮助他们进行写作,检查他们的拼写等等——无论是在写一篇文章、博客或者故事;写一个 README 文件;或者准备一份技术文档的时候。 @@ -11,9 +11,9 @@ ### 编辑器 -没错,你_可以_在命令行进行真正的写作。我知道一些写作者会使用 [Nano][2]、[Vim][3]、[Emacs][4]、以及 [Jove][5] 等编辑器在终端窗口中进行工作。而这些编辑器并不是[aren't the only games in town][6]。文本编辑器的优势在于它们简单易用和专注。它们非常适合于编辑任何文本的初稿甚至完成一个漫长而复杂的写作项目。 +没错,你可以在命令行进行真正的写作。我知道一些写作者会使用 [Nano][2]、[Vim][3]、[Emacs][4]、以及 [Jove][5] 等编辑器在终端窗口中进行工作。而这些编辑器[并非屈指可数][6]。文本编辑器的优势在于它们简单易用以及更专注于文本。非常适合用于编辑任何文本的初稿甚至完成一个漫长而复杂的写作项目。 -如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下[WordGrinder][7]。WordGrinder 是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown, ODT, LaTeX, 以及 HTML等格式导出。 +如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下 [WordGrinder][7]。WordGrinder 是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown,ODT,LaTeX,或者 HTML 等格式导出。 ### 拼写检查 @@ -25,19 +25,19 @@ ### Prose linters -软件开发人员使用[linters][11]来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的linters;而命令行会认为这些错误是_样式元素_。任何写作者都可以(也应该)使用它,一个 prose linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。 +软件开发人员使用 [linters][11] 来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的 linters;而命令行会认为这些错误是样式元素。任何写作者都可以(也应该)使用它,一个 prose linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。 -[Proselint][12]是一款全能的实时检查工具。它会找出行话,大话,不正确日期和时间格式,滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。 +[Proselint][12] 是一款全能的实时检查工具。它会找出行话,大话,不正确日期和时间格式,滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。 -[Alex][14] 是一个简单但有用的 prose linter。 对明文文本或者格式为Markdown或HTML的文档使用它。 Alex 会对 “性别偏好,极端主义,种族相关,宗教,或者文章中其他不平等的措辞” 产生警告。 如果你想要试试看 Alex,这里有一个在线[demo][15]. +[Alex][14] 是一个简单但有用的 prose linter。 对明文文本或者格式为 Markdown 或 HTML 的文档使用它。Alex 会对“性别偏好,极端主义,种族相关,宗教,或者文章中其他不平等的措辞”产生警告。如果你想要试试看 Alex,这里有一个在线 [demo][15]。 ### 其他工具 -有时候你找不到一个单词的恰当的同义词。但你不需要去呆板的词库中抓取或者去专门的网站完善你的单词完整。仅仅需要对你想要替换的单词运行[Aiksaurus][16],然后它就会为你完成这个工作。但是,这个程序最大的缺点是它只支持英语。 +有时候你找不到一个单词的恰当的同义词。但你不需要去呆板的词库中抓取或者去专门的网站完善你的单词完整。仅仅需要对你想要替换的单词运行 [Aiksaurus][16],然后它就会为你完成这个工作。但是,这个程序最大的缺点是它只支持英语。 -即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用Markdown格式的文件转换成其他格式。这就是[Pandoc][18]的用武之地。你可以用它来将你的文档转换成 HTML, Word, LibreOffice Writer, LaTeX, EPUB以及其他格式。你甚至可以用Pandoc来生成书籍和[研究论文][19]。 +即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用 Markdown 格式的文件转换成其他格式。这就是 [Pandoc][18] 的用武之地。你可以用它来将你的文档转换成 HTML,Word,LibreOffice Writer,LaTeX,EPUB 以及其他格式。你甚至可以用 Pandoc 来生成书籍和[研究论文][19]。 -你有一个最喜欢的命令行写作工具吗?在Opensource.com社区发表评论分享它。 +你有最喜欢的命令行写作工具吗?在 Opensource.com 社区发表评论分享它吧。 -------------------------------------------------------------------------------- From 6f8d06190e07799f7ca0db0ff87587a3ff4de123 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 13 Dec 2018 16:34:57 +0800 Subject: [PATCH 0839/1143] PRF:20180208 Gathering project requirements using the Open Decision Framework.md @geekpi --- ...t requirements using the Open Decision Framework.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md b/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md index ea4dced8f8..41416d110a 100644 --- a/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md +++ b/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md @@ -1,9 +1,11 @@ -使用开放决策框架收集项目需求 +降低项目失败率的三个原则 ====== +> 透明和包容性的项目要求可以降低您的失败率。 以下是如何协作收集它们。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/suitcase_container_bag.png?itok=q40lKCBY) -众所周知,明确、简洁和可衡量的需求会带来更多成功的项目。一项关于[麦肯锡与牛津大学][1]的大型项目的研究表明:“平均而言,大型 IT 项目超出预算 45%,时间每推移 7%,价值就比预期低 56% “。该研究还表明,造成这种失败的一些原因是“模糊的业务目标,不同步的利益相关者以及过度的返工”。 +众所周知,明确、简洁和可衡量的需求会带来更多成功的项目。一项[麦肯锡与牛津大学][1]的关于大型项目的研究表明:“平均而言,大型 IT 项目超出预算 45%,时间每推移 7%,价值就比预期低 56% 。”该研究还表明,造成这种失败的一些原因是“模糊的业务目标,不同步的利益相关者以及过度的返工。” 业务分析师经常发现自己通过持续对话来构建这些需求。为此,他们必须吸引多个利益相关方,并确保参与者提供明确的业务目标。这样可以减少返工,提高更多项目的成功率。 @@ -29,7 +31,7 @@ via: https://opensource.com/open-organization/18/2/constructing-project-requirem 作者:[Tracy Buckner][a] 译者:[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/) 荣誉推出 @@ -37,4 +39,4 @@ via: https://opensource.com/open-organization/18/2/constructing-project-requirem [1]:http://calleam.com/WTPF/?page_id=1445 [2]:https://opensource.com/open-organization/resources/open-decision-framework [3]:https://opensource.com/open-organization/resources/open-org-definition -[4]:https://opensource.com/open-organization/16/6/introducing-open-decision-framework \ No newline at end of file +[4]:https://opensource.com/open-organization/16/6/introducing-open-decision-framework From 03eca5c9fb7de3093425aa711039bc7fb3980c48 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 13 Dec 2018 16:35:15 +0800 Subject: [PATCH 0840/1143] PUB:20180208 Gathering project requirements using the Open Decision Framework.md @geekpi https://linux.cn/article-10341-1.html --- ...ring project requirements using the Open Decision Framework.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180208 Gathering project requirements using the Open Decision Framework.md (100%) diff --git a/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md b/published/20180208 Gathering project requirements using the Open Decision Framework.md similarity index 100% rename from translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md rename to published/20180208 Gathering project requirements using the Open Decision Framework.md From 92e61ae3bd4c223039482f569b01f822e6bd8cce Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Thu, 13 Dec 2018 16:59:36 +0800 Subject: [PATCH 0841/1143] Delete 20181119 7 command-line tools for writers - Opensource.com.md --- ...line tools for writers - Opensource.com.md | 75 ------------------- 1 file changed, 75 deletions(-) delete mode 100644 sources/tech/20181119 7 command-line tools for writers - Opensource.com.md diff --git a/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md b/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md deleted file mode 100644 index a222389079..0000000000 --- a/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md +++ /dev/null @@ -1,75 +0,0 @@ -Translating by LazyWolfLin - -7 command-line tools for writers | Opensource.com -====== -Put away your word processor and start writing from the command line using these open source tools. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE) - -For most people (especially non-techies), the act of writing means tapping out words using LibreOffice Writer or another GUI word processing application. But there are many other options available to help anyone communicate their message in writing, especially for the growing number of writers [embracing plaintext][1]. - -There's also room in a GUI writer's world for command line tools that can help them write, check their writing, and more—regardless of whether they're banging out an article, blog post, or story; writing a README; or prepping technical documentation. - -Here's a look at some command-line tools that any writer will find useful. - -### Editors - -Yes, you _can_ do actual writing at the command line. I know writers who do their work using editors like [Nano][2], [Vim][3], [Emacs][4], and [Jove][5] in a terminal window. And those editors [aren't the only games in town][6]. Text editors are great because they (at a basic level, anyway) are easy to use and distraction free. They're perfect for tapping out a first draft of anything or even completing a long and complicated writing project. - -If you want a more word processor-like experience at the command line, take a look at [WordGrinder][7] . WordGrinder is a bare-bones word processor, but it has more than enough features for writing and publishing your work. It supports basic formatting and styles, and you can export your writing to formats like Markdown, ODT, LaTeX, and HTML. - -### Spell checkers - -Every writer does (or at least should do) a spelling check on their work at least once. Why? An immutable law of the writing universe states that, no matter how many times you look over your manuscript, a spelling mistake or typo will creep in. - -My favorite command-line spelling checker is [GNU Aspell][8], which I previously [looked at][9] in detail. Aspell checks plaintext documents interactively and not only highlights errors but often puts the best correction at the top of its list of suggestions. Aspell also ignores many markup languages while doing its thing. - -A much older but still useful alternative is [Ispell][10]. It's a bit slower than Aspell, but both utilities work the same way. As you interact with your text file, Ispell suggests corrections. Ispell also has good support for foreign languages. - -### Prose linters - -Software developers use [linters][11] to check their code for errors or bugs. There are also linters for prose that check for style and syntax errors; think of them as the _Elements of Style_ for the command line. While any writer can (and probably should) use one, a prose linter is especially useful for team documentation projects that require a consistent voice and style. - -[Proselint][12] is a comprehensive tool for checking what you're writing. It looks for jargon, hyperbole, incorrect date and time format, misused terms, and [much more][13]. It's also easy to run and ignores markup in a plaintext file. - -[Alex][14] is a simple yet powerful prose linter. Run it against a plaintext document or one formatted with Markdown or HTML. Alex pumps out warnings of "gender favouring, polarising, race related, religion inconsiderate, or other unequal phrasing in text." If you want to give Alex a test drive, there's an [online demo][15]. - -### Other tools - -Sometimes you just can't find the right synonym for a word. But you don't need to grab a "dead tree" thesaurus or go to a dedicated website to perfect your word choice. Just run [Aiksaurus][16] against the word you want to replace, and it does the work for you. This utility's main drawback, though, is that it supports English only. - -Even writers with few (if any) technical skills are embracing [Markdown][17] to quickly and easily format their work. Sometimes, though, you need to convert files formatted with Markdown to something else. That's where [Pandoc][18] comes in. You can use it to convert your documents to HTML, Word, LibreOffice Writer, LaTeX, EPUB, and other formats. You can even use Pandoc to produce books and [research papers][19]. - -Do you have a favorite command-line tool for writing? Share it with the Opensource.com community by leaving a comment. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/11/command-line-tools-writers - -作者:[Scott Nesbitt][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://plaintextproject.online -[2]: https://www.nano-editor.org/ -[3]: https://www.vim.org -[4]: https://www.gnu.org/software/emacs/ -[5]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim -[6]: https://en.wikipedia.org/wiki/List_of_text_editors#Text_user_interface -[7]: https://cowlark.com/wordgrinder/ -[8]: http://aspell.net/ -[9]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell -[10]: https://www.cs.hmc.edu/~geoff/ispell.html -[11]: https://en.wikipedia.org/wiki/Lint_(software) -[12]: http://proselint.com/ -[13]: http://proselint.com/checks/ -[14]: https://github.com/get-alex/alex -[15]: https://alexjs.com/#demo -[16]: http://aiksaurus.sourceforge.net/ -[17]: https://en.wikipedia.org/wiki/Markdown -[18]: https://pandoc.org -[19]: https://opensource.com/article/18/9/pandoc-research-paper From 29a89180632d396f32dfc9fcc217e19ceca64146 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Thu, 13 Dec 2018 21:54:51 +0800 Subject: [PATCH 0842/1143] Translated by qhwdw --- ...Know Your Storage- Block, File - Object.md | 63 ------------------- ...Know Your Storage- Block, File - Object.md | 60 ++++++++++++++++++ 2 files changed, 60 insertions(+), 63 deletions(-) delete mode 100644 sources/tech/20180911 Know Your Storage- Block, File - Object.md create mode 100644 translated/tech/20180911 Know Your Storage- Block, File - Object.md diff --git a/sources/tech/20180911 Know Your Storage- Block, File - Object.md b/sources/tech/20180911 Know Your Storage- Block, File - Object.md deleted file mode 100644 index 0b7c2cc338..0000000000 --- a/sources/tech/20180911 Know Your Storage- Block, File - Object.md +++ /dev/null @@ -1,63 +0,0 @@ -Translating by qhwdw -Know Your Storage: Block, File & Object -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/block2_1920.jpg?itok=s1y6RLhT) - -Dealing with the tremendous amount of data generated today presents a big challenge for companies who create or consume such data. It’s a challenge for tech companies that are dealing with related storage issues. - -“Data is growing exponentially each year, and we find that the majority of data growth is due to increased consumption and industries adopting transformational projects to expand value. Certainly, the Internet of Things (IoT) has contributed greatly to data growth, but the key challenge for software-defined storage is how to address the use cases associated with data growth,” said Michael St. Jean, principal product marketing manager, Red Hat Storage. - -Every challenge is an opportunity. “The deluge of data being generated by old and new sources today is certainly presenting us with opportunities to meet our customers escalating needs in the areas of scale, performance, resiliency, and governance,” said Tad Brockway, General Manager for Azure Storage, Media and Edge. - -### Trinity of modern software-defined storage - -There are three different kinds of storage solutions -- block, file, and object -- each serving a different purpose while working with the others. - -Block storage is the oldest form of data storage, where data is stored in fixed-length blocks or chunks of data. Block storage is used in enterprise storage environments and usually is accessed using Fibre Channel or iSCSI interface. “Block storage requires an application to map where the data is stored on the storage device,” according to SUSE’s Larry Morris, Sr. Product Manager, Software Defined Storage. - -Block storage is virtualized in storage area network and software defined storage systems, which are abstracted logical devices that reside on a shared hardware infrastructure and are created and presented to the host operating system of a server, virtual server, or hypervisor via protocols like SCSI, SATA, SAS, FCP, FCoE, or iSCSI. - -“Block storage splits a single storage volume (like a virtual or cloud storage node, or a good old fashioned hard disk) into individual instances known as blocks,” said St. Jean. - -Each block exists independently and can be formatted with its own data transfer protocol and operating system — giving users complete configuration autonomy. Because block storage systems aren’t burdened with the same investigative file-finding duties as the file storage systems, block storage is a faster storage system. Pairing that speed with configuration flexibility makes block storage ideal for raw server storage or rich media databases. - -Block storage can be used to host operating systems, applications, databases, entire virtual machines and containers. Traditionally, block storage can only be accessed by individual machine, or machines in a cluster, to which it has been presented. - -### File-based storage - -File-based storage uses a filesystem to map where the data is stored on the storage device. It’s a dominant technology used on direct- and networked-attached storage system, and it takes care of two things: organizing data and representing it to users. “With file storage, data is arranged on the server side in the exact same format as the clients see it. This allows the user to request a file by some unique identifier — like a name, location, or URL — which is communicated to the storage system using specific data transfer protocols,” said St. Jean. - -The result is a type of hierarchical file structure that can be navigated from top to bottom. File storage is layered on top of block storage, allowing users to see and access data as files and folders, but restricting access to the blocks that stand up those files and folders. - -“File storage is typically represented by shared filesystems like NFS and CIFS/SMB that can be accessed by many servers over an IP network. Access can be controlled at a file, directory, and export level via user and group permissions. File storage can be used to store files needed by multiple users and machines, application binaries, databases, virtual machines, and can be used by containers,” explained Brockway. - -### Object storage - -Object storage is the newest form of data storage, and it provides a repository for unstructured data which separates the content from the indexing and allows the concatenation of multiple files into an object. An object is a piece of data paired with any associated metadata that provides context about the bytes contained within the object (things like how old or big the data is). Those two things together — the data and metadata — make an object. - -One advantage of object storage is the unique identifier associated with each piece of data. Accessing the data involves using the unique identifier and does not require the application or user to know where the data is actually stored. Object data is accessed through APIs. - -“The data stored in objects is uncompressed and unencrypted, and the objects themselves are arranged in object stores (a central repository filled with many other objects) or containers (a package that contains all of the files an application needs to run). Objects, object stores, and containers are very flat in nature — compared to the hierarchical structure of file storage systems — which allow them to be accessed very quickly at huge scale,” explained St. Jean. - -Object stores can scale to many petabytes to accommodate the largest datasets and are a great choice for images, audio, video, logs, backups, and data used by analytics services. - -### Conclusion - -Now you know about the various types of storage and how they are used. Stay tuned to learn more about software-defined storage as we examine the topic in the future. - -Join us at [Open Source Summit + Embedded Linux Conference Europe][1] in Edinburgh, UK on October 22-24, 2018, for 100+ sessions on Linux, Cloud, Containers, AI, Community, and more. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/2018/9/know-your-storage-block-file-object - -作者:[Swapnil Bhartiya][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/arnieswap -[1]: https://events.linuxfoundation.org/events/elc-openiot-europe-2018/ diff --git a/translated/tech/20180911 Know Your Storage- Block, File - Object.md b/translated/tech/20180911 Know Your Storage- Block, File - Object.md new file mode 100644 index 0000000000..3dc77ad8e3 --- /dev/null +++ b/translated/tech/20180911 Know Your Storage- Block, File - Object.md @@ -0,0 +1,60 @@ +认识存储:块、文件和对象 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/block2_1920.jpg?itok=s1y6RLhT) + +现在,对于那些创建或消费数据的公司来说,处理生成的数量巨大的数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。 + + Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“ + +任何挑战都意味着机遇。Azure 存储、介质和边缘总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。” + +### 现代软件定义存储的三种类型 + +这里有三个不同类型的存储解决方案 — 块、文件、和对象 — 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。 + +块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置”。 + +块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,它创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。 + +St. Jean 说“块存储将单个的存储卷(像一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。“ + +每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 — 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。 + +块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器、或集群中呈现出的机器访问。 + +### 基于文件的存储 + +基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直接或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。 St. Jean 说,”使用文件存储时,数据在服务器侧的排列格式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。 + +最终成为了一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是限制访问处于这些文件和文件夹之下的数据块。 + +Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录、和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“ + +### 对象存储 + +对象存储是最新的数据存储形式,它为非结构化数据提供一个库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 — 数据和元数据 — 构成了一个对象。 + +对象存储的一个好处是每个数据块都关联了一个唯一标识符。访问数据需要唯一标识符,并且不需要应用程序或用户知道数据的真实存储位置。对象数据是通过 API 来访问的。 + +St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被安排在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 — 这使得它们在存储规模巨大时访问速度很快。” + +对象存储可以扩展到很多 PB 字节大小,以适应巨大的数据集,因此它是图像、音频、视频、日志、备份、和分析服务所使用的数据存储的最佳选择。 + +### 结论 + +现在你已经知道了各种类型的存储以及它们的用处。后面我们将继续研究这个主题的更多内容,敬请关注。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/2018/9/know-your-storage-block-file-object + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/arnieswap +[1]: https://events.linuxfoundation.org/events/elc-openiot-europe-2018/ From 690b6cc853497a5357a66e229d78746c99b63988 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 13 Dec 2018 22:12:13 +0800 Subject: [PATCH 0843/1143] PRF:20180422 Command Line Tricks For Data Scientists - kade killary.md @GraveAccent --- ...icks For Data Scientists - kade killary.md | 266 +++++++++--------- 1 file changed, 140 insertions(+), 126 deletions(-) diff --git a/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md b/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md index a02057f65a..e4190cf7dd 100644 --- a/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md +++ b/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md @@ -3,30 +3,29 @@ ![](https://i.imgur.com/0mzQMcB.png) -对于许多数据科学家来说,数据操作始于和结束于 Pandas 或 Tidyverse。从理论上讲,这样做没有任何问题。毕竟,这就是这些工具存在的原因。然而,对于像分隔符转换这样的简单任务,这些工具是大材小用了。 +对于许多数据科学家来说,数据操作从始至终就是 Pandas 或 Tidyverse。从理论上讲,这样做没有任何问题。毕竟,这就是这些工具存在的原因。然而,对于像分隔符转换这样的简单任务,这些工具是大材小用了。 -立志掌握命令行应该在每个开发人员的清单上,特别是数据科学家。学习 shell 的来龙去脉将无可否认地提高你的生产力。除此之外,命令行还是计算领域的一个重要历史课程。例如,awk - 一种数据驱动的脚本语言。1977年,在传奇的 [K&R 书][2]中 K 即 [Brain Kernighan][1] 的帮助下,Awk 首次出现。今天,大约五十年过去了,awk 仍然和每年出现的[新书][3]相关。因此,可以安全地假设对命令行魔法的投资不会很快贬值。 +立志掌握命令行应该在每个开发人员的学习清单上,特别是数据科学家。学习 shell 的来龙去脉将无可否认地提高你的生产力。除此之外,命令行还是计算领域的一个重要历史课程。例如,awk —— 一种数据驱动的脚本语言。1977 年,在 [Brain Kernighan][1](即传奇的 [K&R 书][2]中 K)的帮助下,awk 首次出现。今天,大约五十年过去了,awk 仍然活跃在每年[新出版的书][3]里面。因此,可以安全地假设对命令行魔法的付出不会很快贬值。 ### 我们将涵盖什么 - * ICONV - * HEAD - * TR - * WC - * SPLIT - * SORT & UNIQ - * CUT - * PASTE - * JOIN - * GREP - * SED - * AWK - - +* ICONV +* HEAD +* TR +* WC +* SPLIT +* SORT & UNIQ +* CUT +* PASTE +* JOIN +* GREP +* SED +* AWK ### ICONV -文件编码可能会很棘手。现在大部分文件都是 UTF-8 编码的。要了解 UTF-8 背后的一些魔力,请查看这个出色的[视频][4]。尽管如此,有时我们收到的文件不是这种格式。这可能引起对改变编码模式的一些不靠谱尝试。这里,iconv 是一个拯救者。Iconv 是一个简单的程序,它将获取采用一种编码的文本并输出采用另一种编码的文本。 +文件编码可能会很棘手。现在大部分文件都是 UTF-8 编码的。要了解 UTF-8 背后的一些魔力,请查看这个出色的[视频][4]。尽管如此,有时我们收到的文件不是这种编码。这可能引起对改变编码模式的一些胡乱尝试。这里,`iconv` 是一个拯救者。`iconv` 是一个简单的程序,它将获取采用一种编码的文本并输出采用另一种编码的文本。 + ``` # Converting -f (from) latin1 (ISO-8859-1) # -t (to) standard UTF_8 @@ -34,16 +33,15 @@ iconv -f ISO-8859-1 -t UTF-8 < input.txt > output.txt ``` - * 实用选项: - - * `iconv -l` 列出所有已知编码 - * `iconv -c` 默默丢弃无法转换的字符 - +实用选项: +* `iconv -l` 列出所有已知编码 +* `iconv -c` 默默丢弃无法转换的字符 ### HEAD -如果你是一个频繁的 Pandas 用户,那么会很熟悉 `head`。通常在处理新数据时,我们想做的第一件事就是了解其内容。这导致启动 Pandas,读取数据然后调用 `df.head()` \- 这至少是费劲的。没有任何标志的 Head 将打印出文件的前10行。`head` 的真正力量在于测试出来干净利落的操作。例如,如果我们想将文件的分隔符从逗号更改为管道。一个快速测试将是:`head mydata.csv | sed 's/,/|/g'`。 +如果你是一个 Pandas 重度用户,那么会很熟悉 `head`。通常在处理新数据时,我们想做的第一件事就是了解其内容。这就得启动 Pandas,读取数据然后调用 `df.head()` —— 要说这有点费劲。没有任何选项的 `head` 将打印出文件的前 10 行。`head` 的真正力量在于干净利落的测试操作。例如,如果我们想将文件的分隔符从逗号更改为管道。一个快速测试将是:`head mydata.csv | sed 's/,/|/g'`。 + ```bash # Prints out first 10 lines head filename.csv @@ -52,63 +50,61 @@ head filename.csv head -n 3 filename.csv ``` - * 实用选项: - - * `head -n` 打印特定行数 - * `head -c` 打印具体的字节数 - +实用选项: +* `head -n` 打印特定行数 +* `head -c` 打印特定字节数 ### TR -Tr 类似于翻译。这个功能强大的实用程序是基本文件清理的主力。理想的用例是交换文件中的分隔符。 +`tr` 类似于翻译。这个功能强大的实用程序是文件基础清理的主力。理想的用例是替换文件中的分隔符。 + ```bash # Converting a tab delimited file into commas cat tab_delimited.txt | tr "\t" "," comma_delimited.csv ``` -`tr` 另一个功能是在你支配中的内建 `[:class:]` 变量(POSIX 字符类)。这些包括了: +`tr` 另一个功能是你可以用内建 `[:class:]` 变量(POSIX 字符类)发挥威力。这些包括了: -``` -[:alnum:] all letters and digits -[:alpha:] all letters -[:blank:] all horizontal whitespace -[:cntrl:] all control characters -[:digit:] all digits -[:graph:] all printable characters, not including space -[:lower:] all lower case letters -[:print:] all printable characters, including space -[:punct:] all punctuation characters -[:space:] all horizontal or vertical whitespace -[:upper:] all upper case letters -[:xdigit:] all hexadecimal digits -``` +- `[:alnum:]` 所有字母和数字 +- `[:alpha:]` 所有字母 +- `[:blank:]` 所有水平空白 +- `[:cntrl:]` 所有控制字符 +- `[:digit:]` 所有数字 +- `[:graph:]` 所有可打印字符,但不包括空格 +- `[:lower:]` 所有小写字母 +- `[:print:]` 所有可打印字符,包括空格 +- `[:punct:]` 所有标点符号 +- `[:space:]` 所有水平或垂直空白 +- `[:upper:]` 所有大写字母 +- `[:xdigit:]` 所有 16 进制数字 + +你可以将这些连接在一起以组成强大的程序。以下是一个基本的字数统计程序,可用于检查 README 是否被滥用。 -你可以将这些连接在一起以组成强大的程序。以下是一个基本的字数统计程序,可用于检查自述文件是否过度使用。 ``` cat README.md | tr "[:punct:][:space:]" "\n" | tr "[:upper:]" "[:lower:]" | grep . | sort | uniq -c | sort -nr ``` 另一个使用基本正则表达式的例子: + ``` # Converting all upper case letters to lower case cat filename.csv | tr '[A-Z]' '[a-z]' ``` - * 实用选项: - - * `tr -d` 删除字符 - * `tr -s` 压缩字符 - * `\b` 退格 - * `\f` 换页 - * `\v` 垂直制表符 - * `\NNN` 八进制字符 - +实用选项: +* `tr -d` 删除字符 +* `tr -s` 压缩字符 +* `\b` 退格 +* `\f` 换页 +* `\v` 垂直制表符 +* `\NNN` 八进制字符 ### WC -单词数量。它的值主要来自 `-l` 标志,它会给你提供行数。 +单词计数。它的价值主要来自其 `-l` 选项,它会给你提供行数。 + ``` # Will return number of lines in CSV wc -l gigantic_comma.csv @@ -116,18 +112,17 @@ wc -l gigantic_comma.csv 这个工具可以方便地确认各种命令的输出。所以,如果我们在转换文件中的分隔符之后运行 `wc -l`,我们会期待总行数是一样的,如果不一致,我们就知道有地方出错了。 - * 实用选项: - - * `wc -c` 打印字节数 - * `wc -m` 打印字符数 - * `wc -L` 打印最长行的长度 - * `wc -w` 打印单词数量 - +实用选项: +* `wc -c` 打印字节数 +* `wc -m` 打印字符数 +* `wc -L` 打印最长行的长度 +* `wc -w` 打印单词数量 ### SPLIT -文件大小的范围可以很广。取决于任务,拆分文件可以是有益的,所以使用 `split` 吧。split的基本语法是: +文件大小的范围可以很广。对于有的任务,拆分文件或许是有好处的,所以使用 `split` 吧。`split` 的基本语法是: + ```bash # We will split our CSV into new_filename every 500 lines split -l 500 filename.csv new_filename_ @@ -138,7 +133,8 @@ split -l 500 filename.csv new_filename_ # new_filename_aa ``` -两个奇怪的地方是命名约定和缺少文件扩展名。后缀约定可以通过 `-d` 标志变为数字。要添加文件扩展名,你需要运行以下 `find` 命令。它将通过附加 `.csv`更改当前目录中所有文件的名称,所以小心了。 +它有两个奇怪的地方是命名约定和缺少文件扩展名。后缀约定可以通过 `-d` 标志变为数字。要添加文件扩展名,你需要运行以下 `find` 命令。它将通过附加 `.csv` 扩展名来更改当前目录中所有文件的名称,所以小心了。 + ```bash find . -type f -exec mv '{}' '{}'.csv \; # ls output @@ -148,19 +144,18 @@ find . -type f -exec mv '{}' '{}'.csv \; # new_filename_aac.csv ``` - * 实用选项: - - * `split -b` 按特定字节大小分割 - * `split -a` 生成长度为 N 的后缀 - * `split -x` 使用十六进制后缀分割 - +实用选项: +* `split -b N` 按特定字节大小分割 +* `split -a N` 生成长度为 N 的后缀 +* `split -x` 使用十六进制后缀 ### SORT & UNIQ -以上两个命令很明显:他们的作用就是字面意思。这两者结合起来可以提供最强大的冲击 (i.e. 单独单词数量)。这是由于 `uniq` 只作用于重复的相邻行。这也是在输出前 `sort` 的原因。一个有趣的纪录是 `sort -u` 会达到和典型的 `sort file.txt | uniq` 模式一样的结果。 +上面两个命令很明显:它们的作用就是字面意思。这两者结合起来可以提供最强大的冲击 (例如,唯一单词的数量)。这是由于 `uniq` 只作用于重复的相邻行。这也是在输出前进行 `sort` 的原因。一个有趣的事情是 `sort -u` 会达到和典型的 `sort file.txt | uniq` 模式一样的结果。 + +`sort` 对数据科学家来说确实具有潜在的有用能力:能够根据特定列对整个 CSV 进行排序。 -Sort 对数据科学家来说确实具有潜在的有用能力:能够根据特定列对整个 CSV 进行排序。 ```bash # Sorting a CSV file by the second column alphabetically sort -t"," -k2,2 filename.csv @@ -172,37 +167,39 @@ sort -t"," -k2n,2 filename.csv sort -t"," -k2nr,2 filename.csv ``` -这里的 `-t` 选项将逗号指定为分隔符。通常假设分隔符是空格或制表符。此外,`-k` 标志是为了确定我们的 key。这里的语法是 `-km,n`,`m` 作为开始列,`n` 作为结束列。 - - * 实用选项: - - * `sort -f` 忽略大小写 - * `sort -r` 反向排序 - * `sort -R` 乱序 - * `uniq -c` 统计出现次数 - * `uniq -d` 只打印重复行 +这里的 `-t` 选项将逗号指定为分隔符,通常假设分隔符是空格或制表符。此外,`-k` 选项是为了确定我们的键。这里的语法是 `-km,n`,`m` 作为开始列,`n` 作为结束列。 +实用选项: +* `sort -f` 忽略大小写 +* `sort -r` 反向排序 +* `sort -R` 乱序 +* `uniq -c` 统计出现次数 +* `uniq -d` 只打印重复行 ### CUT -Cut 用于删除列。为了演示,如果我们只想删除第一和第三列。 +`cut` 用于删除列。作为演示,如果我们只想删除第一和第三列。 + ```bash cut -d, -f 1,3 filename.csv ``` -选择除了第一行外的所有行。 +要选择除了第一行外的所有行。 + ```bash cut -d, -f 2- filename.csv ``` -结合其他命令,将`cut` 用作过滤器。 +结合其他命令,将 `cut` 用作过滤器。 + ```bash # Print first 10 lines of column 1 and 3, where "some_string_value" is present head filename.csv | grep "some_string_value" | cut -d, -f 1,3 ``` 查出第二列中唯一值的数量。 + ```bash cat filename.csv | cut -d, -f 2 | sort | uniq | wc -l @@ -212,7 +209,8 @@ cat filename.csv | cut -d, -f 2 | sort | uniq -c | head ### PASTE -Paste 是一个带有趣味性功能的粘贴命令。如果你有两个需要合并的文件,并且它们已经排序了,`paste` 帮你解决了接下来的步骤。 +`paste` 是一个带有趣味性功能的特定命令。如果你有两个需要合并的文件,并且它们已经排序好了,`paste` 帮你解决了接下来的步骤。 + ```bash # names.txt adam @@ -233,37 +231,38 @@ john,youtuber zach,developer ``` -查看更多 SQL_-esque 变种,见下文。 +更多 SQL 式变种,见下文。 ### JOIN -Join 是一个简单准切向的 SQL。最大的区别是 `join` 将返回所有列以及只能在一个字段上匹配。默认情况下,`join` 将尝试使用第一列作为匹配键。为了获得不同结果,必须使用以下语法: +`join` 是一个简单的、准切向的quasi-tangential SQL。最大的区别是 `join` 将返回所有列以及只能在一个字段上匹配。默认情况下,`join` 将尝试使用第一列作为匹配键。为了获得不同结果,必须使用以下语法: + ```bash # Join the first file (-1) by the second column # and the second file (-2) by the first join -t "," -1 2 -2 1 first_file.txt second_file.txt ``` -标准的 join 是内连接。然而,外连接通过 `-a` 标志也是可行的。另一个值得一提的技巧是 `-q` 标志,如果发现有缺失的字段,可用于替换值。 +标准的 `join` 是内连接。然而,外连接通过 `-a` 选项也是可行的。另一个值得一提的技巧是 `-q` 标志,如果发现有缺失的字段,可用于替换值。 + ```bash # Outer join, replace blanks with NULL in columns 1 and 2 # -o which fields to substitute - 0 is key, 1.1 is first column, etc... join -t"," -1 2 -a 1 -a2 -e ' NULL' -o '0,1.1,2.2' first_file.txt second_file.txt ``` -不是最用户友好的命令,而是绝望时刻的绝望措施。 - - * 实用选项: - - * `join -a` 打印不可配对的行 - * `join -e` 替换丢失的输入字段 - * `join -j` 相当于 `-1 FIELD -2 FIELD` +它不是最用户友好的命令,而是绝望时刻的绝望措施。 +实用选项: +* `join -a` 打印不可配对的行 +* `join -e` 替换丢失的输入字段 +* `join -j` 相当于 `-1 FIELD -2 FIELD` ### GREP -用正则表达式全局搜索并且打印,或者 `grep`,可能是最有名的命令并且有充分的理由。Grep 很强大,特别适合在大型代码库中找到路径。在数据科学的王国里,它充当其他命令的提炼机制。虽然它的标准用途也很有价值。 +`grep` 即 用正则表达式全局搜索并且打印Global search for a Regular Expression and Print,可能是最有名的命令,并且名副其实。`grep` 很强大,特别适合在大型代码库中查找。在数据科学的王国里,它充当其他命令的提炼机制。虽然它的标准用途也很有价值。 + ``` # Recursively search and list all files in directory containing 'word' @@ -276,6 +275,7 @@ grep -lr 'word' . | wc -l ``` 计算包含单词或模式的总行数。 + ``` grep -c 'some_value' filename.csv @@ -284,39 +284,40 @@ grep -c 'some_value' filename.csv grep -c 'some_value' * ``` -使用 or 运算符 - `\|` 为多个值 Grep。 +对多个值使用“或”运算符: `\|`。 + ``` grep "first_value\|second_value" filename.csv ``` - * 实用选项: - - * `alias grep="grep --color=auto"` 使 grep 丰富多彩 - * `grep -E` 使用扩展的 regexp - * `grep -w` 只匹配整个单词 - * `grep -l` 打印匹配的文件名 - * `grep -v` 倒置匹配 - +实用选项: +* `alias grep="grep --color=auto"` 使 grep 色彩丰富 +* `grep -E` 使用扩展正则表达式 +* `grep -w` 只匹配整个单词 +* `grep -l` 打印匹配的文件名 +* `grep -v` 非匹配 ### 大人物们 -Sed 和 Awk 是本文中最强大的两个命令。为简介起见,我不打算详细讨论这两个命令。相反,我将介绍各种能证明其令人印象深刻的力量的命令。如果你想了解更多,[这儿就有一本书][5]是关于它们的。 +`sed` 和 `awk` 是本文中最强大的两个命令。为简洁起见,我不打算详细讨论这两个命令。相反,我将介绍各种能证明其令人印象深刻的力量的命令。如果你想了解更多,[这儿就有一本书][5]是关于它们的。 ### SED `sed` 本质上是一个流编辑器。它擅长替换,但也可以用于所有输出重构。 -最基本的 `sed` 命令由 `s/old/new/g` 组成。这转换为搜索旧值,全局替换为新值。 如果没有 `/g`,我们的命令将在旧值第一次出现后终止。 +最基本的 `sed` 命令由 `s/old/new/g` 组成。它的意思是搜索 `old`,全局替换为 `new`。 如果没有 `/g`,我们的命令将在 `old` 第一次出现后终止。 + +为了快速了解它的功能,我们可以深入了解一个例子。 在以下情景中,你已有以下文件: -为了快速了解它的功能,我们可以深入了解一个例子。 在以下情景中,你已获得以下文件: ``` balance,name $1,000,john $2,000,jack ``` -我们可能想要做的第一件事是删除美元符号。`-i` 标志表示原位。`''` 表示零长度文件扩展名,从而覆盖我们的初始文件。理想情况下,你可以单独测试每个,然后输出到新文件。 +我们可能想要做的第一件事是删除美元符号。`-i` 标志表示原位。`''` 表示零长度文件扩展名,从而覆盖我们的初始文件。理想情况下,你可以单独测试,然后输出到新文件。 + ``` sed -i '' 's/\$//g' data.txt # balance,name @@ -324,7 +325,8 @@ sed -i '' 's/\$//g' data.txt # 2,000,jack ``` -接下来, `blance` 列的逗号。 +接下来,去除 `blance` 列的逗号。 + ``` sed -i '' 's/\([0-9]\),\([0-9]\)/\1\2/g' data.txt # balance,name @@ -332,7 +334,8 @@ sed -i '' 's/\([0-9]\),\([0-9]\)/\1\2/g' data.txt # 2000,jack ``` -最后杰克有一天决定退出。所以,再见了,我的朋友。 +最后 jack 有一天决定辞职。所以,再见了,我的朋友。 + ``` sed -i '' '/jack/d' data.txt # balance,name @@ -343,33 +346,35 @@ sed -i '' '/jack/d' data.txt ### AWK -最好的留在最后。Awk 不仅仅是一个简单的命令:它是一个成熟的语言。在本文中涉及的所有内容中,`awk` 是目前为止最酷的。如果你发现自己对其印象深刻,这里有很多很棒的资源 - 看 [这里][6], [这里][7] 和 [这里][8]。 +最好的留在最后。`awk` 不仅仅是一个简单的命令:它是一个成熟的语言。在本文中涉及的所有内容中,`awk` 是目前为止最酷的。如果你感兴趣,这里有很多很棒的资源 —— 看 [这里][6]、[这里][7] 和 [这里][8]。 `awk` 的常见用例包括: - * 文字处理 - * 格式化文本报告 - * 执行算术运算 - * 执行字符串操作 +* 文字处理 +* 格式化文本报告 +* 执行算术运算 +* 执行字符串操作 +`awk` 可以以最原生的形式并行 `grep`。 - -Awk 可以以最原生的形式并行 `grep`。 ``` awk '/word/' filename.csv ``` -或者更加神奇:将 `grep` 和 `cut` 组合起来。在这里,`awk` 打印第三和第四列,用 tab 分隔,对于所有带我们指定单词的行。`-F,` 只是改变我们的分隔符为逗号。 +或者更加神奇:将 `grep` 和 `cut` 组合起来。在这里,对于所有带我们指定单词 `word` 的行,`awk` 打印第三和第四列,用 `tab` 分隔。`-F,` 用于指定切分时的列分隔符为逗号。 + ```bash awk -F, '/word/ { print $3 "\t" $4 }' filename.csv ``` -Awk 内置了许多精巧的变量。比如,`NF` \- 字段数 - 和 `NR` \- 记录数。要获取文件中的第53条记录: +`awk` 内置了许多精巧的变量。比如,`NF` —— 字段数,和 `NR` —— 记录数。要获取文件中的第 53 条记录: + ```bash awk -F, 'NR == 53' filename.csv ``` -增加的代码是基于一个或多个值进行过滤的能力。下面的第一个示例将打印第一列等于给定字符串的记录的行号和列。 +更多的花招是其基于一个或多个值进行过滤的能力。下面的第一个示例将打印第一列等于给定字符串的行的行号和列。 + ```bash awk -F, ' $1 == "string" { print NR, $0 } ' filename.csv @@ -378,6 +383,7 @@ awk -F, ' $2 == 1000 { print NR, $0 } ' filename.csv ``` 多个数值表达式: + ```bash # Print line number and columns where column three greater # than 2005 and column five less than one thousand @@ -386,16 +392,19 @@ awk -F, ' $3 >= 2005 && $5 <= 1000 { print NR, $0 } ' filename.csv ``` 求出第三列的总和: + ```bash awk -F, '{ x+=$3 } END { print x }' filename.csv ``` -在第一列等于 “something”的那些行,求出第三列值的总和。 +在第一列等于 `something` 的那些行,求出第三列值的总和。 + ```bash awk -F, '$1 == "something" { x+=$3 } END { print x }' filename.csv ``` -获取文件的尺寸: +获取文件的行列数: + ```bash awk -F, 'END { print NF, NR }' filename.csv @@ -404,11 +413,13 @@ awk -F, 'BEGIN { print "COLUMNS", "ROWS" }; END { print NF, NR }' filename.csv ``` 打印出现了两次的行: + ```bash awk -F, '++seen[$0] == 2' filename.csv ``` 删除重复的行: + ```bash # Consecutive lines awk 'a !~ $0; {a=$0}'] @@ -421,16 +432,19 @@ awk '!($0 in a) {a[$0];print} ``` 使用内置函数 `gsub()` 替换多个值。 + ```bash awk '{gsub(/scarlet|ruby|puce/, "red"); print}' ``` 这个 `awk` 命令将组合多个 CSV 文件,忽略标题,然后在最后附加它。 + ```bash awk 'FNR==1 && NR!=1{next;}{print}' *.csv > final_file.csv ``` -需要缩小一个庞大的文件? `awk` 可以在 `sed` 的帮助下处理它。具体来说,该命令根据行数将一个大文件分成多个较小的文件。这个 one-liner 也将增加一个扩展。 +需要缩小一个庞大的文件? `awk` 可以在 `sed` 的帮助下处理它。具体来说,该命令根据行数将一个大文件分成多个较小的文件。这个一行脚本将增加一个扩展名。 + ```bash sed '1d;$d' filename.csv | awk 'NR%NUMBER_OF_LINES==1{x="filename-"++i".csv";}{print > x}' @@ -440,7 +454,7 @@ sed '1d;$d' big_data.csv | awk 'NR%100000==1{x="data_"++i".csv";}{print > x}' ### 结语 -命令行拥有无穷无尽的力量。本文中介绍的命令足以将你从一无所知提升到英雄人物。除了涵盖的内容之外,还有许多实用程序需要考虑用于日常数据操作。[Csvkit][9], [xsv][10] 还有 [q][11] 是需要记住的三个。如果你希望更深入地了解命令行数据科学,查看[这本书][12]。它也可以[免费][13]在线获得! +命令行拥有无穷无尽的力量。本文中介绍的命令足以将你从一无所知提升到英雄人物。除了涵盖的内容之外,还有许多实用程序可以考虑用于日常数据操作。[Csvkit][9]、[xsv][10] 还有 [q][11] 是需要记住的三个。如果你希望更深入地了解命令行数据科学,查看[这本书][12]。它也可以[免费][13]在线获得! -------------------------------------------------------------------------------- @@ -449,7 +463,7 @@ via: http://kadekillary.work/post/cli-4-ds/ 作者:[Kade Killary][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[GraveAccent](https://github.com/graveaccent) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f2ad49f85dc80284746c8fe2489e8b33a3cf55d7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 13 Dec 2018 22:12:43 +0800 Subject: [PATCH 0844/1143] PUB:20180422 Command Line Tricks For Data Scientists - kade killary.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @GraveAccent 翻译的不错 https://linux.cn/article-10342-1.html --- ...0422 Command Line Tricks For Data Scientists - kade killary.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180422 Command Line Tricks For Data Scientists - kade killary.md (100%) diff --git a/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md b/published/20180422 Command Line Tricks For Data Scientists - kade killary.md similarity index 100% rename from translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md rename to published/20180422 Command Line Tricks For Data Scientists - kade killary.md From 3e7ec97f2c434a2b52b04187dc5769bbbc4aa60d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 13 Dec 2018 22:43:57 +0800 Subject: [PATCH 0845/1143] PRF:20181119 7 command-line tools for writers - Opensource.com.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @LazyWolfLin 恭喜你,完成了第一篇翻译! --- ...line tools for writers - Opensource.com.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md index 2073fd9279..9d66c6a0fe 100644 --- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md +++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md @@ -1,11 +1,13 @@ -给写作者们的 7 个命令行工具 | Opensource.com +给写作者们的 7 个命令行工具 ====== -扔掉你的打字机,然后使用这些开源工具在命令行上写作吧。 + +> 扔掉你的文字编辑器,然后使用这些开源工具在命令行上写作吧。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE) -对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文本编辑器上编辑文本。但是还有许多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。 +对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文字处理应用上编辑文本。但是还有许多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。 -在使用图形界面写作的世界同样有命令行工具的一席之地。这些命令行工具可以帮助他们进行写作,检查他们的拼写等等——无论是在写一篇文章、博客或者故事;写一个 README 文件;或者准备一份技术文档的时候。 +在使用图形界面写作的世界同样有命令行工具的一席之地。这些命令行工具可以帮助他们进行写作,检查他们的拼写等等 —— 无论是在写一篇文章、博客或者故事;写一个 README 文件;或者准备一份技术文档的时候。 下面是一些在任何写作情况下都有用的命令行工具。 @@ -13,7 +15,7 @@ 没错,你可以在命令行进行真正的写作。我知道一些写作者会使用 [Nano][2]、[Vim][3]、[Emacs][4]、以及 [Jove][5] 等编辑器在终端窗口中进行工作。而这些编辑器[并非屈指可数][6]。文本编辑器的优势在于它们简单易用以及更专注于文本。非常适合用于编辑任何文本的初稿甚至完成一个漫长而复杂的写作项目。 -如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下 [WordGrinder][7]。WordGrinder 是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown,ODT,LaTeX,或者 HTML 等格式导出。 +如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下 [WordGrinder][7]。它是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown、ODT、LaTeX 或者 HTML 等格式导出。 ### 拼写检查 @@ -23,21 +25,21 @@ 另一个够老但仍然有用的代替品是 [Ispell][10]。虽然它比 Aspell 稍慢一点,但它们都以相同的方式工作。当你在你的文本文件上工作时,Ispell 将提供正确的建议。Ispell 同样也对英语以外的语言提供了良好的支持。 -### Prose linters +### 文章 linter -软件开发人员使用 [linters][11] 来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的 linters;而命令行会认为这些错误是样式元素。任何写作者都可以(也应该)使用它,一个 prose linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。 +软件开发人员使用 [linter][11] 来检查他们的代码是否存在错误或者 bug。同样也有用于检查文本样式或语法错误的 linter;而该命令行工具会认为这些错误是样式元素。任何写作者都可以(也应该)使用它,一个文章 linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。 -[Proselint][12] 是一款全能的实时检查工具。它会找出行话,大话,不正确日期和时间格式,滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。 +[Proselint][12] 是一款全能的实时检查工具。它会找出行话、大话、不正确日期和时间格式、滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。 -[Alex][14] 是一个简单但有用的 prose linter。 对明文文本或者格式为 Markdown 或 HTML 的文档使用它。Alex 会对“性别偏好,极端主义,种族相关,宗教,或者文章中其他不平等的措辞”产生警告。如果你想要试试看 Alex,这里有一个在线 [demo][15]。 +[Alex][14] 是一个简单但有用的文章 linter。 对明文文本或者格式为 Markdown 或 HTML 的文档使用它。Alex 会对“性别偏好、极端主义、种族相关、宗教,或者文章中其他不平等的措辞”产生警告。如果你想要试试看 Alex,这里有一个在线 [demo][15]。 ### 其他工具 有时候你找不到一个单词的恰当的同义词。但你不需要去呆板的词库中抓取或者去专门的网站完善你的单词完整。仅仅需要对你想要替换的单词运行 [Aiksaurus][16],然后它就会为你完成这个工作。但是,这个程序最大的缺点是它只支持英语。 -即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用 Markdown 格式的文件转换成其他格式。这就是 [Pandoc][18] 的用武之地。你可以用它来将你的文档转换成 HTML,Word,LibreOffice Writer,LaTeX,EPUB 以及其他格式。你甚至可以用 Pandoc 来生成书籍和[研究论文][19]。 +即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用 Markdown 格式的文件转换成其他格式。这就是 [Pandoc][18] 的用武之地。你可以用它来将你的文档转换成 HTML、Word、LibreOffice Writer、LaTeX、EPUB 以及其他格式。你甚至可以用 Pandoc 来生成书籍和[研究论文][19]。 -你有最喜欢的命令行写作工具吗?在 Opensource.com 社区发表评论分享它吧。 +你有最喜欢的命令行写作工具吗?在社区发表评论分享它吧。 -------------------------------------------------------------------------------- @@ -46,7 +48,7 @@ via: https://opensource.com/article/18/11/command-line-tools-writers 作者:[Scott Nesbitt][a] 选题:[lujun9972][b] 译者:[LazyWolfLin](https://github.com/LazyWolfLin) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 32d5ada6211bd3ee5b83694f373cd3afb3e63123 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 13 Dec 2018 22:45:13 +0800 Subject: [PATCH 0846/1143] PUB:20181119 7 command-line tools for writers - Opensource.com.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @LazyWolfLin 本文首发地址: https://linux.cn/article-10343-1.html 您的 LCTT 专页:https://linux.cn/lctt/LazyWolfLin 请注册领取 LCCN: https://lctt.linux.cn/ --- .../20181119 7 command-line tools for writers - Opensource.com.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181119 7 command-line tools for writers - Opensource.com.md (100%) diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/published/20181119 7 command-line tools for writers - Opensource.com.md similarity index 100% rename from translated/tech/20181119 7 command-line tools for writers - Opensource.com.md rename to published/20181119 7 command-line tools for writers - Opensource.com.md From 23a778d8f807667686a30f4e16a24ffc2a2aed55 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 13 Dec 2018 23:48:09 +0800 Subject: [PATCH 0847/1143] PRF:20181121 Coupled commands with control operators in Bash.md @Jamskr --- ...commands with control operators in Bash.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/translated/tech/20181121 Coupled commands with control operators in Bash.md b/translated/tech/20181121 Coupled commands with control operators in Bash.md index f5f388e763..e5d4dcb2c0 100644 --- a/translated/tech/20181121 Coupled commands with control operators in Bash.md +++ b/translated/tech/20181121 Coupled commands with control operators in Bash.md @@ -1,10 +1,11 @@ Bash 中使用控制运算符连接命令 ====== -在命令行中,使用控制运算符为复合命令添加逻辑。 + +> 在命令行中,使用控制运算符为复合命令添加逻辑。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-yearbook-best-couple.png?itok=a_99oCdE) -一些简单的复合指令——比如说在一个命令行中连接几个命令——是经常使用的。这些命令使用分号分隔,表示一个命令结束。为了在一个命令行中创建一系列简单的 shell 命令,只需要使用分号把每一条命令分隔开,就像下面这样: +经常会使用一些简单的复合指令,比如说在一个命令行中连接几个命令。这些命令使用分号分隔,表示一个命令结束。为了在一个命令行中创建一系列简单的 shell 命令,只需要使用分号把每一条命令分隔开,就像下面这样: ``` command1 ; command2 ; command3 ; command4 ; @@ -12,7 +13,7 @@ command1 ; command2 ; command3 ; command4 ; 最后一个分号你可以不用添加,因为当你按下回车键时就表示一个命令的结束,但是为了和其它的保持一致,还是建议加上比较好。 -所有的命令执行都没有什么问题——只要没有什么意外发生。但是当出问题时到底发生了什么呢?我们可以预测,并且通过 Bash 中内置的 `&&` 和 `||` 运算符跟踪这些错误。这两个控制运算符提供了一些流控制,可以让我们改变代码执行队列的顺序。分号和 **换行符** 也被认为是 Bash 的控制运算符。 +所有的命令执行都没有什么问题 —— 只要没有什么意外发生。但是当出问题时到底发生了什么呢?我们可以预测,并且通过 Bash 中内置的 `&&` 和 `||` 运算符跟踪这些错误。这两个控制运算符提供了一些流控制,可以让我们改变代码执行队列的顺序。分号和换行符也被认为是 Bash 的控制运算符。 `&&` 运算符意义简单来说就是“如果 `command1` 执行成功,就接着执行 `command2`。”如果 `command1` 因为任何原因执行失败,那么 `command2` 将不执行。这个语法看下来像这样: @@ -20,9 +21,9 @@ command1 ; command2 ; command3 ; command4 ; command1 && command2 ``` -这样写是允许的,因为每一个命令都会返回一个值给 shell 来表示这个命令在执行的过程中是否执行成功或者失败。通常,返回值是 0 表示成功,而一个正数值表示不同种类的错误。有一些系统管理工具仅仅返回一个 1 来表示所有的错误,但是也有很多工具使用其它的正数的返回值来表示各种类型错误。 +这样写是允许的,因为每一个命令都会返回一个值(RC)给 shell 来表示这个命令在执行的过程中是否执行成功或者失败。通常,返回值是 `0` 表示成功,而一个正数值表示不同种类的错误。有一些系统管理工具仅仅返回一个 `1` 来表示所有的错误,但是也有很多工具使用其它的正数的返回值来表示各种类型错误。 -我们可以很容易的使用脚本, 命令列表中的下一个命令,或者可以直接使用系统管理工具来检查 shell 变量 `$?` 。我们一起来看这些返回值。运行一个简单的命令然后立即检查它的返回值,这个返回值始终是属于最后一个运行的命令。 +我们可以很容易的使用脚本来检查 shell 变量 `$?`,可以通过命令列表中的下一个命令,或者可以直接使用系统管理工具检查。我们一起来看这些返回值。运行一个简单的命令然后立即检查它的返回值,这个返回值始终是属于最后一个运行的命令。 ``` [student@studentvm1 ~]$ ll ; echo "RC = $?" @@ -35,7 +36,7 @@ RC = 0 [student@studentvm1 ~]$ ``` -这个返回值是 0,表示这个命令执行成功了。现在尝试使用同样的命令在一些我们没有权限的目录上。 +这个返回值是 `0`,表示这个命令执行成功了。现在尝试使用同样的命令在一些我们没有权限的目录上。 ``` [student@studentvm1 ~]$ ll /root ; echo "RC = $?" @@ -44,7 +45,7 @@ RC = 2 [student@studentvm1 ~]$ ``` -这个返回值的含义可以在 [`ls` 命令的 man 页面][1] 中找到。 +这个返回值的含义可以在 [ls 命令的 man 页面][1] 中找到。 现在我们来试试 `&&` 这个控制运算符,因为它也可能会被用在一个命令行程序中。我们将从一个简单的示例开始:创建一个新目录,如果创建成功就在这个目录中创建一个文件。 @@ -54,7 +55,7 @@ RC = 2 [student@studentvm1 ~]$ cd ; mkdir testdir ``` -在 `~/testdir` 中新建一个目录,这也应该是一个空目录,因为是你刚刚创建的,然后创建一个新的,空文件在这个新目录中。下面的命令可以做这些事情。 +在 `~/testdir` 中新建一个目录,这也应该是一个空目录,因为是你刚刚创建的,然后创建一个新的空文件在这个新目录中。下面的命令可以做这些事情。 ``` [student@studentvm1 ~]$ mkdir ~/testdir/testdir2 && touch ~/testdir/testdir2/testfile1 @@ -64,7 +65,7 @@ total 0 [student@studentvm1 ~]$ ``` -我们看到一切都运行得很好,因为 `testdir` 目录是访问且可写的。然后我们改变 `testdir` 目录的权限,让用户 **student** 不再具有访问的权限。操作如下: +我们看到一切都运行得很好,因为 `testdir` 目录是访问且可写的。然后我们改变 `testdir` 目录的权限,让用户 `student` 不再具有访问的权限。操作如下: ``` [student@studentvm1 ~]$ chmod 076 testdir ; ll | grep testdir @@ -116,7 +117,7 @@ via: https://opensource.com/article/18/11/control-operators-bash-shell 作者:[David Both][a] 选题:[lujun9972][b] 译者:[Jamskr](https://github.com/Jamskr) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6796eac9f56f49d511213fbeea8dd30696ec64b1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 13 Dec 2018 23:48:28 +0800 Subject: [PATCH 0848/1143] PUB:20181121 Coupled commands with control operators in Bash.md @Jamskr https://linux.cn/article-10344-1.html --- .../20181121 Coupled commands with control operators in Bash.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181121 Coupled commands with control operators in Bash.md (100%) diff --git a/translated/tech/20181121 Coupled commands with control operators in Bash.md b/published/20181121 Coupled commands with control operators in Bash.md similarity index 100% rename from translated/tech/20181121 Coupled commands with control operators in Bash.md rename to published/20181121 Coupled commands with control operators in Bash.md From 5f91ccd934028f7fb62854b6a3f7171e350783a1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 14 Dec 2018 09:10:20 +0800 Subject: [PATCH 0849/1143] translated --- ...olor to your Linux terminal with lolcat.md | 60 ------------------- ...olor to your Linux terminal with lolcat.md | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md create mode 100644 translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md diff --git a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md deleted file mode 100644 index 3e070414ae..0000000000 --- a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (Bring some color to your Linux terminal with lolcat) -[#]: via: (https://opensource.com/article/18/12/linux-toy-lolcat) -[#]: author: (Jason Baker https://opensource.com/users/jason-baker) -[#]: url: ( ) - -Bring some color to your Linux terminal with lolcat -====== -With this simple utility, you can add a rainbow of color to the output of any program you want. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-lolcat.png?itok=Es6dYcph) - -Today marks the fifth day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. Even I'm not quite sure, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. - -It's quite possible that some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. - -Today's selection, **lolcat** , is the first utility I'm including that wasn't packaged for my Linux distribution, but it was still an easy install. It's a Ruby program that you ought to be able to easily add to your system with the following. - -``` -$ gem install lolcat -``` - -After that, simply pipe some text to it to see the output in the colors of the rainbow. For example, using a couple of utilities from earlier days in our advent calendar, try the following: - -``` -$ fortune | boxes -a c -d parchment | lolcat -``` - -Depending on what good fortune you have, you'll likely get something like this: -![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-parchment.png) - -There are a few parameters you can pass to **lolcat** , and rather than repeat them all here, I'd suggest you either visit the **lolcat** [GitHub page][1] or just see them at the terminal by typing **lolcat --help**. But generally, they're helpful to set the spread and frequency of your rainbow, and my personal favorite, enabling animation. Who doesn't like animated rainbow printing at the terminal? Let's try the above again, with a different box (cat-themed, of course) and a cat-appropriate fortune that was in my fortunes list, with the following. - -``` -fortune -m "nine tails" | boxes -a c -d cat | lolcat -a -``` -![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-animated.gif) -**lolcat** is open source under a BSD license. - -Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. - -Check out yesterday's toy, [Have a cow at the Linux command line][2], and check back tomorrow for another! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/linux-toy-lolcat - -作者:[Jason Baker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[b]: https://github.com/lujun9972 -[1]: https://github.com/busyloop/lolcat -[2]: https://opensource.com/article/18/12/linux-toy-cowsay diff --git a/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md new file mode 100644 index 0000000000..eb23d85e36 --- /dev/null +++ b/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Bring some color to your Linux terminal with lolcat) +[#]: via: (https://opensource.com/article/18/12/linux-toy-lolcat) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) +[#]: url: ( ) + +使用 lolcat 为你的 Linux 终端带来一些颜色 +====== +使用这个简单的程序,你可以为所需的任何程序的输出添加彩色。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-lolcat.png?itok=Es6dYcph) + +今天是 Linux 命令行玩具日历的第五天。如果这是你第一次访问该系列,你可能会问自己,什么是命令行玩具。即使我不太确定,但一般来说,它可能是一个游戏,或任何简单的可以帮助你在终端玩得开心的东西。 + +很可能你们中的一些人之前已经看过我们日历中的各种选择,但我们希望每个人至少见到一件新事物。 + +今日的选择,**lolcat**,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。 + +``` +$ gem install lolcat +``` + +之后,只需将一些文本传送给它,就可以看到彩色的输出。例如,尝试几个之前在我们的日历中出现的程序,使用以下命令: + +``` +$ fortune | boxes -a c -d parchment | lolcat +``` + +根据你的运气,你可能会看到这样: +![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-parchment.png) + +你可以传递给 **lolcat** 一些参数而不必重复它们,我建议你访问 **lolcat** 的 [GitHub 页面][1] 或者在终端输入 **lolcat --help** 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画打印?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的句子列表中的适合猫的句子。 + +``` +fortune -m "nine tails" | boxes -a c -d cat | lolcat -a +``` +![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-animated.gif) +**lolcat** 是 BSD 许可下的开源软件。 + +你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 + +了解一下昨天的玩具,[在 Linux 命令行中拥有一头牛][2],还有记得明天再来! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-lolcat + +作者:[Jason Baker][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/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://github.com/busyloop/lolcat +[2]: https://opensource.com/article/18/12/linux-toy-cowsay \ No newline at end of file From 9a64f2f248272e42575bf2bfea5e92617ac97731 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 14 Dec 2018 09:18:25 +0800 Subject: [PATCH 0850/1143] translating --- ...81205 How To Fix Broken Ubuntu OS Without Reinstalling It.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md index a00541b536..0d24e0d7c6 100644 --- a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md +++ b/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It) From 33ef858c9cc0afaa1d694b1848c2777e87d7f214 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 12:37:57 +0800 Subject: [PATCH 0851/1143] PRF:20180412 A new approach to security instrumentation.md @hopefully2333 --- ...ew approach to security instrumentation.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/translated/talk/20180412 A new approach to security instrumentation.md b/translated/talk/20180412 A new approach to security instrumentation.md index c177e8f5fe..1d11efb63f 100644 --- a/translated/talk/20180412 A new approach to security instrumentation.md +++ b/translated/talk/20180412 A new approach to security instrumentation.md @@ -1,11 +1,13 @@ -一种新的用于安全检测的方法 +一种新的安全检测的方法 ====== +> 不要只测试已有系统,强安全要求更积极主动的策略。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_privacy_lock.png?itok=ZWjrpFzx) 我们当中有多少人曾说出过下面这句话:“我希望这能起到作用!”? -毫无疑问,我们中的大多数人可能都不止一次地说过这句话。这句话不是用来激发信心的,相反它揭示了我们对自身能力和当前正在测试功能的怀疑。不幸的是,这句话非常好地描述了我们传统的安全模型。我们的运营基于这样的假设,并希望我们实施的控制措施——从 web 应用的漏扫到终端上的杀毒软件——防止恶意的病毒和软件进入我们的系统,损坏或偷取我们的信息。 +毫无疑问,我们中的大多数人可能都不止一次地说过这句话。这句话不是用来激发信心的,相反它揭示了我们对自身能力和当前正在测试的功能的怀疑。不幸的是,这句话非常好地描述了我们传统的安全模型。我们的运营基于这样的假设,并希望我们实施的控制措施 —— 从 web 应用的漏扫到终端上的杀毒软件 —— 防止恶意的病毒和软件进入我们的系统,损坏或偷取我们的信息。 渗透测试通过积极地尝试侵入网络、向 web 应用注入恶意代码或者通过发送钓鱼邮件来传播病毒等等这些步骤来避免我们对假设的依赖。由于我们在不同的安全层面上来发现和渗透漏洞,手动测试无法解决漏洞被主动打开的情况。在安全实验中,我们故意在受控的情形下创造混乱,模拟事故的情形,来客观地检测我们检测、阻止这类问题的能力。 @@ -13,15 +15,15 @@ 在分布式系统的安全性和复杂性方面,需要反复地重申混沌工程界的一句名言,“希望不是一种有效的策略”。我们多久会主动测试一次我们设计或构建的系统,来确定我们是否已失去对它的控制?大多数组织都不会发现他们的安全控制措施失效了,直到安全事件的发生。我们相信“安全事件不是侦察措施”,而且“希望不要出事也不是一个有效的策略”应该是 IT 专业人士执行有效安全实践的口号。 -工业在传统上强调预防性的安全措施和纵深防御,但我们的任务是通过侦探实验来驱动对安全工具链新的知识和见解。因为过于专注于预防机制,我们很少尝试一次以上地或者年度性地手动测试要求的安全措施,来验证这些控件是否按设计的那样执行。 +行业在传统上强调预防性的安全措施和纵深防御,但我们的任务是通过侦探实验来驱动对安全工具链的新知识和见解。因为过于专注于预防机制,我们很少尝试一次以上地或者年度性地手动测试要求的安全措施,来验证这些控件是否按设计的那样执行。 -随着现代分布式系统中的无状态变量的不断改变,人们很难充分理解他们的系统的行为,因为会随时变化。解决这个问题的一种途径是通过强大的系统性的设备进行检测,对于安全性检测,你可以将这个问题分成两个主要方面,测试,和我们称之为实验的部分。测试是对我们已知部分的验证和评估,简单来说,就是我们在开始找之前,要先弄清楚我们在找什么。另一方面,实验是去寻找获得我们之前并不清楚的见解和知识。虽然测试对于一个成熟的安全团队来说是一项重要实践,但以下示例会有助于进一步地阐述两者之间的差异,并对实验的附加价值提供一个更为贴切的描述。 +随着现代分布式系统中的无状态变量的不断改变,人们很难充分理解他们的系统的行为,因为会随时变化。解决这个问题的一种途径是通过强大的系统性的设备进行检测,对于安全性检测,你可以将这个问题分成两个主要方面:**测试**,和我们称之为**实验**的部分。测试是对我们已知部分的验证和评估,简单来说,就是我们在开始找之前,要先弄清楚我们在找什么。另一方面,实验是去寻找获得我们之前并不清楚的见解和知识。虽然测试对于一个成熟的安全团队来说是一项重要实践,但以下示例会有助于进一步地阐述两者之间的差异,并对实验的附加价值提供一个更为贴切的描述。 ### 示例场景:精酿啤酒 思考一个用于接收精酿啤酒订单的 web 服务或者 web 应用。 -这是这家精酿啤酒运输公司的一项重要服务,这些订单来自客户的移动设备,网页,和通过为这家公司精酿啤酒提供服务的餐厅的 API。这项重要服务运行在 AWS EC2 环境上,并且公司认为它是安全的。这家公司去年成功地通过了 PCI 规则,并且每年都会请第三方进行渗透测试,所以公司认为这个系统是安全的。 +这是这家精酿啤酒运输公司的一项重要服务,这些订单来自客户的移动设备、网页,和通过为这家公司精酿啤酒提供服务的餐厅的 API。这项重要服务运行在 AWS EC2 环境上,并且公司认为它是安全的。这家公司去年成功地通过了 PCI 规则,并且每年都会请第三方进行渗透测试,所以公司认为这个系统是安全的。 这家公司有时一天两次部署来进行 DevOps 和持续交付工作,公司为其感到自豪。 @@ -35,10 +37,8 @@ * 该配置会从已选择的目标中随机指定对象,同时端口的范围和数量也会被改变。 * 团队还会设置进行实验的时间并缩小爆破攻击的范围,来确保对业务的影响最小。 * 对于第一次测试,团队选择在他们的测试环境中运行实验并运行一个单独的测试。 - * 在真实的游戏日风格里,团队在预先计划好的两个小时的窗口期内,选择灾难大师来运行实验。在那段窗口期内,灾难大师会在 EC2 实例安全组中的一个上执行这次实验。 - * 一旦游戏日结束,团队就会开始进行一个彻底的、无可指责的事后练习。它的重点在于针对稳定状态和原始假设的实验结果。问题会类似于下面这些: - - + * 在真实的游戏日Game Day风格里,团队在预先计划好的两个小时的窗口期内,选择灾难大师Master of Disaster来运行实验。在那段窗口期内,灾难大师会在 EC2 实例安全组中的一个实例上执行这次实验。 + * 一旦游戏日结束,团队就会开始进行一个彻底的、免于指责的事后练习。它的重点在于针对稳定状态和原始假设的实验结果。问题会类似于下面这些: ### 事后验证问题 @@ -53,24 +53,22 @@ * 获得警报的 SOC 分析师是否能对警报采取措施,还是缺少必要的信息? * 如果 SOC 确定警报是真实的,那么安全事件响应是否能简单地从数据中进行分类活动? - - 我们系统中对失败的承认和预期已经开始揭示我们对系统工作的假设。我们的使命是利用我们所学到的,并更加广泛地应用它。以此来真正主动地解决安全问题,来超越当前传统主流的被动处理问题的安全模型。 随着我们继续在这个新领域内进行探索,我们一定会发布我们的研究成果。如果您有兴趣想了解更多有关研究的信息或是想参与进来,请随时联系 Aaron Rinehart 或者 Grayson Brewer。 特别感谢 Samuel Roden 对本文提供的见解和想法。 -**[看我们相关的文章,是否需要 DevSecOps 这个词?][3]]** +- [看我们相关的文章:是否需要 DevSecOps 这个词?][3] -------------------------------------------------------------------------------- via: https://opensource.com/article/18/4/new-approach-security-instrumentation 作者:[Aaron Rinehart][a] -译者:[hopefully2333](https://github.com/hopefully2333) -校对:[校对者ID](https://github.com/校对者ID) 选题:[lujun9972](https://github.com/lujun9972) +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7c5916acf360265c794986ab1717a112afa72927 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 12:38:18 +0800 Subject: [PATCH 0852/1143] PUB:20180412 A new approach to security instrumentation.md @hopefully2333 https://linux.cn/article-10345-1.html --- .../20180412 A new approach to security instrumentation.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180412 A new approach to security instrumentation.md (100%) diff --git a/translated/talk/20180412 A new approach to security instrumentation.md b/published/20180412 A new approach to security instrumentation.md similarity index 100% rename from translated/talk/20180412 A new approach to security instrumentation.md rename to published/20180412 A new approach to security instrumentation.md From 16e2c4165820d030e759b31a99bd6d0d3c88d1ea Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 14 Dec 2018 12:58:38 +0800 Subject: [PATCH 0853/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Buil?= =?UTF-8?q?d=20a=20Netboot=20Server,=20Part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2 How to Build a Netboot Server, Part 2.md | 454 ++++++++++++++++++ 1 file changed, 454 insertions(+) create mode 100644 sources/tech/20181212 How to Build a Netboot Server, Part 2.md diff --git a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md b/sources/tech/20181212 How to Build a Netboot Server, Part 2.md new file mode 100644 index 0000000000..0301a34da5 --- /dev/null +++ b/sources/tech/20181212 How to Build a Netboot Server, Part 2.md @@ -0,0 +1,454 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Build a Netboot Server, Part 2) +[#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +How to Build a Netboot Server, Part 2 +====== + +![](https://fedoramagazine.org/wp-content/uploads/2018/12/netboot2-816x345.jpg) + +The article [How to Build a Netboot Server, Part 1][1] showed you how to create a netboot image with a “liveuser” account whose home directory lives in volatile memory. Most users probably want to preserve files and settings across reboots, though. So this second part of the netboot series shows how to reconfigure the netboot image from part one so that [Active Directory][2] user accounts can log in and their home directories can be automatically mounted from a NFS server. + +Part 3 of this series will show how to make an interactive and centrally-configurable iPXE boot menu for the netboot clients. + +### Setup NFS4 Home Directories with KRB5 Authentication + +Follow the directions from the previous post “[Share NFS Home Directories Securely with Kerberos][3],” then return here. + +### Remove the Liveuser Account + +Remove the “liveuser” account created in part one of this series: + +``` +$ sudo -i +# sed -i '/automaticlogin/Id' /fc28/etc/gdm/custom.conf +# rm -f /fc28/etc/sudoers.d/liveuser +# for i in passwd shadow group gshadow; do sed -i '/^liveuser:/d' /fc28/etc/$i; done +``` + +### Configure NTP, KRB5 and SSSD + +Next, we will need to duplicate the NTP, KRB5, and SSSD configuration that we set up on the server in the client image so that the same accounts will be available: + +``` +# MY_HOSTNAME=$(> /fc28/etc/$i; done +``` + +### Join Active Directory + +Next, you’ll perform a chroot to join the client image to Active Directory. Begin by deleting any pre-existing computer account with the same name your netboot image will use: + +``` +# MY_USERNAME=jsmith +# MY_CLIENT_HOSTNAME=$( /fc28/root/.bash_history +``` + +### Install and Configure PAM Mount + +We want our clients to automatically mount the user’s home directory when they log in. To accomplish this, we’ll use the “pam_mount” module. Install and configure pam_mount: + +``` +# dnf install -y --installroot=/fc28 pam_mount +# cat << END > /fc28/etc/security/pam_mount.conf.xml + + + + + + +Password: + +END +``` + +Reconfigure PAM to use pam_mount: + +``` +# dnf install -y patch +# cp -r /fc28/usr/share/authselect/default/sssd /fc28/etc/authselect/custom +# echo 'initgroups: files' >> /fc28/etc/authselect/custom/sssd/nsswitch.conf +# patch /fc28/etc/authselect/custom/sssd/system-auth << END +@@ -12 +12,2 @@ +-auth sufficient pam_sss.so forward_pass ++auth requisite pam_mount.so {include if "with-pammount"} ++auth sufficient pam_sss.so {if "with-pammount":use_first_pass|forward_pass} +@@ -35,2 +36,3 @@ + session required pam_unix.so ++session optional pam_mount.so {include if "with-pammount"} + session optional pam_sss.so +END +# patch /fc28/etc/authselect/custom/sssd/password-auth << END +@@ -9 +9,2 @@ +-auth sufficient pam_sss.so forward_pass ++auth requisite pam_mount.so {include if "with-pammount"} ++auth sufficient pam_sss.so {if "with-pammount":use_first_pass|forward_pass} +@@ -32,2 +33,3 @@ + session required pam_unix.so ++session optional pam_mount.so {include if "with-pammount"} + session optional pam_sss.so +END +# chroot /fc28 authselect select custom/sssd with-pammount --force +``` + +Also ensure the NFS server’s hostname is always resolvable from the client: + +``` +# MY_IP=$(host -t A $MY_HOSTNAME | awk '{print $4}') +# echo "$MY_IP $MY_HOSTNAME ${MY_HOSTNAME%%.*}" >> /fc28/etc/hosts +``` + +Optionally, allow all users to run sudo: + +``` +# echo '%users ALL=(ALL) NOPASSWD: ALL' > /fc28/etc/sudoers.d/users +``` + +### Convert the NFS Root to an iSCSI Backing-Store + +Current versions of nfs-utils may have difficulty establishing a second connection from the client back to the NFS server for home directories when an nfsroot connection is already established. The client hangs when attempting to access the home directory. So, we will work around the problem by using a different protocol (iSCSI) for sharing our netboot image. + +First chroot into the image to reconfigure its initramfs for booting from an iSCSI root: + +``` +# for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done +# chroot /fc28 /usr/bin/bash --login +# dnf install -y iscsi-initiator-utils +# sed -i 's/nfs/iscsi/' /etc/dracut.conf.d/netboot.conf +# echo 'omit_drivers+=" qedi "' > /etc/dracut.conf.d/omit-qedi.conf +# echo 'blacklist qedi' > /etc/modprobe.d/blacklist-qedi.conf +# KERNEL=$(ls -c /lib/modules | head -n 1) +# INITRD=$(find /boot -name 'init*' | grep -m 1 $KERNEL) +# dracut -f $INITRD $KERNEL +# logout +# for i in run sys proc dev/shm dev/pts dev; do umount /fc28/$i; done +# > /fc28/root/.bash_history +``` + +The qedi driver broke iscsi during testing, so it’s been disabled here. + +Next, create a fc28.img [sparse file][4]. This file serves as the iSCSI target’s backing store: + +``` +# FC28_SIZE=$(du -ms /fc28 | cut -f 1) +# dd if=/dev/zero of=/fc28.img bs=1MiB count=0 seek=$(($FC28_SIZE*2)) +``` + +(If you have one available, a separate partition or disk drive can be used instead of creating a file.) + +Next, format the image with a filesystem, mount it, and copy the netboot image into it: + +``` +# mkfs -t xfs -L NETROOT /fc28.img +# TEMP_MNT=$(mktemp -d) +# mount /fc28.img $TEMP_MNT +# cp -a /fc28/* $TEMP_MNT +# umount $TEMP_MNT +``` + +During testing using SquashFS, the client would occasionally stutter. It seems that SquashFS does not perform well when doing random I/O from a multiprocessor client. (See also [The curious case of stalled squashfs reads][5].) If you want to improve throughput performance with filesystem compression, [ZFS][6] is probably a better option. + +If you need extremely high throughput from the iSCSI server (say, for hundreds of clients), it might be possible to [load balance][7] a [Ceph][8] cluster. For more information, see [Load Balancing Ceph Object Gateway Servers with HAProxy and Keepalived][9]. + +### Install and Configure iSCSI + +Install the scsi-target-utils package which will provide the iSCSI daemon for serving our image out to our clients: + +``` +# dnf install -y scsi-target-utils +``` + +Configure the iSCSI daemon to serve the fc28.img file: + +``` +# MY_REVERSE_HOSTNAME=$(echo $MY_HOSTNAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_HOSTNAME}) +# cat << END > /etc/tgt/conf.d/fc28.conf + + backing-store /fc28.img + readonly 1 + +END +``` + +The leading iqn. is expected by /usr/lib/dracut/modules.d/40network/net-lib.sh. + +Add an exception to the firewall and enable and start the service: + +``` +# firewall-cmd --add-service=iscsi-target +# firewall-cmd --runtime-to-permanent +# systemctl enable tgtd.service +# systemctl start tgtd.service +``` + +You should now be able to see the image being shared with the tgtadm command: + +``` +# tgtadm --mode target --op show +``` + +The above command should output something similar to the following: + +``` +Target 1: iqn.edu.example.server-01:fc28 + System information: + Driver: iscsi + State: ready + I_T nexus information: + LUN information: + LUN: 0 + Type: controller + SCSI ID: IET 00010000 + SCSI SN: beaf10 + Size: 0 MB, Block size: 1 + Online: Yes + Removable media: No + Prevent removal: No + Readonly: No + SWP: No + Thin-provisioning: No + Backing store type: null + Backing store path: None + Backing store flags: +  LUN: 1 + Type: disk + SCSI ID: IET 00010001 + SCSI SN: beaf11 + Size: 10488 MB, Block size: 512 + Online: Yes + Removable media: No + Prevent removal: No + Readonly: Yes + SWP: No + Thin-provisioning: No + Backing store type: rdwr + Backing store path: /fc28.img + Backing store flags: + Account information: + ACL information: + ALL +``` + +We can now remove the NFS share that we created in part one of this series: + +``` +# rm -f /etc/exports.d/fc28.exports +# exportfs -rv +# umount /export/fc28 +# rmdir /export/fc28 +# sed -i '/^\/fc28 /d' /etc/fstab +``` + +You can also delete the /fc28 filesystem, but you may want to keep it for performing future updates. + +### Update the ESP to use the iSCSI Kernel + +Ipdate the ESP to contain the iSCSI-enabled initramfs: + +``` +$ rm -vf $HOME/esp/linux/*.fc28.* +$ MY_KRNL=$(ls -c /fc28/lib/modules | head -n 1) +$ cp $(find /fc28/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $MY_KRNL) $HOME/esp/linux/vmlinuz-$MY_KRNL +$ cp $(find /fc28/boot -name 'init*' | grep -m 1 $MY_KRNL) $HOME/esp/linux/initramfs-$MY_KRNL.img +``` + +Update the boot.cfg file to pass the new root and netroot parameters: + +``` +$ MY_NAME=server-01.example.edu +$ MY_EMAN=$(echo $MY_NAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_NAME}) +$ MY_ADDR=$(host -t A $MY_NAME | awk '{print $4}') +$ sed -i "s! root=[^ ]*! root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc28-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc28!" $HOME/esp/linux/boot.cfg +``` + +Now you just need to copy the updated files from your $HOME/esp/linux directory out to the ESPs of all your client systems. You should see results similar to what is shown in the below screenshot: + +![][10] + +### Upgrading the Image + +First, make a copy of the current image: + +``` +# cp -a /fc28 /fc29 +``` + +Chroot into the new copy of the image: + +``` +# for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc29/$i; done +# chroot /fc29 /usr/bin/bash --login +``` + +Allow updating the kernel: + +``` +# sed -i 's/^exclude=kernel-\*$/#exclude=kernel-*/' /etc/dnf/dnf.conf +``` + +Perform the upgrade: + +``` +# dnf distro-sync -y --releasever=29 +``` + +Prevent the kernel from being updated: + +``` +# sed -i 's/^#exclude=kernel-\*$/exclude=kernel-*/' /etc/dnf/dnf.conf +``` + +The above command is optional, but saves you from having to copy a new kernel out to the clients if you add or update a few packages in the image at some future time. + +Clean up dnf’s package cache: + +``` +# dnf clean all +``` + +Exit the chroot and clear root’s command history: + +``` +# logout +# for i in run sys proc dev/shm dev/pts dev; do umount /fc29/$i; done +# > /fc29/root/.bash_history +``` + +Create the iSCSI image: + +``` +# FC29_SIZE=$(du -ms /fc29 | cut -f 1) +# dd if=/dev/zero of=/fc29.img bs=1MiB count=0 seek=$(($FC29_SIZE*2)) +# mkfs -t xfs -L NETROOT /fc29.img +# TEMP_MNT=$(mktemp -d) +# mount /fc29.img $TEMP_MNT +# cp -a /fc29/* $TEMP_MNT +# umount $TEMP_MNT +``` + +Define a new iSCSI target that points to our new image and export it: + +``` +# MY_HOSTNAME=$( /etc/tgt/conf.d/fc29.conf + + backing-store /fc29.img + readonly 1 + +END +# tgt-admin --update ALL +``` + +Add the new kernel and initramfs to the ESP: + +``` +$ MY_KRNL=$(ls -c /fc29/lib/modules | head -n 1) +$ cp $(find /fc29/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $MY_KRNL) $HOME/esp/linux/vmlinuz-$MY_KRNL +$ cp $(find /fc29/boot -name 'init*' | grep -m 1 $MY_KRNL) $HOME/esp/linux/initramfs-$MY_KRNL.img +``` + +Update the boot.cfg in the ESP: + +``` +$ MY_DNS1=192.0.2.91 +$ MY_DNS2=192.0.2.92 +$ MY_NAME=server-01.example.edu +$ MY_EMAN=$(echo $MY_NAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_NAME}) +$ MY_ADDR=$(host -t A $MY_NAME | awk '{print $4}') +$ cat << END > $HOME/esp/linux/boot.cfg +#!ipxe + +kernel --name kernel.efi \${prefix}/vmlinuz-$MY_KRNL initrd=initrd.img ro ip=dhcp rd.peerdns=0 nameserver=$MY_DNS1 nameserver=$MY_DNS2 root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc29-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc29 console=tty0 console=ttyS0,115200n8 audit=0 selinux=0 quiet +initrd --name initrd.img \${prefix}/initramfs-$MY_KRNL.img +boot || exit +END +``` + +Finally, copy the files from your $HOME/esp/linux directory out to the ESPs of all your client systems and enjoy! + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ +[2]: https://en.wikipedia.org/wiki/Active_Directory +[3]: https://fedoramagazine.org/secure-nfs-home-directories-kerberos +[4]: https://en.wikipedia.org/wiki/Sparse_file +[5]: https://chrisdown.name/2018/04/17/kernel-adventures-the-curious-case-of-squashfs-stalls.html +[6]: https://en.wikipedia.org/wiki/ZFS +[7]: https://en.wikipedia.org/wiki/Load_balancing_(computing) +[8]: http://docs.ceph.com/docs/mimic/rbd/iscsi-overview/ +[9]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/load_balancer_administration/ceph_example +[10]: https://fedoramagazine.org/wp-content/uploads/2018/12/netboot-screenshot-1024x819.png From c84fd905c61451cbda33612a1ece8d14876e0a59 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 14 Dec 2018 13:00:34 +0800 Subject: [PATCH 0854/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Aliases:=20DIY?= =?UTF-8?q?=20Shell=20Commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20181212 Aliases- DIY Shell Commands.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20181212 Aliases- DIY Shell Commands.md diff --git a/sources/tech/20181212 Aliases- DIY Shell Commands.md b/sources/tech/20181212 Aliases- DIY Shell Commands.md new file mode 100644 index 0000000000..d81fb03bb0 --- /dev/null +++ b/sources/tech/20181212 Aliases- DIY Shell Commands.md @@ -0,0 +1,133 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Aliases: DIY Shell Commands) +[#]: via: (https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands) +[#]: author: (Paul Brown https://www.linux.com/users/bro66) + +Aliases: DIY Shell Commands +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/jodi-mucha-540841-unsplash.jpg?itok=n1d1VDUV) + +Aliases, in the context of the Linux shell, are **commands you build yourself** by packing them with combinations of other instructions that are too long or too hard to remember. + +You create an alias by using the word `alias`, then the name of the command you want to create, an equal sign (`=`), and then the Bash command(s) you want your alias to run. For example, `ls` in its base form does not colorize its output, making it difficult to distinguish between directories, files, and links. You can build a new command that shows colors by making an alias like this: + +``` +alias lc='ls --color=auto' +``` + +where `lc` is the name you have picked for your new command. When creating aliases, be sure to check that the name you picked isn't already in use, or you may override an existing command. In this case, `lc` stands for "list (with) color". Notice there is no space in front of or behind the `=`. Finally, you have the regular Bash command(s) you want to run when `lc` is executed. In this case, the `ls` command with the `--color` option. + +After defining your alias, every time you type `lc`, the contents of the current directory will be shown in color. + +But, you may think, "my `ls` command already lists files in different colors!" That is because most Linux distros come with some aliases already set up for you. + +### Aliases you (probably) already have + +Indeed, you can use the `alias` instruction without any options to see what aliases you already have. These will vary by distro, but some typical preset aliases are: + + * `alias ls='ls --color=auto'`: You already saw this one above. The `auto` modifier of the `--color` option tells `ls` to use color when standard output is connected to a terminal. That is, the output of `ls` is going to show up in a terminal window or a text screen, instead of, say, being piped to a file. Other alternatives for `--color` are `always` and `never`. + * `alias cp='cp -i'`: The `-i` option stands for _interactive_. Sometimes, when you use `cp` you may inadvertently overwrite an existing file. By using the `-i`, `cp` will ask you before clobbering anything. + * `alias free='free -m'`: Using `-m` with `free`you can see how much free memory you have and how much your applications are using in megabytes instead of the default bytes. This makes the output of `free` easier to read for a human. + + + +There may be more (or less, or even none), but regardless of what your distribution comes with, you can always use the base form (vs. the aliased form) of a command with the `\` modifier. For example: + +``` +\free +``` + +will execute `free` without the `-m` option, and + +``` +\ls +``` + +will execute `ls` without the `--color=auto` option. + +If you want to get rid or modify the preset aliases forever, note that they live in the global _.bashrc_ file which hangs out in [our old haunt, the _/etc/skel_ directory][1]. + +### Aliases for muscle memory + +Distro designers try their best to predict which aliases are going to be useful for you. But every user is different and comes from a different background. If you are new to GNU+Linux, it may be because you are coming from another system, and the basic commands vary from shell to shell. If you come from a Windows/MS-DOS background, you may want to define an alias like + +``` +alias dir='ls' +``` + +to list files or directories. + +Likewise, + +``` +alias copy='cp' +alias move='mv' +``` + +may also come in handy, at least until you get used to Linux's new lexicon. + +The other problem occurs when mistakes become ingrained in your muscle memory, so you always mistype some words the same way. I, for instance, have great difficulty typing _admnis-_... _adminsi-_... _A-D-M-I-N-I-S-T-R-A-T-I-ON_ ( _phew!_ ) at speed. That is why some users create aliases like + +``` +alias sl='ls' +``` + +and + +``` +alias gerp='echo "You did it *again*!"; grep' +``` + +Although we haven't formally introduced `grep` yet, in its most basic form, it looks for a string of characters in a file or a set of files. It's one of those commands that you will tend to use A LOT once you get to grips with it, as those ingrained mistyping habits that force you to type the instruction twice every time get annoying really quickly. + +Another thing to note in the `gerp` example is that it is not a single instruction, but two. The first one (`echo "You did it *again*!"`) prints out a message reminding you that you misspelled the grep command, then there is a semicolon (`;`) that separates one instruction from the other. Finally, you've got the second command (`grep`) that does the actual grepping. + +Using `gerp` on my system to search for the lines containing the word " _alias_ " in _/etc/skel/.bashrc_ , the output looks like this: + +``` +$ gerp -R alias /etc/skel/.bashrc +You did it *again*! + alias ls='ls --color=auto' + alias grep='grep --colour=auto' + alias egrep='egrep --colour=auto' + alias fgrep='fgrep --colour=auto' +alias cp="cp -i" +alias df='df -h' +alias free='free -m' +alias np='nano -w PKGBUILD' +alias more=less +shopt -s expand_aliases +``` + +Running commands sequentially as part of an alias, or, even better, chaining commands so that one command can use the results coughed up by another, is getting us perilously close to Bash scripting. This has been in the making of this series for quite some time, and we'll start covering it in the very next article. + +For the time being, if you want to get rid of an alias you temporarily set up in a running terminal, use the `unalias` command: + +``` +unalias gerp +``` + +If you want to make your aliases permanent, you can drop them into the _.bashrc_ file you have in your home directory. This is the same thing we did with custom environment variables in [last week's article][2]. + +See you next time! + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands + +作者:[Paul 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://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts +[2]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise From 44d97063b39449b536f2ec944b3dead5b77abd01 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 13:28:27 +0800 Subject: [PATCH 0855/1143] PRF:20181204 Have a cow at the Linux command line.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @heguangzhi 请在使用翻译工具后,自己读一遍是否通顺,是否有明显错误! --- ...04 Have a cow at the Linux command line.md | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/translated/tech/20181204 Have a cow at the Linux command line.md b/translated/tech/20181204 Have a cow at the Linux command line.md index ef08209828..3be26492fe 100644 --- a/translated/tech/20181204 Have a cow at the Linux command line.md +++ b/translated/tech/20181204 Have a cow at the Linux command line.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (Have a cow at the Linux command line) [#]: via: (https://opensource.com/article/18/12/linux-toy-cowsay) @@ -8,27 +8,28 @@ [#]: url: ( ) -在Linux命令行上拥有一头奶牛 +在 Linux 命令行上拥有一头奶牛 ====== -使用 cowsay 实用程序将牛的声音带到你的终端输出。 +> 使用 cowsay 实用程序将牛的话语带到你的终端输出。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cowsay.png?itok=RA4NDbrY) 欢迎来到 Linux 命令行玩具第四天。如果这是你第一次访问这个系列,你可能会问自己,什么是命令行玩具。我们也在考虑这一点,但是一般来说,这可能是一个游戏,或者任何简单的娱乐,可以帮助你在终端玩得开心。 -你们中的一些人以前会看过我们日历上的各种选项,但是我们希望每个人都至少有一个新的选项。因为几乎所有我提到这个系列的人都已经问过我了,今天的选项是必须的。 +你们中的一些人会见过我们之前的选中的各种玩具,但是我们希望至少有一个对每个人来说都是新的。因为几乎所有我告诉他这个系列的人都已经问过它了,所以今天的选中的玩具是必须提及的。 -你不认为我们会在不提及 cowsay 的情况下完成这个系列,是吗? +你也不会认为我们会在不提及 `cowsay` 的情况下完成这个系列,对吧? -Cowsey 是一个神奇的实用程序,它将文本作为ASCII艺术牛的口语文本输出。 +`cowsay` 是一个神奇的实用程序,它将文本作为 ASCII 艺术牛的讲话文本输出。 -你可能会发现 cowsey 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装: +你可能会发现 `cowsey` 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装: ``` $ sudo dnf install -y cowsay ``` -然后,用 cowsey 调用它,然后是你的消息。也许你想到昨天我们谈到的 [幸运][1] [应用][1]。 + +然后,用 `cowsey` 调用它,然后是你的消息。也许你想到昨天我们谈到的 [fortune 应用][1] 连接起来。 ``` $ fortune | cowsay @@ -43,7 +44,7 @@ $ fortune | cowsay                 ||     || ``` -就这样!**CowSay** 几乎没有变化,称为 cow 文件,通常可以在 **/usr/share/cowsay** ,要查看系统上可用的 cow 文件选项,请在 cowsay 之后使用 **-l** 。然后,用 **-f** 试试其中之一。 +就这样!`cowsay` 还有点小变体,称为 cow 文件,通常可以在 `/usr/share/cowsay` 找到 ,要查看系统上可用的 cow 文件,请在 `cowsay` 之后使用 `-l` 。然后,用 `-f` 试试其中之一。 ``` $ cowsay -f dragon "Run for cover, I feel a sneeze coming on." @@ -68,10 +69,10 @@ $ cowsay -f dragon "Run for cover, I feel a sneeze coming on."                ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~                                                                   /.-~ ``` -我对 **cowsay** 的真正不满是,我今天没有足够的时间来为牛的挤奶。牛排太高了,我可能会开个玩笑。 -更严重的是,我已经完全忘记了 **cowsay** 直到我在学习可翻译的剧本时再次遇到它。如果你碰巧安装了 **cowyay**,当你运行脚本时,你会从一系列奶牛身上获得产出。例如,运行本脚本: +我对 `cowsay` 的真正不满是,我今天没有足够的时间来为牛的挤奶 —— 一语双关。牛排价格太高了,我只是开个玩笑。 +更严重的是,我已经完全忘记了 `cowsay` 直到我在学习 Ansible 的剧本时再次遇到它。如果你碰巧安装了 `cowyay`,当你运行Ansible 的剧本时,你会从一队奶牛那里获得输出。例如,运行这个剧本: ``` - hosts: @@ -79,7 +80,8 @@ $ cowsay -f dragon "Run for cover, I feel a sneeze coming on."   tasks:     - action: ping ``` -可能会给你以下信息: + +可能会给你以下信息: ``` $ ansible-playbook playbook.yml @@ -123,14 +125,14 @@ ok: [localhost] localhost                  : ok=2    changed=0    unreachable=0    failed=0   ``` -**Cowsay** 在GPLV3许可证下可用,您可以在 GitHub 上找到 Perl [源代码][2]。我也见过其他语言的版本,所以看看其他变体;例如,这是 [R语言][3] 。用你选择的语言实现你自己的版本可能是一项有趣的编程学习任务。 -Now that **cowsay** is out of the way, we can move on to greener pastures. -既然 **cowsay** 不碍事了,我们可以去更绿色的牧场了。 +`cowsay` 在 GPLv3 许可证下可用,您可以在 GitHub 上找到 它的 Perl [源代码][2]。我也见过其他语言的版本,所以可以看看其他变体;例如,这是 [R 语言版][3]。用你选择的语言实现你自己的版本可能是一项有趣的编程学习任务。 -你有最喜欢的命令行玩具吗,你认为我应该对它进行分析?这个系列的日历大部分都填好了,但我还有一些地方。在下面的评论中让我知道,梦幻篮球来看看。如果有空间,梦幻篮球会尝试把它包括进去。如果没有,但是我收到了一些好的意见书,梦幻篮球在结尾做了一个荣誉提名的总结。 +既然讲完了 `cowsay`,我们可以去更绿色的牧场了。 -看看昨天的玩具,[如何给你的Linux终端带来好运][1],明天再来看看另一个! +你有希望我来介绍的喜欢的命令行玩具吗?这个系列的排期大部分都填好了,但我还有一些空位方。在下面的评论中让我知道,我会来看看。如果有空间,我会尝试把它包括进去。如果没有,但是我收到了一些好的意见,我在结尾提及。 + +看看昨天的玩具,[如何给你的 Linux 终端带来好运][1],明天再来看看另一个! -------------------------------------------------------------------------------- @@ -139,7 +141,7 @@ via: https://opensource.com/article/18/12/linux-toy-cowsay 作者:[Jason Baker][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0edbad70ff8d58c20d658fb5ddd064fb8339e500 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 13:29:20 +0800 Subject: [PATCH 0856/1143] PUB:20181204 Have a cow at the Linux command line.md @heguangzhi https://linux.cn/article-10346-1.html --- .../20181204 Have a cow at the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181204 Have a cow at the Linux command line.md (98%) diff --git a/translated/tech/20181204 Have a cow at the Linux command line.md b/published/20181204 Have a cow at the Linux command line.md similarity index 98% rename from translated/tech/20181204 Have a cow at the Linux command line.md rename to published/20181204 Have a cow at the Linux command line.md index 3be26492fe..ad7b054d9a 100644 --- a/translated/tech/20181204 Have a cow at the Linux command line.md +++ b/published/20181204 Have a cow at the Linux command line.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (Have a cow at the Linux command line) [#]: via: (https://opensource.com/article/18/12/linux-toy-cowsay) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10346-1.html) 在 Linux 命令行上拥有一头奶牛 From 570ff6a04195b65bd5410c4f5510ec37afa6dcbd Mon Sep 17 00:00:00 2001 From: qhwdw Date: Fri, 14 Dec 2018 14:16:16 +0800 Subject: [PATCH 0857/1143] fixed errors --- ...mputing with Open Source Cirq Framework.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md index 289a62de15..fcbc89e77c 100644 --- a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md +++ b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md @@ -6,15 +6,15 @@ -在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2] 这个词来自拉丁语 Quantus,意思是 “非常小”,在下面的短视频链接中有描述: +在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2] 这个词来自拉丁语 Quantus,意思是 “有多少”,在下面的短视频链接中有描述: -为了易于我们理解量子计算,我们将量子计算与传统计算Classical Computing(也译做经典计算)进行比较。传统计算是指设计用于工作的、我们正在使用的传统计算机,正如你现在用于阅读本文的设备,就是我们所谓的传统计算设备。 +为了易于我们理解量子计算,我们将量子计算与经典计算Classical Computing(也有译做传统计算)进行比较。经典计算是指设计用于工作的、正在使用的计算机,正如你现在用于阅读本文的设备,就是我们所谓的经典计算设备。 -### 传统计算 +### 经典计算 -传统计算是描述传统计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。传统计算机不会理解除 1 或 0 之外的任何其它东西。 +经典计算是描述计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。经典计算机不会理解除 1 或 0 之外的任何其它东西。 直白来说,在计算机内部一个晶体管只能是开(1)或关(0)。我们输入的任何信息都被转换为无数个 1 和 0,所以计算机只能理解和存储 1 和 0。所有的东西都只能用无数个 1 和 0 的组合来表示。 @@ -22,7 +22,7 @@ ### 量子计算 -然而,量子计算不再像传统计算那样遵循 “开或关” 的模式。而是,借助量子的名为 [叠加和纠缠][3] 的两个现象,能同时处理信息的多个状态,因此能以更快的速率加速计算,并且在信息存储方面效率更高。 +然而,量子计算不再像经典计算那样遵循 “开或关” 的模式。而是,借助量子的名为 [叠加和纠缠][3] 的两个现象,能同时处理信息的多个状态,因此能以更快的速率加速计算,并且在信息存储方面效率更高。 请注意,叠加和纠缠 [不是同一个现象][4]。 @@ -30,9 +30,9 @@ ![][5] -就像在传统计算中,我们有比特bit,在量子计算中,我们相应也有量子比特qubits(或 Quantum bits)。想了解它们二者之间的巨大差异之处,请查看这个 [页面][6],从那里的图片中可以得到答案。 +就像在经典计算中,我们有比特bit,在量子计算中,我们相应也有量子比特qubits(或 Quantum bits)。想了解它们二者之间的巨大差异之处,请查看这个 [页面][6],从那里的图片中可以得到答案。 -量子计算机并不是来替代我们的传统计算机的。但是,有一些非常巨大的任务用我们的传统计算机是无法完成的,而那些正是量子计算机大显身手的好机会。下面链接的视频详细描述了上述情况,同时也描述了量子计算机的原理。 +量子计算机并不是来替代我们的经典计算机的。但是,有一些非常巨大的任务用我们的经典计算机是无法完成的,而那些正是量子计算机大显身手的好机会。下面链接的视频详细描述了上述情况,同时也描述了量子计算机的原理。 @@ -44,7 +44,7 @@ 根据最新更新的(2018 年 7 月 31 日)研究论文,术语 “Noisy” 是指由于对量子比特未能完全控制所产生的不准确性。正是这种不准确性严重制约了量子设备短期内实现其目标。 -“中型” 指的是在接下来的几年中,量子计算机将要实现的规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力][7] 模拟能力。更多信息请阅读 [这里的][9] 论文。 +“中型” 指的是在接下来的几年中,量子计算机将要实现的量子规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力][7] 模拟能力。更多信息请阅读 [这里的][9] 论文。 随着 Cirq 出现,许多事情将会发生变化。 @@ -133,7 +133,7 @@ Cirq 的开发者在 GitHub 上已经放了学习 [教程][22]。如果你想认 #### OpenFermion-Cirq -[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵表示费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米— 狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。 +[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵代表的费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米— 狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。 OpenFermion 被称为从事 [量子化学][29] 的化学家和研究人员的 [一个极好的实践工具][28]。量子化学主要专注于 [量子力学][30] 在物理模型和化学系统实验中的应用。量子化学也被称为 [分子量子力学][31]。 @@ -143,7 +143,7 @@ Cirq 的出现使 OpenFermion 通过提供程序和工具去扩展功能成为 2018 年 3 月 5 日,在洛杉矶举行的一年一度的 [美国物理学会会议][33] 上,Google 发布了 [Bristlecone][32],这是他们的最新的量子处理器。这个 [基于门的超导系统][34] 为 Google 提供了一个测试平台,用以研究 [量子比特技术][37] 的 [系统错误率][35] 和 [扩展性][36] ,以及在量子 [仿真][38]、[优化][39]、和 [机器学习][40] 方面的应用。 -Google 希望在不久的将来,能够制造出它的 [云可访问][41] 的 72 个量子比特的 Bristlecone 量子处理器。Bristlecone 将越来越有能力完成一个传统超级计算机无法在合理时间内完成的任务。 +Google 希望在不久的将来,能够制造出它的 [云可访问][41] 的 72 个量子比特的 Bristlecone 量子处理器。Bristlecone 将越来越有能力完成一个经典超级计算机无法在合理时间内完成的任务。 Cirq 将让研究人员直接在云上为 Bristlecone 写程序变得很容易,它提供了一个非常方便的、实时的、量子编程和测试的接口。 @@ -164,7 +164,7 @@ Cirq 将允许我们去: ### 总结 -最后我们总结一下,我们首先通过与传统计算相比较,介绍了量子计算的概念,然后是一个非常重要的视频来介绍了自去年以来量子计算的最新发展。接着我们简单讨论了嘈杂中型量子,也就是为什么要特意构建 Cirq 的原因所在。 +最后我们总结一下,我们首先通过与经典计算相比较,介绍了量子计算的概念,然后是一个非常重要的视频来介绍了自去年以来量子计算的最新发展。接着我们简单讨论了嘈杂中型量子,也就是为什么要特意构建 Cirq 的原因所在。 我们看了如何在一个 Ubuntu 系统上安装和测试 Cirq。我们也在一个更好用的 IDE 环境中做了安装测试,并使用一些资源去开始学习有关概念。 From 6e8022ff249ef730a44c50a02a6c6f19e857bd8d Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Fri, 14 Dec 2018 13:46:21 +0800 Subject: [PATCH 0858/1143] Update 20181210 How to Update Ubuntu.md --- ... How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md index 50ba70c073..3a9036f403 100644 --- a/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md +++ b/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md @@ -1,11 +1,12 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (LazyWolfLin) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Update Ubuntu [Terminal & GUI Methods] It's FOSS) [#]: via: (https://itsfoss.com/update-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +Translating by LazyWolfLin How to Update Ubuntu [Terminal & GUI Methods] It's FOSS ====== From a999ca5553f426d137f9c292f2d76468ff7aed40 Mon Sep 17 00:00:00 2001 From: wwhio Date: Fri, 14 Dec 2018 16:19:54 +0800 Subject: [PATCH 0859/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20180623 The IBM 029 Card Punch.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/talk/20180623 The IBM 029 Card Punch.md b/sources/talk/20180623 The IBM 029 Card Punch.md index b8af5fb602..6b36845c2d 100644 --- a/sources/talk/20180623 The IBM 029 Card Punch.md +++ b/sources/talk/20180623 The IBM 029 Card Punch.md @@ -1,3 +1,6 @@ +Translating by wwhio + + The IBM 029 Card Punch ====== Lines of code longer than 80 characters drive me crazy. I appreciate that this is pedantic. I’ve seen people on the internet make good arguments for why the 80-character limit ought to be respected even on our modern Retina-display screens, but those arguments hardly justify the visceral hatred I feel for even that one protruding 81st character. From 1f801d3d030d0ff0a6675b0aa2c9c140919695b6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 16:38:54 +0800 Subject: [PATCH 0860/1143] PRF:20181102 Create a containerized machine learning model.md @geekpi --- ...Create a containerized machine learning model.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/translated/tech/20181102 Create a containerized machine learning model.md b/translated/tech/20181102 Create a containerized machine learning model.md index 7c48ba6af7..0bad5a3bc6 100644 --- a/translated/tech/20181102 Create a containerized machine learning model.md +++ b/translated/tech/20181102 Create a containerized machine learning model.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (Create a containerized machine learning model) [#]: via: (https://fedoramagazine.org/create-containerized-machine-learning-model/) @@ -32,7 +32,7 @@ mkdir deployment_container && cd deployment_container 下一步是为机器学习模型创建 REST API。这个 [github 仓库][4]包含一个预训练模型,以及能让 REST API 工作的设置。 -使用以下命令在 deployment_container 目录中克隆它: +使用以下命令在 `deployment_container` 目录中克隆它: ``` git clone https://github.com/svenboesiger/titanic_tf_ml_model.git @@ -44,7 +44,7 @@ git clone https://github.com/svenboesiger/titanic_tf_ml_model.git #### swagger.yaml -swagger.yaml 使用 [Swagger规范][7] 定义 Connexion 库的 API。此文件包含让你的服务器提供输入参数验证、输出响应数据验证、URL 端点定义所需的所有信息。 +[swagger.yaml][12] 使用 [Swagger规范][7] 定义 Connexion 库的 API。此文件包含让你的服务器提供输入参数验证、输出响应数据验证、URL 端点定义所需的所有信息。 额外地,Connexion 还将给你提供一个简单但有用的单页 Web 应用,它演示了如何使用 Javascript 调用 API 和更新 DOM。 @@ -110,7 +110,7 @@ pandas ### 容器化! -为了让 Podman 构建映像,请在上面的准备步骤中创建的 **deployment_container** 目录中创建一个名为 “Dockerfile” 的新文件: +为了让 Podman 构建映像,请在上面的准备步骤中创建的 `deployment_container` 目录中创建一个名为 `Dockerfile` 的新文件: ``` FROM fedora:28 @@ -171,7 +171,7 @@ via: https://fedoramagazine.org/create-containerized-machine-learning-model/ 作者:[Sven Bösiger][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/) 荣誉推出 @@ -187,4 +187,5 @@ via: https://fedoramagazine.org/create-containerized-machine-learning-model/ [8]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/server.py [9]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/requirements.txt [10]: http://0.0.0.0:5000/ -[11]: https://fedoramagazine.org/wp-content/uploads/2018/10/Screenshot-from-2018-10-27-14-46-56-682x1024.png \ No newline at end of file +[11]: https://fedoramagazine.org/wp-content/uploads/2018/10/Screenshot-from-2018-10-27-14-46-56-682x1024.png +[12]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/swagger.yaml From 5973f0ef5be151ca0023d5f2571d7c8a7c609242 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 16:40:28 +0800 Subject: [PATCH 0861/1143] REV:20181102 Create a containerized machine learning model.md @geekpi --- .../20181102 Create a containerized machine learning model.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => review}/20181102 Create a containerized machine learning model.md (100%) diff --git a/translated/tech/20181102 Create a containerized machine learning model.md b/review/20181102 Create a containerized machine learning model.md similarity index 100% rename from translated/tech/20181102 Create a containerized machine learning model.md rename to review/20181102 Create a containerized machine learning model.md From 517cd3c6f43fe63e90434c075f580ebfe2dd3c9a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 16:43:00 +0800 Subject: [PATCH 0862/1143] Revert "REV:20181102 Create a containerized machine learning model.md" This reverts commit 5973f0ef5be151ca0023d5f2571d7c8a7c609242. --- .../20181102 Create a containerized machine learning model.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {review => translated/tech}/20181102 Create a containerized machine learning model.md (100%) diff --git a/review/20181102 Create a containerized machine learning model.md b/translated/tech/20181102 Create a containerized machine learning model.md similarity index 100% rename from review/20181102 Create a containerized machine learning model.md rename to translated/tech/20181102 Create a containerized machine learning model.md From 9304ca0b08e70d1af725ebc7a37945561d6f5e16 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 17:30:41 +0800 Subject: [PATCH 0863/1143] PRF:20180814 HTTP request routing and validation with gorilla-mux.md @yongshouzhang --- ...routing and validation with gorilla-mux.md | 636 ++++++------------ 1 file changed, 214 insertions(+), 422 deletions(-) diff --git a/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md b/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md index 4699398bcc..4dcf7f7f52 100644 --- a/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md +++ b/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md @@ -1,68 +1,70 @@ -使用 gorilla/mux 进行HTTP请求路由和验证 +使用 gorilla/mux 进行 HTTP 请求路由和验证 ====== +> gorilla/mux 包以直观的 API 提供了 HTTP 请求路由、验证和其它服务。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr) -Go 网络库包括 `http.ServeMux` 结构类型,它支持 HTTP 请求多路复用(路由):Web 服务器将托管资源的 HTTP 请求与诸如 sales4today 之类的 URI 路由到代码处理程序; 处理程序在发送 HTTP 响应(通常是 HTML 页面)之前执行适当的逻辑。 这是该体系的草图: +Go 网络库包括 `http.ServeMux` 结构类型,它支持 HTTP 请求多路复用(路由):Web 服务器将托管资源的 HTTP 请求与诸如 `/sales4today` 之类的 URI 路由到代码处理程序;处理程序在发送 HTTP 响应(通常是 HTML 页面)之前执行适当的逻辑。 这是该体系的草图: ``` -                 +------------+     +--------+     +---------+ -HTTP 请求---->| web 服务器 |---->| 路由 |---->| 处理程序| -                 +------------+     +--------+     +---------+ +             +-----------+     +--------+     +---------+ +HTTP 请求---->| web 服务器 |---->| 路由 |---->| 处理程序 | +             +-----------+     +--------+     +---------+ ``` -调用 `ListenAndServe` 方法后启动 HTTP 服务器 +调用 `ListenAndServe` 方法后启动 HTTP 服务器: ``` http.ListenAndServe(":8888", nil) // args: port & router ``` - 第二个参数 `nil` 意味着 `DefaultServeMux` 用于请求路由。 `gorilla/mux` 库包含 `mux.Router` 类型,可替代 `DefaultServeMux` 或自定义请求多路复用器。 在 `ListenAndServe` 调用中,`mux.Router` 实例将代替 `nil` 作为第二个参数。 下面的示例代码很好的说明了为什么 `mux.Router`如此吸引人: -### 1\. A sample crud web app +### 1、一个简单的 CRUD web 应用程序 + +crud web 应用程序(见下文)支持四种 CRUD(创建/读取/更新/删除)操作,它们分别对应四种 HTTP 请求方法:POST、GET、PUT 和 DELETE。 在这个 CRUD 应用程序中,所管理的资源是套话与反套话的列表,每个都是套话及其反面的的套话,例如这对: -crud web 应用程序(见下文)支持四种 CRUD(创建读取更新删除)操作,它们分别对应四种 HTTP 请求方法:POST,GET,PUT 和 DELETE。 在 crud 应用程序中,托管资源是陈词滥调对的列表,每个陈词滥调都是陈词滥调和冲突的陈词滥调,例如这对: ``` Out of sight, out of mind. Absence makes the heart grow fonder. - ``` -可以添加新的陈词滥调对,可以编辑或删除现有的陈词滥调对。 +可以添加新的套话对,可以编辑或删除现有的套话对。 + +CRUD web 应用程序: -**crud web 应用程序** ``` package main import ( -   "gorilla/mux" -   "net/http" -   "fmt" -   "strconv" + "gorilla/mux" + "net/http" + "fmt" + "strconv" ) const GETALL string = "GETALL" const GETONE string = "GETONE" -const POST string   = "POST" -const PUT string    = "PUT" +const POST string = "POST" +const PUT string = "PUT" const DELETE string = "DELETE" type clichePair struct { -   Id      int -   Cliche  string -   Counter string + Id int + Cliche string + Counter string } // Message sent to goroutine that accesses the requested resource. type crudRequest struct { -   verb     string -   cp       *clichePair -   id       int -   cliche   string -   counter  string -   confirm  chan string + verb string + cp *clichePair + id int + cliche string + counter string + confirm chan string } var clichesList = []*clichePair{} @@ -72,596 +74,386 @@ var crudRequests chan *crudRequest // GET / // GET /cliches func ClichesAll(res http.ResponseWriter, req *http.Request) { -   cr := &crudRequest{verb: GETALL, confirm: make(chan string)} -   completeRequest(cr, res, "read all") + cr := &crudRequest{verb: GETALL, confirm: make(chan string)} + completeRequest(cr, res, "read all") } // GET /cliches/id func ClichesOne(res http.ResponseWriter, req *http.Request) { -   id := getIdFromRequest(req) -   cr := &crudRequest{verb: GETONE, id: id, confirm: make(chan string)} -   completeRequest(cr, res, "read one") + id := getIdFromRequest(req) + cr := &crudRequest{verb: GETONE, id: id, confirm: make(chan string)} + completeRequest(cr, res, "read one") } // POST /cliches - func ClichesCreate(res http.ResponseWriter, req *http.Request) { - -   cliche, counter := getDataFromRequest(req) - -   cp := new(clichePair) - -   cp.Cliche = cliche - -   cp.Counter = counter - -   cr := &crudRequest{verb: POST, cp: cp, confirm: make(chan string)} - -   completeRequest(cr, res, "create") - + cliche, counter := getDataFromRequest(req) + cp := new(clichePair) + cp.Cliche = cliche + cp.Counter = counter + cr := &crudRequest{verb: POST, cp: cp, confirm: make(chan string)} + completeRequest(cr, res, "create") } - - // PUT /cliches/id - func ClichesEdit(res http.ResponseWriter, req *http.Request) { - -   id := getIdFromRequest(req) - -   cliche, counter := getDataFromRequest(req) - -   cr := &crudRequest{verb: PUT, id: id, cliche: cliche, counter: counter, confirm: make(chan string)} - -   completeRequest(cr, res, "edit") - + id := getIdFromRequest(req) + cliche, counter := getDataFromRequest(req) + cr := &crudRequest{verb: PUT, id: id, cliche: cliche, counter: counter, confirm: make(chan string)} + completeRequest(cr, res, "edit") } - - // DELETE /cliches/id - func ClichesDelete(res http.ResponseWriter, req *http.Request) { - -   id := getIdFromRequest(req) - -   cr := &crudRequest{verb: DELETE, id: id, confirm: make(chan string)} - -   completeRequest(cr, res, "delete") - + id := getIdFromRequest(req) + cr := &crudRequest{verb: DELETE, id: id, confirm: make(chan string)} + completeRequest(cr, res, "delete") } - - func completeRequest(cr *crudRequest, res http.ResponseWriter, logMsg string) { - -   crudRequests<-cr - -   msg := <-cr.confirm - -   res.Write([]byte(msg)) - -   logIt(logMsg) - + crudRequests<-cr + msg := <-cr.confirm + res.Write([]byte(msg)) + logIt(logMsg) } - - func main() { + populateClichesList() -   populateClichesList() - - - -   // From now on, this gorountine alone accesses the clichesList. - -   crudRequests = make(chan *crudRequest, 8) - -   go func() { // resource manager - -      for { - -         select { - -         case req := <-crudRequests: - -         if req.verb == GETALL { - -            req.confirm<-readAll() - -         } else if req.verb == GETONE { - -            req.confirm<-readOne(req.id) - -         } else if req.verb == POST { - -            req.confirm<-addPair(req.cp) - -         } else if req.verb == PUT { - -            req.confirm<-editPair(req.id, req.cliche, req.counter) - -         } else if req.verb == DELETE { - -            req.confirm<-deletePair(req.id) - -         } - -      } - -   }() - -   startServer() - + // From now on, this gorountine alone accesses the clichesList. + crudRequests = make(chan *crudRequest, 8) + go func() { // resource manager + for { + select { + case req := <-crudRequests: + if req.verb == GETALL { + req.confirm<-readAll() + } else if req.verb == GETONE { + req.confirm<-readOne(req.id) + } else if req.verb == POST { + req.confirm<-addPair(req.cp) + } else if req.verb == PUT { + req.confirm<-editPair(req.id, req.cliche, req.counter) + } else if req.verb == DELETE { + req.confirm<-deletePair(req.id) + } + } + }() + startServer() } - - func startServer() { + router := mux.NewRouter() -   router := mux.NewRouter() + // Dispatch map for CRUD operations. + router.HandleFunc("/", ClichesAll).Methods("GET") + router.HandleFunc("/cliches", ClichesAll).Methods("GET") + router.HandleFunc("/cliches/{id:[0-9]+}", ClichesOne).Methods("GET") + router.HandleFunc("/cliches", ClichesCreate).Methods("POST") + router.HandleFunc("/cliches/{id:[0-9]+}", ClichesEdit).Methods("PUT") + router.HandleFunc("/cliches/{id:[0-9]+}", ClichesDelete).Methods("DELETE") + http.Handle("/", router) // enable the router -   // Dispatch map for CRUD operations. - -   router.HandleFunc("/", ClichesAll).Methods("GET") - -   router.HandleFunc("/cliches", ClichesAll).Methods("GET") - -   router.HandleFunc("/cliches/{id:[0-9]+}", ClichesOne).Methods("GET") - - - -   router.HandleFunc("/cliches", ClichesCreate).Methods("POST") - -   router.HandleFunc("/cliches/{id:[0-9]+}", ClichesEdit).Methods("PUT") - -   router.HandleFunc("/cliches/{id:[0-9]+}", ClichesDelete).Methods("DELETE") - - - -   http.Handle("/", router) // enable the router - - - -   // Start the server. - -   port := ":8888" - -   fmt.Println("\nListening on port " + port) - -   http.ListenAndServe(port, router); // mux.Router now in play - + // Start the server. + port := ":8888" + fmt.Println("\nListening on port " + port) + http.ListenAndServe(port, router); // mux.Router now in play } - - // Return entire list to requester. - func readAll() string { - -   msg := "\n" - -   for _, cliche := range clichesList { - -      next := strconv.Itoa(cliche.Id) + ": " + cliche.Cliche + "  " + cliche.Counter + "\n" - -      msg += next - -   } - -   return msg - + msg := "\n" + for _, cliche := range clichesList { + next := strconv.Itoa(cliche.Id) + ": " + cliche.Cliche + " " + cliche.Counter + "\n" + msg += next + } + return msg } - - // Return specified clichePair to requester. - func readOne(id int) string { + msg := "\n" + "Bad Id: " + strconv.Itoa(id) + "\n" -   msg := "\n" + "Bad Id: " + strconv.Itoa(id) + "\n" - - - -   index := findCliche(id) - -   if index >= 0 { - -      cliche := clichesList[index] - -      msg = "\n" + strconv.Itoa(id) + ": " + cliche.Cliche + "  " + cliche.Counter + "\n" - -   } - -   return msg - + index := findCliche(id) + if index >= 0 { + cliche := clichesList[index] + msg = "\n" + strconv.Itoa(id) + ": " + cliche.Cliche + " " + cliche.Counter + "\n" + } + return msg } - - // Create a new clichePair and add to list - func addPair(cp *clichePair) string { - -   cp.Id = masterId - -   masterId++ - -   clichesList = append(clichesList, cp) - -   return "\nCreated: " + cp.Cliche + " " + cp.Counter + "\n" - + cp.Id = masterId + masterId++ + clichesList = append(clichesList, cp) + return "\nCreated: " + cp.Cliche + " " + cp.Counter + "\n" } - - // Edit an existing clichePair - func editPair(id int, cliche string, counter string) string { - -   msg := "\n" + "Bad Id: " + strconv.Itoa(id) + "\n" - -   index := findCliche(id) - -   if index >= 0 { - -      clichesList[index].Cliche = cliche - -      clichesList[index].Counter = counter - -      msg = "\nCliche edited: " + cliche + " " + counter + "\n" - -   } - -   return msg - + msg := "\n" + "Bad Id: " + strconv.Itoa(id) + "\n" + index := findCliche(id) + if index >= 0 { + clichesList[index].Cliche = cliche + clichesList[index].Counter = counter + msg = "\nCliche edited: " + cliche + " " + counter + "\n" + } + return msg } - - // Delete a clichePair - func deletePair(id int) string { - -   idStr := strconv.Itoa(id) - -   msg := "\n" + "Bad Id: " + idStr + "\n" - -   index := findCliche(id) - -   if index >= 0 { - -      clichesList = append(clichesList[:index], clichesList[index + 1:]...) - -      msg = "\nCliche " + idStr + " deleted\n" - -   } - -   return msg - + idStr := strconv.Itoa(id) + msg := "\n" + "Bad Id: " + idStr + "\n" + index := findCliche(id) + if index >= 0 { + clichesList = append(clichesList[:index], clichesList[index + 1:]...) + msg = "\nCliche " + idStr + " deleted\n" + } + return msg } - - //*** utility functions - func findCliche(id int) int { - -   for i := 0; i < len(clichesList); i++ { - -      if id == clichesList[i].Id { - -         return i; - -      } - -   } - -   return -1 // not found - + for i := 0; i < len(clichesList); i++ { + if id == clichesList[i].Id { + return i; + } + } + return -1 // not found } - - func getIdFromRequest(req *http.Request) int { - -   vars := mux.Vars(req) - -   id, _ := strconv.Atoi(vars["id"]) - -   return id - + vars := mux.Vars(req) + id, _ := strconv.Atoi(vars["id"]) + return id } - - func getDataFromRequest(req *http.Request) (string, string) { - -   // Extract the user-provided data for the new clichePair - -   req.ParseForm() - -   form := req.Form - -   cliche := form["cliche"][0]    // 1st and only member of a list - -   counter := form["counter"][0]  // ditto - -   return cliche, counter - + // Extract the user-provided data for the new clichePair + req.ParseForm() + form := req.Form + cliche := form["cliche"][0] // 1st and only member of a list + counter := form["counter"][0] // ditto + return cliche, counter } - - func logIt(msg string) { - -   fmt.Println(msg) - + fmt.Println(msg) } - - func populateClichesList() { + var cliches = []string { + "Out of sight, out of mind.", + "A penny saved is a penny earned.", + "He who hesitates is lost.", + } + var counterCliches = []string { + "Absence makes the heart grow fonder.", + "Penny-wise and dollar-foolish.", + "Look before you leap.", + } -   var cliches = []string { - -      "Out of sight, out of mind.", - -      "A penny saved is a penny earned.", - -      "He who hesitates is lost.", - -   } - -   var counterCliches = []string { - -      "Absence makes the heart grow fonder.", - -      "Penny-wise and dollar-foolish.", - -      "Look before you leap.", - -   } - - - -   for i := 0; i < len(cliches); i++ { - -      cp := new(clichePair) - -      cp.Id = masterId - -      masterId++ - -      cp.Cliche = cliches[i] - -      cp.Counter = counterCliches[i] - -      clichesList = append(clichesList, cp) - -   } - + for i := 0; i < len(cliches); i++ { + cp := new(clichePair) + cp.Id = masterId + masterId++ + cp.Cliche = cliches[i] + cp.Counter = counterCliches[i] + clichesList = append(clichesList, cp) + } } - ``` -为了专注于请求路由和验证,crud 应用程序不使用 HTML 页面作为请求响应。 相反,请求会产生明文响应消息:陈词滥调对的列表是对 GET 请求的响应,确认新的陈词滥调对已添加到列表中是对 POST 请求的响应,依此类推。 这种简化使得使用命令行实用程序(如 [curl] [1])可以轻松地测试应用程序,尤其是 `gorilla/mux` 组件。 +为了专注于请求路由和验证,CRUD 应用程序不使用 HTML 页面作为请求响应。 相反,请求会产生明文响应消息:套话对的列表是对 GET 请求的响应,确认新的套话对已添加到列表中是对 POST 请求的响应,依此类推。 这种简化使得使用命令行实用程序(如 [curl][1])可以轻松地测试应用程序,尤其是 `gorilla/mux` 组件。 -`gorilla/mux` 包可以从 [GitHub] [2] 安装。 crud app 无限期运行; 因此,应使用 Control-C 或同等命令终止。 crud 应用程序的代码,以及自述文件和简单的 curl 测试,可以在[我的网站] [3]上找到。 +`gorilla/mux` 包可以从 [GitHub][2] 安装。 CRUD app 无限期运行;因此,应使用 `Control-C` 或同等命令终止。 CRUD 应用程序的代码,以及自述文件和简单的 curl 测试,可以在[我的网站] [3]上找到。 -### 2\. 请求路由 +### 2、请求路由 -`mux.Router` 扩展了 REST 风格的路由,它赋给 HTTP 方法(例如,GET)和 URL 末尾的 URI 或路径(例如/cliches)相同的权重。 URI 用作 HTTP 动词(方法)的名词。 例如,在HTTP请求中有一个起始行,例如 +`mux.Router` 扩展了 REST 风格的路由,它赋给 HTTP 方法(例如,GET)和 URL 末尾的 URI 或路径(例如 `/cliches`)相同的权重。 URI 用作 HTTP 动词(方法)的名词。 例如,在HTTP请求中有一个起始行,例如: ``` GET /cliches - ``` -意味着得到所有的陈词滥调对,而一个起始线,如 +意味着得到所有的套话对,而一个起始线,如: ``` POST /cliches - ``` -意味着从HTTP正文中的数据创建一个陈词滥调对。 +意味着从 HTTP 正文中的数据创建一个套话对。 + +在 CRUD web 应用程序中,有五个函数充当 HTTP 请求的五种变体的请求处理程序: -在 crud web 应用程序中,有五个函数充当HTTP请求的五种变体的请求处理程序: ``` -ClichesAll(...)    # GET: 获取所有的陈词滥调对 - -ClichesOne(...)    # GET: 获取指定的陈词滥调对 - -ClichesCreate(...) # POST: 创建新的陈词滥调对 - -ClichesEdit(...)   # PUT: 编辑现有的陈词滥调对 - -ClichesDelete(...) # DELETE: 删除指定的陈词滥调对 - +ClichesAll(...)    # GET: 获取所有的套话对 +ClichesOne(...)    # GET: 获取指定的套话对 +ClichesCreate(...) # POST: 创建新的套话对 +ClichesEdit(...)   # PUT: 编辑现有的套话对 +ClichesDelete(...) # DELETE: 删除指定的套话对 ``` 每个函数都有两个参数:一个 `http.ResponseWriter` 用于向请求者发送一个响应,一个指向 `http.Request` 的指针,该指针封装了底层 HTTP 请求的信息。 使用 `gorilla/mux` 包可以轻松地将这些请求处理程序注册到Web服务器,并执行基于正则表达式的验证。 -crud 应用程序中的 `startServer` 函数注册请求处理程序。 考虑这对注册,`router` 作为 `mux.Router` 实例: +CRUD 应用程序中的 `startServer` 函数注册请求处理程序。 考虑这对注册,`router` 作为 `mux.Router` 实例: + ``` router.HandleFunc("/", ClichesAll).Methods("GET") - router.HandleFunc("/cliches", ClichesAll).Methods("GET") - ``` -这些语句意味着对单斜线/ 或 /cliches 的 GET 请求应该路由到 `ClichesAll` 函数,然后处理请求。 例如,curl 请求(使用%作为命令行提示符) +这些语句意味着对单斜线 `/` 或 `/cliches` 的 GET 请求应该路由到 `ClichesAll` 函数,然后处理请求。 例如,curl 请求(使用 `%` 作为命令行提示符): ``` % curl --request GET localhost:8888/ - ``` -会产生如下结果 +会产生如下结果: + ``` 1: Out of sight, out of mind.  Absence makes the heart grow fonder. - 2: A penny saved is a penny earned.  Penny-wise and dollar-foolish. - 3: He who hesitates is lost.  Look before you leap. - ``` -三个陈词滥调对是 crud 应用程序中的初始数据。 +这三个套话对是 CRUD 应用程序中的初始数据。 +在这句注册语句中: -在这句注册语句中 ``` router.HandleFunc("/cliches", ClichesAll).Methods("GET") - router.HandleFunc("/cliches", ClichesCreate).Methods("POST") - ``` -URI是相同的(/cliches),但动词不同:第一种情况下为 GET 请求,第二种情况下为 POST 请求。 此注册举例说明了 REST 样式的路由,因为仅动词的不同就足以将请求分派给两个不同的处理程序。 +URI 是相同的(`/cliches`),但动词不同:第一种情况下为 GET 请求,第二种情况下为 POST 请求。 此注册举例说明了 REST 样式的路由,因为仅动词的不同就足以将请求分派给两个不同的处理程序。 注册中允许多个 HTTP 方法,尽管这会影响 REST 风格路由的精髓: ``` router.HandleFunc("/cliches", DoItAll).Methods("POST", "GET") - ``` + 除了动词和 URI 之外,还可以在功能上路由 HTTP 请求。 例如,注册 ``` router.HandleFunc("/cliches", ClichesCreate).Schemes("https").Methods("POST") - ``` -要求对 POST 请求进行 HTTPS 访问以创建新的陈词滥调对。 以类似的方式,注册可能需要具有指定的 HTTP 头元素(例如,认证凭证)的请求。 -### 3\. Request validation +要求对 POST 请求进行 HTTPS 访问以创建新的套话对。以类似的方式,注册可能需要具有指定的 HTTP 头元素(例如,认证凭证)的请求。 + +### 3、 Request validation `gorilla/mux` 包采用简单,直观的方法通过正则表达式进行请求验证。 考虑此请求处理程序以获取一个操作: + ``` router.HandleFunc("/cliches/{id:[0-9]+}", ClichesOne).Methods("GET") - ``` -此注册排除了 HTTP 请求,例如 + +此注册排除了 HTTP 请求,例如: + ``` % curl --request GET localhost:8888/cliches/foo - ``` -因为 foo 不是十进制数字。 该请求导致熟悉的 404(未找到)状态码。 在此处理程序注册中包含正则表达式模式可确保仅在请求 URI 以十进制整数值结束时才调用 `ClichesOne` 函数来处理请求: +因为 foo 不是十进制数字。该请求导致熟悉的 404(未找到)状态码。 在此处理程序注册中包含正则表达式模式可确保仅在请求 URI 以十进制整数值结束时才调用 `ClichesOne` 函数来处理请求: ``` % curl --request GET localhost:8888/cliches/3  # ok - ``` -另一个例子,请求如下 +另一个例子,请求如下: + ``` % curl --request PUT --data "..." localhost:8888/cliches - ``` -此请求导致状态代码为 405(错误方法),因为 /cliches URI 在 crud 应用程序中仅在 GET 和 POST 请求中注册。 像 GET 请求一样,PUT 请求必须在 URI 的末尾包含一个数字id: + +此请求导致状态代码为 405(错误方法),因为 /cliches URI 在 CRUD 应用程序中仅在 GET 和 POST 请求中注册。 像 GET 请求一样,PUT 请求必须在 URI 的末尾包含一个数字 id: ``` router.HandleFunc("/cliches/{id:[0-9]+}", ClichesEdit).Methods("PUT") - ``` -### 4\. 并发问题 +### 4、并发问题 -`gorilla/mux` 路由器作为单独的 goroutine 执行对已注册的请求处理程序的每次调用,这意味着并发性被烘焙到包中。 例如,如果有十个同时发出的请求,例如 +`gorilla/mux` 路由器作为单独的 Go 协程执行对已注册的请求处理程序的每次调用,这意味着并发性被内置于包中。 例如,如果有十个同时发出的请求,例如 ``` % curl --request POST --data "..." localhost:8888/cliches - ``` -然后 `mux.Router` 启动十个 goroutines 来执行 `ClichesCreate` 处理程序。 +然后 `mux.Router` 启动十个 Go 协程来执行 `ClichesCreate` 处理程序。 -GET all,GET one,POST,PUT 和 DELETE 中的五个请求操作中,最后三个改变了所请求的资源,即包含陈词滥调对的共享 `clichesList`。 因此,crudapp 需要通过协调对`clichesList` 的访问来保证安全的并发性。 在不同但等效的术语中,crud app 必须防止 `clichesList` 上的竞争条件。 在生产环境中,可以使用数据库系统来存储诸如 `clichesList` 之类的资源,然后可以通过数据库事务来管理安全并发。 +GET all、GET one、POST、PUT 和 DELETE 中的五个请求操作中,最后三个改变了所请求的资源,即包含套话对的共享 `clichesList`。 因此,CRUD app 需要通过协调对 `clichesList` 的访问来保证安全的并发性。 在不同但等效的术语中,CRUD app 必须防止 `clichesList` 上的竞争条件。 在生产环境中,可以使用数据库系统来存储诸如 `clichesList` 之类的资源,然后可以通过数据库事务来管理安全并发。 -crud 应用程序采用推荐的Go方法来实现安全并发: +CRUD 应用程序采用推荐的Go方法来实现安全并发: -* 只有一个 goroutine,资源管理器在 crud app`startServer` 函数中启动,一旦 Web 服务器开始侦听请求,就可以访问 `clichesList`。 +* 只有一个 Go 协程,资源管理器在 CRUD app `startServer` 函数中启动,一旦 Web 服务器开始侦听请求,就可以访问 `clichesList`。 * 诸如 `ClichesCreate` 和 `ClichesAll` 之类的请求处理程序向 Go 通道发送(指向)`crudRequest` 实例(默认情况下是线程安全的),并且资源管理器单独从该通道读取。 然后,资源管理器对 `clichesList` 执行请求的操作。 安全并发体系结构绘制如下: ``` -                 crudRequest                   读/写 +           crudRequest                读/写 -请求处理程序 -------------> 资源托管者 ------------> 陈词滥调列表 +请求处理程序 -------------> 资源托管者 ------------> 套话列表 ``` -在这种架构中,不需要显式锁定 `clichesList`,因为一旦 CRUD 请求开始进入,只有一个 goroutine(资源管理器)访问 `clichesList`。 +在这种架构中,不需要显式锁定 `clichesList`,因为一旦 CRUD 请求开始进入,只有一个 Go 协程(资源管理器)访问 `clichesList`。 -为了使 crud 应用程序尽可能保持并发,在一方请求处理程序与另一方的单一资源管理器之间进行有效的分工至关重要。 在这里,为了审查,是 `ClichesCreate` 请求处理程序: +为了使 CRUD 应用程序尽可能保持并发,在一方请求处理程序与另一方的单一资源管理器之间进行有效的分工至关重要。 在这里,为了审查,是 `ClichesCreate` 请求处理程序: ``` func ClichesCreate(res http.ResponseWriter, req *http.Request) { - -   cliche, counter := getDataFromRequest(req) - -   cp := new(clichePair) - -   cp.Cliche = cliche - -   cp.Counter = counter - -   cr := &crudRequest{verb: POST, cp: cp, confirm: make(chan string)} - -   completeRequest(cr, res, "create") - -}ClichesCreateres httpResponseWriterreqclichecountergetDataFromRequestreqcpclichePaircpClicheclichecpCountercountercr&crudRequestverbPOSTcpcpconfirmcompleteRequestcrres - + cliche, counter := getDataFromRequest(req) + cp := new(clichePair) + cp.Cliche = cliche + cp.Counter = counter + cr := &crudRequest{verb: POST, cp: cp, confirm: make(chan string)} + completeRequest(cr, res, "create") +} ``` -`ClichesCreate` 调用实用函数 `getDataFromRequest`,它从 POST 请求中提取新的陈词滥调和反陈词滥调。 然后 `ClichesCreate` 函数创建一个新的 `ClichePair`,设置两个字段,并创建一个 `crudRequest` 发送给单个资源管理器。 此请求包括一个确认通道,资源管理器使用该通道将信息返回给请求处理程序。 所有设置工作都可以在不涉及资源管理器的情况下完成,因为尚未访问 `clichesList`。 -请求处理程序调用实用程序函数,该函数从 POST 请求中提取新的陈词滥调和反陈词滥调。 然后,该函数创建一个新的,设置两个字段,并创建 ato 发送到单个资源管理器。 此请求包括一个确认通道,资源管理器使用该通道将信息返回给请求处理程序。 所有设置工作都可以在不涉及资源管理器的情况下完成,因为尚未访问它。 +`ClichesCreate` 调用实用函数 `getDataFromRequest`,它从 POST 请求中提取新的套话和反套话。 然后 `ClichesCreate` 函数创建一个新的 `ClichePair`,设置两个字段,并创建一个 `crudRequest` 发送给单个资源管理器。 此请求包括一个确认通道,资源管理器使用该通道将信息返回给请求处理程序。 所有设置工作都可以在不涉及资源管理器的情况下完成,因为尚未访问 `clichesList`。 + +请求处理程序调用实用程序函数,该函数从 POST 请求中提取新的套话和反套话。 然后,该函数创建一个新的,设置两个字段,并创建一个 crudRequest 发送到单个资源管理器。 此请求包括一个确认通道,资源管理器使用该通道将信息返回给请求处理程序。 所有设置工作都可以在不涉及资源管理器的情况下完成,因为尚未访问它。 + +`completeRequest` 实用程序函数在 `ClichesCreate` 函数和其他请求处理程序的末尾调用: -`completeRequest` 实用程序函数在 `ClichesCreate` 函数和其他请求处理程序的末尾调用 ``` completeRequest(cr, res, "create") // shown above - ``` 通过将 `crudRequest` 放入 `crudRequests` 频道,使资源管理器发挥作用: + ``` func completeRequest(cr *crudRequest, res http.ResponseWriter, logMsg string) { -    crudRequests<-cr          // 向资源托管者发送请求 -    msg := <-cr.confirm       // 等待确认 -    res.Write([]byte(msg))    // 向请求方发送确认 -    logIt(logMsg)             // 打印到标准输出 - } - ``` + 对于 POST 请求,资源管理器调用实用程序函数 `addPair`,它会更改 `clichesList` 资源: + ``` func addPair(cp *clichePair) string { -    cp.Id = masterId  // 分配一个唯一的 ID -    masterId++        // 更新 ID 计数器 -    clichesList = append(clichesList, cp) // 更新列表 -    return "\nCreated: " + cp.Cliche + " " + cp.Counter + "\n" - } - ``` -资源管理器为其他CRUD操作调用类似的实用程序函数。 值得重复的是,一旦 Web 服务器开始接受请求,资源管理器就是唯一可以读取或写入 `clichesList` 的 goroutine。 +资源管理器为其他 CRUD 操作调用类似的实用程序函数。 值得重复的是,一旦 Web 服务器开始接受请求,资源管理器就是唯一可以读取或写入 `clichesList` 的 goroutine。 -对于任何类型的 Web 应用程序,`gorilla/mux` 包在简单直观的API中提供请求路由,请求验证和相关服务。 crud web 应用程序突出了软件包的主要功能。 给包裹一个测试驱动,你可能会成为买主。 +对于任何类型的 Web 应用程序,`gorilla/mux` 包在简单直观的 API 中提供请求路由、请求验证和相关服务。 CRUD web 应用程序突出了软件包的主要功能。 -------------------------------------------------------------------------------- @@ -670,7 +462,7 @@ via: https://opensource.com/article/18/8/http-request-routing-validation-gorilla 作者:[Marty Kalin][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[yongshouzhang](https://github.com/yongshouzhang) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 34b70e2c91e67a2b53c5988f9e383dd77b11549e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 18:28:47 +0800 Subject: [PATCH 0864/1143] PRF:20180104 How Creative Commons benefits artists and big business.md @Valoniakim --- ...mmons benefits artists and big business.md | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/translated/talk/20180104 How Creative Commons benefits artists and big business.md b/translated/talk/20180104 How Creative Commons benefits artists and big business.md index c04ed4c240..aefc804479 100644 --- a/translated/talk/20180104 How Creative Commons benefits artists and big business.md +++ b/translated/talk/20180104 How Creative Commons benefits artists and big business.md @@ -1,42 +1,49 @@ -知识共享是怎样造福艺术家和大企业的 +你所不知道的知识共享(CC) ====== + +> 知识共享为艺术家提供访问权限和原始素材。大公司也从中受益。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/CreativeCommons_ideas_520x292_1112JS.png?itok=otei0vKb) -我毕业于电影学院,毕业后在一所电影学校教书,之后进入一家主流电影工作室,我一直在从事电影相关的工作。创造业的方方面面面临着同一个问题:创造者需要原材料。有趣的是,自由文化运动提出了解决方案,具体来说是在自由文化运动中出现的知识共享组织。 +我毕业于电影学院,毕业后在一所电影学校教书,之后进入一家主流电影工作室,我一直在从事电影相关的工作。创意产业的方方面面面临着同一个问题:创作者需要原材料。有趣的是,自由文化运动提出了解决方案,具体来说是在自由文化运动中出现的知识共享Creative Commons组织。 -###知识共享能够为我们提供展示片段和小样 +### 知识共享能够为我们提供展示片段和小样 -和其他事情一样,创造力也需要反复练习。幸运的是,在我刚开始接触电脑时,就在一本渲染工场的专业杂志中接触到了开源这个存在。当时我并不理解所谓的“开源”是什么,但我知道只有开源工具能帮助我在领域内稳定发展。对我来说,知识共享也是如此。知识共享可以为艺术家们提供充满丰富艺术资源的工作室。 +和其他事情一样,创造力也需要反复练习。幸运的是,在我刚开始接触电脑时,就在一本关于渲染工场的专业杂志中接触到了开源这个存在。当时我并不理解所谓的“开源”是什么,但我知道只有开源工具能帮助我在领域内稳定发展。对我来说,知识共享也是如此。知识共享可以为艺术家们提供充满丰富艺术资源的工作室。 -我在电影学院任教时,经常需要给学生们准备练习编辑、录音、拟音、分级、评分的脚本。在 Jim Munroe 的独立作品 [Infest Wisely][1] 中和 [Vimeo][2] 上的知识共享里我总能找到我想要的。这些写实的脚本覆盖内容十分广泛,从独立影院出品到昂贵的高质的升降镜头(一般都会用无人机代替)都有。 +我在电影学院任教时,经常需要给学生们准备练习编辑、录音、拟音、分级、评分的示例录像。在 Jim Munroe 的独立作品 [Infest Wisely][1] 中和 [Vimeo][2] 上的知识共享内容里我总能找到我想要的。这些逼真的镜头覆盖内容十分广泛,从独立制作到昂贵的高品质的升降镜头(一般都会用无人机代替)都有。 -对实验艺术来说,确有无尽可能。知识共享提供了丰富的底片材料,这些材料可以用来整合,混剪等等,可以满足一位视觉先锋能够想到的任何用途。 +![](https://opensource.com/sites/default/files/u128651/bunny.png) -在接触知识共享之前,如果我想要使用写实脚本,我只能用之前的学生和老师拍摄的或者直接使用版权库里的脚本,但这些都有很多局限性。 +对实验主义艺术来说,确有无尽可能。知识共享提供了丰富的素材,这些材料可以用来整合、混剪等等,可以满足一位视觉先锋能够想到的任何用途。 -###坚守版权的底线很重要 +在接触知识共享之前,如果我想要使用写实镜头,如果在大学,只能用之前的学生和老师拍摄的或者直接使用版权库里的镜头,或者使用有受限的版权保护的镜头。 -知识共享同样能够创造经济效益。在某大型计算机公司的渲染工场工作时,我负责在某些硬件设施上测试渲染的运行情况,而这个测试时刻面临着被搁置的风险。做这些测试时,我用的都是[大雄兔][3]的资源,因为这个电影和它的组件都是可以免费使用和分享的。如果没有这个小短片,在接触写实资源之前我都没法完成我的实验,因为对于一个计算机公司来说,雇佣一只3D艺术家来应召布景是不太现实的。 +### 坚守版权的底线很重要 -令我震惊的是,与开源类似,知识共享已经用我们难以想象的方式支撑起了大公司。知识共享的使用或有或无地影响着公司的日常程序,但它填补了不足,让工作流程顺利进行。我没见到谁在他们的书中将流畅工作归功于知识共享的应用,但它确实无处不在。 +知识共享同样能够创造经济效益。在某大型计算机公司的渲染工场工作时,我负责在某些硬件设施上测试渲染的运行情况,而这个测试时刻面临着被搁置的风险。做这些测试时,我用的都是[大雄兔][3]的资源,因为这个电影和它的组件都是可以免费使用和分享的。如果没有这个小短片,在接触写实资源之前我都没法完成我的实验,因为对于一个计算机公司来说,雇佣一只 3D 艺术家来按需布景是不太现实的。 -我也见过一些开放版权的电影,比如[辛特尔][4],在最近的电视节目中播放了它的短片,那时的电视比现在的网络媒体要火得多。 +令我震惊的是,与开源类似,知识共享已经用我们难以想象的方式支撑起了大公司。知识共享的使用可能会也可能不会影响公司的日常流程,但它填补了不足,让工作流程顺利进行。我没见到谁在他们的书中将流畅工作归功于知识共享的应用,但它确实无处不在。 -###知识共享可以提供大量原材料 +![](https://opensource.com/sites/default/files/u128651/sintel.png) -艺术家需要原材料。画家需要颜料,画笔和画布。雕塑家需要陶土和工具。数字内容编辑师需要数字内容,无论它是剪贴画还是音效或者是电子游戏里的成品精灵。 +我也见过一些开放版权的电影,比如[辛特尔][4],在最近的电视节目中播放了它的短片,电视的分辨率已经超过了标准媒体。 + +### 知识共享可以提供大量原材料 + +艺术家需要原材料。画家需要颜料、画笔和画布。雕塑家需要陶土和工具。数字内容编辑师需要数字内容,无论它是剪贴画还是音效或者是电子游戏里的现成的精灵。 数字媒介赋予了人们超能力,让一个人就能完成需要一组人员才能完成的工作。事实上,我们大部分都好高骛远。我们想做高大上的项目,想让我们的成果不论是视觉上还是听觉上都无与伦比。我们想塑造的是宏大的世界,紧张的情节,能引起共鸣的作品,但我们所拥有的时间精力和技能与之都不匹配,达不到想要的效果。 -是知识共享再一次拯救了我们,用 [Freesound.org][5], [Openclipart.org][6], [OpenGameArt.org][7] 等等网站上那些细小的开放版权艺术材料。通过知识共享,艺术家可以使用各种他们自己没办法创造的原材料,来完成他们原本完不成的工作。 +是知识共享再一次拯救了我们,在 [Freesound.org][5]、 [Openclipart.org][6]、 [OpenGameArt.org][7] 等等网站上都有大量的开放版权艺术材料。通过知识共享,艺术家可以使用各种他们自己没办法创造的原材料,来完成他们原本完不成的工作。 -最神奇的是,不用自己投资,你放在网上给大家使用的原材料就能变成精美的作品,而这是你从没想过的。我在知识共享上面分享了很多音乐素材,它们现在用于无数的专辑和电子游戏里。有些人用了我的材料会通知我,有些是我自己发现的,所以这些材料的应用可能比我知道的还有多得多。有时我会偶然看到我亲手画的标志出现在我从没听说过的软件里。我见到过我为[开源网站][8]写的文章在别处发表,有的是论文的参考文献,白皮书或者参考资料中。 +最神奇的是,不用自己投资,你放在网上给大家使用的原材料就能变成精美的作品,而这是你从没想过的。我在知识共享上面分享了很多音乐素材,它们现在用于无数的专辑和电子游戏里。有些人用了我的材料会通知我,有些是我自己发现的,所以这些材料的应用可能比我知道的还有多得多。有时我会偶然看到我亲手画的标志出现在我从没听说过的软件里。我见到过我为 [Opensource.com][8] 写的文章在别处发表,有的是论文的参考文献,白皮书或者参考资料中。 -###知识共享所代表的自由文化也是一种文化 +### 知识共享所代表的自由文化也是一种文化 “自由文化”这个说法过于累赘,文化,从概念上来说,是一个有机的整体。在这种文化中社会逐渐成长发展,从一个人到另一个。它是人与人之间的互动和思想交流。自由文化是自由缺失的现代世界里的特殊产物。 -如果你也想对这样的局限进行反抗,想把你的思想、作品,你自己的文化分享给全世界的人,那么就来和我们一起,使用知识共享吧! +如果你也想对这样的局限进行反抗,想把你的思想、作品、你自己的文化分享给全世界的人,那么就来和我们一起,使用知识共享吧! -------------------------------------------------------------------------------- @@ -44,7 +51,7 @@ via: https://opensource.com/article/18/1/creative-commons-real-world 作者:[Seth Kenlon][a] 译者:[Valoniakim](https://github.com/Valoniakim) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1bdb61b88273c9c95a71b6150a591cf6cc0e787f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 14 Dec 2018 18:31:29 +0800 Subject: [PATCH 0865/1143] PUB:20180104 How Creative Commons benefits artists and big business.md @Valoniakim https://linux.cn/article-10347-1.html --- ...0104 How Creative Commons benefits artists and big business.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180104 How Creative Commons benefits artists and big business.md (100%) diff --git a/translated/talk/20180104 How Creative Commons benefits artists and big business.md b/published/20180104 How Creative Commons benefits artists and big business.md similarity index 100% rename from translated/talk/20180104 How Creative Commons benefits artists and big business.md rename to published/20180104 How Creative Commons benefits artists and big business.md From 4a5986dc8a11fb53aaa95123a3423ca660d0c172 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 15 Dec 2018 09:11:52 +0800 Subject: [PATCH 0866/1143] PUB:20180814 HTTP request routing and validation with gorilla-mux.md @yongshouzhang https://linux.cn/article-10348-1.html --- ...180814 HTTP request routing and validation with gorilla-mux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180814 HTTP request routing and validation with gorilla-mux.md (100%) diff --git a/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md b/published/20180814 HTTP request routing and validation with gorilla-mux.md similarity index 100% rename from translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md rename to published/20180814 HTTP request routing and validation with gorilla-mux.md From e5fa1a19976943ee9d7a78fd4b9d8dc64f9320d2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 15 Dec 2018 09:18:45 +0800 Subject: [PATCH 0867/1143] PUB:20181102 Create a containerized machine learning model.md @geekpi https://linux.cn/article-10349-1.html --- .../20181102 Create a containerized machine learning model.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181102 Create a containerized machine learning model.md (98%) diff --git a/translated/tech/20181102 Create a containerized machine learning model.md b/published/20181102 Create a containerized machine learning model.md similarity index 98% rename from translated/tech/20181102 Create a containerized machine learning model.md rename to published/20181102 Create a containerized machine learning model.md index 0bad5a3bc6..a58b658398 100644 --- a/translated/tech/20181102 Create a containerized machine learning model.md +++ b/published/20181102 Create a containerized machine learning model.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (Create a containerized machine learning model) [#]: via: (https://fedoramagazine.org/create-containerized-machine-learning-model/) [#]: author: (Sven Bösiger) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10349-1.html) 创建一个容器化的机器学习模型 ====== From 82e68c686fb9eed12811e758103c9a519f74b970 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Sat, 15 Dec 2018 12:24:27 +0800 Subject: [PATCH 0868/1143] hankchow translated --- ... Variables- Environmental and Otherwise.md | 222 ------------------ ... Variables- Environmental and Otherwise.md | 212 +++++++++++++++++ 2 files changed, 212 insertions(+), 222 deletions(-) delete mode 100644 sources/tech/20181205 Bash Variables- Environmental and Otherwise.md create mode 100644 translated/tech/20181205 Bash Variables- Environmental and Otherwise.md diff --git a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md b/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md deleted file mode 100644 index 4df8c10143..0000000000 --- a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md +++ /dev/null @@ -1,222 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (Bash Variables: Environmental and Otherwise) -[#]: via: (https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) -[#]: url: ( ) - -Bash Variables: Environmental and Otherwise -====== -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/wynand-van-poortvliet-40467-unsplash.jpg?itok=tr6Eb4N0) - -Bash variables, including those pesky _environment variables_ , have been popped up several times in previous articles, and it’s high time you get to know them better and how they can help you. - -So, open your terminal window and let's get started. - -### Environment Variables - -Consider `HOME`. Apart from the cozy place where you lay down your hat, in Linux it is a variable that contains the path to the current user's home directory. Try this: - -``` -echo $HOME -``` - -This will show the path to your home directory, usually _/home/_. - -As the name indicates, variables can change according to the context. Indeed, each user on a Linux system will have a `HOME` variable containing a different value. You can also change the value of a variable by hand: - -``` -HOME=/home//Documents -``` - -will make `HOME` point to your _Documents/_ folder. - -There are three things to notice here: - - 1. There are no spaces between the name of the variable and the `=` or between the `=` and the value you are putting into the variable. Spaces have their own meaning in the shell and cannot be used any old way you want. - 2. If you want to put a value into a variable or manipulate it in any way, you just have to write the name of the variable. If you want to see or use the contents of a variable, you put a `$` in front of it. - 3. Changing `HOME` is risky! A lot programs rely on `HOME` to do stuff and changing it can have unforeseeable consequences. For example, just for laughs, change `HOME` as shown above and try typing `cd` and then [Enter]. As we have seen elsewhere in this series, you use `cd` to _c_ hange to another _d_ irectory. Without any parameters, `cd` takes you to your home directory. If you change the `HOME` variable, `cd` will take you to the new directory `HOME` points to. - - - -Changes to environment variables like the one described in point 3 above are not permanent. If you close your terminal and open it back up, or even open a new tab in your terminal window and move there, `echo $HOME` will show its original value. - -Before we go on to how you make changes permanent, let's look at another environment variable that it does make sense changing. - -### PATH - -The `PATH` variable lists directories that contain executable programs. If you ever wondered where your applications go when they are installed and how come the shell seems to magically know which programs it can run without you having to tell it where to look for them, `PATH` is the reason. - -Have a look inside `PATH` and you will see something like this: - -``` -$ echo $PATH -/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin -``` - -Each directory is separated by a colon (`:`) and if you want to run an application installed in any directory other than the ones listed in `PATH`, you will have to tell the shell where to find it: - -``` -/home//bin/my_program.sh -``` - -This will run a program calle _my_program.sh_ you have copied into a _bin/_ directory in your home directory. - -This is a common problem: you don't want to clutter up your system's _bin/_ directories, or you don't want other users running your own personal scripts, but you don't want to have to type out the complete path every time you need to run a script you use often. The solution is to create your own _bin/_ directory in your home directory: - -``` -mkdir $HOME/bin -``` - -And then tell `PATH` all about it: - -``` -PATH=$PATH:$HOME/bin -``` - -After that, your _/home//bin_ will show up in your `PATH` variable. But... Wait! We said that the changes you make in a given shell will not last and will lose effect when that shell is closed. - -To make changes permanent for your user, instead of running them directly in the shell, put them into a file that gets run every time a shell is started. That file already exists and lives in your home directory. It is called _.bashrc_ and the dot in front of the name makes it a hidden file -- a regular `ls` won't show it, but `ls -a` will. - -You can open it with a text editor like [kate][1], [gedit][2], [nano][3], or [vim][4] (NOT LibreOffice Writer -- that's a word processor. Different beast entirely). You will see that _.bashrc_ is full of shell commands the purpose of which are to set up the environment for your user. - -Scroll to the bottom and add the following on a new, empty line: - -``` -export PATH=$PATH:$HOME/bin -``` - -Save and close the file. You'll be seeing what `export` does presently. In the meantime, to make sure the changes take effect immediately, you need to `source` _.bashrc_ : - -``` -source .bashrc -``` - -What `source` does is execute _.bashrc_ for the current open shell, and all the ones that come after it. The alternative would be to log out and log back in again for the changes to take effect, and who has the time for that? - -From now on, your shell will find every program you dump in _/home//bin_ without you having to specify the whole path to the file. - -### DYI Variables - -You can, of course, make your own variables. All the ones we have seen have been written with ALL CAPS, but [you can call a variable more or less whatever you want][5]. - -Creating a new variables is straightforward: just set a value within it: - -``` -new_variable="Hello" -``` - -And you already know how to recover a value contained within a variable: - -``` -echo $new_variable -``` - -You often have a program that will require you set up a variable for things to work properly. The variable may set an option to "on", or help the program find a library it needs, and so on. When you run a program in Bash, the shell spawns a daughter process. This means it is not exactly the same shell that executes your program, but a related mini-shell that inherits some of the mother's characteristics. Unfortunately, variables, by default, are not one of them. This is because, by default again, variables are _local_. This means that, for security reasons, a variable set in one shell cannot be read in another, even if it is a daughter shell. - -To see what I mean, set a variable: - -``` -robots="R2D2 & C3PO" -``` - -... and run: - -``` -bash -``` - -You just ran a Bash shell program within a Bash shell program. - -Now see if you can read the contents of you variable with: - -``` -echo $robots -``` - -You should draw a blank. - -Still inside your bash-within-bash shell, set `robots` to something different: - -``` -robots="These aren't the ones you are looking for" -``` - -Check `robots`' value: - -``` -$ echo $robots -These aren't the ones you are looking for -``` - -Exit the bash-within-bash shell: - -``` -exit -``` - -And re-check the value of `robots`: - -``` -$ echo $robots -R2D2 & C3P0 -``` - -This is very useful to avoid all sorts of messed up configurations, but this presents a problem also: if a program requires you set up a variable, but the program can't access it because Bash will execute it in a daughter process, what can you do? That is exactly what `export` is for. - -Try doing the prior experiment, but, instead of just starting off by setting `robots="R2D2 & C3PO"`, export it at the same time: - -``` -export robots="R2D2 & C3PO" -``` - -You'll notice that, when you enter the bash-within-bash shell, `robots` still retains the same value it had at the outset. - -**Interesting fact:** While the daughter process will "inherit" the value of an exported variable, if the variable is changed within the daughter process, changes will not flow upwards to the mother process. In other words, changing the value of an exported variable in a daughter process does not change the value of the original variable in the mother process. - -You can see all exported variables by running - -``` -export -p -``` - -The variables you create should be at the end of the list. You will also notice some other interesting variables in the list: `USER`, for example, contains the current user's user name; `PWD` points to the current directory; and `OLDPWD` contains the path to the last directory you visited and since left. That's because, if you run: - -``` -cd - -``` - -You will go back to the last directory you visited and `cd` gets the information from `OLDPWD`. - -You can also see all the environment variables using the `env` command. - -To un-export a variable, use the `-n` option: - -``` -export -n robots -``` - -### Next Time - -You have now reached a level in which you are dangerous to yourself and others. It is time you learned how to protect yourself from yourself by making your environment safer and friendlier through the use of _aliases,_ and that is exactly what we'll be tackling in the next episode. See you then. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise - -作者:[Paul 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://www.linux.com/users/bro66 -[b]: https://github.com/lujun9972 -[1]: https://www.kde.org/applications/utilities/kate/ -[2]: https://help.gnome.org/users/gedit/stable/ -[3]: https://www.nano-editor.org/ -[4]: https://www.vim.org/ -[5]: https://bash.cyberciti.biz/guide/Rules_for_Naming_variable_name diff --git a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md new file mode 100644 index 0000000000..d77cfd22aa --- /dev/null +++ b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md @@ -0,0 +1,212 @@ +Bash 环境变量的那些事 +====== +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/wynand-van-poortvliet-40467-unsplash.jpg?itok=tr6Eb4N0) + +bash 变量,尤其是讨厌的环境变量,已经是一个老生常谈的话题了。我们也更应该对它有一个详细的了解,让它为我们所用。 + +下面就打开终端,开始吧。 + +### 环境变量 + +`HOME` 除了是你脱下帽子惬意休息的地方,同时也是 Linux 中的一个变量,它是当前用户主目录的路径: + +``` +echo $HOME +``` + +以上这个命令会显示当前用户的主目录路径,通常都在 `/home/` 下。 + +顾名思义,一个变量的值并不是固定的。实际上,Linux 系统中每一个用户的 `HOME` 变量都是不一样的,当然你也可以这样自行更改 `HOME` 变量的值: + +``` +HOME=/home//Documents +``` + +以上这个命令将会把 `HOME` 变量设置为 `/home//Documents` 目录。 + +其中有三点需要留意: + + 1. `=` 符号和其两侧的内容之间不加空格。空格在 shell 中有专门的意义,不能随意地在任何地方添加空格。 + 2. 如果你需要对变量进行赋值,只需要使用变量名称就可以了。但如果需要读取或者使用变量的值,需要在变量前面加上一个 `$` 号。 + 3. 更改 `HOME` 变量具有一定的风险。有很多程序是依赖于 `HOME` 变量的,更改 `HOME` 变量可能会导致一些不可预见的结果。例如,如果按照上面的方式更改了 `HOME` 变量,然后执行不带有任何参数的 `cd` 命令,在通常情况下,会跳转到用户的主目录下,但在这个时候,会跳转到 `HOME` 变量指定的目录下。 + +上面第 3 点中环境变量的更改并不是持久有效的,在终端关闭后重新打开终端,又或者是新建一个终端,执行 `echo $HOME` 命令输出的仍然会是初始的值,而不是重新自定义的值。 + +在讨论如何持久地更改一个环境变量之前,我们先来看一下另一个比较重要的环境变量。 + +### PATH 变量 + +在 `PATH` 变量中存放了一系列目录,而且是放置了可执行程序的目录。正是由于 `PATH` 变量的存在,让你不需要知道应用程序具体安装到了什么目录,而 shell 却可以正确地找到这些应用程序。 + +如果你查看 `PATH` 变量的值,大概会是以下这样: + +``` +$ echo $PATH +/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin +``` + +每两个目录之间使用冒号(`:`)分隔。如果某个应用程序的所在目录不在 `PATH` 变量中,那么运行的时候就需要声明应用程序的目录让 shell 能够找到。 + +``` +/home//bin/my_program.sh +``` + +例如以上命令就会执行当前用户 `bin/` 目录下的 `my_program.sh` 文件。 + +有一个常见的问题:如果你不希望弄乱系统的 `bin/` 目录,同时也不希望你自己的文件被其它人运行,还不想每次运行的时候都要输入完整的路径,那么,你可以在你的主目录中创建一个独立的 `bin/` 目录: + +``` +mkdir $HOME/bin +``` + +然后将这个目录添加到 `PATH` 变量中: + +``` +PATH=$PATH:$HOME/bin +``` + +然后 `/home//bin/` 目录就会出现在 `PATH` 变量中了。但正如之前所说,这个变更只会在当前的 shell 生效,当前的 shell 一旦关闭,环境变量的值就又恢复原状了。 + +如果要让变更对当前用户持续生效,就不能在 shell 中直接执行对应的变更,而是应该将这些变更操作卸载每次启动 shell 时都会运行的文件当中。这个文件就是当前用户主目录中的 `.bashrc` 文件。文件名前面的点号表明这是一个隐藏文件,执行普通的 `ls` 命令是不会将这个文件显示出来的,但只要在 `ls` 命令中加入 `-a` 参数就可以看到这个文件了。 + +你可以使用诸如 [kate][1]、[gedit][2]、[nano][3] 或者 [vim][4] 这些文本编辑器来打开 `.bashrc` 文件(但不要用 LibreOffice Writer,它是一个文字处理软件,跟前面几个文字编辑器并不一个量级的东西)。打开 `.bashrc` 文件之后,你会看见里面放置了一些 shell 命令,是用于为当前用户设置环境的。 + +在文件的末尾添加新行并输入以下内容: + +``` +export PATH=$PATH:$HOME/bin +``` + +保存并关闭 `.bashrc` 文件,接下来你就会看到 `export` 语句的效果。执行以下的命令让刚才的修改立即生效: + +``` +source .bashrc +``` + +刚才执行的 `source` 命令让 `.bashrc` 文件在当前的 shell 立即生效,并且对于之后打开的 shell 都会有效。因此另一个等效的方法是退出并重新进入 shell,但这样也太麻烦了。 + +现在,你的 shell 就能自动寻找到 `/home//bin/` 下的程序了,执行这个目录下的程序也不需要完整地写出程序的路径。 + +### 自定义变量 + +当然,你也可以定义自己的变量。刚才我们看到的变量名称都是全大写的,实际上[变量名称的定义还是比较灵活的][5]。 + +定义新变量的过程非常直观,直接对它赋值就可以了: + +``` +new_variable="Hello" +``` + +然后可以用一下的方式读取到已定义变量的值: + +``` +echo $new_variable +``` + +程序的正常工作离不开各种变量,例如要将某个选项设置为 on,又或者让程序找到所需的代码库,都需要使用变量。在 bash 中运行程序的时候会生成一个子 shell,这个子 shell 和执行原程序的父 shell 并不是完全一样的,只是继承了父 shell 的部分内容,而且默认是不继承父 shell 中的变量的。因为变量默认情况下是局部变量,出于安全原因,一个 shell 中的局部变量不会被另一个 shell 读取到,即使是子 shell 也不可以。 + +下面举一个例子。首先定义一个变量: + +``` +robots="R2D2 & C3PO" +``` + +然后执行: + +``` +bash +``` + +现在是在 bash shell 中创建了一个子 shell。 + +执行这个命令看看还能不能读取到刚才定义的变量: + +``` +echo $robots +``` + +你会发现读取不到。 + +还是在这个子 shell 中,为 `robots` 变量赋一个不同的值: + +``` +robots="These aren't the ones you are looking for" +``` + +再读取一次: + +``` +$ echo $robots +These aren't the ones you are looking for +``` + +退出这个子 shell: + +``` +exit +``` + +然后再看一下现在 `robots` 变量的值: + +``` +$ echo $robots +R2D2 & C3P0 +``` + +这一个特性可以有效避免配置过程中产生混乱,同时也会导致一个问题:如果程序中需要设置变量,但却由于子 shell 的原因无法正常访问到这个变量,该如何解决呢?这个时候就需要用到 `export` 了。 + +重复一次刚才的过程,但这一次不是通过 `robots="R2D2 & C3PO"` 方式来设置变量,而是使用 `export` 命令: + +``` +export robots="R2D2 & C3PO" +``` + +现在你会发现,在进入子 shell 之后,`robots` 变量的值仍然是最初赋予的值。 + +要注意的是,尽管子 shell 会继承通过 `export` 导出的变量,但如果在子 shell 中对这个变量重新赋值,是不会影响到父 shell 中对应变量的。 + +如果要查看所有通过 `export` 导出的变量,可以执行以下命令: + +``` +export -p +``` + +自定义的变量会显示在这个列表的末尾。这个列表中还有一些常见的变量:例如 `USER` 的值是当前用户的用户名,`PWD` 的值是当前用户当前所在的目录,而 `OLDPWD` 的值则是当前用户上一个访问过的目录。因此如果执行: + +``` +cd - +``` + +就会切换到上一个访问过的目录,那是因为 `cd` 命令读取到了 `OLDPWD` 变量的值。 + +你也可以使用 `env` 命令查看所有环境变量。 + +如果要取消导出一个变量,可以加上 `-n` 参数: + +``` +export -n robots +``` + +### 接下来 + +了解过环境变量的知识之后,你已经到达了可能对自己和他人造成危险的水平,接下来就需要了解如何通过使用 `_aliases` 来让环境变得更安全、更友好以保护自己了。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.kde.org/applications/utilities/kate/ +[2]: https://help.gnome.org/users/gedit/stable/ +[3]: https://www.nano-editor.org/ +[4]: https://www.vim.org/ +[5]: https://bash.cyberciti.biz/guide/Rules_for_Naming_variable_name + From 5f3454c27ba96c29819ecb9c4220a82bcb7a85c0 Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Sat, 15 Dec 2018 12:52:50 +0800 Subject: [PATCH 0869/1143] translating by hopefully2333 translating by hopefully2333 --- ...ove login security with challenge-response authentication.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181022 Improve login security with challenge-response authentication.md b/sources/tech/20181022 Improve login security with challenge-response authentication.md index 66ed2534b0..ff5cdba354 100644 --- a/sources/tech/20181022 Improve login security with challenge-response authentication.md +++ b/sources/tech/20181022 Improve login security with challenge-response authentication.md @@ -1,3 +1,5 @@ +translating by hopefully2333 + Improve login security with challenge-response authentication ====== From 9a9757403e988a7c6b5e52073553d74484bd1ffb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 15 Dec 2018 15:06:31 +0800 Subject: [PATCH 0870/1143] PRF:20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md @geekpi --- ...le Formats with SoundConverter in Linux.md | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md index 0ad348edb0..30dd467e8f 100644 --- a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md +++ b/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (Easily Convert Audio File Formats with SoundConverter in Linux) [#]: via: (https://itsfoss.com/sound-converter-linux/) @@ -10,7 +10,7 @@ 在 Linux 中使用 SoundConverter 轻松转换音频文件格式 ====== -**如果你正在寻找将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中需要的工具。** +> 如果你正在寻找将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中需要的工具。 ![Audio Converter in Linux][1] @@ -18,18 +18,19 @@ 不幸的是,Rhythmbox 无法播放 WAV。最重要的是,单个文件大小约为 70MB。想象一下,将这么大的音乐传输到智能手机。它会不必要地占用大量空间。 -所以我认为是时候将 WAV 文件转换为 MP3,这个长青且最流行的音乐文件格式。 +所以我认为是时候将 WAV 文件转换为 MP3 —— 这个长青且最流行的音乐文件格式。 为此,我需要一个在 Linux 中的音频转换器。在这个教程中,我将向你展示如何使用名为 SoundCoverter 的 GUI 工具轻松地将音频文件从一种格式转换为另一种格式。 ### 在 Linux 中安装 SoundConverter -[SoundConverter][3] 是一款流行的免费开源软件。它应该可以在大多数 Linux 发行版的官方仓库中找到。 +[SoundConverter][3] 是一款流行的自由开源软件。它应该可以在大多数 Linux 发行版的官方仓库中找到。 Ubuntu/Linux Mint 用户只需在软件中心搜索 SoundConverter 并从那里安装即可。 ![SoundConverter application in Software Center of Ubuntu][4] -SoundConverter 可以从软件中心安装 + +*SoundConverter 可以从软件中心安装* 或者,你可以使用命令行方式。在基于 Debian 和 Ubuntu 的系统中,你可以使用以下命令: @@ -45,14 +46,17 @@ sudo apt install soundconverter 默认界面看起来像这样,它不能比这简单: -![SoundConverter application interface in Linux][5]Simple Interface +![SoundConverter application interface in Linux][5] + +*简单的界面* 转换音频文件格式只要选择文件并单击转换。 但是,我建议你至少在第一次运行时检查下默认设置。默认情况下,它会将音频文件转换为 OGG 文件格式,你可能不希望这样。 ![Preferences in SoundConverter][6] -可以在“首选项”中更改默认输出设置 + +*可以在“首选项”中更改默认输出设置* 要更改默认输出设置,请单击界面上的“首选项”图标。你会在这里看到很多可更改的选择。 @@ -62,11 +66,11 @@ sudo apt install soundconverter 你还可以更改输出文件名。默认情况下,它只会更改后缀,但你也可以选择根据曲目编号、标题、艺术家等进行命名。为此,原始文件中应包含适当的元数据。 -说到元数据,你听说过 [MusicBrainz Picard][7]吗?此工具可帮助你自动更新本地音乐文件的元数据。 +说到元数据,你听说过 [MusicBrainz Picard][7] 吗?此工具可帮助你自动更新本地音乐文件的元数据。 ### 总结 -我之前用讨论过用一个小程序[在 Linux 中录制音频][8]。这些很棒的工具通过专注某个特定的任务使得生活更轻松。你可以使用成熟和更好的音频编辑工具,如 [Audacity][9],但对于较小的任务,如转换音频文件格式,它可能用起来很复杂。 +我之前用讨论过用一个小程序 [在 Linux 中录制音频][8]。这些很棒的工具通过专注某个特定的任务使得生活更轻松。你可以使用成熟和更好的音频编辑工具,如 [Audacity][9],但对于较小的任务,如转换音频文件格式,它可能用起来很复杂。 我希望你喜欢 SoundConverter。如果你使用其他工具,请在评论中提及,我会在 FOSS 中提及。使用开心! @@ -77,7 +81,7 @@ via: https://itsfoss.com/sound-converter-linux/ 作者:[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/) 荣誉推出 @@ -91,4 +95,4 @@ via: https://itsfoss.com/sound-converter-linux/ [6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux-preferences.jpeg?resize=800%2C431&ssl=1 [7]: https://itsfoss.com/musicbrainz-picard/ [8]: https://itsfoss.com/record-streaming-audio/ -[9]: https://www.audacityteam.org/ \ No newline at end of file +[9]: https://www.audacityteam.org/ From 7c0f1d12f41b32e847d77cf46fab84c6ad87c20f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 15 Dec 2018 15:06:58 +0800 Subject: [PATCH 0871/1143] PUB:20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md @geekpi https://linux.cn/article-10350-1.html --- ...Convert Audio File Formats with SoundConverter in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md (98%) diff --git a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/published/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md similarity index 98% rename from translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md rename to published/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md index 30dd467e8f..345dac8ac1 100644 --- a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md +++ b/published/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (Easily Convert Audio File Formats with SoundConverter in Linux) [#]: via: (https://itsfoss.com/sound-converter-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10350-1.html) 在 Linux 中使用 SoundConverter 轻松转换音频文件格式 ====== From bb8cd4ab169d8ed58c29a68d602bf255833dc2b6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 15 Dec 2018 15:14:08 +0800 Subject: [PATCH 0872/1143] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=88=B0=E6=96=B0=E7=9A=84=20Wiki=20?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LCTT翻译规范.md | 4 - 中文排版指北.md | 294 ------------------------------------------------ 选题模板.txt | 65 ----------- 3 files changed, 363 deletions(-) delete mode 100644 LCTT翻译规范.md delete mode 100644 中文排版指北.md delete mode 100644 选题模板.txt diff --git a/LCTT翻译规范.md b/LCTT翻译规范.md deleted file mode 100644 index b9a514f115..0000000000 --- a/LCTT翻译规范.md +++ /dev/null @@ -1,4 +0,0 @@ -# Linux中国翻译规范 -1. 翻译中出现的专有名词,可参见Dict.md中的翻译。 -2. 英文人名,如无中文对应译名,一般不译。 -2. 缩写词,一般不须翻译,可考虑旁注中文全名。 \ No newline at end of file diff --git a/中文排版指北.md b/中文排版指北.md deleted file mode 100644 index 9888b4dbc1..0000000000 --- a/中文排版指北.md +++ /dev/null @@ -1,294 +0,0 @@ -# 中文文案排版指北 -[![devDependency Status](https://david-dm.org/mzlogin/chinese-copywriting-guidelines/dev-status.svg)](https://david-dm.org/mzlogin/chinese-copywriting-guidelines#info=devDependencies) - -统一中文文案、排版的相关用法,降低团队成员之间的沟通成本,增强网站气质。 - -Other languages: - -- [English](https://github.com/mzlogin/chinese-copywriting-guidelines/blob/Simplified/README.en.md) -- [Chinese Traditional](https://github.com/sparanoid/chinese-copywriting-guidelines) -- [Chinese Simplified](README.md) - ------ - -## 目录 - -- [空格](#空格) - - [中英文之间需要增加空格](#中英文之间需要增加空格) - - [中文与数字之间需要增加空格](#中文与数字之间需要增加空格) - - [数字与单位之间需要增加空格](#数字与单位之间需要增加空格) - - [全角标点与其他字符之间不加空格](#全角标点与其他字符之间不加空格) - - [`-ms-text-autospace` to the rescue?](#-ms-text-autospace-to-the-rescue) -- [标点符号](#标点符号) - - [不重复使用标点符号](#不重复使用标点符号) -- [全角和半角](#全角和半角) - - [使用全角中文标点](#使用全角中文标点) - - [数字使用半角字符](#数字使用半角字符) - - [遇到完整的英文整句、特殊名词,其內容使用半角标点](#遇到完整的英文整句特殊名词其內容使用半角标点) -- [名词](#名词) - - [专有名词使用正确的大小写](#专有名词使用正确的大小写) - - [不要使用不地道的缩写](#不要使用不地道的缩写) -- [争议](#争议) - - [链接之间增加空格](#链接之间增加空格) -  - [简体中文不要使用直角引号](#简体中文不要使用直角引号) -- [工具](#工具) -- [谁在这样做?](#谁在这样做) -- [参考文献](#参考文献) - -## 空格 - -「有研究显示,打字的时候不喜欢在中文和英文之间加空格的人,感情路都走得很辛苦,有七成的比例会在 34 岁的时候跟自己不爱的人结婚,而其余三成的人最后只能把遗产留给自己的猫。毕竟爱情跟书写都需要适时地留白。 - -与大家共勉之。」——[vinta/paranoid-auto-spacing](https://github.com/vinta/pangu.js) - -### 中英文之间需要增加空格 - -正确: - -> 在 LeanCloud 上,数据存储是围绕 `AVObject` 进行的。 - -错误: - -> 在LeanCloud上,数据存储是围绕`AVObject`进行的。 - -> 在 LeanCloud上,数据存储是围绕`AVObject` 进行的。 - -完整的正确用法: - -> 在 LeanCloud 上,数据存储是围绕 `AVObject` 进行的。每个 `AVObject` 都包含了与 JSON 兼容的 key-value 对应的数据。数据是 schema-free 的,你不需要在每个 `AVObject` 上提前指定存在哪些键,只要直接设定对应的 key-value 即可。 - -例外:「豆瓣FM」等产品名词,按照官方所定义的格式书写。 - -### 中文与数字之间需要增加空格 - -正确: - -> 今天出去买菜花了 5000 元。 - -错误: - -> 今天出去买菜花了 5000元。 - -> 今天出去买菜花了5000元。 - -### 数字与单位之间需要增加空格 - -正确: - -> 我家的光纤入户宽带有 10 Gbps,SSD 一共有 20 TB。 - -错误: - -> 我家的光纤入户宽带有 10Gbps,SSD 一共有 10TB。 - -例外:度/百分比与数字之间不需要增加空格: - -正确: - -> 今天是 233° 的高温。 - -> 新 MacBook Pro 有 15% 的 CPU 性能提升。 - -错误: - -> 今天是 233 ° 的高温。 - -> 新 MacBook Pro 有 15 % 的 CPU 性能提升。 - -### 全角标点与其他字符之间不加空格 - -正确: - -> 刚刚买了一部 iPhone,好开心! - -错误: - -> 刚刚买了一部 iPhone ,好开心! - -### `-ms-text-autospace` to the rescue? - -Microsoft 有个 [`-ms-text-autospace`](http://msdn.microsoft.com/en-us/library/ie/ms531164(v=vs.85).aspx) 的 CSS 属性可以实现自动为中英文之间增加空白。不过目前并未普及,另外在其他应用场景,例如 OS X、iOS 的用户界面目前并不存在这个特性,所以请继续保持随手加空格的习惯。 - -## 标点符号 - -### 不重复使用标点符号 - -正确: - -> 德国队竟然战胜了巴西队! - -> 她竟然对你说“喵”?! - -错误: - -> 德国队竟然战胜了巴西队!! - -> 德国队竟然战胜了巴西队!!!!!!!! - -> 她竟然对你说「喵」??!! - -> 她竟然对你说「喵」?!?!??!! - -## 全角和半角 - -不明白什么是全角(全形)与半角(半形)符号?请查看维基百科词条『[全角和半角](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)』。 - -### 使用全角中文标点 - -正确: - -> 嗨!你知道嘛?今天前台的小妹跟我说“喵”了哎! - -> 核磁共振成像(NMRI)是什么原理都不知道?JFGI! - -错误: - -> 嗨! 你知道嘛? 今天前台的小妹跟我说 "喵" 了哎! - -> 嗨!你知道嘛?今天前台的小妹跟我说"喵"了哎! - -> 核磁共振成像 (NMRI) 是什么原理都不知道? JFGI! - -> 核磁共振成像(NMRI)是什么原理都不知道?JFGI! - -### 数字使用半角字符 - -正确: - -> 这件蛋糕只卖 1000 元。 - -错误: - -> 这件蛋糕只卖 1000 元。 - -例外:在设计稿、宣传海报中如出现极少量数字的情形时,为方便文字对齐,是可以使用全角数字的。 - -### 遇到完整的英文整句、特殊名词,其內容使用半角标点 - -正确: - -> 乔布斯那句话是怎么说的?“Stay hungry, stay foolish.” - -> 推荐你阅读《Hackers & Painters: Big Ideas from the Computer Age》,非常的有趣。 - -错误: - -> 乔布斯那句话是怎么说的?「Stay hungry,stay foolish。」 - -> 推荐你阅读《Hackers&Painters:Big Ideas from the Computer Age》,非常的有趣。 - -## 名词 - -### 专有名词使用正确的大小写 - -大小写相关用法原属于英文书写范畴,不属于本 wiki 讨论內容,在这里只对部分易错用法进行简述。 - -正确: - -> 使用 GitHub 登录 - -> 我们的客户有 GitHub、Foursquare、Microsoft Corporation、Google、Facebook, Inc.。 - -错误: - -> 使用 github 登录 - -> 使用 GITHUB 登录 - -> 使用 Github 登录 - -> 使用 gitHub 登录 - -> 使用 gイんĤЦ8 登录 - -> 我们的客户有 github、foursquare、microsoft corporation、google、facebook, inc.。 - -> 我们的客户有 GITHUB、FOURSQUARE、MICROSOFT CORPORATION、GOOGLE、FACEBOOK, INC.。 - -> 我们的客户有 Github、FourSquare、MicroSoft Corporation、Google、FaceBook, Inc.。 - -> 我们的客户有 gitHub、fourSquare、microSoft Corporation、google、faceBook, Inc.。 - -> 我们的客户有 gイんĤЦ8、キouЯƧquムгє、๓เςг๏ร๏Ŧt ς๏гק๏гคtเ๏ภn、900913、ƒ4ᄃëв๏๏к, IПᄃ.。 - -注意:当网页中需要配合整体视觉风格而出现全部大写/小写的情形,HTML 中请使用标准的大小写规范进行书写;并通过 `text-transform: uppercase;`/`text-transform: lowercase;` 对表现形式进行定义。 - -### 不要使用不地道的缩写 - -正确: - -> 我们需要一位熟悉 JavaScript、HTML5,至少理解一种框架(如 Backbone.js、AngularJS、React 等)的前端开发者。 - -错误: - -> 我们需要一位熟悉 Js、h5,至少理解一种框架(如 backbone、angular、RJS 等)的 FED。 - -## 争议 - -以下用法略带有个人色彩,既:无论是否遵循下述规则,从语法的角度来讲都是**正确**的。 - -### 链接之间增加空格 - -用法: - -> 请 [提交一个 issue](#) 并分配给相关同事。 - -> 访问我们网站的最新动态,请 [点击这里](#) 进行订阅! - -对比用法: - -> 请[提交一个 issue](#) 并分配给相关同事。 - -> 访问我们网站的最新动态,请[点击这里](#)进行订阅! - -### 简体中文不要使用直角引号 - -不管中英文,如果没有特殊要求,**不要用直角引号**。 - -## 工具 - -仓库 | 语言 ---- | --- -[vinta/paranoid-auto-spacing](https://github.com/vinta/paranoid-auto-spacing) | JavaScript -[huei90/pangu.node](https://github.com/huei90/pangu.node) | Node.js -[huacnlee/auto-correct](https://github.com/huacnlee/auto-correct) | Ruby -[sparanoid/space-lover](https://github.com/sparanoid/space-lover) | PHP (WordPress) -[nauxliu/auto-correct](https://github.com/NauxLiu/auto-correct) | PHP -[hotoo/pangu.vim](https://github.com/hotoo/pangu.vim) | Vim -[sparanoid/grunt-auto-spacing](https://github.com/sparanoid/grunt-auto-spacing) | Node.js (Grunt) -[hjiang/scripts/add-space-between-latin-and-cjk](https://github.com/hjiang/scripts/blob/master/add-space-between-latin-and-cjk) | Python - -## 谁在这样做? - -网站 | 文案 | UGC ---- | --- | --- -[Apple 中国](http://www.apple.com/cn/) | Yes | N/A -[Apple 香港](http://www.apple.com/hk/) | Yes | N/A -[Apple 台湾](http://www.apple.com/tw/) | Yes | N/A -[Microsoft 中国](http://www.microsoft.com/zh-cn/) | Yes | N/A -[Microsoft 香港](http://www.microsoft.com/zh-hk/) | Yes | N/A -[Microsoft 台湾](http://www.microsoft.com/zh-tw/) | Yes | N/A -[LeanCloud](https://leancloud.cn/) | Yes | N/A -[知乎](https://www.zhihu.com/) | Yes | 部分用户达成 -[V2EX](https://www.v2ex.com/) | Yes | Yes -[SegmentFault](https://segmentfault.com/) | Yes | 部分用户达成 -[Apple4us](http://apple4us.com/) | Yes | N/A -[豌豆荚](https://www.wandoujia.com/) | Yes | N/A -[Ruby China](https://ruby-china.org/) | Yes | 标题达成 -[PHPHub](https://phphub.org/) | Yes | 标题达成 - -## 参考文献 - -- [Guidelines for Using Capital Letters](http://grammar.about.com/od/punctuationandmechanics/a/Guidelines-For-Using-Capital-Letters.htm) -- [Letter case - Wikipedia](http://en.wikipedia.org/wiki/Letter_case) -- [Punctuation - Oxford Dictionaries](http://www.oxforddictionaries.com/words/punctuation) -- [Punctuation - The Purdue OWL](https://owl.english.purdue.edu/owl/section/1/6/) -- [How to Use English Punctuation Corrently - wikiHow](http://www.wikihow.com/Use-English-Punctuation-Correctly) -- [格式 - openSUSE](https://zh.opensuse.org/index.php?title=Help:%E6%A0%BC%E5%BC%8F) -- [全角和半角 - 维基百科](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2) -- [引号 - 维基百科](http://zh.wikipedia.org/wiki/%E5%BC%95%E8%99%9F) -- [疑问惊叹号 - 维基百科](http://zh.wikipedia.org/wiki/%E7%96%91%E5%95%8F%E9%A9%9A%E5%98%86%E8%99%9F) - -## CopyRight - -[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines) diff --git a/选题模板.txt b/选题模板.txt deleted file mode 100644 index 4515fe78ab..0000000000 --- a/选题模板.txt +++ /dev/null @@ -1,65 +0,0 @@ -选题标题格式: - -``` -原文日期 标题.md -``` - -其中: - -- 原文日期为该文章发表时的日期,采用 8 位数字表示 -- 标题需去除特殊字符,使用 `_` 替换。 - -正文内容: - -``` -[#]: collector: (选题人 GitHub ID) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (文章标题) -[#]: via: (原文 URL) -[#]: author: (作者名 作者链接 URL) -[#]: url: ( ) - -标题 -======= - -### 子一级标题 - -正文 - -#### 子二级标题 - -正文内容 - -![][1] - -### 子一级标题 - -正文内容 : I have a [dream][2]。 - --------------------------------------------------------------------------------- - -via: 原文 链接 URL - -作者:[作者名][a] -译者:[选题 ID][b] -译者:[译者 ID](https://github.com/译者 ID) -校对:[校对 ID](https://github.com/校对 ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: 作者链接 URL -[b]: 选题链接 URL -[1]: 图片链接地址 -[2]: 文内链接地址 -``` - -说明: - -1. 标题层级很多时从 `##` 开始 -2. 图片链接和引文链接地址在下方集中写 -3. 因为 Windows 系统文件名有限制,所以文章名不要有特殊符号,如 `\/:*"<>|`,同时也不推荐全大写,或者其它不利阅读的格式 -4. 正文格式参照中文排版指北(https://github.com/LCTT/TranslateProject/blob/master/%E4%B8%AD%E6%96%87%E6%8E%92%E7%89%88%E6%8C%87%E5%8C%97.md) -5. 我们使用的 markdown 语法和 GitHub 一致。而实际中使用的都是基本语法,比如链接、包含图片、标题、列表、字体控制和代码高亮。 -6. 选题的内容分为两类: 干货和湿货。干货就是技术文章,比如针对某种技术、工具的介绍、讲解和讨论。湿货则是和技术、开发、计算机文化有关的文章。选题时主要就是根据这两条来选择文章,文章需要对大家有益处,篇幅不宜太短,可以是系列文章,也可以是长篇大论,但是文章要有内容,不能有严重的错误,最好不要选择已经有翻译的原文。 From 69e0f0ad82fa51c88e7e19726683cd938b18e841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com> Date: Sat, 15 Dec 2018 19:52:34 +0800 Subject: [PATCH 0873/1143] Create 20180419 Migrating to Linux- Network and System Settings.md --- ...g to Linux- Network and System Settings.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 translated/tech/20180419 Migrating to Linux- Network and System Settings.md diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md new file mode 100644 index 0000000000..480aa05239 --- /dev/null +++ b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md @@ -0,0 +1,128 @@ +# 迁移到 Linux 工作环境: 网络和系统设置 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO) + +在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到Linux。如果你错过了以前的文章,可以从这访问: + +[Part 1 - 基本介绍][1] + +[Part 2 - 磁盘、文件和文件系统][2] + +[Part 3 - 图形界面环境][3] + +[Part 4 - 命令行][4] + +[Part 5 - 使用 sudo 命令][5] + +[Part 6 - 软件安装][6] + +Linux 提供了一系列网络和系统设置。在桌面上,Linux允许您调整系统上的任何内容。大多数这些设置都在/ etc目录下的纯文本文件中公开。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。 + + + +大多数设置都能够在设置程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。 + + + +### 连接因特网 + +在Linux中连接到Internet通常非常简单。如果您通过以太网电缆连接,Linux通常会在插入电缆时或启动时获得IP地址并自动连接(如果电缆已连接)。 + +如果您使用无线,则在大多数发行版中都有一个菜单,可以在指示器面板中或在设置中(取决于您的发行版),您可以在其中选择无线网络的SSID。如果网络受密码保护,它通常会提示您输入密码。 然后连接,这个过程相当顺利。 + +在图形界面您可以通过进入设置来调整网络设置。通常称为系统设置或者是设置。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。 + +![Network Settings][8] + +图1: Gnome 桌面网络设置指示器图标. + +[经许可使用][9] + +### 网络接口名称 + +在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 - 或以太网和无线。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。 + +### 通过命令行进行网络管理 + +如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。 + +请注意,用于在图形桌面中管理网络的最常用服务是网络管理器,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。 + +更改图形环境中的设置很可能与网络管理器交互,您还可以使用名为nmtui的工具从命令行更改网络管理器设置。nmtui工具提供了您在图形环境中找到的所有设置,但是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图2)。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ) + +图 2:nmtui 界面 + +[经许可使用][9] + +在命令行上,有一个名为 ifconfig 的旧工具来管理网络,还有一个名为 ip 的新工具。在某些发行版中,ifconfig 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,ifconfig 仍可以使用。 + +以下是一些允许您显示和更改网络设置的命令: + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ) + +[经许可使用][9] + +### 进程和系统信息 + +在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能.。 + +在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可以使用的图形工具。大多数所共有的工具是 System Monitor 和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA) + +图 3:NetHogs 截图 + +[经许可使用][9] + +在这些工具中,你也可以查看系统全局网络流量(图 4)。 + +![System Monitor][11] + +图4: Gnome System Monitor 的截图 + +[经许可使用][9] + +### 管理进程和系统使用 + +您还可以从命令行使用相当多的工具。使用 ps 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 ps 命令不会使用可以使用命令 info ps 或者 man ps。 + +大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或CPU时间的进程。这种情况下有两个非常简单的命令,分别是 top 和 htop 命令(图 5)。 + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl) + +top 和 htop 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。 + +使用两个命令时 (top and htop),你可以输入 ”?“ 来获取使用帮助,输入 ”q“ 来退出程序。使用 top 命令你可以按”k“键然后输入进程 ID 来杀死某个进程。 + +使用 htop 命令时你可以使用 ↑↓ 键来将列表中的一条记录进行高亮显示,按下 F9 键会杀死进程(需要回车确认)。 + +本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。 + +想学习更多 Linux 内容可访问免费的 ["Linux 简介" ][12]课程,此课程来自 Linux 基金会和 edx. + +------ + +via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-settings + +作者:[John Bonesio][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[ScarboroughCoral](https://github.com/ScarboroughCoral) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/johnbonesio +[1]: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction +[2]: https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems +[3]: https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments +[4]: https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line +[5]: https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo +[6]: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software +[7]: https://www.linux.com/files/images/figure-1png-2 +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings" +[9]: https://www.linux.com/licenses/category/used-permission +[10]: https://www.linux.com/files/images/figure-4png-1 +[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor" +[12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From dadff90637d2d7bf81e1f449a8583fa9fc49d9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com> Date: Sat, 15 Dec 2018 19:53:59 +0800 Subject: [PATCH 0874/1143] Delete 20180419 Migrating to Linux- Network and System Settings.md --- ...g to Linux- Network and System Settings.md | 118 ------------------ 1 file changed, 118 deletions(-) delete mode 100644 sources/tech/20180419 Migrating to Linux- Network and System Settings.md diff --git a/sources/tech/20180419 Migrating to Linux- Network and System Settings.md b/sources/tech/20180419 Migrating to Linux- Network and System Settings.md deleted file mode 100644 index 50141aedca..0000000000 --- a/sources/tech/20180419 Migrating to Linux- Network and System Settings.md +++ /dev/null @@ -1,118 +0,0 @@ -ScarboroughCoral translating! - -Migrating to Linux: Network and System Settings -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO) -In this series, we provide an overview of fundamentals to help you successfully make the transition to Linux from another operating system. If you missed the earlier articles in the series, you can find them here: - -[Part 1 - An Introduction][1] - -[Part 2 - Disks, Files, and Filesystems][2] - -[Part 3 - Graphical Environments][3] - -[Part 4 - The Command Line][4] - -[Part 5 - Using sudo][5] - -[Part 6 - Installing Software][6] - -Linux gives you a lot of control over network and system settings. On your desktop, Linux lets you tweak just about anything on the system. Most of these settings are exposed in plain text files under the /etc directory. Here I describe some of the most common settings you’ll use on your desktop Linux system. - -A lot of settings can be found in the Settings program, and the available options will vary by Linux distribution. Usually, you can change the background, tweak sound volume, connect to printers, set up displays, and more. While I won't talk about all of the settings here, you can certainly explore what's in there. - -### Connect to the Internet - -Connecting to the Internet in Linux is often fairly straightforward. If you are wired through an Ethernet cable, Linux will usually get an IP address and connect automatically when the cable is plugged in or at startup if the cable is already connected. - -If you are using wireless, in most distributions there is a menu, either in the indicator panel or in settings (depending on your distribution), where you can select the SSID for your wireless network. If the network is password protected, it will usually prompt you for the password. Afterward, it connects, and the process is fairly smooth. - -You can adjust network settings in the graphical environment by going into settings. Sometimes this is called System Settings or just Settings. Often you can easily spot the settings program because its icon is a gear or a picture of tools (Figure 1). - - -![Network Settings][8] - -Figure 1: Gnome Desktop Network Settings Indicator Icon. - -[Used with permission][9] - -### Network Interface Names - -Under Linux, network devices have names. Historically, these are given names like eth0 and wlan0 -- or Ethernet and wireless, respectively. Newer Linux systems have been using different names that appear more esoteric, like enp4s0 and wlp5s0. If the name starts with en, it's a wired Ethernet interface. If it starts with wl, it's a wireless interface. The rest of the letters and numbers reflect how the device is connected to hardware. - -### Network Management from the Command Line - -If you want more control over your network settings, or if you are managing network connections without a graphical desktop, you can also manage the network from the command line. - -Note that the most common service used to manage networks in a graphical desktop is the Network Manager, and Network Manager will often override setting changes made on the command line. If you are using the Network Manager, it's best to change your settings in its interface so it doesn't undo the changes you make from the command line or someplace else. - -Changing settings in the graphical environment is very likely to be interacting with the Network Manager, and you can also change Network Manager settings from the command line using the tool called nmtui. The nmtui tool provides all the settings that you find in the graphical environment but gives it in a text-based semi-graphical interface that works on the command line (Figure 2). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ) - -On the command line, there is an older tool called ifconfig to manage networks and a newer one called ip. On some distributions, ifconfig is considered to be deprecated and is not even installed by default. On other distributions, ifconfig is still in use. - -Here are some commands that will allow you to display and change network settings: - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ) - -### Process and System Information - -In Windows, you can go into the Task Manager to see a list of the all the programs and services that are running. You can also stop programs from running. And you can view system performance in some of the tabs displayed there. - -You can do similar things in Linux both from the command line and from graphical tools. In Linux, there are a few graphical tools available depending on your distribution. The most common ones are System Monitor or KSysGuard. In these tools, you can see system performance, see a list of processes, and even kill processes (Figure 3). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA) - -In these tools, you can also view global network traffic on your system (Figure 4). - - -![System Monitor][11] - -Figure 4: Screenshot of Gnome System Monitor. - -[Used with permission][9] - -### Managing Process and System Usage - -There are also quite a few tools you can use from the command line. The command ps can be used to list processes on your system. By default, it will list processes running in your current terminal session. But you can list other processes by giving it various command line options. You can get more help on ps with the commands info ps, or man ps. - -Most folks though want to get a list of processes because they would like to stop the one that is using up too much memory or CPU time. In this case, there are two commands that make this task much easier. These are top and htop (Figure 5). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl) - -The top and htop tools work very similarly to each other. These commands update their list every second or two and re-sort the list so that the task using the most CPU is at the top. You can also change the sorting to sort by other resources as well such as memory usage. - -In either of these programs (top and htop), you can type '?' to get help, and 'q' to quit. With top, you can press 'k' to kill a process and then type in the unique PID number for the process to kill it. - -With htop, you can highlight a task by pressing down arrow or up arrow to move the highlight bar, and then press F9 to kill the task followed by Enter to confirm. - -The information and tools provided in this series will help you get started with Linux. With a little time and patience, you'll feel right at home. - -Learn more about Linux through the free ["Introduction to Linux" ][12]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-settings - -作者:[John Bonesio][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/johnbonesio -[1]:https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction -[2]:https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems -[3]:https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments -[4]:https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line -[5]:https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo -[6]:https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software -[7]:https://www.linux.com/files/images/figure-1png-2 -[8]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 (Network Settings) -[9]:https://www.linux.com/licenses/category/used-permission -[10]:https://www.linux.com/files/images/figure-4png-1 -[11]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF (System Monitor) -[12]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 712d4fdc9836cbeae33772b3fef5c663d6f0ca7a Mon Sep 17 00:00:00 2001 From: dianbanjiu Date: Sat, 15 Dec 2018 21:21:54 +0800 Subject: [PATCH 0875/1143] translating --- ...Check Laptop Battery Status And Level From Linux Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md index 631efa91f9..1f94cd1045 100644 --- a/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md +++ b/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (dianbanjiu ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fa1068a0b94dff4257f93169ff0ffc0533a75aa2 Mon Sep 17 00:00:00 2001 From: Valonia Kim <34000495+Valoniakim@users.noreply.github.com> Date: Sat, 15 Dec 2018 21:22:50 +0800 Subject: [PATCH 0876/1143] translated --- ...ource and builds her own medical device.md | 86 ------------------- 1 file changed, 86 deletions(-) delete mode 100644 sources/talk/20180508 Person with diabetes finds open source and builds her own medical device.md diff --git a/sources/talk/20180508 Person with diabetes finds open source and builds her own medical device.md b/sources/talk/20180508 Person with diabetes finds open source and builds her own medical device.md deleted file mode 100644 index 3131746c07..0000000000 --- a/sources/talk/20180508 Person with diabetes finds open source and builds her own medical device.md +++ /dev/null @@ -1,86 +0,0 @@ -translating by valoniakim - -Person with diabetes finds open source and builds her own medical device -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/health_heartbeat.png?itok=P-GXea-p) -Dana Lewis is the 2018 Women in [Open Source Community Award][1] winner! Here is her story about how open source improved her health in a big way. - -Dana has Type 1 diabetes and commercially available medical devices were failing her. The continuous glucose monitor (CGM) alarm she was using to manage her blood sugar was not loud enough to wake her up. The product design put her in danger every time she went to sleep. - -"I went to a bunch of manufacturers and asked what they could do, and I was told, 'It’s loud enough for most people.' I was told that 'it’s not a problem for most people, and we're working on it. It'll be out in a future version.’' That was all really frustrating to hear, but at the same time, I didn’t feel like I could do anything about it because it’s an FDA-approved medical device. You can’t change it." - -These obstacles aside, Dana thought that if she could get her data from the device, she could use her phone to make a louder alarm. Toward the end of 2013, she saw a tweet that provided an answer to her problem. The author of the tweet, who is the parent of a child with diabetes, had reverse-engineered a CGM to get the data off his child’s device so that he could monitor his child’s blood sugar remotely. - -She realized that if he was willing to share, she could use the same code to build a louder alarm system. - -"I didn’t understand that it was perfectly normal to ask people to share code. That was my first introduction to open source." - -The system evolved from a louder alarm to a web page where she could share data with her loved ones. Together with her now-husband, Scott Leibrand, she iteratively added features to the page, eventually including an algorithm that could not only monitor glucose levels in real time but also proactively predict future highs and lows. - -As Dana got more involved with the open source diabetes community, she met Ben West. He had spent years figuring out how to communicate with the insulin pump Dana used. Unlike a CGM, which tells the user if their blood sugar is high or low, an insulin pump is a separate device used to continuously infuse insulin throughout the day. - -"A light bulb went off. We said, 'Oh, if we take this code to communicate with the pump with what we’ve done to access the data from the CGM in real time and our algorithm, we can actually process data from both devices in real time and create a closed-loop system.'" - -The result was a do-it-yourself artificial pancreas system (DIY APS). - -Using the algorithm to process data from the insulin pump and CGM, the DIY APS forecasts predicted blood glucose levels and automates adjustments to the insulin delivery, making small changes to keep blood sugar within the target range. This makes life much easier for people with diabetes because they no longer have to calibrate insulin delivery manually several times per day. - -"Because we had been using open source software, we knew that the right thing to do was to turn around and make what we had done open source as well so that other people could leverage it." And thus, OpenAPS (the Open Source Artificial Pancreas System) was born. - -The OpenAPS community has since grown to more than 600 users of various DIY "closed-loop" systems. OpenAPS contributors have embraced the hashtag #WeAreNotWaiting as a mantra to express their belief that patient communities should not have to wait for the healthcare industry to create something that works for them. - -"Yes, you may choose to adopt a commercial solution in the future—that’s totally fine, and you should have the freedom do to that. Waiting should be a choice and not the status quo. To me, what’s amazing about this movement of open source in healthcare is that waiting is now a choice. You can choose not to DIY. You can choose to wait for a commercial solution. But if you don’t want to wait, you don’t have to. There are a plethora of options to take advantage of. A lot of problems have been solved by people in the community." - -The OpenAPS community is made up of people with diabetes, their loved ones, parents of children with diabetes, and people who want to use their skills for good. By helping lead the community, Dana has learned about the many ways of contributing to an open source project. She sees many valuable contributions to OpenAPS come from non-technical contributors on Facebook or [Gitter][2]. - -"There are a lot of different ways that people contribute, and it’s important that we recognize all of those because they’re all equally valuable. And they often involve different interests and different skill sets, but together, that’s what makes a community project in open source succeed." - -She knows firsthand how discouraging it can be for contributions to go unrecognized by others in a community. She also isn’t shy about discussing people’s tendency to discount the contributions of women. She first wrote about her experience being treated differently in a [2014 blog post][3] and [reflected on it again][4] when she learned she was a Women in Open Source Award finalist. - -In her first blog post, she and Scott shared the differences in the way they were treated by members of the community. They both noticed that, in subtle ways, Dana was constantly battling to be taken seriously. People often directed technical questions to him instead of her, even after Scott tried to redirect them to Dana. By calling out these behaviors, the post opened up a highly productive discussion in the community. - -"People would talk about the project initially as 'Scott’s thing' instead of 'Dana and Scott’s thing.' It was death by a thousand paper cuts in terms of frustration. I wrote the blog post to call it out. I said, 'Look, for some of you it’s conscious, but for some of you, it’s unconscious. We need to think that if we want this community to grow and support and allow many diverse participants, we need to talk about how we’re behaving.' To their credit, a lot of people in the community stopped and had serious conversations. They said, 'OK, here’s what I’m going to do to change. Call me out if I do it unconsciously.' It was phenomenal." - -She added that if it weren’t for the support of Scott as another active developer in the community, as well as that of other women in the community she could talk to and get encouragement from, she might have stopped. - -"I think that might have totally changed what happened in diabetes in open source if I had just thrown up my hands. I know that happens to other people, and it’s unfortunate. They leave open source because they don’t feel welcome or valued. My hope is that we continue to have the conversation about it and recognize that even if you’re not consciously trying to discourage people, we can all always do better at being more welcoming and engaging and recognizing contributions." - -Communication and sharing about OpenAPS are examples of non-technical contributions that have been critical to the success of the community. Dana’s background in public relations and communications certainly contributed to getting the word out. She has written and spoken extensively about the community on the [DIYPS blog][5], in a [TEDx Talk][6], at [OSCON][7], and more. - -"Not every project that is really impactful to a patient community has made it into the mainstream the way OpenAPS has. The diabetes community has done a really good job communicating about various projects, which brings more people with diabetes in and also gets the attention of people who want to help." - -Her goal now is to help bring to light to other patient community projects. Specifically, she wants to share tools or skills community members have learned with other patient communities looking to take projects to the next level, facilitate research, or work with companies. - -"I also realize that a lot of patients in these projects are told, 'You should patent that. You should create a company. You should create a non-profit.' But all those are huge things. They’re very time-consuming. They take away from your day job or require you to totally switch professions. People like me, we don’t always want to do that, and we shouldn’t have to do that in order to scale projects like this and help other people." - -To this end, she also wants to find other pathways people can take that aren’t all-consuming—for example, writing a children’s book. Dana took on this challenge in 2017 to help her nieces and nephews understand their aunt’s diabetes devices. When her niece asked her what "the thing on her arm was" (her CGM), she realized she didn’t have a point of reference to explain to a young child what it meant to be a person with diabetes. Her solution was [Carolyn’s Robot Relative][8]. - -"I wanted to talk to my nieces and nephews in a way that was age-appropriate that also normalizes that people are different in different ways. I was like, 'I wish there was a kid’s book that talks about this. Well, why don’t I write my own?'" - -She wrote the book and published it on Amazon because true to her open source values, she wanted it to be available to others. She followed up by also writing a [blog post about self-publishing a book on Amazon][9] in the hopes that others would publish books that speak to their own experiences. - -Books like Carolyn’s Robot Relative and awards like the Women in Open Source Award speak to the greater need for representation of different kinds of people in many areas of life, including open source. - -"Things are always better when the communities are more diverse." - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/5/dana-lewis-women-open-source-community-award-winner-2018 - -作者:[Taylor Greene][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/tgreene -[1]:https://www.redhat.com/en/about/women-in-open-source -[2]:https://gitter.im/ -[3]:https://diyps.org/2014/08/25/being-female-a-patient-and-co-designing-diyps-means-often-being-discounted/ -[4]:https://diyps.org/2018/02/01/women-in-open-source-make-a-difference/ -[5]:https://diyps.org/ -[6]:https://www.youtube.com/watch?v=kgu-AYSnyZ8 -[7]:https://www.youtube.com/watch?v=eQGWrdgu_fE -[8]:https://www.amazon.com/gp/product/1977641415/ref=as_li_tl?ie=UTF8&tag=diyps-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=1977641415&linkId=96bb65e21b5801901586e9fabd12c860 -[9]:https://diyps.org/2017/11/01/makers-gonna-make-a-book-about-diabetes-devices-kids-book-written-by-danamlewis/ From f6b7a3410f36694bd27fd810f14ca9d02f8a4c10 Mon Sep 17 00:00:00 2001 From: Valonia Kim <34000495+Valoniakim@users.noreply.github.com> Date: Sat, 15 Dec 2018 21:25:18 +0800 Subject: [PATCH 0877/1143] translated 20180508 Person with diabetes finds open source and builds her own medical device.md --- ...ource and builds her own medical device.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md diff --git a/translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md b/translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md new file mode 100644 index 0000000000..1a965cdf72 --- /dev/null +++ b/translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md @@ -0,0 +1,86 @@ +糖尿病患者们是怎样使用开源造出自己的医疗设备的 +====== +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/health_heartbeat.png?itok=P-GXea-p) + +Dana Lewis 被评选为开源社区 2018 年度最佳女性!下面是开源怎样改善了她的健康的故事。 + +Dana 患有1型糖尿病,但当时市面上流通的药品和医疗设备都对她无效。 +她用来管理血糖的动态血糖监测报警器的声音太小了,根本叫不醒熟睡的她,产品这样的设计无法保证她每天睡眠时间的生命安全。 + +“我和生产厂家见了一面商议提出意见,厂家的回复是‘我们产品的音量已经足够大了,很少有人叫不醒’,我被告知‘这不是普遍问题,我们正在改进,请期待我们的新产品。’听到这些时我真的很挫败,但我从没想象过我能做出什么改变,毕竟那是通过了 FDA 标准的医疗设备,不是我们能随意改变的。” + +面临着这些阻碍,Dana 想着如果她能把自己的数据从设备里导出,就可以设置手机闹铃来叫醒自己。在2013年末,她看到的一条推特解决了她的疑问。那条推特的作者是一位糖尿病患儿的家长,他把动态血糖监测仪进行了逆向工程,这样就可以导出孩子的血糖数据进行远程监控了。 + +她意识到如果对方愿意把过程分享给她,她也可以用那些代码做一个自己的响亮的血糖监测仪了。 + +“我并不知道向别人要源代码是件稀松平常的事,那是我第一次接触开源。” + +那个系统演化成一个响亮闹钟的代码,她也可以把代码在网页上分享给别人。和她的丈夫 Scott Leibrand 一起,她反复向闹铃添加属性,最终合成了一个算法,这个算法不仅能监测实时血糖水平,还能主动预测未来血糖波动。 + +随着 Dana 与开源糖尿病患者社区的接触越来越深,她认识了 Ben West,他花了很多年才研究出与 Dana 使用的胰岛素泵沟通数据的方法,与血糖监测仪不同,胰岛素泵不是简单的报告血糖,它是个单独的设备,要按人体需要持续推注胰岛素,比血糖监测仪要复杂得多。 + +“老路行不通了,我们说‘哦,如果我们能用这段代码和胰岛素泵沟通,就像我们之前用算法和血糖监测仪沟通实时数据那样,我们就能获取两个设备的实时数据,创建一个闭路系统。’” + +我们得到的是一个自制人工胰腺系统 (DIY APS)。 + +这个系统可以使用算法处理胰岛素泵和血糖监测仪的数据,来预测患者血糖水平,据此调整胰岛素的注射量,从而保持患者的血糖稳定。这个人工胰岛素系统取代了从前患者每日多次对胰岛素注射量的计算和调整,减轻了糖尿病患者的负担。 + +“正因为我们使用的是开源软件,在做出这个系统之后我们就把成果开源化了,这样可以造福更多的人。”开源人工胰腺系统 (OpenAPS) 由此诞生。 + +OpenAPS 社区已经拥有超过600名用户,大家都提供了各种各样的自制“闭路”系统代码。OpenAPS 贡献者们以 #WeAreNotWaiting 话题团结一致,以表达患者群体不该干等着医疗保健工厂制造出真正有效便捷产品的理念。 + +“你可以选择等待未来的商业解决方案,这无可厚非,选择等待是你的自由。等待可以是一种选择,但不能是无法改变的现状。对我来说,开源在医疗保健方面做出的这个举动让等待变成了一种选择。你可以选择不自行解决,你可以选择等待商业解决方案,但如果你不想等了,你无需再等。现在你有很多选择,开源社区的人们已经解决了很多问题。” + +OpenAPS 社区由糖尿病患者,患者家属,还有想要合理利用这项技术的人们。在社区的帮助下,Dana 学会了很多种贡献开源项目的方式。她发现许多从 Facebook 或 [Gitter][2] 上过来的非技术贡献者也对 OpenAPS 做出了很大贡献。 + +“贡献有很多方式,我们要认识到各种方式的贡献都是平等的。它们一般涉及不同的兴趣领域和技能组合,只有把这些综合起来,才能做成社区的项目。” + +她亲身经历过,所以知道自己的贡献不被社区的其他成员认可是怎样难过的感受。对于人们习惯把女性的贡献打折的这一现象,她也不回避。在她的 [2014 年博客][3] 和 [反思][4] 文章中她初次写道在入围开源年度最佳人物时所遭受到的区别待遇,这些待遇让她意识到身为女性的不同。 + +在她最初的博客中,她写道了自己和丈夫 Scott 同为开源社区成员,遭受到的区别待遇。他们都注意到,Dana 总是被提出一些细枝末节的要求,但 Scott 就不会。而 Scott 总被问道一些技术性问题,即使他向他们推荐 Dana,人们也更倾向于问身为男性的 Scott。大家都或多或少经历过这些行为,Dana 的博文在社区里引起了广泛的讨论。 + +“人们更愿意认为项目是‘Scott 发起的’而非‘Dana 和 Scott 一起发起的’。”这让我感受到千刀万剐般的痛苦和挫败,我写了博客把这个现象提到明面上,我说,‘看看这些行为,我知道你们有些是故意的,有些是无意的,但如果我们的社区想要得到多元化参与者的支持,想要发展壮大,我们就要规范自己的行为,有不妥之处也不要回避,直接摊开来交流。”值得赞扬的是,社区里的大部分成员都加入进来,认真地讨论这个问题。他们都说,‘好的,我知道有哪里需要改了,如果我再无意识这样做时提醒我一下。’这就是我们社区形成的风气。” + +她还说如果没有 Scott 这位社区里活跃开发者的支持,还有社区里其他女性贡献者的鼓励,她可能就半途而废了。 + +“我想如果我就放弃努力了,可能开源世界里糖尿病患者们的现状会有很大不同。我知道别人不幸的遭遇,他们在开源社区中感受不到认同感和自身价值,最终离开了开源。我希望我们可以继续这种讨论,大家都能意识到如果我们不故意打击贡献者,我们可以变得更加温暖,成员们也能感受到认同感,大家的付出也能得到相应的认可。 + +OpenAPS 社区的交流和分享给我们提供了一个很好的例子,它说明非技术性的贡献者对于整个社区的成功都是至关重要的。Dana 在现实社会中的关系和交流经历对她为开源社区做出的宣传有着很大的贡献。她为社区在 [DIYPS blog][5] 上写了很多篇文章,她还在 [TEDx Talk][6] 做过一场演讲, 在 [开源大会 (OSCON)][7] 上也演讲过很多次,诸如此类的还有很多。 + +“不是每个项目都像 OpenAPS 一样,对患者有那么大的影响,甚至成为患者中间的主流项目。糖尿病社区在项目的沟通中真的做了很多贡献,引来了很多糖尿病患者,也让需要帮助的人们知道了我们的存在。” + +Dana 现在的目标是帮助其他疾病的患者社区创建项目。她尤其想要把社区成员们学到的工具和技术和其他的患者社区分享,特别是那些想要把项目进一步提升,进行深入研究,或者想和公司合作的社区。 + +“听说很多参与项目的患者都听过这样的话,‘你应该申请个专利;你应该拿它开个公司;你应该成立个非营利组织。’但这些都是大事,它们太耗时间了,不仅占据你的工作时间,甚至强行改变你的专业领域。我这样的人并不想做那样的事,我们更倾向于把精力放在壮大其他项目上,以此帮助更多的人。” + +在此之后,她开始寻找其他不那么占用时间的任务,比如给小孩们写一本书。Dana 在 2017 年进行了这项挑战,她写了本书给侄子侄女,讲解他们婶婶的糖尿病设备是怎样工作的。在她侄女问她“胳膊上的东西是什么”(那是她的血糖监测仪)时,她意识到她不知道怎么和一个小孩子解释糖尿病患者是什么,所以写了[《卡罗琳的机器人亲戚》][8]这本书。 + +“我想用我侄子侄女那个年纪的语言和他们交流,毕竟不同年龄的人说话方式也不同。我当时想,‘真希望有本这方面的儿童读物,那我为什么不自己写一本呢?’” + +她写了书在亚马逊上出版,因为她想把开源的价值分享给更多的人。她还开了一个名为[“自己在亚马逊上出书”][9]的博客,希望大家也可以把自己的经历写进书里出版。 + +像《卡罗琳的机器人亲戚》这本书还有开源社区年度最佳女性这样的奖项都说明生活中包括开源在内的不同领域中,还有很多人的工作等待着大众的认知。 + +“社区越多元,事情越好办。” + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/5/dana-lewis-women-open-source-community-award-winner-2018 + +作者:[Taylor Greene][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[Valoniakim](https://github.com/Valoniakim) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/tgreene +[1]:https://www.redhat.com/en/about/women-in-open-source +[2]:https://gitter.im/ +[3]:https://diyps.org/2014/08/25/being-female-a-patient-and-co-designing-diyps-means-often-being-discounted/ +[4]:https://diyps.org/2018/02/01/women-in-open-source-make-a-difference/ +[5]:https://diyps.org/ +[6]:https://www.youtube.com/watch?v=kgu-AYSnyZ8 +[7]:https://www.youtube.com/watch?v=eQGWrdgu_fE +[8]:https://www.amazon.com/gp/product/1977641415/ref=as_li_tl?ie=UTF8&tag=diyps-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=1977641415&linkId=96bb65e21b5801901586e9fabd12c860 +[9]:https://diyps.org/2017/11/01/makers-gonna-make-a-book-about-diabetes-devices-kids-book-written-by-danamlewis/ From 64cebbbd73ec258d74b9afc20211684aa5fe7a38 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Sun, 16 Dec 2018 03:26:05 +0800 Subject: [PATCH 0878/1143] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20181205 Bash Variables- Environmental and Otherwise.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md index d77cfd22aa..c6786eef15 100644 --- a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md +++ b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md @@ -189,7 +189,7 @@ export -n robots ### 接下来 -了解过环境变量的知识之后,你已经到达了可能对自己和他人造成危险的水平,接下来就需要了解如何通过使用 `_aliases` 来让环境变得更安全、更友好以保护自己了。 +了解过环境变量的知识之后,你已经到达了可能对自己和他人造成危险的水平,接下来就需要了解如何通过使用别名来让环境变得更安全、更友好以保护自己了。 -------------------------------------------------------------------------------- From b77746f0d6282e5584490eab2e0e5bb6df6eb3a2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 11:03:15 +0800 Subject: [PATCH 0879/1143] PRF:20181204 Have a cow at the Linux command line.md @heguangzhi --- published/20181204 Have a cow at the Linux command line.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/published/20181204 Have a cow at the Linux command line.md b/published/20181204 Have a cow at the Linux command line.md index ad7b054d9a..0d0f260bb8 100644 --- a/published/20181204 Have a cow at the Linux command line.md +++ b/published/20181204 Have a cow at the Linux command line.md @@ -23,13 +23,13 @@ `cowsay` 是一个神奇的实用程序,它将文本作为 ASCII 艺术牛的讲话文本输出。 -你可能会发现 `cowsey` 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装: +你可能会发现 `cowsay` 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装: ``` $ sudo dnf install -y cowsay ``` -然后,用 `cowsey` 调用它,然后是你的消息。也许你想到昨天我们谈到的 [fortune 应用][1] 连接起来。 +然后,用 `cowsay` 调用它,然后是你的消息。也许你想到昨天我们谈到的 [fortune 应用][1] 连接起来。 ``` $ fortune | cowsay @@ -72,7 +72,7 @@ $ cowsay -f dragon "Run for cover, I feel a sneeze coming on." 我对 `cowsay` 的真正不满是,我今天没有足够的时间来为牛的挤奶 —— 一语双关。牛排价格太高了,我只是开个玩笑。 -更严重的是,我已经完全忘记了 `cowsay` 直到我在学习 Ansible 的剧本时再次遇到它。如果你碰巧安装了 `cowyay`,当你运行Ansible 的剧本时,你会从一队奶牛那里获得输出。例如,运行这个剧本: +更严重的是,我已经完全忘记了 `cowsay` 直到我在学习 Ansible 的剧本时再次遇到它。如果你碰巧安装了 `cowsay`,当你运行 Ansible 的剧本时,你会从一队奶牛那里获得输出。例如,运行这个剧本: ``` - hosts: From 6c2e1a5d7fc7764a818a5616d9a42c8199593615 Mon Sep 17 00:00:00 2001 From: dianbanjiu Date: Sun, 16 Dec 2018 12:45:22 +0800 Subject: [PATCH 0880/1143] translated --- ...ry Status And Level From Linux Terminal.md | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) rename {sources => translated}/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md (53%) diff --git a/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md similarity index 53% rename from sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md rename to translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md index 1f94cd1045..7e4bff270a 100644 --- a/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md +++ b/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (dianbanjiu ) +[#]: translator: ( dianbanjiu ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,38 +7,38 @@ [#]: via: (https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -5 Ways To Check Laptop Battery Status And Level From Linux Terminal +从 Linux 终端查看笔记本电池状态等级的 5 个方法 ====== -We can easily check the battery status through GUI such as current battery percentage, whether it’s charging or not charging and how long it will be usable without charging, but we can’t able to check the battery health and other related information. +我们可以轻松地通过图形化界面查看当前电量百分比、是否在充电以及当前电量还可以使用多长时间等电池状态,但是却无法查看电池健康度等相关信息。 -In this scenario what will be the solutions. +在这篇文章就是为了解决这些问题。 -Yes, we have few utilities available for this in Linux and it can be achieved through command line. +在 Linux 上有很多实用工具可以用命令行进行使用。 -We are going to discuss about this topic today through this article and i will try to cover possible information i can. +这篇文章今天就要探讨这个主题,我会尽我所能的覆盖尽可能多的信息。 -Checking your battery health monthly once is something good. It will help you to identify whether we are facing any battery or charge related issues. +每月检查一次你的电池健康度是一个很好的想法。它可以帮你检查你当前遇到的问题是否与电池或者充电相关。 -Also, we can see battery model name, power source, vendor and battery technology, etc,. +同时,我们也可以查看电池模组名称、电源、出售商以及电池规格等。 -Power management is a feature that turns off the power or switches system’s components to a low-power state when inactive. +电源管理是在非活跃状态时关闭电源或者切换系统的组件到低耗模式的一种功能。 -### Following Utilities are available in Linux to Check Battery Status. +### 几种在 Linux 下检查电池状态的实用工具 - * `upower`: upower is a command line tool which provides an interface to enumerate power sources on the system. - * `acpi`: acpi Shows information from the /proc or the /sys filesystem, such as battery status or thermal information. - * `batstat`: batstat is a command line tool to print battery status for linux. - * `tlp`: TLP brings you the benefits of advanced power management for Linux without changing any configuration. - * `class file`: The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures. + * `upower`: upower 是一个提供了接口来罗列系统中电源的命令行工具。 + * `acpi`: acpi显示来自 /proc 或者 /sys 文件中的一些信息,例如电池状态或者热量信息 + * `batstat`: batstat 是一个为 Linux 打印电池状态的命令行工具。 + * `tlp`: TLP 可以为你带来更高级的电源管理,而无需修改任何配置。 + * `class file`: 这个文件系统是一个提供了内核数据结构接口的伪文件系统。 -### How to Check Laptop Battery Status Using upower Command? +### 如何使用 upower 命令检查笔记本电池状态 -[upower][1] is a command line tool that provides an interface to enumerate power sources on the system. It control the latency of different operations on your computer, which enables you to save significant amounts of power. +[upower][1] 是一个提供了接口来罗列系统中电源的命令行工具。它在你的电脑上可以控制不同操作的延迟,这可以为你节省很大一部分电量。 -Just run the following command to get the battery and it’s related information on Linux. +只需要在 Linux 中运行以下命令获取电池以及它所依赖的其他信息。 ``` $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 @@ -72,7 +72,7 @@ $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 1543847178 10.714 discharging ``` -To check the specific information about battery, use the following format. +使用下面的格式检查电池的特定信息。 ``` $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty" @@ -81,7 +81,7 @@ $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|perce percentage: 43% ``` -It’s same as above, but it’s taken after power cable plugged in, that’s why the state showing charging. +这个类似于上面的那个,但是充电线缆的插入就相当于一个令牌,这也就是为什么下面会显示正在充电状态的原因。 ``` $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty" @@ -89,15 +89,15 @@ $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|perce percentage: 41% ``` -### How to Check Laptop Battery Status Using TLP Command? +### 如何使用 TLP 命令检查笔记本电池状态 -TLP is a free opensource feature-rich command line tool which optimize laptop battery without making any configuration change. +TLP 是一个自由开源多功能的命令行工具,它可以优化笔记本电池而无需修改任何配置。 -TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfil your specific requirements. +TLP 可以为你的 Linux 带来更高级的电源管理,而无需理解任何技术细节。TLP 默认附带了一个已经为你的电池优化好的配置,所以你可以安装好后就不再管它了。尽管 TLP 是一个可以根据你的需求高度可定制的工具。 -TLP package is available in most of the Linux distribution official repository such as Arch, Debian, Fedora, Gentoo, openSUSE, etc. Use your distribution Package Manager to install the TLP utility. +TLP 在绝大多数 Linux 发行版,例如 Arch、Debian、Fedora、Gentoo、openSUSE等的官方库中都可用。使用你的 Linux 发行版的包管理安装 TLP 即可。 -Just run the following command to get the battery and it’s related information on Linux. +只需要在 Linux 中运行以下命令获取电池以及其他所依赖的信息。 ``` $ sudo tlp-stat -b @@ -117,7 +117,7 @@ Charge = 42.0 [%] Capacity = 87.1 [%] ``` -To see other information as well. +也可以查看其他的信息。 ``` $ sudo tlp-stat -s @@ -139,16 +139,16 @@ Mode = battery Power source = battery ``` -### How to Check Laptop Battery Status Using ACPI Command? +### 如何使用 ACPI 命令检查电池状态 -ACPI stands for Advanced Configuration and Power Interface modules are kernel modules for different ACPI parts. They enable special ACPI functions or add information to /proc or /sys. These information can be parsed by acpid for events or other monitoring applications. +ACPI 代表高级配置和电源接口模块,它们是不同 ACPI 部件的内核模块。它们启用特殊的 ACPI 函数向 /proc 或者 /sys 中添加信息。这些信息可以通过事件或者其他监控程序的 acpid 进行解析。 ``` $ acpi Battery 0: Charging, 43%, 01:05:11 until charged ``` -To see battery capacity. +查看电池容量。 ``` $ acpi -i @@ -156,7 +156,7 @@ Battery 0: Charging, 43%, 01:05:07 until charged Battery 0: design capacity 3817 mAh, last full capacity 3324 mAh = 87% ``` -To see more details about battery and related information. +查看更多有关电池及其相关的信息。 ``` $ acpi -V @@ -177,9 +177,9 @@ Cooling 10: x86_pkg_temp no state information available Cooling 11: Processor 0 of 10 ``` -### How to Check Laptop Battery Status Using Batstat Command? +### 如何使用 Batstat 命令查看笔记本电池状态 -batstat is a command line tool to print battery status in linux terminal. +batstat 是一个在 Linux 终端打印电池信息的命令行工具。 ``` Status: Charging @@ -193,13 +193,13 @@ Time elapsed: 0: 0:12 since 49.00% 0: 0: 0 49.00% ``` -### How to Check Laptop Battery Status Using sysfs filesystem? +### 如何使用 sysfs 文件系统查看笔记本电池状态 -The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures. The files under sysfs provide information about devices, kernel modules, filesystems, and other kernel components. +sysfs 文件系统是一个提供了内核数据结构接口的伪文件系统。sysfs 下的文件提供有关设备、内核模块、文件系统和其他内核组件的信息。 -The sysfs filesystem is commonly mounted at /sys. Typically, it is mounted automatically by the system, but it can also be mounted manually using a command such as `mount -t sysfs sysfs /sys` +sysfs 文件系统通常挂载在 /sys。通常来说,它会被系统自动挂载,但是也可以使用例如 `mount -t sysfs sysfs /sys` 命令进行手动挂载。 -Many of the files in the sysfs filesystem are read-only, but some files are writable, allowing kernel variables to be changed. To avoid redundancy, symbolic links are heavily used to connect entries across the filesystem tree. +在 sysfs 文件系统中的很多文件都是只读的,但也有一些是可写的,允许更改内核变量。为了避免冗余,符号链接被大量用于连接文件系统数中的条目。 ``` $ cat /sys/class/power_supply/BAT0/* @@ -247,7 +247,7 @@ via: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[dianbanjiu](https://github.com/dianbanjiu) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8a9e2985aa5ecfed2ece687677feeb1a1464f0d8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 12:58:38 +0800 Subject: [PATCH 0881/1143] PRF:20181016 Lab 4- Preemptive Multitasking.md @qhwdw --- ...20181016 Lab 4- Preemptive Multitasking.md | 381 ++++++++---------- 1 file changed, 173 insertions(+), 208 deletions(-) diff --git a/translated/tech/20181016 Lab 4- Preemptive Multitasking.md b/translated/tech/20181016 Lab 4- Preemptive Multitasking.md index 9302b7288a..4023b0b2e9 100644 --- a/translated/tech/20181016 Lab 4- Preemptive Multitasking.md +++ b/translated/tech/20181016 Lab 4- Preemptive Multitasking.md @@ -1,10 +1,9 @@ -实验 4:抢占式多任务处理 +Caffeinated 6.828:实验 4:抢占式多任务处理 ====== -### 实验 4:抢占式多任务处理 -#### 简介 +### 简介 -在本实验中,你将在多个同时活动的用户模式中的环境之间实现抢占式多任务处理。 +在本实验中,你将在多个同时活动的用户模式环境之间实现抢占式多任务处理。 在 Part A 中,你将在 JOS 中添加对多处理器的支持,以实现循环调度。并且添加基本的环境管理方面的系统调用(创建和销毁环境的系统调用、以及分配/映射内存)。 @@ -12,7 +11,7 @@ 最后,在 Part C 中,你将在 JOS 中添加对进程间通讯(IPC)的支持,以允许不同用户模式环境之间进行显式通讯和同步。你也将要去添加对硬件时钟中断和优先权的支持。 -##### 预备知识 +#### 预备知识 使用 git 去提交你的实验 3 的源代码,并获取课程仓库的最新版本,然后创建一个名为 `lab4` 的本地分支,它跟踪我们的名为 `origin/lab4` 的远程 `lab4` 分支: @@ -31,6 +30,7 @@ ``` 实验 4 包含了一些新的源文件,在开始之前你应该去浏览一遍: + ```markdown kern/cpu.h Kernel-private definitions for multiprocessor support kern/mpconfig.c Code to read the multiprocessor configuration @@ -41,19 +41,19 @@ kern/spinlock.c Kernel code implementing spin locks kern/sched.c Code skeleton of the scheduler that you are about to implement ``` -##### 实验要求 +#### 实验要求 -本实验分为三部分:Part A、Part B、和 Part C。我们计划为每个部分分配一周的时间。 +本实验分为三部分:Part A、Part B 和 Part C。我们计划为每个部分分配一周的时间。 和以前一样,你需要完成实验中出现的、所有常规练习和至少一个挑战问题。(不是每个部分做一个挑战问题,是整个实验做一个挑战问题即可。)另外,你还要写出你实现的挑战问题的详细描述。如果你实现了多个挑战问题,你只需写出其中一个即可,虽然我们的课程欢迎你完成越多的挑战越好。在动手实验之前,请将你的挑战问题的答案写在一个名为 `answers-lab4.txt` 的文件中,并把它放在你的 `lab` 目录的根下。 -#### Part A:多处理器支持和协调多任务处理 +### Part A:多处理器支持和协调多任务处理 在本实验的第一部分,将去扩展你的 JOS 内核,以便于它能够在一个多处理器的系统上运行,并且要在 JOS 内核中实现一些新的系统调用,以便于它允许用户级环境创建附加的新环境。你也要去实现协调的循环调度,在当前的环境自愿放弃 CPU(或退出)时,允许内核将一个环境切换到另一个环境。稍后在 Part C 中,你将要实现抢占调度,它允许内核在环境占有 CPU 一段时间后,从这个环境上重新取回对 CPU 的控制,那怕是在那个环境不配合的情况下。 -##### 多处理器支持 +#### 多处理器支持 -我们继续去让 JOS 支持 “对称多处理器”(SMP),在一个多处理器的模型中,所有 CPU 们都有平等访问系统资源(如内存和 I/O 总线)的权利。虽然在 SMP 中所有 CPU 们都有相同的功能,但是在引导进程的过程中,它们被分成两种类型:引导程序处理器(BSP)负责初始化系统和引导操作系统;而在操作系统启动并正常运行后,应用程序处理器(AP)将被 BSP 激活。哪个处理器做 BSP 是由硬件和 BIOS 来决定的。到目前为止,你所有的已存在的 JOS 代码都是运行在 BSP 上的。 +我们继续去让 JOS 支持 “对称多处理器”(SMP),在一个多处理器的模型中,所有 CPU 们都有平等访问系统资源(如内存和 I/O 总线)的权力。虽然在 SMP 中所有 CPU 们都有相同的功能,但是在引导进程的过程中,它们被分成两种类型:引导程序处理器(BSP)负责初始化系统和引导操作系统;而在操作系统启动并正常运行后,应用程序处理器(AP)将被 BSP 激活。哪个处理器做 BSP 是由硬件和 BIOS 来决定的。到目前为止,你所有的已存在的 JOS 代码都是运行在 BSP 上的。 在一个 SMP 系统上,每个 CPU 都伴有一个本地 APIC(LAPIC)单元。这个 LAPIC 单元负责传递系统中的中断。LAPIC 还为它所连接的 CPU 提供一个唯一的标识符。在本实验中,我们将使用 LAPIC 单元(它在 `kern/lapic.c` 中)中的下列基本功能: @@ -61,15 +61,11 @@ kern/sched.c Code skeleton of the scheduler that you are about to implement * 从 BSP 到 AP 之间发送处理器间中断(IPI) `STARTUP`,以启动其它 CPU(查看 `lapic_startap()`)。 * 在 Part C 中,我们设置 LAPIC 的内置定时器去触发时钟中断,以便于支持抢占式多任务处理(查看 `apic_init()`)。 +一个处理器使用内存映射的 I/O(MMIO)来访问它的 LAPIC。在 MMIO 中,一部分物理内存是硬编码到一些 I/O 设备的寄存器中,因此,访问内存时一般可以使用相同的 `load/store` 指令去访问设备的寄存器。正如你所看到的,在物理地址 `0xA0000` 处就是一个 IO 入口(就是我们写入 VGA 缓冲区的入口)。LAPIC 就在那里,它从物理地址 `0xFE000000` 处(4GB 减去 32MB 处)开始,这个地址对于我们在 KERNBASE 处使用直接映射访问来说太高了。JOS 虚拟内存映射在 `MMIOBASE` 处,留下一个 4MB 的空隙,以便于我们有一个地方,能像这样去映射设备。由于在后面的实验中,我们将介绍更多的 MMIO 区域,你将要写一个简单的函数,从这个区域中去分配空间,并将设备的内存映射到那里。 +> **练习 1**、实现 `kern/pmap.c` 中的 `mmio_map_region`。去看一下它是如何使用的,从 `kern/lapic.c` 中的 `lapic_init` 开始看起。在 `mmio_map_region` 的测试运行之前,你还要做下一个练习。 -一个处理器使用内存映射的 I/O(MMIO)来访问它的 LAPIC。在 MMIO 中,一部分物理内存是硬编码到一些 I/O 设备的寄存器中,因此,访问内存时一般可以使用相同的 `load/store` 指令去访问设备的寄存器。正如你所看到的,在物理地址 `0xA0000` 处就是一个 IO 入口(就是我们写入 VGA 缓冲区的入口)。LAPIC 就在那里,它从物理地址 `0xFE000000` 处(4GB 减去 32MB 处)开始,这个地址对于我们在 KERNBASE 处使用直接映射访问来说太高了。JOS 虚拟内存映射在 `MMIOBASE` 处,留下一个 4MB 的空隙,以便于我们有一个地方,能像这样去映射设备。由于在后面的实验中,我们将介绍更多的 MMIO 区域,你将要写一个简单的函数,从这个区域中去分配空间,并将设备的内存映射到那里。 - -```markdown -练习 1、实现 `kern/pmap.c` 中的 `mmio_map_region`。去看一下它是如何使用的,从 `kern/lapic.c` 中的 `lapic_init` 开始看起。在 `mmio_map_region` 的测试运行之前,你还要做下一个练习。 -``` - -###### 引导应用程序处理器 +##### 引导应用程序处理器 在引导应用程序处理器之前,引导程序处理器应该会首先去收集关于多处理器系统的信息,比如总的 CPU 数、它们的 APIC ID 以及 LAPIC 单元的 MMIO 地址。在 `kern/mpconfig.c` 中的 `mp_init()` 函数,通过读取内存中位于 BIOS 区域里的 MP 配置表来获得这些信息。 @@ -77,46 +73,42 @@ kern/sched.c Code skeleton of the scheduler that you are about to implement 在那之后,通过发送 IPI `STARTUP` 到相关 AP 的 LAPIC 单元,以及一个初始的 `CS:IP` 地址(AP 将从那儿开始运行它的入口代码,在我们的案例中是 `MPENTRY_PADDR` ),`boot_aps()` 将一个接一个地激活 AP。在 `kern/mpentry.S` 中的入口代码非常类似于 `boot/boot.S`。在一些简短的设置之后,它启用分页,使 AP 进入保护模式,然后调用 C 设置程序 `mp_main()`(它也在 `kern/init.c` 中)。在继续唤醒下一个 AP 之前, `boot_aps()` 将等待这个 AP 去传递一个 `CPU_STARTED` 标志到它的 `struct CpuInfo` 中的 `cpu_status` 字段中。 -```markdown -练习 2、阅读 `kern/init.c` 中的 `boot_aps()` 和 `mp_main()`,以及在 `kern/mpentry.S` 中的汇编代码。确保你理解了在 AP 引导过程中的控制流转移。然后修改在 `kern/pmap.c` 中的、你自己的 `page_init()`,实现避免在 `MPENTRY_PADDR` 处添加页到空闲列表上,以便于我们能够在物理地址上安全地复制和运行 AP 引导程序代码。你的代码应该会通过更新后的 `check_page_free_list()` 的测试(但可能会在更新后的 `check_kern_pgdir()` 上测试失败,我们在后面会修复它)。 -``` +> **练习 2**、阅读 `kern/init.c` 中的 `boot_aps()` 和 `mp_main()`,以及在 `kern/mpentry.S` 中的汇编代码。确保你理解了在 AP 引导过程中的控制流转移。然后修改在 `kern/pmap.c` 中的、你自己的 `page_init()`,实现避免在 `MPENTRY_PADDR` 处添加页到空闲列表上,以便于我们能够在物理地址上安全地复制和运行 AP 引导程序代码。你的代码应该会通过更新后的 `check_page_free_list()` 的测试(但可能会在更新后的 `check_kern_pgdir()` 上测试失败,我们在后面会修复它)。 -```markdown -问题 - 1、比较 `kern/mpentry.S` 和 `boot/boot.S`。记住,那个 `kern/mpentry.S` 是编译和链接后的,运行在 `KERNBASE` 上面的,就像内核中的其它程序一样,宏 `MPBOOTPHYS` 的作用是什么?为什么它需要在 `kern/mpentry.S` 中,而不是在 `boot/boot.S` 中?换句话说,如果在 `kern/mpentry.S` 中删掉它,会发生什么错误? +. + +> **问题 1**、比较 `kern/mpentry.S` 和 `boot/boot.S`。记住,那个 `kern/mpentry.S` 是编译和链接后的,运行在 `KERNBASE` 上面的,就像内核中的其它程序一样,宏 `MPBOOTPHYS` 的作用是什么?为什么它需要在 `kern/mpentry.S` 中,而不是在 `boot/boot.S` 中?换句话说,如果在 `kern/mpentry.S` 中删掉它,会发生什么错误? 提示:回顾链接地址和加载地址的区别,我们在实验 1 中讨论过它们。 -``` - -###### 每个 CPU 的状态和初始化 +##### 每个 CPU 的状态和初始化 当写一个多处理器操作系统时,区分每个 CPU 的状态是非常重要的,而每个 CPU 的状态对其它处理器是不公开的,而全局状态是整个系统共享的。`kern/cpu.h` 定义了大部分每个 CPU 的状态,包括 `struct CpuInfo`,它保存了每个 CPU 的变量。`cpunum()` 总是返回调用它的那个 CPU 的 ID,它可以被用作是数组的索引,比如 `cpus`。或者,宏 `thiscpu` 是当前 CPU 的 `struct CpuInfo` 缩略表示。 下面是你应该知道的每个 CPU 的状态: - * **每个 CPU 的内核栈** -因为内核能够同时捕获多个 CPU,因此,我们需要为每个 CPU 准备一个单独的内核栈,以防止它们运行的程序之间产生相互干扰。数组 `percpu_kstacks[NCPU][KSTKSIZE]` 为 NCPU 的内核栈资产保留了空间。 +* **每个 CPU 的内核栈** -在实验 2 中,你映射的 `bootstack` 所引用的物理内存,就作为 `KSTACKTOP` 以下的 BSP 的内核栈。同样,在本实验中,你将每个 CPU 的内核栈映射到这个区域,而使用保护页做为它们之间的缓冲区。CPU 0 的栈将从 `KSTACKTOP` 处向下增长;CPU 1 的栈将从 CPU 0 的栈底部的 `KSTKGAP` 字节处开始,依次类推。在 `inc/memlayout.h` 中展示了这个映射布局。 + 因为内核能够同时捕获多个 CPU,因此,我们需要为每个 CPU 准备一个单独的内核栈,以防止它们运行的程序之间产生相互干扰。数组 `percpu_kstacks[NCPU][KSTKSIZE]` 为 NCPU 的内核栈资产保留了空间。 - * **每个 CPU 的 TSS 和 TSS 描述符** -为了指定每个 CPU 的内核栈在哪里,也需要有一个每个 CPU 的任务状态描述符(TSS)。CPU _i_ 的任务状态描述符是保存在 `cpus[i].cpu_ts` 中,而对应的 TSS 描述符是定义在 GDT 条目 `gdt[(GD_TSS0 >> 3) + i]` 中。在 `kern/trap.c` 中定义的全局变量 `ts` 将不再被使用。 + 在实验 2 中,你映射的 `bootstack` 所引用的物理内存,就作为 `KSTACKTOP` 以下的 BSP 的内核栈。同样,在本实验中,你将每个 CPU 的内核栈映射到这个区域,而使用保护页做为它们之间的缓冲区。CPU 0 的栈将从 `KSTACKTOP` 处向下增长;CPU 1 的栈将从 CPU 0 的栈底部的 `KSTKGAP` 字节处开始,依次类推。在 `inc/memlayout.h` 中展示了这个映射布局。 - * **每个 CPU 当前的环境指针** -由于每个 CPU 都能同时运行不同的用户进程,所以我们重新定义了符号 `curenv`,让它指向到 `cpus[cpunum()].cpu_env`(或 `thiscpu->cpu_env`),它指向到当前 CPU(代码正在运行的那个 CPU)上当前正在运行的环境上。 +* **每个 CPU 的 TSS 和 TSS 描述符** - * **每个 CPU 的系统寄存器** -所有的寄存器,包括系统寄存器,都是一个 CPU 私有的。所以,初始化这些寄存器的指令,比如 `lcr3()`、`ltr()`、`lgdt()`、`lidt()`、等待,必须在每个 CPU 上运行一次。函数 `env_init_percpu()` 和 `trap_init_percpu()` 就是为此目的而定义的。 + 为了指定每个 CPU 的内核栈在哪里,也需要有一个每个 CPU 的任务状态描述符(TSS)。CPU _i_ 的任务状态描述符是保存在 `cpus[i].cpu_ts` 中,而对应的 TSS 描述符是定义在 GDT 条目 `gdt[(GD_TSS0 >> 3) + i]` 中。在 `kern/trap.c` 中定义的全局变量 `ts` 将不再被使用。 +* **每个 CPU 当前的环境指针** + 由于每个 CPU 都能同时运行不同的用户进程,所以我们重新定义了符号 `curenv`,让它指向到 `cpus[cpunum()].cpu_env`(或 `thiscpu->cpu_env`),它指向到当前 CPU(代码正在运行的那个 CPU)上当前正在运行的环境上。 -```markdown -练习 3、修改 `mem_init_mp()`(在 `kern/pmap.c` 中)去映射每个 CPU 的栈从 `KSTACKTOP` 处开始,就像在 `inc/memlayout.h` 中展示的那样。每个栈的大小是 `KSTKSIZE` 字节加上未映射的保护页 `KSTKGAP` 的字节。你的代码应该会通过在 `check_kern_pgdir()` 中的新的检查。 -``` +* **每个 CPU 的系统寄存器** -```markdown -练习 4、在 `trap_init_percpu()`(在 `kern/trap.c` 文件中)的代码为 BSP 初始化 TSS 和 TSS 描述符。在实验 3 中它就运行过,但是当它运行在其它的 CPU 上就会出错。修改这些代码以便它能在所有 CPU 上都正常运行。(注意:你的新代码应该还不能使用全局变量 `ts`) -``` + 所有的寄存器,包括系统寄存器,都是一个 CPU 私有的。所以,初始化这些寄存器的指令,比如 `lcr3()`、`ltr()`、`lgdt()`、`lidt()`、等待,必须在每个 CPU 上运行一次。函数 `env_init_percpu()` 和 `trap_init_percpu()` 就是为此目的而定义的。 + +> **练习 3**、修改 `mem_init_mp()`(在 `kern/pmap.c` 中)去映射每个 CPU 的栈从 `KSTACKTOP` 处开始,就像在 `inc/memlayout.h` 中展示的那样。每个栈的大小是 `KSTKSIZE` 字节加上未映射的保护页 `KSTKGAP` 的字节。你的代码应该会通过在 `check_kern_pgdir()` 中的新的检查。 + +. + +> **练习 4**、在 `trap_init_percpu()`(在 `kern/trap.c` 文件中)的代码为 BSP 初始化 TSS 和 TSS 描述符。在实验 3 中它就运行过,但是当它运行在其它的 CPU 上就会出错。修改这些代码以便它能在所有 CPU 上都正常运行。(注意:你的新代码应该还不能使用全局变量 `ts`) 在你完成上述练习后,在 QEMU 中使用 4 个 CPU(使用 `make qemu CPUS=4` 或 `make qemu-nox CPUS=4`)来运行 JOS,你应该看到类似下面的输出: @@ -134,94 +126,87 @@ kern/sched.c Code skeleton of the scheduler that you are about to implement SMP: CPU 3 starting ``` -###### 锁定 +##### 锁定 在 `mp_main()` 中初始化 AP 后我们的代码快速运行起来。在你更进一步增强 AP 之前,我们需要首先去处理多个 CPU 同时运行内核代码的争用状况。达到这一目标的最简单的方法是使用大内核锁。大内核锁是一个单个的全局锁,当一个环境进入内核模式时,它将被加锁,而这个环境返回到用户模式时它将释放锁。在这种模型中,在用户模式中运行的环境可以同时运行在任何可用的 CPU 上,但是只有一个环境能够运行在内核模式中;而任何尝试进入内核模式的其它环境都被强制等待。 `kern/spinlock.h` 中声明大内核锁,即 `kernel_lock`。它也提供 `lock_kernel()` 和 `unlock_kernel()`,快捷地去获取/释放锁。你应该在以下的四个位置应用大内核锁: - * 在 `i386_init()` 时,在 BSP 唤醒其它 CPU 之前获取锁。 - * 在 `mp_main()` 时,在初始化 AP 之后获取锁,然后调用 `sched_yield()` 在这个 AP 上开始运行环境。 - * 在 `trap()` 时,当从用户模式中捕获一个陷阱trap时获取锁。在检查 `tf_cs` 的低位比特,以确定一个陷阱是发生在用户模式还是内核模式时。 - * 在 `env_run()` 中,在切换到用户模式之前释放锁。不能太早也不能太晚,否则你将可能会产生争用或死锁。 +* 在 `i386_init()` 时,在 BSP 唤醒其它 CPU 之前获取锁。 +* 在 `mp_main()` 时,在初始化 AP 之后获取锁,然后调用 `sched_yield()` 在这个 AP 上开始运行环境。 +* 在 `trap()` 时,当从用户模式中捕获一个陷阱trap时获取锁。在检查 `tf_cs` 的低位比特,以确定一个陷阱是发生在用户模式还是内核模式时。 +* 在 `env_run()` 中,在切换到用户模式之前释放锁。不能太早也不能太晚,否则你将可能会产生争用或死锁。 +> **练习 5**、在上面所描述的情况中,通过在合适的位置调用 `lock_kernel()` 和 `unlock_kernel()` 应用大内核锁。 -```markdown -练习 5、在上面所描述的情况中,通过在合适的位置调用 `lock_kernel()` 和 `unlock_kernel()` 应用大内核锁。 -``` +> 如果你的锁定是正确的,如何去测试它?实际上,到目前为止,还无法测试!但是在下一个练习中,你实现了调度之后,就可以测试了。 -如果你的锁定是正确的,如何去测试它?实际上,到目前为止,还无法测试!但是在下一个练习中,你实现了调度之后,就可以测试了。 +. -``` -问题 - 2、看上去使用一个大内核锁,可以保证在一个时间中只有一个 CPU 能够运行内核代码。为什么每个 CPU 仍然需要单独的内核栈?描述一下使用一个共享内核栈出现错误的场景,即便是在它使用了大内核锁保护的情况下。 -``` +> **问题 2**、看上去使用一个大内核锁,可以保证在一个时间中只有一个 CPU 能够运行内核代码。为什么每个 CPU 仍然需要单独的内核栈?描述一下使用一个共享内核栈出现错误的场景,即便是在它使用了大内核锁保护的情况下。 -``` -小挑战!大内核锁很简单,也易于使用。尽管如此,它消除了内核模式的所有并发。大多数现代操作系统使用不同的锁,一种称之为细粒度锁定的方法,去保护它们的共享的栈的不同部分。细粒度锁能够大幅提升性能,但是实现起来更困难并且易出错。如果你有足够的勇气,在 JOS 中删除大内核锁,去拥抱并发吧! +> **小挑战!**大内核锁很简单,也易于使用。尽管如此,它消除了内核模式的所有并发。大多数现代操作系统使用不同的锁,一种称之为细粒度锁定的方法,去保护它们的共享的栈的不同部分。细粒度锁能够大幅提升性能,但是实现起来更困难并且易出错。如果你有足够的勇气,在 JOS 中删除大内核锁,去拥抱并发吧! -由你来决定锁的粒度(一个锁保护的数据量)。给你一个提示,你可以考虑在 JOS 内核中使用一个自旋锁去确保你独占访问这些共享的组件: +> 由你来决定锁的粒度(一个锁保护的数据量)。给你一个提示,你可以考虑在 JOS 内核中使用一个自旋锁去确保你独占访问这些共享的组件: - * 页分配器 - * 控制台驱动 - * 调度器 - * 你将在 Part C 中实现的进程间通讯(IPC)的状态 -``` +> * 页分配器 +* 控制台驱动 +* 调度器 +* 你将在 Part C 中实现的进程间通讯(IPC)的状态 - -##### 循环调度 +#### 循环调度 本实验中,你的下一个任务是去修改 JOS 内核,以使它能够在多个环境之间以“循环”的方式去交替。JOS 中的循环调度工作方式如下: - * 在新的 `kern/sched.c` 中的 `sched_yield()` 函数负责去选择一个新环境来运行。它按顺序以循环的方式在数组 `envs[]` 中进行搜索,在前一个运行的环境之后开始(或如果之前没有运行的环境,就从数组起点开始),选择状态为 `ENV_RUNNABLE` 的第一个环境(查看 `inc/env.h`),并调用 `env_run()` 去跳转到那个环境。 - * `sched_yield()` 必须做到,同一个时间在两个 CPU 上绝对不能运行相同的环境。它可以判断出一个环境正运行在一些 CPU(可能是当前 CPU)上,因为,那个正在运行的环境的状态将是 `ENV_RUNNING`。 - * 我们已经为你实现了一个新的系统调用 `sys_yield()`,用户环境调用它去调用内核的 `sched_yield()` 函数,并因此将自愿把对 CPU 的控制禅让给另外的一个环境。 +* 在新的 `kern/sched.c` 中的 `sched_yield()` 函数负责去选择一个新环境来运行。它按顺序以循环的方式在数组 `envs[]` 中进行搜索,在前一个运行的环境之后开始(或如果之前没有运行的环境,就从数组起点开始),选择状态为 `ENV_RUNNABLE` 的第一个环境(查看 `inc/env.h`),并调用 `env_run()` 去跳转到那个环境。 +* `sched_yield()` 必须做到,同一个时间在两个 CPU 上绝对不能运行相同的环境。它可以判断出一个环境正运行在一些 CPU(可能是当前 CPU)上,因为,那个正在运行的环境的状态将是 `ENV_RUNNING`。 +* 我们已经为你实现了一个新的系统调用 `sys_yield()`,用户环境调用它去调用内核的 `sched_yield()` 函数,并因此将自愿把对 CPU 的控制禅让给另外的一个环境。 +> **练习 6**、像上面描述的那样,在 `sched_yield()` 中实现循环调度。不要忘了去修改 `syscall()` 以派发 `sys_yield()`。 -```c -练习 6、像上面描述的那样,在 `sched_yield()` 中实现循环调度。不要忘了去修改 `syscall()` 以派发 `sys_yield()`。 +> 确保在 `mp_main` 中调用了 `sched_yield()`。 -确保在 `mp_main` 中调用了 `sched_yield()`。 +> 修改 `kern/init.c` 去创建三个(或更多个!)运行程序 `user/yield.c`的环境。 -修改 `kern/init.c` 去创建三个(或更多个!)运行程序 `user/yield.c`的环境。 +> 运行 `make qemu`。在它终止之前,你应该会看到像下面这样,在环境之间来回切换了五次。 -运行 `make qemu`。在它终止之前,你应该会看到像下面这样,在环境之间来回切换了五次。 +> 也可以使用几个 CPU 来测试:`make qemu CPUS=2`。 -也可以使用几个 CPU 来测试:make qemu CPUS=2。 - - ... - Hello, I am environment 00001000. - Hello, I am environment 00001001. - Hello, I am environment 00001002. - Back in environment 00001000, iteration 0. - Back in environment 00001001, iteration 0. - Back in environment 00001002, iteration 0. - Back in environment 00001000, iteration 1. - Back in environment 00001001, iteration 1. - Back in environment 00001002, iteration 1. - ... - -在程序 `yield` 退出之后,系统中将没有可运行的环境,调度器应该会调用 JOS 内核监视器。如果它什么也没有发生,那么你应该在继续之前修复你的代码。 +>``` +... +Hello, I am environment 00001000. +Hello, I am environment 00001001. +Hello, I am environment 00001002. +Back in environment 00001000, iteration 0. +Back in environment 00001001, iteration 0. +Back in environment 00001002, iteration 0. +Back in environment 00001000, iteration 1. +Back in environment 00001001, iteration 1. +Back in environment 00001002, iteration 1. +... ``` -```c -问题 - 3、在你实现的 `env_run()` 中,你应该会调用 `lcr3()`。在调用 `lcr3()` 的之前和之后,你的代码引用(至少它应该会)变量 `e`,它是 `env_run` 的参数。在加载 `%cr3` 寄存器时,MMU 使用的地址上下文将马上被改变。但一个虚拟地址(即 `e`)相对一个给定的地址上下文是有意义的 —— 地址上下文指定了物理地址到那个虚拟地址的映射。为什么指针 `e` 在地址切换之前和之后被解除引用? - 4、无论何时,内核从一个环境切换到另一个环境,它必须要确保旧环境的寄存器内容已经被保存,以便于它们稍后能够正确地还原。为什么?这种事件发生在什么地方? -``` +> 在程序 `yield` 退出之后,系统中将没有可运行的环境,调度器应该会调用 JOS 内核监视器。如果它什么也没有发生,那么你应该在继续之前修复你的代码。 -```c -小挑战!给内核添加一个小小的调度策略,比如一个固定优先级的调度器,它将会给每个环境分配一个优先级,并且在执行中,较高优先级的环境总是比低优先级的环境优先被选定。如果你想去冒险一下,尝试实现一个类 Unix 的、优先级可调整的调度器,或者甚至是一个彩票调度器或跨步调度器。(可以在 Google 中查找“彩票调度”和“跨步调度”的相关资料) -写一个或两个测试程序,去测试你的调度算法是否工作正常(即,正确的算法能够按正确的次序运行)。如果你实现了本实验的 Part B 和 Part C 部分的 `fork()` 和 IPC,写这些测试程序可能会更容易。 -``` +> **问题 3**、在你实现的 `env_run()` 中,你应该会调用 `lcr3()`。在调用 `lcr3()` 的之前和之后,你的代码引用(至少它应该会)变量 `e`,它是 `env_run` 的参数。在加载 `%cr3` 寄存器时,MMU 使用的地址上下文将马上被改变。但一个虚拟地址(即 `e`)相对一个给定的地址上下文是有意义的 —— 地址上下文指定了物理地址到那个虚拟地址的映射。为什么指针 `e` 在地址切换之前和之后被解除引用? -```markdown -小挑战!目前的 JOS 内核还不能应用到使用了 x87 协处理器、MMX 指令集、或流式 SIMD 扩展(SSE)的 x86 处理器上。扩展数据结构 `Env` 去提供一个能够保存处理器的浮点状态的地方,并且扩展上下文切换代码,当从一个环境切换到另一个环境时,能够保存和还原正确的状态。`FXSAVE` 和 `FXRSTOR` 指令或许对你有帮助,但是需要注意的是,这些指令在旧的 x86 用户手册上没有,因为它是在较新的处理器上引入的。写一个用户级的测试程序,让它使用浮点做一些很酷的事情。 -``` +. -##### 创建环境的系统调用 +> **问题 4**、无论何时,内核从一个环境切换到另一个环境,它必须要确保旧环境的寄存器内容已经被保存,以便于它们稍后能够正确地还原。为什么?这种事件发生在什么地方? + +. + +> 小挑战!给内核添加一个小小的调度策略,比如一个固定优先级的调度器,它将会给每个环境分配一个优先级,并且在执行中,较高优先级的环境总是比低优先级的环境优先被选定。如果你想去冒险一下,尝试实现一个类 Unix 的、优先级可调整的调度器,或者甚至是一个彩票调度器或跨步调度器。(可以在 Google 中查找“彩票调度”和“跨步调度”的相关资料) + +> 写一个或两个测试程序,去测试你的调度算法是否工作正常(即,正确的算法能够按正确的次序运行)。如果你实现了本实验的 Part B 和 Part C 部分的 `fork()` 和 IPC,写这些测试程序可能会更容易。 + +. + +> 小挑战!目前的 JOS 内核还不能应用到使用了 x87 协处理器、MMX 指令集、或流式 SIMD 扩展(SSE)的 x86 处理器上。扩展数据结构 `Env` 去提供一个能够保存处理器的浮点状态的地方,并且扩展上下文切换代码,当从一个环境切换到另一个环境时,能够保存和还原正确的状态。`FXSAVE` 和 `FXRSTOR` 指令或许对你有帮助,但是需要注意的是,这些指令在旧的 x86 用户手册上没有,因为它是在较新的处理器上引入的。写一个用户级的测试程序,让它使用浮点做一些很酷的事情。 + +#### 创建环境的系统调用 虽然你的内核现在已经有了在多个用户级环境之间切换的功能,但是由于内核初始化设置的原因,它在运行环境时仍然是受限的。现在,你需要去实现必需的 JOS 系统调用,以允许用户环境去创建和启动其它的新用户环境。 @@ -229,34 +214,35 @@ Unix 提供了 `fork()` 系统调用作为它的进程创建原语。Unix 的 `f 为创建一个用户模式下的新的环境,你将要提供一个不同的、更原始的 JOS 系统调用集。使用这些系统调用,除了其它类型的环境创建之外,你可以在用户空间中实现一个完整的类 Unix 的 `fork()`。你将要为 JOS 编写的新的系统调用如下: - * `sys_exofork`: -这个系统调用创建一个新的空白的环境:在它的地址空间的用户部分什么都没有映射,并且它也不能运行。这个新的环境与 `sys_exofork` 调用时创建它的父环境的寄存器状态完全相同。在父进程中,`sys_exofork` 将返回新创建进程的 `envid_t`(如果环境分配失败的话,返回的是一个负的错误代码)。在子进程中,它将返回 0。(因为子进程从一开始就被标记为不可运行,在子进程中,`sys_exofork` 将并不真的返回,直到它的父进程使用 .... 显式地将子进程标记为可运行之前。) - * `sys_env_set_status`: -设置指定的环境状态为 `ENV_RUNNABLE` 或 `ENV_NOT_RUNNABLE`。这个系统调用一般是在,一个新环境的地址空间和寄存器状态已经完全初始化完成之后,用于去标记一个准备去运行的新环境。 - * `sys_page_alloc`: -分配一个物理内存页,并映射它到一个给定的环境地址空间中、给定的一个虚拟地址上。 - * `sys_page_map`: -从一个环境的地址空间中复制一个页映射(不是页内容!)到另一个环境的地址空间中,保持一个内存共享,以便于新的和旧的映射共同指向到同一个物理内存页。 - * `sys_page_unmap`: -在一个给定的环境中,取消映射一个给定的已映射的虚拟地址。 +* `sys_exofork`: + 这个系统调用创建一个新的空白的环境:在它的地址空间的用户部分什么都没有映射,并且它也不能运行。这个新的环境与 `sys_exofork` 调用时创建它的父环境的寄存器状态完全相同。在父进程中,`sys_exofork` 将返回新创建进程的 `envid_t`(如果环境分配失败的话,返回的是一个负的错误代码)。在子进程中,它将返回 0。(因为子进程从一开始就被标记为不可运行,在子进程中,`sys_exofork` 将并不真的返回,直到它的父进程使用 .... 显式地将子进程标记为可运行之前。) +* `sys_env_set_status`: + 设置指定的环境状态为 `ENV_RUNNABLE` 或 `ENV_NOT_RUNNABLE`。这个系统调用一般是在,一个新环境的地址空间和寄存器状态已经完全初始化完成之后,用于去标记一个准备去运行的新环境。 +* `sys_page_alloc`: + + 分配一个物理内存页,并映射它到一个给定的环境地址空间中、给定的一个虚拟地址上。 +* `sys_page_map`: + + 从一个环境的地址空间中复制一个页映射(不是页内容!)到另一个环境的地址空间中,保持一个内存共享,以便于新的和旧的映射共同指向到同一个物理内存页。 +* `sys_page_unmap`: + + 在一个给定的环境中,取消映射一个给定的已映射的虚拟地址。 上面所有的系统调用都接受环境 ID 作为参数,JOS 内核支持一个约定,那就是用值 “0” 来表示“当前环境”。这个约定在 `kern/env.c` 中的 `envid2env()` 中实现的。 在我们的 `user/dumbfork.c` 中的测试程序里,提供了一个类 Unix 的 `fork()` 的非常原始的实现。这个测试程序使用了上面的系统调用,去创建和运行一个复制了它自己地址空间的子环境。然后,这两个环境像前面的练习那样使用 `sys_yield` 来回切换,父进程在迭代 10 次后退出,而子进程在迭代 20 次后退出。 -```c -练习 7、在 `kern/syscall.c` 中实现上面描述的系统调用,并确保 `syscall()` 能调用它们。你将需要使用 `kern/pmap.c` 和 `kern/env.c` 中的多个函数,尤其是要用到 `envid2env()`。目前,每当你调用 `envid2env()` 时,在 `checkperm` 中传递参数 1。你务必要做检查任何无效的系统调用参数,在那个案例中,就返回了 `-E_INVAL`。使用 `user/dumbfork` 测试你的 JOS 内核,并在继续之前确保它运行正常。 -``` +> **练习 7**、在 `kern/syscall.c` 中实现上面描述的系统调用,并确保 `syscall()` 能调用它们。你将需要使用 `kern/pmap.c` 和 `kern/env.c` 中的多个函数,尤其是要用到 `envid2env()`。目前,每当你调用 `envid2env()` 时,在 `checkperm` 中传递参数 1。你务必要做检查任何无效的系统调用参数,在那个案例中,就返回了 `-E_INVAL`。使用 `user/dumbfork` 测试你的 JOS 内核,并在继续之前确保它运行正常。 -```c -小挑战!添加另外的系统调用,必须能够读取已存在的、所有的、环境的重要状态,以及设置它们。然后实现一个能够 fork 出子环境的用户模式程序,运行它一小会(即,迭代几次 `sys_yield()`),然后取得几张屏幕截图或子环境的检查点,然后运行子环境一段时间,然后还原子环境到检查点时的状态,然后从这里继续开始。这样,你就可以有效地从一个中间状态“回放”了子环境的运行。确保子环境与用户使用 `sys_cgetc()` 或 `readline()` 执行了一些交互,这样,那个用户就能够查看和突变它的内部状态,并且你可以通过给子环境给定一个选择性遗忘的状况,来验证你的检查点/重启动的有效性,使它“遗忘”了在某些点之前发生的事情。 -``` +. + +> **小挑战!**添加另外的系统调用,必须能够读取已存在的、所有的、环境的重要状态,以及设置它们。然后实现一个能够 fork 出子环境的用户模式程序,运行它一小会(即,迭代几次 `sys_yield()`),然后取得几张屏幕截图或子环境的检查点,然后运行子环境一段时间,然后还原子环境到检查点时的状态,然后从这里继续开始。这样,你就可以有效地从一个中间状态“回放”了子环境的运行。确保子环境与用户使用 `sys_cgetc()` 或 `readline()` 执行了一些交互,这样,那个用户就能够查看和突变它的内部状态,并且你可以通过给子环境给定一个选择性遗忘的状况,来验证你的检查点/重启动的有效性,使它“遗忘”了在某些点之前发生的事情。 到此为止,已经完成了本实验的 Part A 部分;在你运行 `make grade` 之前确保它通过了所有的 Part A 的测试,并且和以往一样,使用 `make handin` 去提交它。如果你想尝试找出为什么一些特定的测试是失败的,可以运行 `run ./grade-lab4 -v`,它将向你展示内核构建的输出,和测试失败时的 QEMU 运行情况。当测试失败时,这个脚本将停止运行,然后你可以去检查 `jos.out` 的内容,去查看内核真实的输出内容。 -#### Part B:写时复制 Fork +### Part B:写时复制 Fork 正如在前面提到过的,Unix 提供 `fork()` 系统调用作为它主要的进程创建原语。`fork()` 系统调用通过复制调用进程(父进程)的地址空间来创建一个新进程(子进程)。 @@ -264,11 +250,11 @@ xv6 Unix 的 `fork()` 从父进程的页上复制所有数据,然后将它分 但是,一个对 `fork()` 的调用后,经常是紧接着几乎立即在子进程中有一个到 `exec()` 的调用,它使用一个新程序来替换子进程的内存。这是 shell 默认去做的事,在这种情况下,在复制父进程地址空间上花费的时间是非常浪费的,因为在调用 `exec()` 之前,子进程使用的内存非常少。 -基于这个原因,Unix 的最新版本利用了虚拟内存硬件的优势,允许父进程和子进程去共享映射到它们各自地址空间上的内存,直到其中一个进程真实地修改了它们为止。这个技术就是众所周知的“写时复制”。为实现这一点,在 `fork()` 时,内核将复制从父进程到子进程的地址空间的映射,而不是所映射的页的内容,并且同时设置正在共享中的页为只读。当两个进程中的其中一个尝试去写入到它们共享的页上时,进程将产生一个页故障。在这时,Unix 内核才意识到那个页实际上是“虚拟的”或“写时复制”的副本,然后它生成一个新的、私有的、那个发生页故障的进程可写的、页的副本。在这种方式中,个人的页的内容并不进行真实地复制,直到它们真正进行写入时才进行复制。这种优化使得一个`fork()` 后在子进程中跟随一个 `exec()` 变得代价很低了:子进程在调用 `exec()` 时或许仅需要复制一个页(它的栈的当前页)。 +基于这个原因,Unix 的最新版本利用了虚拟内存硬件的优势,允许父进程和子进程去共享映射到它们各自地址空间上的内存,直到其中一个进程真实地修改了它们为止。这个技术就是众所周知的“写时复制”。为实现这一点,在 `fork()` 时,内核将复制从父进程到子进程的地址空间的映射,而不是所映射的页的内容,并且同时设置正在共享中的页为只读。当两个进程中的其中一个尝试去写入到它们共享的页上时,进程将产生一个页故障。在这时,Unix 内核才意识到那个页实际上是“虚拟的”或“写时复制”的副本,然后它生成一个新的、私有的、那个发生页故障的进程可写的、页的副本。在这种方式中,个人的页的内容并不进行真实地复制,直到它们真正进行写入时才进行复制。这种优化使得一个`fork()` 后在子进程中跟随一个 `exec()` 变得代价很低了:子进程在调用 `exec()` 时或许仅需要复制一个页(它的栈的当前页)。 在本实验的下一段中,你将实现一个带有“写时复制”的“真正的”类 Unix 的 `fork()`,来作为一个常规的用户空间库。在用户空间中实现 `fork()` 和写时复制有一个好处就是,让内核始终保持简单,并且因此更不易出错。它也让个别的用户模式程序在 `fork()` 上定义了它们自己的语义。一个有略微不同实现的程序(例如,代价昂贵的、总是复制的 `dumbfork()` 版本,或父子进程真实共享内存的后面的那一个),它自己可以很容易提供。 -##### 用户级页故障处理 +#### 用户级页故障处理 一个用户级写时复制 `fork()` 需要知道关于在写保护页上的页故障相关的信息,因此,这是你首先需要去实现的东西。对用户级页故障处理来说,写时复制仅是众多可能的用途之一。 @@ -276,15 +262,14 @@ xv6 Unix 的 `fork()` 从父进程的页上复制所有数据,然后将它分 内核跟踪有大量的信息,与传统的 Unix 方法不同,你将决定在每个用户空间中关于每个页故障应该做的事。用户空间中的 bug 危害都较小。这种设计带来了额外的好处,那就是允许程序员在定义它们的内存区域时,会有很好的灵活性;对于映射和访问基于磁盘文件系统上的文件时,你应该使用后面的用户级页故障处理。 -###### 设置页故障服务程序 +##### 设置页故障服务程序 为了处理它自己的页故障,一个用户环境将需要在 JOS 内核上注册一个页故障服务程序入口。用户环境通过新的 `sys_env_set_pgfault_upcall` 系统调用来注册它的页故障入口。我们给结构 `Env` 增加了一个新的成员 `env_pgfault_upcall`,让它去记录这个信息。 -```markdown -练习 8、实现 `sys_env_set_pgfault_upcall` 系统调用。当查找目标环境的环境 ID 时,一定要确认启用了权限检查,因为这是一个“危险的”系统调用。 +> **练习 8**、实现 `sys_env_set_pgfault_upcall` 系统调用。当查找目标环境的环境 ID 时,一定要确认启用了权限检查,因为这是一个“危险的”系统调用。 ``` -###### 在用户环境中的正常和异常栈 +##### 在用户环境中的正常和异常栈 在正常运行期间,JOS 中的一个用户环境运行在正常的用户栈上:它的 `ESP` 寄存器开始指向到 `USTACKTOP`,而它所推送的栈数据将驻留在 `USTACKTOP-PGSIZE` 和 `USTACKTOP-1`(含)之间的页上。但是,当在用户模式中发生页故障时,内核将在一个不同的栈上重新启动用户环境,运行一个用户级页故障指定的服务程序,即用户异常栈。其它,我们将让 JOS 内核为用户环境实现自动的“栈切换”,当从用户模式转换到内核模式时,x86 处理器就以大致相同的方式为 JOS 实现了栈切换。 @@ -292,7 +277,7 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 每个想去支持用户级页故障处理的用户环境,都需要为它自己的异常栈使用在 Part A 中介绍的 `sys_page_alloc()` 系统调用去分配内存。 -###### 调用用户页故障服务程序 +##### 调用用户页故障服务程序 现在,你需要去修改 `kern/trap.c` 中的页故障处理代码,以能够处理接下来在用户模式中发生的页故障。我们将故障发生时用户环境的状态称之为捕获时状态。 @@ -322,25 +307,20 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 去测试 `tf->tf_esp` 是否已经在用户异常栈上准备好,可以去检查它是否在 `UXSTACKTOP-PGSIZE` 和 `UXSTACKTOP-1`(含)的范围内。 -```markdown -练习 9、实现在 `kern/trap.c` 中的 `page_fault_handler` 的代码,要求派发页故障到用户模式故障服务程序上。在写入到异常栈时,一定要采取适当的预防措施。(如果用户环境运行时溢出了异常栈,会发生什么事情?) -``` +> **练习 9**、实现在 `kern/trap.c` 中的 `page_fault_handler` 的代码,要求派发页故障到用户模式故障服务程序上。在写入到异常栈时,一定要采取适当的预防措施。(如果用户环境运行时溢出了异常栈,会发生什么事情?) -###### 用户模式页故障入口点 +##### 用户模式页故障入口点 接下来,你需要去实现汇编程序,它将调用 C 页故障服务程序,并在原始的故障指令处恢复程序运行。这个汇编程序是一个故障服务程序,它由内核使用 `sys_env_set_pgfault_upcall()` 来注册。 -```markdown -练习 10、实现在 `lib/pfentry.S` 中的 `_pgfault_upcall` 程序。最有趣的部分是返回到用户代码中产生页故障的原始位置。你将要直接返回到那里,不能通过内核返回。最难的部分是同时切换栈和重新加载 EIP。 -``` +> **练习 10**、实现在 `lib/pfentry.S` 中的 `_pgfault_upcall` 程序。最有趣的部分是返回到用户代码中产生页故障的原始位置。你将要直接返回到那里,不能通过内核返回。最难的部分是同时切换栈和重新加载 EIP。 最后,你需要去实现用户级页故障处理机制的 C 用户库。 -```c -练习 11、完成 `lib/pgfault.c` 中的 `set_pgfault_handler()`。 +> **练习 11**、完成 `lib/pgfault.c` 中的 `set_pgfault_handler()`。 ``` -###### 测试 +##### 测试 运行 `user/faultread`(make run-faultread)你应该会看到: @@ -376,7 +356,7 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 [00001000] free env 00001000 ``` -如果你只看到第一个 "this string” 行,意味着你没有正确地处理递归页故障。 +如果你只看到第一个 “this string” 行,意味着你没有正确地处理递归页故障。 运行 `user/faultallocbad` 你应该会看到: @@ -389,11 +369,9 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 确保你理解了为什么 `user/faultalloc` 和 `user/faultallocbad` 的行为是不一样的。 -```markdown -小挑战!扩展你的内核,让它不仅是页故障,而是在用户空间中运行的代码能够产生的所有类型的处理器异常,都能够被重定向到一个用户模式中的异常服务程序上。写出用户模式测试程序,去测试各种各样的用户模式异常处理,比如除零错误、一般保护故障、以及非法操作码。 -``` +> **小挑战!**扩展你的内核,让它不仅是页故障,而是在用户空间中运行的代码能够产生的所有类型的处理器异常,都能够被重定向到一个用户模式中的异常服务程序上。写出用户模式测试程序,去测试各种各样的用户模式异常处理,比如除零错误、一般保护故障、以及非法操作码。 -##### 实现写时复制 Fork +#### 实现写时复制 Fork 现在,你有个内核功能要去实现,那就是在用户空间中完整地实现写时复制 `fork()`。 @@ -401,38 +379,29 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 `fork()` 的基本控制流如下: - 1. 父环境使用你在上面实现的 `set_pgfault_handler()` 函数,安装 `pgfault()` 作为 C 级页故障服务程序。 - - 2. 父环境调用 `sys_exofork()` 去创建一个子环境。 - - 3. 在它的地址空间中,低于 UTOP 位置的、每个可写入页、或写时复制页上,父环境调用 `duppage` 后,它应该会映射页写时复制到子环境的地址空间中,然后在它自己的地址空间中重新映射页写时复制。[ 注意:这里的顺序很重要(即,在父环境中标记之前,先在子环境中标记该页为 COW)!你能明白是为什么吗?尝试去想一个具体的案例,将顺序颠倒一下会发生什么样的问题。] `duppage` 把两个 PTE 都设置了,致使那个页不可写入,并且在 "avail” 字段中通过包含 `PTE_COW` 来从真正的只读页中区分写时复制页。 - -然而异常栈是不能通过这种方式重映射的。对于异常栈,你需要在子环境中分配一个新页。因为页故障服务程序不能做真实的复制,并且页故障服务程序是运行在异常栈上的,异常栈不能进行写时复制:那么谁来复制它呢? - -`fork()` 也需要去处理存在的页,但不能写入或写时复制。 - - 4. 父环境为子环境设置了用户页故障入口点,让它看起来像它自己的一样。 - - 5. 现在,子环境准备去运行,所以父环境标记它为可运行。 - +1. 父环境使用你在上面实现的 `set_pgfault_handler()` 函数,安装 `pgfault()` 作为 C 级页故障服务程序。 +2. 父环境调用 `sys_exofork()` 去创建一个子环境。 +3. 在它的地址空间中,低于 UTOP 位置的、每个可写入页、或写时复制页上,父环境调用 `duppage` 后,它应该会映射页写时复制到子环境的地址空间中,然后在它自己的地址空间中重新映射页写时复制。[ 注意:这里的顺序很重要(即,在父环境中标记之前,先在子环境中标记该页为 COW)!你能明白是为什么吗?尝试去想一个具体的案例,将顺序颠倒一下会发生什么样的问题。] `duppage` 把两个 PTE 都设置了,致使那个页不可写入,并且在 "avail” 字段中通过包含 `PTE_COW` 来从真正的只读页中区分写时复制页。 + 然而异常栈是不能通过这种方式重映射的。对于异常栈,你需要在子环境中分配一个新页。因为页故障服务程序不能做真实的复制,并且页故障服务程序是运行在异常栈上的,异常栈不能进行写时复制:那么谁来复制它呢? + `fork()` 也需要去处理存在的页,但不能写入或写时复制。 +4. 父环境为子环境设置了用户页故障入口点,让它看起来像它自己的一样。 +5. 现在,子环境准备去运行,所以父环境标记它为可运行。 每次其中一个环境写一个还没有写入的写时复制页时,它将产生一个页故障。下面是用户页故障服务程序的控制流: - 1. 内核传递页故障到 `_pgfault_upcall`,它调用 `fork()` 的 `pgfault()` 服务程序。 - 2. `pgfault()` 检测到那个故障是一个写入(在错误代码中检查 `FEC_WR`),然后将那个页的 PTE 标记为 `PTE_COW`。如果不是一个写入,则崩溃。 - 3. `pgfault()` 在一个临时位置分配一个映射的新页,并将故障页的内容复制进去。然后,故障服务程序以读取/写入权限映射新页到合适的地址,替换旧的只读映射。 - - +1. 内核传递页故障到 `_pgfault_upcall`,它调用 `fork()` 的 `pgfault()` 服务程序。 +2. `pgfault()` 检测到那个故障是一个写入(在错误代码中检查 `FEC_WR`),然后将那个页的 PTE 标记为 `PTE_COW`。如果不是一个写入,则崩溃。 +3. `pgfault()` 在一个临时位置分配一个映射的新页,并将故障页的内容复制进去。然后,故障服务程序以读取/写入权限映射新页到合适的地址,替换旧的只读映射。 对于上面的几个操作,用户级 `lib/fork.c` 代码必须查询环境的页表(即,那个页的 PTE 是否标记为 `PET_COW`)。为此,内核在 `UVPT` 位置精确地映射环境的页表。它使用一个 [聪明的映射技巧][1] 去标记它,以使用户代码查找 PTE 时更容易。`lib/entry.S` 设置 `uvpt` 和 `uvpd`,以便于你能够在 `lib/fork.c` 中轻松查找页表信息。 -```c -练习 12、在 `lib/fork.c` 中实现 `fork`、`duppage` 和 `pgfault`。 +> **练习 12**、在 `lib/fork.c` 中实现 `fork`、`duppage` 和 `pgfault`。 -使用 `forktree` 程序测试你的代码。它应该会产生下列的信息,在信息中会有 'new env'、'free env'、和 'exiting gracefully' 这样的字眼。信息可能不是按如下的顺序出现的,并且环境 ID 也可能不一样。 +> 使用 `forktree` 程序测试你的代码。它应该会产生下列的信息,在信息中会有 'new env'、'free env'、和 'exiting gracefully' 这样的字眼。信息可能不是按如下的顺序出现的,并且环境 ID 也可能不一样。 +>``` 1000: I am '' 1001: I am '0' 2000: I am '00' @@ -450,31 +419,32 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 1006: I am '101' ``` -```c -小挑战!实现一个名为 `sfork()` 的共享内存的 `fork()`。这个版本的 `sfork()` 中,父子环境共享所有的内存页(因此,一个环境中对内存写入,就会改变另一个环境数据),除了在栈区域中的页以外,它应该使用写时复制来处理这些页。修改 `user/forktree.c` 去使用 `sfork()` 而是不常见的 `fork()`。另外,你在 Part C 中实现了 IPC 之后,使用你的 `sfork()` 去运行 `user/pingpongs`。你将找到提供全局指针 `thisenv` 功能的一个新方式。 -``` +. -```markdown -小挑战!你实现的 `fork` 将产生大量的系统调用。在 x86 上,使用中断切换到内核模式将产生较高的代价。增加系统调用接口,以便于它能够一次发送批量的系统调用。然后修改 `fork` 去使用这个接口。 -你的新的 `fork` 有多快? +> **小挑战!**实现一个名为 `sfork()` 的共享内存的 `fork()`。这个版本的 `sfork()` 中,父子环境共享所有的内存页(因此,一个环境中对内存写入,就会改变另一个环境数据),除了在栈区域中的页以外,它应该使用写时复制来处理这些页。修改 `user/forktree.c` 去使用 `sfork()` 而是不常见的 `fork()`。另外,你在 Part C 中实现了 IPC 之后,使用你的 `sfork()` 去运行 `user/pingpongs`。你将找到提供全局指针 `thisenv` 功能的一个新方式。 -你可以用一个分析来论证,批量提交对你的 `fork` 的性能改变,以它来(粗略地)回答这个问题:使用一个 `int 0x30` 指令的代价有多高?在你的 `fork` 中运行了多少次 `int 0x30` 指令?访问 `TSS` 栈切换的代价高吗?等待 ... +. -或者,你可以在真实的硬件上引导你的内核,并且真实地对你的代码做基准测试。查看 `RDTSC`(读取时间戳计数器)指令,它的定义在 IA32 手册中,它计数自上一次处理器重置以来流逝的时钟周期数。QEMU 并不能真实地模拟这个指令(它能够计数运行的虚拟指令数量,或使用主机的 TSC,但是这两种方式都不能反映真实的 CPU 周期数)。 -``` +> **小挑战!**你实现的 `fork` 将产生大量的系统调用。在 x86 上,使用中断切换到内核模式将产生较高的代价。增加系统调用接口,以便于它能够一次发送批量的系统调用。然后修改 `fork` 去使用这个接口。 + +> 你的新的 `fork` 有多快? + +> 你可以用一个分析来论证,批量提交对你的 `fork` 的性能改变,以它来(粗略地)回答这个问题:使用一个 `int 0x30` 指令的代价有多高?在你的 `fork` 中运行了多少次 `int 0x30` 指令?访问 `TSS` 栈切换的代价高吗?等待 ... + +> 或者,你可以在真实的硬件上引导你的内核,并且真实地对你的代码做基准测试。查看 `RDTSC`(读取时间戳计数器)指令,它的定义在 IA32 手册中,它计数自上一次处理器重置以来流逝的时钟周期数。QEMU 并不能真实地模拟这个指令(它能够计数运行的虚拟指令数量,或使用主机的 TSC,但是这两种方式都不能反映真实的 CPU 周期数)。 到此为止,Part B 部分结束了。在你运行 `make grade` 之前,确保你通过了所有的 Part B 部分的测试。和以前一样,你可以使用 `make handin` 去提交你的实验。 -#### Part C:抢占式多任务处理和进程间通讯(IPC) +### Part C:抢占式多任务处理和进程间通讯(IPC) 在实验 4 的最后部分,你将修改内核去抢占不配合的环境,并允许环境之间显式地传递消息。 -##### 时钟中断和抢占 +#### 时钟中断和抢占 运行测试程序 `user/spin`。这个测试程序 fork 出一个子环境,它控制了 CPU 之后,就永不停歇地运转起来。无论是父环境还是内核都不能回收对 CPU 的控制。从用户模式环境中保护系统免受 bug 或恶意代码攻击的角度来看,这显然不是个理想的状态,因为任何用户模式环境都能够通过简单的无限循环,并永不归还 CPU 控制权的方式,让整个系统处于暂停状态。为了允许内核去抢占一个运行中的环境,从其中夺回对 CPU 的控制权,我们必须去扩展 JOS 内核,以支持来自硬件时钟的外部硬件中断。 -###### 中断规则 +##### 中断规则 外部中断(即:设备中断)被称为 IRQ。现在有 16 个可能出现的 IRQ,编号 0 到 15。从 IRQ 号到 IDT 条目的映射是不固定的。在 `picirq.c` 中的 `pic_init` 映射 IRQ 0 - 15 到 IDT 条目 `IRQ_OFFSET` 到 `IRQ_OFFSET+15`。 @@ -484,31 +454,27 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 处于用户环境中时,你将要确保 `FL_IF` 标志被设置,以便于出现一个中断时,它能够通过处理器来传递,让你的中断代码来处理。否则,中断将被屏蔽或忽略,直到中断被重新打开后。我们使用引导加载程序的第一个指令去屏蔽中断,并且到目前为止,还没有去重新打开它们。 -```markdown -练习 13、修改 `kern/trapentry.S` 和 `kern/trap.c` 去初始化 IDT 中的相关条目,并为 IRQ 0 到 15 提供服务程序。然后修改 `kern/env.c` 中的 `env_alloc()` 的代码,以确保在用户环境中,中断总是打开的。 +> **练习 13**、修改 `kern/trapentry.S` 和 `kern/trap.c` 去初始化 IDT 中的相关条目,并为 IRQ 0 到 15 提供服务程序。然后修改 `kern/env.c` 中的 `env_alloc()` 的代码,以确保在用户环境中,中断总是打开的。 -另外,在 `sched_halt()` 中取消注释 `sti` 指令,以便于空闲的 CPU 取消屏蔽中断。 +> 另外,在 `sched_halt()` 中取消注释 `sti` 指令,以便于空闲的 CPU 取消屏蔽中断。 -当调用一个硬件中断服务程序时,处理器不会推送一个错误代码。在这个时候,你可能需要重新阅读 [80386 参考手册][2] 的 9.2 节,或 [IA-32 Intel 架构软件开发者手册 卷 3][3] 的 5.8 节。 +> 当调用一个硬件中断服务程序时,处理器不会推送一个错误代码。在这个时候,你可能需要重新阅读 [80386 参考手册][2] 的 9.2 节,或 [IA-32 Intel 架构软件开发者手册 卷 3][3] 的 5.8 节。 -在完成这个练习后,如果你在你的内核上使用任意的测试程序去持续运行(即:`spin`),你应该会看到内核输出中捕获的硬件中断的捕获帧。虽然在处理器上已经打开了中断,但是 JOS 并不能处理它们,因此,你应该会看到在当前运行的用户环境中每个中断的错误属性并被销毁,最终环境会被销毁并进入到监视器中。 -``` +> 在完成这个练习后,如果你在你的内核上使用任意的测试程序去持续运行(即:`spin`),你应该会看到内核输出中捕获的硬件中断的捕获帧。虽然在处理器上已经打开了中断,但是 JOS 并不能处理它们,因此,你应该会看到在当前运行的用户环境中每个中断的错误属性并被销毁,最终环境会被销毁并进入到监视器中。 -###### 处理时钟中断 +##### 处理时钟中断 在 `user/spin` 程序中,子环境首先运行之后,它只是进入一个高速循环中,并且内核再无法取得 CPU 控制权。我们需要对硬件编程,定期产生时钟中断,它将强制将 CPU 控制权返还给内核,在内核中,我们就能够将控制权切换到另外的用户环境中。 我们已经为你写好了对 `lapic_init` 和 `pic_init`(来自 `init.c` 中的 `i386_init`)的调用,它将设置时钟和中断控制器去产生中断。现在,你需要去写代码来处理这些中断。 -```markdown -练习 14、修改内核的 `trap_dispatch()` 函数,以便于在时钟中断发生时,它能够调用 `sched_yield()` 去查找和运行一个另外的环境。 +> **练习 14**、修改内核的 `trap_dispatch()` 函数,以便于在时钟中断发生时,它能够调用 `sched_yield()` 去查找和运行一个另外的环境。 -现在,你应该能够用 `user/spin` 去做测试了:父环境应该会 fork 出子环境,`sys_yield()` 到它许多次,但每次切换之后,将重新获得对 CPU 的控制权,最后杀死子环境后优雅地终止。 -``` +> 现在,你应该能够用 `user/spin` 去做测试了:父环境应该会 fork 出子环境,`sys_yield()` 到它许多次,但每次切换之后,将重新获得对 CPU 的控制权,最后杀死子环境后优雅地终止。 这是做回归测试的好机会。确保你没有弄坏本实验的前面部分,确保打开中断能够正常工作(即: `forktree`)。另外,尝试使用 ` make CPUS=2 target` 在多个 CPU 上运行它。现在,你应该能够通过 `stresssched` 测试。可以运行 `make grade` 去确认。现在,你的得分应该是 65 分了(总分为 80)。 -##### 进程间通讯(IPC) +#### 进程间通讯(IPC) (严格来说,在 JOS 中这是“环境间通讯” 或 “IEC”,但所有人都称它为 IPC,因此我们使用标准的术语。) @@ -516,13 +482,13 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 进程间通讯有许多模型。关于哪个模型最好的争论从来没有停止过。我们不去参与这种争论。相反,我们将要实现一个简单的 IPC 机制,然后尝试使用它。 -###### JOS 中的 IPC +##### JOS 中的 IPC 你将要去实现另外几个 JOS 内核的系统调用,由它们共同来提供一个简单的进程间通讯机制。你将要实现两个系统调用,`sys_ipc_recv` 和 `sys_ipc_try_send`。然后你将要实现两个库去封装 `ipc_recv` 和 `ipc_send`。 用户环境可以使用 JOS 的 IPC 机制相互之间发送 “消息” 到每个其它环境,这些消息有两部分组成:一个单个的 32 位值,和可选的一个单个页映射。允许环境在消息中传递页映射,提供了一个高效的方式,传输比一个仅适合单个的 32 位整数更多的数据,并且也允许环境去轻松地设置安排共享内存。 -###### 发送和接收消息 +##### 发送和接收消息 一个环境通过调用 `sys_ipc_recv` 去接收消息。这个系统调用将取消对当前环境的调度,并且不会再次去运行它,直到消息被接收为止。当一个环境正在等待接收一个消息时,任何其它环境都能够给它发送一个消息 — 而不仅是一个特定的环境,而且不仅是与接收环境有父子关系的环境。换句话说,你在 Part A 中实现的权限检查将不会应用到 IPC 上,因为 IPC 系统调用是经过慎重设计的,因此可以认为它是“安全的”:一个环境并不能通过给它发送消息导致另一个环境发生故障(除非目标环境也存在 Bug)。 @@ -532,7 +498,7 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 同样,一个库函数 `ipc_send` 将去不停地调用 `sys_ipc_try_send` 来发送消息,直到发送成功为止。 -###### 转移页 +##### 转移页 当一个环境使用一个有效的 `dstva` 参数(低于 `UTOP`)去调用 `sys_ipc_recv` 时,环境将声明愿意去接收一个页映射。如果发送方发送一个页,那么那个页应该会被映射到接收者地址空间的 `dstva` 处。如果接收者在 `dstva` 已经有了一个页映射,那么已存在的那个页映射将被取消映射。 @@ -540,31 +506,30 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚 如果发送方和接收方都没有表示要转移这个页,那么就不会有页被转移。在任何 IPC 之后,内核将在接收方的 `Env` 结构上设置新的 `env_ipc_perm` 字段,以允许接收页,或者将它设置为 0,表示不再接收。 -###### 实现 IPC +##### 实现 IPC -```markdown -练习 15、实现 `kern/syscall.c` 中的 `sys_ipc_recv` 和 `sys_ipc_try_send`。在实现它们之前一起阅读它们的注释信息,因为它们要一起工作。当你在这些程序中调用 `envid2env` 时,你应该去设置 `checkperm` 的标志为 0,这意味着允许任何环境去发送 IPC 消息到另外的环境,并且内核除了验证目标 envid 是否有效外,不做特别的权限检查。 +> **练习 15**、实现 `kern/syscall.c` 中的 `sys_ipc_recv` 和 `sys_ipc_try_send`。在实现它们之前一起阅读它们的注释信息,因为它们要一起工作。当你在这些程序中调用 `envid2env` 时,你应该去设置 `checkperm` 的标志为 0,这意味着允许任何环境去发送 IPC 消息到另外的环境,并且内核除了验证目标 envid 是否有效外,不做特别的权限检查。 -接着实现 `lib/ipc.c` 中的 `ipc_recv` 和 `ipc_send` 函数。 +> 接着实现 `lib/ipc.c` 中的 `ipc_recv` 和 `ipc_send` 函数。 -使用 `user/pingpong` 和 `user/primes` 函数去测试你的 IPC 机制。`user/primes` 将为每个质数生成一个新环境,直到 JOS 耗尽环境为止。你可能会发现,阅读 `user/primes.c` 非常有趣,你将看到所有的 fork 和 IPC 都是在幕后进行。 -``` +> 使用 `user/pingpong` 和 `user/primes` 函数去测试你的 IPC 机制。`user/primes` 将为每个质数生成一个新环境,直到 JOS 耗尽环境为止。你可能会发现,阅读 `user/primes.c` 非常有趣,你将看到所有的 fork 和 IPC 都是在幕后进行。 -``` -小挑战!为什么 `ipc_send` 要循环调用?修改系统调用接口,让它不去循环。确保你能处理多个环境尝试同时发送消息到一个环境上的情况。 -``` +. -```markdown -小挑战!质数筛选是在大规模并发程序中传递消息的一个很巧妙的用法。阅读 C. A. R. Hoare 写的 《Communicating Sequential Processes》,Communications of the ACM_ 21(8) (August 1978), 666-667,并去实现矩阵乘法示例。 -``` -```markdown -小挑战!控制消息传递的最令人印象深刻的一个例子是,Doug McIlroy 的幂序列计算器,它在 [M. Douglas McIlroy,《Squinting at Power Series》,Software--Practice and Experience, 20(7) (July 1990),661-683][4] 中做了详细描述。实现了它的幂序列计算器,并且计算了 _sin_ ( _x_ + _x_ ^3) 的幂序列。 -``` +> **小挑战!**为什么 `ipc_send` 要循环调用?修改系统调用接口,让它不去循环。确保你能处理多个环境尝试同时发送消息到一个环境上的情况。 -```markdown -小挑战!通过应用 Liedtke 的论文([通过内核设计改善 IPC 性能][5])中的一些技术、或你可以想到的其它技巧,来让 JOS 的 IPC 机制更高效。为此,你可以随意修改内核的系统调用 API,只要你的代码向后兼容我们的评级脚本就行。 -``` +. + +> **小挑战!**质数筛选是在大规模并发程序中传递消息的一个很巧妙的用法。阅读 C. A. R. Hoare 写的 《Communicating Sequential Processes》,Communications of the ACM_ 21(8) (August 1978), 666-667,并去实现矩阵乘法示例。 + +. + +> **小挑战!**控制消息传递的最令人印象深刻的一个例子是,Doug McIlroy 的幂序列计算器,它在 [M. Douglas McIlroy,《Squinting at Power Series》,Software--Practice and Experience, 20(7) (July 1990),661-683][4] 中做了详细描述。实现了它的幂序列计算器,并且计算了 _sin_ ( _x_ + _x_ ^3) 的幂序列。 + +. + +> **小挑战!**通过应用 Liedtke 的论文([通过内核设计改善 IPC 性能][5])中的一些技术、或你可以想到的其它技巧,来让 JOS 的 IPC 机制更高效。为此,你可以随意修改内核的系统调用 API,只要你的代码向后兼容我们的评级脚本就行。 **Part C 到此结束了。**确保你通过了所有的评级测试,并且不要忘了将你的小挑战的答案写入到 `answers-lab4.txt` 中。 @@ -577,7 +542,7 @@ via: https://pdos.csail.mit.edu/6.828/2018/labs/lab4/ 作者:[csail.mit][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -587,4 +552,4 @@ via: https://pdos.csail.mit.edu/6.828/2018/labs/lab4/ [2]: https://pdos.csail.mit.edu/6.828/2018/labs/readings/i386/toc.htm [3]: https://pdos.csail.mit.edu/6.828/2018/labs/readings/ia32/IA32-3A.pdf [4]: https://swtch.com/~rsc/thread/squint.pdf -[5]: http://dl.acm.org/citation.cfm?id=168633 \ No newline at end of file +[5]: http://dl.acm.org/citation.cfm?id=168633 From 78a05676f08c4405280bb437333d5ec3e4fbd4ab Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 13:00:50 +0800 Subject: [PATCH 0882/1143] PUB:20181016 Lab 4- Preemptive Multitasking.md @qhwdw https://linux.cn/article-10351-1.html --- .../tech => published}/20181016 Lab 4- Preemptive Multitasking.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181016 Lab 4- Preemptive Multitasking.md (100%) diff --git a/translated/tech/20181016 Lab 4- Preemptive Multitasking.md b/published/20181016 Lab 4- Preemptive Multitasking.md similarity index 100% rename from translated/tech/20181016 Lab 4- Preemptive Multitasking.md rename to published/20181016 Lab 4- Preemptive Multitasking.md From 8bee3af9f203bf3c0b6d2a09b0a8132b1d4774f9 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Sun, 16 Dec 2018 13:31:33 +0800 Subject: [PATCH 0883/1143] hankchow translating --- sources/tech/20181212 Aliases- DIY Shell Commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181212 Aliases- DIY Shell Commands.md b/sources/tech/20181212 Aliases- DIY Shell Commands.md index d81fb03bb0..81dce2efe7 100644 --- a/sources/tech/20181212 Aliases- DIY Shell Commands.md +++ b/sources/tech/20181212 Aliases- DIY Shell Commands.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6231a212de89cab2144103573af4dbbcff25dfb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com> Date: Sun, 16 Dec 2018 14:47:50 +0800 Subject: [PATCH 0884/1143] Update 20180912 How to turn on an LED with Fedora IoT.md --- sources/tech/20180912 How to turn on an LED with Fedora IoT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md b/sources/tech/20180912 How to turn on an LED with Fedora IoT.md index 007cfc27ab..5f1843fc83 100644 --- a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md +++ b/sources/tech/20180912 How to turn on an LED with Fedora IoT.md @@ -1,3 +1,4 @@ +Translating by ScarboroughCoral How to turn on an LED with Fedora IoT ====== From 608359fff4f1b0a49091e3a4259d3e4ef6975de2 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Sun, 16 Dec 2018 17:12:33 +0800 Subject: [PATCH 0885/1143] Translated by qhwdw --- .../tech/20181210 How to get started in AI.md | 113 ------------------ .../tech/20181210 How to get started in AI.md | 113 ++++++++++++++++++ 2 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 sources/tech/20181210 How to get started in AI.md create mode 100644 translated/tech/20181210 How to get started in AI.md diff --git a/sources/tech/20181210 How to get started in AI.md b/sources/tech/20181210 How to get started in AI.md deleted file mode 100644 index 0dfb5761aa..0000000000 --- a/sources/tech/20181210 How to get started in AI.md +++ /dev/null @@ -1,113 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (qhwdw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to get started in AI) -[#]: via: (https://opensource.com/article/18/12/how-get-started-ai) -[#]: author: (Gordon Haff https://opensource.com/users/ghaff) - -How to get started in AI -====== -Before you can begin working in artificial intelligence, you need to acquire some human intelligence. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain-think-ai-intelligence-ccby.png?itok=C-gK01E_) - -I've both asked and been asked about the best way to learn more about artificial intelligence (AI). What should I read? What should I watch? I'll get to that. But, first, it's useful to break down this question, given that AI covers a lot of territory. - -One important distinction to draw is between the research side of AI and the applied side. Cassie Kozyrkov of Google [drew this distinction][1] in a talk at the recent O'Reilly Artificial Intelligence Conference in London, and it's a good one. - -Research AI is rather academic in nature and requires a heavy dose of math across a variety of disciplines before you even get to those parts that are specific to AI. This aspect of AI focuses on the algorithms and tools that drive the state of AI forward. For example, what neural network structures might improve vision recognition results? How might we make unsupervised learning a more generally useful approach? Can we find ways to understand better how deep learning pipelines come up with the answers they do? - -Applied AI, on the other hand, is more about using existing tools to obtain useful results. Open source has played a big role here in providing free and often easy-to-use software in a variety of languages. Public cloud providers have also devoted a lot of attention to providing machine learning services, models, and datasets that make the onramp to getting started with AI much simpler than it would be otherwise. - -I'll add at this point that applied AI practitioners shouldn't treat their tools as some sort of black box that spits out answers for mysterious reasons. At a minimum, they need to understand the limits and potential biases of different techniques, models, and data collection approaches. It's just that they don't necessarily need to delve deeply into all the theory underpinning every part of their toolchain. - -Although it's probably less important for working in AI on a day-to-day basis, it's also useful to understand the broader context of AI. It goes beyond the narrow scope of deep learning on neural networks that have been so important to the gains made in reinforcement learning and supervised learning to date. For example, AI is often viewed as a way to augment (rather than replace) human judgment and decisions. But the handoff between machine and human has its own pitfalls. - -With that background, here are some study areas and resources you may find useful. - -### Research AI - -In a lot of respects, a list of resources for research AI mirror those in an undergraduate (or even graduate) computer science program that's focused on AI. The main difference is that the syllabus you draw up may be more interdisciplinary than more traditionally focused university curricula. - -Where you start will depend on your computer science and math background. - -If it's minimal or rusty, but you still want to develop a deep understanding of AI fundamentals, you'll benefit from taking some math courses to start. There are many options on massive online open courses (MOOCs) like the nonprofit [edX][2] platform and [Coursera][3]. (Both platforms charge for certifications, but edX makes all the content available for free to people just auditing the course.) - -Typical foundational courses could include: - -+ [MIT's Calculus courses][22], starting with differentiation -+ [Linear Algebra][23] (University of Texas) -+ Probability and statistics, such as MIT's [Probability—The Science of Uncertainty and Data][24] - - -To get deeper into AI from a research perspective, you'll probably want to get into all these areas of mathematics and more. But the above should give you an idea of the general branches of study that are probably most important before delving into machine learning and AI proper. - -In addition to MOOCs, resources such as [MIT OpenCourseWare][4] provide the syllabus and various supporting materials for a wide range of mathematics and computer science courses. - -With the foundations in place, you can move onto more specialized courses in AI proper. Andrew Ng's AI MOOC, from when he was teaching at Stanford, was one of the early courses to popularize the whole online course space. Today, his [Neural Networks and Deep Learning][5] is part of the Deep Learning specialization at Coursera. There are corresponding programs on edX. For example, Columbia offers an [Artificial Intelligence MicroMasters][6]. - -In addition to courses, a variety of textbooks and other learning material are also available online. These include: - - * [Neural Networks and Deep Learning][7] - * [Deep Learning][8] from MIT Press by Ian Goodfellow and Yoshua Bengio and Aaron Courville - -### Applied AI - -Applied AI is much more focused on using available tools than building new ones. Some appreciation of the mathematical underpinnings, especially statistics, is still useful—arguably even necessary—but you won't be majoring in that aspect of AI to the same degree you would in a research mode. - -Programming is a core skill here. While different programming languages can come into play, a lot of libraries and toolsets—such as [PyTorch][9]—rely on Python, so that's a good skill to have. Especially if you have some level of programming background, MIT's [Introduction to Computer Science and Programming Using Python][10], based on its on-campus 6.001 course, is a good primer. If you're truly new to programming, Charles Severance's [Programming for Everybody (Getting Started with Python)][11] from the University of Michigan doesn't toss you into the deep end of the pool the way the MIT course does. - -[The R programming language][12] is also a useful skill to add to your toolbox. While it's less used in machine learning (ML) per se, it's common for a variety of other data science tasks, and applied AI/ML and data science often blend in practice. For example, many tasks associated with organizing and cleaning data apply equally whatever analysis techniques you'll eventually use. A MOOC sequence like Harvard's [Data Science certificate][13] is an example of a set of courses that provide a good introduction to working with data. - -Another open source software library you're likely to encounter if you do any work with AI is [TensorFlow][14]. It was originally developed by researchers and engineers from the Google Brain team within Google's AI organization. [Google offers a variety of tutorials][15] to get started with TensorFlow using the high-level Keras API. You can run TensorFlow locally as well as online in Google Cloud. - -In general, all of the big public cloud providers offer online datasets and ML services that can be an easy way to get started. However, especially as you move beyond "play" datasets and applications, you need to start thinking seriously about the degree to which you want to be locked into a single provider. - -Datasets for your exploratory learning projects are available from many different sources. In addition to the public cloud providers, [Kaggle][16] is another popular source and also a good learning resource more broadly. Government data is also increasingly available in digital form. The US Federal Government's [Data.gov][17] claims over 300,000 datasets. State and local governments also publish data on everything from restaurant health ratings to dogs' names. - -### Miscellany - -I'll close by noting that AI is a broad topic that isn't just about math, programming, and data. AI as a whole touches many other fields, including cognitive psychology, linguistics, game theory, operations research, and control systems. Indeed, a concern among at least some AI researchers today is that the field has become too fixated on a small number of techniques that have become powerful and interesting only quite recently because of the intersection of processing power and big data. Many longstanding problems in understanding how humans learn and reason remain largely unsolved. Developing at least some appreciation for these broader problem spaces will better enable you to place AI within a broader context. - -One of my favorite examples is the [Humans and Autonomy Lab][18] at Duke. The work in this lab touches on all the challenges of humans working with machines, such as how autopilots can create ["Children of the Magenta"][19] who are unable to take control quickly if the automation fails. A basic brain-science course, such as MIT's [Introduction to Psychology][20], provides some useful context for the relationship between human intelligence and machine intelligence. Another course in a similar vein, but taught by the late Marvin Minsky from MIT's Electrical Engineering and Computer Science department, is [The Society of Mind][21]. - -If there's one key challenge to learning about AI, it's not that raw materials and tools aren't readily available. It's that there are so many of them. My objective hasn't been to give you a comprehensive set of pointers. Rather, it's been to both point out the different paths you can take and provide you with some possible starting points. Happy learning! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/how-get-started-ai - -作者:[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://www.youtube.com/watch?v=RLtI7r3QUyY -[2]: https://www.edx.org/ -[3]: https://www.coursera.org/ -[4]: https://ocw.mit.edu/index.htm -[5]: https://www.coursera.org/learn/neural-networks-deep-learning -[6]: https://www.edx.org/micromasters/columbiax-artificial-intelligence -[7]: http://neuralnetworksanddeeplearning.com/ -[8]: http://www.deeplearningbook.org/ -[9]: https://pytorch.org/ -[10]: https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python -[11]: https://www.coursera.org/learn/python -[12]: https://www.r-project.org/about.html -[13]: https://www.edx.org/professional-certificate/harvardx-data-science -[14]: https://www.tensorflow.org/ -[15]: https://www.tensorflow.org/tutorials/ -[16]: https://www.kaggle.com/ -[17]: https://www.data.gov/ -[18]: https://hal.pratt.duke.edu/ -[19]: https://99percentinvisible.org/episode/children-of-the-magenta-automation-paradox-pt-1/ -[20]: https://ocw.mit.edu/courses/brain-and-cognitive-sciences/9-00sc-introduction-to-psychology-fall-2011/ -[21]: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-868j-the-society-of-mind-fall-2011/ -[22]: https://www.edx.org/course/calculus-1a-differentiation -[23]: https://www.edx.org/course/linear-algebra-foundations-to-frontiers -[24]: https://courses.edx.org/courses/course-v1:MITx+6.431x+3T2018/course/ diff --git a/translated/tech/20181210 How to get started in AI.md b/translated/tech/20181210 How to get started in AI.md new file mode 100644 index 0000000000..ee88bb6961 --- /dev/null +++ b/translated/tech/20181210 How to get started in AI.md @@ -0,0 +1,113 @@ +[#]: collector: (lujun9972) +[#]: translator: (qhwdw) +[#]: reviewer: () +[#]: publisher: () +[#]: url: () +[#]: subject: (How to get started in AI) +[#]: via: (https://opensource.com/article/18/12/how-get-started-ai) +[#]: author: (Gordon Haff https://opensource.com/users/ghaff) + +学习人工智能如何起步 +====== +在你开始从事人工智能之前,你需要先了解人类的智能。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain-think-ai-intelligence-ccby.png?itok=C-gK01E_) + +我曾经问过别人也被别人问过关于学习人工智能最好的方式是什么?我应该去阅读什么?我应该去关注什么?后面我将讲到这些,但是,考虑到人工智能涉及很多领域,我把这个问题分开来讲可能更好理解。 + +学习人工智能很重要的一点是区别开研究方面和应用方面。Google 的 Cassie Kozyrkov 在近日于伦敦举行的 O’Reilly 人工智能会议的一个演讲中 [描述了这个区别][1],并且这是一个很好的区别。 + +研究人工智能在本质上是学术性的,在你能够获得人工智能的某些细节之前,需要大量的跨各类学科的数学知识。这部分人工智能关注于算法和驱动人工智能发展的工具。比如,什么样的神经网络结构能够改善视觉识别的结果?我们如何使无监督学习成为更有用的方法?我们能否找到一个更好的方法,去理解深度学习流水线是如何得出答案的? + +另一方面,人工智能应用更多是关于使用现有工具去获取有用的结果。开源在这里发挥了一个重要的作用,那就是免费提供了易于使用的、各种语言的软件。公有云提供商也致力于提供大量的机器学习、模型、以及数据集,这使得人工智能入门比其它的要简单的多。 + +在这个问题上我想补充一点,那就是人工智能的从业者不应该为了故弄玄虚而将它们的工具搞成只输出答案的黑匣子。至少,他们应该去了解不同技术、模型、和数据采集方法的限制和潜在偏差。但不需要去深入研究他们工具链中每个部分的理论。 + +虽然在日常工作中人工智能可能并不那么重要,但理解人工智能的大量的背景知识还是很有用的。人工智能已经超越了神经网络上深度学习的狭窄范围,目前神经网络上的强化学习和监督学习已经取得重要成就。例如,人工智能经常被视为是增强(而不是替代)人类判断和决策的一种方法。但是在机器和人类之间切换还有它自己的缺陷。 + +有了这些背景知识,下面是的一些研究领域和资源,你可能发现会很有用。 + +### 研究人工智能 + +在很多方面,用于人工智能研究的一个资源清单,可以反映出本科(甚至是研究生)的计算机科学项目都是专注于人工智能。最主要的区别是,你起草的教学大纲比起传统的大纲更关注于跨学科。 + +你的计算机科学和数学背景知识决定了你的起点。 + +如果你的计算机科学和数据背景知识很差或已经荒芜了,但你还希望能够深入了解人工智能的基本原理,那么从一些数学课程开始将会让你受益。MOOCs 上像非盈利的 [edX][2] 平台和 [Coursera][3] 上都有许多可供你选择的课程(这两个平台都对认证收费,但 edX 上所有的课程,对旁听者是全免费的)。 + +典型的基础课程包括: + ++ [MIT 的微积分课程][22],从微分开始学习 ++ [线性代数][23] (德克萨斯大学) ++ 概率与统计,比如 MIT 的 [概率 — 不确定性与数据科学][24] + + +从一个研究的角度去深入人工智能,你可能需要深入所有的这些数据领域,甚至更多。在深入研究机器学习和人工智能之前,上述的内容应该会让你得到一些常见研究分支的大致概念。 + +除了 MOOCs 之外,像 [MIT OpenCourseWare][4] 这样的资源也提供了大量的数学和计算机科学课程的大纲和各种支持材料。 + +有了这些基础,你就可以学习更专业的人工智能课程了。Andrew Ng 在斯坦福大学教的 “AI MOOC” 就是整个在线课程中最早流行起来的课程之一。今天,他的 [神经网络和深度学习][5] 也是 Coursera 深度学习专业的一部分。在 edX 上也有相关的一些项目,比如,哥伦比亚大学提供的一个 [人工智能 MicroMasters][6]。 + +除了课程之外,也可以在网上找到各种范例和其它学习材料。这些包括: + + * [神经网络和深度学习][7] + * MIT 的 Ian Goodfellow、Yoshua Bengio、Aaron Courville 出版的 [深度学习][8] + +### 应用人工智能 + +人工智能应用更关注于使用可用的工具,而不是去构建新工具。对一些底层的数学,尤其是统计学的了解仍然是非常有用的 — 甚至可以说是必需的 — 但对这些知识的了解程度不像研究人工智能的要求那么高。 + +在这里编程是核心技能。虽然可以使用不同的编程语言去做,但是一些库和工具集 — 比如 Python 的 [PyTorch][9],在这方面有很好的专长。尤其是,如果你有一些编程方面的背景知识,MIT 的 [计算机科学入门和使用 Python 编程][10],它是基于 MIT 的 6.001 课程,是一个非常好的启蒙课程。如果你编程零基础,来自密歇根大学的 Charles Severance 的 [人人学编程(Python 使用入门)][11] 是个很好的开端,它不会像 MIT 的课程那样,把你一下子扔进代码的汪洋大海。 + +[R 编程语言][12] 也是一个应该增加到你的技能库中的很有用的技能。虽然它在机器学习(ML)中使用的很少,但它在其它数据科学任务中很常见,并且经常与人工智能/机器学习和数据科学的应用实践结合在一起。比如,许多使用原始和数据清洗相关的应用任务,此外还有你最终要使用的诸如此类的分析技术,都将使用到它。一个 MOOC 系列,像 Harvard 的 [数据科学认证][13] 就是一整套课程的一个例子,这些课程介绍了如何去很好地处理数据。 + +如果你从事人工智能方面的工作,那么你很可能会遇到的另一个开源软件库就是 [TensorFlow][14]。它最初是由 Google 人工智能团队中的 Google 智慧团队的研发工程师开发的。[Google 提供了许多教程][15] 让你通过高级 Keras API 去开始使用 TensorFlow。你既可以在 Google 云上也可以在本地运行 TensorFlow。 + +通常,大的公有云提供商都提供在线数据集和易于使用的机器学习服务。但是,在你开始去 “玩” 数据集和应用之前,你需要考虑清楚,一旦开始选定一个提供商,你将被它们 “锁定” 的程度。 + +你的探索学习项目所需的数据集可以从许多不同的源获得。除了公有云提供商之外,[Kaggle][16] 是另一个受欢迎的源,总体来看,它也是一个比较好的学习源。以数字形式提供的政府数据也越来越多了。美国联邦政府的 [Data.gov][17] 声称它提供超过 300,000 的数据集。州和地方政府也发布从餐馆健康评级到狗的名字的所有数据。 + +### 研究和应用人工智能兼而有之 + +最后我想说明的一点是,人工智能不仅是与数学、编程、和数据有关的一个宽泛的主题。人工智能作为一个综合体涉及到了许多其它的领域,包括心理学、语言学、博弈论、运筹学和控制系统。确实,现在有一些人工智能研究者担心,由于处理能力和大数据的结合,使得该领域过于关注最近才变得强大和有趣的少数几个技术。在了解人类如何学习和推理方面,许多长期存在的问题仍未解决。不管怎样,对这些广泛存在的问题有一个了解,将更好地让你在更广泛的背景中评估人工智能。 + +我比较喜欢的其中一个示例是杜克大学的 [人类和自治实验室][18]。这个实验室的工作涉及人类与机器工作所面临的全部挑战,比如,如果自动化设备失效,自动驾驶仪如何设计才能让那些[“洋红色的孩子“][19] 快速取得对飞机的控制。一个基础的大脑科学课程,比如 MIT 的 [心理学导论][20],它提供了关于人类智能和机器智能之间关系的一些很有用的内容。另一个类似的课程是,MIT 电子工程与计算机科学系已故教授 Marvin Minsky 的 [心灵的社会][21]。 + +关于学习人工智能,假如说有一个最重要的挑战,那它不是原材料和工具不易获得,而是它们只有这么多。我的目标并不是给你一个全面的指导,相反,而是指出了你可以去学习的不同路径,以及为你提供一些可能的起点。祝你学习愉快! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/how-get-started-ai + +作者:[Gordon Haff][a] +选题:[lujun9972][b] +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者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://www.youtube.com/watch?v=RLtI7r3QUyY +[2]: https://www.edx.org/ +[3]: https://www.coursera.org/ +[4]: https://ocw.mit.edu/index.htm +[5]: https://www.coursera.org/learn/neural-networks-deep-learning +[6]: https://www.edx.org/micromasters/columbiax-artificial-intelligence +[7]: http://neuralnetworksanddeeplearning.com/ +[8]: http://www.deeplearningbook.org/ +[9]: https://pytorch.org/ +[10]: https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python +[11]: https://www.coursera.org/learn/python +[12]: https://www.r-project.org/about.html +[13]: https://www.edx.org/professional-certificate/harvardx-data-science +[14]: https://www.tensorflow.org/ +[15]: https://www.tensorflow.org/tutorials/ +[16]: https://www.kaggle.com/ +[17]: https://www.data.gov/ +[18]: https://hal.pratt.duke.edu/ +[19]: https://99percentinvisible.org/episode/children-of-the-magenta-automation-paradox-pt-1/ +[20]: https://ocw.mit.edu/courses/brain-and-cognitive-sciences/9-00sc-introduction-to-psychology-fall-2011/ +[21]: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-868j-the-society-of-mind-fall-2011/ +[22]: https://www.edx.org/course/calculus-1a-differentiation +[23]: https://www.edx.org/course/linear-algebra-foundations-to-frontiers +[24]: https://courses.edx.org/courses/course-v1:MITx+6.431x+3T2018/course/ From b2f28aadec871b2a3ff46672e27e005d57cc92d2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 19:36:53 +0800 Subject: [PATCH 0886/1143] PRF:20181201 Boxing yourself in on the Linux command line.md @jrglinux --- ...g yourself in on the Linux command line.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/translated/tech/20181201 Boxing yourself in on the Linux command line.md b/translated/tech/20181201 Boxing yourself in on the Linux command line.md index 56575b1f5b..1680a7ded8 100644 --- a/translated/tech/20181201 Boxing yourself in on the Linux command line.md +++ b/translated/tech/20181201 Boxing yourself in on the Linux command line.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) -[#]: translator: (jrglinux ) -[#]: reviewer: ( ) +[#]: translator: (jrglinux) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (Boxing yourself in on the Linux command line) [#]: via: (https://opensource.com/article/18/12/linux-toy-boxes) @@ -9,24 +9,26 @@ 神奇的 Linux 命令行字符形状工具 boxes ====== -本文将教你如何在 Linux 命令行终端中使用 boxes 工具绘制字符形状图形来包装你的文字让其更突出。 + +> 本文将教你如何在 Linux 命令行终端中使用 boxes 工具绘制字符形状图形来包装你的文字让其更突出。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-boxes.png?itok=Rii6nT5P) 现在正值假期,每个 Linux 终端用户都该得到一点礼物。无论你是庆祝圣诞节还是庆祝其他节日,或者什么节日也没有,都没有关系。我将在接下来的几周内介绍 24 个 Linux 命令行小玩具,供你把玩或者与朋友分享。让我们享受乐趣,让这个月过得快乐一点,因为对于北半球来说,这个月有点冷并且沉闷。 对于我要讲述的内容,可能你之前就有些了解。但是,我还是希望我们都有机会学到一些新的东西(我做了一点研究,确保可以分享 24 个小玩具)。 -24 个 Linux 终端小玩具中的第一个是叫做 boxes 的小程序。为何从 boxes 说起呢?因为在没有它的情况下很难将所有其他命令礼物包装起来! +24 个 Linux 终端小玩具中的第一个是叫做 `boxes` 的小程序。为何从 `boxes` 说起呢?因为在没有它的情况下很难将所有其他命令礼物包装起来! -在我的 Fedora 机器上,默认没有安装 boxes 程序,但它在我的普通仓库中可以获取到,所以用如下命令就可安装: +在我的 Fedora 机器上,默认没有安装 `boxes` 程序,但它在我的普通仓库中可以获取到,所以用如下命令就可安装: ``` $ sudo dnf install boxes -y ``` -如果你在使用其他 Linux 发行版,一般也都可以在默认仓库中找到 boxes。 +如果你在使用其他 Linux 发行版,一般也都可以在默认仓库中找到 `boxes`。 -Boxes 是我真正希望在高中和大学计算机课程中就使用的实用程序,因为善意的老师要求我在每个源文件、函数、代码块等开头添加一些具体的评论信息。 +`boxes` 是我真正希望在高中和大学计算机课程中就使用的实用程序,因为善意的老师要求我在每个源文件、函数、代码块等开头添加一些特定外观的备注信息。 ``` /***************/ @@ -34,7 +36,7 @@ Boxes 是我真正希望在高中和大学计算机课程中就使用的实用 /***************/ ``` -事实证明,一旦你需要在框内添加几行文字,并且格式化的将它们统一风格就会变得很乏味。而 boxes 是一个简单实用程序,它使用 ASCII 艺术风格的字符形状框来包围文本。其字符形状默认风格是源代码注释风格,但也提供了一些其他选项。 +事实证明,一旦你需要在框内添加几行文字,并且格式化的将它们统一风格就会变得很乏味。而 `boxes` 是一个简单实用程序,它使用 ASCII 艺术风格的字符形状框来包围文本。其字符形状默认风格是源代码注释风格,但也提供了一些其他选项。 它真的很容易使用。使用管道,便可以将一个简短问候语塞进字符形状盒子里。 @@ -86,7 +88,7 @@ echo "I am a dog" | boxes -d dog -a c '---------------------------------------' ``` -Boxes 程序提供了[很多选项][1] 用于填充、定位甚至处理正则表达式。你可以在其 [项目主页][2] 上了解更多有关 boxes 的信息,或者转到 [GitHub][3] 去下载源代码或者贡献你自己的盒子形状。说到此,如果你正在寻找贡献的好点子,我已经有了一个想法:为什么不贡献一个节日礼物盒子? +`boxes` 程序提供了[很多选项][1] 用于填充、定位甚至处理正则表达式。你可以在其 [项目主页][2] 上了解更多有关 `boxes` 的信息,或者转到 [GitHub][3] 去下载源代码或者贡献你自己的盒子形状。说到此,如果你想给你的提交找个好点子,我已经有了一个想法:为什么不能是一个节日礼物盒子? ```          _  _ @@ -100,11 +102,11 @@ Boxes 程序提供了[很多选项][1] 用于填充、定位甚至处理正则 |____________________| ``` -Boxes 是基于 GPLv2 许可证的开源项目。 +`boxes` 是基于 GPLv2 许可证的开源项目。 -你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。即使要介绍的小玩具已经有 24 个了,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 +你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。即使要介绍的小玩具已经有 24 个了,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 -你可以通过[ Drive a locomotive through your Linux terminal][4] 来查看明天会介绍的命令行小玩具。 +你可以通过 [Drive a locomotive through your Linux terminal][4] 来查看明天会介绍的命令行小玩具。 -------------------------------------------------------------------------------- @@ -113,7 +115,7 @@ via: https://opensource.com/article/18/12/linux-toy-boxes 作者:[Jason Baker][a] 选题:[lujun9972][b] 译者:[jrg](https://github.com/jrglinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 069ed6a2ae9b85f090b2d083320a815b23b955a0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 19:37:50 +0800 Subject: [PATCH 0887/1143] PUB:20181201 Boxing yourself in on the Linux command line.md @jrglinux https://linux.cn/article-10352-1.html --- .../20181201 Boxing yourself in on the Linux command line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181201 Boxing yourself in on the Linux command line.md (98%) diff --git a/translated/tech/20181201 Boxing yourself in on the Linux command line.md b/published/20181201 Boxing yourself in on the Linux command line.md similarity index 98% rename from translated/tech/20181201 Boxing yourself in on the Linux command line.md rename to published/20181201 Boxing yourself in on the Linux command line.md index 1680a7ded8..657d7b8a31 100644 --- a/translated/tech/20181201 Boxing yourself in on the Linux command line.md +++ b/published/20181201 Boxing yourself in on the Linux command line.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (jrglinux) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (Boxing yourself in on the Linux command line) [#]: via: (https://opensource.com/article/18/12/linux-toy-boxes) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10352-1.html) 神奇的 Linux 命令行字符形状工具 boxes ====== From 5165e663676f019cb539c3756264fc0b0679b7b2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 20:13:11 +0800 Subject: [PATCH 0888/1143] PRF:20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md @dianbanjiu --- ...ry Status And Level From Linux Terminal.md | 171 +++++++++--------- 1 file changed, 84 insertions(+), 87 deletions(-) diff --git a/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md index 7e4bff270a..52767b97d4 100644 --- a/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md +++ b/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md @@ -1,101 +1,99 @@ [#]: collector: (lujun9972) -[#]: translator: ( dianbanjiu ) -[#]: reviewer: ( ) +[#]: translator: (dianbanjiu) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 Ways To Check Laptop Battery Status And Level From Linux Terminal) [#]: via: (https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -从 Linux 终端查看笔记本电池状态等级的 5 个方法 +从 Linux 终端查看笔记本电池状态和等级的 5 个方法 ====== 我们可以轻松地通过图形化界面查看当前电量百分比、是否在充电以及当前电量还可以使用多长时间等电池状态,但是却无法查看电池健康度等相关信息。 在这篇文章就是为了解决这些问题。 -在 Linux 上有很多实用工具可以用命令行进行使用。 +在 Linux 上有很多这样的实用工具,而且可以在命令行使用。 这篇文章今天就要探讨这个主题,我会尽我所能的覆盖尽可能多的信息。 每月检查一次你的电池健康度是一个很好的想法。它可以帮你检查你当前遇到的问题是否与电池或者充电相关。 -同时,我们也可以查看电池模组名称、电源、出售商以及电池规格等。 +同时,我们也可以查看电池模组名称、电源、厂商以及电池规格等。 -电源管理是在非活跃状态时关闭电源或者切换系统的组件到低耗模式的一种功能。 +电源管理是在不使用时关闭电源或者切换系统的组件到低耗模式的一种功能。 ### 几种在 Linux 下检查电池状态的实用工具 - * `upower`: upower 是一个提供了接口来罗列系统中电源的命令行工具。 - * `acpi`: acpi显示来自 /proc 或者 /sys 文件中的一些信息,例如电池状态或者热量信息 - * `batstat`: batstat 是一个为 Linux 打印电池状态的命令行工具。 - * `tlp`: TLP 可以为你带来更高级的电源管理,而无需修改任何配置。 - * `class file`: 这个文件系统是一个提供了内核数据结构接口的伪文件系统。 - - +* `upower`:是一个命令行工具,其提供了罗列系统中电源的接口。 +* `acpi`:显示来自 `/proc` 或者 `/sys` 文件系统中的一些信息,例如电池状态或者热量信息。 +* `batstat`:是一个为 Linux 打印电池状态的命令行工具。 +* `tlp`:可以为你带来更高级的电源管理,而无需修改任何配置。 +* `class file`:这个 sysfs 文件系统是一个提供了内核数据结构接口的伪文件系统。 ### 如何使用 upower 命令检查笔记本电池状态 -[upower][1] 是一个提供了接口来罗列系统中电源的命令行工具。它在你的电脑上可以控制不同操作的延迟,这可以为你节省很大一部分电量。 +[upower][1] 是一个命令行工具,其提供了罗列系统中电源的接口。它在你的电脑上可以控制不同操作的延迟,这可以为你节省很大一部分电量。 只需要在 Linux 中运行以下命令获取电池以及它所依赖的其他信息。 ``` $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 - native-path: BAT0 - vendor: SMP - model: L14M4P23 - serial: 756 - power supply: yes - updated: Monday 03 December 2018 07:56:18 PM IST (95 seconds ago) - has history: yes - has statistics: yes - battery - present: yes - rechargeable: yes - state: discharging - warning-level: none - energy: 28.23 Wh - energy-empty: 0 Wh - energy-full: 52.26 Wh - energy-full-design: 60 Wh - energy-rate: 10.714 W - voltage: 14.819 V - time to empty: 2.6 hours - percentage: 54% - capacity: 87.1% - technology: lithium-ion - icon-name: 'battery-good-symbolic' - History (charge): - 1543847178 54.000 discharging - History (rate): - 1543847178 10.714 discharging + native-path: BAT0 + vendor: SMP + model: L14M4P23 + serial: 756 + power supply: yes + updated: Monday 03 December 2018 07:56:18 PM IST (95 seconds ago) + has history: yes + has statistics: yes + battery + present: yes + rechargeable: yes + state: discharging + warning-level: none + energy: 28.23 Wh + energy-empty: 0 Wh + energy-full: 52.26 Wh + energy-full-design: 60 Wh + energy-rate: 10.714 W + voltage: 14.819 V + time to empty: 2.6 hours + percentage: 54% + capacity: 87.1% + technology: lithium-ion + icon-name: 'battery-good-symbolic' + History (charge): + 1543847178 54.000 discharging + History (rate): + 1543847178 10.714 discharging ``` 使用下面的格式检查电池的特定信息。 ``` $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty" - state: discharging - time to empty: 2.1 hours - percentage: 43% + state: discharging + time to empty: 2.1 hours + percentage: 43% ``` -这个类似于上面的那个,但是充电线缆的插入就相当于一个令牌,这也就是为什么下面会显示正在充电状态的原因。 +这个类似于上面的那个,但是是在充电线缆的插入后运行,这也就是为什么下面会显示正在充电状态的原因。 ``` $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty" - state: charging - percentage: 41% + state: charging + percentage: 41% ``` ### 如何使用 TLP 命令检查笔记本电池状态 -TLP 是一个自由开源多功能的命令行工具,它可以优化笔记本电池而无需修改任何配置。 +TLP 是一个自由开源的多功能的命令行工具,它可以优化笔记本电池而无需修改任何配置。 TLP 可以为你的 Linux 带来更高级的电源管理,而无需理解任何技术细节。TLP 默认附带了一个已经为你的电池优化好的配置,所以你可以安装好后就不再管它了。尽管 TLP 是一个可以根据你的需求高度可定制的工具。 -TLP 在绝大多数 Linux 发行版,例如 Arch、Debian、Fedora、Gentoo、openSUSE等的官方库中都可用。使用你的 Linux 发行版的包管理安装 TLP 即可。 +TLP 在绝大多数 Linux 发行版,例如 Arch、Debian、Fedora、Gentoo、openSUSE 等的官方库中都可用。使用你的 Linux 发行版的包管理安装 TLP 即可。 只需要在 Linux 中运行以下命令获取电池以及其他所依赖的信息。 @@ -104,17 +102,17 @@ $ sudo tlp-stat -b --- TLP 1.1 -------------------------------------------- +++ Battery Status -/sys/class/power_supply/BAT0/manufacturer = SMP -/sys/class/power_supply/BAT0/model_name = L14M4P23 -/sys/class/power_supply/BAT0/cycle_count = (not supported) -/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] -/sys/class/power_supply/BAT0/energy_full = 52260 [mWh] -/sys/class/power_supply/BAT0/energy_now = 21950 [mWh] -/sys/class/power_supply/BAT0/power_now = 10923 [mW] -/sys/class/power_supply/BAT0/status = Discharging +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 52260 [mWh] +/sys/class/power_supply/BAT0/energy_now = 21950 [mWh] +/sys/class/power_supply/BAT0/power_now = 10923 [mW] +/sys/class/power_supply/BAT0/status = Discharging -Charge = 42.0 [%] -Capacity = 87.1 [%] +Charge = 42.0 [%] +Capacity = 87.1 [%] ``` 也可以查看其他的信息。 @@ -124,24 +122,23 @@ $ sudo tlp-stat -s --- TLP 1.1 -------------------------------------------- +++ System Info -System = LENOVO Lenovo ideapad Y700-15ISK 80NV -BIOS = CDCN35WW -Release = "Manjaro Linux" -Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 -/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b -Init system = systemd -Boot mode = BIOS (CSM, Legacy) +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) +++ TLP Status -State = enabled -Last run = 07:16:12 IST, 4362 sec(s) ago -Mode = battery -Power source = battery -``` +State = enabled +Last run = 07:16:12 IST, 4362 sec(s) ago +Mode = battery +Power source = battery``` ### 如何使用 ACPI 命令检查电池状态 -ACPI 代表高级配置和电源接口模块,它们是不同 ACPI 部件的内核模块。它们启用特殊的 ACPI 函数向 /proc 或者 /sys 中添加信息。这些信息可以通过事件或者其他监控程序的 acpid 进行解析。 +ACPI 代表高级配置和电源接口Advanced Configuration and Power Interface模块,它们是不同 ACPI 部件的内核模块。它们启用特殊的 ACPI 函数向 `/proc` 或者 `/sys` 中添加信息。这些信息可以通过事件或者其他监控程序的 acpid 进行解析。 ``` $ acpi @@ -179,25 +176,25 @@ Cooling 11: Processor 0 of 10 ### 如何使用 Batstat 命令查看笔记本电池状态 -batstat 是一个在 Linux 终端打印电池信息的命令行工具。 +`batstat` 是一个在 Linux 终端打印电池信息的命令行工具。 ``` -Status: Charging -Max energy: 50.00 Wh -Energy left: 24.50 Wh -Power Consumption: 26.40 W -Percentage left: 49.00% -Average power Consumption: 0.00 W -Time elapsed: 0: 0:12 since 49.00% -= Time ======== Percent ============================================ - 0: 0: 0 49.00% +Status: Charging +Max energy: 50.00 Wh +Energy left: 24.50 Wh +Power Consumption: 26.40 W +Percentage left: 49.00% +Average power Consumption: 0.00 W +Time elapsed: 0: 0:12 since 49.00% += Time ======== Percent ============================================ + 0: 0: 0 49.00% ``` ### 如何使用 sysfs 文件系统查看笔记本电池状态 sysfs 文件系统是一个提供了内核数据结构接口的伪文件系统。sysfs 下的文件提供有关设备、内核模块、文件系统和其他内核组件的信息。 -sysfs 文件系统通常挂载在 /sys。通常来说,它会被系统自动挂载,但是也可以使用例如 `mount -t sysfs sysfs /sys` 命令进行手动挂载。 +sysfs 文件系统通常挂载在 `/sys`。通常来说,它会被系统自动挂载,但是也可以使用例如 `mount -t sysfs sysfs /sys` 命令进行手动挂载。 在 sysfs 文件系统中的很多文件都是只读的,但也有一些是可写的,允许更改内核变量。为了避免冗余,符号链接被大量用于连接文件系统数中的条目。 @@ -216,7 +213,7 @@ L14M4P23 cat: /sys/class/power_supply/BAT0/power: Is a directory 27656000 1 - 756 + 756 Charging cat: /sys/class/power_supply/BAT0/subsystem: Is a directory Li-ion @@ -236,7 +233,7 @@ POWER_SUPPLY_CAPACITY=51 POWER_SUPPLY_CAPACITY_LEVEL=Normal POWER_SUPPLY_MODEL_NAME=L14M4P23 POWER_SUPPLY_MANUFACTURER=SMP -POWER_SUPPLY_SERIAL_NUMBER= 756 +POWER_SUPPLY_SERIAL_NUMBER= 756 14800000 15840000 ``` @@ -248,7 +245,7 @@ via: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[dianbanjiu](https://github.com/dianbanjiu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f8a8ed65781dcd4faf53247e767d27e9f55a6381 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 20:13:53 +0800 Subject: [PATCH 0889/1143] PUB:20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md @dianbanjiu https://linux.cn/article-10353-1.html --- ...eck Laptop Battery Status And Level From Linux Terminal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md (99%) diff --git a/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/published/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md similarity index 99% rename from translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md rename to published/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md index 52767b97d4..dc7866eb07 100644 --- a/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md +++ b/published/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (dianbanjiu) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10353-1.html) [#]: subject: (5 Ways To Check Laptop Battery Status And Level From Linux Terminal) [#]: via: (https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From e497d34784159ce9fd1eb8046f80724c2adce535 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 20:38:22 +0800 Subject: [PATCH 0890/1143] PRF:20181112 A Free Guide for Setting Your Open Source Strategy.md @geekpi --- ...e for Setting Your Open Source Strategy.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md b/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md index 16216c8a46..8647eea005 100644 --- a/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md +++ b/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (A Free Guide for Setting Your Open Source Strategy) [#]: via: (https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-strategy) @@ -10,13 +10,15 @@ 制定开源战略的免费指南 ====== +> 了解如何使用 TODO Group 的成熟实践,使您的组织的开源软件目标与您的业务目标保持一致。 + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/os-strategy.jpg?itok=hSmtdJdK) -大多数使用开源的公司都了解其商业价值,但他们可能缺乏战略性地实施开源计划和获得全部回报的工具。根据 [The New Stack][1] 最近的一项调查,“开源计划的三大好处是1)提高了对开源的认识,2)提高了开发周期的速度和灵活性,以及 3)更好的许可证合规性“。 +大多数使用开源的公司都了解其商业价值,但他们可能缺乏战略性地实施开源计划和获得全部回报的工具。根据 [The New Stack][1] 最近的一项调查,“开源计划的三大好处是 1)提高了对开源的认识,2)提高了开发周期的速度和灵活性,以及 3)更好的许可证合规性。” -运营开源计划办公点涉及创建策略来帮助你定义和实施你的方法,并衡量你的进度。由 Linux 基金会与 TODO 集团合作开发的[企业开源指南][2]基于多年的经验和实践提供了专业开源知识。 +运作一个开源计划办公室涉及到创建策略来帮助你定义和实施你的方法,并衡量你的进度。由 Linux 基金会与 TODO Group 合作开发的[企业开源指南][2]基于多年的经验和实践提供了专业开源知识。 -最新的指南中,[设置开源战略][3]详细介绍了制定战略和确保成功之路的基本步骤。根据该指南,“你的开源战略将管理、参与和创建开源软件的计划与计划所服务的业务目标联系起来。这可以开辟许多机会并促进创新。“该指南涵盖以下主题: +最新的指南中,[设置开源战略][3]详细介绍了制定战略和确保成功之路的基本步骤。根据该指南,“你的开源战略将管理、参与和创建开源软件的计划与计划所服务的业务目标联系起来。这可以开辟许多机会并促进创新。”该指南涵盖以下主题: 1. 为什么制定战略? 2. 你的战略文件 @@ -26,9 +28,7 @@ 6. 确定投资回报率 7. 投资目标 - - -这里关键的第一步是创建和记录你的开源策略,该策略将“帮助你最大限度地提高组织从开源中获得的利益。”同时,你详细的策略可以帮助你避免因错误而导致的困难,例如:选择错误的许可证或不正确地维护代码。根据指南,该文件还可以: +这里关键的第一步是创建和将你的开源策略形成文字,该策略将“帮助你最大限度地提高组织从开源中获得的利益。”同时,你详细的策略可以帮助你避免因错误而导致的困难,例如:选择错误的许可证或不正确地维护代码。根据指南,该文件还可以: * 让领导者感到兴奋并参与 * 帮助在公司内获得支持 @@ -37,15 +37,13 @@ * 解释贵公司的开源方式和对其使用的支持 * 明确贵公司在社区驱动的外部研发中投资的地方,以及贵公司将重点放在增值差异化的地方 +Salesforce 的软件架构师兼本指南的撰稿人 Ian Varley 说:“在 Salesforce 内,我们有内部文件,我们将这些围绕开源战略指导和鼓励的文件分发给我们的工程团队。其中鼓励创建和使用开源,这让他们毫不含糊地知道公司的战略领导者完全支持它。此外,如果有某些我们不希望工程师使用的许可证或有其他开源指南,我们的内部文档需要明确。” - -Salesforce 的软件架构师兼指南的撰稿人 Ian Varley 说:“在 Salesforce 内,我们有内部文件,我们将这些围绕开源战略指导和鼓励的文件分发给我们的工程团队。其中鼓励创建和使用开源,这让他们毫不含糊地知道公司的战略领导者完全支持它。此外,如果有某些我们不希望工程师使用的许可证或有其他开源指南,我们的内部文档需要明确。“ - -开源计划有助于促进企业文化,使企业更高效,并且根据指南,强有力的战略文档可以“帮助你的团队了解开源计划背后的业务目标,确保更好的决策,并最大限度地降低风险“。 +开源计划有助于促进企业文化,使企业更高效,并且根据指南,强有力的战略文档可以“帮助你的团队了解开源计划背后的业务目标,确保更好的决策,并最大限度地降低风险。” 了解如何使用[设置开源策略][3]新指南中的提示和经过验证的实践,将管理和创建开源软件的目标与组织的业务目标保持一致。然后,查看所有 12 个[企业开源指南][2],了解有关使用开源获得成功的更多信息。 -本文最初发表在 [Linux基金会][4] +本文最初发表在 [Linux基金会][4]。 -------------------------------------------------------------------------------- @@ -54,7 +52,7 @@ via: https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-stra 作者:[Amber Ankerholz][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/) 荣誉推出 @@ -63,4 +61,4 @@ via: https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-stra [1]: https://thenewstack.io/open-source-culture-starts-with-programs-and-policies/ [2]: https://www.linuxfoundation.org/resources/open-source-guides/ [3]: https://www.linuxfoundation.org/resources/open-source-guides/setting-an-open-source-strategy/ -[4]: https://www.linuxfoundation.org/blog/2018/11/a-free-guide-for-setting-your-open-source-strategy/ \ No newline at end of file +[4]: https://www.linuxfoundation.org/blog/2018/11/a-free-guide-for-setting-your-open-source-strategy/ From 387752f580cd3f2c74756306dc2e67ca65a02364 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 16 Dec 2018 20:39:09 +0800 Subject: [PATCH 0891/1143] PUB:20181112 A Free Guide for Setting Your Open Source Strategy.md @geekpi https://linux.cn/article-10354-1.html --- ...1112 A Free Guide for Setting Your Open Source Strategy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20181112 A Free Guide for Setting Your Open Source Strategy.md (98%) diff --git a/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md b/published/20181112 A Free Guide for Setting Your Open Source Strategy.md similarity index 98% rename from translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md rename to published/20181112 A Free Guide for Setting Your Open Source Strategy.md index 8647eea005..6e203f72a1 100644 --- a/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md +++ b/published/20181112 A Free Guide for Setting Your Open Source Strategy.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (A Free Guide for Setting Your Open Source Strategy) [#]: via: (https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-strategy) [#]: author: ([Amber Ankerholz](https://www.linux.com/users/aankerholz) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10354-1.html) 制定开源战略的免费指南 ====== From 5e3f99e481760a3087feb930074e0b2ac65c9227 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 16 Dec 2018 20:46:12 +0800 Subject: [PATCH 0892/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=902?= =?UTF-8?q?0180710=20Users,=20Groups,=20and=20Other=20Linux=20Beasts.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0 Users, Groups, and Other Linux Beasts.md | 155 ------------------ ...0 Users, Groups, and Other Linux Beasts.md | 139 ++++++++++++++++ 2 files changed, 139 insertions(+), 155 deletions(-) delete mode 100644 sources/tech/20180710 Users, Groups, and Other Linux Beasts.md create mode 100644 translated/tech/20180710 Users, Groups, and Other Linux Beasts.md diff --git a/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md b/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md deleted file mode 100644 index ad5be702d8..0000000000 --- a/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md +++ /dev/null @@ -1,155 +0,0 @@ -Translating by MjSeven - -Users, Groups, and Other Linux Beasts -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/flamingo-2458782_1920.jpg?itok=_gkzGGx5) - -Having reached this stage, [after seeing how to manipulate folders/directories][1], but before flinging ourselves headlong into fiddling with files, we have to brush up on the matter of _permissions_ , _users_ and _groups_. Luckily, [there is already an excellent and comprehensive tutorial on this site that covers permissions][2], so you should go and read that right now. In a nutshell: you use permissions to establish who can do stuff to files and directories and what they can do with each file and directory -- read from it, write to it, move it, erase it, etc. - -To try everything this tutorial covers, you'll need to create a new user on your system. Let's be practical and make a user for anybody who needs to borrow your computer, that is, what we call a _guest account_. - -**WARNING:** _Creating and especially deleting users, along with home directories, can seriously damage your system if, for example, you remove your own user and files by mistake. You may want to practice on another machine which is not your main work machine or on a virtual machine. Regardless of whether you want to play it safe, or not, it is always a good idea to back up your stuff frequently, check the backups have worked correctly, and save yourself a lot of gnashing of teeth later on._ - -### A New User - -You can create a new user with the `useradd` command. Run `useradd` with superuser/root privileges, that is using `sudo` or `su`, depending on your system, you can do: -``` -sudo useradd -m guest - -``` - -... and input your password. Or do: -``` -su -c "useradd -m guest" - -``` - -... and input the password of root/the superuser. - -( _For the sake of brevity, we'll assume from now on that you get superuser/root privileges by using`sudo`_ ). - -By including the `-m` argument, `useradd` will create a home directory for the new user. You can see its contents by listing _/home/guest_. - -Next you can set up a password for the new user with -``` -sudo passwd guest - -``` - -Or you could also use `adduser`, which is interactive and asks you a bunch of questions, including what shell you want to assign the user (yes, there are more than one), where you want their home directory to be, what groups you want them to belong to (more about that in a second) and so on. At the end of running `adduser`, you get to set the password. Note that `adduser` is not installed by default on many distributions, while `useradd` is. - -Incidentally, you can get rid of a user with `userdel`: -``` -sudo userdel -r guest - -``` - -With the `-r` option, `userdel` not only removes the _guest_ user, but also deletes their home directory and removes their entry in the mailing spool, if they had one. - -### Skeletons at Home - -Talking of users' home directories, depending on what distro you're on, you may have noticed that when you use the `-m` option, `useradd` populates a user's directory with subdirectories for music, documents, and whatnot as well as an assortment of hidden files. To see everything in you guest's home directory run `sudo ls -la /home/guest`. - -What goes into a new user's directory is determined by a skeleton directory which is usually _/etc/skel_. Sometimes it may be a different directory, though. To check which directory is being used, run: -``` -useradd -D -GROUP=100 -HOME=/home -INACTIVE=-1 -EXPIRE= -SHELL=/bin/bash -SKEL=/etc/skel -CREATE_MAIL_SPOOL=no - -``` - -This gives you some extra interesting information, but what you're interested in right now is the `SKEL=/etc/skel` line. In this case, and as is customary, it is pointing to _/etc/skel/_. - -As everything is customizable in Linux, you can, of course, change what gets put into a newly created user directory. Try this: Create a new directory in _/etc/skel/_ : -``` -sudo mkdir /etc/skel/Documents - -``` - -And create a file containing a welcome text and copy it over: -``` -sudo cp welcome.txt /etc/skel/Documents - -``` - -Now delete the guest account: -``` -sudo userdel -r guest - -``` - -And create it again: -``` -sudo useradd -m guest - -``` - -Hey presto! Your _Documents/_ directory and _welcome.txt_ file magically appear in the guest's home directory. - -You can also modify other things when you create a user by editing _/etc/default/useradd_. Mine looks like this: -``` -GROUP=users -HOME=/home -INACTIVE=-1 -EXPIRE= -SHELL=/bin/bash -SKEL=/etc/skel -CREATE_MAIL_SPOOL=no - -``` - -Most of these options are self-explanatory, but let's take a closer look at the `GROUP` option. - -### Herd Mentality - -Instead of assigning permissions and privileges to users one by one, Linux and other Unix-like operating systems rely on _groups_. A group is a what you imagine it to be: a bunch of users that are related in some way. On your system you may have a group of users that are allowed to use the printer. They would belong to the _lp_ (for " _line printer_ ") group. The members of the _wheel_ group were traditionally the only ones who could become superuser/root by using _su_. The _network_ group of users can bring up and power down the network. And so on and so forth. - -Different distributions have different groups and groups with the same or similar names have different privileges also depending on the distribution you are using. So don't be surprised if what you read in the prior paragraph doesn't match what is going on in your system. - -Either way, to see which groups are on your system you can use: -``` -getent group - -``` - -The `getent` command lists the contents of some of the system's databases. - -To find out which groups your current user belongs to, try: -``` -groups - -``` - -When you create a new user with `useradd`, unless you specify otherwise, the user will only belong to one group: their own. A _guest_ user will belong to a _guest_ group and the group gives the user the power to administer their own stuff and that is about it. - -You can create new groups and then add users to them at will with the `groupadd` command: -``` -sudo groupadd photos - -``` - -will create the _photos_ group, for example. Next time, we’ll use this to build a shared directory all members of the group can read from and write to, and we'll learn even more about permissions and privileges. Stay tuned! - -Learn more about Linux through the free ["Introduction to Linux" ][3]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts - -作者:[Paul Brown][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/bro66 -[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux -[2]:https://www.linux.com/learn/understanding-linux-file-permissions -[3]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md b/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md new file mode 100644 index 0000000000..477d317d9f --- /dev/null +++ b/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md @@ -0,0 +1,139 @@ +用户,组和其他 Linux 用户 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/flamingo-2458782_1920.jpg?itok=_gkzGGx5) + +到这个阶段,[在看到如何操作目录或文件夹之后][1],但在让自己一头扎进文件之前,我们必须重新审视 _权限_, _users_ 和 _group_。幸运的是,[有一个网站上已经有了一个优秀而全面的教程,包括了权限][2],所以你应该去立刻阅读它。简而言之,你使用权限来确定谁可以对文件和目录执行操作,以及他们可以对每个文件和目录执行什么操作 -- 从中读取,写入,擦除等等。 + +要尝试本教程涵盖的所有内容,你需要在系统上创建新用户。让我们实践起来,为每一个需要借用你电脑的人创建一个用户,我们称之为 _guest 账户_。 + +**警告:** _例如,如果你错误地删除了自己的用户和目录,那么创建,特别是删除用户以及主目录会严重损坏系统。你可能不想在你日常的工作机中练习,那么请在另一台机器或者虚拟机上练习。无论你是否想要安全地练习,经常备份你的东西总是一个好主意。检查备份是否正常工作,为你自己以后避免很多咬牙切齿的事情。_ + +### 一个新用户 + +你可以使用 `useradd` 命令来创建一个新用户。使用超级用户或 root 权限运行 `useradd`,即使用 `sudo` 或 `su`,这具体取决于你的系统,你可以: +``` +sudo useradd -m guest +``` + +然后输入你的密码。或者也可以这样: +``` +su -c "useradd -m guest" +``` + +然后输入 root 或超级用户的密码。 + +(_为了简洁起见,我们将从现在开始假设你使用 `sudo` 获得超级用户或 root 权限。_) + +通过使用 `-m` 参数,`useradd` 将为新用户创建一个主目录。你可以通过列出 _/home/guest_ 来查看其内容。 + +然后你可以使用以下命令来为新用户设置密码: +``` +sudo passwd guest +``` + +或者你也可以使用 `adduser`,这是一个交互式的命令,它会询问你一些问题,包括你要为用户分配的 shell(是的,不止一个),你希望其主目录在哪里,你希望他们属于哪些组(有关这点稍后会讲到)等等。在运行 `adduser` 结束时,你可以设置密码。注意,默认情况下,在许多发行版中都没有安装 `adduser`,但安装了 `useradd`。 + +顺便说一下,你可以使用 `userdel` 来移除一个用户: +``` +sudo userdel -r guest +``` + +使用 `-r` 选项,`userdel` 不仅删除了 _guest_ 用户,还删除了他们的主目录和邮件中的条目(如果有的话)。 + +### home 中的内容 + +谈到用户的主目录,它依赖于你所使用的发行版。你可能已经注意到,当你使用 `-m` 选项时,`useradd` 使用子目录填充用户的目录,包括音乐,文档和诸如此类的内容以及各种各样的隐藏文件。要查看 guest 主目录中的所有内容,运行 `sudo ls -la /home/guest`。 + +进入新用户目录的内容通常是由 _/etc/skel_ 架构目录确定的。有时它可能是一个不同的目录。要检查正在使用的目录,运行: +``` +useradd -D +GROUP=100 +HOME=/home +INACTIVE=-1 +EXPIRE= +SHELL=/bin/bash +SKEL=/etc/skel +CREATE_MAIL_SPOOL=no +``` + +这给你一些额外的有趣信息,但你现在感兴趣的是 `SKEL=/etc/skel` 这一行,在这种情况下,按照惯例,它指向 _/etc/skel/_。 + +由于 Linux 中的所有东西都是可定制的,因此你可以更改那些放入新创建的用户目录的内容。试试这样做:在 _/etc/skel/_ 中创建一个新目录: +``` +sudo mkdir /etc/skel/Documents +``` + +然后创建一个包含欢迎消息的文件,并将其复制过来: +``` +sudo cp welcome.txt /etc/skel/Documents +``` + +现在删除 guest 账户: +``` +sudo userdel -r guest +``` + +再次创建: +``` +sudo useradd -m guest +``` + +嘿 presto!(to 校正:这个 presto 是什么?)你的 _Documents/_ 目录和 _welcome.txt_ 文件神奇地出现在了 guest 的主目录中。 + +你还可以在创建用户时通过编辑 _/etc/default/useradd_ 来修改其他内容。我的看起来像这样: +``` +GROUP=users +HOME=/home +INACTIVE=-1 +EXPIRE= +SHELL=/bin/bash +SKEL=/etc/skel +CREATE_MAIL_SPOOL=no +``` + +这些选项大多数都是不言自明的,但让我们仔细看看 `GROUP` 选项。 + +### 群组心态 + +Linux 和其他类 Unix 操作系统依赖于 _groups_,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。在你的系统上可能有一组允许使用打印机的用户,他们属于 _lp_(即 "_line printer_")组。传统上 _wheel_ 组的成员是唯一可以通过使用 _su_ 成为超级用户或 root 的成员。_network_ 用户组可以启动或关闭网络。还有许多诸如此类的。 + +不同的发行版有不同的组,具有相同或相似名称的组具有不同的权限,这也取决于你使用的发行版。因此,如果你在前一段中读到的内容与你系统中的内容不匹配,不要感到惊讶。 + +不管怎样g,要查看系统中有哪些组,你可以使用: +``` +getent group +``` + +`getent` 命令列出了某些系统数据库的内容。 + +要查找当前用户所属的组,尝试: +``` +groups +``` + +当你使用 `useradd` 创建新用户时,除非你另行指定,否则用户讲只属于一个组:他们自己。一个 _guest_ 用户属于 _guest_ 组。组使用户有权管理自己的东西,仅此而已。 + +你可以使用 `groupadd` 命令创建新组,然后添加用户: +``` +sudo groupadd photos +``` + +例如,这将创建 _photos_ 组。下一次,我们将使用它来构建一个共享目录,该组的所有成员都可以读取和写入,我们将更多地了解权限和特权。敬请关注! + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts + +作者:[Paul Brown][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/bro66 +[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux +[2]:https://www.linux.com/learn/understanding-linux-file-permissions +[3]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 65332a0e14804a34eacaea874afc64506ce0ec3b Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 17 Dec 2018 08:59:20 +0800 Subject: [PATCH 0893/1143] translated --- ...arch Or Find Files And Folders in Linux.md | 153 ------------------ ...arch Or Find Files And Folders in Linux.md | 153 ++++++++++++++++++ 2 files changed, 153 insertions(+), 153 deletions(-) delete mode 100644 sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md create mode 100644 translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md diff --git a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md deleted file mode 100644 index f28649013b..0000000000 --- a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md +++ /dev/null @@ -1,153 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux) -[#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/) -[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) - -Four Easy Ways to Search Or Find Files And Folders in Linux -====== - -Linux admins can’t able to leave a day without performing a file search as this one of the activity for their routine. - -It’s good to know all the file search stuffs because it would help you in many ways when you are working on headless server. - -These commands are not complicate to remember because these are using a standard syntax. - -This can be performed through Four Linux commands and each command has their own unique feature. - -### Method-1: Search Files And Folders in Linux Using find Command - -Find command is widely used and very famous command to search files and folders in Linux. It searches given files in the current directory and recursively through its sub-directories based on the search criteria. - -It allow users to perform all kind of file searches based on the criteria lie by size, name, owner, group, type, permissions, date, and other criteria. - -Run the following command to find a given file in system. - -``` -# find / -iname "sshd_config" -/etc/ssh/sshd_config -``` - -Run the following command to find a given folder in system. To search a folder in Linux we need to use `-type` parameter. - -``` -# find / -type d -iname "ssh" -/usr/lib/ssh -/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh -/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh -/etc/ssh -``` - -Use wildcard option to search set of files on your system. We are going to search all files available in the system with `.config` extension. - -``` -# find / -name "*.config" -/usr/lib/mono/gac/avahi-sharp/1.0.0.0__4d116c78973743f5/avahi-sharp.dll.config -/usr/lib/mono/gac/avahi-ui-sharp/0.0.0.0__4d116c78973743f5/avahi-ui-sharp.dll.config -/usr/lib/python2.7/config/Setup.config -/usr/share/git/mw-to-git/t/test.config -/var/lib/lightdm/.config -/home/daygeek/.config -/root/.config -/etc/skel/.config -``` - -Use the following command format to find an empty files and folders in system. - -``` -# find / -empty -``` - -Use the following command combination to find all files containing specific text on Linux. - -``` -# find / -type f -exec grep "Port 22" '{}' \; -print -# find / -type f -print | xargs grep "Port 22" -# find / -type f | xargs grep 'Port 22' -# find / -type f -exec grep -H 'Port 22' {} \; -``` - -### Method-2: Search Files And Folders in Linux Using locate command - -locate command works faster than the find command because it uses updatedb database, whereas the find command searches in the real system. - -It uses a database rather than hunting individual directory paths to get a given file. - -locate command doesn’t pre-installed in most of the distributions so, use your distribution package manager to install it. - -The database is updated regularly through cron, however we can manually update it by running the following command. - -``` -$ sudo updatedb -``` - -Simply run the following command to list the given file or folder. There is no specific options need to be specified in locate command to print file or folder. - -To search `ssh` folder in system. - -``` -# locate --basename '\ssh' -/etc/ssh -/usr/bin/ssh -/usr/lib/ssh -/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh -/usr/lib/go/src/cmd/go/testdata/failssh/ssh -/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh -``` - -To search `ssh_config` file in system. - -``` -# locate --basename '\sshd_config' -/etc/ssh/sshd_config -``` - -### Method-3: Search Files in Linux Using which command - -TThe which command returns the full path of the executable that would have been executed when the command had been entered in terminal. - -It’s very useful when you want to create a desktop shortcut or symbolic link for executable files. - -Which command searches the directories listed in the current user’s PATH environment variable not for all the users. I mean, when you are logged in your own account and you can’t able to search for root user file or directory. - -Run the following command to print the full path of the vim executable file location. - -``` -# which vi -/usr/bin/vi -``` - -Alternatively, it’s allowing user to perform multiple file search in one shot. - -``` -# which -a vi sudo -/usr/bin/vi -/bin/vi -/usr/bin/sudo -/bin/sudo -``` - -### Method-4: Search Files in Linux Using whereis command - -The whereis command used to search the binary, source, and man page files for a given command. - -``` -# whereis vi -vi: /usr/bin/vi /usr/share/man/man1/vi.1p.gz /usr/share/man/man1/vi.1.gz -``` --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/ - -作者:[Prakash Subramanian][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.2daygeek.com/author/prakash/ -[b]: https://github.com/lujun9972 diff --git a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md new file mode 100644 index 0000000000..a95aef6e7d --- /dev/null +++ b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux) +[#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/) +[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) + +四种简单的方法来搜索或查找 Linux 中的文件和文件夹 +====== + +Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。 + +了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。 + +这些命令记忆起来不复杂,因为它们使用的是标准语法。 + +这里执行四个 Linux 命令,每个命令都有自己独特的功能。 + +### 方法 1:使用 find 命令在 Linux 中搜索文件和文件夹 + +find 命令被广泛使用,并且是非常著名的在 Linux 中搜索文件和文件夹的命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。 + +它允许用户根据大小、名称、所有者、组、类型、权限、日期和其他条件执行所有类型的文件搜索。 + +运行以下命令以在系统中查找给定文件。 + +``` +# find / -iname "sshd_config" +/etc/ssh/sshd_config +``` + +运行以下命令以查找系统中的给定文件夹。要在 Linux 中搜索文件夹,我们需要使用 `-type` 参数。 + +``` +# find / -type d -iname "ssh" +/usr/lib/ssh +/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh +/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh +/etc/ssh +``` + +使用通配符搜索系统上的所有文件。我们将搜索系统中所有以 `.config` 为扩展名的文件。 + +``` +# find / -name "*.config" +/usr/lib/mono/gac/avahi-sharp/1.0.0.0__4d116c78973743f5/avahi-sharp.dll.config +/usr/lib/mono/gac/avahi-ui-sharp/0.0.0.0__4d116c78973743f5/avahi-ui-sharp.dll.config +/usr/lib/python2.7/config/Setup.config +/usr/share/git/mw-to-git/t/test.config +/var/lib/lightdm/.config +/home/daygeek/.config +/root/.config +/etc/skel/.config +``` + +使用以下命令格式在系统中查找空文件和文件夹。 + +``` +# find / -empty +``` + +使用以下命令组合查找 Linux 上包含特定文本的所有文件。 + +``` +# find / -type f -exec grep "Port 22" '{}' \; -print +# find / -type f -print | xargs grep "Port 22" +# find / -type f | xargs grep 'Port 22' +# find / -type f -exec grep -H 'Port 22' {} \; +``` + +### 方法 2:使用 locate 命令在 Linux 中搜索文件和文件夹 + +locate 命令比 find 命令运行得更快,因为它使用 updatedb 数据库,而 find 命令在真实系统中搜索。 + +它使用数据库而不是搜索单个目录路径来获取给定文件。 + +locate 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。 + +数据库通过 cron 定期更新,但我们可以通过运行以下命令手动更新它。 + +``` +$ sudo updatedb +``` + +只需运行以下命令即可列出给定的文件或文件夹。在 locate 命令中不需要指定特定选项来打印文件或文件夹。 + +在系统中搜索 `ssh` 文件夹。 + +``` +# locate --basename '\ssh' +/etc/ssh +/usr/bin/ssh +/usr/lib/ssh +/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh +/usr/lib/go/src/cmd/go/testdata/failssh/ssh +/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh +``` + +在系统中搜索 `ssh_config` 文件。 + +``` +# locate --basename '\sshd_config' +/etc/ssh/sshd_config +``` + +### 方法 3:在 Linux 中搜索文件使用 which 命令 + +which 返回在终端输入命令时执行的可执行文件的完整路径。 + +当你想要为可执行文件创建桌面快捷方式或符号链接时,它非常有用。 + +which 命令搜索当前用户而不是所有用户的 PATH 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。 + +运行以下命令以打印 vim 可执行文件的完整路径。 + +``` +# which vi +/usr/bin/vi +``` + +或者,它允许用户一次执行多个文件搜索。 + +``` +# which -a vi sudo +/usr/bin/vi +/bin/vi +/usr/bin/sudo +/bin/sudo +``` + +### 方法 4:使用 whereis 命令在 Linux 中搜索文件 + +whereis 命令用于搜索给定命令的二进制、源码和手册页文件。 + +``` +# whereis vi +vi: /usr/bin/vi /usr/share/man/man1/vi.1p.gz /usr/share/man/man1/vi.1.gz +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/ + +作者:[Prakash Subramanian][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/prakash/ +[b]: https://github.com/lujun9972 \ No newline at end of file From 2e26f45a24fd7fb8f1bd689660bcf1f7d2197e7e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 17 Dec 2018 09:09:27 +0800 Subject: [PATCH 0894/1143] translating --- .../20181212 Patch into The Matrix at the Linux command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md b/sources/tech/20181212 Patch into The Matrix at the Linux command line.md index c07e71fc28..108fb7c97d 100644 --- a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md +++ b/sources/tech/20181212 Patch into The Matrix at the Linux command line.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 909d8ba98d018e2b1ae0b33d07037af119ba6d30 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 10:22:00 +0800 Subject: [PATCH 0895/1143] Update README.md --- README.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index f1e0cec6c1..6590da83cb 100644 --- a/README.md +++ b/README.md @@ -15,30 +15,26 @@ LCTT 已经拥有几百名活跃成员,并欢迎更多的 Linux 志愿者加入我们的团队。 -![logo](https://linux.cn/static/image/common/lctt_logo.png) +![LCTT](https://lctt.github.io/wiki/images/lctt_logo.png) -LCTT 的组成 -------------------------------- - -**选题**,负责选择合适的内容,并将原文转换为 markdown 格式,提交到 LCTT 的 [TranslateProject](https://github.com/LCTT/TranslateProject) 库中。 - -**译者**,负责从选题中选择内容进行翻译。 - -**校对**,负责将初译的文章进行文字润色、技术校对等工作。 - -**发布**,负责将校对后的文章,排版进行发布。 +- LCTT 官网: [https://linux.cn/lctt/](https://linux.cn/lctt/) +- LCTT 状态: [https://lctt.github.io/](https://lctt.github.io/) 加入我们 ------------------------------- -请首先加入翻译组的 QQ 群,群号是:**198889102**,加群时请说明是“*志愿者*”。加入后记得修改您的群名片为您的 GitHub 的 ID。 +请首先加入翻译组的 QQ 群,群号是:**198889102**,加群时请说明是“*志愿者*”。 -加入的成员,请先阅读 [WIKI 如何开始](https://github.com/LCTT/TranslateProject/wiki/01-如何开始)。 +加入的成员,请: + +1. 修改你的 QQ 群名片为“译者-您的_GitHub_ID”。 +2. 阅读 [WIKI](http://lctt.github.io/wiki) 了解如何开始。 +3. 遇到不解之处,请在群内发问。 如何开始 ------------------------------- -请阅读 [WIKI](https://github.com/LCTT/TranslateProject/wiki)。如需要协助,请在群内发问。 +请阅读 [WIKI](http://lctt.github.io/wiki)。如需要协助,请在群内发问。 历史 ------------------------------- From 6e2fd557f6c412e021bc476ec8326faaeeb4a2cc Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Mon, 17 Dec 2018 13:37:28 +0800 Subject: [PATCH 0896/1143] Translating How to Update Ubuntu. --- ...untu -Terminal - GUI Methods- It-s FOSS.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md new file mode 100644 index 0000000000..3a4332c365 --- /dev/null +++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: (LazyWolfLin) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Update Ubuntu [Terminal & GUI Methods] It's FOSS) +[#]: via: (https://itsfoss.com/update-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何更新Ubuntu [终端及GUI方式] It's FOSS +====== + +**这篇教程将向你展示如何更新服务器版本或者桌面版本的Ubuntu。它还解释了更新和升级之间的区别以及你应该了解的有关于Ubuntu Linux中的更新的一些其他内容。** + +如果你是一个新手并已经体验Ubuntu数天或几周,你可能想知道如何更新你的[Ubuntu][1]系统以获取安全补丁,错误修复和应用升级。 + +更新 Ubuntu 非常简单。我并不夸张的说。它简单得只要运行两个命令。让我来告诉你更多更新细节。 + +Please note that the tutorial is valid for Ubuntu 18.04, 16.04 or any other version. The command line way is also valid for Ubuntu-based distributions like Linux Mint, Linux Lite, elementary OS etc. + +### Update Ubuntu via Command Line + +![How to Update Ubuntu][2] + +On the desktop, open the terminal. You can find it in the menu or use the Ctrl+Alt+T [keyboard shortcut][3]. If you are logged on to an [Ubuntu server][4], you already have access to a terminal. + +In the terminal, you just have to use the following command: + +``` +sudo apt update && sudo apt upgrade -y +``` + +It will ask for password and you can use your account’s password. You won’t see the anything on the screen while typing so keep on typing your password and hit enter. + +Now let me explain the above command. + +Actually, it’s not a single command. It’s a combination of two commands. The && is a way to combine two commands in a way that the second command runs only when the previous command ran successfully. + +The ‘-y’ in the end automatically enters yes when the command ‘apt upgrade’ ask for your confirmation before installing the updates. + +Note that you can also use the two commands separately, one by one: + +``` +sudo apt update +sudo apt upgrade +``` + +It will take a little longer because you have to wait for one command to finish and then enter the second command. + +#### Explanation: sudo apt update + +This command updates the local database of available packages. If you won’t run this command, the local database won’t be updated and your system will not know if there are any new versions available. + +This is why when you run the sudo apt update, you’ll see lots of URLs in the output. The command fetches the package information from the respective repositories (the URLs you see in the output). + +![Updating Ubuntu Linux][5] + +At the end of the command, it tells you how many packages can be upgraded. You can see these packages by running the following command: + +``` +apt list --upgradable +``` + +**Additional Reading:** Read this article to learn [what is Ign, Hit and Get in the apt update command output][6]. + +#### Explanation: sudo apt upgrade + +This command matches the versions of installed packages with the local database. It collects all of them and then it will list all of the packages that have a newer version available. At this point, it will ask if you want to upgrade (the installed packages to the newer version). + +![Update Ubuntu Linux via Command Line][7] + +You can type ‘yes’, ‘y’ or just press enter to confirm the installation of updates. + +So the bottom line is that the sudo apt update checks for the availability of new versions while as the sudo apt upgrade actually performs the update. + +The term update might be confusing as you might expect the apt update command to update the system by installing the updates but that doesn’t happen. + +### Update Ubuntu via GUI [For Desktop Users] + +If you are using Ubuntu as a desktop, you don’t have to go to terminal just for updating the system. You can still use the command line but it’s optional for you. + +In the menu, look for ‘Software Updater’ and run it. + +![Run Software Updater in Ubuntu][8] + +It will check if there are updates available for your system. + +![Checking if updates are available for Ubuntu][9] + +If there are updates available, it will give provide you with options to install the updates. + +![Install Updates via Update Manager in Ubuntu][10] + +Click on Install Now, it may ask for your password. + +![Installing Updates in Ubuntu Linux via GUI][11] + +Once you enter your password, it will start installing the updates. + +![Updating Ubuntu via GUI][12] + +In some cases, you may need to reboot the system for the installed updates to work properly. You’ll be notified at the end of the update if you need to restart the system. + +![Updating Ubuntu via GUI][12] + +You can choose to restart later if you don’t want to reboot your system straightaway. + +![Installing updates via GUI in Ubuntu][13] + +Tip: If the software updater returns an error, you should use the command ‘sudo apt update’ in the terminal. The last few lines of the output will contain the actual error message. You can search on the internet for that error and fix the problem. + +### Few things to keep in mind abou updating Ubuntu + +You just learned how to update your Ubuntu system. If you are interested, you should also know these few things around Ubuntu updates. + +#### Clean up after an update + +Your system will have some unnecessary packages that won’t be required after the updates. You can remove such packages and [free up some space][14] using this command: + +``` +sudo apt autoremove +``` + +#### Live patching kernel in Ubuntu Server to avoid rebooting + +In case of a Linux kernel updates, you’ll have to restart the system after the update. This is an issue when you don’t want downtime for your server. + +[Live patching][15] feature allows the patching of Linux kernel while the kernel is still running. In other words, you don’t have to reboot your system. + +If you manage servers, you may want to [enable live patching in Ubuntu][16]. + +#### Version upgrades are different + +The updates discussed here is to keep your Ubuntu install fresh and updated. It doesn’t cover the [version upgrades][17] (for example upgrading Ubuntu 16.04 to 18.04). + +[Ubuntu version][18] upgrades are entirely a different thing. It updates the entire operating system core. You need to make proper backups before starting this lengthy process. + +### Conclusion + +I hope you liked this tutorial on updating the Ubuntu system and you learned a few new things. + +If you have any questions, please fee free to ask. If you are an experienced Linux users and have some tip that can make this tutorial more useful, please share it with the rest of us. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/update-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.ubuntu.com/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/how-to-update-ubuntu.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/ubuntu-shortcuts/ +[4]: https://www.ubuntu.com/download/server +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubunt-1.jpeg?resize=800%2C357&ssl=1 +[6]: https://itsfoss.com/apt-get-linux-guide/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubunt-2.jpeg?ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-via-GUI-1.jpeg?resize=800%2C250&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-via-GUI-2.jpeg?resize=800%2C250&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-GUI-3.jpeg?resize=800%2C365&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/install-update-ubuntu-1.jpg?resize=800%2C450&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/installing-updates-ubuntu.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/installing-updates-ubuntu-2.jpeg?ssl=1 +[14]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[15]: https://www.ubuntu.com/livepatch +[16]: https://www.cyberciti.biz/faq/howto-live-patch-ubuntu-linux-server-kernel-without-rebooting/ +[17]: https://itsfoss.com/upgrade-ubuntu-version/ +[18]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ From 133c99a824e911cad0a304b298687ad76d72b28a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 13:44:18 +0800 Subject: [PATCH 0897/1143] Update 20171129 TLDR pages Simplified Alternative To Linux Man Pages.md --- ...71129 TLDR pages Simplified Alternative To Linux Man Pages.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md index afa981df46..749f2647dc 100644 --- a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md +++ b/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md @@ -1,3 +1,4 @@ +wxy is translating TLDR pages: Simplified Alternative To Linux Man Pages ============================================================ From da9c6f228a5347e1257997bd07548d2b99df18b8 Mon Sep 17 00:00:00 2001 From: WangYue <815420852@qq.com> Date: Mon, 17 Dec 2018 14:20:48 +0800 Subject: [PATCH 0898/1143] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=20=2020180826=20How=20to=20Install=20and=20Use=20FreeDOS=20on?= =?UTF-8?q?=20VirtualBox.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译 20180826 How to Install and Use FreeDOS on VirtualBox.md --- .../20180826 How to Install and Use FreeDOS on VirtualBox.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md b/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md index 8ba7db5139..f6d36e718b 100644 --- a/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md +++ b/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md @@ -1,3 +1,5 @@ +WangYueScream Tanslating +--------------- How to Install and Use FreeDOS on VirtualBox ====== This step-by-step guide shows you how to install FreeDOS on VirtualBox in Linux. From 30c0fdd0aded2040b298a06839573fdaec6f03c0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 15:05:10 +0800 Subject: [PATCH 0899/1143] Update 20171129 TLDR pages Simplified Alternative To Linux Man Pages.md --- ...mplified Alternative To Linux Man Pages.md | 74 ++++++++----------- 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md index 749f2647dc..fe9d2cdd6a 100644 --- a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md +++ b/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md @@ -1,93 +1,81 @@ -wxy is translating -TLDR pages: Simplified Alternative To Linux Man Pages -============================================================ +TLDR 页:Linux 手册页的简化替代品 +============== - [![](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu-640x360.jpg "tldr page ubuntu")][22] - - Working on the terminal and using various commands to carry out important tasks is an indispensable part of a Linux desktop experience. This open-source operating system possesses an [abundance of commands][23] that **makes** it impossible for any user to remember all of them. To make things more complex, each command has its own set of options to bring a wider set of functionality. +[![](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu-640x360.jpg "tldr page ubuntu")][22] -To solve this problem, [Man Pages][12], short for manual pages, were created. First written in English, it contains tons of in-depth information about different commands. Sometimes, when you’re looking for just basic information on a command, it can also become overwhelming. To solve this issue,[ TLDR pages][13] was created. +在终端上使用各种命令执行重要任务是 Linux 桌面体验中不可或缺的一部分。Linux 这个开源操作系统拥有[丰富的命令][23],使得任何用户都无法记住所有这些命令。而使事情变得更复杂的是,每个命令都有自己的一组带来丰富的功能的选项。 - _Before going ahead and knowing more about it, don’t forget to check a few more terminal tricks:_ +为了解决这个问题,人们创建了[手册页][12],(手册 —— man 是 manual 的缩写)。首先,它是用英文写成的,包含了大量关于不同命令的深入信息。有时候,当你在寻找命令的基本信息时,它就会显得有点庞杂。 为了解决这个问题,人们创建了[TLDR 页][13]。 -* _**[Watch Star Wars in terminal ][1]**_ +### 什么是 TLDR 页? -* _**[Use StackOverflow in terminal][2]**_ +用于 Linux / Unix 的 TLDR 页的 GitHub 仓库将其描述为简化的、社区驱动的手册页的集合。在实际示例的帮助下,努力让使用手册页的体验变得更简单。如果还不知道,TLDR 取自互联网的常见俚语:太长没读Too Long Didn’t Read。 -* _**[Get Weather report in terminal][3]**_ +如果你想比较一下,让我们以 `tar` 命令为例。 通常,手册页会超过 1000 行。它是一个归档实用程序,经常与 `bzip` 或 `gzip` 等压缩方法结合使用。看一下它的手册页: -* _**[Access Google through terminal][4]**_ +[![tar man page](https://fossbytes.com/wp-content/uploads/2017/11/tar-man-page.jpg)][14] -* [**_Use Wikipedia from command line_**][7] +而另一方面,TLDR 页面让你只是浏览一下命令,看看它是如何工作的。 `tar` 的 TLDR 页面看起来像这样,并带有一些方便的例子——你可以使用此实用程序完成的最常见任务: -* _**[Check Cryptocurrency Prices From Terminal][5]**_ +[![tar tldr page](https://fossbytes.com/wp-content/uploads/2017/11/tar-tldr-page.jpg)][15] -* _**[Search and download torrent in terminal][6]**_ +让我们再举一个例子,向你展示 TLDR 页面为 `apt` 提供的内容: -### What are TLDR pages? +[![tldr-page-of-apt](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-of-apt.jpg)][16] -The GitHub page of TLDR pages for Linux/Unix describes it as a collection of simplified and community-driven man pages. It’s an effort to make the experience of using man pages simpler with the help of practical examples. For those who don’t know, TLDR is taken from common internet slang _ Too Long Didn’t Read_ . +如上向你展示了 TLDR 如何工作并使你的生活更轻松,下面让我们告诉你如何在基于 Linux 的操作系统上安装它。 -In case you wish to compare, let’s take the example of tar command. The usual man page extends over 1,000 lines. It’s an archiving utility that’s often combined with a compression method like bzip or gzip. Take a look at its man page: +### 如何在 Linux 上安装和使用 TLDR 页? - [![tar man page](https://fossbytes.com/wp-content/uploads/2017/11/tar-man-page.jpg)][14] On the other hand, TLDR pages lets you simply take a glance at the command and see how it works. Tar’s TLDR page simply looks like this and comes with some handy examples of the most common tasks you can complete with this utility: - - [![tar tldr page](https://fossbytes.com/wp-content/uploads/2017/11/tar-tldr-page.jpg)][15] Let’s take another example and show you what TLDR pages has to offer when it comes to apt: - - [![tldr-page-of-apt](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-of-apt.jpg)][16] Having shown you how TLDR works and makes your life easier, let’s tell you how to install it on your Linux-based operating system. - -### How to install and use TLDR pages on Linux? - -The most mature TLDR client is based on Node.js and you can install it easily using NPM package manager. In case Node and NPM are not available on your system, run the following command: +最成熟的 TLDR 客户端基于 Node.js,你可以使用 NPM 包管理器轻松安装它。如果你的系统上没有 Node 和 NPM,请运行以下命令: ``` sudo apt-get install nodejs - sudo apt-get install npm ``` -In case you’re using an OS other than Debian, Ubuntu, or Ubuntu’s derivatives, you can use yum, dnf, or pacman package manager as per your convenience. +如果你使用的是 Debian、Ubuntu 或 Ubuntu 衍生产品以外的操作系统,你可以根据自己的情况使用`yum`、`dnf` 或 `pacman`包管理器。 -Now, by running the following command in terminal, install TLDR client on your Linux machine: +现在,通过在终端中运行以下命令,在 Linux 机器上安装 TLDR 客户端: ``` -sudo npm install -g tldr +sudo npm install -g tldr ``` -Once you’ve installed this terminal utility, it would be a good idea to update its cache before trying it out. To do so, run the following command: +一旦安装了此终端实用程序,最好在尝试之前更新其缓存。 为此,请运行以下命令: ``` tldr --update ``` -After doing this, feel free to read the TLDR page of any Linux command. To do so, simply type: +执行此操作后,就可以阅读任何 Linux 命令的 TLDR 页面了。 为此,只需键入: ``` tldr ``` - [![tldr kill command](https://fossbytes.com/wp-content/uploads/2017/11/tldr-kill-command.jpg)][17] +[![tldr kill command](https://fossbytes.com/wp-content/uploads/2017/11/tldr-kill-command.jpg)][17] -You can also run the following help command to see all different parameters that can be used with TLDR to get the desired output. As usual, this help page is also accompanied with examples. +你还可以运行其[帮助命令](https://github.com/tldr-pages/tldr-node-client),以查看可与 TLDR 一起使用的各种参数,以获取所需输出。 像往常一样,这个帮助页面也附有例子。 -### TLDR web, Android, and iOS versions +### TLDR 的 web、Android 和 iOS 版本 -You would be pleasantly surprised to know that TLDR pages isn’t limited to your Linux desktop. Instead, it can also be used in your web browser, which can be accessed from any machine. +你会惊喜地发现 TLDR 页不仅限于你的 Linux 桌面。 相反,它也可以在你的 Web 浏览器中使用,可以从任何计算机访问。 -To use TLDR web version, visit [tldr.ostera.io][18] and perform the required search operation. +要使用 TLDR Web 版本,请访问 [tldr.ostera.io][18] 并执行所需的搜索操作。 -Alternatively, you can also download the [iOS][19] and [Android][20] apps and keep learning new commands on the go. +或者,你也可以下载 [iOS][19] 和 [Android][20] 应用程序,并随时随地学习新命令。 - [![tldr app ios](https://fossbytes.com/wp-content/uploads/2017/11/tldr-app-ios.jpg)][21] +[![tldr app ios](https://fossbytes.com/wp-content/uploads/2017/11/tldr-app-ios.jpg)][21] -Did you find this cool Linux terminal trick interesting? Do give it a try and let us know your feedback. +你觉得这个很酷的 Linux 终端技巧很有意思吗? 请尝试一下,让我们知道您的反馈。 -------------------------------------------------------------------------------- via: https://fossbytes.com/tldr-pages-linux-man-pages-alternative/ -作者:[Adarsh Verma ][a] -译者:[译者ID](https://github.com/译者ID) +作者:[Adarsh Verma][a] +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 788010ea5e8aa93456e137f3ff9e01ce9ff0f9b3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 15:09:17 +0800 Subject: [PATCH 0900/1143] Rename sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md to translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md --- ...171129 TLDR pages Simplified Alternative To Linux Man Pages.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md (100%) diff --git a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md similarity index 100% rename from sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md rename to translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md From 25bc7ad4d7142da74c2645f1cd4adfa6387a20de Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 15:25:14 +0800 Subject: [PATCH 0901/1143] Rename translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md to translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md --- ...71129 TLDR pages Simplified Alternative To Linux Man Pages.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/{tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md => tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md} (100%) diff --git a/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md similarity index 100% rename from translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md rename to translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md From f4effae7c02eb56b6f80d5954c227255c8a08ead Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 15:32:40 +0800 Subject: [PATCH 0902/1143] Rename translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md to translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md --- ...71129 TLDR pages Simplified Alternative To Linux Man Pages.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/{tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md => tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md} (100%) diff --git a/translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md similarity index 100% rename from translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md rename to translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md From 2c150fd3a75a2dcc560698dff7c82b276211a573 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Dec 2018 16:13:19 +0800 Subject: [PATCH 0903/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Linux=20on=20th?= =?UTF-8?q?e=20Desktop:=20Are=20We=20Nearly=20There=20Yet=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on the Desktop- Are We Nearly There Yet.md | 344 ++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md diff --git a/sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md b/sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md new file mode 100644 index 0000000000..2f3b046362 --- /dev/null +++ b/sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md @@ -0,0 +1,344 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Linux on the Desktop: Are We Nearly There Yet?) +[#]: via: (https://blog.dxmtechsupport.com.au/linux-on-the-desktop-are-we-nearly-there-yet/) +[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) + +Linux on the Desktop: Are We Nearly There Yet? +====== + +![][1] + +The numbers are pretty stark: Linux might be the backbone of everything from embedded devices to mainframes and super computers. But it has just a 2% share of desktops and laptops. + +It seems the only way to get most people to even touch it is to rip away everything you recognise as Linux to rebuild it as Android. + +Until recently, I was in the 98%. I honestly wasn’t even conflicted. I used Linux most days both for work and for hobbies – but always in the cloud or on one of those handy little project boards that are everywhere now. For my daily driver, it was Windows all the way. + +I guess what’s kept me with Windows so long is really that it’s just been good enough as a default option that I haven’t been prompted to even think about it. Which, to be fair, is a great quality in an operating system. + +The last time I tried a dual boot Linux/Windows setup was about 15 years ago. I was using Unix at university, and was quite attracted to the idea of free and open source software, so I decided to give it a go. + +This was back when, if you wanted to install Linux, you went to the newsagent and bought a magazine that had a CD-ROM on the front cover. I don’t exactly remember what distro it was – probably something like Slackware or Red Hat. + +I got it running, poked around a bit and played some of the included games, which were relatively primitive but still quite a lot of fun. After that, I wasn’t sure what I was supposed to do with it. I never managed to connect it to the internet. + +For a number of years, I had no say in my operating system: work was buying my computer for me. I was a junior developer at a small software company that wrote for Windows machines, so it made sense that it would be a Windows laptop. That was easy to arrange because that’s how they came anyway. + +When I left this role to work for myself, I kept doing the laptop thing; they’re so convenient when you’re renting and it’s great to work outside on a lovely day. Whenever I bought a new one, it would come with Windows on it, which was great because that’s what I used. + +I’ve managed to avoid most of the security headaches in Windows. I got a nasty rootkit about 7 years ago and it’s all been smooth sailing since. + +### I Only Want the Command Line When I Want it + +A big misgiving about Linux as a main OS is that it never really seemed like it was a total GUI operating system. Whatever desktop environment you used, it was just a nice little place to run your web browser, media player, and maybe an IDE or something. As soon as it’s time to install or configure anything, you opened a terminal window. + +I’m okay with the command line – up to a point. You definitely want it for “nerd stuff” like server configuration or deploying a website. + +But when I’m doing “normie stuff”, I’m like most people: I’d really rather just point and click. I want my mind to be on the actual task, not on what command I need to make it happen. + +Using a Windows laptop felt like I could have the best of both worlds. Whenever I needed a bash shell, I’d just ssh into a Linux machine and do it from there. + +Even when I started doing web tasks that required a bash shell on my local machine, that was no problem. Microsoft [had sorted one out for me][2] and it just worked. + +In the end, what made me install [Ubuntu Studio][3] was not any intent of replacing Windows. I had just started messing around with Linux synthesizers on my home theatre rig and was curious to see what I could do with these on an x86 machine. + +### Linux Very Quickly Became My Daily Driver + +The first thing to really hit me was just how fast this is. It boots quick and programs just open. This makes it so much nicer as a place to get things done. + +So it made sense to do my web browsing and word processing here as well. Booting back into the Windows partition for that would just be a drag. + +I guess, up until this point, I’ve just taken it for granted as an immutable fact of life that laptops gradually slow down as they age and every few years it will be time for a new one. Every time Microsoft pushes out an update, it gets a little slower. + +So it was that my cheap 4GB machine from 2015 felt like it was nearing the end. In my head, I was already pondering firewood and a longboat. + +I suppose when you have a monopoly operating system, nudging your customers toward buying that new machine a little bit earlier might even help move a few more licenses. + +I accepted that for a long time. I now thoroughly resent it. + +I mean, given what I’m doing – web browsing, word processing, editing text files, opening ssh terminals, some very light image editing – I honestly reckon a 3 year old machine should be able to keep up. These are all tasks you could do in the 90s. It’s not like I’m playing the latest Battlefield while rendering the next Star Wars. + +With Windows 10, my laptop was struggling with simple tasks. There seemed to be no way of avoiding the expense and hassle of getting a new one. After switching to Linux, I instead spent a pittance on another 4GB memory module for the spare slot. + +I reckon I can at least get another year of use out of this machine now. This in itself has made changing worthwhile. + +#### A Seamless Desktop Experience + +Ubuntu studio comes with the [xfce][4] desktop. The default design is intuitive and beautifully styled with kind of a cyberpunk motif. I haven’t felt any desire to mess with the default theme, except to change the background image. + +I love how simple the interface is. All your programs and settings are there in the menu where you might look for them. By comparison, the Windows 10 desktop seems to always grow more elaborate and crammed with obscurities. + +I can’t really say how much of my enthusiasm for this desktop is the ease of use and how much is simply down to how much more snappy and responsive it is – you experience these things together. + +#### A GUI You Can Set Your Watch to (Literally) + +So far, it seems like you could actually do a lot with this without ever going near the command line. They’ve actually gotten it to a point where you don’t need to edit text files to connect to wi-fi or set your timezone. + +I’d be lying if I said I wasn’t using the command line a bit more. But that’s only because an Ubuntu terminal window is also a great ssh client. For a couple of weeks I was using nano as my main text editor, but I decided that a mouse is actually pretty handy for navigating and selecting text. + +For the great mass of people who aren’t that into nerd stuff, I don’t think you would need the terminal at all. + +#### The Same Software, Only Better + +One thing that I think will help open Linux up to a much larger audience is the graphical front end for the package manager. It’s honestly not much different to browsing apps on my Android phone. + +I’ve found myself using both the graphical interface and the command line to install software. The graphical interface is great for browsing, while the command line makes it super simple when you already know what you want to install. + +That’s just me though. Most people don’t know how to run a package manager from the command line because they’ve never had to learn. The good news for them is that they’re not obliged to – you can get by fine with just the graphical interface. + +I guess it helps that I was already using so much open source software on Windows: [Firefox][5] for web browsing, [GIMP][6] to format images for web use, [OpenOffice][7] for word processing and the occasional spreadsheet. Moving to Linux has meant still using much the same software. I’ve switched from OpenOffice to [LibreOffice][8] and have barely noticed the difference. + +Installing software from the repositories means that it’s actually easier than on Windows, because I’m not having to look up a bunch of websites. Closed source applications like [Dropbox][9] and [Slack][10] were no hassle to install and work the same as always. + +Thanks to the package manager, updates and patches are now automated too. On Windows, Firefox knew to update itself, but other software expected you to download and install new versions manually, and I inevitably couldn’t be bothered + +#### Smooth Operating System Updates + +Every so often, when you boot Ubuntu Studio, there’s a little window that politely tells you that you have some updates to install. If you decide you want to install them right now, it will take a matter of minutes. You totally get on with other things in the meantime. Of course, if you absolutely need all your system resources, you’re not forced to run it at all until you’re ready. + +It’s a nice change. Windows updates, by contrast, show up out of nowhere like a bank robber, yelling, waving an Uzi and marching you to a big blue update screen for as long as it has to take. + +Having not booted into my Windows partition for about a month now, I’m dreading how much of it would have piled up and how long they will take to get through. And the longer I leave it, the worse it’s going to get. So maybe I’ll just never go back. + +All in all, I’m very happy to now use Linux as my main OS. I could almost become a Linux evangelist. + +Except for one thing: + +### This Was an Absolute Pig to Install + +I’m used to an easy install with Linux. You flash an SD card or buy a VPS, you’re up and running in minutes. Running a virtual machine on your own metal can take a little longer. But not a lot. + +Installing Linux on a partition of my laptop was a Biblical effort. It took 6 days to get it to boot. + +How could it take so long? Well, it starts with super slow download links: 7 to 13 hours for an image. Then there was the hardware support. Most time consuming of all were the mystery problems and all the time sunk trying to diagnose and fix them. + +What had got me interested was playing around with a bit of audio. [KXStudio][11] and [AVLinux][12] seemed to be the popular choices. Both belong to the Ubuntu/Debian family, which is the style of Linux I know. + +KXStudio booted fine from the USB stick. But it didn’t like my wireless adapter. The fix for this seemed to involve compiling something from github. This was a bother; I needed a working wireless adapter to connect to the internet. + +I figured it might be possible to download either a binary or the source to my Windows partition so I could install it without an internet connection. But after much searching and no clear instructions, I was stuck. + +So I downloaded AVLinux and flashed it to a USB stick. The installer connected to the internet fine, so I installed the damn thing, only to find that the partition wouldn’t boot and then neither would the USB stick. Also, I was locked out of the UEFI. + +I did the only logical thing you can do when you brick your work machine: panic. Then I remembered that I had a live boot restoration utility on a USB stick stashed away somewhere for precisely this occasion. + +I then tried Ubuntu Studio 18.10. The Live Boot worked fine and even connected to the internet. So I installed it. This seemed to go off without a hitch. + +When I tried to boot into it though, I just got a blank screen. I spent a while trying various kernel parameters like “nomodeset”, but with no luck. + +A helpful chap on Reddit recommended I try just bog standard Ubuntu, explaining to me that it’s easy enough to swap in a low-latency kernel once it’s installed. + +So it was that I tried Ubuntu 18.04 and 18.10, then Ubuntu Studio 18.04.. then again and again, trying slightly different settings on the installer, all in vain. + +Having made so many attempts and spent so much time trying to get these things to work, I was – reluctantly – having to face the possibility that perhaps a distribution based on Debian just wasn’t going to work on my machine. + +#### Fedora Jam Worked First Time + +I had no trouble installing this distribution. The installer was super simple and it just worked on my first try. + +It didn’t boot much faster than Windows 10, but once you were in the desktop it was quite snappy and responsive. + +Like Ubuntu Studio, this also has a graphical front end for the package manager. It doesn’t quite have the same smooth “app store” experience though. If you’re already familiar with command line package managers, it’s pretty easy, but I’m not sure how intuitive it would be for everyone else. + +I quickly came to discover that Fedora doesn’t have anything like the kind of software library that Ubuntu and Debian has. Or at least, that’s how it was for the software I was interested. I know that it’s often still possible to install things that aren’t in the repositories – but we’re talking ease of use here. Having to compile it yourself is not an ease of use. + +For web browsing and word processing, this was a great operating system. But when it came to tinkering with audio, I couldn’t even get [JACK][13] to start. + +So, after a few days, it was time to move on. + +All in all, even though I decided Fedora wasn’t really from me, I still rate it somewhat. There’s a very good workstation there for ordinary office work. And I can well believe the claims that it’s a great development environment – especially having the entire Red Hat ecosystem downstream of your OS. + +Still, the hunt was back on. A friend told me how much he liked using [Linux Mint][14]. I’d heard of it before, but knew little about it. I was intrigued when my friend explained it was based on Ubuntu because I’d really missed those repositories. I decided to give it a go. + +#### Linux Mint Was Excellent + +As near as I can tell, Linux Mint is basically just Ubuntu with a few tweaks to make it really user friendly right out of the box. + +The big one is the desktop environment Cinnamon. This is clearly very influenced by Windows XP – a fine OS to pay tribute to in my opinion. It’s probably even more beginner-friendly than the default desktop on Ubuntu Studio. + +I liked Linux Mint and decided to install it. The fly in the ointment though was that the dreaded wireless adapter problem had reemerged. This was a showstopper for me earlier. But by this point I was willing to consider building a temporary wireless bridge from bits and pieces I had lying around so that I could have an internet connection to try to get the right driver. + +I never got that far though. When I tried to, the installer kept aborting when it couldn’t install the boot loader. I tried it again and again and the same thing kept happening. + +#### Back to Ubuntu Studio + +I decided to go back to Ubuntu Studio 18.10. I’d at least gotten this to install before, even if it booted to a blank screen. I figured that there’d be some answer to this problem somewhere, if I only looked hard enough. + +I went and installed it again, expecting to be faced with the same problem. But this time it just worked. + +I’m pretty glad that it worked in the end. But I still have absolutely no idea what was going wrong or what I did differently to get it to work that one last time. + +### Should it Really Be This Difficult Even for Nerds? + +I admit it’s the other dudes in [DXM Tech Support team][15] who really know drivers and hardware. My own skills are mostly with web stuff. + +But still, I’d like to think I can hold my own a bit. I wrote my first code at the age of 7, I’ve worked as a software developer before, I can use a bash shell a bit, and installing weird operating systems to play 30 year old video games is my idea of a fun Sunday afternoon. + +And I reckon the things I was juggling a few things here that might be a bit beyond any kind of mass audience: things like kernel parameters, endlessly using Gparted and efibootmgr to clean up failed installs, or building my own wireless bridge. + +Which is all just a longer way of saying that, while I’m not exactly Linus Torvalds, I can do a thing or two here and there with a computer. + +But what if you actually are Linus Torvalds? + +It turns out you also think the install is disgusting: + + + +My favourite bit here is in the middle where the Debian fan approaches the microphone for what’s meant to be a question. It was totally within her power to just ask him what the difficulty was. Instead she completely dismisses his experience and tells him he should use her favourite Linux instead. + +I doubt that she actually meant to be that much of a dick. It’d be more that she’s such a fan of the software that it’s difficult for her to see any complaint as a genuine area for improvement. For her, it has to be a user education problem. + +You can literally have the whole damn thing named after you and still have to put up with that crap. No wonder he can be a bit cranky. + +### It’s the Little Things Too + +To install Linux, you have to first run all sorts of errands to prepare your machine. + +You need the Windows 10 Disk Management tool to resize your C partition, delve into the UEFI to change some settings, install an image writer to burn the installer image to a USB stick, that sort of thing. Often you’re presented with multiple alternatives for each of these steps. + +My suspicion is that each of these things feels so trivial to most Linux users that it just doesn’t occur to them that it’s a real point of friction for most people. + +Using a different tool for each task is very much in keeping with the [UNIX Philosophy][16]: any one thing should do just one thing and do it well. + +That’s actually excellent for anyone who uses a computer to build things. You have all these lego bricks that you can arrange however makes sense. You can totally just run a Python script, grep the most relevant bits, then make the output presentable by piping it to [cowsay][17]. + +But not everyone’s ready for cowsay. Joe Average has never even heard of UEFI or partitioning and he honestly shouldn’t have to. + +So this might be the wrong place for a rigid application of the UNIX philosophy. It greatly adds to the number of steps and that’s always going to cut down on the number of people who make it to the end. + +Even if you’ve always been amazing at computers, I think you can probably think of something else that once seemed too difficult. For me, that was cooking Indian recipes. + +That’s been my favourite thing to eat ever since I was a kid. But every time I looked at a recipe, it was just line after line of ingredients I didn’t really understand. So I made do with the jars and recipe kits. + +When I finally decided to actually give it a go, I realised the ingredients list was so long because of all the spices I’d never cooked with before. It turned out that the most difficult part of using them was bringing them home from the Indian grocers. Putting them in the pan added mere seconds to the actual cooking. + +Pretty easy, right? And yet, until I knew that, it was enough to stop me even trying, literally for years. + +That’s how this stuff works. Every unfamiliar step you add to a process brings people closer to thinking “hmm, that’s actually a bit too involved for me” – even if those extra steps are, individually, trivial. + +Linux does this to potential new users every day. + +The worst thing about adding this to the installation is that it’s all front loaded right at the start of someone’s decision to try Linux. If they don’t make it through the install, then none of the rest of it comes into play. + +### What the Install Should Look Like + +A big part of what sucks about an unsuccessful Linux install is the amount of time you spend and the number steps you take to reach a point of failure. + +So what would be cool is a lightweight installation tool that began with a hardware scan to give you meaningful feedback on what’s supported, what’s unsupported, and what needs further attention. + +Then, if it’s all good to go, it could download the live boot image, burn it to a USB stick, take care of the UEFI settings and so on. Then, when you decide you want to install it, it could also take care of defragmenting and resizing the C partition. + +It’s a thought anyway. + +### It’s Part of a Bigger Picture + +Addressing the install nightmare won’t make anyone who wasn’t. It’s more about boosting the [conversion rate][18] of those already interested to actual users. + +Off the top of my head, here are some of the other big things that stop people switching: + + * **Gaming:** A lot of the people who are most comfortable tinkering with drivers and the UEFI became that way because they’re really into playing the latest games. + +Linux is more than ok for casual gamers. For console gamers, like me, it’s an irrelevance. But if playing the best and latest games on PC is hugely important to you, there’s no contest which platform has the best library. + +There is an interesting push by the guys behind Steam to turn this around. There’s really no reason why Linux couldn’t be a major platform for gaming – not everyone realises that [the world’s best-selling console runs FreeBSD][19], a close cousin of Linux. + +But even if this starts to take off, it will be a while before hardcore gamers start moving away from Windows. + + * **Business Realities:** The difficult installation matters much less in a professionally managed IT environment. But these are also the places where a need to preserve existing systems, configurations and procedures can complicate any change. Even just migrating from one version of Windows to another has pain points. + +On top of this, the business owners and senior managers with the final say tend to be very busy and preoccupied with a dozen other challenges, and fairly reluctant to consider anything that seems weird and unfamiliar. This makes inertia hard to shift. + +The IT staff who might lobby for such a move would be understandably wary of blame for any difficulties that arise with Linux, in a way they won’t be for difficulties with Windows. + + * **Home Networking:** This is one spot where Windows still is much more user friendly. Your Windows machines are generally pretty good at detecting each other on the LAN and then appearing in Windows Explorer. From there it’s pretty easy to decide what to make public using a GUI interface. + +To do the same thing on Linux, you’re installing servers for various protocols and configuring them from the command line or in a text editor. Which is actually a lot less difficult than it first looks if you’re willing to roll your sleeves up. But, if we’re talking about going mainstream, then realistically most people will be repelled by this at a glance. + +Compared to the difficulty of the install, I think this is a relatively minor pain point. For the average home user, so long as they can run their software and connect to the internet, they’re pretty happy. And from what I’ve both seen and heard of DIY Windows networking jobs in the workplace, part of me thinks it’s a bad idea to democratise this too far. + +But it’s fairly normal for home users to want to copy things across a network to, say, a home theatre machine and they should be able to. + + * **Social Proof and Branding:** Properly covering all the social proof and branding problems Linux has with ordinary people would be a lengthy article in its own right. + +The basic idea of [social proof][20] is that humans, as social animals, are highly influenced by what everyone. That’s a highly rational instinct in a paleolithic environment, where there is an obvious drawback to A/B testing all the things that might kill you. It also suits us in our modern world that throws vastly more decisions at us than anyone has the time or mental resources. + +But being on the wrong side of it means you’re significantly penalised simply for not already being popular. + +On top of this, to the extent that people are aware of Linux, it’s mostly as an operating system for a technical elite. + + + + +If you think about it, the difficulty of the install feeds back into most of these. Definitely, a larger user base would make games developers care more about the platform. Hypothetically, big titles that are properly optimised for a lighter weight operating system might run better. This is a huge drawcard for hardcore gamers. + +Because of the legacy system issues of even fairly small businesses, one easier path into the workplace would be to get the business owner while it’s still a one person show. + +A large number of new businesses are started by parents of young children, who are often struggling to afford everything. And a great many freelancers and solo entrepreneurs go through feast and famine periods often enough that they’ve learned to be protective of their cash buffers. + +These are all people who’d rather get a couple more years out of a machine than be made to buy a new one. It’s a good use case for Linux. So long as they can actually install it. + +And creating social proof means building a visibly larger use base. That will happen easier if more interested new users can install successfully. + +### Is it Time for a Branded Linux Machine? + +The easiest installation is one that’s already done. So perhaps it’s time for off-the-shelf Linux desktops and laptops. + +These exist already of course. Big PC makers like Dell have a Linux lineup, while some boutique outfits are exclusively Linux in their product offering. + +I’m picturing something kinda different though: an officially branded consumer product by one of the more user friendly distributions, pitched not tech professionals but to a mass market audience. Something that could be reviewed next to Apple and Samsung products. + +The desktop environment is ready for a broader audience. The software library is quite excellent for anyone with ordinary computing needs – and with a good graphical front end, it’s pretty easy to find and install software. And because Linux is so much gentler on hardware requirements, there’s some real scope to offer some solid bang for back here. + +I expect most open source developers have had no experience of and even less interest in. So what they could do is license the brand and a subdomain on their website for a given time period to someone already in the business of making and selling computers. + +For the sake of the brand, it’d be important to license this to someone you could trust to do a good job of building a decent machine. That would take care and attention, but I don’t think it’s impossible. + +As well as providing a small income stream to developers, and growing the user base through direct sales, the ordinary publicity effort to promote these products would help make Linux visible as a thing that the mass market could use. + +I’m just spitballin’ really. But if anyone likes this idea, they’re welcome to it. + +### It’s More a Matter of When than If + +Maybe it seems like I spent a lot of this article talking down Linux on the desktop. The wider truth though is that I’ve voted with my feet. If I don’t stick with Ubuntu Studio forever, it will be because I went to a different flavour of Linux. + +I really don’t want to go back to Windows if I can avoid it. + +There are certainly still big obstacles to bringing Linux to a wider audience. But I can’t see why they wouldn’t be overcome. + +-------------------------------------------------------------------------------- + +via: https://blog.dxmtechsupport.com.au/linux-on-the-desktop-are-we-nearly-there-yet/ + +作者:[James Mawson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/ +[b]: https://github.com/lujun9972 +[1]: https://blog.dxmtechsupport.com.au/wp-content/uploads/2018/11/Ubuntu-Desktop-1024x576.png +[2]: https://docs.microsoft.com/en-us/windows/wsl/about +[3]: https://ubuntustudio.org/ +[4]: https://www.xfce.org/ +[5]: https://www.mozilla.org/en-US/firefox/ +[6]: https://www.gimp.org/ +[7]: https://www.openoffice.org/ +[8]: https://www.libreoffice.org/ +[9]: https://www.dropbox.com/ +[10]: https://slack.com/ +[11]: https://kxstudio.linuxaudio.org/ +[12]: http://www.bandshed.net/avlinux/ +[13]: http://jackaudio.org/ +[14]: https://linuxmint.com/ +[15]: https://dxmtechsupport.com.au/about +[16]: https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html +[17]: https://medium.com/@jasonrigden/cowsay-is-the-most-important-unix-like-command-ever-35abdbc22b7f +[18]: https://www.wordstream.com/conversion-rate +[19]: http://www.extremetech.com/gaming/159476-ps4-runs-orbis-os-a-modified-version-of-freebsd-thats-similar-to-linux +[20]: https://conversionxl.com/blog/is-social-proof-really-that-important/ From 27ff4e67e416504fa819f1fad53016e8fedc937f Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Dec 2018 16:23:28 +0800 Subject: [PATCH 0904/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20Things=20In?= =?UTF-8?q?fluenza=20Taught=20Me=20About=20the=20Evolution=20of=20the=20De?= =?UTF-8?q?sktop=20Computer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t the Evolution of the Desktop Computer.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md diff --git a/sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md b/sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md new file mode 100644 index 0000000000..c1e7f98200 --- /dev/null +++ b/sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 Things Influenza Taught Me About the Evolution of the Desktop Computer) +[#]: via: (https://blog.dxmtechsupport.com.au/5-things-influenza-taught-me-about-the-evolution-of-the-desktop-computer/) +[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) + +5 Things Influenza Taught Me About the Evolution of the Desktop Computer +====== + +The flu took me completely out of action recently. It hit me pretty hard. + +And, as tends to happen with these things, I ended up binge watching more TV and movies in two weeks hidden under a blanket than in 2 years as a member of wider society. + +In the most delirious moments, the vicious conspiracy of fever and painkillers gave me no choice but to stick to bad 80s action movies. + +When I was a little more lucid, though, I got really stuck into some documentaries around the early days of desktop computing: Computerphile episodes, Silicon Cowboys, Micro Men, Youtube interviews, all sorts of stuff. + +Here are the big things that have stuck with me from it: + +### The Modern Computing Industry was Almost Entirely Built by Young Hobbyists + +There was an established computing industry in the 1970s – but these companies played very little direct role in what was to come. + +Xerox’s Palo Alto Research Centre had an important role to play in developing desktop technologies – with absolutely zero intention of ever commercialising anything. The entire thing was funded entirely from Xerox’s publicity budget. + +But for the most part, computers were sold to universities and enterprises. These were large, expensive machines guarded by a priesthood. + +The smallest and most affordable machines in use here were minicomputers like the DEC PDP-11. “Mini” is, of course, a relative term. These were the size of several fridges and cost several years worth of the average wage. + +So what if you wanted a computer of your own? Were you totally stranded? Not quite. You could always buy a bunch of chips and build and program the whole damn thing yourself. + +This had become increasingly accessible, thanks to the development of the microprocessor, which condensed the separate components of a CPU into a single chip. As the homebrew computer scene grew, hobby electronics companies started offering kits. + +It was out of this scene that desktop computing industry actually grew – both Apple and Acorn computers were founded by hobbyists. Their first commercial products evolved from what they’d built at home. + +Businesses that catered to the electronics hobbyist market, like Tandy and Radio Shack, were also some of the earliest to enter the market. + +### Things Changed More Radically from ’77 – ’87 than the Next 3 Decades Combined + +The first desktop computers were a massive leap forward in terms of bringing computing to ordinary people, they were still fairly primitive. We’re talking beeps, monochrome graphics, and a 30 minute wait to load your software from cassette tape. + +And the only way to steer it was from the command line. It’s definitely much more accessible than building and programming your own computer from scratch, but it’s still very much in nerd territory. + +By 1987, you’ve got most of what we’re familiar with: point and click interfaces, full colour graphics, word processors, spreadsheets, desktop publishing, music production, 3D gaming. The floppy drives had made loading times insignificant – and some machines even had hard drives. + +Your mum could use it. + +Things still got invented after that. The internet has obviously been a game changer. Screens are completely different. And there are any number of new languages. + +For the most part, though, desktop computers came together in a decade. Since then, we’ve just been making better and better versions of the same thing. + +### Bill Gates Really Was Kind of a James Bond Villain + +Back in the ’90s, it seemed a fairly ubiquitous part of computer geek culture that Bill Gates was kind of a dick. In magazines, on bulletin boards and the early internet, it was just taken for granted that Microsoft dominated the market not with a superior product but with sharp business practices. + +I was too young to really know if that was true, but I was happy to go along with it. It turns out that there was actually plenty of truth in that. An MS-DOS PC was hardly the best computer of the 1980s. + +The [Acorn Archimedes][1], for instance, had the world’s fastest processor in a desktop computer, many times faster than the 386, and an operating system so far ahead of its time that Microsoft shamelessly plagiarised it 8 years for Windows 95. + +And the Motorola 68000 series of CPUs used in many machines such as the Apple Macintosh and Commodore Amiga was also faster, and were vastly better for input/output intensive work such as graphics and sound. + +So how did Microsoft win? + +Well they had a head start piggybacking with IBM, who very successfully marketed the PC as a general purpose business computer. At this point, the PC was already one of the first platforms that many software developers would write for. + +Then, as what was then known as the “IBM clone” market began and grew, Bill Gates was very aggressive about getting MS-DOS onto as many machines as possible by licensing it on very generous terms to companies like Compaq and Amstrad. This was a short term sacrifice of profits in pursuit of market share. It also helped the PC to become the affordable choice for families. + +As this market share grew, the PC became the more obvious platform to first release your software on. This created a snowball effect, where more software support made the PC the more obvious computer to buy, increasing market share and attracting more software development. + +In the end, it didn’t matter how much better your computer was when all the programs ran on MS-DOS. + +### That’s Actually Totally Awesome Though + +On first glance, Gates looks like the consummate monopolist. Actually, he did a lot more open up access to new players and foster innovation and competition. + +In the early days of desktop computing, every manufacturer more or less maintained its own proprietary platform, with its own hardware, operating system and software support. That meant if you wanted a certain kind of computer, there was one company who built it so you bought it from them. + +By opening the PC market to new entrants, selling the operating systems to anyone who wanted them, and setting industry standards that anyone could build to, PC makers had to compete directly on price and performance. + +Apple still have the old model of a closed, proprietary platform, and you’ll pay vastly more for an equivalent machine – or perhaps one whose specs haven’t improved in 3 years. + +It was also great for software developers not to have to port their software across so many platforms. I had first hand experience of this growing up – when I was really young, there were more than a dozen computers scattered around the house, because Dad was running his software business from home, and when he needed to port a program to a new machine, he needed the machine. But by the time I was finishing primary school, it was just the mac and the PC. + +Handling the compatibility problem, throwing Windows on top of it, and offering it on machines at all price points did so much to bring computing to ordinary people. + +At this point, I’m pretty sure someone in the audience is saying “yeah, but we could have done that open source”. Look, I like Linux for what it’s good for, but let’s be real here. Linux doesn’t really have a GUI environment – it has dozens of them, each with different quirks to learn. + +One thing that they all have in common though is that they’re not really proper operating system environments, more just nice little boxes to stick your web browser and word processor. The moment you need to install or configure anything, guess what? It’s terminal time. Which is rather excellent if you’re that way inclined, but realistically, that’s a small fraction of humanity. + +If Bill Gates never came up with an everyman operating system that you could run on an affordable machine, would someone else have? Probably. But he’s the guy that actually did it. + +### Sheer Conceit Will Make Fools of Even the Most Brilliant and Powerful + +The deal that really made Microsoft is also the deal that eventually cost IBM their entire market share of the PC platform they created and of the desktop computer market as a whole. + +IBM were in a hurry to bring their PC to market, they built almost all of it from off-the-shelf components. Bill Gates got the meeting to talk operating systems because his mother sat on a board with. IBM offered to buy the rights to the operating system, but Gates offered instead to license it. + +There was really no reason that IBM had to take that deal. There was nothing all that special about MS-DOS. They could have bought a similar operating system from someone else. I mean, that’s exactly what Gates did: he went to another guy in Seattle, bought the rights to a rip off of CP/M that worked on the Intel 8086, and tweaked it a bit. + +To be fair to IBM, in 1980, it wasn’t obvious yet how crucial it would be to hold a dominant operating system. That came later. At that point, the OS was kind of just a bit of code to run the hardware – a component. It was normal for every computer manufacturer to have its own . It was normal for developers to port their products across them. + +But it’s also just weren’t inclined to take a skinny twenty-something seriously. + +Compaq famously reverse engineered the BIOS, and other manufacturers followed them into the market. IBM now had competition, but were still considered the market leaders and standard setters – it was their platform and everyone else was a “clone”. + +They were still cocky. + +So when the 386, IBM decided they weren’t in any hurry to do anything with it. The logic was that they already held the manufacturing rights to the 286, so they might as well get as much value out of that as they could. This was crazy: the 386 was more than twice as fast at the same clock speed, and it could go to much higher clock speeds. + +Compaq jumped on it. Suddenly IBM were the slowpokes in their own market. + +Having totally lost all control and leadership in the PC market, they fought back with a new, totally proprietary platform: the PS/2. But it was way too late. The genie was out of the bottle. This was up against the same third party support issues working against everyone other company with a closed, proprietary platform. It didn’t last. + +-------------------------------------------------------------------------------- + +via: https://blog.dxmtechsupport.com.au/5-things-influenza-taught-me-about-the-evolution-of-the-desktop-computer/ + +作者:[James Mawson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/ +[b]: https://github.com/lujun9972 +[1]: https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/ From e41fbbc9bec2709d8f7ea1f008ccf4b9f458eb9b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Dec 2018 16:25:44 +0800 Subject: [PATCH 0905/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=2011=20Uses=20for?= =?UTF-8?q?=20a=20Raspberry=20Pi=20Around=20the=20Office?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...es for a Raspberry Pi Around the Office.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md diff --git a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md new file mode 100644 index 0000000000..c1a9e1a165 --- /dev/null +++ b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (11 Uses for a Raspberry Pi Around the Office) +[#]: via: (https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/) +[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) + +11 Uses for a Raspberry Pi Around the Office +====== + +Look, I know what you’re thinking: a Raspberry Pi is really just for tinkering, prototyping and hobby use. It’s not actually meant for running a business on. + +And it’s definitely true that this computer’s relatively low processing power, corruptible SD card, lack of battery backup and the DIY nature of the support means it’s not going to be a viable replacement for a [professionally installed and configured business server][1] for your most mission-critical operations any time soon. + +But the board is affordable, incredibly frugal with power, small enough to fit just about anywhere and endlessly flexible – it’s actually a pretty great way to handle some basic tasks around the office. + +And, even better, there’s a whole world of people out there who have done these projects before and are happy to share how they did it. + +### DNS Server + +Every time you type a website address or click a link in your browser, it needs to convert the domain name into a numeric IP address before it can show you anything. + +Normally this means a request to a DNS server somewhere on the internet – but you can speed up your browsing by handling this locally. + +You can also assign your own subdomains for local access to machines around the office. + +[Here’s how to get this working.][2] + +### Toilet Occupied Sign + +Ever get queues at the loos? + +That’s annoying for those left waiting and the time spent dealing with it is a drain on your whole office’s productivity. + +I guess you could always hang those signs they have on airplanes all through your office. + +[Occu-pi][3] is a much simpler solution, using a magnetic switch and a Raspberry Pi to tell when the bolt is closed and update a Slack channel as to when it’s in use – meaning that the whole office can tell at a glance of their computer or mobile device whether there’s a cubicle free. + +### Honeypot Trap for Hackers + +It should scare most business owners just a little bit that their first clue that a hacker’s breached the network is when something goes badly wrong. + +That’s where it can help to have a honeypot: a computer that serves no purpose except to sit on your network with certain ports open to masquerade as a juicy target to hackers. + +Security researchers often deploy honeypots on the exterior of a network, to collect data on what attackers are doing. + +But for the average small business, these are more usefully deployed in the interior, to serve as kind of a tripwire. Because no ordinary user has any real reason to want to connect to the honeypot, any login attempts that occur are a very good indicator that mischief is afoot. + +This can provide early warning of outsider intrusion, and of trusted insiders up to no good. + +In larger, client/server networks, it might be more practical to run something like this as a virtual machine. But in small-office/home-office situations with a peer-to-peer network running on a wireless router, something like [HoneyPi][4] is a great little burglar alarm. + +### Print Server + +Network-attached printers are so much more convenient. + +But it can be expensive to replace all your printers- especially if you’re otherwise happy with them. + +It might make a lot more sense to [set up a Raspberry Pi as a print server][5]. + +### Network Attached Storage + +Turning simple hard drives into network attached storage was one of the earliest practical uses for a Raspberry Pi, and it’s still one of the best. + +[Here’s how to create a NAS with your Raspberry Pi.][6] + +### Ticketing Server + +Looking for a way to manage the support tickets for your help desk on a shoestring budget? + +There’s a totally open source ticketing program called osTicket that you can install on your Pi, and it’s even available as [a ready-to-go SD card image][7]. + +### Digital Signage + +Whether it’s for events, advertising, a menu, or something else entirely, a lot of businesses need a way to display digital signage – and the Pi’s affordability and frugal electricity needs make it a very attractive choice. + +[There are a wealth of options to choose from here.][8] + +### Directories and Kiosks + +[FullPageOS][9] is a Linux distribution based on Raspbian that boots straight into a full screen version of Chromium – ideal for shopping directoriers, library catalogues and so on. + +### Basic Intranet Web Server + +For hosting a public-facing website, you’re really much better off just getting a hosting account. A Raspberry Pi is not really built to serve any real volume of web traffic. + +But for small offices, it can host an internal business wiki or basic company intranet. It can also work as a sandbox environment for experimenting with code and server configurations. + +[Here’s how to get Apache, MySQL and PHP running on a Pi.][10] + +### Penetration Tester + +Kali Linux is an operating system built specifically to probe networks for security vulnerabilities. By installing it on a Pi, you’ve got a super portable penetration tester with more than 600 tools included. + +[You can find a torrent link for the Raspberry Pi image here.][11] + +Be absolutely scrupulous to only use this on your own network or networks you’ve got permission to perform a security audit on – using this to hack other networks is a serious crime. + +### VPN Server + +When you’re out on the road, relying on public wireless internet, you’ve not really any say in who else might be on the network, snooping on all your traffic. That’s why it can be reassuring to encrypt everything with a VPN connection. + +There are any number of commercial VPN services you can subscribe to – and you can install your own in the cloud – but by running one from your office, you can also access the local network from anywhere. + +For light use – say, the occasional bit of business travel – a Raspberry Pi is a great, power-efficient way to set up a VPN server. (It’s also worth checking first that your router doesn’t offer this functionality already – very many do.) + +[Here’s how to install OpenVPN on a Raspberry Pi.][12] + +### Wireless Coffee Machine + +Ahh, ambrosia: sweet nectar of the gods and the backbone of all productive enterprise. + +So why not [hack the office coffee machine into a smart coffee machine][13] for precision temperature control and wireless network connectivity? + +-------------------------------------------------------------------------------- + +via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/ + +作者:[James Mawson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/ +[b]: https://github.com/lujun9972 +[1]: https://dxmtechsupport.com.au/server-configuration +[2]: https://www.1and1.com/digitalguide/server/configuration/how-to-make-your-raspberry-pi-into-a-dns-server/ +[3]: https://blog.usejournal.com/occu-pi-the-bathroom-of-the-future-ed69b84e21d5 +[4]: https://trustfoundry.net/honeypi-easy-honeypot-raspberry-pi/ +[5]: https://opensource.com/article/18/3/print-server-raspberry-pi +[6]: https://howtoraspberrypi.com/create-a-nas-with-your-raspberry-pi-and-samba/ +[7]: https://everyday-tech.com/a-raspberry-pi-ticketing-system-image-with-osticket/ +[8]: https://blog.capterra.com/7-free-and-open-source-digital-signage-software-options-for-your-next-event/ +[9]: https://github.com/guysoft/FullPageOS +[10]: https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server +[11]: https://www.offensive-security.com/kali-linux-arm-images/ +[12]: https://medium.freecodecamp.org/running-your-own-openvpn-server-on-a-raspberry-pi-8b78043ccdea +[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine From 22890f2a5d822b56f584d299dd67eff459dcd3da Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 18:23:19 +0800 Subject: [PATCH 0906/1143] PRF:20171129 TLDR pages Simplified Alternative To Linux Man Pages.md @wxy --- ...implified Alternative To Linux Man Pages.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md index fe9d2cdd6a..bca48001bf 100644 --- a/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md +++ b/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md @@ -3,19 +3,19 @@ TLDR 页:Linux 手册页的简化替代品 [![](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu-640x360.jpg "tldr page ubuntu")][22] -在终端上使用各种命令执行重要任务是 Linux 桌面体验中不可或缺的一部分。Linux 这个开源操作系统拥有[丰富的命令][23],使得任何用户都无法记住所有这些命令。而使事情变得更复杂的是,每个命令都有自己的一组带来丰富的功能的选项。 +在终端上使用各种命令执行重要任务是 Linux 桌面体验中不可或缺的一部分。Linux 这个开源操作系统拥有[丰富的命令][23],任何用户都无法全部记住所有这些命令。而使事情变得更复杂的是,每个命令都有自己的一组带来丰富的功能的选项。 -为了解决这个问题,人们创建了[手册页][12],(手册 —— man 是 manual 的缩写)。首先,它是用英文写成的,包含了大量关于不同命令的深入信息。有时候,当你在寻找命令的基本信息时,它就会显得有点庞杂。 为了解决这个问题,人们创建了[TLDR 页][13]。 +为了解决这个问题,人们创建了[手册页][12]man page,(手册 —— man 是 manual 的缩写)。首先,它是用英文写成的,包含了大量关于不同命令的深入信息。有时候,当你在寻找命令的基本信息时,它就会显得有点庞杂。为了解决这个问题,人们创建了[TLDR 页][13]。 ### 什么是 TLDR 页? -用于 Linux / Unix 的 TLDR 页的 GitHub 仓库将其描述为简化的、社区驱动的手册页的集合。在实际示例的帮助下,努力让使用手册页的体验变得更简单。如果还不知道,TLDR 取自互联网的常见俚语:太长没读Too Long Didn’t Read。 +TLDR 页的 GitHub 仓库将其描述为简化的、社区驱动的手册页集合。在实际示例的帮助下,努力让使用手册页的体验变得更简单。如果还不知道,TLDR 取自互联网的常见俚语:太长没读Too Long Didn’t Read。 -如果你想比较一下,让我们以 `tar` 命令为例。 通常,手册页会超过 1000 行。它是一个归档实用程序,经常与 `bzip` 或 `gzip` 等压缩方法结合使用。看一下它的手册页: +如果你想比较一下,让我们以 `tar` 命令为例。 通常,手册页的篇幅会超过 1000 行。`tar` 是一个归档实用程序,经常与 `bzip` 或 `gzip` 等压缩方法结合使用。看一下它的手册页: [![tar man page](https://fossbytes.com/wp-content/uploads/2017/11/tar-man-page.jpg)][14] -而另一方面,TLDR 页面让你只是浏览一下命令,看看它是如何工作的。 `tar` 的 TLDR 页面看起来像这样,并带有一些方便的例子——你可以使用此实用程序完成的最常见任务: +而另一方面,TLDR 页面让你只是浏览一下命令,看看它是如何工作的。 `tar` 的 TLDR 页面看起来像这样,并带有一些方便的例子 —— 你可以使用此实用程序完成的最常见任务: [![tar tldr page](https://fossbytes.com/wp-content/uploads/2017/11/tar-tldr-page.jpg)][15] @@ -23,18 +23,18 @@ TLDR 页:Linux 手册页的简化替代品 [![tldr-page-of-apt](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-of-apt.jpg)][16] -如上向你展示了 TLDR 如何工作并使你的生活更轻松,下面让我们告诉你如何在基于 Linux 的操作系统上安装它。 +如上,它向你展示了 TLDR 如何工作并使你的生活更轻松,下面让我们告诉你如何在基于 Linux 的操作系统上安装它。 ### 如何在 Linux 上安装和使用 TLDR 页? -最成熟的 TLDR 客户端基于 Node.js,你可以使用 NPM 包管理器轻松安装它。如果你的系统上没有 Node 和 NPM,请运行以下命令: +最成熟的 TLDR 客户端是基于 Node.js 的,你可以使用 NPM 包管理器轻松安装它。如果你的系统上没有 Node 和 NPM,请运行以下命令: ``` sudo apt-get install nodejs sudo apt-get install npm ``` -如果你使用的是 Debian、Ubuntu 或 Ubuntu 衍生产品以外的操作系统,你可以根据自己的情况使用`yum`、`dnf` 或 `pacman`包管理器。 +如果你使用的是 Debian、Ubuntu 或 Ubuntu 衍生发行版以外的操作系统,你可以根据自己的情况使用`yum`、`dnf` 或 `pacman`包管理器。 现在,通过在终端中运行以下命令,在 Linux 机器上安装 TLDR 客户端: @@ -76,7 +76,7 @@ via: https://fossbytes.com/tldr-pages-linux-man-pages-alternative/ 作者:[Adarsh Verma][a] 译者:[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 cfa2c44454ae16a474a5dde715f647320cf2f8e8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 18:24:45 +0800 Subject: [PATCH 0907/1143] PUB:20171129 TLDR pages Simplified Alternative To Linux Man Pages.md @wxy https://linux.cn/article-10355-1.html --- ...171129 TLDR pages Simplified Alternative To Linux Man Pages.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md (100%) diff --git a/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/published/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md similarity index 100% rename from translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md rename to published/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md From b1676eb2250b917922d780a75eabd7f8c7a20f49 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Dec 2018 19:18:53 +0800 Subject: [PATCH 0908/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Playing=20Badas?= =?UTF-8?q?s=20Acorn=20Archimedes=20Games=20on=20a=20Raspberry=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...corn Archimedes Games on a Raspberry Pi.md | 539 ++++++++++++++++++ 1 file changed, 539 insertions(+) create mode 100644 sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md diff --git a/sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md b/sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md new file mode 100644 index 0000000000..b1f8d97305 --- /dev/null +++ b/sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md @@ -0,0 +1,539 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Playing Badass Acorn Archimedes Games on a Raspberry Pi) +[#]: via: (https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/) +[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) + +Playing Badass Acorn Archimedes Games on a Raspberry Pi +====== + +![Cannon Fodder on the Raspberry Pi][1] + +The Acorn Archimedes was an excellent machine and years ahead of its time. + +Debuting in 1987, it featured a point and click graphic interface not so different to Windows 95, 32 bit processing, and enough 3D graphics power to portal you to a new decade. + +These days, it’s best remembered for launching the Acorn RISC Machines processor. ARM processors went on to rule the world. You almost certainly keep one in your pocket. + +What’s less well appreciated is that the Archimedes was rad for games. For a few years, it was the most powerful desktop in the world and developers were eager to show what they could do with it. + +But with such power came a great price tag. The Archimedes was never going to be in as many homes to make as many memories as Sega or Nintendo. + +But now, the Raspberry Pi’s ARM chip makes it cheap and easy to play these games on the same operating system and CPU architecture they were written for. + +Even better, the rights holders to much of this machine’s gaming catalogue have been generous enough to allow hobbyists to legally download their work for free. + +This is a cheap and easy project. In fact, if you already run a Raspberry Pi home theatre or retro gaming rig, all you really need is a spare SD card. + +### Introduction + +None of this will be on the exam, so if you already know the story of the Acorn Archimedes – or just want to get straight into gaming – feel free to skip ahead to the next section. + +But if you’re wondering what we’re even talking about, here it is: + +#### What on Earth is an Acorn Archimedes? + +Me and Acorn computers go way back. + +For the earliest part of my life that I can remember, Dad ran his business from home, writing timetabling software for schools. This was the early 80s, before the desktop computer market had been whittled down to Mac and PC. There were Amstrad CPCs, Sinclairs, Commodores, Ataris, TRSs, the list goes on. + +They all had their operating systems and ran their own software. If you wanted to port your software over to a new platform, you had to buy it. + +So, at a time when it was somewhat novel for a family to have even one computer, we had about a dozen, many of them already quite antique. There was a Microbee, an Apple IIc, an IBM XT, all sorts of stuff. + +The ones Dad liked most though were the BBC machines by [Acorn Computers][2]. He had several. There was a Model B, a Master 128 and a Master Compact. + +They were named that way because the British Broadcasting Corporation were developing a course to teach children how to program and they needed. Because of this educational focus, they’d found their way into a lot of schools – exactly the market he was selling to. + +At some point, I figured out you could play games on these things. I was straight away hooked like it was crack. All I cared about was games games games. It must have taken me several years to figure out that computers had a different use, because I can vividly recall how annoyed I was to be starting school while Dad got to stay home and play games all day. + +On my 7th birthday I got a second hand BBC Master Compact all of my own. This was probably as much to keep me away from his work computers as it was to introduce me to computing. I started learning to program in BASIC and Logo. I also played epic amounts of space shooters, 2D platformers and adventure games. + +Being obsessed with these things, I tagged along to the local BBC Users Group. This was a monthly get-together where enthusiasts would discuss what was new, bring their machines to show off what they’re doing and engage in some casual software piracy. Back before internet forums and torrents, people did this in person. + +This was where I first saw an Archimedes. I can’t really remember the exact year or the exact model – I just remember my jaw dropping to the floor at the 3D graphics and the 8 channel stereo sound. It would be about a decade before I saw anything similar on a gaming console. + + + +#### The Birth of a Legend + +Looking back, this has very good claim to be the first modern desktop computer. It was a 32-bit machine, an interface that looks more like what we use today than anything built in the 1980s, a palette of 4096 colours, and more horsepower than a lot of people knew what to do with. + +Now, don’t get me wrong: the 8-bit BBC machines were loads of fun and great for what they were – but what they were was fairly primitive. It was basically just a big box you typed commands on to make it beep and stuff. In theory it had 8 colours, but when you saw one in the wild it was usually hooked up to a monochrome screen and you didn’t feel like you were missing out on too much because of it. + +In 1984, Apple launched their Macintosh, featuring the first Graphical User Interface available on the mass market. Acorn knew they’d need a point and click graphic interface to stay in the game. And they knew the aging MOS 6502 they’d used in all their machines so far was just not going to be the CPU of the future. + +So, what to replace it with? + +The Acorn engineers looked at the available processors and found that none of them could quite do what they want. They decided to build their own – and it would be radically different. + +Up until that point, chip makers took a bit of a Swiss Army Knife approach to processor design – to compete, you added more and more useful stuff to the instruction set. + +There was a certain logic to this – hardware could be mass produced, while good software engineers were expensive. It made sense to handle as much as possible in the hardware. For device manufacturers with bills to pay, it was a real selling point. + +But this came at a cost – more and more complex instructions required more and more clock cycles to complete. Often there was a whole extra layer of processing to convert the complex machine code instructions into smaller instructions. As RAM became bigger and faster, CPUs were struggling to keep pace with the available memory bandwidth. + +Acorn turned this idea on its head, with a stripped-back approach in the great British tradition of the [de Havilland Mosquito][3]: Every instruction could be completed in a single cycle. + +While testing the prototype CPU, the engineers noticed something weird: they’d disconnected the power and yet the chip was running. What they’d built was so power-efficient that it kept running on residual power from nearby components. + +It was also 25 times faster than the 6502 CPU they used in the old BBC machines. Even better, it was several times more powerful than the Motorola 68000 found in the Apple Macintosh, Atari ST and Commodore Amiga – and several time more powerful than the 386 in the new Compaq too. + +With such radically new hardware, they needed a new operating system. What they come up with was Risc OS, and it was operated entirely through a graphic point-and-click desktop interface with a pinboard and an icon bar. This was pretty much Windows 95, 8 years before it happened. + +In a single step, Acorn had gone from producing some perfectly serviceable 8-bit box that kids could learn to code one, to having the most powerful desktop computer in the world. I mean, it was technically possible to get something more powerful – but it would have been some kind of server or mainframe. As far as something that could sit on your desk, this was top of the pile. + +It sold well in Acorn’s traditional education market in the UK. The sheer grunt also made it popular for certain power-hungry business tasks, like desktop publishing. + +#### The Crucifixion + +It wasn’t too long before Dad got an Archimedes – I can’t remember exactly which model. By this time, he’d moved his business out of home to an office. When school holidays rolled around, I’d sometimes have to spend the day at his work, where I had all the time in the world to fiddle around on it. + +The software it came with was enough to keep a child entertained for a while. It came with a demo game called Lander – this was more about showing off the machine’s 3D graphics power than providing any lasting value. There was a card game, and also some drawing programs. + + + +I played with the demo disc until I got bored – which I think was the most use that this particular machine ever got. For all the power under the hood, all the applications Dad used to actually run his business ran on DOS and Windows. + +He’d spent more than $4000 in today’s money for the most sophisticated and advanced piece of computing technology for a mile in any direction and it just sat there. + +He might have at least salvaged some beneficial utility out of it if he’d followed my advice of getting some games for it and letting me take it home. + +He never got around to writing any software on it. The Archimedes was apparently a big hit with British schools, but never really got popular enough with his Australian customer base to be worth coding for. + +Which I guess is kind of sums up where it all ultimately went wrong for the Acorn desktop. + +As the 80s wore on to the ’90s, Compaq reverse engineered the BIOS on the IBM PC to release their own fully compatible PC, and big players like Amstrad left their proprietary platforms to produce their own compatible MS-DOS machines. It was also became increasingly easy for just about anyone with a slight technical bunt to build their own PC-compatible clone from off-the-shelf parts – and to upgrade old PCs with new hard drives, sound cards, and the latest 386 and 486 processors. + +Small, independent computer shops and other local businesses started building their owns PCs and hardware manufacturers competed to sell parts to them. This was a computing platform that could serve all price points. + +With so much of the user base now on MS-DOS, software developers followed. Which only reinforced the idea that this was the obvious system to buy, which in turn reinforced that it was the system to code for. + +The days when just any computer maker could make a go of it with their own proprietary hardware and operating system had passed. Third-party support was everything. It didn’t actually matter how good your technology was if nothing would run on it. Even Apple nearly went to the wall. + +Acorn hung on through the 90s, and there was even a successor to the Archimedes called the [RiscPC][4]. But while the technology itself was again very good, these things were relatively marginal affairs in the marketplace. The era of the Acorn desktop had passed. + +#### The Resurrection + +It was definitely good for our family business when the market consolidated to Mac and PC. We didn’t need to maintain so many versions of the same software. + +But the Acorn machines had so much sentimental value. We both liked them and were sad to see them go. I’ve never been that into sport, but watching them slowly disappear might have been a bit like watching your football team lose match after match before finally going broke. + +We totally had no idea that they were, very quietly, on a path to total domination. + +The ARM was originally only built to go in the Archimedes. But it turned out that having a massively powerful processor with a simple instruction set and very little heat emission was useful for all sorts of stuff: DVD players, set top boxes, photocopiers, televisions, vending machines, home and small business routers, you name it. + +The ARM’s low power consumption made it especially useful for portable devices like PDAs, digital cameras, GPS navigators and – eventually – tablets and smartphones. Intel tried to compete in the smartphone market, but was [eventually forced to admit that this technology was just better for phones][5]. + +So in the end, Dad’s old BBC machines went on to conquer the world. + +### The Acorn Archimedes as a Gaming Platform + +While Microsoft operating systems were ultimately to become the only real choice for the serious desktop gamer, for a while the Archimedes was the most powerful desktop computer in the world. This attracted a lot of games developers, eager to show what they could do with it. + +This would have been about more than just selling to a well moneyed section of the desktop computer market that was clearly quite willing to throw cash at shiny things. It would have been a chance to make your reputation in the industry with a flagship product that just wasn’t possible on lesser hardware. + +So it is that you see Star Fighter 3000, Chocks Away and Zarch all charting new territory in what was possible on a desktop computer. + +But while the 3D graphics power was this system’s headline feature, the late 80s and early 90s were really the era of Sonic and Mario: the heyday of 2D platform games. Here, the Archimedes also excels, with offerings like Mad Professor Mariarti, Bug Hunter, F.R.E.D. and Hamsters, all of which are massively playable, have vibrant graphics and a boatload of personality. + +As you dig further into the library, you also find a few games that show that not every developer really knew what to do with this machine. Some games – like Repton 3 – are just old BBC micro games given the most meagre of facelifts. + +Many of the games in the Archimedes catalogue you’ll recognise from other platforms: Populous, Lemmings, James Pond, Battle Chess, the list goes on. + +Here, the massive hardware advantage of the Archimedes means that it usually had the best version of the game to play. You’re not getting a whole new game here: but it’s noticeably smoother graphics and gameplay, especially compared to the console releases. + +All in all, the Archimedes never had a catalogue as expansive as MS-DOS, the Commodore Amiga, or the Sega and Nintendo consoles. But there are enough truly excellent games to make it worth an SD card. + +### Configuring Your Raspberry Pi + +This is a bit different to other retro gaming options on the Raspberry Pi – we’re not running an emulator. The ARM chip in the Pi is a direct descendant of the one in the Archimedes, and there’s an [open source version of Risc OS][6] we can install on it. + +For the most hardcore retro gaming purist, nothing less than using the hardware will do. For everyone else, using the same operating system from back in the day to load up your games means that your retro gaming rig becomes just that little bit more of a time machine. + +But even with all these similarities, there’s still going to be a few things that change in 30 years of computing. + +The most visible difference is that our Raspberry Pi doesn’t come with an internal 3.5″ floppy disk drive. You might be able to hook up a USB one, but most of us don’t have this lying around and don’t really want one. So we’re going to need a different way to boot floppy images. + +The more major difference is how much RAM the operating system is written to handle. The earliest versions of Risc OS made efficient use of the ARM’s 32-bit register by using 26 bits for the memory address and the remaining 6 bits for status flags. A 26-bit scheme gives you enough addressing space for up to 64 megabytes of RAM. + +When this was first devised, the fact that an Archimedes came with a whole megabyte of RAM was considered incredibly luxurious by the standards of the day. By contrast, the first Commodore Amiga had 256kb of RAM. The Sega Mega Drive had 72kb. + +But as time wore on, and later versions of Risc OS moved to a 32-bit addressing scheme. This is what we have on our Raspberry Pi. A few games have been [recompiled to run on 32 bit addressing][7], but most have not. + +The Archimedes also used different display drivers for different screens. These days, our GPU can handle all of this for us. We just need to install a patch to get that working. + +There are free utilities you can download to handle all of these things. + +#### Hardware Requirements + +I’ve tested this to work with a Raspberry Pi Model 3 B, but I expect that any Pi from the Model A onwards should manage this. The ARM processor on the slowest Pi is a great many times more powerful than the on the fastest Archimedes. + +The lack of ports on a Raspberry Pi Zero means it’s probably not the most convenient choice, but if you can navigate around this, then it should be powerful enough. + +In addition to the board, you’ll need something to put it in, a micro SD card, a USB SD card adapter, a power supply, a screen with an HDMI input, a USB keyboard and a 3 button mouse – a clickable scroll wheel works fine for your middle button. + +If you already have a Raspberry Pi home theatre or retro gaming rig, then you’ve already got all this, so all you really need is a new micro SD card to swap in for Risc OS. + +#### Installing Risc OS Open + +When I first wrote this guide, Risc OS wasn’t an available option for the Raspberry Pi 3 on the NOOBS and PINN installers. That meant you had to download the image from the [Risc OS Open downloads page][8] and burn it to a new micro SD card. + +You can still do this if you like, and if you can’t connect your Raspberry Pi to the internet via Wi-Fi or Ethernet then that’s still your best option. If you’re not sure how to write an image to an SD card, here’s some good guides for [Windows][9] and for [Mac][10]. + +For everyone else, now that Risc OS is available in the [NOOBS installer][11] again, I recommend using that. What’s really cool about NOOBS is that it makes it super simple to dual boot with something like [Retropie][12] or [Recalbox][13] for the ultimate all-in-one retro gaming device. + +Risc OS is as an extremely good option for a dual boot machine because it only uses a few gigabytes – a small fraction of even the smallest SD cards around these days. This leaves most of it available for other operating systems and saves you having to swap cards, which can be a right pain if you have to unscrew the case. The games themselves vary from about 300kb to about 5 megabytes at the very largest, so don’t worry about that. + +This image requires a card with at least 2 gigabytes, which for what we’re doing is plenty. Don’t worry about tracking down the largest SD card you can find. The operating system is extremely lightweight and the games themselves vary from about 300kb to about 5 megabytes at the very largest. Even a very small card offers enough space for hundreds of games – more than you will ever play. + +If you’re unsure how to use the NOOBS installer, please [click here for instructions][14]. + +#### Navigating Risc OS + +Compared to your first Linux experience, using Risc OS for the first time is, in my opinion, far more gentle. This is in large part thanks to a graphical interface that’s both fairly intuitive and actually very useful for configuring things. + +The command line is there if you want it, but we won’t need it just to play some games. You can kind of tell that this was first built with a mass-market audience in mind. + +So let’s jump right in. + +Insert your card into your Pi, hook it up to your screen, keyboard, mouse and power supply. It shouldn’t take all that long before you’re at the desktop. + +###### The Risc OS Mouse + +Risc OS uses a three button mouse. + +You use the left button – or “Select” button – in much the same way as you’re already used to: one click to select icons and a double click to open folders and execute programs. + +The middle button – ie, your scroll wheel – is used to open menus in much the same way as the right mouse button is used in Windows. We’ll be using this a lot. + +The right button – or “Adjust” button – has behaviours that vary between applications. + +###### Browsing Directories + +Ok, so let’s start taking a look around. At the bottom of the screen you’ll see an icon bar. In the bottom left are icons for storage devices. + +Click once with the left mouse button on the SD card and a window will open to show you what’s on it. You can take a look inside the directories by double clicking. + +###### The Pling + +As you start to browse Risc OS, you’ll notice that a lot of what you see inside the directories has exclamation marks at the beginning. This is said out aloud as a “pling”, and it’s used to mark an application that you can execute. + +One of the quirks of Risc OS is that these executables aren’t really files – they’re directories. If you hold shift while double clicking, you can open them and start looking inside, same as any other directory – but be careful with this, it’s a good way to break stuff. + +Risc OS comes with some applications installed – including a web browser called !NetSurf. We’ll be using that soon to download our games and some small utilities we need to get them running. + +###### Creating Directories + +Risc OS comes with a basic directory structure, but you’ll probably want to create some new ones to put your floppy images and .zip files. + +To do this, click with the middle button inside the folder where you want to place your new directory. This will open up a menu. Move your mouse over the arrow next to “New Directory” and a prompt will open where you can name it and press OK. + +###### Copying Files and Directories + +To copy a file or directory somewhere else, just drag and drop it with the left mouse button to the new location. + +###### Forcing Applications to Quit + +Sometimes, if you haven’t configured something right, if you’ve downloaded something that just doesn’t work, or if you plain forgot to look up the controls in the manual, you might find yourself stuck inside an application that has a blank screen or isn’t responding. + +Here, you can press Ctrl-Shift-F12 to quit back to the desktop. + +###### Shutting Down and Rebooting + +If you want to power down or reboot your Pi, just click the middle button on the raspberry icon in the bottom right corner and select “Shutdown”. This will give you an option to reboot the Pi or you can just remove the power cable. + +#### Connecting to the Internet + +Okay, so I’ve got good news and bad news. I’ll get the bad news right out of the way first: + +Risc OS Open doesn’t yet support wireless networking through either the onboard wireless or a wireless dongle in the USB port. It’s on the [to-do list][15]. + +In the meantime, if you can a way to connect to the internet through the Ethernet port, it makes the rest of this project a lot easier. If you were going to use an Ethernet cable anyway, this will be no big deal. And if you have a wireless bridge handy, you can just use that. + +If you don’t have a wireless bridge, but do have a second Raspberry Pi board lying around (hey, who doesn’t these days :p), you can [set it up as a wireless bridge][16]. This is what I did and it’s actually pretty easy if you just follow the steps. + +Another option might be to set up a temporary tinkering area next to your router so that you can plug straight in to get everything in configured. + +Ok, so what’s the good news? + +It’s this: once you’ve got the internet in your front hole, the rest is rather easy. In fact, the only bit that’s not done for your is configuring name servers. + +So let’s get to it. + +Double-click on !Configure, click once on Network, click on Internet and then on Host Names. Then enter the IPs of your name servers in the name server fields. If you’re not sure what IP to put in here, just use Google’s publicly available name servers – 8.8.8.8 and 8.8.4.4. + +When you click Set, it will ask you if you want to reboot. Click yes. + +Now double-click on !NetSurf. You’ll see the logo is now added to the bottom right corner. Click on this to open a new browser window. + +Compared to Chrome, Firefox, et al, !NetSurf is a primitive web browser. I do not recommend it as a daily driver. But to download Risc OS software directly to the Pi, it’s actually pretty damn convenient. + +###### Short Link to This Guide + +As you go through the rest of this guide, it’s going to get annoying copying by hand all the URLs you’ll want to visit. + +To save you this trouble, type bit.do/riscpi into the browser bar to load this page. With this loaded, you can follow the links. + +###### If You’re Still Getting Host Name Error Messages + +One little quirk of Risc OS is that it seems to check for name servers as part of the boot process. If it doesn’t find them then, it assumes they’re not there for the rest of the session. + +This means that if you connect your Pi to the internet when it’s already booted, you will get an error message when you try to browse the internet with !NetSurf. + +To fix this, just double check that your wireless bridge is switched on or that your Pi is plugged into the router, reboot, and the OS should find the name servers. + +###### If You Can’t Connect to the Internet + +If this is all too hard and you absolutely can’t connect to the internet, there’s always sneakernet – downloading files to another machine and then transferring by USB stick. + +This is what I tried at first; It does work, but I found it terribly annoying. + +One frustration is that using a Windows 10 machine to download Risc OS software seems to strip out the filetype information – even when you aren’t unzipping the archives. It’s not that difficult to repair this, it’s just tedious when you have to do it all the time. + +The other problem is that running USB sticks from computer to computer all the time just got a bit old. + +Still, if you have to do it, it’s an option. + +#### Unzipping Compressed Files + +Most of the files we’ll be downloading will come in .zip format – this is a good thing, because it preserves the file type information. But we’ll need a way to uncompress these files. + +For this we’ll use a program called !SparkFS. This is proprietary software, but you can download a read-only version for free. This will let us extract files from .zip archives. + +To download and install !SparkFS, click [this link][17] and follow the instructions. You want the version of this software for machines with more than 2MB of RAM. + +#### Installing ADFFS and Anymode + +Now we need to install ADFFS, a floppy disk imaging program written by Jon Abbot of the [Archimedes Software Preservation Project][18]. + +This gives us a virtual floppy drive we can use to boot floppy images. It also takes care of the 26 bit memory addressing issues. + +To get your copy, browse to the [ADFFS subforum][19] and click the thread for the latest public release – at the time of writing that’s 2.64. + +Download the .zip file, open it and then drag and drop !ADFFS to somewhere on your SD card where it’s conveniently accessible – we’ll be using it a lot. + +###### Configuring Boot Scripts + +For ADFFS to work properly, we’re going to need to add a little boot script. + +Follow these instructions carefully – if you do the wrong thing here you can really mess up your OS, or even brick your Pi. + +###### Creating !Boot.Loader.CMDLINE/TXT + +Remember how I showed you that you could open up applications as directories by holding down shift when you double-click? We can also do this to get inside the Risc OS boot process. We’ll need to do this now to add our boot script. + +Start by left clicking once on the SD card icon on the icon bar, then hold down shift and double-click !Boot with your left mouse button. Then double click the folder labeled Loader to open it. This is where we’re going to put our script. + +To write our script, click Apps on the icon bar, then double-click !StrongEd. Now click on the fist icon that appeared on the bottom right of the icon bar to open a text editor window, and type: + +``` +disable_mode_changes +``` + +Computers are fussy so take a moment to double-check your spelling. + +To save this file, click the middle button on the text editor and hover your cursor over the arrow next to Save. Then delete the existing text in the Name field and replace it with: + +``` +CMDLINE/TXT +``` + +Now, see that button marked Save? It’s a trap! Instead, drag and drop the pen and paper icon to the Loader folder. + +We’re now finished with this folder, so you can close it and also close the text editor. + +###### Installing Anymode + +Now we need to install the Anymode module. This is to make the screen modes on our software play nice with our GPU and HDMI output. + +Download Anymode from [here,][20] copy the .zip file to somewhere temporary and open it. + +Now go back to the root directory on your SD card, double-click on !Boot again, then open the folders marked Choices, Boot and Predesk. + +Then use your left mouse button to drag and drop the Anymode module from your .zip file to the Predesk folder. + +#### Configuring USB Joysticks and Gamepads + +Over at the Archimedes Software Preservation Project, there’s a [USB joystick driver][21] in development. + +This module is still in alpha testing, and you’ll need to use the command line to configure it, but it’s there if you’d like to give it a try. + +If you can’t get this working, don’t worry too much. It was actually pretty normal back in the day for people either to not have a joystick, or not to be able to get it to work. So pretty much every game can be played with keyboard and mouse. + +I’ll be updating this section as this project develops. + +#### Setting File Types + +Risc OS uses an [ADFS][22] filesystem, different to anything used on Windows or Linux. + +Instead of using a filename extension, ADFS files have a “file type” associated with them to show what. When these files pass through a different operating system, this information can get stripped from the file. + +In theory, if we don’t open our .zip archives until it reaches our Risc OS machine, the file type should be preserved. Usually this works, but sometimes you unzip the archive and find files with no file type attached. You’ll be able to tell when this has happened because you’ll be faced with a green icon labeled “data”. + +Fortunately, this is pretty easy to fix. + +Just click on the file with your middle button. A menu will appear. + +The second item on this menu will include the name of the file and it will have an arrow next to it. Hover your cursor over the arrow and a second menu will appear. + +Near the bottom of this menu will be an option marked “Set Type”, and it will also have an arrow next to it. Hover your cursor over this arrow and a field will appear where you can enter the file type. + +To set the file type on a floppy image, type: + +``` +&FCE +``` + +[Click here for more file type codes.][23] + +### Finding, Loading and Playing Games + +The best start looking for floppy images is in the [Games subforum][24] at the Archimedes Software Preservation Project. + +There’s also a [Risc OS downloads section at Acorn Arcade][25]. + +There are definitely other websites that host Archimedes games, but I have no idea how legal these copies are. + +###### Booting and Switching Floppy Disc Images + +Some games might have specific instructions for how to boot the floppy. If so, then follow them. + +Generally, though, you drag and drop the image file to, then click on it with the middle button and press “boot floppy”. Your game should start straight away. + +Many of the games use more than one floppy disc. To play these, boot disc 1. When you’re asked to switch floppy discs, press control and shift and the function key corresponding to the disc you want to change to. + +### Which Games Should You Play? + +This is a matter of opinion really and everyone’s taste differs. + +Still, if you’re wondering what to try, here are my recommendations. + +This is still a work in progress. I’ll be adding more games as I find what I like. + +#### Cannon Fodder + + + +This is a top-down action/strategy game that’s extremely playable and wickedly funny. + +You control a team of soldiers indirectly by clicking on areas of the screen to tell them where to move and who to kill. Everyone dies with a single shot. + +At the start your enemies are all very easy to beat but the game progresses in difficulty. As you go, you’ll need to start dividing your team up into squads to command separately. + +I used to play this on the Mega Drive back in the day, but it’s so much more playable with an actual mouse. + +[Click here to get Cannon Fodder.][26] + +#### Star Fighter 3000 + + + +This is a 3D space shooter that really laid down the gauntlet for what the Archimedes could do. + +You fly around and blast stuff with lasers and missiles. It’s pretty awesome. It’s kind of a forerunner to Terminal Velocity, if you ever played that. + +It was later ported to the 3D0, Sega Saturn and Playstation, but they could never render the 3D graphics to the same distance. + +[Click here to get Star Fighter 3000.][27] + +You want the download marked “Star Fighter 3000 version 3.20”. This one doesn’t use a floppy image, so don’t use ADFFS to run this file. Just double click the program and go. + +#### Aggressor + + + +This is a side-scrolling run-and-gun where you have unlimited ammo and a whole lot of aliens and robots to kill. Badass. + +#### Bug Hunter + + + +This is a really unique puzzle/platform game – you’re a robot with sticky legs who can walk up and down walls and across the ceiling, and your job is to squash bugs by dropping objects lying around. + +Which is harder than it sounds, because you can easily get yourself into situations where you dropped something in the wrong place, making it impossible to complete your objective, so your only way out is to initiate your self destruct sequence in futility and shame. Which I guess is kinda rather dark, if you dwell on it. + +It’s fun though. + +[Click here to get Bug Hunter.][28] + +#### Mad Professor Mariarti + + + +This is a platformer where you’re a mad scientist who shoots spanners and other weapons at bad guys. It has good music and gameplay and an immersive puzzle element as well. + +[Click here to get Mad Professor Mariarti.][29] + +#### Chuckie Egg + +Ok, now we’re getting really retro. + +Strictly speaking, this doesn’t really belong in this list, because it’s not even an Archimedes game – it’s an old BBC Micro game that I played the hell out of back in the day that some nice chap has ported to Risc OS. + +But there’s a version that runs and it’s awesome so you should play it. + +Basically you’re just this guy who goes around stealing eggs. That’s it. That’s all you do. + +It’s absolutely amazing. + +If you’ve never played it, you really should check it out. + +You can [get Chuckie Egg here][30]. + +This isn’t a floppy image, so you don’t need ADFFS to run it. Just double click on the program and go. + +### Over to You + +Got any favourite Acorn Archimedes games? + +Got any tips for getting them running on the Pi? + +Please let me know in the comments section 🙂 + +-------------------------------------------------------------------------------- + +via: https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/ + +作者:[James Mawson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/ +[b]: https://github.com/lujun9972 +[1]: https://blog.dxmtechsupport.com.au/wp-content/uploads/2018/06/cannonfodder-1024x768.jpg +[2]: http://www.computinghistory.org.uk/det/897/Acorn-Computers/ +[3]: http://davetrott.co.uk/2017/03/strategy-is-sacrifice/ +[4]: http://www.old-computers.com/museum/computer.asp?c=1015 +[5]: https://www.theverge.com/2016/8/16/12507568/intel-arm-mobile-chips-licensing-deal-idf-2016 +[6]: https://www.riscosopen.org/content/ +[7]: https://www.riscosopen.org/wiki/documentation/show/ARMv6%2Fv7%20software%20compatibility%20list#games +[8]: https://www.riscosopen.org/content/downloads/raspberry-pi +[9]: http://www.raspberry-projects.com/pi/pi-operating-systems/win32diskimager +[10]: http://osxdaily.com/2018/01/11/write-img-to-sd-card-mac-etcher/ +[11]: https://www.raspberrypi.org/downloads/noobs/ +[12]: https://retropie.org.uk/ +[13]: https://www.recalbox.com/ +[14]: https://www.raspberrypi.org/documentation/installation/noobs.md +[15]: https://www.riscosopen.org/wiki/documentation/show/RISC%20OS%20Roadmap +[16]: https://pimylifeup.com/raspberry-pi-wifi-bridge/ +[17]: http://www.riscos.com/ftp_space/generic/sparkfs/index.htm +[18]: https://forums.jaspp.org.uk/forum/index.php +[19]: https://forums.jaspp.org.uk/forum/viewforum.php?f=14&sid=d0f037e95c560144f3910503b776aef5 +[20]: http://www.pi-star.co.uk/anymode/ +[21]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=8&t=396 +[22]: https://en.wikipedia.org/wiki/Advanced_Disc_Filing_System +[23]: https://www.riscosopen.org/wiki/documentation/show/File%20Types +[24]: https://forums.jaspp.org.uk/forum/viewforum.php?f=25 +[25]: http://www.acornarcade.com/downloads/ +[26]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=188 +[27]: http://starfighter.acornarcade.com/ +[28]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=330 +[29]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=148 +[30]: http://homepages.paradise.net.nz/mjfoot/riscos.htm From 40d2dc885ebd13ed8fe0b07728d490678e4533bc Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 17 Dec 2018 19:20:58 +0800 Subject: [PATCH 0909/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Streaming=20Aus?= =?UTF-8?q?tralian=20TV=20Channels=20to=20a=20Raspberry=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ustralian TV Channels to a Raspberry Pi.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md diff --git a/sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md b/sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md new file mode 100644 index 0000000000..ac756223f1 --- /dev/null +++ b/sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md @@ -0,0 +1,209 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Streaming Australian TV Channels to a Raspberry Pi) +[#]: via: (https://blog.dxmtechsupport.com.au/streaming-australian-tv-channels-to-a-raspberry-pi/) +[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) + +Streaming Australian TV Channels to a Raspberry Pi +====== + +If you’re anything like me, it’s been years since you’ve even thought about hooking an antenna to your television. With so much of the good stuff available by streaming and download, it’s easy go a very long time without even thinking about free-to-air TV. + +But every now and again, something comes up – perhaps the cricket, news and current affairs shows, the FIFA World Cup – where the easiest thing would be to just chuck on the telly. + +When I first started tinkering with the Raspberry Pi as a gaming and media centre platform, the standard advice for watching broadcast TV always seemed to involve an antenna and a USB TV tuner. + +Which I guess is fine if you can be arsed. + +But what if you utterly can’t? + +What if you bitterly resent the idea of more clutter, more cords to add to the mess, more stuff to buy? What if every USB port is precious and jealously guarded for your keyboard, mouse, game controllers and removable storage? What if the wall port for your roof antenna is in a different room? + +That’s all a bit of a hassle for a thing you might use only a few times a year. + +In 2018, shouldn’t we just be able to stream free TV from the internet? + +It turns out that, yes, we can access legal and high quality TV streams from any Australian IP using [Freeview][1]. And thanks to a cool Kodi Add-on by [Matt Huisman][2], it’s now really easy to access this service from a Raspberry Pi. + +I’ve tested this to work on a Model 3 B+ running Retropie 4.4 and Kodi 17.6. But it should work similarly for other models and operating systems, so long as you’re using a reasonably up-to-date version of Kodi. + +Let’s jump right in. + +### If You Already Have Kodi Installed + +If you’re already using your Raspberry Pi to watch movies and TV shows, there’s a good chance you’ve already installed Kodi. + +Most Raspberry Pi operating systems intended for media centre use – such as OSMC or Xbian – come with Kodi installed by default. + +It’s fairly easy to get running on other Linux operating systems, and you might have already installed it there too. + +If your version of Kodi is more than a year or so old, it might be an idea to update it. The following instructions are written for the interface on Kodi 17 (Krypton). + +You can do that by typing the following commands at the command line: + +``` +sudo apt-get update +sudo apt-get upgrade +``` + +And now you can skip ahead to the next section. + +### Installing Kodi + +Installing Kodi on Retropie and other versions of Raspbian is fairly simple. Other Linux operating systems should be able to run it, perhaps with a bit of coaxing. + +You will need to be connected to the internet to install it. + +If you’re using something, such as Risc OS – you probably can’t install kodi. You will need to either swap in another SD card, or use a boot loader to boot into a media centre OS for your TV viewing. + +#### Installing Kodi on Retropie + +It’s really easy to install Kodi using the Retropie menu system. + +Here’s how: + + 1. Navigate to the Retropie main screen – that’s that horizontal menu where you can scroll left and right through all your different consoles + 2. Select “Retropie” + 3. Select “Retropie setup” + 4. Select “Manage Packages” + 5. Select “Manage Optional Packages” + 6. Scroll down and select “Kodi” + 7. Select “Install from Binary” + + + +This will take a minute or two to install. Once it’s installed, you can exit out of the Retropie Setup screen. When you next restart Retropie, you will see Kodi under the “Ports” section of the Retropie main screen. + +#### Installing Kodi on Raspbian + +If you’re running Raspbian without Retropie. But that’s okay, because it’s pretty easy to do it from the command line + +Just type: + +``` +sudo apt-get update +sudo apt-get install kodi +``` + +At this point you have a vanilla installation of Kodi. You can run it by typing: + +``` +kodi +``` + +It’s possible to delve a lot further into setting up Kodi from the command line. Check out [this guide][3] if you’re interested. + +If not, what you’ve just installed will work just fine. + +#### Installing Kodi on Other Versions of Linux + +If you’re using a different flavour of Linux, such as Pidora or Arch Linux ARM, then the above might or might not work – I’m not really sure, because I don’t really use these operating systems. + +If you get stuck, it might be worth a look at the [how-to guide][4] on the Kodi wiki. + +#### Dual Booting a Media Centre OS + +If your operating system of choice isn’t suitable for Kodi – or is just too confusing and difficult to figure out – it might be easiest to use a boot loader for multiple operating systems on the one SD card. + +You can set this up using an OS installer like [PINN][5]. + +Using PINN, you can install a media centre OS like [OSMC][6] to use Kodi – it will be installed with the operating system – and then your preferred OS for your other uses. + +It’s even possible to [move your existing OS over][7]. + +### Adding Australian TV Channels to Kodi + +With Kodi installed and running, you’ve got a pretty good media player for the files on your network and hard drive. + +But we need to install an add-on if we want to use it to chuck on the telly. This only takes a minute or so. + +#### Installing Matt Huisman’s Kodi Repository + +Ready? Let’s get started. + + 1. Open Kodi + 2. Click the cog icon at the top left to enter the settings + 3. Click “System Settings” + 4. Select “Add-ons” + 5. Make sure that “Unknown Sources” is enabled + 6. Right click anywhere on the screen to navigate back to the settings menu + 7. Click “File Manager” + 8. Click “Add Source” + 9. Double-click “Add Source” + 10. Select “” + 11. Type in exactly **** + 12. Select “OK” + 13. Click the text input underneath the label “Enter a name for this media source.” + 14. Type in exactly **MJH** + 15. Click “OK” + 16. Right click twice anywhere on the screen to navigate back to the main menu + 17. Select “Add-ons” + 18. Click “My Add-ons” + 19. Click “..” + 20. Click “Install from zip file” + 21. Click “MJH” + 22. Select “repository.matthuisman.zip” + + + +The repository is now installing. + +If you get stuck with any of this, here’s a video from Matt that starts by installing the repository. + + + +#### Installing the Freeview Australia Add-On + +We’re nearly there! Just a few more steps. + + 1. Right click anywhere on the screen a couple of times to navigate back to the main menu + 2. Select “Add-ons” + 3. Click “My add-ons” + 4. Click “..” + 5. Click “Install from repository” + 6. Click “MattHuisman.nz Repository” + 7. Click “Video add-ons” + 8. Click “AU Freeview” + 9. Click “Install” + + + +You can now have every free-to-air TV channel in your Add-ons main menu item. + +### Watching TV + +When you want to chuck the telly on, all you need to do is click “AU Freeview” in the Add-ons main menu item. This will give you a list of channels to browse through and select. + +If you want, you can also add individual channels to your Favourites menu by right clicking them and selecting “Add to favourites”. + +By default you will be watching Melbourne television. You can change the region by right clicking on “AU Freeview” and clicking “settings”. + +When you first tune in, it sometimes jumps a bit for a few seconds, but after that it’s pretty smooth. + +After spending a few minutes with this, you’ll quickly realise that free-to-air TV hasn’t improved in the years since you last looked at. Unfortunately, I don’t think there’s a fix for that. + +But at least it’s there now for when you want it. + +-------------------------------------------------------------------------------- + +via: https://blog.dxmtechsupport.com.au/streaming-australian-tv-channels-to-a-raspberry-pi/ + +作者:[James Mawson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/ +[b]: https://github.com/lujun9972 +[1]: http://www.freeview.com.au/ +[2]: https://www.matthuisman.nz/ +[3]: https://www.raspberrypi.org/forums/viewtopic.php?t=192499 +[4]: https://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux +[5]: https://github.com/procount/pinn +[6]: https://osmc.tv/ +[7]: https://github.com/procount/pinn/wiki/How-to-Create-a-Multi-Boot-SD-card-out-of-2-existing-OSes-using-PINN From feda553caebe541995208fe397bf18f96a0d184c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 19:33:14 +0800 Subject: [PATCH 0910/1143] PRF:20181210 How to get started in AI.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @qhwdw 好文章 --- .../tech/20181210 How to get started in AI.md | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/translated/tech/20181210 How to get started in AI.md b/translated/tech/20181210 How to get started in AI.md index ee88bb6961..a88e0588f7 100644 --- a/translated/tech/20181210 How to get started in AI.md +++ b/translated/tech/20181210 How to get started in AI.md @@ -1,28 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: () -[#]: publisher: () -[#]: url: () +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) [#]: subject: (How to get started in AI) [#]: via: (https://opensource.com/article/18/12/how-get-started-ai) [#]: author: (Gordon Haff https://opensource.com/users/ghaff) -学习人工智能如何起步 +学习人工智能如何入门 ====== -在你开始从事人工智能之前,你需要先了解人类的智能。 + +> 在你开始从事人工智能之前,你需要先了解人类的智能。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain-think-ai-intelligence-ccby.png?itok=C-gK01E_) -我曾经问过别人也被别人问过关于学习人工智能最好的方式是什么?我应该去阅读什么?我应该去关注什么?后面我将讲到这些,但是,考虑到人工智能涉及很多领域,我把这个问题分开来讲可能更好理解。 +我曾经问过别人、也被别人问过关于学习人工智能(AI)最好的方式是什么?我应该去阅读什么书?我应该去看什么视频?后面我将讲到这些,但是,考虑到人工智能涉及很多领域,我把这个问题分开来讲可能更好理解。 -学习人工智能很重要的一点是区别开研究方面和应用方面。Google 的 Cassie Kozyrkov 在近日于伦敦举行的 O’Reilly 人工智能会议的一个演讲中 [描述了这个区别][1],并且这是一个很好的区别。 +学习人工智能很重要的一点是区别开研究方面和应用方面。Google 的 Cassie Kozyrkov 在近日于伦敦举行的 O'Reilly 人工智能会议的一个演讲中 [描述了这个区别][1],并且这是一个很好的演讲。 -研究人工智能在本质上是学术性的,在你能够获得人工智能的某些细节之前,需要大量的跨各类学科的数学知识。这部分人工智能关注于算法和驱动人工智能发展的工具。比如,什么样的神经网络结构能够改善视觉识别的结果?我们如何使无监督学习成为更有用的方法?我们能否找到一个更好的方法,去理解深度学习流水线是如何得出答案的? +人工智能研究在本质上是学术性的,在你能够获得人工智能的某些细节之前,需要大量的跨各类学科的数学知识。这部分的人工智能关注于算法和驱动人工智能发展的工具。比如,什么样的神经网络结构能够改善视觉识别的结果?我们如何使无监督学习成为更有用的方法?我们能否找到一个更好的方法,去理解深度学习流水线是如何得出答案的? -另一方面,人工智能应用更多是关于使用现有工具去获取有用的结果。开源在这里发挥了一个重要的作用,那就是免费提供了易于使用的、各种语言的软件。公有云提供商也致力于提供大量的机器学习、模型、以及数据集,这使得人工智能入门比其它的要简单的多。 +另一方面,人工智能应用更多是关于使用现有工具去获取有用的结果。开源在这里发挥了一个重要的作用,那就是免费提供了易于使用的、各种语言的软件。公有云提供商也致力于提供大量的机器学习、模型、以及数据集,这使得人工智能的入门比其它的要简单的多。 -在这个问题上我想补充一点,那就是人工智能的从业者不应该为了故弄玄虚而将它们的工具搞成只输出答案的黑匣子。至少,他们应该去了解不同技术、模型、和数据采集方法的限制和潜在偏差。但不需要去深入研究他们工具链中每个部分的理论。 +在这个问题上我想补充一点,那就是人工智能的从业者不应该将他们的工具视为神秘地输出答案的黑匣子。至少,他们应该去了解不同技术、模型、和数据采集方法的限制和潜在偏差。只是不需要去深入研究他们工具链中每个部分的理论基础。 -虽然在日常工作中人工智能可能并不那么重要,但理解人工智能的大量的背景知识还是很有用的。人工智能已经超越了神经网络上深度学习的狭窄范围,目前神经网络上的强化学习和监督学习已经取得重要成就。例如,人工智能经常被视为是增强(而不是替代)人类判断和决策的一种方法。但是在机器和人类之间切换还有它自己的缺陷。 +虽然在日常工作中人工智能可能并不那么重要,但理解人工智能的大量的背景知识还是很有用的。人工智能已经超越了神经网络上深度学习的狭窄范围,目前神经网络上的强化学习和监督学习已经取得重要成就。例如,人工智能经常被视为是增强(而不是替代)人类判断和决策的一种方法。但是在机器和人类之间交换信息还有其自身的缺陷。 有了这些背景知识,下面是的一些研究领域和资源,你可能发现会很有用。 @@ -32,47 +34,46 @@ 你的计算机科学和数学背景知识决定了你的起点。 -如果你的计算机科学和数据背景知识很差或已经荒芜了,但你还希望能够深入了解人工智能的基本原理,那么从一些数学课程开始将会让你受益。MOOCs 上像非盈利的 [edX][2] 平台和 [Coursera][3] 上都有许多可供你选择的课程(这两个平台都对认证收费,但 edX 上所有的课程,对旁听者是全免费的)。 +如果你的计算机科学和数据背景知识很差或已经荒芜了,但你还希望能够深入了解人工智能的基本原理,那么从一些数学课程开始将会让你受益。MOOC 上像非盈利的 [edX][2] 平台和 [Coursera][3] 上都有许多可供你选择的课程(这两个平台都对认证收费,但 edX 上所有的课程,对旁听者是全免费的)。 典型的基础课程包括: -+ [MIT 的微积分课程][22],从微分开始学习 -+ [线性代数][23] (德克萨斯大学) -+ 概率与统计,比如 MIT 的 [概率 — 不确定性与数据科学][24] +- [MIT 的微积分课程][22],从微分开始学习 +- [线性代数][23] (德克萨斯大学) +- 概率与统计,比如 MIT 的 [概率 —— 不确定性与数据科学][24] +从一个研究的角度去深入人工智能,你可能需要深入所有的这些数据领域,甚至更多。但是上面的内容应该让您在深入研究机器学习和AI之前大致了解可能是最重要的研究分支。 -从一个研究的角度去深入人工智能,你可能需要深入所有的这些数据领域,甚至更多。在深入研究机器学习和人工智能之前,上述的内容应该会让你得到一些常见研究分支的大致概念。 +除了 MOOC 之外,像 [MIT OpenCourseWare][4] 这样的资源也提供了大量的数学和计算机科学课程的大纲和各种支持材料。 -除了 MOOCs 之外,像 [MIT OpenCourseWare][4] 这样的资源也提供了大量的数学和计算机科学课程的大纲和各种支持材料。 - -有了这些基础,你就可以学习更专业的人工智能课程了。Andrew Ng 在斯坦福大学教的 “AI MOOC” 就是整个在线课程中最早流行起来的课程之一。今天,他的 [神经网络和深度学习][5] 也是 Coursera 深度学习专业的一部分。在 edX 上也有相关的一些项目,比如,哥伦比亚大学提供的一个 [人工智能 MicroMasters][6]。 +有了这些基础,你就可以学习更专业的人工智能课程了。吴恩达从他在斯坦福大学时教的 “AI MOOC” 就是整个在线课程领域中最早流行起来的课程之一。今天,他的 [神经网络和深度学习][5] 也是 Coursera 深度学习专业的一部分。在 edX 上也有相关的一些项目,比如,哥伦比亚大学提供的一个 [人工智能 MicroMasters][6]。 除了课程之外,也可以在网上找到各种范例和其它学习材料。这些包括: * [神经网络和深度学习][7] - * MIT 的 Ian Goodfellow、Yoshua Bengio、Aaron Courville 出版的 [深度学习][8] + * MIT 出版的 Ian Goodfellow、Yoshua Bengio、Aaron Courville 的《[深度学习][8]》 ### 应用人工智能 -人工智能应用更关注于使用可用的工具,而不是去构建新工具。对一些底层的数学,尤其是统计学的了解仍然是非常有用的 — 甚至可以说是必需的 — 但对这些知识的了解程度不像研究人工智能的要求那么高。 +人工智能应用更关注于使用可用的工具,而不是去构建新工具。对一些底层的数学,尤其是统计学的了解仍然是非常有用的 —— 甚至可以说是必需的 —— 但对这些知识的了解程度不像研究人工智能的要求那么高。 -在这里编程是核心技能。虽然可以使用不同的编程语言去做,但是一些库和工具集 — 比如 Python 的 [PyTorch][9],在这方面有很好的专长。尤其是,如果你有一些编程方面的背景知识,MIT 的 [计算机科学入门和使用 Python 编程][10],它是基于 MIT 的 6.001 课程,是一个非常好的启蒙课程。如果你编程零基础,来自密歇根大学的 Charles Severance 的 [人人学编程(Python 使用入门)][11] 是个很好的开端,它不会像 MIT 的课程那样,把你一下子扔进代码的汪洋大海。 +在这里编程是核心技能。虽然可以使用不同的编程语言去做,但是一些库和工具集 —— 比如 Python 的 [PyTorch][9],依赖于 Python,所以这是一个应该掌握的好技能。尤其是,如果你有某种程度上的编程背景,MIT 的 [计算机科学入门和使用 Python 编程][10],它是基于 MIT 的 6.001 在校课程,是一个非常好的启蒙课程。如果你编程零基础,来自密歇根大学的 Charles Severance 的 [人人学编程(Python 使用入门)][11] 是个很好的开端,它不会像 MIT 的课程那样,把你一下子扔进代码的汪洋大海。 -[R 编程语言][12] 也是一个应该增加到你的技能库中的很有用的技能。虽然它在机器学习(ML)中使用的很少,但它在其它数据科学任务中很常见,并且经常与人工智能/机器学习和数据科学的应用实践结合在一起。比如,许多使用原始和数据清洗相关的应用任务,此外还有你最终要使用的诸如此类的分析技术,都将使用到它。一个 MOOC 系列,像 Harvard 的 [数据科学认证][13] 就是一整套课程的一个例子,这些课程介绍了如何去很好地处理数据。 +[R 编程语言][12] 也是一个应该增加到你的技能库中的很有用的技能。虽然它在机器学习(ML)中使用的很少,但它在其它数据科学任务中很常见,并且经常与人工智能/机器学习和数据科学的应用实践结合在一起。例如,与组织和清理数据相关的许多任务同样适用于您最终使用的任何分析技术。像哈佛的 [数据科学认证][13] 这样的一个 MOOC 系列就是一整套课程的一个例子,这些课程介绍了如何去很好地处理数据。 -如果你从事人工智能方面的工作,那么你很可能会遇到的另一个开源软件库就是 [TensorFlow][14]。它最初是由 Google 人工智能团队中的 Google 智慧团队的研发工程师开发的。[Google 提供了许多教程][15] 让你通过高级 Keras API 去开始使用 TensorFlow。你既可以在 Google 云上也可以在本地运行 TensorFlow。 +如果你从事人工智能方面的工作,那么你很可能会遇到的另一个开源软件库就是 [TensorFlow][14]。它最初是由 Google 人工智能团队中的 Google 大脑团队的研发工程师开发的。[Google 提供了许多教程][15] 让你通过高级 Keras API 去开始使用 TensorFlow。你既可以在 Google 云上也可以在本地运行 TensorFlow。 通常,大的公有云提供商都提供在线数据集和易于使用的机器学习服务。但是,在你开始去 “玩” 数据集和应用之前,你需要考虑清楚,一旦开始选定一个提供商,你将被它们 “锁定” 的程度。 -你的探索学习项目所需的数据集可以从许多不同的源获得。除了公有云提供商之外,[Kaggle][16] 是另一个受欢迎的源,总体来看,它也是一个比较好的学习源。以数字形式提供的政府数据也越来越多了。美国联邦政府的 [Data.gov][17] 声称它提供超过 300,000 的数据集。州和地方政府也发布从餐馆健康评级到狗的名字的所有数据。 +你的探索学习项目所需的数据集可以从许多不同的源获得。除了公有云提供商之外,[Kaggle][16] 是另一个受欢迎的源,总体来看,它也是一个比较好的学习源。以数字形式提供的政府数据也越来越多了。美国联邦政府的 [Data.gov][17] 声称它提供超过 300,000 个数据集。各州和地方政府也发布从餐馆健康评级到狗的名字的所有数据。 ### 研究和应用人工智能兼而有之 -最后我想说明的一点是,人工智能不仅是与数学、编程、和数据有关的一个宽泛的主题。人工智能作为一个综合体涉及到了许多其它的领域,包括心理学、语言学、博弈论、运筹学和控制系统。确实,现在有一些人工智能研究者担心,由于处理能力和大数据的结合,使得该领域过于关注最近才变得强大和有趣的少数几个技术。在了解人类如何学习和推理方面,许多长期存在的问题仍未解决。不管怎样,对这些广泛存在的问题有一个了解,将更好地让你在更广泛的背景中评估人工智能。 +最后我想说明的一点是,人工智能不仅是与数学、编程、数据有关的一个宽泛主题。人工智能作为一个综合体涉及到了许多其它的领域,包括心理学、语言学、博弈论、运筹学和控制系统。确实,现在有一些人工智能研究者担心,由于处理能力和大数据的结合,使得该领域过于关注最近才变得强大和有趣的少数几个技术。在了解人类如何学习和推理方面,许多长期存在的问题仍未解决。不管怎样,对这些广泛存在的问题有一个了解,将更好地让你在更广泛的背景中评估人工智能。 -我比较喜欢的其中一个示例是杜克大学的 [人类和自治实验室][18]。这个实验室的工作涉及人类与机器工作所面临的全部挑战,比如,如果自动化设备失效,自动驾驶仪如何设计才能让那些[“洋红色的孩子“][19] 快速取得对飞机的控制。一个基础的大脑科学课程,比如 MIT 的 [心理学导论][20],它提供了关于人类智能和机器智能之间关系的一些很有用的内容。另一个类似的课程是,MIT 电子工程与计算机科学系已故教授 Marvin Minsky 的 [心灵的社会][21]。 +我比较喜欢的其中一个示例是杜克大学的 [人类和自治实验室][18]。这个实验室的工作涉及人机协同所面临的各种挑战,比如,如果自动化设备失效,自动驾驶仪如何设计才能让那些[“洋红色的孩子“][19] 快速取得控制。有一个基础的大脑科学课程,比如 MIT 的 [心理学导论][20],它提供了关于人类智能和机器智能之间关系的一些很有用的内容。另一个类似的课程是,MIT 电子工程与计算机科学系已故教授 Marvin Minsky 的 [心灵的社会][21]。 -关于学习人工智能,假如说有一个最重要的挑战,那它不是原材料和工具不易获得,而是它们只有这么多。我的目标并不是给你一个全面的指导,相反,而是指出了你可以去学习的不同路径,以及为你提供一些可能的起点。祝你学习愉快! +关于学习人工智能,假如说有一个最重要的挑战,那它不是原材料和工具不易获得,因为它们有如此之多。我的目标并不是给你一个全面的指导,相反,而是指出了你可以去学习的不同路径,以及为你提供一些可能的起点。祝你学习愉快! -------------------------------------------------------------------------------- @@ -81,7 +82,7 @@ via: https://opensource.com/article/18/12/how-get-started-ai 作者:[Gordon Haff][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b2fa053297477892690da95ad319e5706e1fe838 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 19:34:04 +0800 Subject: [PATCH 0911/1143] PUB:20181210 How to get started in AI.md @qhwdw https://linux.cn/article-10356-1.html --- .../tech => published}/20181210 How to get started in AI.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181210 How to get started in AI.md (99%) diff --git a/translated/tech/20181210 How to get started in AI.md b/published/20181210 How to get started in AI.md similarity index 99% rename from translated/tech/20181210 How to get started in AI.md rename to published/20181210 How to get started in AI.md index a88e0588f7..07a21f9910 100644 --- a/translated/tech/20181210 How to get started in AI.md +++ b/published/20181210 How to get started in AI.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10356-1.html) [#]: subject: (How to get started in AI) [#]: via: (https://opensource.com/article/18/12/how-get-started-ai) [#]: author: (Gordon Haff https://opensource.com/users/ghaff) From d67cadc6cd6a9009eaa120deb87f928944a3dbb5 Mon Sep 17 00:00:00 2001 From: chizelin Date: Mon, 17 Dec 2018 21:10:24 +0800 Subject: [PATCH 0912/1143] [translated] 3 best practices for continuous integration and deployment --- ...r continuous integration and deployment.md | 138 ------------------ ...r continuous integration and deployment.md | 137 +++++++++++++++++ 2 files changed, 137 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20181115 3 best practices for continuous integration and deployment.md create mode 100644 translated/tech/20181115 3 best practices for continuous integration and deployment.md diff --git a/sources/tech/20181115 3 best practices for continuous integration and deployment.md b/sources/tech/20181115 3 best practices for continuous integration and deployment.md deleted file mode 100644 index 09e10f187b..0000000000 --- a/sources/tech/20181115 3 best practices for continuous integration and deployment.md +++ /dev/null @@ -1,138 +0,0 @@ -[Translating by ChiZelin] -3 best practices for continuous integration and deployment -====== -Learn about automating, using a Git repository, and parameterizing Jenkins pipelines. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M) - -The article covers three key topics: automating CI/CD configuration, using a Git repository for common CI/CD artifacts, and parameterizing Jenkins pipelines. - -### Terminology - -First things first; let's define a few terms. **CI/CD** is a practice that allows teams to quickly and automatically test, package, and deploy their applications. It is often achieved by leveraging a server called **[Jenkins][1]** , which serves as the CI/CD orchestrator. Jenkins listens to specific inputs (often a Git hook following a code check-in) and, when triggered, kicks off a pipeline. - -A **pipeline** consists of code written by development and/or operations teams that instructs Jenkins which actions to take during the CI/CD process. This pipeline is often something like "build my code, then test my code, and if those tests pass, deploy my application to the next highest environment (usually a development, test, or production environment)." Organizations often have more complex pipelines, incorporating tools such as artifact repositories and code analyzers, but this provides a high-level example. - -Now that we understand the key terminology, let's dive into some best practices. - -### 1\. Automation is key - -To run CI/CD on a PaaS, you need the proper infrastructure to be configured on the cluster. In this example, I will use [OpenShift][2]. - -"Hello, World" implementations of this are quite simple to achieve. Simply run **oc new-app jenkins- ** and voilà, you have a running Jenkins server ready to go. Uses in the enterprise, however, are much more complex. In addition to the Jenkins server, admins will often need to deploy a code analysis tool such as SonarQube and an artifact repository such as Nexus. They will then have to create pipelines to perform CI/CD and Jenkins slaves to reduce the load on the master. Most of these entities are backed by OpenShift resources that need to be created to deploy the desired CI/CD infrastructure. - -Eventually, the manual steps required to deploy your CI/CD components may need to be replicated, and you might not be the person to perform those steps. To ensure the outcome is produced quickly, error-free, and exactly as it was before, an automation method should be incorporated in the way your infrastructure is created. This can be an Ansible playbook, a Bash script, or any other way you would like to automate the deployment of CI/CD infrastructure. I have used [Ansible][3] and the [OpenShift-Applier][4] role to automate my implementations. You may find these tools valuable, or you may find something else that works better for you and your organization. Either way, you'll find that automation significantly reduces the workload required to recreate CI/CD components. - -#### Configuring the Jenkins master - -Outside of general "automation," I'd like to single out the Jenkins master and talk about a few ways admins can take advantage of OpenShift to automate Jenkins configuration. The Jenkins image from the [Red Hat Container Catalog][5] comes packaged with the [OpenShift-Sync plugin][6] installed. In the [video][7], we discuss how this plugin can be used to create Jenkins pipelines and slaves. - -To create a Jenkins pipeline, create an OpenShift BuildConfig similar to this: - -``` -apiVersion: v1 -kind: BuildConfig -... -spec:   -  source:       -    git:   -      ref: master       -      uri:   -  ...   -  strategy:     -    jenkinsPipelineStrategy:     -      jenkinsfilePath: Jenkinsfile       -    type: JenkinsPipeline -``` - -The OpenShift-Sync plugin will notice that a BuildConfig with the strategy **jenkinsPipelineStrategy** has been created and will convert it into a Jenkins pipeline, pulling from the Jenkinsfile specified by the Git source. An inline Jenkinsfile can also be used instead of pulling from one from a Git repository. See the [documentation][8] for more information. - -To create a Jenkins slave, create an OpenShift ImageStream that starts with the following definition: - -``` -apiVersion: v1 -kind: ImageStream -metadata: -  annotations: -    slave-label: jenkins-slave -    labels: -      role: jenkins-slave -… -``` - -Notice the metadata defined in this ImageStream. The OpenShift-Sync plugin will convert any ImageStream with the label **role: jenkins-slave** into a Jenkins slave. The Jenkins slave will be named after the value from the **slave-label** annotation. - -ImageStreams work just fine for simple Jenkins slave configurations, but some teams will find it necessary to configure nitty-gritty details such as resource limits, readiness and liveness probes, and instance caps. This is where ConfigMaps come into play: - -``` -apiVersion: v1 -kind: ConfigMap -metadata: -  labels: -  role: jenkins-slave -... -data: -  template1: |- -    -``` - -Notice that the **role: jenkins-slave** label is still required to convert the ConfigMap into a Jenkins slave. The **Kubernetes pod template** consists of a lengthy bit of XML that will configure every detail to your organization's liking. To view this XML, as well as more information on converting ImageStreams and ConfigMaps into Jenkins slaves, see the [documentation][9]. - -Notice with the three examples shown above that none of the operations required an administrator to make manual changes to the Jenkins console. By using OpenShift resources, Jenkins can be configured in a way that is easily automated. - -### 2\. Sharing is caring - -The second best practice is maintaining a Git repository of common CI/CD artifacts. The main idea is to prevent teams from reinventing the wheel. Imagine your team needs to perform a blue/green deployment to an OpenShift environment as part of the pipeline's CD phase. The members of your team responsible for writing the pipeline may not be OpenShift experts, nor may they have the bandwidth to write this functionality from scratch. Luckily, somebody has already written a function that incorporates that functionality in a common CI/CD repository, so your team can use that function instead of spending time writing one. - -To take this a step further, your organization may decide to maintain entire pipelines. You may find that teams are writing pipelines with similar functionality. It would be more efficient for those teams to use a parameterized pipeline from a common repository as opposed to writing their own from scratch. - -### 3\. Less is more - -As I hinted in the previous section, the third and final best practice is to parameterize your CI/CD pipelines. Parameterization will prevent an over-abundance of pipelines, making your CI/CD system easier to maintain. Imagine I have multiple regions where I can deploy my application. Without parameterization, I would need a separate pipeline for each region. - -To parameterize a pipeline written as an OpenShift build config, add the **env** stanza to the configuration: - -``` -... -spec: -  ... -  strategy: -    jenkinsPipelineStrategy: -      env: -      - name: REGION -        value: US-West           -      jenkinsfilePath: Jenkinsfile       -    type: JenkinsPipeline -``` - -With this configuration, I can pass the **REGION** parameter the pipeline to deploy my application to the specified region. - -The [video][7] provides a more substantial case where parameterization is a must. Some organizations decide to split up their CI/CD pipelines into separate CI and CD pipelines, usually, because there is some sort of approval process that happens before deployment. Imagine I have four images and three different environments to deploy to. Without parameterization, I would need 12 CD pipelines to allow all deployment possibilities. This can get out of hand very quickly. To make maintenance of the CD pipeline easier, organizations would find it better to parameterize the image and environment to allow one pipeline to perform the work of many. - -### Summary - -CI/CD at the enterprise level tends to become more complex than many organizations anticipate. Luckily, with Jenkins, there are many ways to seamlessly provide automation of your setup. Maintaining a Git repository of common CI/CD artifacts will also ease the effort, as teams can pull from maintained dependencies instead of writing their own from scratch. Finally, parameterization of your CI/CD pipelines will reduce the number of pipelines that will have to be maintained. - -If you've found other practices you can't do without, please share them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/11/best-practices-cicd - -作者:[Austin Dewey][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/adewey -[b]: https://github.com/lujun9972 -[1]: https://jenkins.io/ -[2]: https://www.openshift.com/ -[3]: https://docs.ansible.com/ -[4]: https://github.com/redhat-cop/openshift-applier -[5]: https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/openshift3/jenkins-2-rhel7 -[6]: https://github.com/openshift/jenkins-sync-plugin -[7]: https://www.youtube.com/watch?v=zlL7AFWqzfw -[8]: https://docs.openshift.com/container-platform/3.11/dev_guide/dev_tutorials/openshift_pipeline.html#the-pipeline-build-config -[9]: https://docs.openshift.com/container-platform/3.11/using_images/other_images/jenkins.html#configuring-the-jenkins-kubernetes-plug-in diff --git a/translated/tech/20181115 3 best practices for continuous integration and deployment.md b/translated/tech/20181115 3 best practices for continuous integration and deployment.md new file mode 100644 index 0000000000..0706d70544 --- /dev/null +++ b/translated/tech/20181115 3 best practices for continuous integration and deployment.md @@ -0,0 +1,137 @@ +持续集成与部署的3个最佳实践 +====== +了解自动化,使用 Git 存储库以及参数化 Jenkins 管道。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M) + +本文涵盖了三个关键主题:自动化 CI/CD 配置、使用 Git 存储库处理常见的 CI/CD 工件、参数化 Jenkins 管道。 + +### 术语 + +首先,我们定义一些术语。**CI/CD** 是允许团队快速自动化测试、打包、部署其应用程序的实践。它通常通过利用名为 **[Jenkins][1]** 的服务器来实现,该服务器充当 CI/CD 协调器。Jenkins 侦听特定输入(通常是代码签入后的 Git hook),并在触发时启动管道。 + +**pipeline** 由开发和/或运营团队编写的代码组成,这些代码指导 Jenkins 在 CI/CD 过程中采取哪些操作。这个流水线通常类似于“构建我的代码,然后测试我的代码,如果这些测试通过,则把我的应用程序部署到下一个最高环境(通常是开发、测试或生产环境)”。组织通常具有更复杂的流水线,并入了诸如工件存储库和代码分析器之类的工具,但是这提供了一个高级示例。 + +现在我们了解了关键术语,让我们深入研究一些最佳实践。 + +### 1\. 自动化是关键 + +要在 PaaS 上运行 CI/CD,需要在集群上配置适当的基础设施。在这个例子中,我将使用 [OpenShift][2]。 + +"Hello, World" 的实现很容易实现。简单地运行 **oc new-app jenkins- ** 和 voilà, 你已经准备好运行 Jenkins 服务器了。然而,在企业中的使用要复杂得多。除了 Jenkins 服务器之外,管理员通常还需要部署代码分析工具(如 SonarQube)和构件库(如 Nexus)。然后,它们必须创建管道来执行 CI/CD 和 Jenkins 从服务器,以减少主服务器的负载。这些实体中的大多数都由 OpenShift 资源支持,需要创建这些资源来部署所需的 CI/CD 基础设施。 + +最后,部署 CI/CD 组件所需要的手动步骤可能是需要被重复的,并且你可能不想成为执行那些重复步骤的人。为了确保结果能够像以前一样快速、无错误和准确地产生,应该在创建基础设施的方式中结合自动化方法。这可以是一个 Ansible 剧本、一个 Bash 脚本,或者任何您希望自动化 CI/CD 基础设施部署的其他方式。我已经使用 [Ansible][3] 和 [OpenShift-Applier][4] 角色来自动化我的实现。您可能会发现这些工具很有价值,或者您可能会发现其他一些对您和组织更有效的工具。无论哪种方式,您都将发现自动化显著地减少了重新创建 CI/CD 组件所需的工作量。 + +#### 配置Jenkins主服务器 + +除了一般的“自动化”之外,我想单独介绍一下 Jenkins 主服务器,并讨论管理员如何利用 OpenShift 来自动化配置 Jenkins。来自 [Red Hat Container Catalog][5] 的 Jenkins 映像已经安装了 [OpenShift-Sync plugin][6]。在 [视频][7] 中,我们将讨论如何使用这个插件来创建 Jenkins 管道和从设备。 + +要创建 Jenkins 流水线,请创建一个类似于下面的 OpenShift BuildConfig: + +``` +apiVersion: v1 +kind: BuildConfig +... +spec:   +  source:       +    git:   +      ref: master       +      uri:   +  ...   +  strategy:     +    jenkinsPipelineStrategy:     +      jenkinsfilePath: Jenkinsfile       +    type: JenkinsPipeline +``` + +OpenShift-Sync 插件将注意到已经创建了带有 **jenkinsPipelineStrategy** 策略的 BuildConfig,并将其转换为 Jenkins 管道,从 Git 源指定的 Jenkins 文件中提取。也可以使用内联 Jenkinsfile,而不是从 Git 存储库中提取。有关更多信息,请参阅[文档][8]。 + +要创建 Jenkins 从站,请创建一个 OpenShift ImageStream,它从以下定义开始: + +``` +apiVersion: v1 +kind: ImageStream +metadata: +  annotations: +    slave-label: jenkins-slave +    labels: +      role: jenkins-slave +… +``` + +注意在这个 ImageStream 中定义的元数据。OpenShift-Sync 插件将把带有标签 **role: jenkins-slave** 的任何ImageStream 转换为 Jenkins 从站。Jenkins 从站将以 **slave-label** 注释中的值命名。 + +ImageStreams 对于简单的 Jenkins 从属配置工作得很好,但是一些团队会发现有必要配置一些细节详情,比如资源限制、准备就绪和活动性探测,以及实例帽。这就是 ConfigMap 发挥作用的地方: + +``` +apiVersion: v1 +kind: ConfigMap +metadata: +  labels: +  role: jenkins-slave +... +data: +  template1: |- +    +``` + +注意,仍然需要角色:jenkins-slave 标签来将 ConfigMap 转换为 Jenkins slave。Kubernetes pod 模板由一长段 XML 组成,它将根据组织的喜好配置每个细节。要查看此 XML,以及有关将 ImageStreams 和 ConfigMaps 转换为 Jenkins 从属的更多信息,请参阅[文档][9]。 + +请注意上面所示的三个示例,其中没有一个操作需要管理员对 Jenkins 控制台进行手动更改。通过使用 OpenShift 资源,可以简单的自动化方式配置 Jenkins。 + +### 2\. 分享就是关心 + +第二个最佳实践是维护一个公共 CI/CD 工件的 Git 存储库。主要思想是防止团队重新发明轮子。假设您的团队需要执行到 OpenShift 环境的蓝色/绿色部署,作为管道 CD 阶段的一部分。负责编写流水线的团队成员可能不是 OpenShift 专家,也不可能具有从头开始编写此功能的能力。幸运的是,有人已经编写了一个将此功能合并到一个公共 CI/CD 存储库中的函数,因此您的团队可以使用该函数而不是花时间编写一个函数。 + +为了更进一步,您的组织可能决定维护整个管道。您可能会发现团队正在编写具有相似功能的流水线。对于那些团队来说,使用来自公共存储库的参数化管道要比从头开始编写自己的管道更有效。 + +### 3\. 少即是多 + +正如我在前一节中提到的,第三个也是最后一个最佳实践是参数化您的 CI/CD 管道。参数化将防止过多的管道,使您的 CI/CD 系统更容易维护。假设我有多个区域可以部署应用程序。如果没有参数化,我需要为每个区域设置单独的管道。 + +要参数化作为 OpenShift 构建配置编写的管道,请将 **env** 节添加到配置: + +``` +... +spec: +  ... +  strategy: +    jenkinsPipelineStrategy: +      env: +      - name: REGION +        value: US-West           +      jenkinsfilePath: Jenkinsfile       +    type: JenkinsPipeline +``` + +使用此配置,我可以传递 **REGION** 参数管道以将我的应用程序部署到指定区域。 + +这有一个[视频][7]提供了一个更实质性的情况,其中参数化是必须的。一些组织决定把他们的 CI/CD 管道分割成单独的 CI 和 CD 管道,通常是因为在部署之前有一些审批过程。假设我有四个映像和三个不同的环境要部署。如果没有参数化,我需要12个 CD 管道来允许所有部署可能性。这会很快失去控制。为了使 CD 流水线的维护更容易,组织会发现将映像和环境参数化以便允许一个流水线执行多个流水线的工作会更好。 + +### 总结 + +企业级的 CI/CD 往往比许多组织预期的更加复杂。幸运的是,对于 Jenkins,有很多方法可以无缝地提供设置的自动化。维护一个公共 CI/CD 工件的 Git 存储库也会减轻工作量,因为团队可以从维护的依赖项中提取而不是从头开始编写自己的依赖项。最后,CI/CD 管道的参数化将减少必须维护的管道的数量。 + +如果您找到了其他不可或缺的做法,请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/best-practices-cicd + +作者:[Austin Dewey][a] +选题:[lujun9972][b] +译者:[ChiZelin](https://github.com/ChiZelin) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/adewey +[b]: https://github.com/lujun9972 +[1]: https://jenkins.io/ +[2]: https://www.openshift.com/ +[3]: https://docs.ansible.com/ +[4]: https://github.com/redhat-cop/openshift-applier +[5]: https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/openshift3/jenkins-2-rhel7 +[6]: https://github.com/openshift/jenkins-sync-plugin +[7]: https://www.youtube.com/watch?v=zlL7AFWqzfw +[8]: https://docs.openshift.com/container-platform/3.11/dev_guide/dev_tutorials/openshift_pipeline.html#the-pipeline-build-config +[9]: https://docs.openshift.com/container-platform/3.11/using_images/other_images/jenkins.html#configuring-the-jenkins-kubernetes-plug-in From 8b453ba56c5996025518197a77f29fc0bc3a43ca Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 21:42:22 +0800 Subject: [PATCH 0913/1143] PRF:20181202 Drive a locomotive through your Linux terminal.md @geekpi --- ... locomotive through your Linux terminal.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/translated/tech/20181202 Drive a locomotive through your Linux terminal.md b/translated/tech/20181202 Drive a locomotive through your Linux terminal.md index 540f3de7ec..e9bdd2c30f 100644 --- a/translated/tech/20181202 Drive a locomotive through your Linux terminal.md +++ b/translated/tech/20181202 Drive a locomotive through your Linux terminal.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (Drive a locomotive through your Linux terminal) [#]: via: (https://opensource.com/article/18/12/linux-toy-sl) @@ -9,42 +9,42 @@ 在 Linux 终端中开火车 ====== -使用 sl 命令,你可以让自己坐上火车,有一个有趣的命令行体验。 + +> 使用 sl 命令,你可以让自己驾驶火车,带来一个有趣的命令行体验。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-sl.png?itok=WPTj0Ga9) -现在是 12 月,每个 Linux 终端用户都值得这一年的奖励。因此, 我们将为你带来一个 Linux 命令行玩具的出现日历。什么是命令行玩具?它可能是一个游戏、一个小的无意义的打发时间的东西,或者为你在终端带来快乐的东西。 +现在是 12 月,每个 Linux 终端用户都值得这一年的奖励。因此,我们将为你带来一个 Linux 命令行玩具的日历。什么是命令行玩具?它可能是一个游戏、一个小的无意义的打发时间的东西,或者为你在终端带来快乐的东西。 -今天的 Linux 命令行玩具是来自 Opensource.com 社区版主 [Ben Cotton][1] 的建议。Ben 建议 `sl`,它是蒸汽机车的简称。 +今天的 Linux 命令行玩具来自 Opensource.com 社区版主 [Ben Cotton][1] 的建议。Ben 建议 `sl`,它是蒸汽机车steam locomotive的简称。 -对于 Linux **ls** 命令来说,它也是一个常见的错误,而不是巧合。想要不再打错吗?尝试安装 **sl**。它可能已经在默认仓库中打包。对我而言,在 Fedora 中,这意味着安装起来很简单: +而对于 Linux `ls` 命令来说,`sl` 也是一个常见的拼写错误,这并不是巧合(LCTT 译注:意即 `sl` 是专门用来设计提醒 `ls` 打错的)。想要不再打错吗?尝试安装 `sl`。它可能已经在默认仓库中打包。对我而言,在 Fedora 中,这意味着安装起来很简单: ``` $ sudo dnf install sl -y ``` -现在,只需键入**sl** 即可测试。 +现在,只需键入 `sl` 即可测试。 ![](https://opensource.com/sites/default/files/uploads/linux-toy-sl-animated.gif) -你可能会像我一样注意到,**Ctrl+C** 不会让你的火车脱轨,所以你必须等待整列火车通过。这会让你知道打错了 **ls**! +你可能会像我一样注意到,`Ctrl+C` 不会让你的火车脱轨,所以你必须等待整列火车通过。这会让你知道打错了 `ls`! +想查看 `sl` 源码?它已经在[在 GitHub 上][2]。 -想查看 **sl** 源码?它已经在[在 GitHub 上][2]。 +`sl` 也是分享我个人关于开源许可证的见解的绝佳机会。虽然它的[许可证][3]“足够开源”能够打包到我的发行版,但技术上而言,它并不是 [OSI 批准][4]的许可证。在其版权行之后,许可证的内容很简单: -**sl** 也是分享关于开源许可的个人 PSA 的绝佳机会。虽然它的[许可证][3]“足够开源”以便为我的发行版打包,但技术上而言,它并不是 [OSI 批准][4]的许可证。在版权行之后,许可证的内容很简单: - -``` -Everyone is permitted to do anything on this program including copying, -modifying, and improving, unless you try to pretend that you wrote it. -i.e., the above copyright notice has to appear in all copies. -THE AUTHOR DISCLAIMS ANY RESPONSIBILITY WITH REGARD TO THIS SOFTWARE. -``` +> 每个人都可以在这个程序上做任何事情,包括复制,修改和改进,除非你试图假装你写了它。 +> +> 即,上述版权声明必须出现在所有副本中。 +> +> 作者对本软件不承担任何责任。 遗憾的是,当你选择未经 OSI 批准的许可证时,你可能会意外地为你的用户带来额外的工作,因为他们必须要弄清楚你的许可证是否适用于他们的情况。他们的公司政策是否允许他们做贡献?甚至他们可以合法地使用该程序吗?许可证是否与他们希望与之集成的其他程序的许可证相匹配? 除非你是律师(也许,即使你是律师),否则在非标准许可证范围内选择可能会很棘手。因此,如果你仍在寻找新年的方案,为什么不把仅 OSI 批准的许可证作为你 2019 年新项目的选择呢。 -这并不是对作者的不尊重。**sl** 仍然是一个很棒的小命令行玩具。 +这并不是对作者的不尊重。`sl` 仍然是一个很棒的小命令行玩具。 你有一个你认为我应该介绍的最喜欢的命令行玩具吗?这个系列的日历大部分已经完成,但我还剩下几个空余。请在下面的评论中告诉我,我会了解一下。如果有空间,我会尝试包含它。如果没有,但我得到了一些好的投稿,我会在最后做一些荣誉介绍。 @@ -57,7 +57,7 @@ via: https://opensource.com/article/18/12/linux-toy-sl 作者:[Jason Baker][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/) 荣誉推出 @@ -67,4 +67,4 @@ via: https://opensource.com/article/18/12/linux-toy-sl [2]: https://github.com/mtoyoda/sl [3]: https://github.com/mtoyoda/sl/blob/master/LICENSE [4]: https://opensource.org/licenses -[5]: https://opensource.com/article/18/12/linux-toy-boxes \ No newline at end of file +[5]: https://opensource.com/article/18/12/linux-toy-boxes From e18d163096098580b2b780edc8fa2af98c4f93e6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 21:43:24 +0800 Subject: [PATCH 0914/1143] PUB:20181202 Drive a locomotive through your Linux terminal.md @geekpi https://linux.cn/article-10357-1.html --- ...20181202 Drive a locomotive through your Linux terminal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181202 Drive a locomotive through your Linux terminal.md (98%) diff --git a/translated/tech/20181202 Drive a locomotive through your Linux terminal.md b/published/20181202 Drive a locomotive through your Linux terminal.md similarity index 98% rename from translated/tech/20181202 Drive a locomotive through your Linux terminal.md rename to published/20181202 Drive a locomotive through your Linux terminal.md index e9bdd2c30f..4f1f3b5f19 100644 --- a/translated/tech/20181202 Drive a locomotive through your Linux terminal.md +++ b/published/20181202 Drive a locomotive through your Linux terminal.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (Drive a locomotive through your Linux terminal) [#]: via: (https://opensource.com/article/18/12/linux-toy-sl) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10357-1.html) 在 Linux 终端中开火车 ====== From 8a6a8da15d4e5d44f0745a42e17d6b33051eb48c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 22:39:25 +0800 Subject: [PATCH 0915/1143] PRF:20181121 How to swap Ctrl and Caps Lock keys in Linux.md @jlztan --- ...o swap Ctrl and Caps Lock keys in Linux.md | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md index cf1c56e908..f1da291931 100644 --- a/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md +++ b/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md @@ -1,38 +1,43 @@ -在 Linux 下交换 Ctrl 与 Caps Lock 键 +在 Linux 下交换 Ctrl 与大写锁定键 ====== -Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。 +> Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K) -对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久,Ctrl 和 Caps Lock 键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。) +对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久,Ctrl 和大写锁定键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。) -感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,不评论 Caps Lock 键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上也不可能这样做,因为有的键会位于腕托以下。 +![](https://opensource.com/sites/default/files/uploads/keyboard.jpg) -相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人,并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和 Caps Lock 键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。 +感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,也不评论大写锁定键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上不可能这样做到,因为有的键会位于腕托以下。 + +相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人,并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和大写锁定键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。 ### GNOME 3 -[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换 Caps Lock 和 Ctrl 键,如下所示。![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png) +[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换大写锁定和 Ctrl 键,如下所示。 + +![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png) 具体步骤如下: 1. 从你的 Linux 发行版的软件仓库安装 Tweaks 工具。 2. 启动 Tweaks 程序。 - 3. 从左侧菜单中选择“Keyboard & Mouse”。 - 4. 单击“Additional Layout Options”。 - 5. 在打开的窗口中单击“Ctrl position”,然后选择“Swap Ctrl and Caps Lock”。 + 3. 从左侧菜单中选择 “Keyboard & Mouse”。 + 4. 单击 “Additional Layout Options”。 + 5. 在打开的窗口中单击 “Ctrl position”,然后选择 “Swap Ctrl and Caps Lock”。 -完成!顺便说一句,你可以使用 Tweaks 工具做很多很酷的事情。例如,我将我的右 Ctrl 键设置为 Compose 键,这让我可以使用键盘快捷键打出各种字符,例如通过 `Compose+c+,`、`Compose+e+'`、`Compose+O+^` 以及 `Compose+n+~` 分别键入 ç、é、ô 和 ñ。 +完成!顺便说一句,你可以使用 Tweaks 工具做很多很酷的事情。例如,我将我的右 Ctrl 键设置为 Compose 键,这让我可以使用键盘快捷键打出各种字符,例如通过 `Compose+c+,`、`Compose+e+'`、`Compose+o+^` 以及 `Compose+n+~` 分别键入 ç、é、ô 和 ñ。(LCTT 译注:可参考 [Special characters listed by extended compose sequence](https://www.ibm.com/support/knowledgecenter/en/SSKTWP_9.0.0/com.ibm.notes900.help.doc/acc_spec_characters_r.html)) ### KDE -我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [KDE tweaks that will change your life][5] 这篇文章的第 5 项演示了如何重新映射按键。 +我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [将改变你的生命的 KDE tweaks][5] 这篇文章的第 5 项演示了如何重新映射按键。 ### Xfce 据我所知,[Xfce][6] 桌面环境没有一个方便的工具来管理这些(指交换按键)设置。 但是,`setxkbmap` 命令的 `ctrl:swapcaps` 选项可以帮助你完成交换按键的修改。这个修改包含两部分: - 1. 弄清楚命令的用法; + 1. 弄清楚命令的用法; 2. 找出调用命令的位置,以便在桌面启动时激活它。 第一部分非常简单,命令是: @@ -43,7 +48,7 @@ Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示 在终端窗口中执行此命令,以确保结果符合你的预期。 -假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置(在设置管理器中查找“Session and Startup”)里。 +假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置(在设置管理器中查找 “Session and Startup”)里。 还有一种可能性是在文件 `/etc/default/keyboard` 中使用相同的选项,最终可能看起来像这样: @@ -76,7 +81,7 @@ BACKSPACE="guess" ### 其他环境 -最后,上面 StackExchange 的链接中提到的这一点值得强调--配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。 +最后,上面 StackExchange 的链接中提到的这一点值得强调 —— 配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。 `setxkbmap`、`xkeyboard-config`、`keyboard`、`console-setup` 和 `setupcon` 命令的手册都是有用的参考资料。或者,如果你不喜欢阅读手册,可以看一下 [这篇极好的文章][13]。 @@ -87,7 +92,7 @@ via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keybo 作者:[Chris Hermansen][a] 选题:[lujun9972][b] 译者:[jlztan](https://github.com/jlztan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 35fbfdba5426bf989e8b76b687ff6e63f52978e4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 17 Dec 2018 22:40:01 +0800 Subject: [PATCH 0916/1143] PUB:20181121 How to swap Ctrl and Caps Lock keys in Linux.md @jltzan https://linux.cn/article-10358-1.html --- .../20181121 How to swap Ctrl and Caps Lock keys in Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181121 How to swap Ctrl and Caps Lock keys in Linux.md (100%) diff --git a/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/published/20181121 How to swap Ctrl and Caps Lock keys in Linux.md similarity index 100% rename from translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md rename to published/20181121 How to swap Ctrl and Caps Lock keys in Linux.md From af60871a89dad8a6999cba05398c72f075151ca4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 18 Dec 2018 09:03:50 +0800 Subject: [PATCH 0917/1143] translated --- ...on Ubuntu and Other Linux Distributions.md | 111 ------------------ ...on Ubuntu and Other Linux Distributions.md | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md create mode 100644 translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md deleted file mode 100644 index 2c7805cbf2..0000000000 --- a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions) -[#]: via: (https://itsfoss.com/putty-linux/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Install Putty on Ubuntu and Other Linux Distributions -====== - -If I am not wrong, [Putty][1] is perhaps the most popular SSH client for Windows. - -In IT companies, the development environment is usually on a remote Linux system while the developers use Windows as their local system. Putty is used for connecting to the remote Linux system from the Windows machine. - -Putty is not limited to Windows only. You can also use this open source software on Linux and macOS. - -But wait! Why would you use a separate SSH client on Linux when you already have the ‘real’ Linux terminal with you? There are several reasons why you would want to use Putty on Linux. - - * You have used Putty for so long on Windows that you are more comfortable with it. - * You find it difficult to manually edit SSH config file to save the various SSH sessions. You prefer Putty’s graphical way of storing SSH connection. - * You want to debug by connecting to raw sockets and serial ports. - - - -Whatever may be the reason, if you want to use Putty on Ubuntu or any other Linux, you can certainly do so. Let me show you how to do that. - -### Installing Putty on Ubuntu Linux - -![Installing Putty on Linux][2] - -The good news for the Ubuntu users is that Putty is available in the universe repository of Ubuntu. - -To install Putty on Ubuntu, you should first make sure that the universe repository is enabled. - -``` -sudo add-apt-repository universe -``` - -Once you have the universe repository enabled, you should update Ubuntu with this command: - -``` -sudo apt update -``` - -After this, you can install Putty with this command: - -``` -sudo apt install putty -``` - -Once installed, you can start Putty by finding it in the menu. - -As you can see in the screenshot below, the Linux version of Putty looks the same as the Windows version. That’s a relief because you won’t have to fiddle around trying to find your way through a new and changed settings. - -![Putty in Linux][3] - -When you enter the remote system’s [hostname][4] or IP address and connect to it, Putty will utilize the already saved SSH keys in your home directory. - -![Using Putty in Ubuntu Linux][5] - -### Installing Putty on other Linux distributions - -[Putty is available for Debian][6] so you just need to use apt-get or aptitude for installing it. - -``` -sudo apt-get install putty -``` - -Putty is also available for Fedora/Red Hat and can be installed using the default package manager. - -``` -sudo dnf install putty -``` - -You can also easily install Putty in Arch Linux based distributions. - -``` -sudo pacman -S putty -``` - -Remember that Putty is an open source software. You can also install it via source code if you really want to. You can get the source code of Putty from the link below. - -[Download Putty Source Code][8] - -I would always prefer the native Linux terminal over an SSH client like Putty. I feel more at home with the GNOME terminal or [Terminator][7]. However, it’s up to an individual’s choice to use the default terminal or Putty in Linux - -What do you use for managing multiple SSH connections on Linux? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/putty-linux/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.putty.org/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Putty-linux.png?resize=800%2C450&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu.jpeg?resize=800%2C503&ssl=1 -[4]: https://itsfoss.com/change-hostname-ubuntu/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1 -[6]: https://packages.debian.org/jessie/putty -[7]: https://launchpad.net/terminator -[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html diff --git a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..886d5ce5e8 --- /dev/null +++ b/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/putty-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 和其他 Linux 发行版上安装 Putty +====== + +如果我没错,[Putty][1] 可能是 Windows 最受欢迎的 SSH 客户端。 + +I在 IT 公司中,开发环境通常在远程 Linux 系统上,而开发人员则使用 Windows 作为本地系统。Putty 用于从 Windows 机器连接到远程 Linux 系统。 + +Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源软件。 + +但是等等!当你已经拥有“真正的” Linux 终端时,为什么要在 Linux 上使用单独的 SSH 客户端?这有几个想在 Linux 上使用 Putty 的原因。 + + * 你在 Windows 上使用 Putty 已经很久了,你觉得它更舒服。 + * 你发现很难手动编辑 SSH 配置文件以保存各种 SSH 会话。你更喜欢 Putty 图形化保存 SSH 连接的方式。 + * 你想通过连接到原始套接字和串口进行调试。 + + + +无论是什么原因,如果你想在 Ubuntu 或任何其他 Linux 上使用 Putty,你当然可以这样做。让我告诉你如何做到。 + +### 在 Ubuntu Linux 上安装 Putty + +![Installing Putty on Linux][2] + +对于 Ubuntu 用户来说,好消息是 Putty 可以在 Ubuntu 的 universe 仓库中找到。 + +要在 Ubuntu上安装 Putty,首先应确保已启用 universe 仓库。 + +``` +sudo add-apt-repository universe +``` + +启用 universe 存储库后,应使用以下命令更新 Ubuntu: + +``` +sudo apt update +``` + +之后,你可以使用以下命令安装 Putty: + +``` +sudo apt install putty +``` + +安装后,你可以在菜单中找到它来启动 Putty。 + +正如你在下面的截图中看到的,Putty 的 Linux 版本看起来与 Windows 版本相同。这让你松了一口气, 因为你不必再尝试新的设置。 + +![Putty in Linux][3] + +当你输入远程系统的[主机名][4]或 IP 地址并连接到它时,Putty 将使用你主目录中已保存的 SSH 密钥。 + +![Using Putty in Ubuntu Linux][5] + +### 在其他 Linux 发行版上安装 Putty + +[Putty 可用于 Debian][6],所以你只需要使用 apt-get 或 aptitude 来安装它。 + +``` +sudo apt-get install putty +``` + +Putty 也适用于 Fedora/Red Hat,并可以使用默认的包管理器进行安装。 + +``` +sudo dnf install putty +``` + +你还可以在基于 Arch Linux 的发行版中轻松安装 Putty。 + +``` +sudo pacman -S putty +``` + +请记住,Putty 是一款开源软件。如果你真的想要,你也可以通过源代码安装它。你可以从下面的链接获取 Putty 的源代码。 + +[下载 Putty 源代码][8] + +我一直喜欢原生 Linux 终端而不是像 Putty 这样的 SSH 客户端。我觉得 GNOME 终端或 [Terminator][7] 更有家的感觉。但是,在 Linux 中使用默认终端或 Putty 是个人选择。 + +你在 Linux 上管理多个 SSH 连接时使用了什么? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/putty-linux/ + +作者:[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.putty.org/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Putty-linux.png?resize=800%2C450&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu.jpeg?resize=800%2C503&ssl=1 +[4]: https://itsfoss.com/change-hostname-ubuntu/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1 +[6]: https://packages.debian.org/jessie/putty +[7]: https://launchpad.net/terminator +[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html \ No newline at end of file From 9062abccaf10eba0d727e39829955f87b626dd65 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 18 Dec 2018 09:14:59 +0800 Subject: [PATCH 0918/1143] translating --- .../20180717 11 Uses for a Raspberry Pi Around the Office.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md index c1a9e1a165..4eb59ba1a0 100644 --- a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md +++ b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9dbc6d7dea1305a1cd95cda59434fa83e6b09840 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Tue, 18 Dec 2018 10:08:06 +0800 Subject: [PATCH 0919/1143] hankchow translated --- .../20181212 Aliases- DIY Shell Commands.md | 133 ------------------ .../20181212 Aliases- DIY Shell Commands.md | 123 ++++++++++++++++ 2 files changed, 123 insertions(+), 133 deletions(-) delete mode 100644 sources/tech/20181212 Aliases- DIY Shell Commands.md create mode 100644 translated/tech/20181212 Aliases- DIY Shell Commands.md diff --git a/sources/tech/20181212 Aliases- DIY Shell Commands.md b/sources/tech/20181212 Aliases- DIY Shell Commands.md deleted file mode 100644 index 81dce2efe7..0000000000 --- a/sources/tech/20181212 Aliases- DIY Shell Commands.md +++ /dev/null @@ -1,133 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Aliases: DIY Shell Commands) -[#]: via: (https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands) -[#]: author: (Paul Brown https://www.linux.com/users/bro66) - -Aliases: DIY Shell Commands -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/jodi-mucha-540841-unsplash.jpg?itok=n1d1VDUV) - -Aliases, in the context of the Linux shell, are **commands you build yourself** by packing them with combinations of other instructions that are too long or too hard to remember. - -You create an alias by using the word `alias`, then the name of the command you want to create, an equal sign (`=`), and then the Bash command(s) you want your alias to run. For example, `ls` in its base form does not colorize its output, making it difficult to distinguish between directories, files, and links. You can build a new command that shows colors by making an alias like this: - -``` -alias lc='ls --color=auto' -``` - -where `lc` is the name you have picked for your new command. When creating aliases, be sure to check that the name you picked isn't already in use, or you may override an existing command. In this case, `lc` stands for "list (with) color". Notice there is no space in front of or behind the `=`. Finally, you have the regular Bash command(s) you want to run when `lc` is executed. In this case, the `ls` command with the `--color` option. - -After defining your alias, every time you type `lc`, the contents of the current directory will be shown in color. - -But, you may think, "my `ls` command already lists files in different colors!" That is because most Linux distros come with some aliases already set up for you. - -### Aliases you (probably) already have - -Indeed, you can use the `alias` instruction without any options to see what aliases you already have. These will vary by distro, but some typical preset aliases are: - - * `alias ls='ls --color=auto'`: You already saw this one above. The `auto` modifier of the `--color` option tells `ls` to use color when standard output is connected to a terminal. That is, the output of `ls` is going to show up in a terminal window or a text screen, instead of, say, being piped to a file. Other alternatives for `--color` are `always` and `never`. - * `alias cp='cp -i'`: The `-i` option stands for _interactive_. Sometimes, when you use `cp` you may inadvertently overwrite an existing file. By using the `-i`, `cp` will ask you before clobbering anything. - * `alias free='free -m'`: Using `-m` with `free`you can see how much free memory you have and how much your applications are using in megabytes instead of the default bytes. This makes the output of `free` easier to read for a human. - - - -There may be more (or less, or even none), but regardless of what your distribution comes with, you can always use the base form (vs. the aliased form) of a command with the `\` modifier. For example: - -``` -\free -``` - -will execute `free` without the `-m` option, and - -``` -\ls -``` - -will execute `ls` without the `--color=auto` option. - -If you want to get rid or modify the preset aliases forever, note that they live in the global _.bashrc_ file which hangs out in [our old haunt, the _/etc/skel_ directory][1]. - -### Aliases for muscle memory - -Distro designers try their best to predict which aliases are going to be useful for you. But every user is different and comes from a different background. If you are new to GNU+Linux, it may be because you are coming from another system, and the basic commands vary from shell to shell. If you come from a Windows/MS-DOS background, you may want to define an alias like - -``` -alias dir='ls' -``` - -to list files or directories. - -Likewise, - -``` -alias copy='cp' -alias move='mv' -``` - -may also come in handy, at least until you get used to Linux's new lexicon. - -The other problem occurs when mistakes become ingrained in your muscle memory, so you always mistype some words the same way. I, for instance, have great difficulty typing _admnis-_... _adminsi-_... _A-D-M-I-N-I-S-T-R-A-T-I-ON_ ( _phew!_ ) at speed. That is why some users create aliases like - -``` -alias sl='ls' -``` - -and - -``` -alias gerp='echo "You did it *again*!"; grep' -``` - -Although we haven't formally introduced `grep` yet, in its most basic form, it looks for a string of characters in a file or a set of files. It's one of those commands that you will tend to use A LOT once you get to grips with it, as those ingrained mistyping habits that force you to type the instruction twice every time get annoying really quickly. - -Another thing to note in the `gerp` example is that it is not a single instruction, but two. The first one (`echo "You did it *again*!"`) prints out a message reminding you that you misspelled the grep command, then there is a semicolon (`;`) that separates one instruction from the other. Finally, you've got the second command (`grep`) that does the actual grepping. - -Using `gerp` on my system to search for the lines containing the word " _alias_ " in _/etc/skel/.bashrc_ , the output looks like this: - -``` -$ gerp -R alias /etc/skel/.bashrc -You did it *again*! - alias ls='ls --color=auto' - alias grep='grep --colour=auto' - alias egrep='egrep --colour=auto' - alias fgrep='fgrep --colour=auto' -alias cp="cp -i" -alias df='df -h' -alias free='free -m' -alias np='nano -w PKGBUILD' -alias more=less -shopt -s expand_aliases -``` - -Running commands sequentially as part of an alias, or, even better, chaining commands so that one command can use the results coughed up by another, is getting us perilously close to Bash scripting. This has been in the making of this series for quite some time, and we'll start covering it in the very next article. - -For the time being, if you want to get rid of an alias you temporarily set up in a running terminal, use the `unalias` command: - -``` -unalias gerp -``` - -If you want to make your aliases permanent, you can drop them into the _.bashrc_ file you have in your home directory. This is the same thing we did with custom environment variables in [last week's article][2]. - -See you next time! - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands - -作者:[Paul 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://www.linux.com/users/bro66 -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts -[2]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise diff --git a/translated/tech/20181212 Aliases- DIY Shell Commands.md b/translated/tech/20181212 Aliases- DIY Shell Commands.md new file mode 100644 index 0000000000..d7d0c9d096 --- /dev/null +++ b/translated/tech/20181212 Aliases- DIY Shell Commands.md @@ -0,0 +1,123 @@ +命令别名:定义自己的命令 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/jodi-mucha-540841-unsplash.jpg?itok=n1d1VDUV) + +命令别名Alias在 Linux shell 中指的是将一些太长或者太难记的多个命令组合起来,成为一个由用户自定义构建的命令。 + +可以通过 `alias` 命令来创建命令别名。在 `alias` 后面跟上想要创建的别名名称、一个等号(`=`),以及希望使用这个别名来执行的命令,这样一个命令别名就创建好了。举个例子,`ls` 命令在默认情况下是不会对输出的内容进行着色的,这样就不能让用户一眼分辨出目录、文件和连接了。对此,可以创建这样一个命令别名,在输出目录内容的时候为输出内容着色: + +``` +alias lc='ls --color=auto' +``` + +其中 `lc` 是自定义的命令别名,代表“list with color”的意思。在创建命令别名的时候,需要先确认使用的别名是不是已经有对应的命令了,如果有的话,原本的命令就会被覆盖掉了。注意,定义命令别名的时候,`=` 两端是没有空格的。当运行 `lc` 的时候,就相当于执行了 `ls --color` 命令。 + +此后,执行 `lc` 列出目录内容的时候,就会输出带有着色的内容了。 + +你可能会发现你在执行 `ls` 的时候,本来就是输出带有着色的内容。那是因为大部分 Linux 发行版都已经将 `ls` 设定为带有着色的命令别名了。 + +### 可以直接使用的命令别名 + +实际上,执行不带任何内容的 `alias` 命令就可以看到当前已经设定的所有命令别名。对于不同的发行版,包含的命令别名不尽相同,但普遍都会有以下这些命令别名: + + * `alias ls='ls --color=auto'`:这个命令别名在前面已经提到过了。`--color=auto` 参数会让 `ls` 命令在通过标准输出在终端中显示内容时进行着色,而其它情况(例如通过管道输出到文件)下则不进行着色。`--color` 这个参数还可以设置为 `always` 或`never`。 + * `alias cp='cp -i'`:`-i` 参数代表“交互interactive”。在使用 `cp` 命令复制文件的时候,可能会无意中覆盖现有的文件,在使用了 `-i` 参数之后,`cp` 命令会在一些关键操作前向用户发出询问。 + * `alias free='free -m'`:在 `free` 命令后面加上 `-m` 参数,就可以将输出的内存信息以 MiB 这个更方面阅读和计算的单位输出,而不是默认的 Byte 单位。 + + + +你使用的发行版自带的命令别名可能多多少少和上面有些差别。但你都可以在命令前面加上 `\` 修饰符来使用命令的最基本形式。例如: + +``` +\free +``` + +就是直接执行 `free`,而不是 `free -m`。还有: + +``` +\ls +``` + +执行的就是不带有`--color=auto` 参数的 `ls`。 + +如果想要持久地保存命令别名,可以在 `.bashrc` 文件中进行修改。 + +### 使用命令别名纠正错误 + +各种发行版的设计者都会尽量设置用户可能需要用到的命令别名。但是不同的用户的习惯各不相同,一些用户可能刚从其它操作系统迁移到 Linux,而不同操作系统的基本命令又因 shell 而异。因此,对于刚从 Windows/MS-DOS 系统迁移到 Linux 系统的用户,不妨使用 + +``` +alias dir='ls' +``` + +这个命令别名来列出目录内容。 + +类似地, + +``` +alias copy='cp' +alias move='mv' +``` + +也可以在尚未完全熟悉 Linux 的时候用得顺手。 + +还有一种情况,就是在经常出现输入错误的场合中做出容错,例如 Administration 这个单词就很难快速正确地输入,因此很多用户都会设置 + +``` +alias sl='ls' +``` + +以及 + +``` +alias gerp='echo "You did it *again*!"; grep' +``` + + `grep` 命令最基本的用途就是在文件中查找字符串,在熟悉这个命令之后,它一定是最常用的命令之一,因此输入错误导致不得不重输命令就很令人抓狂。 + +在上面 `gerp` 的例子中,包含的不只是一条命令,而是两条。第一条命令 `echo "You did it *again*!"` 输出了一条提醒用户拼写错误的消息,然后使用分号(`;`)把两条命令隔开,再往后才是 `grep` 这一条正确的命令。 + +在我的系统上使用 `gerp` 来搜索 `/etc/skel/.bashrc` 中包含“alias”这个单词的行,就会输出以下内容: + +``` +$ gerp -R alias /etc/skel/.bashrc +You did it *again*! + alias ls='ls --color=auto' + alias grep='grep --colour=auto' + alias egrep='egrep --colour=auto' + alias fgrep='fgrep --colour=auto' +alias cp="cp -i" +alias df='df -h' +alias free='free -m' +alias np='nano -w PKGBUILD' +alias more=less +shopt -s expand_aliases +``` + +在命令别名中以固定的顺序执行多个命令,甚至更进一步,把多个命令串连起来,让后面的命令可以使用到前面的命令的执行结果。这样的做法已经非常接近 bash 脚本了。这篇文章已经接近尾声,我们将在下一篇文章中详细介绍。 + +如果想要删除在终端中临时设置的别名,可以使用 `unalias` 命令。 + +``` +unalias gerp +``` + +如果想要持久保存命令别名,可以将命令别名放在用户主目录的 `.bashrc` 文件中,具体的方法在[上一篇文章][2]中已经介绍过。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands + +作者:[Paul Brown][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/bro66 +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts +[2]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise + From 49e075989b63503a01a547fe52e976862824c72b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 11:08:53 +0800 Subject: [PATCH 0920/1143] PRF:20180504 How a university network assistant used Linux in the 90s.md @geekpi --- ...network assistant used Linux in the 90s.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/talk/20180504 How a university network assistant used Linux in the 90s.md b/translated/talk/20180504 How a university network assistant used Linux in the 90s.md index 3c8b0e8a5d..f9e811986d 100644 --- a/translated/talk/20180504 How a university network assistant used Linux in the 90s.md +++ b/translated/talk/20180504 How a university network assistant used Linux in the 90s.md @@ -1,34 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (How a university network assistant used Linux in the 90s) [#]: via: (https://opensource.com/article/18/5/my-linux-story-student) [#]: author: ([Alan Formy-Duva](https://opensource.com/users/alanfdoss) [#]: url: ( ) -大学网络助理如何在 90 年代使用 Linux +90 年代的大学网管如何使用 Linux ====== + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/moneyrecycle_520x292.png?itok=SAaIziNr) -在 20 世纪 90 年代中期,我报名了计算机科学课。我大学的计算机科学系为学生提供了一台 SunOS 服务器,它是一个多用户、多任务的 Unix 系统。我们登录它并编写我们在学习的编程语言代码,例如 C、C++ 和 ADA。在那些日子里,在社交网络和 IM 出现之前,我们还使用该系统相互通信,发送电子邮件和使用诸如 `write` 和 `talk` 之类的程序。我们每个人被允许托管一个个人网站。我很高兴它能够完成我的作业并联系其他用户。 + +在上世纪 90 年代中期,我报名了计算机科学课。我大学的计算机科学系为学生提供了一台 SunOS 服务器,它是一个多用户、多任务的 Unix 系统。我们登录它并编写我们学习的编程语言代码,例如 C、C++ 和 ADA。在那时,在社交网络和 IM 出现之前,我们还使用该系统发送电子邮件和使用诸如 `write` 和 `talk` 之类的程序来相互通信。我们每个人被允许托管一个个人网站。我很高兴能够使用它完成我的作业并联系其他用户。 这是我第一次体验这种类型的操作环境,但我很快就了解了另一个可以做同样事情的操作系统:Linux。 -当我还是一名学生的时候,我还在大学兼职工作。我的第一个职位是住房和住宅部 (H&R) 的网络安装人员。这包含将学生宿舍与校园网络连接起来。由于这是该大学的第一个宿舍网络服务,因此只有两幢楼和大约 75 名学生已经连接。 +那会我还是学生,我在大学找了份兼职工作。我的第一个职位是住房和住宅部(H&R)的网络安装人员。这工作涉及到将学生宿舍与校园网络连接起来。由于这是该大学的第一个宿舍网络服务,因此只有两幢楼和大约 75 名学生连上了网。 -在我工作的第二年,该网络扩展到另外两幢楼。H&R 决定让该大学的信息技术办公室 (OIT) 管理这不断增长的业务。我进入 OIT 并开始担任 OIT 网络经理的学生助理。这就是我发现 Linux 的方式。我的新职责之一是管理防火墙系统,它为宿舍提供网络和互联网访问。 +在第二年,该网络扩展到另外两幢楼。H&R 决定让该大学的信息技术办公室(OIT)管理这不断增长的业务。我进入 OIT 并开始担任 OIT 网络经理的学生助理。这就是我发现 Linux 的方式。我的新职责之一是管理防火墙系统,它为宿舍提供网络和互联网访问。 -每个学生都注册了他们硬件的 MAC 地址。注册学生可以连接到宿舍网络并获得 IP 地址及访问互联网。与大学使用的其他昂贵的 SunOS 和 VMS 服务器不同,这些防火墙使用运行着免费和开源 Linux 操作系统的低成本计算机。截至年底,该系统已注册近 500 名学生。 +每个学生都注册了他们硬件的 MAC 地址。注册的学生可以连接到宿舍网络并获得 IP 地址及访问互联网。与大学使用的其他昂贵的 SunOS 和 VMS 服务器不同,这些防火墙使用运行着自由开源的 Linux 操作系统的低成本计算机。截至年底,该系统已注册近 500 名学生。 ![Red hat Linux install disks][1] -OIT 网络工作人员使用 Linux 运行 HTTP、FTP 和其他服务。他们还在个人桌面上使用 Linux。就在那时,我意识到我手上的计算机看起来和运行起来就像 CS 系昂贵的 SunOS 机器一样但没有高昂的成本。Linux 可以在商用 x86 硬件上运行,例如有 8 MB RAM 和 133Mhz Intel Pentium CPU 的 Dell Latitude。那对我来说是个卖点!我在从一个剩余的仓库中清理出来的机器上安装了 Red Hat Linux 5.2,并给了我的朋友登录帐户。 +OIT 网络工作人员使用 Linux 运行 HTTP、FTP 和其他服务。他们还在个人桌面上使用 Linux。就在那时,我意识到我手上的计算机看起来和运行起来就像 CS 系昂贵的 SunOS 机器一样,但没有高昂的成本。Linux 可以在商用 x86 硬件上运行,例如有 8 MB RAM 和 133Mhz Intel Pentium CPU 的 Dell Latitude。那对我来说是个卖点!我在从一个存货仓库中清理出来的机器上安装了 Red Hat Linux 5.2,并给了我的朋友登录帐户。 我使用我的新 Linux 服务器来托管我的网站并向我的朋友提供帐户,同时它还提供 CS 系服务器没有的图形功能。它使用了 X Windows 系统,我可以使用 Netscape Navigator 浏览网页,使用 [XMMS][2] 播放音乐,并尝试不同的窗口管理器。我也可以下载并编译其他开源软件并编写自己的代码。 -我了解到 Linux 提供了一些非常先进的功能,其中许多功能比更主流的操作系统更方便或更优越。例如,许多操作系统尚未提供应用更新的简单方法。在 Linux 中,这很简单,感谢 [autoRPM][3],一个由 Kirk Bauer 编写的更新管理器,它向 root 用户每日发送邮件,其中包含可用的更新。它有一个直观的界面,用于审查和选择要安装的软件更新 - 这对于 90 年代中期来说非常了不起。 +我了解到 Linux 提供了一些非常先进的功能,其中许多功能比更主流的操作系统更方便或更优越。例如,许多操作系统尚未提供应用更新的简单方法。在 Linux 中,这很简单,感谢 [autoRPM][3],一个由 Kirk Bauer 编写的更新管理器,它向 root 用户每日发送邮件,其中包含可用的更新。它有一个直观的界面,用于审查和选择要安装的软件更新 —— 这对于 90 年代中期来说非常了不起。 -Linux may not have been well-known back then, and it was often received with skepticism, but I was convinced it would survive. And survive it did! +当时 Linux 可能并不为人所知,而且它经常受到怀疑,但我确信它会存活下来。而它确实生存下来了! -------------------------------------------------------------------------------- @@ -37,11 +39,11 @@ via: https://opensource.com/article/18/5/my-linux-story-student 作者:[Alan Formy-Duval][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://opensource.com/users/alanfdoss [1]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/red_hat_linux_install_disks.png?itok=VSw6Cke9 (Red hat Linux install disks) [2]:http://www.xmms.org/ -[3]:http://www.ccp14.ac.uk/solution/linux/autorpm_redhat7_3.html \ No newline at end of file +[3]:http://www.ccp14.ac.uk/solution/linux/autorpm_redhat7_3.html From c60a0e756dcf64271001cf35a71091d63f0e0373 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 11:09:41 +0800 Subject: [PATCH 0921/1143] PUB:20180504 How a university network assistant used Linux in the 90s.md @geekpi https://linux.cn/article-10359-1.html --- ...ow a university network assistant used Linux in the 90s.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20180504 How a university network assistant used Linux in the 90s.md (98%) diff --git a/translated/talk/20180504 How a university network assistant used Linux in the 90s.md b/published/20180504 How a university network assistant used Linux in the 90s.md similarity index 98% rename from translated/talk/20180504 How a university network assistant used Linux in the 90s.md rename to published/20180504 How a university network assistant used Linux in the 90s.md index f9e811986d..38a99e4310 100644 --- a/translated/talk/20180504 How a university network assistant used Linux in the 90s.md +++ b/published/20180504 How a university network assistant used Linux in the 90s.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (How a university network assistant used Linux in the 90s) [#]: via: (https://opensource.com/article/18/5/my-linux-story-student) [#]: author: ([Alan Formy-Duva](https://opensource.com/users/alanfdoss) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10359-1.html) 90 年代的大学网管如何使用 Linux ====== From 73aa9a68a321fc81b3d1f6e7ca0aeb876a43a31a Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Tue, 18 Dec 2018 14:05:23 +0800 Subject: [PATCH 0922/1143] Translating How to Update Ubuntu. --- ...untu -Terminal - GUI Methods- It-s FOSS.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md index 3a4332c365..b0f0751d81 100644 --- a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md +++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md @@ -7,7 +7,7 @@ [#]: via: (https://itsfoss.com/update-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何更新Ubuntu [终端及GUI方式] It's FOSS +如何更新 Ubuntu [终端及GUI方式] It's FOSS ====== **这篇教程将向你展示如何更新服务器版本或者桌面版本的Ubuntu。它还解释了更新和升级之间的区别以及你应该了解的有关于Ubuntu Linux中的更新的一些其他内容。** @@ -16,38 +16,38 @@ 更新 Ubuntu 非常简单。我并不夸张的说。它简单得只要运行两个命令。让我来告诉你更多更新细节。 -Please note that the tutorial is valid for Ubuntu 18.04, 16.04 or any other version. The command line way is also valid for Ubuntu-based distributions like Linux Mint, Linux Lite, elementary OS etc. +请注意,本教程适用于 Ubuntu 18.04,16.04 或任何其他版本。命令行方式也适用于基于 Ubuntu 的发行版如 Linux Mint,Linux Lite,elementary OS 等。 -### Update Ubuntu via Command Line +### 通过命令行更新 Ubuntu -![How to Update Ubuntu][2] +![如何更新 Ubuntu][2] -On the desktop, open the terminal. You can find it in the menu or use the Ctrl+Alt+T [keyboard shortcut][3]. If you are logged on to an [Ubuntu server][4], you already have access to a terminal. +在桌面上,打开终端。你可以在菜单里找到它或者使用 Ctrl+Alt+T [快捷键][3]。如果你登陆到一台 [Ubuntu 服务器][4],那你已经在访问一个终端了。 -In the terminal, you just have to use the following command: +在终端里,你只需要使用以下命令: ``` sudo apt update && sudo apt upgrade -y ``` -It will ask for password and you can use your account’s password. You won’t see the anything on the screen while typing so keep on typing your password and hit enter. +它将询问密码,而你可以使用你账号的密码。输入时,你将不会看到任何内容在屏幕上,所以请继续输入你的密码并按回车键。 -Now let me explain the above command. +现在,我来解释下上面的命令。 -Actually, it’s not a single command. It’s a combination of two commands. The && is a way to combine two commands in a way that the second command runs only when the previous command ran successfully. +事实上,这不是一条命令。它由两条命令组成。符号 `&&` 是合并两条命令的一个方法,第二条命令仅在前一条命令执行成功时执行。 -The ‘-y’ in the end automatically enters yes when the command ‘apt upgrade’ ask for your confirmation before installing the updates. +当命令 `apt upgrade` 要求你在安装更新前确认时,末尾的参数 `-y` 会自动输入 yes。 -Note that you can also use the two commands separately, one by one: +请注意,你也可以逐条使用这两条命令: ``` sudo apt update sudo apt upgrade ``` -It will take a little longer because you have to wait for one command to finish and then enter the second command. +这将花费更长的时间,因为你必须等待第一条命令执行完成后才能输入第二条命令。 -#### Explanation: sudo apt update +#### 说明:sudo apt update This command updates the local database of available packages. If you won’t run this command, the local database won’t be updated and your system will not know if there are any new versions available. @@ -63,7 +63,7 @@ apt list --upgradable **Additional Reading:** Read this article to learn [what is Ign, Hit and Get in the apt update command output][6]. -#### Explanation: sudo apt upgrade +#### 说明:sudo apt upgrade This command matches the versions of installed packages with the local database. It collects all of them and then it will list all of the packages that have a newer version available. At this point, it will ask if you want to upgrade (the installed packages to the newer version). @@ -75,7 +75,7 @@ So the bottom line is that the sudo apt update checks for the availability of ne The term update might be confusing as you might expect the apt update command to update the system by installing the updates but that doesn’t happen. -### Update Ubuntu via GUI [For Desktop Users] +### 通过 GUI 更新 Ubuntu[适用于桌面用户] If you are using Ubuntu as a desktop, you don’t have to go to terminal just for updating the system. You can still use the command line but it’s optional for you. @@ -109,11 +109,11 @@ You can choose to restart later if you don’t want to reboot your system straig Tip: If the software updater returns an error, you should use the command ‘sudo apt update’ in the terminal. The last few lines of the output will contain the actual error message. You can search on the internet for that error and fix the problem. -### Few things to keep in mind abou updating Ubuntu +### 更新 Ubuntu 时要记住几件事 You just learned how to update your Ubuntu system. If you are interested, you should also know these few things around Ubuntu updates. -#### Clean up after an update +#### 更新后清理 Your system will have some unnecessary packages that won’t be required after the updates. You can remove such packages and [free up some space][14] using this command: @@ -121,7 +121,7 @@ Your system will have some unnecessary packages that won’t be required after t sudo apt autoremove ``` -#### Live patching kernel in Ubuntu Server to avoid rebooting +#### 在 Ubuntu Server 中热修复内核以避免重启 In case of a Linux kernel updates, you’ll have to restart the system after the update. This is an issue when you don’t want downtime for your server. @@ -129,13 +129,13 @@ In case of a Linux kernel updates, you’ll have to restart the system after the If you manage servers, you may want to [enable live patching in Ubuntu][16]. -#### Version upgrades are different +#### 版本升级是不同的 The updates discussed here is to keep your Ubuntu install fresh and updated. It doesn’t cover the [version upgrades][17] (for example upgrading Ubuntu 16.04 to 18.04). [Ubuntu version][18] upgrades are entirely a different thing. It updates the entire operating system core. You need to make proper backups before starting this lengthy process. -### Conclusion +### 总结 I hope you liked this tutorial on updating the Ubuntu system and you learned a few new things. From 4bbdcb279b3ff9982f636f351cfd140f9bf87f61 Mon Sep 17 00:00:00 2001 From: cycoe Date: Tue, 18 Dec 2018 14:12:40 +0800 Subject: [PATCH 0923/1143] translating by cycoe --- .../20180822 9 flowchart and diagramming tools for Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180822 9 flowchart and diagramming tools for Linux.md b/sources/tech/20180822 9 flowchart and diagramming tools for Linux.md index 853cd1b7c3..5729f765d1 100644 --- a/sources/tech/20180822 9 flowchart and diagramming tools for Linux.md +++ b/sources/tech/20180822 9 flowchart and diagramming tools for Linux.md @@ -1,3 +1,5 @@ +translating by cycoe +cycoe 翻译中 9 flowchart and diagramming tools for Linux ====== From a85fe7df351a1cbf06f0abf05172a56b158ebdfd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 16:04:23 +0800 Subject: [PATCH 0924/1143] PRF:20181205 Bring some color to your Linux terminal with lolcat.md @geekpi --- ...olor to your Linux terminal with lolcat.md | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md index eb23d85e36..2fc3c4cb0a 100644 --- a/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md +++ b/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md @@ -1,22 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (Bring some color to your Linux terminal with lolcat) [#]: via: (https://opensource.com/article/18/12/linux-toy-lolcat) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) [#]: url: ( ) -使用 lolcat 为你的 Linux 终端带来一些颜色 +使用 lolcat 为你的 Linux 终端带来彩虹 ====== -使用这个简单的程序,你可以为所需的任何程序的输出添加彩色。 + +> 使用这个简单的工具,你可以为所需的任何程序的输出变成七彩。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-lolcat.png?itok=Es6dYcph) 今天是 Linux 命令行玩具日历的第五天。如果这是你第一次访问该系列,你可能会问自己,什么是命令行玩具。即使我不太确定,但一般来说,它可能是一个游戏,或任何简单的可以帮助你在终端玩得开心的东西。 -很可能你们中的一些人之前已经看过我们日历中的各种选择,但我们希望每个人至少见到一件新事物。 +很可能你们中的一些人之前已经看过我们日历中的各种玩具,但我们希望每个人至少见到一件新事物。 -今日的选择,**lolcat**,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。 +今日的选择,`lolcat`,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。 ``` $ gem install lolcat @@ -29,15 +31,18 @@ $ fortune | boxes -a c -d parchment | lolcat ``` 根据你的运气,你可能会看到这样: + ![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-parchment.png) -你可以传递给 **lolcat** 一些参数而不必重复它们,我建议你访问 **lolcat** 的 [GitHub 页面][1] 或者在终端输入 **lolcat --help** 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画打印?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的句子列表中的适合猫的句子。 +你可以传递给 `lolcat` 一些参数。这里不再赘述,我建议你访问 `lolcat` 的 [GitHub 页面][1] 或者在终端输入 `lolcat --help` 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画输出呢?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的格言列表中的适合猫的句子。 ``` fortune -m "nine tails" | boxes -a c -d cat | lolcat -a ``` + ![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-animated.gif) -**lolcat** 是 BSD 许可下的开源软件。 + +`lolcat` 是一个 BSD 许可下的开源软件。 你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 @@ -50,11 +55,11 @@ via: https://opensource.com/article/18/12/linux-toy-lolcat 作者:[Jason Baker][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/jason-baker [b]: https://github.com/lujun9972 [1]: https://github.com/busyloop/lolcat -[2]: https://opensource.com/article/18/12/linux-toy-cowsay \ No newline at end of file +[2]: https://opensource.com/article/18/12/linux-toy-cowsay From 7fa885b3178e3a6bdd0ea0aeec75cf6b43ae34a6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 16:05:00 +0800 Subject: [PATCH 0925/1143] PUB:20181205 Bring some color to your Linux terminal with lolcat.md @geekpi https://linux.cn/article-10361-1.html --- ...205 Bring some color to your Linux terminal with lolcat.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181205 Bring some color to your Linux terminal with lolcat.md (97%) diff --git a/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/published/20181205 Bring some color to your Linux terminal with lolcat.md similarity index 97% rename from translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md rename to published/20181205 Bring some color to your Linux terminal with lolcat.md index 2fc3c4cb0a..629f30a6e3 100644 --- a/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md +++ b/published/20181205 Bring some color to your Linux terminal with lolcat.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (Bring some color to your Linux terminal with lolcat) [#]: via: (https://opensource.com/article/18/12/linux-toy-lolcat) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10361-1.html) 使用 lolcat 为你的 Linux 终端带来彩虹 ====== From f0c2d70ee9c8ef9d37103a27a1f05120615d1d25 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 19:37:13 +0800 Subject: [PATCH 0926/1143] PRF:20171111 A CEOs Guide to Emacs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 部分 --- .../tech/20171111 A CEOs Guide to Emacs.md | 88 ++++++++----------- 1 file changed, 39 insertions(+), 49 deletions(-) diff --git a/translated/tech/20171111 A CEOs Guide to Emacs.md b/translated/tech/20171111 A CEOs Guide to Emacs.md index 5b25f37313..6d14ad7a8e 100644 --- a/translated/tech/20171111 A CEOs Guide to Emacs.md +++ b/translated/tech/20171111 A CEOs Guide to Emacs.md @@ -1,57 +1,58 @@ 一位 CEO 的 Emacs 指南 -============================================================ +=========== -几年前,不,是几十年前,我就在用 Emacs。不论是码代码、编写文档,还是管理邮件和日程,我都用这个编辑器或者是说操作系统,而且我还乐此不疲。多年过去了,我也转向了其他更新,更好的工具。结果,我已经忘了如何在不用鼠标的情况下来浏览文件。大约三个月前,我意识到我在应用程序和计算机之间切换上耗费了大量的时间,于是就决定再试一次 Emacs。这是个很正确的决定,原因有以下几个。其中包括了 `.emacs` 和 Dropbox 的技巧,可以让你建立一个良好的,可移植的环境。 +几年前,不,是几十年前,我就在用 Emacs。不论是码代码、编写文档,还是管理邮件和日程,我都用这个编辑器或者是说操作系统,而且我还乐此不疲。许多年过去了,我也转向了其他更新、更好的工具。结果,我已经忘了如何在不用鼠标的情况下来浏览文件。大约三个月前,我意识到我在应用程序和计算机之间切换上耗费了大量的时间,于是就决定再试一次 Emacs。这是个很正确的决定,原因有以下几个。其中包括了 `.emacs` 和 Dropbox 的技巧,可以让你建立一个良好的、可移植的环境。 -对于那先还没用过 Emacs 的人来说,你可能会讨厌它,但也可能喜欢上它。它有点像一个房子大小的 Rube Goldberg 机器,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键短语是“乍一看”。一旦你了解了Emacs,你就会意识到它其实是一种可以作为发动机的热核烤面包机。好吧,你想对文字做什么都可以。当考虑到计算寿命在很大程度上与文本有关时,这是一个相当大胆的声明,真的很大胆。 +对于那些还没用过 Emacs 的人来说,你可能会讨厌它,但也可能喜欢上它。它有点像一个房子大小的鲁布·戈德堡机械Rube Goldberg machine,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键短语是“乍一看”。一旦你了解了 Emacs,你就会意识到它其实是一种可以作为发动机的热核烤面包机……好吧,你可以用来对文字做什么都可以。当考虑到你的计算生活在很大程度上与文本有关时,这是一个相当大胆的声明,真的很大胆。 -也许对我来说更重要的是,它是我曾经使用过的一个应用程序,并让我觉得我真正的拥有它,而不是把我塑造成一个匿名的“用户”,就好像位于 [Soma][30] 或 Redmond 附近某个高档办公室的产品营销部门把钱作为明确的目标一样。现代生产力和创作应用程序(如文件或 `IDE`)就像碳纤维赛车,他们装备得很好,也很完整。而Emacs 就像一盒经典的 [Campagnolo][31] 零件和一个漂亮的拖钢框架,缺少曲柄臂和刹车杆,你必须在网上某个小众文化中找到它们。第二点就是它会给你带来无尽的快乐或烦恼,这取决于你自己,而且会一直持续到你生命的最后一天。我是那种在找到一堆老古董或用 `Emacs Lisp` 配置编辑器时同样感到高兴的人,具体情况因人而异。 +也许对我来说更重要的是,它是我曾经使用过的一个应用程序,并让我觉得我真正的拥有它,而不是把我塑造成一个匿名的“用户”,就好像位于 [Soma][30](LCTT 译注:旧金山的一个街区)或雷蒙德(LCTT 译注:微软总部所在地)附近某个高档办公室的产品营销部门把钱作为明确的目标一样。现代生产力和创作应用程序(如 Pages 或 IDE)就像碳纤维赛车,它们装备得很好,也很齐全。而 Emacs 就像一盒经典的 [Campagnolo][31] (LCTT 译注:世界上最好的三个公路自行车套件系统品牌之一)零件和一个漂亮的自行车牵引式钢框架,但缺少曲柄臂和刹车杆,你必须在网上某个小众文化中找到它们。第一点是它是更快更完整的。第二点就是它会给你带来无尽的快乐或烦恼,这取决于你自己,而且会一直持续到你生命的最后一天。我是那种在找到一堆老古董或用 `Emacs Lisp` 配置编辑器时同样感到高兴的人,具体情况因人而异。 -![1933 steel bicycle](https://blog.fugue.co/assets/images/bicycle.jpg) -一辆我还在骑的1933年产的钢制自行车。你可以从查看框架管差别: [https://www.youtube.com/watch?v=khJQgRLKMU0][6]. +![1933 steel bicycle](https://www.fugue.co/hubfs/Imported_Blog_Media/bicycle-1.jpg) -这可能给人一种 Emacs 已经过气或过时的印象。但它不是,它是强大和永恒的,只要你耐心地去理解它的一些规则。他的规则很另类,也很奇怪,但其中的逻辑却引人注目,且很有魅力。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这。 +*一辆我还在骑的1933年产的钢制自行车。你可以看看框架管差别: [https://www.youtube.com/watch?v=khJQgRLKMU0][6]* -如果通过编辑 `Lisp` 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 `Ludwig` 和 `Emacs Lisp`),但是 `Fugue` 的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs, 40% 用 `IDE` 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32](PHB[1][7])的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。 +这可能给人一种 Emacs 已经过气或过时的印象。但它不是,它是强大和永恒的,只要你耐心地去理解它的一些规则。它的规则很另类,也很奇怪,但其中的逻辑却引人注目,且很有魅力。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这里。 -### 最后的优点 +如果通过编辑 Lisp 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 Ludwig 和 Emacs Lisp),但是 Fugue 的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs,40% 用 IDE 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32]Pointy-Haired Bosses(PHB[^1] )(以及,其它好奇的人)的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。 -使用 Emacs 带来的长期优势是让生活更轻松。与最后的收获相比,最开始的付出完全值得。想想这些: +### 恒久优势 -### 无需上下文切换 +使用 Emacs 带来的长期优势是让生活更轻松。与最后的收获相比,最开始的付出完全值得。想想这些: -`Org` 模式本身就值得花时间,但如果你像我一样,你通常要处理十几份左右的文件 —— 从博客帖子到会议需要做什么的清单,再到员工评论。在现代计算世界中,这通常意味着要使用多个应用程序,所有这些应用程序都有不同的用户界面,保存方式、排序和搜索方式。结果就是你需要不断转换思维环境,记住细节。我讨厌上下文切换,因为它是一种强加到我身上的方式,原因是破坏了接口模型[2][8],并且我讨厌记住计算机的命令,这本该是计算机要记住的东西。在单个环境下,Emacs 对 PHB 甚至比对于程序员更有用,因为程序员更多时候只需要专注于一个程序。转换思维环境的成本比通常看起来的要高。操作系统和应用程序供应商已经构建了各种接口,以分散我们对这一现实的注意力。如果你是技术人员,通过快捷键(`M-:`)来访问功能强大的[语言解释器][33]会方便的多[3][9]。 +#### 无需上下文切换 -许多应用程序可以全天全屏并用于编辑文本。Emacs 是惟一的,因为它既是编辑器也是 `Emacs Lisp` 解释器。从本质上说,你工作时只要用电脑上的一两个键就能完成。如果你对编程略知一二,就能发现这一位置你可以在 Emacs 中做 _任何事情_。一旦你在内存中有了这些命令,你的电脑就可以在你工作时几乎实时地为你提供高效的运转。你不会想用 `Emacs Lisp` 来重建 Excel,只要用简单的一两行代码就能实现 Excel 中大多数的功能。如果我需要处理数字,我更有可能转到 scratch 缓冲区,编写一些代码,而不是打开电子表格。即便是我有一封多行的邮件要写,我通常也会先在 Emacs 中写完,然后再复制粘贴到邮件客户端中。当你可以流畅的书写时,为什么要去切换呢?你可以先从一两个简单的计算开始,随着时间的推移,你可以很容易的在 Emacs 中添加你所需要处理的计算。这在应用程序中可能是独一无二的,同时还提供了让为其他的人创造的丰富特性。还记得 Isaac Asimov 书中那些神奇的终端吗[4][10]? Emacs 是我所遇到的最接近他们的东西。我决定不再用什么应用程序来做这个或那个。相反,我只是工作。拥有一个伟大的工具并致力于此,这才是真正的动力和效率。 +Org 模式本身就值得花时间,但如果你像我一样,你通常要处理十几份左右的文件 —— 从博客帖子到会议需要做什么的清单,再到员工评估。在现代计算世界中,这通常意味着要使用多个应用程序,所有这些应用程序都有不同的用户界面、保存方式、排序和搜索方式。结果就是你需要不断转换思维环境,记住细节。我讨厌上下文切换,因为它是一种强加到我身上的方式,原因是破坏了界面模型[^2] ,并且我讨厌记住本该是计算机要为我记住的东西。在单个环境下,Emacs 对 PHB 甚至比对于程序员更有用,因为程序员更多时候只需要专注于一个程序。转换思维环境的成本比通常看起来的要高。操作系统和应用程序厂商已经构建了各种界面,以分散我们对这一现实的注意力。如果你是技术人员,通过快捷键(`M-:`)来访问功能强大的[语言解释器][33]会方便的多[^3] 。 -### 在安静中创造事情 +许多应用程序可以全天全屏地用于编辑文本。Emacs 是惟一的,因为它既是编辑器也是 Emacs Lisp 解释器。从本质上说,你工作时只要用电脑上的一两个键就能完成。如果你对编程略知一二,就能发现这意味着你可以在 Emacs 中做 _任何事情_。一旦你在内存中有了这些命令,你的电脑就可以在你工作时几乎实时地为你提供高效的运转。你不会想用 Emacs Lisp 来重建 Excel,只要用简单的一两行代码就能实现 Excel 中大多数的功能。如果我需要处理数字,我更有可能转到 scratch 缓冲区,编写一些代码,而不是打开电子表格。即便是我有一封多行的邮件要写,我通常也会先在 Emacs 中写完,然后再复制粘贴到邮件客户端中。当你可以流畅的书写时,为什么要去切换呢?你可以先从一两个简单的算术开始,随着时间的推移,你可以很容易的在 Emacs 中添加你所需要处理的计算。这在应用程序中可能是独一无二的,同时还提供了让为其他的人创造的丰富特性。还记得艾萨克·阿西莫夫书中那些神奇的终端吗? Emacs 是我所遇到的最接近它们的东西[^4] 。我决定不再用什么应用程序来做这个或那个。相反,我只是工作。拥有一个伟大的工具并致力于此,这才是真正的动力和效率。 + +#### 在安静中创造事情 拥有我所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?拥有 `Lisp` 键盘的全部功能?这就是我用 Emacs 来完成所有的创作性工作,处理音乐和图片除外。 -我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等保存在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序努力提供帮助并使其易于使用。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[5][11]。比其 office 应用程序,我更讨厌在线版的应用程序。 +我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等保存在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序努力提供帮助并使其易于使用。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比其 office 应用程序,我更讨厌在线版的应用程序。 ![1933 steel bicycle](https://blog.fugue.co/assets/images/desktop.jpg) 我的桌面布局, Emacs 在左边 但是交流呢?创造和交流之间的差别很大。当我为两者留出不同的时间时,我的效率会更高。在 `Fugue` 中使用了 `Slack`,痛并快乐着。我把它和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我很高兴地能够忽略所有的聊天。仅仅是风投或董事会董事的一次懈怠,或一封电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。 -### 带上一切,并保留着 +#### 带上一切,并保留着 第三个原因是,我发现 Emacs 比其它的环境更有优势的是你可以很容易的用它来处理事务。我的意思是,你所需要的只是通过 `Dropbox` 类似的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何地方,任何环境下工作了,因为你已经精心制作了适合目的套件了。我在 OS X,Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理页面、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。 -永久存储在计算机上的限制是文件格式。假设人类已经解决了存储[6][12]的问题,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最持久的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于办公应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。 +永久存储在计算机上的限制是文件格式。假设人类已经解决了存储[^6] 的问题,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最持久的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于办公应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。 如果你准备尝试 Emacs,请继续阅读!下面的部分不会取代完整的教程,但是在完成阅读时,就可以操作了。 ### 学会驾驭 Emacs —— 一个专业的配置 -所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像现代世界已经过去了。这有点像你只开过车,却要你去学骑自行车[7][13]。 +所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像现代世界已经过去了。这有点像你只开过车,却要你去学骑自行车[^7] 。 -### 该选哪个 Emacs +#### 该选哪个 Emacs -我用的是 GNU 中 OS X 和 Windows 的通用版本的 Emacs。你可以在 [][34][http://emacsformacos.com/][35] 获取 OS X 版本,在[][36][http://www.gnu.org/software/emacs/][37]获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(包括 `Lisp` 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[8][14]! +我用的是 GNU 中 OS X 和 Windows 的通用版本的 Emacs。你可以在 [][34][http://emacsformacos.com/][35] 获取 OS X 版本,在[][36][http://www.gnu.org/software/emacs/][37]获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(包括 `Lisp` 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[^8] ! -### 首先,学会浏览 +#### 首先,学会浏览 在本文中,我将约定 Emacs 中的键和组合。`C` 表示 `Control` 键,`M` 表示 `meta`(通常是 `Alt` 或 `Option` 键),以及用于组合键的连字符。因此,`C-h t` 表示同时按下 `Control` 和 `h` 键,然后释放,再按下 `t`。这个组快捷键会指向一个教程,这是你首先要做的一件事。 @@ -59,11 +60,11 @@ Emacs 附带的教程很值得去看。对于真正缺乏耐心的人,我将介绍一些重要的命令,但那个教程非常有用。记住:用 `C-h t` 进入教程。 -### 学会复制和粘贴 +#### 学会复制和粘贴 你可以叫 Emacs 设为 `CUA` 模式,这将会以熟悉的方式工作来操作复制粘贴,但是原生的 Emacs 方法更好,而且你一旦学会了它,就很容易。你可以使用 `Shift` 这样的浏览命令来标记区域(如选择)。所以 `C-F` 是选中管标前的一个字符,等等。亦可以用 `M-w` 来复制,用 `C-w` 剪切,然后用 `C-y` 粘贴。这些实际上叫做删除和召回,但它非常类似于剪切和粘贴。在删除的环中有些小技巧,但是现在,你只需要关注剪切、复制和粘贴。如果你在这开始摸索, `C-x u` 是撤销。 -### 下一步,学会用 `Ido` 模式 +#### 下一步,学会用 `Ido` 模式 相信我,`Ido` 会让文件的工作变得很简单。通常,你在 Emacs 中处理文件不需要使用一个单独分开的查找或文件资源管理器的窗口。相反的,你可以用编辑器的命令来创建、打开和保存文件。如果没有 `Ido` 的话,这将有点麻烦,所以我建议你在学习其他之前安装好它。 `Ido` 是 Emacs 的 22 版时开发出来的,但是需要对你的 `.emacs` 文件做一些调整,来确保它一直开启着。这是个配置环境的好理由。 @@ -85,7 +86,7 @@ home `Ido` 模式是 Emacs 自带的,所以你不需要在你的 `lisp` 目录中放 `.el` 文件,但你仍然需要添加上面代码,因为下面的介绍会使用到它. -### 符号链接是你的好伙伴 +#### 符号链接是你的好伙伴 等等,这里写的 `.emacs` 和 `.emacs.d` 都是存放在你的主目录下,但我们把他们放到了 Dropbox 的某些愚蠢的文件夹!对,这就让你的环境在任何地方都很容易使用。把所有东西都保存在 Dropbox 上,并链接到 `.emacs` 和 `.emacs.d`,以及主目录 `~`。在 OS X 上,使用 `ln -s` 命令非常简单,但在 Windows 上却很麻烦。幸运的是,Emacs 提供了一种简单的方法来替代 Windows 上的符号链接,Windows 的 `HOME` 环境变量。转到 Windows 的环境变量(Windows 10,你可以按 Windows 键然后输入 “环境变量” 来搜索,这是 Windows 10 最好的一部分了),在你的帐户下创建一个指向你在 Dropbox 中 Emacs 的文件家的 `HOME` 环境变量。如果你想方便地浏览 Dropbox 之外的本地文件,你可能想在你的实际主目录下建立一个到 Dropbox 下 Emacs 主目录的符号链接。 @@ -113,7 +114,7 @@ home 其中 `[RET]` 是我使用 `Ido` 模式的自动补全而按下的回车键。所以,这只需要按 12 个键,如果你习惯了的话, 这将比打开查找或文件资源管理器再用鼠标点要节省 _很_ 多时间。 `Ido` 模式很有用, 这真的是操作 Emacs 的一种实用的模式。下面让我们去探索一些其他对完成工作很有帮助的模式吧。 -### 字体及风格 +#### 字体及风格 我推荐在 Emacs 中使用很棒的字体系列。它们可以使用不同的括号、0和其他字符进行自定义。你可以在字体文件本身中构建额外的行间距。我推荐 1\.5 倍的行间距,并在代码和数据中使用它们适应比例的字体。写作中我用 `Serif` 字体,它有一种紧凑但时髦的感觉。你可以在 [http://input.fontbureau.com/][40] 上找到它们,在那里你可以根据自己的喜好进行定制。你可以使用 Emacs 中的菜单手动设置字体,但这会将代码保存到你的 `.emacs` 文件中,如果您使用多个设备,您可能需要一些不同的设置。我我将我的 `.emacs` 设置位根据使用的机器的名称,并配置适当的屏幕机字体。代码如下: @@ -142,7 +143,7 @@ home (if (fboundp 'menu-bar-mode) (menu-bar-mode 1)) ``` -### Org 模式 +#### Org 模式 我基本上 `Org` 模式下处理工作的。它是我创作文档、记笔记、列任务清单以及 90% 其他工作的首选环境。`Org` 最初是由一个在会议中使用笔记本电脑的家伙构想出来的,它是笔记和待办事项列表的组合工具。我反对在会议中使用笔记本电脑,自己也不使用,所以我的用法与他的有些不同。对我来说,`Org` 主要是一种处理结构中内容的方式。在 `Org` 模式中有标题和副标题等,它们的作用就像一个大纲。`Org` 允许你展开或隐藏文本内容,还可以重新排列文本。这非常很符合我的想法,而且我发现用这种方式使用它是一种乐趣。 @@ -159,7 +160,7 @@ home 我有一个总是在缓冲区中打开的 `stuff.org` 文件。我把它当作记事本。`Org` 使得提取待办事项和有期限的事情变得很容易。当你在内联 `Lisp` 代码并在需要计算它时,它特别有用。拥有包含内容的代码非常方便。同样,你可以使用 Emacs 访问实际的计算机,这是一种解放。 -#### 用 `Org` 模式进行发布 +##### 用 `Org` 模式进行发布 我关心的是文档的外观和格式。我我刚开始工作时是个设计师,而且我认为信息可以,也应该表现得清晰和美丽。`Org` 对将 `LaTeX` 生成 PDF 支持的很好, `LaTeX` 有自己的学习曲线,但是做简单的事情非常简单。 @@ -187,9 +188,9 @@ home 这个文件是一个使用该配置输出为 PDF 的实例。这就是开箱即用的 `LaTeX` 一样。在我看来这还不错,但是字体很无聊,而且有点奇怪。此外,如果你使用标准格式,人们会认为他们正在阅读的东西是或假装是一篇学术论文。别怪我没提醒你。 -### `Ace Jump` 模式 +#### `Ace Jump` 模式 -如果你想使用的话,这是个辅助而不是主要功能。它的工作原理有点像 Jef Raskin 的 `Leap` 功能[9][15]。 按下 `C-c` `C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。您只需键入所需位置的字母,光标就会跳转到该位置。我自己经常用这个作为导航键或搜索。将 `.el` 文件下到你的 `Lisp` 目录下,并在 `.emacs` 文件添加如下代码: +如果你想使用的话,这是个辅助而不是主要功能。它的工作原理有点像 Jef Raskin 的 `Leap` 功能[^9] 。 按下 `C-c` `C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。您只需键入所需位置的字母,光标就会跳转到该位置。我自己经常用这个作为导航键或搜索。将 `.el` 文件下到你的 `Lisp` 目录下,并在 `.emacs` 文件添加如下代码: ``` ;; set up ace-jump-mode @@ -202,27 +203,16 @@ home 这篇文章已经够详细了,你能在其中的到你所想要的。我很想了解除编程(或编程)之外你对 Emacs 的使用,以及这是否有用。在我使用 Emacs 的过程中,可能存在一些自作聪明的想法,如果你能指出它们,我将感激不尽。之后,我可能会写一些更新来引入其他特性或模式。我很确定我将会向你展示如何在 Emacs 和 `Ludwig` 模式下使用 `Fugue`,因为我会将它发展成比代码突出显示更有用的东西。把你的想法发到 [@fugueHQ][41] 上。 -* * * -#### 附注 - -1. [^][16] If you are now a PHB of some sort, but were never technical, Emacs likely isn’t for you. There may be a handful of folks for whom Emacs will form a path into the more technical aspects of computing, but this is probably a small population. It’s helpful to know how to use a Unix or Windows terminal, to have edited a dotfile or two, and to have written some code at some point in your life for Emacs to make much sense. - -2. [^][17] [][18][http://archive.wired.com/wired/archive/2.08/tufte.html][19] - -3. [^][20] I mainly use this to perform calculations while writing. For example, I was writing an offer letter to a new employee and wanted to calculate how many options to include in the offer. Since I have a variable defined in my `.emacs` for outstanding-shares, I can simply type `M-: (* .001 outstanding-shares)`and get a tenth of a point without opening a calculator or spreadsheet. I keep  _lots_ of numbers in variables like this so I can avoid context switching. - -4. [^][21] The missing piece of this is the web. There is an Emacs web browser called eww that will allow you to browse in Emacs. I actually use this, as it is both a great ad-blocker and removes most of the poor choices in readability from the web designer's hands. It's a bit like Reading Mode in Safari. Unfortunately, most websites have lots of annoying cruft and navigation that translates poorly into text. - -5. [^][22] Usability is often confused with learnability. Learnability is how difficult it is to learn a tool. Usability is how useful the tool is. Often, these are at odds, such as with the mouse and menus. Menus are highly learnable, but have poor usability, so there have been keyboard shortcuts from the earliest days. Raskin was right on many points where he was ignored about GUIs in general. Now, OSes are putting things like decent search onto a keyboard shortcut. On OS X and Windows, my default method of navigation is search. Ubuntu's search is badly broken, as is the rest of its GUI. - -6. [^][23] AWS S3 has effectively solved file storage for as long as we have the Internet. Trillions of objects are stored in S3 and they've never lost one of them. Most every service out there that offers cloud storage is built on S3 or imitates it. No one has the scale of S3, so I keep important stuff there, via Dropbox. - -7. [^][24] By now, you might be thinking "what is it with this guy and bicycles?" ... I love them on every level. They are the most mechanically efficient form of transportation ever invented. They can be objects of real beauty. And, with some care, they can last a lifetime. I had Rivendell Bicycle Works build a frame for me back in 2001 and it still makes me happy every time I look at it. Bicycles and UNIX are the two best inventions I've interacted with. Well, they and Emacs. - -8. [^][25] This is not a tutorial for Emacs. It comes with one and it's excellent. I do walk through some of the things that I find most important to getting a useful Emacs setup, but this is not a replacement in any way. - -9. [^][26] Jef Raskin designed the Canon Cat computer in the 1980s after falling out with Steve Jobs on the Macintosh project, which he originally led. The Cat had a document-centric interface (as all computers should) and used the keyboard in innovative ways that you can now imitate with Emacs. If I could have a modern, powerful Cat with a giant high-res screen and Unix underneath, I'd trade my Mac for it right away. [][27][https://youtu.be/o_TlE_U_X3c?t=19s][28] +[^1]: If you are now a PHB of some sort, but were never technical, Emacs likely isn’t for you. There may be a handful of folks for whom Emacs will form a path into the more technical aspects of computing, but this is probably a small population. It’s helpful to know how to use a Unix or Windows terminal, to have edited a dotfile or two, and to have written some code at some point in your life for Emacs to make much sense. +[^2]: http://archive.wired.com/wired/archive/2.08/tufte.html +[^3]: I mainly use this to perform calculations while writing. For example, I was writing an offer letter to a new employee and wanted to calculate how many options to include in the offer. Since I have a variable defined in my `.emacs` for outstanding-shares, I can simply type `M-: (* .001 outstanding-shares)`and get a tenth of a point without opening a calculator or spreadsheet. I keep  _lots_ of numbers in variables like this so I can avoid context switching. +[^4]: The missing piece of this is the web. There is an Emacs web browser called eww that will allow you to browse in Emacs. I actually use this, as it is both a great ad-blocker and removes most of the poor choices in readability from the web designer's hands. It's a bit like Reading Mode in Safari. Unfortunately, most websites have lots of annoying cruft and navigation that translates poorly into text. +[^5]: Usability is often confused with learnability. Learnability is how difficult it is to learn a tool. Usability is how useful the tool is. Often, these are at odds, such as with the mouse and menus. Menus are highly learnable, but have poor usability, so there have been keyboard shortcuts from the earliest days. Raskin was right on many points where he was ignored about GUIs in general. Now, OSes are putting things like decent search onto a keyboard shortcut. On OS X and Windows, my default method of navigation is search. Ubuntu's search is badly broken, as is the rest of its GUI. +[^6]: AWS S3 has effectively solved file storage for as long as we have the Internet. Trillions of objects are stored in S3 and they've never lost one of them. Most every service out there that offers cloud storage is built on S3 or imitates it. No one has the scale of S3, so I keep important stuff there, via Dropbox. +[^7]: By now, you might be thinking "what is it with this guy and bicycles?" ... I love them on every level. They are the most mechanically efficient form of transportation ever invented. They can be objects of real beauty. And, with some care, they can last a lifetime. I had Rivendell Bicycle Works build a frame for me back in 2001 and it still makes me happy every time I look at it. Bicycles and UNIX are the two best inventions I've interacted with. Well, they and Emacs. +[^8]: This is not a tutorial for Emacs. It comes with one and it's excellent. I do walk through some of the things that I find most important to getting a useful Emacs setup, but this is not a replacement in any way. +[^9]: Jef Raskin designed the Canon Cat computer in the 1980s after falling out with Steve Jobs on the Macintosh project, which he originally led. The Cat had a document-centric interface (as all computers should) and used the keyboard in innovative ways that you can now imitate with Emacs. If I could have a modern, powerful Cat with a giant high-res screen and Unix underneath, I'd trade my Mac for it right away. [][27][https://youtu.be/o_TlE_U_X3c?t=19s][28] -------------------------------------------------------------------------------- From b9246f66148532703d7ce7c6439033a95b02d6d8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 23:25:57 +0800 Subject: [PATCH 0927/1143] PRF:20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @geekpi --- ...arch Or Find Files And Folders in Linux.md | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md index a95aef6e7d..8358a9ebb0 100644 --- a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md +++ b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @@ -1,26 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux) [#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/) [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) -四种简单的方法来搜索或查找 Linux 中的文件和文件夹 +搜索 Linux 中的文件和文件夹的四种简单方法 ====== -Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。 +Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。这些命令记忆起来不复杂,因为它们使用的是标准语法。 -了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。 - -这些命令记忆起来不复杂,因为它们使用的是标准语法。 - -这里执行四个 Linux 命令,每个命令都有自己独特的功能。 +可以通过四个 Linux 命令啦执行此操作,每个命令都有自己独特的功能。 ### 方法 1:使用 find 命令在 Linux 中搜索文件和文件夹 -find 命令被广泛使用,并且是非常著名的在 Linux 中搜索文件和文件夹的命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。 +`find` 命令被广泛使用,并且是在 Linux 中搜索文件和文件夹的著名命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。 它允许用户根据大小、名称、所有者、组、类型、权限、日期和其他条件执行所有类型的文件搜索。 @@ -72,19 +68,19 @@ find 命令被广泛使用,并且是非常著名的在 Linux 中搜索文件 ### 方法 2:使用 locate 命令在 Linux 中搜索文件和文件夹 -locate 命令比 find 命令运行得更快,因为它使用 updatedb 数据库,而 find 命令在真实系统中搜索。 +`locate` 命令比 `find` 命令运行得更快,因为它使用 `updatedb` 数据库,而 `find` 命令在真实系统中搜索。 它使用数据库而不是搜索单个目录路径来获取给定文件。 -locate 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。 +`locate` 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。 -数据库通过 cron 定期更新,但我们可以通过运行以下命令手动更新它。 +数据库通过 cron 任务定期更新,但我们可以通过运行以下命令手动更新它。 ``` $ sudo updatedb ``` -只需运行以下命令即可列出给定的文件或文件夹。在 locate 命令中不需要指定特定选项来打印文件或文件夹。 +只需运行以下命令即可列出给定的文件或文件夹。在 `locate` 命令中不需要指定特定选项来打印文件或文件夹。 在系统中搜索 `ssh` 文件夹。 @@ -107,13 +103,13 @@ $ sudo updatedb ### 方法 3:在 Linux 中搜索文件使用 which 命令 -which 返回在终端输入命令时执行的可执行文件的完整路径。 +`which` 返回在终端输入命令时执行的可执行文件的完整路径。 当你想要为可执行文件创建桌面快捷方式或符号链接时,它非常有用。 -which 命令搜索当前用户而不是所有用户的 PATH 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。 +`which` 命令搜索当前用户而不是所有用户的 `$PATH` 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。 -运行以下命令以打印 vim 可执行文件的完整路径。 +运行以下命令以打印 `vim` 可执行文件的完整路径。 ``` # which vi @@ -132,12 +128,13 @@ which 命令搜索当前用户而不是所有用户的 PATH 环境变量中列 ### 方法 4:使用 whereis 命令在 Linux 中搜索文件 -whereis 命令用于搜索给定命令的二进制、源码和手册页文件。 +`whereis` 命令用于搜索给定命令的二进制、源码和手册页文件。 ``` # whereis vi vi: /usr/bin/vi /usr/share/man/man1/vi.1p.gz /usr/share/man/man1/vi.1.gz ``` + -------------------------------------------------------------------------------- via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/ @@ -145,9 +142,9 @@ via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders 作者:[Prakash Subramanian][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/prakash/ -[b]: https://github.com/lujun9972 \ No newline at end of file +[b]: https://github.com/lujun9972 From f7b88e3744d9acbf35afab82437378d96b75aac8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 18 Dec 2018 23:26:46 +0800 Subject: [PATCH 0928/1143] PUB:20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @geekpi https://linux.cn/article-10362-1.html --- ... Easy Ways to Search Or Find Files And Folders in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md (98%) diff --git a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md similarity index 98% rename from translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md rename to published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md index 8358a9ebb0..d9326f0904 100644 --- a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md +++ b/published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10362-1.html) [#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux) [#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/) [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) From 13b7fc841a5a6fdb39245fe1d483c99bc14c7b08 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 00:44:58 +0800 Subject: [PATCH 0929/1143] PRF:20180419 Migrating to Linux- Network and System Settings.md @ScarboroughCoral --- ...g to Linux- Network and System Settings.md | 102 ++++++++---------- 1 file changed, 44 insertions(+), 58 deletions(-) diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md index 480aa05239..b9fe12b66e 100644 --- a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md +++ b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md @@ -1,106 +1,92 @@ -# 迁移到 Linux 工作环境: 网络和系统设置 +迁移到 Linux:网络和系统设置 +====== + +> 这个系列我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux;这篇中我们涉及到 Linux 桌面系统上的一些常见设置。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO) -在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到Linux。如果你错过了以前的文章,可以从这访问: +在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux。如果你错过了以前的文章,可以从这访问: -[Part 1 - 基本介绍][1] +- [第1部分 - 入门介绍][1] +- [第2部分 - 磁盘、文件和文件系统][2] +- [第3部分 - 图形操作环境][3] +- [第4部分 - 命令行][4] +- [第5部分 - 使用 sudo][5] +- [第5部分 - 安装软件][6] -[Part 2 - 磁盘、文件和文件系统][2] +Linux 提供了一系列网络和系统设置。在你的桌面计算机上,Linux 允许您调整系统上的任何内容。大多数这些设置都出现在 `/etc` 目录下的纯文本文件中。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。 -[Part 3 - 图形界面环境][3] +大多数设置都能够在“设置”程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。 -[Part 4 - 命令行][4] +### 连接互联网 -[Part 5 - 使用 sudo 命令][5] +在 Linux 中连接到互联网通常非常简单。如果您通过以太网电缆连接,Linux 通常会在插入电缆时或启动时(如果电缆已连接)获得 IP 地址并自动连接。 -[Part 6 - 软件安装][6] +如果您使用无线网络,则在大多数发行版中都有一个菜单,可以在指示器面板中或在“设置”中(取决于您的发行版),您可以在其中选择无线网络的 SSID。如果网络受密码保护,它通常会提示您输入密码。然后连接,这个过程相当顺利。 -Linux 提供了一系列网络和系统设置。在桌面上,Linux允许您调整系统上的任何内容。大多数这些设置都在/ etc目录下的纯文本文件中公开。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。 - - - -大多数设置都能够在设置程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。 - - - -### 连接因特网 - -在Linux中连接到Internet通常非常简单。如果您通过以太网电缆连接,Linux通常会在插入电缆时或启动时获得IP地址并自动连接(如果电缆已连接)。 - -如果您使用无线,则在大多数发行版中都有一个菜单,可以在指示器面板中或在设置中(取决于您的发行版),您可以在其中选择无线网络的SSID。如果网络受密码保护,它通常会提示您输入密码。 然后连接,这个过程相当顺利。 - -在图形界面您可以通过进入设置来调整网络设置。通常称为系统设置或者是设置。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。 +在图形界面您可以通过进入设置来调整网络设置。通常称为“系统设置”或者是“设置”。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。 ![Network Settings][8] -图1: Gnome 桌面网络设置指示器图标. - -[经许可使用][9] +*图1: Gnome 桌面网络设置指示器图标。* ### 网络接口名称 -在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 - 或以太网和无线。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。 +在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 —— 或“以太网”和“无线网络”。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0 和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。 ### 通过命令行进行网络管理 如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。 -请注意,用于在图形桌面中管理网络的最常用服务是网络管理器,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。 +请注意,用于在图形桌面中管理网络的最常用服务是“网络管理器Network Manager”,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。 -更改图形环境中的设置很可能与网络管理器交互,您还可以使用名为nmtui的工具从命令行更改网络管理器设置。nmtui工具提供了您在图形环境中找到的所有设置,但是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图2)。 +在图形环境中的更改设置与在网络管理器中很类似,您还可以使用名为 `nmtui` 的工具从命令行更改网络管理器设置。`nmtui` 工具提供了您在图形环境中找到的所有设置,但是是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图 2)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ) -图 2:nmtui 界面 +*图 2:nmtui 界面* -[经许可使用][9] - -在命令行上,有一个名为 ifconfig 的旧工具来管理网络,还有一个名为 ip 的新工具。在某些发行版中,ifconfig 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,ifconfig 仍可以使用。 +在命令行上,有一个名为 `ifconfig` 的旧工具来管理网络,还有一个名为 `ip` 的新工具。在某些发行版中,`ifconfig` 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,`ifconfig` 仍可以使用。 以下是一些允许您显示和更改网络设置的命令: ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ) -[经许可使用][9] - ### 进程和系统信息 -在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能.。 +在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能。 -在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可以使用的图形工具。大多数所共有的工具是 System Monitor 和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。 +在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可用的图形工具。大多数所共有的工具是“系统监视器”和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA) -图 3:NetHogs 截图 - -[经许可使用][9] +*图 3:NetHogs 截图* 在这些工具中,你也可以查看系统全局网络流量(图 4)。 ![System Monitor][11] -图4: Gnome System Monitor 的截图 - -[经许可使用][9] +*图 4:Gnome System Monitor 的截图* ### 管理进程和系统使用 -您还可以从命令行使用相当多的工具。使用 ps 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 ps 命令不会使用可以使用命令 info ps 或者 man ps。 +您还可以从命令行使用相当多的工具。使用 `ps` 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 `ps` 命令不会使用,可以使用命令 `info ps` 或者 `man ps` 获取帮助。 -大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或CPU时间的进程。这种情况下有两个非常简单的命令,分别是 top 和 htop 命令(图 5)。 +大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或 CPU 时间的进程。这种情况下有两个非常简单的命令,分别是 `top` 和 `htop` 命令(图 5)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl) -top 和 htop 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。 +*图 5:top 截屏* -使用两个命令时 (top and htop),你可以输入 ”?“ 来获取使用帮助,输入 ”q“ 来退出程序。使用 top 命令你可以按”k“键然后输入进程 ID 来杀死某个进程。 +`top` 和 `htop` 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。 -使用 htop 命令时你可以使用 ↑↓ 键来将列表中的一条记录进行高亮显示,按下 F9 键会杀死进程(需要回车确认)。 +使用这两个命令时(`top` 和 `htop`),你可以输入 `?` 来获取使用帮助,输入 `q` 来退出程序。使用 `top` 命令你可以按 `k` 键然后输入进程 ID 来杀死某个进程。 + +使用 `htop` 命令时你可以使用 `↑` `↓` 键来将列表中的一条记录进行高亮显示,按下 `F9` 键会杀死进程(需要回车确认)。 本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。 -想学习更多 Linux 内容可访问免费的 ["Linux 简介" ][12]课程,此课程来自 Linux 基金会和 edx. +想学习更多 Linux 内容可访问免费的 [Linux 简介][12]课程,此课程来自 Linux 基金会和 edx。 ------ @@ -109,20 +95,20 @@ via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system- 作者:[John Bonesio][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[ScarboroughCoral](https://github.com/ScarboroughCoral) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.linux.com/users/johnbonesio -[1]: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction -[2]: https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems -[3]: https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments -[4]: https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line -[5]: https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo -[6]: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software +[1]: https://linux.cn/article-9212-1.html +[2]: https://linux.cn/article-9213-1.html +[3]: https://linux.cn/article-9293-1.html +[4]: https://linux.cn/article-9565-1.html +[5]: https://linux.cn/article-9819-1.html +[6]: https://linux.cn/article-9823-1.html [7]: https://www.linux.com/files/images/figure-1png-2 -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings" +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings" [9]: https://www.linux.com/licenses/category/used-permission [10]: https://www.linux.com/files/images/figure-4png-1 -[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor" +[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor" [12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 5bae0d23ac4dfdf272d8cb162c8b1ddc0389daad Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 00:45:38 +0800 Subject: [PATCH 0930/1143] PUB:20180419 Migrating to Linux- Network and System Settings.md @ScarboroughCoral https://linux.cn/article-10363-1.html --- .../20180419 Migrating to Linux- Network and System Settings.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180419 Migrating to Linux- Network and System Settings.md (100%) diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/published/20180419 Migrating to Linux- Network and System Settings.md similarity index 100% rename from translated/tech/20180419 Migrating to Linux- Network and System Settings.md rename to published/20180419 Migrating to Linux- Network and System Settings.md From 2b9a2b44cf96f43fa321c18b88f089658ff56f3f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 Dec 2018 08:51:41 +0800 Subject: [PATCH 0931/1143] translated --- ...roken Ubuntu OS Without Reinstalling It.md | 78 ------------------- ...roken Ubuntu OS Without Reinstalling It.md | 78 +++++++++++++++++++ 2 files changed, 78 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md create mode 100644 translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md diff --git a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md deleted file mode 100644 index 0d24e0d7c6..0000000000 --- a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It) -[#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/) -[#]: author: (SK https://www.ostechnix.com/author/sk/) -[#]: url: ( ) - -How To Fix Broken Ubuntu OS Without Reinstalling It -====== - -![](https://www.ostechnix.com/wp-content/uploads/2018/12/Fix-Broken-Ubuntu-OS-720x340.jpg) - -Today, I was upgrading my Ubuntu 18.04 LTS system. Unfortunately, the power has gone in mid-way and the system powered off while updating Ubuntu OS. When the power is back, I boot the system again. Right after entering the password at the login screen, it’s gone blank and didn’t respond. Keyboard and mouse also didn’t work. All I see is just a blank screen! Thankfully, It’s just a test machine and there were no important data in it. I can simply wipe off the entire OS and install it again. But, I don’t want to do that. Since I have nothing to lose, I just wanted to repair my broken Ubuntu system without reinstalling it completely and it worked!!! If you ever find yourself in a situation like mine, don’t panic. This brief tutorial describes how to easily fix broken Ubuntu OS without losing data and without reinstalling it completely. - -### Fix Broken Ubuntu OS - -First of all, try to login with live cd and **backup your data** in an external drive. Just in case, if this method didn’t work, you can still have your data and reinstall everything! - -At the login screen, press **CTRL+ALT+F1** to switch to **tty1**. You can learn more about switching between TTYs [**here**][1]. - -Now, type the following commands one by one to fix the broken Ubuntu Linux. - -``` -$ sudo rm /var/lib/apt/lists/lock - -$ sudo rm /var/lib/dpkg/lock - -$ sudo rm /var/lib/dpkg/lock-frontend - -$ sudo dpkg --configure -a - -$ sudo apt clean - -$ sudo apt update --fix-missing - -$ sudo apt install -f - -$ sudo dpkg --configure -a - -$ sudo apt upgrade - -$ sudo apt dist-upgrade -``` - -Finally, reboot the system using command: - -``` -$ sudo reboot -``` - -You can now be able to login to your Ubuntu system as usual. - -After I followed these steps, all of my data in Ubuntu 18.04 test system was there and everything is the same as I left it. This method may not work for everyone. However, this small tip worked for me and saved a couple minutes from reinstalling. If you know any other better way, please let me know in the comment section. I will add them in this guide as well. - -And, that’s all for now. Hope this was useful. - -More good stuffs to come. Stay tuned! - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/ - -作者:[SK][a] -选题:[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.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/ diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md new file mode 100644 index 0000000000..2fbdc6f07e --- /dev/null +++ b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It) +[#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) +[#]: url: ( ) + +如何不重装修复损坏的 Ubuntu 系统 +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Fix-Broken-Ubuntu-OS-720x340.jpg) + +今天,我在升级我的 Ubuntu 18.04 LTS 系统。不幸的是,在更新 Ubuntu 时中途断电,系统关机。电源恢复后,我再次启动系统。在登录页面输入密码后,它变成空白并且没有响应。键盘和鼠标也没有作用。我只看到一个空白的屏幕!值得庆幸的是,它只是一台测试机,并且没有重要的数据。我可以直接擦除整个系统然后重新安装。但是,我不想这样做。由于我没有什么可失去的,我只是想不重装修复我损坏的 Ubuntu 系统,并且我成功了!如果你发现自己处于像我这样的境地,不要惊慌。这个简短的教程描述了如何在不丢失数据的情况下轻松修复损坏的 Ubuntu 系统,而无需重新安装。 + +### 修复损坏的 Ubuntu 系统 + +首先,尝试使用 live cd 登录并**在外部驱动器中备份数据**。以防这个方法没用,你仍然可以获取数据并重新安装系统! + +在登录页上,按下 **CTRL+ALT+F1** 切换到 **tty1**。你可以在[**此处**][1]了解有关在 TTY 之间切换的更多信息。 + +现在,逐个输入以下命令来修复损坏的 Ubuntu Linux。 + +``` +$ sudo rm /var/lib/apt/lists/lock + +$ sudo rm /var/lib/dpkg/lock + +$ sudo rm /var/lib/dpkg/lock-frontend + +$ sudo dpkg --configure -a + +$ sudo apt clean + +$ sudo apt update --fix-missing + +$ sudo apt install -f + +$ sudo dpkg --configure -a + +$ sudo apt upgrade + +$ sudo apt dist-upgrade +``` + +最后,使用命令重启系统: + +``` +$ sudo reboot +``` + +你现在可以像往常一样登录到你的 Ubuntu 系统。 + +我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的贴士对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。 + +这是这些了。希望这篇文章有用。 + +还有更多好东西。敬请关注! + +干杯! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/ + +作者:[SK][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/ \ No newline at end of file From 66b22351b1d9b10c097ad36d8989173e5bbe5166 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 19 Dec 2018 08:59:31 +0800 Subject: [PATCH 0932/1143] translating --- ...nt Dropbox Folder Locally As Virtual File System In Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md b/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md index 691600a4cc..ae559de4c6 100644 --- a/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md +++ b/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md @@ -1,3 +1,5 @@ +translating---geekpi + Dbxfs – Mount Dropbox Folder Locally As Virtual File System In Linux ====== From 31b5122870c1e31449d6db8a71b377806cb4e0d7 Mon Sep 17 00:00:00 2001 From: lxy <524187166@qq.com> Date: Wed, 19 Dec 2018 09:35:33 +0800 Subject: [PATCH 0933/1143] update --- ... - Notmuch, mbsync, postfix and dovecot.md | 237 ------------------ ... - Notmuch, mbsync, postfix and dovecot.md | 235 +++++++++++++++++ 2 files changed, 235 insertions(+), 237 deletions(-) delete mode 100644 sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md create mode 100644 translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md diff --git a/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md deleted file mode 100644 index b239209c1b..0000000000 --- a/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md +++ /dev/null @@ -1,237 +0,0 @@ -translating by lixinyuxx - -My personal Email setup - Notmuch, mbsync, postfix and dovecot -====== -I've been using personal email setup for quite long and have not documented it anywhere. Recently when I changed my laptop (a post is pending about it) I got lost trying to recreate my local mail setup. So this post is a self documentation so that I don't have to struggle again to get it right. - -### Server Side - -I run my own mail server and I use postfix as SMTP server and Dovecot for the IMAP purpose. I'm not going into detail of setting those up as my setup was mostly done by using scripts created by Jonas for Redpill infrastructure. What redpill is?. (In jonas's own words) - -> Redpill is a concept - a way to setup Debian hosts to collaborate across organisations I develop the concept, and use it for the first ever Redpill network-of-networks redpill.dk, involving my own network (jones.dk), my main client's network (homebase.dk), a network in Germany including Skolelinux Germany (free-owl.de), and Vasudev's network (copyninja.info) - -Along with that I have a dovecot sieve filtering to classify on high level mails into various folders depending on from where they originate. All the rules live in the ~/dovecot.sieve file under every account which has a mail address. - -Again I'm not going into detail of how to set these things up, as its not goal of my this post. - -### On my Laptop - -On my laptop I've following 4 parts setup - - 1. Mail syncing : Done using mbsync command - 2. Classification: Done using notmuch - 3. Reading: Done using notmuch-emacs - 4. Mail sending: Done using postfix running as relay server and SMTP client. - - - -### Mail Syncing - -Mail syncing is done using mbsync tool, I was previously user of offlineimap and recently switched to mbsync as I felt it more lighter and simpler to configure than offlineimap. mbsync command is provided by package isync. - -Configuration file is ~/.mbsyncrc. Below is my sample content with some private things redacted. - -``` -IMAPAccount copyninja -Host imap.copyninja.info -User vasudev -PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg" -SSLType IMAPS -SSLVersion TLSv1.2 -CertificateFile /etc/ssl/certs/ca-certificates.crt - - -IMAPAccount gmail-kamathvasudev -Host imap.gmail.com -User kamathvasudev@gmail.com -PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg" -SSLType IMAPS -SSLVersion TLSv1.2 -CertificateFile /etc/ssl/certs/ca-certificates.crt - -IMAPStore copyninja-remote -Account copyninja - -IMAPStore gmail-kamathvasudev-remote -Account gmail-kamathvasudev - -MaildirStore copyninja-local -Path ~/Mail/vasudev-copyninja.info/ -Inbox ~/Mail/vasudev-copyninja.info/INBOX - -MaildirStore gmail-kamathvasudev-local -Path ~/Mail/Gmail-1/ -Inbox ~/Mail/Gmail-1/INBOX - -Channel copyninja -Master :copyninja-remote: -Slave :copyninja-local: -Patterns * -Create Both -SyncState * -Sync All - -Channel gmail-kamathvasudev -Master :gmail-kamathvasudev-remote: -Slave :gmail-kamathvasudev-local: -# Exclude everything under the internal [Gmail] folder, except the interesting folders -Patterns * ![Gmail]* -Create Both -SyncState * -Sync All -``` - -Explanation for some interesting part in above configuration. One is the PassCmd which allows you to provide shell command to obtain the password for the account. This avoids filling in the password in configuration file. I'm using symmetric encryption with gpg and storing password some where on my disk. Which is of course just safe guarded by Unix ACL. - -I actually wanted to use my public key to encrypt the file but unlocking the file when script is run in background or via systemd looks difficult (or looked nearly impossible). If you have better suggestion I'm all ears :-). - -Next instruction part is Patterns. This allows you to selectively sync mail from your mail server. This was really helpful for me to exclude all crappy [Gmail]/ folders. - -### Mail Classification - -Once mail is locally on your device, we need a way to read the mails easily in a mail reader. My original setup was serving synced Maildir using local dovecot instance and read it in Gnus. This setup was bit of a over kill with all server software setups but inability of Gnus to not cope well with Maildir format this was best way to do it. This setup also has a disadvantage, that is searching a mail quickly when you have huge pile of mail to go through. This is where notmuch comes into picture. - -notmuch allows me to easily index through Gigabytes of my mail archives and get what I need very easily. I've created a small script which combines executing of mbsync and notmuch execution. I tag mails based on the Maildirs which are actually created on server side using dovecot sieve. Below is my full shell script which is doing task of syncing classification and deleting of spams. - -``` -#!/bin/sh - -MBSYNC=$(pgrep mbsync) -NOTMUCH=$(pgrep notmuch) - -if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then - echo "Already running one instance of mail-sync. Exiting..." - exit 0 -fi - -echo "Deleting messages tagged as *deleted*" -notmuch search --format=text0 --output=files tag:deleted |xargs -0 --no-run-if-empty rm -v - -echo "Moving spam to Spam folder" -notmuch search --format=text0 --output=files tag:Spam and \ - to:vasudev@copyninja.info | \ - xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur -notmuch search --format=text0 --output=files tag:Spam and - to:vasudev-debian@copyninja.info | \ - xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur - - -MDIR="vasudev-copyninja.info vasudev-debian Gmail-1" -mbsync -Va -notmuch new - -for mdir in $MDIR; do - echo "Processing $mdir" - for fdir in $(ls -d /home/vasudev/Mail/$mdir/*); do - if [ $(basename $fdir) != "INBOX" ]; then - echo "Tagging for $(basename $fdir)" - notmuch tag +$(basename $fdir) -inbox -- folder:$mdir/$(basename $fdir) - fi - done -done -``` - -So before running mbsync I search for all mails tagged as deleted and delete them from system. Next I look for mails tagged as Spam on both my accounts and move it to Spam folder. Yeah you got it right these are mails escaping the spam filter and landing in my inbox and personally marked as Spam. - -After running mbsync I tag mails based on their folder (searching string folder:). This allows me easily get contents of lets say a mailing list without remembering the list address. - -### Reading Mails - -Now that we have synced and classified mail its time to setup the reading part. I use notmuch-emacs interface to read the mails. I use Spacemacs flavor of emacs so I took some time to write down the a private layer which brings together all my keybindings and classification in one place and does not clutter my entire .spacemacs file. You can find the code for my private layer in [notmuch-emacs-layer repository][1] - -### Sending Mails - -Well its not sufficient that if we can read mails, we need to be able to reply to mail. And this was the slightly tricky part where I recently got lost and had to write this post so that I don't forget it again. (And of course don't have to refer some outdated posts on web). - -My setup to send mails is using postfix as SMTP client with my own SMTP server as relayhost for it. The problem of relaying is it's not for the hosts with dynamic IP. There are couple of ways to allow hosts with dynamic IP to use relay servers, one is put the IP address from where mail will originate into my_network or second use SASL authentication. - -My preferred way is use of SASL authentication. For this I first had to create a separate account one for each machine which is going to relay the mails to my main server. Idea is to not use my primary account for SASL authentication. (Originally I was using primary account, but Jonas gave this idea of account per road runner). -``` -adduser _relay - -``` - -Here replace with name of your laptop/desktop or whatever you are using. Now we need to adjust postfix to act as relaying server. So add following lines to postfix configuration -``` -# SASL authentication -smtp_sasl_auth_enable = yes -smtp_tls_security_level = encrypt -smtp_sasl_tls_security_options = noanonymous -relayhost = [smtp.copyninja.info]:submission -smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd -``` - -So here relayhost is the server name which your postfix instance will be using to relay mails forward into internet. :submission part tells postfix to forward mail on to port 587 (secure). smtp_sasl_tls_security_options is set to disallow anonymous connection. This is must so that relay server trusts your mobile host and agrees to forward the mail for you. - -/etc/postfix/sasl_passwd is the file where you need to store password for account to be used for SASL authentication with server. Put following content into it. -``` -[smtp.example.com]:submission user:password - -``` - -Replace smtp.example.com with your SMTP server name which you have put in relayhost configuration. Replace user with _relay user you created and its password. - -To secure the sasl_passwd file and create a hash of it for postfix use following command. -``` -chown root:root /etc/postfix/sasl_passwd -chmod 0600 /etc/postfix/sasl_passwd -postmap /etc/postfix/sasl_passwd -``` - -The last command will create /etc/postfix/sasl_passwd.db file which is hash of your file /etc/postfix/sasl_passwd with same owner and permission. Now reload the postfix and check if mail makes out of your system using mail command. - -### Bonus Part - -Well since I've a script created above bringing together mail syncing and classification. I went ahead and created a systemd timer to periodically sync mails in the background. In my case every 10 minutes. Below is mailsync.timer file. -``` -[Unit] -Description=Check Mail Every 10 minutes -RefuseManualStart=no -RefuseManualStop=no - -[Timer] -Persistent=false -OnBootSec=5min -OnUnitActiveSec=10min -Unit=mailsync.service - -[Install] -WantedBy=default.target -``` - -Below is mailsync.service which is needed by mailsync.timer to execute our scripts. - -``` -[Unit] -Description=Check Mail -RefuseManualStart=no -RefuseManualStop=yes - -[Service] -Type=oneshot -ExecStart=/usr/local/bin/mail-sync -StandardOutput=syslog -StandardError=syslog -``` - -Put these files under /etc/systemd/user and run below command to enable them. -``` -systemctl enable --user mailsync.timer -systemctl enable --user mailsync.service -systemctl start --user mailsync.timer -``` - -So that's how I've sync and send mail from my system. I came to know about afew from Jonas Smedegaard who also proof read this post. So next step I will try to improve my notmuch configuration using afew and of course a post will follow after that :-). - --------------------------------------------------------------------------------- - -via: https://copyninja.info/blog/email_setup.html - -作者:[copyninja][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://copyninja.info -[1]:https://source.copyninja.info/notmuch-emacs-layer.git/ diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md new file mode 100644 index 0000000000..ffbf6d11a7 --- /dev/null +++ b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @@ -0,0 +1,235 @@ +我的个人电子邮件系统 - Notmuch, mbsync, postfix and dovecot +====== +我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷路了。所以这篇文章是一个自我文档, 这样我就不用再挣扎了就能改正过来。 + +### 服务器端 + +我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说) + +> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我发展了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info) + +除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。 + +再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。 + +### 在我的笔记本电脑上 + +在我的笔记本电脑上, 我已经按照4个部分设置 + + 1. 邮件同步: 使用 mbsync 命令完成 + 2. 分类: 使用 notmuch 完成 + 3. 阅读: 使用 notmuch-emacs 完成 + 4. 邮件发送: 使用作为转接服务器和 SMTP 客户端运行的 postfix 完成。 + + + +### 邮件同步 + +邮件同步是使用 mbsync 工具完成的, 我以前是离线的用户, 最近切换到 mbsync, 因为我觉得它比 OfflineIMAP 的配置更轻, 更简单。命令是由包 isync 提供的。 + +配置文件是 ~/.mbsyncrc. 下面是我的例子与一些私人设置。 + +``` +IMAPAccount copyninja +Host imap.copyninja.info +User vasudev +PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg" +SSLType IMAPS +SSLVersion TLSv1.2 +CertificateFile /etc/ssl/certs/ca-certificates.crt + + +IMAPAccount gmail-kamathvasudev +Host imap.gmail.com +User kamathvasudev@gmail.com +PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg" +SSLType IMAPS +SSLVersion TLSv1.2 +CertificateFile /etc/ssl/certs/ca-certificates.crt + +IMAPStore copyninja-remote +Account copyninja + +IMAPStore gmail-kamathvasudev-remote +Account gmail-kamathvasudev + +MaildirStore copyninja-local +Path ~/Mail/vasudev-copyninja.info/ +Inbox ~/Mail/vasudev-copyninja.info/INBOX + +MaildirStore gmail-kamathvasudev-local +Path ~/Mail/Gmail-1/ +Inbox ~/Mail/Gmail-1/INBOX + +Channel copyninja +Master :copyninja-remote: +Slave :copyninja-local: +Patterns * +Create Both +SyncState * +Sync All + +Channel gmail-kamathvasudev +Master :gmail-kamathvasudev-remote: +Slave :gmail-kamathvasudev-local: +# Exclude everything under the internal [Gmail] folder, except the interesting folders +Patterns * ![Gmail]* +Create Both +SyncState * +Sync All +``` + +对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许您提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我使用对称加密与 gpg 和存储密码在我的磁盘上的一些地方。这当然是由 Unix ACL 保护安全。 + +实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。 + +下一个指令部分是模式。这使您可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders. + +### 邮件分类 + +一旦邮件在您本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置是有点大题小作相比于设置所有服务器软件, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。 + +不多让我很容易索引通过千兆字节的邮件档案, 并很容易得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。 + +``` +#!/bin/sh + +MBSYNC=$(pgrep mbsync) +NOTMUCH=$(pgrep notmuch) + +if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then + echo "Already running one instance of mail-sync. Exiting..." + exit 0 +fi + +echo "Deleting messages tagged as *deleted*" +notmuch search --format=text0 --output=files tag:deleted |xargs -0 --no-run-if-empty rm -v + +echo "Moving spam to Spam folder" +notmuch search --format=text0 --output=files tag:Spam and \ + to:vasudev@copyninja.info | \ + xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur +notmuch search --format=text0 --output=files tag:Spam and + to:vasudev-debian@copyninja.info | \ + xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur + + +MDIR="vasudev-copyninja.info vasudev-debian Gmail-1" +mbsync -Va +notmuch new + +for mdir in $MDIR; do + echo "Processing $mdir" + for fdir in $(ls -d /home/vasudev/Mail/$mdir/*); do + if [ $(basename $fdir) != "INBOX" ]; then + echo "Tagging for $(basename $fdir)" + notmuch tag +$(basename $fdir) -inbox -- folder:$mdir/$(basename $fdir) + fi + done +done +``` + +因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对, 这些邮件逃脱垃圾邮件过滤器进到我的 inbox, 并被我亲自标记为垃圾邮件。 + +运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。 + +### 阅读邮件 + +现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层, 它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。您可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。 + +### 发送邮件 + +如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是我最近迷惑的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。 + +我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。 + +我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法 +``` +adduser _relay + +``` + +这里替换 与您的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行 +``` +# SASL authentication +smtp_sasl_auth_enable = yes +smtp_tls_security_level = encrypt +smtp_sasl_tls_security_options = noanonymous +relayhost = [smtp.copyninja.info]:submission +smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd +``` + +因此, 这里的 relayhost 是您的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任您的移动主机, 并同意为您转发邮件。 + +/etc/postfix/sasl__asswd 是您需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。 +``` +[smtp.example.com]:submission user:password + +``` + +替换 smtp.example.com 用你的 SMTP 服务器名称, 您已输入的 relayhost 认证。 用您创建的用户及其密码替换 user with _relay 。 + +若要保护 sasl_passwd 文件, 并创建它的哈希值进行 postfix 使用以下命令。 +``` +chown root:root /etc/postfix/sasl_passwd +chmod 0600 /etc/postfix/sasl_passwd +postmap /etc/postfix/sasl_passwd +``` + +最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是您的文件的哈希值 /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从您的系统中取出。 + +### Bonus 的部分 + +好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。 +``` +[Unit] +Description=Check Mail Every 10 minutes +RefuseManualStart=no +RefuseManualStop=no + +[Timer] +Persistent=false +OnBootSec=5min +OnUnitActiveSec=10min +Unit=mailsync.service + +[Install] +WantedBy=default.target +``` + +下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。 + +``` +[Unit] +Description=Check Mail +RefuseManualStart=no +RefuseManualStop=yes + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/mail-sync +StandardOutput=syslog +StandardError=syslog +``` + +将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启他们 +``` +systemctl enable --user mailsync.timer +systemctl enable --user mailsync.service +systemctl start --user mailsync.timer +``` + +这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew 他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。 + +-------------------------------------------------------------------------------- + +via: https://copyninja.info/blog/email_setup.html + +作者:[copyninja][a] +译者:[lixinyuxx](https://github.com/lixinyuxx) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://copyninja.info +[1]:https://source.copyninja.info/notmuch-emacs-layer.git/ From 9b1bba79fda1b38b9df99d31607edf9c7d545de6 Mon Sep 17 00:00:00 2001 From: lxy <524187166@qq.com> Date: Wed, 19 Dec 2018 09:40:41 +0800 Subject: [PATCH 0934/1143] 20180101 --- ...en solutions to everything in education.md | 113 ------------------ ...en solutions to everything in education.md | 110 +++++++++++++++++ 2 files changed, 110 insertions(+), 113 deletions(-) delete mode 100644 sources/tech/20180101 27 open solutions to everything in education.md create mode 100644 translated/tech/20180101 27 open solutions to everything in education.md diff --git a/sources/tech/20180101 27 open solutions to everything in education.md b/sources/tech/20180101 27 open solutions to everything in education.md deleted file mode 100644 index eeba3692e4..0000000000 --- a/sources/tech/20180101 27 open solutions to everything in education.md +++ /dev/null @@ -1,113 +0,0 @@ -translating by lixinyuxx - -27 open solutions to everything in education -====== -![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo) - -Openness (from open source software, to open hardware, to open principles) is changing the paradigm of education. So, to celebrate all that's gone on this year, I collected 27 of the best articles published on Opensource.com in 2017 on the subject. I divided them into broad themes, rather than ordering them by popularity. And, if these 27 stories don't satisfy your appetite for information about open source in education, check out our companion article on how [education is leveraging Raspberry Pi and Linux][30]. - -### Open is better for everyone - -1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt reviews David Price's book OPEN, which explores the idea that "open" isn't just a technological shift, rather it's "how we'll work, live, and learn in the future." - -2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur points out how to get ahead in the workforce by learning open source. This advice isn't just for programmers; designers, writers, marketers, and other creative professionals are also essential to the success of open source. - -3. [A graduate degree could springboard you into an open source job][3]: Citing research that shows that Linux skills lead to higher pay, Joshua Pearce makes the case that open source proficiency and a graduate degree are an unbeatable career combination. - -4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger shows us how open practices are creating a more inclusive, agile, and open culture in a Pennsylvania school district. Charlie says it's not just about saving money; the district also gains from "open leadership principles that foster innovation among teachers and students, help to better engage the community, and create a more vibrant and inclusive learning community." - -5. [15 ways to empower students with open source tools][5]: I write how open source gives students the freedom to explore, tinker, and learn, whether they're learning basic digital literacy or expanding on those skills with fun projects. - -6. [Developer opportunities to code for good][6]: Open source is often the backbone of socially beneficial projects. As Ahn Bui, vice president of Benetech Labs, states in this interview: "Establishing open data standards is an integral step in breaking down data silos. Those open standards will provide the foundation for interoperability and in turn, translate to more organizations building together, often more cost effectively. The ultimate goal is to serve more people at the same cost or even less." - -### Open education resources for remixing and reusing - -1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis, director of programs for Wiki Ed, discusses how open educational resources (OERs), such as Wiki Ed, are providing high-quality and affordable open source learning resources as classroom teaching tools. - -2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, director of open education for Creative Commons, shares how the face of education is changing in higher education and what Creative Commons is doing to facilitate it. - -3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites, community evangelist and chief marketing officer of Open Up Resources, talks about the nonprofit organization's efforts to provide open, standards-aligned curricula for K-12 schools. - -4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke, educational technologist at the University of Hawaii at Manoa, says that transitioning to OER in college courses will "empower faculty to take control of what content they teach with, which we expect will result in their saving students money." - -5. [How open courses are slashing the cost of higher education][11]: Saylor Academy's director of education Devon Ritter reports how Saylor is building its college credit-eligible courses on openly licensed content, with the goal of making higher education affordable and accessible to more people. - -6. [Open educational resources movement gains speed][12]: Alexis Clifton, executive director of the State University of New York OER Services, describes how New York's US$ 8 million investment is spurring growth in open education and making college more affordable. - -7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik from Duke University explores OSPRI (Open Source Pedagogy Research and Innovation), a collaboration between Duke and Red Hat that's building a 21st-century, preK-12 learning ecosystem that is open by design. - -8. [Perma.cc stops scholarly link rot][14]: Virginia Tech's Phillip Young writes about Perma.cc, a solution to "link rot," which is the high probability that hyperlinks in academic papers will disappear or change over time. - -9. [Open education: How students save money by creating open textbooks][15]: OER pioneer Robin DeRosa talks about "the freedom that the openly licensed textbook introduced, and the overarching idea that education and learning should be contextualized in inclusive ecosystems that enhance the public good." - -### Open source tools in the classroom - -1. [How an open source board game is saving the planet][16]: Joshua Pearce writes about Save the Planet, a board game that empowers students to solve environmental problems while having fun and contributing to the maker community. - -2. [A new Android app for teaching kids how to read][17]: Michael Hall talks about Phoenicia, a children's literacy app he developed after his son was diagnosed with autism, the value of coding for good, and why user testing matters more than you think. - -3. [8 open source Android apps for education][18]: Joshua Allen Holm challenges us to use our smartphones as learning tools by recommending eight open source apps from the F-Droid repository to try. - -4. [3 open source alternatives to MATLAB][19]: Jason Baker's update to his 2016 survey of open source mathematical computing software presents alternatives to MATLAB, the expensive, proprietary solution nearly ubiquitous in mathematics, physical sciences, engineering, and economics. - -5. [What does SVG have to do with teaching kids to code?][20] Retired engineer Jay Nick talks about how he uses art as a creative way to introduce students to coding. He volunteers in schools, using Scalable Vector Graphics (SVG) to teach an approach to coding that combines principles of mathematics and art. - -6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, who holds a PhD in fine arts from Texas Tech, shares his experience using open source tools in a world ruled by proprietary solutions. Kyle says there's a bias against using open source in disciplines outside of computer science: "Many people think non-technical students can't use Linux, and they make a lot of assumptions about people who use it in their advanced degree programs. … Well, it is possible, and I'm proof." - -7. [A list of open source tools for college][22]: Aaron Cocker outlines the open source tools (including presentation, backup, and programming software) he uses while working on his undergraduate degree in computer science. - -8. [5 great KDE apps to help you study][23]: Zsolt Szakács offers five KDE applications that help anyone who wants to learn new skills or cultivate existing ones. - -### Coding in the classroom - -1. [How to get the next generation coding early][24]: Bryson Payne says we need to teach kids to code before high school: By ninth grade 80% of girls and 60% of boys have already self-selected out of a STEM career. But it's not only about jobs and closing the IT skills gap, he suggests. "Teaching a young person to code could be the single most life-changing skill you can give them. And it's not just a career-enhancer. Coding is about problem-solving, it's about creativity, and more importantly, it's about empowerment." - -2. [Kids can't code without computers][25]: Patrick Masson introduces the FLOSS Desktops for Kids program, which teaches students at underserved schools to repurpose older computers with open source software, such as Linux, LibreOffice, and GIMP. Not only is the program breathing new life into broken or decommissioned hardware, it's also giving students important skills that may translate into future careers. - -3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva offers suggestions for using [Scratch][27] to spark kids' interest in programming, just as LOGO did when he started using it in the 1980s. - -4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger describes App Inventor, a programming framework for building Android applications using a visual blocks language (similar to Scratch or [Snap][29]). - -Throughout the year we learned that there is an open solution to everything in education, and I expect this theme to continue in 2018 and beyond. Are there open education topics you'd like Opensource.com to cover in the coming year? If so, please share your ideas in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/1/best-open-education - -作者:[Don Watkins][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/don-watkins -[1]:https://opensource.com/article/17/7/book-review-open -[2]:https://opensource.com/article/17/8/jump-start-your-career -[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab -[4]:https://opensource.com/article/17/7/open-school-leadership -[5]:https://opensource.com/article/17/7/empower-students-open-source-tools -[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs -[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation -[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons -[9]:https://opensource.com/article/17/1/open-up-resources -[10]:https://opensource.com/article/17/2/interview-education-billy-meinke -[11]:https://opensource.com/article/17/7/college-alternatives -[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton -[13]:https://opensource.com/article/17/3/education-should-be-open-design -[14]:https://opensource.com/article/17/9/stop-link-rot-permacc -[15]:https://opensource.com/article/17/11/creating-open-textbooks -[16]:https://opensource.com/article/17/7/save-planet-board-game -[17]:https://opensource.com/article/17/4/phoenicia-education-software -[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education -[19]:https://opensource.com/alternatives/matlab -[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam -[21]:https://opensource.com/article/17/5/how-linux-higher-education -[22]:https://opensource.com/article/17/6/open-source-tools-university-student -[23]:https://opensource.com/article/17/6/kde-education-software -[24]:https://opensource.com/article/17/8/teach-kid-code-change-life -[25]:https://opensource.com/article/17/9/floss-desktops-kids -[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids -[27]:https://scratch.mit.edu/ -[28]:https://opensource.com/article/17/8/app-inventor-android-app-development -[29]:http://snap.berkeley.edu/ -[30]:https://opensource.com/article/17/12/best-opensourcecom-linux-and-raspberry-pi-education diff --git a/translated/tech/20180101 27 open solutions to everything in education.md b/translated/tech/20180101 27 open solutions to everything in education.md new file mode 100644 index 0000000000..898a4250ab --- /dev/null +++ b/translated/tech/20180101 27 open solutions to everything in education.md @@ -0,0 +1,110 @@ +27个解决教学问题的开放式方法 +====== +![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo) + +开放式理念 (从开源软件到开放硬件, 再到开放原则) 正在改变教育的范式。因此, 为了庆祝今年发生的一切, 我收集了2017年在 Opensource.com 上发表的27篇关于这个主题的最好的文章。我把它们分成明确的主题, 而不是按人气来分类。而且, 如果这27个故事不能满足你对教育公开信息的胃口, 那就看看我们的协同文章吧 " [education is leveraging Raspberry Pi and Linux][30]. + +### 开放对每个人都有好处 + +1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt 评价David Price 的书 'OPEN' ,该书探讨了 "开放" 不仅仅是技术转变的观点, 而是 "我们未来将如何工作、生活和学习"。 + +2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur 指出了如何利用开放式学习在工作群体中脱颖而出。 这个建议不仅仅是针对程序员的, 而是针对程序员的。设计师、作家、营销人员和其他创意专业人士也是开放式成功的关键。 + +3. [A graduate degree could springboard you into an open source job][3]: 引用的研究表明会 Linux 技能会带来更高的薪水, Joshua Pearce 说对开源的熟练和研究生学位是无与伦比的职业技能组合。 + +4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger 向我们展示了开放的做法是如何在宾夕法尼亚州的一个学区创造一种更具包容性、敏捷性和开放性的文化的。 Charlie 说, 这不仅仅是为了省钱;该区还受益于 "开放式领导原则, 促进师生创新, 帮助更好地吸引社区, 创造一个更有活力和包容性的学习社区"。 + +5. [15 ways to empower students with open source tools][5]: 我写开源是如何让学生自由探索、补拙和学习的, 不管他们是在学习基本的数字化素养, 还是通过有趣的项目来扩展这些技能。 + +6. [Developer opportunities to code for good][6]: 开源往往是对社会有益的项目的支柱。正如 Benetech Labs 副总裁 Ahn Bui 在这次采访中指出的那样: "建立开放数据标准是打破数据孤岛不可或缺的一步。这些开放标准将为互操作性提供基础, 进而转化为更多的组织共同建设, 往往更具成本效益。最终目标是以同样的成本甚至更低的成本为更多的人服务。 + +### 用于再混合和再利用的开放教育资源 + +1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis,Wiki Ed 的, 项目总监,讨论开放教育资源 (OERs) ,如 Wiki Ed,如何提供高质量且经济实惠的开源学习资源作为课堂教学工具。 + +2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, Creative Common 开放教育主任,分享高等教育中教育面貌是如何变化的, 以及 Creative Common 正在采取哪些措施来促进教育。 + +3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites,Open Up Resources 的社区福音传教士和首席营销官, 谈论非营利组织努力为 K-12 学校提供开放的, 标准一致的课程。 + +4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke夏威夷大学马诺阿分校的教育技术专家,他说, 在大学课程中过渡到 ORE 将 "使教师能够控制他们教授的内容, 我们预计这将为他们节省学生的费用"。 + +5. [How open courses are slashing the cost of higher education][11]: Saylor Academy 的教育主任 Devon Ritter 报告了 Saylor 是如何建立以公开许可内容为基础的大学学分课程, 目的是使更多的人能够负担得起和获得高等教育。 + +6. [Open educational resources movement gains speed][12]: Alexis Clifton,State University of New York 的 OER 服务的执行主任, 描述了纽约800万美元的投资如何刺激开放教育的增长, 并使大学更实惠。 + +7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik 在Duke University 探索 OSPRI (Open Source Pedagogy Research and Innovation,开源教育学的研究与创新), 在 Duke 和 Red Hat 的联合合作这是建立一个21世纪的, preK-12 学习生态系统, 是开放的设计。 + +8. [Perma.cc stops scholarly link rot][14]: Virginia Tech 的 Phillip Young 写关于 Perma.cc, "link rot,"(链接失效) 的解决方案 很大可能在学术论文中的超链接随着时间的推移而消失或变化。 + +9. [Open education: How students save money by creating open textbooks][15]: OER 先驱 Robin DeRosa 谈到 "公开许可教科书引入的自由, 以及教育和学习应结合包容性生态系统, 以增强公益的总体理念"。 + +### 课堂上的开源工具 + +1. [How an open source board game is saving the planet][16]: Joshua Pearce 写关于拯救地球, 一个棋盘游戏, 使学生能够解决环境问题, 同时有乐趣, 并为制造商社区作出贡献。 + +2. [A new Android app for teaching kids how to read][17]: Michael Hall 谈到 Phoenicia,他在儿子被诊断为自闭症后开发的儿童识字应用, 为了产生更好的编码价值, 以及为什么用户测试比你想象的更重要。 + +3. [8 open source Android apps for education][18]: Joshua Allen Holm 通过推荐 F-Droid 存储库中的8个开源应用来尝试, 这将挑战我们将智能手机用作学习工具。 + +4. [3 open source alternatives to MATLAB][19]: Jason Baker's 更新了他2016年的开源数学计算软件调查, 提出了 MATLAB 的替代方案, 这是数学、物理科学、工程和经济学中几乎无处不在的昂贵的专有解决方案。 + +5. [What does SVG have to do with teaching kids to code?][20] 退休工程师 Jay Nick 谈论他如何使用艺术作为一种创造性的方式, 向学生介绍编码。他在学校做志愿者, 使用可缩放矢量图形 (SVG,Scalable Vector Graphics) 教授一种结合数学和艺术原理的编码方法。 + +6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, 在 Texas Tech 拥有美术博士学位 分享他在单一解决方案统治的世界中使用开源工具的经验。 Kyle 说有一种偏见, 反对在计算机科学以外的学科中使用开源:"很多人认为非技术专业的学生不能使用 Linux, 他们对在高级学位课程中使用 Linux 的人做出了很多假设。...嗯, 这是有可能的, 我就是证明。 + +7. [A list of open source tools for college][22]: Aaron Cocker 概述了他在攻读计算机科学本科学位时使用的开源工具 (包括演示、备份和编程软件)。 + +8. [5 great KDE apps to help you study][23]: Zsolt Szakács 提供五个 KDE 应用程序, 帮助任何想要学习新技能或培养现有技能的人。 + +### 在教室编码 + +1. [How to get the next generation coding early][24]: Bryson Payne 说我们需要教孩子们在高中前编码: 到了九年级, 80% 的女孩和60% 的男孩已经从 STEM 职业中自选。但他建议, 这不仅仅是就业和缩小 IT 技能差距的问题。"教一个年轻人编写代码可能是你能给他们的最改变生活的技能。而且这不仅仅是一个职业提升者。编码是关于解决问题, 它是关于创造力, 更重要的是, 它是关于授权。 + +2. [Kids can't code without computers][25]: Patrick Masson 推出了 FLOSS 儿童桌面计划, 该计划教授服务不足学校的学生使用开源软件 (如 Linux、LibreOffice 和 GIMP) 重新设计较旧的计算机。该计划不仅为破碎或退役的硬件注入新的生命, 还为学生提供了重要的技能, 这些技能可能会转化为未来的职业。 + +3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva 提供 [Scratch][27] 的使用建议激发孩子们对编程的兴趣, 就像 LOGO 在20世纪80年代开始使用它时一样。 + +4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger 描述应用发明者, 一个编程框架, 用于构建 Android 应用程序使用可视块语言 (类似 Scratch 或者[Snap][29]). + +在这一年里, 我们了解到, 教育领域的一切都有一个开放的解决方案, 我预计这一主题将在2018年及以后继续下去。在未来的一年里, 你是否希望 Opensource.com 涵盖开放的教育主题?如果是, 请在评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/1/best-open-education + +作者:[Don Watkins][a] +译者:[lixinyuxx](https://github.com/lixinyuxx) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/don-watkins +[1]:https://opensource.com/article/17/7/book-review-open +[2]:https://opensource.com/article/17/8/jump-start-your-career +[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab +[4]:https://opensource.com/article/17/7/open-school-leadership +[5]:https://opensource.com/article/17/7/empower-students-open-source-tools +[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs +[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation +[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons +[9]:https://opensource.com/article/17/1/open-up-resources +[10]:https://opensource.com/article/17/2/interview-education-billy-meinke +[11]:https://opensource.com/article/17/7/college-alternatives +[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton +[13]:https://opensource.com/article/17/3/education-should-be-open-design +[14]:https://opensource.com/article/17/9/stop-link-rot-permacc +[15]:https://opensource.com/article/17/11/creating-open-textbooks +[16]:https://opensource.com/article/17/7/save-planet-board-game +[17]:https://opensource.com/article/17/4/phoenicia-education-software +[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education +[19]:https://opensource.com/alternatives/matlab +[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam +[21]:https://opensource.com/article/17/5/how-linux-higher-education +[22]:https://opensource.com/article/17/6/open-source-tools-university-student +[23]:https://opensource.com/article/17/6/kde-education-software +[24]:https://opensource.com/article/17/8/teach-kid-code-change-life +[25]:https://opensource.com/article/17/9/floss-desktops-kids +[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids +[27]:https://scratch.mit.edu/ +[28]:https://opensource.com/article/17/8/app-inventor-android-app-development +[29]:http://snap.berkeley.edu/ From 47c856dc6c4fd72c084a5c578626530adadc568e Mon Sep 17 00:00:00 2001 From: lxy <524187166@qq.com> Date: Wed, 19 Dec 2018 09:41:57 +0800 Subject: [PATCH 0935/1143] Revert "20180101" This reverts commit 9b1bba79fda1b38b9df99d31607edf9c7d545de6. --- ...en solutions to everything in education.md | 113 ++++++++++++++++++ ...en solutions to everything in education.md | 110 ----------------- 2 files changed, 113 insertions(+), 110 deletions(-) create mode 100644 sources/tech/20180101 27 open solutions to everything in education.md delete mode 100644 translated/tech/20180101 27 open solutions to everything in education.md diff --git a/sources/tech/20180101 27 open solutions to everything in education.md b/sources/tech/20180101 27 open solutions to everything in education.md new file mode 100644 index 0000000000..eeba3692e4 --- /dev/null +++ b/sources/tech/20180101 27 open solutions to everything in education.md @@ -0,0 +1,113 @@ +translating by lixinyuxx + +27 open solutions to everything in education +====== +![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo) + +Openness (from open source software, to open hardware, to open principles) is changing the paradigm of education. So, to celebrate all that's gone on this year, I collected 27 of the best articles published on Opensource.com in 2017 on the subject. I divided them into broad themes, rather than ordering them by popularity. And, if these 27 stories don't satisfy your appetite for information about open source in education, check out our companion article on how [education is leveraging Raspberry Pi and Linux][30]. + +### Open is better for everyone + +1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt reviews David Price's book OPEN, which explores the idea that "open" isn't just a technological shift, rather it's "how we'll work, live, and learn in the future." + +2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur points out how to get ahead in the workforce by learning open source. This advice isn't just for programmers; designers, writers, marketers, and other creative professionals are also essential to the success of open source. + +3. [A graduate degree could springboard you into an open source job][3]: Citing research that shows that Linux skills lead to higher pay, Joshua Pearce makes the case that open source proficiency and a graduate degree are an unbeatable career combination. + +4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger shows us how open practices are creating a more inclusive, agile, and open culture in a Pennsylvania school district. Charlie says it's not just about saving money; the district also gains from "open leadership principles that foster innovation among teachers and students, help to better engage the community, and create a more vibrant and inclusive learning community." + +5. [15 ways to empower students with open source tools][5]: I write how open source gives students the freedom to explore, tinker, and learn, whether they're learning basic digital literacy or expanding on those skills with fun projects. + +6. [Developer opportunities to code for good][6]: Open source is often the backbone of socially beneficial projects. As Ahn Bui, vice president of Benetech Labs, states in this interview: "Establishing open data standards is an integral step in breaking down data silos. Those open standards will provide the foundation for interoperability and in turn, translate to more organizations building together, often more cost effectively. The ultimate goal is to serve more people at the same cost or even less." + +### Open education resources for remixing and reusing + +1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis, director of programs for Wiki Ed, discusses how open educational resources (OERs), such as Wiki Ed, are providing high-quality and affordable open source learning resources as classroom teaching tools. + +2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, director of open education for Creative Commons, shares how the face of education is changing in higher education and what Creative Commons is doing to facilitate it. + +3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites, community evangelist and chief marketing officer of Open Up Resources, talks about the nonprofit organization's efforts to provide open, standards-aligned curricula for K-12 schools. + +4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke, educational technologist at the University of Hawaii at Manoa, says that transitioning to OER in college courses will "empower faculty to take control of what content they teach with, which we expect will result in their saving students money." + +5. [How open courses are slashing the cost of higher education][11]: Saylor Academy's director of education Devon Ritter reports how Saylor is building its college credit-eligible courses on openly licensed content, with the goal of making higher education affordable and accessible to more people. + +6. [Open educational resources movement gains speed][12]: Alexis Clifton, executive director of the State University of New York OER Services, describes how New York's US$ 8 million investment is spurring growth in open education and making college more affordable. + +7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik from Duke University explores OSPRI (Open Source Pedagogy Research and Innovation), a collaboration between Duke and Red Hat that's building a 21st-century, preK-12 learning ecosystem that is open by design. + +8. [Perma.cc stops scholarly link rot][14]: Virginia Tech's Phillip Young writes about Perma.cc, a solution to "link rot," which is the high probability that hyperlinks in academic papers will disappear or change over time. + +9. [Open education: How students save money by creating open textbooks][15]: OER pioneer Robin DeRosa talks about "the freedom that the openly licensed textbook introduced, and the overarching idea that education and learning should be contextualized in inclusive ecosystems that enhance the public good." + +### Open source tools in the classroom + +1. [How an open source board game is saving the planet][16]: Joshua Pearce writes about Save the Planet, a board game that empowers students to solve environmental problems while having fun and contributing to the maker community. + +2. [A new Android app for teaching kids how to read][17]: Michael Hall talks about Phoenicia, a children's literacy app he developed after his son was diagnosed with autism, the value of coding for good, and why user testing matters more than you think. + +3. [8 open source Android apps for education][18]: Joshua Allen Holm challenges us to use our smartphones as learning tools by recommending eight open source apps from the F-Droid repository to try. + +4. [3 open source alternatives to MATLAB][19]: Jason Baker's update to his 2016 survey of open source mathematical computing software presents alternatives to MATLAB, the expensive, proprietary solution nearly ubiquitous in mathematics, physical sciences, engineering, and economics. + +5. [What does SVG have to do with teaching kids to code?][20] Retired engineer Jay Nick talks about how he uses art as a creative way to introduce students to coding. He volunteers in schools, using Scalable Vector Graphics (SVG) to teach an approach to coding that combines principles of mathematics and art. + +6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, who holds a PhD in fine arts from Texas Tech, shares his experience using open source tools in a world ruled by proprietary solutions. Kyle says there's a bias against using open source in disciplines outside of computer science: "Many people think non-technical students can't use Linux, and they make a lot of assumptions about people who use it in their advanced degree programs. … Well, it is possible, and I'm proof." + +7. [A list of open source tools for college][22]: Aaron Cocker outlines the open source tools (including presentation, backup, and programming software) he uses while working on his undergraduate degree in computer science. + +8. [5 great KDE apps to help you study][23]: Zsolt Szakács offers five KDE applications that help anyone who wants to learn new skills or cultivate existing ones. + +### Coding in the classroom + +1. [How to get the next generation coding early][24]: Bryson Payne says we need to teach kids to code before high school: By ninth grade 80% of girls and 60% of boys have already self-selected out of a STEM career. But it's not only about jobs and closing the IT skills gap, he suggests. "Teaching a young person to code could be the single most life-changing skill you can give them. And it's not just a career-enhancer. Coding is about problem-solving, it's about creativity, and more importantly, it's about empowerment." + +2. [Kids can't code without computers][25]: Patrick Masson introduces the FLOSS Desktops for Kids program, which teaches students at underserved schools to repurpose older computers with open source software, such as Linux, LibreOffice, and GIMP. Not only is the program breathing new life into broken or decommissioned hardware, it's also giving students important skills that may translate into future careers. + +3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva offers suggestions for using [Scratch][27] to spark kids' interest in programming, just as LOGO did when he started using it in the 1980s. + +4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger describes App Inventor, a programming framework for building Android applications using a visual blocks language (similar to Scratch or [Snap][29]). + +Throughout the year we learned that there is an open solution to everything in education, and I expect this theme to continue in 2018 and beyond. Are there open education topics you'd like Opensource.com to cover in the coming year? If so, please share your ideas in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/1/best-open-education + +作者:[Don Watkins][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/don-watkins +[1]:https://opensource.com/article/17/7/book-review-open +[2]:https://opensource.com/article/17/8/jump-start-your-career +[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab +[4]:https://opensource.com/article/17/7/open-school-leadership +[5]:https://opensource.com/article/17/7/empower-students-open-source-tools +[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs +[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation +[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons +[9]:https://opensource.com/article/17/1/open-up-resources +[10]:https://opensource.com/article/17/2/interview-education-billy-meinke +[11]:https://opensource.com/article/17/7/college-alternatives +[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton +[13]:https://opensource.com/article/17/3/education-should-be-open-design +[14]:https://opensource.com/article/17/9/stop-link-rot-permacc +[15]:https://opensource.com/article/17/11/creating-open-textbooks +[16]:https://opensource.com/article/17/7/save-planet-board-game +[17]:https://opensource.com/article/17/4/phoenicia-education-software +[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education +[19]:https://opensource.com/alternatives/matlab +[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam +[21]:https://opensource.com/article/17/5/how-linux-higher-education +[22]:https://opensource.com/article/17/6/open-source-tools-university-student +[23]:https://opensource.com/article/17/6/kde-education-software +[24]:https://opensource.com/article/17/8/teach-kid-code-change-life +[25]:https://opensource.com/article/17/9/floss-desktops-kids +[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids +[27]:https://scratch.mit.edu/ +[28]:https://opensource.com/article/17/8/app-inventor-android-app-development +[29]:http://snap.berkeley.edu/ +[30]:https://opensource.com/article/17/12/best-opensourcecom-linux-and-raspberry-pi-education diff --git a/translated/tech/20180101 27 open solutions to everything in education.md b/translated/tech/20180101 27 open solutions to everything in education.md deleted file mode 100644 index 898a4250ab..0000000000 --- a/translated/tech/20180101 27 open solutions to everything in education.md +++ /dev/null @@ -1,110 +0,0 @@ -27个解决教学问题的开放式方法 -====== -![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo) - -开放式理念 (从开源软件到开放硬件, 再到开放原则) 正在改变教育的范式。因此, 为了庆祝今年发生的一切, 我收集了2017年在 Opensource.com 上发表的27篇关于这个主题的最好的文章。我把它们分成明确的主题, 而不是按人气来分类。而且, 如果这27个故事不能满足你对教育公开信息的胃口, 那就看看我们的协同文章吧 " [education is leveraging Raspberry Pi and Linux][30]. - -### 开放对每个人都有好处 - -1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt 评价David Price 的书 'OPEN' ,该书探讨了 "开放" 不仅仅是技术转变的观点, 而是 "我们未来将如何工作、生活和学习"。 - -2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur 指出了如何利用开放式学习在工作群体中脱颖而出。 这个建议不仅仅是针对程序员的, 而是针对程序员的。设计师、作家、营销人员和其他创意专业人士也是开放式成功的关键。 - -3. [A graduate degree could springboard you into an open source job][3]: 引用的研究表明会 Linux 技能会带来更高的薪水, Joshua Pearce 说对开源的熟练和研究生学位是无与伦比的职业技能组合。 - -4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger 向我们展示了开放的做法是如何在宾夕法尼亚州的一个学区创造一种更具包容性、敏捷性和开放性的文化的。 Charlie 说, 这不仅仅是为了省钱;该区还受益于 "开放式领导原则, 促进师生创新, 帮助更好地吸引社区, 创造一个更有活力和包容性的学习社区"。 - -5. [15 ways to empower students with open source tools][5]: 我写开源是如何让学生自由探索、补拙和学习的, 不管他们是在学习基本的数字化素养, 还是通过有趣的项目来扩展这些技能。 - -6. [Developer opportunities to code for good][6]: 开源往往是对社会有益的项目的支柱。正如 Benetech Labs 副总裁 Ahn Bui 在这次采访中指出的那样: "建立开放数据标准是打破数据孤岛不可或缺的一步。这些开放标准将为互操作性提供基础, 进而转化为更多的组织共同建设, 往往更具成本效益。最终目标是以同样的成本甚至更低的成本为更多的人服务。 - -### 用于再混合和再利用的开放教育资源 - -1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis,Wiki Ed 的, 项目总监,讨论开放教育资源 (OERs) ,如 Wiki Ed,如何提供高质量且经济实惠的开源学习资源作为课堂教学工具。 - -2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, Creative Common 开放教育主任,分享高等教育中教育面貌是如何变化的, 以及 Creative Common 正在采取哪些措施来促进教育。 - -3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites,Open Up Resources 的社区福音传教士和首席营销官, 谈论非营利组织努力为 K-12 学校提供开放的, 标准一致的课程。 - -4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke夏威夷大学马诺阿分校的教育技术专家,他说, 在大学课程中过渡到 ORE 将 "使教师能够控制他们教授的内容, 我们预计这将为他们节省学生的费用"。 - -5. [How open courses are slashing the cost of higher education][11]: Saylor Academy 的教育主任 Devon Ritter 报告了 Saylor 是如何建立以公开许可内容为基础的大学学分课程, 目的是使更多的人能够负担得起和获得高等教育。 - -6. [Open educational resources movement gains speed][12]: Alexis Clifton,State University of New York 的 OER 服务的执行主任, 描述了纽约800万美元的投资如何刺激开放教育的增长, 并使大学更实惠。 - -7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik 在Duke University 探索 OSPRI (Open Source Pedagogy Research and Innovation,开源教育学的研究与创新), 在 Duke 和 Red Hat 的联合合作这是建立一个21世纪的, preK-12 学习生态系统, 是开放的设计。 - -8. [Perma.cc stops scholarly link rot][14]: Virginia Tech 的 Phillip Young 写关于 Perma.cc, "link rot,"(链接失效) 的解决方案 很大可能在学术论文中的超链接随着时间的推移而消失或变化。 - -9. [Open education: How students save money by creating open textbooks][15]: OER 先驱 Robin DeRosa 谈到 "公开许可教科书引入的自由, 以及教育和学习应结合包容性生态系统, 以增强公益的总体理念"。 - -### 课堂上的开源工具 - -1. [How an open source board game is saving the planet][16]: Joshua Pearce 写关于拯救地球, 一个棋盘游戏, 使学生能够解决环境问题, 同时有乐趣, 并为制造商社区作出贡献。 - -2. [A new Android app for teaching kids how to read][17]: Michael Hall 谈到 Phoenicia,他在儿子被诊断为自闭症后开发的儿童识字应用, 为了产生更好的编码价值, 以及为什么用户测试比你想象的更重要。 - -3. [8 open source Android apps for education][18]: Joshua Allen Holm 通过推荐 F-Droid 存储库中的8个开源应用来尝试, 这将挑战我们将智能手机用作学习工具。 - -4. [3 open source alternatives to MATLAB][19]: Jason Baker's 更新了他2016年的开源数学计算软件调查, 提出了 MATLAB 的替代方案, 这是数学、物理科学、工程和经济学中几乎无处不在的昂贵的专有解决方案。 - -5. [What does SVG have to do with teaching kids to code?][20] 退休工程师 Jay Nick 谈论他如何使用艺术作为一种创造性的方式, 向学生介绍编码。他在学校做志愿者, 使用可缩放矢量图形 (SVG,Scalable Vector Graphics) 教授一种结合数学和艺术原理的编码方法。 - -6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, 在 Texas Tech 拥有美术博士学位 分享他在单一解决方案统治的世界中使用开源工具的经验。 Kyle 说有一种偏见, 反对在计算机科学以外的学科中使用开源:"很多人认为非技术专业的学生不能使用 Linux, 他们对在高级学位课程中使用 Linux 的人做出了很多假设。...嗯, 这是有可能的, 我就是证明。 - -7. [A list of open source tools for college][22]: Aaron Cocker 概述了他在攻读计算机科学本科学位时使用的开源工具 (包括演示、备份和编程软件)。 - -8. [5 great KDE apps to help you study][23]: Zsolt Szakács 提供五个 KDE 应用程序, 帮助任何想要学习新技能或培养现有技能的人。 - -### 在教室编码 - -1. [How to get the next generation coding early][24]: Bryson Payne 说我们需要教孩子们在高中前编码: 到了九年级, 80% 的女孩和60% 的男孩已经从 STEM 职业中自选。但他建议, 这不仅仅是就业和缩小 IT 技能差距的问题。"教一个年轻人编写代码可能是你能给他们的最改变生活的技能。而且这不仅仅是一个职业提升者。编码是关于解决问题, 它是关于创造力, 更重要的是, 它是关于授权。 - -2. [Kids can't code without computers][25]: Patrick Masson 推出了 FLOSS 儿童桌面计划, 该计划教授服务不足学校的学生使用开源软件 (如 Linux、LibreOffice 和 GIMP) 重新设计较旧的计算机。该计划不仅为破碎或退役的硬件注入新的生命, 还为学生提供了重要的技能, 这些技能可能会转化为未来的职业。 - -3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva 提供 [Scratch][27] 的使用建议激发孩子们对编程的兴趣, 就像 LOGO 在20世纪80年代开始使用它时一样。 - -4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger 描述应用发明者, 一个编程框架, 用于构建 Android 应用程序使用可视块语言 (类似 Scratch 或者[Snap][29]). - -在这一年里, 我们了解到, 教育领域的一切都有一个开放的解决方案, 我预计这一主题将在2018年及以后继续下去。在未来的一年里, 你是否希望 Opensource.com 涵盖开放的教育主题?如果是, 请在评论中分享你的想法。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/1/best-open-education - -作者:[Don Watkins][a] -译者:[lixinyuxx](https://github.com/lixinyuxx) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/don-watkins -[1]:https://opensource.com/article/17/7/book-review-open -[2]:https://opensource.com/article/17/8/jump-start-your-career -[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab -[4]:https://opensource.com/article/17/7/open-school-leadership -[5]:https://opensource.com/article/17/7/empower-students-open-source-tools -[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs -[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation -[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons -[9]:https://opensource.com/article/17/1/open-up-resources -[10]:https://opensource.com/article/17/2/interview-education-billy-meinke -[11]:https://opensource.com/article/17/7/college-alternatives -[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton -[13]:https://opensource.com/article/17/3/education-should-be-open-design -[14]:https://opensource.com/article/17/9/stop-link-rot-permacc -[15]:https://opensource.com/article/17/11/creating-open-textbooks -[16]:https://opensource.com/article/17/7/save-planet-board-game -[17]:https://opensource.com/article/17/4/phoenicia-education-software -[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education -[19]:https://opensource.com/alternatives/matlab -[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam -[21]:https://opensource.com/article/17/5/how-linux-higher-education -[22]:https://opensource.com/article/17/6/open-source-tools-university-student -[23]:https://opensource.com/article/17/6/kde-education-software -[24]:https://opensource.com/article/17/8/teach-kid-code-change-life -[25]:https://opensource.com/article/17/9/floss-desktops-kids -[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids -[27]:https://scratch.mit.edu/ -[28]:https://opensource.com/article/17/8/app-inventor-android-app-development -[29]:http://snap.berkeley.edu/ From 6602c304cc871ab4fe6dc569686f2a8f1afaccf6 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Wed, 19 Dec 2018 11:01:39 +0800 Subject: [PATCH 0936/1143] correct --- ... - Notmuch, mbsync, postfix and dovecot.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md index ffbf6d11a7..0edd75e2bd 100644 --- a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md +++ b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @@ -1,12 +1,12 @@ 我的个人电子邮件系统 - Notmuch, mbsync, postfix and dovecot ====== -我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷路了。所以这篇文章是一个自我文档, 这样我就不用再挣扎了就能改正过来。 +我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。 ### 服务器端 我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说) -> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我发展了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info) +> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info) 除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。 @@ -25,9 +25,9 @@ ### 邮件同步 -邮件同步是使用 mbsync 工具完成的, 我以前是离线的用户, 最近切换到 mbsync, 因为我觉得它比 OfflineIMAP 的配置更轻, 更简单。命令是由包 isync 提供的。 +邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户, 最近切换到 mbsync, 因为我觉得它比 OfflineIMAP 的配置更轻, 更简单。命令是由包 isync 提供的。 -配置文件是 ~/.mbsyncrc. 下面是我的例子与一些私人设置。 +配置文件是 ~/.mbsyncrc. 下面是我的例子与一些个人设置。 ``` IMAPAccount copyninja @@ -79,7 +79,7 @@ SyncState * Sync All ``` -对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许您提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我使用对称加密与 gpg 和存储密码在我的磁盘上的一些地方。这当然是由 Unix ACL 保护安全。 +对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许您提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。 实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。 @@ -87,9 +87,9 @@ Sync All ### 邮件分类 -一旦邮件在您本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置是有点大题小作相比于设置所有服务器软件, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。 +一旦邮件在您本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。 -不多让我很容易索引通过千兆字节的邮件档案, 并很容易得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。 +不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。 ``` #!/bin/sh @@ -135,15 +135,15 @@ done ### 阅读邮件 -现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层, 它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。您可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。 +现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer), 它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。您可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。 ### 发送邮件 -如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是我最近迷惑的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。 +如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。 我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。 -我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法 +我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法) ``` adduser _relay @@ -167,16 +167,16 @@ smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd ``` -替换 smtp.example.com 用你的 SMTP 服务器名称, 您已输入的 relayhost 认证。 用您创建的用户及其密码替换 user with _relay 。 + 用你的 SMTP 服务器名称替换 smtp.example.com ,您已输入的 relayhost 认证。 用您创建的用户及其密码替换 user with _relay 。 -若要保护 sasl_passwd 文件, 并创建它的哈希值进行 postfix 使用以下命令。 +若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。 ``` chown root:root /etc/postfix/sasl_passwd chmod 0600 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd ``` -最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是您的文件的哈希值 /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从您的系统中取出。 +最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是您的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从您的系统中取出。 ### Bonus 的部分 @@ -212,14 +212,14 @@ StandardOutput=syslog StandardError=syslog ``` -将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启他们 +将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启它们 ``` systemctl enable --user mailsync.timer systemctl enable --user mailsync.service systemctl start --user mailsync.timer ``` -这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew 他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。 +这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。 -------------------------------------------------------------------------------- From 2132fc3343ac37a09ecbbb1deaac05790124f4d8 Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 19 Dec 2018 11:16:42 +0800 Subject: [PATCH 0937/1143] =?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 --- ...23 Celebrate Christmas In Linux Way With These Wallpapers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md index e59286ddbc..94c08d72ae 100644 --- a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (jlztan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers) From 5b9c7454137a8a6639bad8a9dad3f08eac8f530d Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Wed, 19 Dec 2018 13:40:24 +0800 Subject: [PATCH 0938/1143] Translating How to Update Ubuntu. --- ...untu -Terminal - GUI Methods- It-s FOSS.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md index b0f0751d81..00864bffa9 100644 --- a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md +++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md @@ -49,31 +49,31 @@ sudo apt upgrade #### 说明:sudo apt update -This command updates the local database of available packages. If you won’t run this command, the local database won’t be updated and your system will not know if there are any new versions available. +这条命令更新了可用软件包的本地数据库。如果你没运行这条命令,本地数据库将不会更新而你的系统将不会知道是否又可用的新版本。 -This is why when you run the sudo apt update, you’ll see lots of URLs in the output. The command fetches the package information from the respective repositories (the URLs you see in the output). +这就是为什么当你运行 `sudo apt update`,你会在输出中看到大量的 URLs。这条命令从对应的储存库(你在输出中看到的 URLs)中获取软件包信息。 -![Updating Ubuntu Linux][5] +![更新 Ubuntu Linux][5] -At the end of the command, it tells you how many packages can be upgraded. You can see these packages by running the following command: +在命令的末尾,它告诉你有多少个软件包可以被更新。你可以使用下列命令查看这些软件包: ``` apt list --upgradable ``` -**Additional Reading:** Read this article to learn [what is Ign, Hit and Get in the apt update command output][6]. +**补充阅读:** 阅读这篇文章了解[命令 `apt update` 的输出中的 Ign,Hit 和 Get 是什么][6]。 #### 说明:sudo apt upgrade -This command matches the versions of installed packages with the local database. It collects all of them and then it will list all of the packages that have a newer version available. At this point, it will ask if you want to upgrade (the installed packages to the newer version). +这条命令将已安装的软件包版本与本地数据库进行匹配。它收集全部信息,然后列出所有具有更新版本的软件包。此时,它会询问您是否要升级(已安装的软件包更新到新版本)。 -![Update Ubuntu Linux via Command Line][7] +![通过命令行更新 Ubuntu Linux][7] -You can type ‘yes’, ‘y’ or just press enter to confirm the installation of updates. +你可以键入 `yes`,`y` 或者只敲回车键去确认安装这些更新。 -So the bottom line is that the sudo apt update checks for the availability of new versions while as the sudo apt upgrade actually performs the update. +所以总的来说,`sudo apt update` 会检查可用的新版本,而 `sudo apt upgrade` 实际上会执行更新。 -The term update might be confusing as you might expect the apt update command to update the system by installing the updates but that doesn’t happen. +命令 `update` 可能会令人困惑,因为你可能期望通过命令 `apt update` 安装更新来更新系统,但这并不会发生。 ### 通过 GUI 更新 Ubuntu[适用于桌面用户] From 7b7ec40b94c86f3bef61a01487c87cee78f90a70 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 15:12:29 +0800 Subject: [PATCH 0939/1143] PRF:20171111 A CEOs Guide to Emacs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 部分 --- .../tech/20171111 A CEOs Guide to Emacs.md | 69 ++++++++++--------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/translated/tech/20171111 A CEOs Guide to Emacs.md b/translated/tech/20171111 A CEOs Guide to Emacs.md index 6d14ad7a8e..9ddbab89d2 100644 --- a/translated/tech/20171111 A CEOs Guide to Emacs.md +++ b/translated/tech/20171111 A CEOs Guide to Emacs.md @@ -13,7 +13,7 @@ 这可能给人一种 Emacs 已经过气或过时的印象。但它不是,它是强大和永恒的,只要你耐心地去理解它的一些规则。它的规则很另类,也很奇怪,但其中的逻辑却引人注目,且很有魅力。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这里。 -如果通过编辑 Lisp 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 Ludwig 和 Emacs Lisp),但是 Fugue 的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs,40% 用 IDE 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32]Pointy-Haired Bosses(PHB[^1] )(以及,其它好奇的人)的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。 +如果通过编辑 Lisp 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 Ludwig 和 Emacs Lisp),但是 Fugue 公司的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs,40% 用 IDE 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32]Pointy-Haired Bosses(PHB[^1] )(以及,其它好奇的人)的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。 ### 恒久优势 @@ -27,48 +27,49 @@ Org 模式本身就值得花时间,但如果你像我一样,你通常要处 #### 在安静中创造事情 -拥有我所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?拥有 `Lisp` 键盘的全部功能?这就是我用 Emacs 来完成所有的创作性工作,处理音乐和图片除外。 +拥有我所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?发挥了 Lisp 键盘的全部威力了吗?我用 Emacs 来完成所有的创作性工作,处理音乐和图片除外。 -我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等保存在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序努力提供帮助并使其易于使用。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比其 office 应用程序,我更讨厌在线版的应用程序。 +我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等放在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序致力于提供帮助和易用性。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比起 office 应用程序,我更讨厌其在线版。 -![1933 steel bicycle](https://blog.fugue.co/assets/images/desktop.jpg) -我的桌面布局, Emacs 在左边 +![](https://www.fugue.co/hubfs/Imported_Blog_Media/desktop-1.jpg) -但是交流呢?创造和交流之间的差别很大。当我为两者留出不同的时间时,我的效率会更高。在 `Fugue` 中使用了 `Slack`,痛并快乐着。我把它和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我很高兴地能够忽略所有的聊天。仅仅是风投或董事会董事的一次懈怠,或一封电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。 +*我的桌面布局, Emacs 在左边* -#### 带上一切,并保留着 +但是交流呢?创造和交流之间的差别很大。当我为两者留出不同的时间段时,我的效率会更高。我们 Fugue 公司使用 Slack,痛并快乐着。我把它和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我很高兴地能够忽略所有的聊天。只要一个 Slackstorm 或一封风投或董事会董事的电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。 -第三个原因是,我发现 Emacs 比其它的环境更有优势的是你可以很容易的用它来处理事务。我的意思是,你所需要的只是通过 `Dropbox` 类似的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何地方,任何环境下工作了,因为你已经精心制作了适合目的套件了。我在 OS X,Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理页面、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。 +#### 包罗万象,永久长青 -永久存储在计算机上的限制是文件格式。假设人类已经解决了存储[^6] 的问题,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最持久的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于办公应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。 +第三个原因是,我发现 Emacs 比其它的环境更有优势的是你可以很容易的用它来处理事务。我的意思是,你所需要的只是通过 Dropbox 类似的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何你已经精心打造了适合你的目的的套件的环境中工作了。我在 OS X、Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理 Pages、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。 + +限制在计算机上永久存储的因素是文件格式。假设人类已经解决了存储问题[^6] ,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最长青的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于 Office 应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。 如果你准备尝试 Emacs,请继续阅读!下面的部分不会取代完整的教程,但是在完成阅读时,就可以操作了。 ### 学会驾驭 Emacs —— 一个专业的配置 -所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像现代世界已经过去了。这有点像你只开过车,却要你去学骑自行车[^7] 。 +所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像穿越到过去。这有点像你只开过车,却要你去学骑自行车[^7] 。 #### 该选哪个 Emacs -我用的是 GNU 中 OS X 和 Windows 的通用版本的 Emacs。你可以在 [][34][http://emacsformacos.com/][35] 获取 OS X 版本,在[][36][http://www.gnu.org/software/emacs/][37]获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(包括 `Lisp` 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[^8] ! +我用的是来自 GNU 的 OS X 和 Windows 的通用版本的 Emacs。你可以在 [http://emacsformacos.com/][35] 获取 OS X 版本,在 [http://www.gnu.org/software/emacs/][37] 获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(涉及到 Lisp 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[^8] ! -#### 首先,学会浏览 +#### 首先,学会导航 -在本文中,我将约定 Emacs 中的键和组合。`C` 表示 `Control` 键,`M` 表示 `meta`(通常是 `Alt` 或 `Option` 键),以及用于组合键的连字符。因此,`C-h t` 表示同时按下 `Control` 和 `h` 键,然后释放,再按下 `t`。这个组快捷键会指向一个教程,这是你首先要做的一件事。 +在本文中,我将使用 Emacs 的按键和组合键约定。`C` 表示 `Control` 键,`M` 表示 `meta`(通常是 `Alt` 或 `Option` 键),以及用于组合键的连字符。因此,`C-h t` 表示同时按下 `Control` 和 `h` 键,然后释放,再按下 `t`。这个组合快捷键会指向一个教程,这是你首先要做的一件事。 -不要使用方向键或鼠标。它们可以工作,但是你应该给自己一周的时间来使用 Emacs 教程中的原生命令。一旦你这些命令变为了肌肉记忆,你可能就会乐在其中,无论到哪里,你都会非常想念它们。Emacs 教程在介绍它们方面做得很好,但是我将进行总结,所以您不需要阅读全部内容。最无聊的是,不用方向键,用 `C-b` 向前移动,用 `C-f` 向后移动,上一行用 `C-p`,下一行用 `C-n`。你可能会想:“我用方向键就很好,为什么还要这样做?” 有几个原因。首先,你不需要从主键盘区将你的手移开。第二,使用 `Alt`(或用 Emacs 的说法 `Meta`)键来向前或向后移动一个单词。显而易见这样更方便。第三,如果想重复某个命令,可以在命令前面加上一个数字。在编辑文档时,我经常使用这种方法,通过估计向前多少个单词或向上或线下移动多少行,然后按下 `C-9 C-p` 或 `M-5 M-b` 之类的快捷键。其他真正重要的浏览命令基于开头用 `a` 和结尾用 `e`。在行中使用 `C-a|e`,在句中使用 `M-a|e`。为了让句中的命令正常工作,需要在句号后增加两个空格,这同时提供了一个有用的特性,并消除了脑中的[希伯列][38]。如果需要将文档导出到单个空间[发布环境][39],可以编写一个宏来执行此操作。 +不要使用方向键或鼠标。它们可以工作,但是你应该给自己一周的时间来使用 Emacs 教程中的原生的导航命令。一旦你这些命令变为了肌肉记忆,你可能就会乐在其中,无论到哪里,你都会非常想念它们。这个 Emacs 教程在介绍它们方面做得很好,但是我将进行总结,所以您不需要阅读全部内容。最无聊的是,不用方向键,用 `C-b` 向前移动,用 `C-f` 向后移动,上一行用 `C-p`,下一行用 `C-n`。你可能会想:“我用方向键就很好,为什么还要这样做?” 有几个原因。首先,你不需要从主键盘区将你的手移开。第二,使用 `Alt`(或用 Emacs 的说法 `Meta`)键来向前或向后在单词间移动。显而易见这样更方便。第三,如果想重复某个命令,可以在命令前面加上一个数字。在编辑文档时,我经常使用这种方法,通过估计向后移动多少个单词或向上或向下移动多少行,然后按下 `C-9 C-p` 或 `M-5 M-b` 之类的快捷键。其它真正重要的导航命令基于开头用 `a` 和结尾用 `e`。在行中使用 `C-a|e`,在句中使用 `M-a|e`。为了让句中的命令正常工作,需要在句号后增加两个空格,这同时提供了一个有用的特性,并消除了脑中一个过时的[观点][38]。如果需要将文档导出到单个空间[发布环境][39],可以编写一个宏来执行此操作。 -Emacs 附带的教程很值得去看。对于真正缺乏耐心的人,我将介绍一些重要的命令,但那个教程非常有用。记住:用 `C-h t` 进入教程。 +Emacs 所附带的教程很值得去看。对于真正缺乏耐心的人,我将介绍一些重要的命令,但那个教程非常有用。记住:用 `C-h t` 进入教程。 #### 学会复制和粘贴 -你可以叫 Emacs 设为 `CUA` 模式,这将会以熟悉的方式工作来操作复制粘贴,但是原生的 Emacs 方法更好,而且你一旦学会了它,就很容易。你可以使用 `Shift` 这样的浏览命令来标记区域(如选择)。所以 `C-F` 是选中管标前的一个字符,等等。亦可以用 `M-w` 来复制,用 `C-w` 剪切,然后用 `C-y` 粘贴。这些实际上叫做删除和召回,但它非常类似于剪切和粘贴。在删除的环中有些小技巧,但是现在,你只需要关注剪切、复制和粘贴。如果你在这开始摸索, `C-x u` 是撤销。 +你可以把 Emacs 设为 CUA 模式,这将会以熟悉的方式工作来操作复制粘贴,但是原生的 Emacs 方法更好,而且你一旦学会了它,就很容易。你可以使用 `Shift` 和导航命令来标记区域(如同选择)。所以 `C-F` 是选中光标前的一个字符,等等。亦可以用 `M-w` 来复制,用 `C-w` 剪切,然后用 `C-y` 粘贴。这些实际上叫做删除killing召回yanking,但它非常类似于剪切和粘贴。在删除中有些小技巧,但是现在,你只需要关注剪切、复制和粘贴。如果你开始尝试了,那么 `C-x u` 是撤销。 -#### 下一步,学会用 `Ido` 模式 +#### 下一步,学会用 Ido 模式 -相信我,`Ido` 会让文件的工作变得很简单。通常,你在 Emacs 中处理文件不需要使用一个单独分开的查找或文件资源管理器的窗口。相反的,你可以用编辑器的命令来创建、打开和保存文件。如果没有 `Ido` 的话,这将有点麻烦,所以我建议你在学习其他之前安装好它。 `Ido` 是 Emacs 的 22 版时开发出来的,但是需要对你的 `.emacs` 文件做一些调整,来确保它一直开启着。这是个配置环境的好理由。 +相信我,Ido 会让文件的工作变得很简单。通常,你在 Emacs 中处理文件不需要使用一个单独的访达或文件资源管理器的窗口。相反的,你可以用编辑器的命令来创建、打开和保存文件。如果没有 Ido 的话,这将有点麻烦,所以我建议你在学习其他之前安装好它。 Ido 是 Emacs 的 22 版时开始出现的,但是需要对你的 `.emacs` 文件做一些调整,来确保它一直开启着。这是个配置环境的好理由。 -Emacs 中的大多数功能都表现在模式上。要安装制定的模式,需要做两件事。嗯,一开始你需要做一些额外的事情,但这些只需要做一次,然后再做这两件事。那么,额外的事情是你需要一个单独的位置来放置所有 `Emacs Lisp` 文件,并且你需要告诉 Emacs 这个位置在哪。我建议你在 Dropbox 上创建一个单独的目录,那是你 Emacs 主目录。在这里,你需要创建一个 `.emacs` 文件和 `.emacs.d` 目录。在 `.emacs.d` 目录下,创建一个 `lisp` 的目录。就像这样: +Emacs 中的大多数功能都表现在模式上。要安装指定的模式,需要做两件事。嗯,一开始你需要做一些额外的事情,但这些只需要做一次,然后再做这两件事。那么,这件额外的事情是你需要一个单独的位置来放置所有 Emacs Lisp 文件,并且你需要告诉 Emacs 这个位置在哪。我建议你在 Dropbox 上创建一个单独的目录,那是你 Emacs 主目录。在这里,你需要创建一个 `.emacs` 文件和 `.emacs.d` 目录。在 `.emacs.d` 目录下,创建一个 `lisp` 的目录。就像这样: ``` home @@ -80,21 +81,23 @@ home -lisp ``` -你可以将那些像模式的 `.el` 文件放到 `home/.emacs.d/lis` 目录下,然后在你的 `.emacs` 文件中添加以下代码来指明该路径: +你可以将那些比如模式的 `.el` 文件放到 `home/.emacs.d/lisp` 目录下,然后在你的 `.emacs` 文件中添加以下代码来指明该路径: -`(add-to-list 'load-path "~/.emacs.d/lisp/")` +``` +(add-to-list 'load-path "~/.emacs.d/lisp/") +``` -`Ido` 模式是 Emacs 自带的,所以你不需要在你的 `lisp` 目录中放 `.el` 文件,但你仍然需要添加上面代码,因为下面的介绍会使用到它. +Ido 模式是 Emacs 自带的,所以你不需要在你的 `lisp` 目录中放这个 `.el` 文件,但你仍然需要添加上面代码,因为下面的介绍会使用到它. #### 符号链接是你的好伙伴 -等等,这里写的 `.emacs` 和 `.emacs.d` 都是存放在你的主目录下,但我们把他们放到了 Dropbox 的某些愚蠢的文件夹!对,这就让你的环境在任何地方都很容易使用。把所有东西都保存在 Dropbox 上,并链接到 `.emacs` 和 `.emacs.d`,以及主目录 `~`。在 OS X 上,使用 `ln -s` 命令非常简单,但在 Windows 上却很麻烦。幸运的是,Emacs 提供了一种简单的方法来替代 Windows 上的符号链接,Windows 的 `HOME` 环境变量。转到 Windows 的环境变量(Windows 10,你可以按 Windows 键然后输入 “环境变量” 来搜索,这是 Windows 10 最好的一部分了),在你的帐户下创建一个指向你在 Dropbox 中 Emacs 的文件家的 `HOME` 环境变量。如果你想方便地浏览 Dropbox 之外的本地文件,你可能想在你的实际主目录下建立一个到 Dropbox 下 Emacs 主目录的符号链接。 +等等,这里写的 `.emacs` 和 `.emacs.d` 都是存放在你的主目录下,但我们把它们放到了 Dropbox 的某些愚蠢的文件夹!对,这就让你的环境在任何地方都很容易使用。把所有东西都保存在 Dropbox 上,并做符号链接到 `~` 下的 `.emacs` 、`.emacs.d` 和你的主要存放文档的目录。在 OS X 上,使用 `ln -s` 命令非常简单,但在 Windows 上却很麻烦。幸运的是,Emacs 提供了一种简单的方法来替代 Windows 上的符号链接,Windows 的 `HOME` 环境变量。转到 Windows 的环境变量(Windows 10,你可以按 Windows 键然后输入 “环境变量” 来搜索,这是 Windows 10 最好的地方了),在你的帐户下创建一个指向你在 Dropbox 中 Emacs 的文件夹的 `HOME` 环境变量。如果你想方便地浏览 Dropbox 之外的本地文件,你可能想在你的实际主目录下建立一个到 Dropbox 下 Emacs 主目录的符号链接。 -至此,你已经完成了在任意机器上指向 Emacs 配置和配置文件所需的技巧。如果你买了一台新电脑,或者用别人的电脑一小时或一天,你就得到了你的整个工作环境。第一次做这个似乎有点困难,但是一旦你知道你在做什么,就只需要10分钟(最多)。 +至此,你已经完成了在任意机器上指向你的 Emacs 配置和文件所需的技巧。如果你买了一台新电脑,或者用别人的电脑一小时或一天,你就可以得到你的整个工作环境。第一次做这个似乎有点困难,但是一旦你知道你在做什么,就(最多)只需要 10 分钟。 -但我们现在是在配置 `Ido`…… +但我们现在是在配置 Ido …… -按下 `C-x` `C-f` 然后输入 `~/.emacs RET RET` 来创建 `.emacs` 文件,将下面几行添加进去: +按下 `C-x` `C-f` 然后输入 `~/.emacs` 和两次回车来创建 `.emacs` 文件,将下面几行添加进去: ``` ;; set up ido mode @@ -104,15 +107,19 @@ home (ido-mode 1) ``` -在 `.emacs` 窗口开着的时候,执行 `M-x evaluate-buffer` 命令。如果某处弄错了的话,将得到一个错误,或者你将得到 `Ido`。`Ido` 改变了在 `minibuffer` 中操作文件操方式。有一篇比较好的文档,但是我也会指出一些技巧。有效地使用 `~/`;你可以在 `minibuffer` 的任何地方输入 `~/`,它就会跳转到主目录。这就意味着,你应该让你的大部分东西就近的放在主目录下。我用 `~/org` 目录来保存所有非代码的东西,用 `~/code` 保存代码。一旦你进入到正确的目录,通常会拥有一组具有不同扩展名的文件,特别是当你使用 `Org` 模式并从中发布的话。你可以输入 `period` 和想要的扩展名,无论你的在文件名的什么位置,`Ido` 都会将选择限制在具有该扩展名的文件中。例如,我在 `Org` 模式下写这篇博客,所以该文件是: +在 `.emacs` 窗口开着的时候,执行 `M-x evaluate-buffer` 命令。如果某处弄错了的话,将得到一个错误,或者你将得到 Ido。Ido 改变了在 minibuffer 中操作文件操方式。关于这个有一篇比较好的文档,但是我也会指出一些技巧。有效地使用 `~/`;你可以在 minibuffer 的任何地方输入 `~/`,它就会跳转到主目录。这就意味着,你应该让你的大部分东西就近的放在主目录下。我用 `~/org` 目录来保存所有非代码的东西,用 `~/code` 保存代码。一旦你进入到正确的目录,通常会拥有一组具有不同扩展名的文件,特别是当你使用 Org 模式并从中发布的话。你可以输入 `.` 和想要的扩展名,无论你的在文件名的什么位置,Ido 都会将选择限制在具有该扩展名的文件中。例如,我在 Org 模式下写这篇博客,所以该文件是: -`~/org/blog/emacs.org` +``` +~/org/blog/emacs.org +``` -我偶尔也会用 `Org` 模式发布成 HTML 格式,所以我将在同一目录下得到 `emacs.html` 文件。当我想打开 `Org` 文件时,我会输入: +我偶尔也会用 Org 模式发布成 HTML 格式,所以我将在同一目录下得到 `emacs.html` 文件。当我想打开该 Org 文件时,我会输入: -`C-x C-f ~/o[RET]/bl[RET].or[RET]` +``` +C-x C-f ~/o[RET]/bl[RET].or[RET] +``` -其中 `[RET]` 是我使用 `Ido` 模式的自动补全而按下的回车键。所以,这只需要按 12 个键,如果你习惯了的话, 这将比打开查找或文件资源管理器再用鼠标点要节省 _很_ 多时间。 `Ido` 模式很有用, 这真的是操作 Emacs 的一种实用的模式。下面让我们去探索一些其他对完成工作很有帮助的模式吧。 +其中 `[RET]` 是我使用 `Ido` 模式的自动补全而按下的回车键。所以,这只需要按 12 个键,如果你习惯了的话, 这将比打开访达或文件资源管理器再用鼠标点要节省 _很_ 多时间。 Ido 模式很有用,而这只是操作 Emacs 的一种实用模式而已。下面让我们去探索一些其它对完成工作很有帮助的模式吧。 #### 字体及风格 From 1704626c5ecb804fae391bf0dc8aa6c46dc7f9f4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 15:45:26 +0800 Subject: [PATCH 0940/1143] PRF:20180911 Know Your Storage- Block, File - Object.md @qhwdw --- ...Know Your Storage- Block, File - Object.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/translated/tech/20180911 Know Your Storage- Block, File - Object.md b/translated/tech/20180911 Know Your Storage- Block, File - Object.md index 3dc77ad8e3..01f4cb4b15 100644 --- a/translated/tech/20180911 Know Your Storage- Block, File - Object.md +++ b/translated/tech/20180911 Know Your Storage- Block, File - Object.md @@ -1,43 +1,44 @@ 认识存储:块、文件和对象 ====== +> 今天产生的大量数据带来了新的存储挑战。在本文中了解各种存储类型以及它们的使用方式。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/block2_1920.jpg?itok=s1y6RLhT) -现在,对于那些创建或消费数据的公司来说,处理生成的数量巨大的数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。 +现在,对于那些创建或消费数据的公司来说,处理数量巨大的生成数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。 - Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“ +Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“ -任何挑战都意味着机遇。Azure 存储、介质和边缘总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。” +任何挑战都意味着机遇。Azure 存储、介质和边缘计算总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。” ### 现代软件定义存储的三种类型 -这里有三个不同类型的存储解决方案 — 块、文件、和对象 — 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。 +这里有三个不同类型的存储解决方案 —— 块、文件、和对象 —— 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。 -块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置”。 +块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 的软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置。” -块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,它创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。 +块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,其创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。 -St. Jean 说“块存储将单个的存储卷(像一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。“ +St. Jean 说“块存储将单个的存储卷(如一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。” -每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 — 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。 +每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 —— 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。 -块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器、或集群中呈现出的机器访问。 +块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器访问,或呈现给集群中的机器访问。 ### 基于文件的存储 -基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直接或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。 St. Jean 说,”使用文件存储时,数据在服务器侧的排列格式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。 +基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直连或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。St. Jean 说,”使用文件存储时,数据在服务器侧的存储方式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。 -最终成为了一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是限制访问处于这些文件和文件夹之下的数据块。 +其结果就是一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是被限制访问处于这些文件和文件夹之下的数据块。 -Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录、和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“ +Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“ ### 对象存储 -对象存储是最新的数据存储形式,它为非结构化数据提供一个库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 — 数据和元数据 — 构成了一个对象。 +对象存储是最新的数据存储形式,它为非结构化数据提供一个仓库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 —— 数据和元数据 —— 构成了一个对象。 对象存储的一个好处是每个数据块都关联了一个唯一标识符。访问数据需要唯一标识符,并且不需要应用程序或用户知道数据的真实存储位置。对象数据是通过 API 来访问的。 -St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被安排在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 — 这使得它们在存储规模巨大时访问速度很快。” +St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被组织在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 —— 这使得它们在存储规模巨大时访问速度很快。” 对象存储可以扩展到很多 PB 字节大小,以适应巨大的数据集,因此它是图像、音频、视频、日志、备份、和分析服务所使用的数据存储的最佳选择。 @@ -52,7 +53,7 @@ via: https://www.linux.com/blog/2018/9/know-your-storage-block-file-object 作者:[Swapnil Bhartiya][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 87d11f5ea0d30a91101f01eac2fd6a79208a2f16 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 15:46:05 +0800 Subject: [PATCH 0941/1143] PUB:20180911 Know Your Storage- Block, File - Object.md @qhwdw https://linux.cn/article-10364-1.html --- .../20180911 Know Your Storage- Block, File - Object.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180911 Know Your Storage- Block, File - Object.md (100%) diff --git a/translated/tech/20180911 Know Your Storage- Block, File - Object.md b/published/20180911 Know Your Storage- Block, File - Object.md similarity index 100% rename from translated/tech/20180911 Know Your Storage- Block, File - Object.md rename to published/20180911 Know Your Storage- Block, File - Object.md From 3bdd047664f41dbda43491fc6efafb06ddea3914 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 17:52:06 +0800 Subject: [PATCH 0942/1143] PRF:20181130 SMPlayer in Linux- Features, Download and Installation.md @geekpi --- ...ux- Features, Download and Installation.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md index be826fc446..1e0147ac10 100644 --- a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md +++ b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md @@ -1,29 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (SMPlayer in Linux: Features, Download and Installation) [#]: via: (https://itsfoss.com/smplayer/) [#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/) [#]: url: ( ) -Linux 中的 SMPlayer:功能,下载和安装 +SMPlayer:增强版的媒体播放器 ====== 当你要播放视频时,你会在[全新安装的 Ubuntu][1],或其他许多发行版中,会注意到一个消息: ![][2] -默认媒体播放器没有适合的编解码器 -这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。了解一下 [SMPlayer][4]。 +*默认媒体播放器没有适合的编解码器* + +这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。让我们了解一下 [SMPlayer][4]。 ### 认识 SMPlayer:适用于 Linux 的更好的媒体播放器 -SMPlayer 是一款免费的开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。 +SMPlayer 是一款自由开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。 ![SMPlayer default interface][7] -SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。 +SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动系统,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。 你也可以在 SMPlayer 上播放 YouTube。我知道每次复制粘贴视频 URL 并在外部播放器上播放是不切实际的。但是当你观看相对较长的视频时,SMPlayer 特别有用。SMPlayer 以相当好的质量播放 YouTube 视频,我觉得比在浏览器中播放得更好。通过在 SMPlayer 上播放较长的视频,你可以远离视频中间弹出的插播广告。 @@ -51,7 +52,7 @@ SMPlayer 应该可在所有主要 Linux 发行版的软件中心获取。你可 sudo apt install smplayer ``` -或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包 +或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包。 ### 总结 @@ -66,7 +67,7 @@ via: https://itsfoss.com/smplayer/ 作者:[Aquil Roshan;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/) 荣誉推出 @@ -83,4 +84,4 @@ via: https://itsfoss.com/smplayer/ [9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-icon-packs.jpg?fit=800%2C450&ssl=1 [10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-theme.jpg?fit=800%2C450&ssl=1 [11]: https://software.opensuse.org/download.html?project=home%3Asmplayerdev&package=smplayer -[12]: https://itsfoss.com/essential-linux-applications/ \ No newline at end of file +[12]: https://itsfoss.com/essential-linux-applications/ From 228a0a7fbc5fe30c4c28571541ca6d741875b5f5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 17:53:02 +0800 Subject: [PATCH 0943/1143] PUB:20181130 SMPlayer in Linux- Features, Download and Installation.md @geekpi https://linux.cn/article-10365-1.html --- ... SMPlayer in Linux- Features, Download and Installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181130 SMPlayer in Linux- Features, Download and Installation.md (98%) diff --git a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/published/20181130 SMPlayer in Linux- Features, Download and Installation.md similarity index 98% rename from translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md rename to published/20181130 SMPlayer in Linux- Features, Download and Installation.md index 1e0147ac10..5165fed0f7 100644 --- a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md +++ b/published/20181130 SMPlayer in Linux- Features, Download and Installation.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (SMPlayer in Linux: Features, Download and Installation) [#]: via: (https://itsfoss.com/smplayer/) [#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10365-1.html) SMPlayer:增强版的媒体播放器 ====== From 45de03a32dcf7afd5789fe4142114aac0757cf93 Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 19 Dec 2018 18:13:24 +0800 Subject: [PATCH 0944/1143] Delete 20171223 Celebrate Christmas In Linux Way With These Wallpapers.md --- ...tmas In Linux Way With These Wallpapers.md | 201 ------------------ 1 file changed, 201 deletions(-) delete mode 100644 sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md diff --git a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md deleted file mode 100644 index 94c08d72ae..0000000000 --- a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (jlztan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers) -[#]: via: (https://itsfoss.com/christmas-linux-wallpaper/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: url: ( ) - -Celebrate Christmas In Linux Way With These Wallpapers -====== - -It’s the holiday season and many of you might be celebrating Christmas already. From the team of It’s FOSS, I would like to wish you a Merry Christmas and a happy new year. - -To continue the festive mood, I’ll show you some really awesome [Linux wallpapers][1] on Christmas theme. But before we see that, how about a Christmas Tree in Linux terminal. - -### Display Christmas Tree in Linux Terminal - - - -If you want to display an animated Christmas tree in the terminal, you can use the command below: - -``` -curl https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh | bash -``` - -If you don’t want to get it from the internet all the time, you can get the shell script from its GitHub repository, change the permission and run it like a normal shell script. - -[ChristBASHTree][2] - -### Display Christmas Tree in Linux terminal using Perl - -[![Christmas Tree in Linux terminal by NixCraft][3]][4] - -This trick was originally shared by [NixCraft][5]. You’ll need to install a Perl module for this. - -To be honest, I don’t like using Perl modules because uninstalling them is a real pain. So **use this Perl module knowing that you’ll have to manually remove it**. - -``` -perl -MCPAN -e 'install Acme::POE::Tree' -``` - -You can read the original article [here][5] to know more about it. - -## Download Linux Christmas Wallpapers - -All these Linux Christmas wallpapers are created by Mark Riedesel and you can find plenty of other artwork on [his website][6]. - -He has been making such wallpapers almost every year since 2002. Quite understandably some of the earliest wallpapers don’t have modern aspect ratio. I have put them up in reverse chronological order. - -One tiny note. The images displayed here are highly compressed so download the wallpapers from the provided link only. - -![Christmas Linux Wallpaper][7] - -[Download This Wallpaper][8] - -[![Christmas Linux Wallpapers][9]][10] - -[Download This Wallpaper][11] - -[![Christmas Linux Wallpapers][12]][13] - -[Download This Wallpaper][14] - -[![Christmas Linux Wallpapers][15]][16] - -[Download This Wallpaper][17] - -[![Christmas Linux Wallpapers][18]][19] - -[Download This Wallpaper][20] - -[![Christmas Linux Wallpapers][21]][22] - -[Download This Wallpaper][23] - -[![Christmas Linux Wallpapers][24]][25] - -[Download This Wallpaper][26] - -[![Christmas Linux Wallpapers][27]][28] - -[Download This Wallpaper][29] - -[![Christmas Linux Wallpapers][30]][31] - -[Download This Wallpaper][32] - -[![Christmas Linux Wallpapers][33]][34] - -[Download This Wallpaper][35] - -[![Christmas Linux Wallpapers][36]][37] - -[Download This Wallpaper][38] - -[![Christmas Linux Wallpapers][39]][40] - -[Download This Wallpaper][41] - -[![Christmas Linux Wallpapers][42]][43] - -[Download This Wallpaper][44] - -[![Christmas Linux Wallpapers][45]][46] - -[Download This Wallpaper][47] - -[![Christmas Linux Wallpapers][48]][49] - -[Download This Wallpaper][50] - -### Bonus: Linux Christmas carols - -Here is a bonus for you. Christmas carols Linuxified for Linux lovers like us. - -In [an article on Computer World][51], [Sandra Henry-Stocker][52] shared such Christmas carols. An excerpt: - -To the tune of: [Chestnuts Roasting on an Open Fire][53] - -> Running merrily on open source -> With users happy as can be -> We’re using Linux and getting lots done -> And happy everything is free - -To the tune of: [The Twelve Days of Christmas][54] - -> On my first day with Linux, my admin gave to me a password and a login ID -> On my second day with Linux my admin gave to me two new commands and a password and a login ID - -You can read full carols [here][51]. - -Merry Linux to you!! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/christmas-linux-wallpaper/ - -作者:[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/beautiful-linux-wallpapers/ -[2]: https://github.com/sergiolepore/ChristBASHTree -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/perl-tree.gif?resize=600%2C622&ssl=1 -[4]: https://itsfoss.com/christmas-linux-wallpaper/perl-tree/ -[5]: https://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/ -[6]: http://www.klowner.com/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmas-linux-wallpaper-featured.jpeg?resize=800%2C450&ssl=1 -[8]: http://klowner.com/wallery/christmas_tux_2017/download/ChristmasTux2017_3840x2160.png -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2016_3840x2160_result.jpg?resize=800%2C450&ssl=1 -[10]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2016_3840x2160_result/ -[11]: http://www.klowner.com/wallpaper/christmas_tux_2016/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2015_2560x1920_result.jpg?resize=800%2C600&ssl=1 -[13]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2015_2560x1920_result/ -[14]: http://www.klowner.com/wallpaper/christmas_tux_2015/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2014_2560x1440_result.jpg?resize=800%2C450&ssl=1 -[16]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2014_2560x1440_result/ -[17]: http://www.klowner.com/wallpaper/christmas_tux_2014/ -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2013_result.jpg?resize=800%2C450&ssl=1 -[19]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2013_result/ -[20]: http://www.klowner.com/wallpaper/christmas_tux_2013/ -[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2012_2560x1440_result.jpg?resize=800%2C450&ssl=1 -[22]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2012_2560x1440_result/ -[23]: http://www.klowner.com/wallpaper/christmas_tux_2012/ -[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2011_2560x1440_result.jpg?resize=800%2C450&ssl=1 -[25]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2011_2560x1440_result/ -[26]: http://www.klowner.com/wallpaper/christmas_tux_2011/ -[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2010_5120x2880_result.jpg?resize=800%2C450&ssl=1 -[28]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2010_5120x2880_result/ -[29]: http://www.klowner.com/wallpaper/christmas_tux_2010/ -[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2009_1600x1200_result.jpg?resize=800%2C600&ssl=1 -[31]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2009_1600x1200_result/ -[32]: http://www.klowner.com/wallpaper/christmas_tux_2009/ -[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2008_2560x1600_result.jpg?resize=800%2C500&ssl=1 -[34]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2008_2560x1600_result/ -[35]: http://www.klowner.com/wallpaper/christmas_tux_2008/ -[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2007_2560x1600_result.jpg?resize=800%2C500&ssl=1 -[37]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2007_2560x1600_result/ -[38]: http://www.klowner.com/wallpaper/christmas_tux_2007/ -[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2006_1024x768_result.jpg?resize=800%2C600&ssl=1 -[40]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2006_1024x768_result/ -[41]: http://www.klowner.com/wallpaper/christmas_tux_2006/ -[42]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2005_1600x1200_result.jpg?resize=800%2C600&ssl=1 -[43]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2005_1600x1200_result/ -[44]: http://www.klowner.com/wallpaper/christmas_tux_2005/ -[45]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2004_1600x1200_result.jpg?resize=800%2C600&ssl=1 -[46]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2004_1600x1200_result/ -[47]: http://www.klowner.com/wallpaper/christmas_tux_2004/ -[48]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2002_1600x1200_result.jpg?resize=800%2C600&ssl=1 -[49]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2002_1600x1200_result/ -[50]: http://www.klowner.com/wallpaper/christmas_tux_2002/ -[51]: http://www.computerworld.com/article/3151076/linux/merry-linux-to-you.html -[52]: https://twitter.com/bugfarm -[53]: https://www.youtube.com/watch?v=dhzxQCTCI3E -[54]: https://www.youtube.com/watch?v=oyEyMjdD2uk From c1e7fb3466c15af52f7f7f805fff1a91045a2239 Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 19 Dec 2018 18:16:59 +0800 Subject: [PATCH 0945/1143] Create 20171223 Celebrate Christmas In Linux Way With These Wallpapers.md --- ...tmas In Linux Way With These Wallpapers.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md diff --git a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md new file mode 100644 index 0000000000..1132a52058 --- /dev/null +++ b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -0,0 +1,190 @@ +使用这些壁纸以 Linux 的方式庆祝圣诞节 +====== + +当前正是假日季节,很多人可能已经在庆祝圣诞节了。我代表 It's FOSS 团队祝你圣诞快乐,新年快乐。 + +为了延续节日氛围,我将向你展示一些非常棒的圣诞主题 [Linux壁纸][1]。在呈现这些壁纸之前,先来看一棵 Linux 终端下的圣诞树。 + +### 在 Linux 终端下显示圣诞树 + +圣诞树的效果如 [这个页面](https://giphy.com/embed/xUNda6KphvbpYxL3tm) 所示。 + +使用以下命令在终端中显示一棵动画圣诞树: + +``` +curl https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh | bash +``` + +要是不想一直从互联网上获取这棵圣诞树,也可以从它的 [GitHub 仓库][2] 中获取对应的 shell 脚本,更改权限之后按照运行普通 shell 脚本的方式运行它。 + +### 使用 Perl 在 Linux 终端下显示圣诞树 + +[![Christmas Tree in Linux terminal by NixCraft][3]][4] + +这个技巧最初由 [NixCraft][5] 分享,你需要为此安装 Perl 模块。 + +说实话,我不喜欢使用 Perl 模块,因为卸载它们真的很痛苦。所以使用这个 Perl 模块时需谨记,你必须手动移除它。 + +``` +perl -MCPAN -e 'install Acme::POE::Tree' +``` + +你可以阅读 [原文][5] 来了解更多信息。 + +## 下载 Linux 圣诞主题壁纸 + +所有这些 Linux 圣诞主题壁纸都是由 Mark Riedesel 制作的,你可以在 [他的网站][6] 上找到很多其他艺术品。 + +自 2002 年以来,他几乎每年都在制作这样的壁纸。可以理解的是,最早的一些壁纸不具有现代的宽高比。我把它们按时间倒序排列。 + +注意一个小地方,这里显示的图片都是高度压缩的,因此你要通过图片下方提供的链接进行下载。 + +![Christmas Linux Wallpaper][7] + +[下载此壁纸][8] + +[![Christmas Linux Wallpapers][9]][10] + +[下载此壁纸][11] + +[![Christmas Linux Wallpapers][12]][13] + +[下载此壁纸][14] + +[![Christmas Linux Wallpapers][15]][16] + +[下载此壁纸][17] + +[![Christmas Linux Wallpapers][18]][19] + +[下载此壁纸][20] + +[![Christmas Linux Wallpapers][21]][22] + +[下载此壁纸][23] + +[![Christmas Linux Wallpapers][24]][25] + +[下载此壁纸][26] + +[![Christmas Linux Wallpapers][27]][28] + +[下载此壁纸][29] + +[![Christmas Linux Wallpapers][30]][31] + +[下载此壁纸][32] + +[![Christmas Linux Wallpapers][33]][34] + +[下载此壁纸][35] + +[![Christmas Linux Wallpapers][36]][37] + +[下载此壁纸][38] + +[![Christmas Linux Wallpapers][39]][40] + +[下载此壁纸][41] + +[![Christmas Linux Wallpapers][42]][43] + +[下载此壁纸][44] + +[![Christmas Linux Wallpapers][45]][46] + +[下载此壁纸][47] + +[![Christmas Linux Wallpapers][48]][49] + +[下载此壁纸][50] + +### 福利:Linux 圣诞颂歌 + +这是给你的一份福利,给像我们一样的 Linux 爱好者的关于 Linux 的圣诞颂歌。 + +在 [计算机世界的一篇文章][51] 中,[Sandra Henry-Stocker][52] 分享了这些圣诞颂歌。摘录片段如下: + +这一段用的 [Chestnuts Roasting on an Open Fire][53] 的曲调: + +> Running merrily on open source +> With users happy as can be +> We’re using Linux and getting lots done +> And happy everything is free + +这一段用的 [The Twelve Days of Christmas][54] 的曲调: + +> On my first day with Linux, my admin gave to me a password and a login ID +> On my second day with Linux my admin gave to me two new commands and a password and a login ID + +在 [这里][51] 阅读完整的颂歌。 + +祝你享受 Linux! + +------ + +via: https://itsfoss.com/christmas-linux-wallpaper/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[jlztan](https://github.com/jlztan) +校对:[校对者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/beautiful-linux-wallpapers/ +[2]: https://github.com/sergiolepore/ChristBASHTree +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/perl-tree.gif?resize=600%2C622&ssl=1 +[4]: https://itsfoss.com/christmas-linux-wallpaper/perl-tree/ +[5]: https://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/ +[6]: http://www.klowner.com/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmas-linux-wallpaper-featured.jpeg?resize=800%2C450&ssl=1 +[8]: http://klowner.com/wallery/christmas_tux_2017/download/ChristmasTux2017_3840x2160.png +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2016_3840x2160_result.jpg?resize=800%2C450&ssl=1 +[10]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2016_3840x2160_result/ +[11]: http://www.klowner.com/wallpaper/christmas_tux_2016/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2015_2560x1920_result.jpg?resize=800%2C600&ssl=1 +[13]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2015_2560x1920_result/ +[14]: http://www.klowner.com/wallpaper/christmas_tux_2015/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2014_2560x1440_result.jpg?resize=800%2C450&ssl=1 +[16]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2014_2560x1440_result/ +[17]: http://www.klowner.com/wallpaper/christmas_tux_2014/ +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2013_result.jpg?resize=800%2C450&ssl=1 +[19]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2013_result/ +[20]: http://www.klowner.com/wallpaper/christmas_tux_2013/ +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2012_2560x1440_result.jpg?resize=800%2C450&ssl=1 +[22]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2012_2560x1440_result/ +[23]: http://www.klowner.com/wallpaper/christmas_tux_2012/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2011_2560x1440_result.jpg?resize=800%2C450&ssl=1 +[25]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2011_2560x1440_result/ +[26]: http://www.klowner.com/wallpaper/christmas_tux_2011/ +[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2010_5120x2880_result.jpg?resize=800%2C450&ssl=1 +[28]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2010_5120x2880_result/ +[29]: http://www.klowner.com/wallpaper/christmas_tux_2010/ +[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2009_1600x1200_result.jpg?resize=800%2C600&ssl=1 +[31]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2009_1600x1200_result/ +[32]: http://www.klowner.com/wallpaper/christmas_tux_2009/ +[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2008_2560x1600_result.jpg?resize=800%2C500&ssl=1 +[34]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2008_2560x1600_result/ +[35]: http://www.klowner.com/wallpaper/christmas_tux_2008/ +[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2007_2560x1600_result.jpg?resize=800%2C500&ssl=1 +[37]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2007_2560x1600_result/ +[38]: http://www.klowner.com/wallpaper/christmas_tux_2007/ +[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2006_1024x768_result.jpg?resize=800%2C600&ssl=1 +[40]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2006_1024x768_result/ +[41]: http://www.klowner.com/wallpaper/christmas_tux_2006/ +[42]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2005_1600x1200_result.jpg?resize=800%2C600&ssl=1 +[43]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2005_1600x1200_result/ +[44]: http://www.klowner.com/wallpaper/christmas_tux_2005/ +[45]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2004_1600x1200_result.jpg?resize=800%2C600&ssl=1 +[46]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2004_1600x1200_result/ +[47]: http://www.klowner.com/wallpaper/christmas_tux_2004/ +[48]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2002_1600x1200_result.jpg?resize=800%2C600&ssl=1 +[49]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2002_1600x1200_result/ +[50]: http://www.klowner.com/wallpaper/christmas_tux_2002/ +[51]: http://www.computerworld.com/article/3151076/linux/merry-linux-to-you.html +[52]: https://twitter.com/bugfarm +[53]: https://www.youtube.com/watch?v=dhzxQCTCI3E +[54]: https://www.youtube.com/watch?v=oyEyMjdD2uk From 54787c29b9075afa34d775af0a3b6a919ba83cbf Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Wed, 19 Dec 2018 18:35:52 +0800 Subject: [PATCH 0946/1143] Update 20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md --- ... - Notmuch, mbsync, postfix and dovecot.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md index 0edd75e2bd..01e5c82f08 100644 --- a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md +++ b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @@ -1,20 +1,20 @@ -我的个人电子邮件系统 - Notmuch, mbsync, postfix and dovecot +我的个人电子邮件系统 - Notmuch, mbsync,postfix and dovecot ====== -我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。 +我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。 ### 服务器端 -我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说) +我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说) -> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info) +> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info) -除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。 +除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。 -再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。 +再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。 ### 在我的笔记本电脑上 -在我的笔记本电脑上, 我已经按照4个部分设置 +在我的笔记本电脑上,我已经按照4个部分设置 1. 邮件同步: 使用 mbsync 命令完成 2. 分类: 使用 notmuch 完成 @@ -25,7 +25,7 @@ ### 邮件同步 -邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户, 最近切换到 mbsync, 因为我觉得它比 OfflineIMAP 的配置更轻, 更简单。命令是由包 isync 提供的。 +邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户,最近切换到 mbsync,因为我觉得它比 OfflineIMAP 的配置更轻,更简单。命令是由包 isync 提供的。 配置文件是 ~/.mbsyncrc. 下面是我的例子与一些个人设置。 @@ -79,17 +79,17 @@ SyncState * Sync All ``` -对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许您提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。 +对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许你提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。 -实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。 +实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。 -下一个指令部分是模式。这使您可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders. +下一个指令部分是模式。这使你可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders. ### 邮件分类 -一旦邮件在您本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。 +一旦邮件在你本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。 -不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。 +不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。 ``` #!/bin/sh @@ -129,27 +129,27 @@ for mdir in $MDIR; do done ``` -因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对, 这些邮件逃脱垃圾邮件过滤器进到我的 inbox, 并被我亲自标记为垃圾邮件。 +因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对,这些邮件逃脱垃圾邮件过滤器进到我的 inbox ,并被我亲自标记为垃圾邮件。 -运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。 +运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。 ### 阅读邮件 -现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer), 它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。您可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。 +现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer),它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。你可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。 ### 发送邮件 -如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。 +如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。 -我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。 +我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。 -我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法) +我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法) ``` adduser _relay ``` -这里替换 与您的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行 +这里替换 与你的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行 ``` # SASL authentication smtp_sasl_auth_enable = yes @@ -159,28 +159,28 @@ relayhost = [smtp.copyninja.info]:submission smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd ``` -因此, 这里的 relayhost 是您的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任您的移动主机, 并同意为您转发邮件。 +因此, 这里的 relayhost 是你的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任你的移动主机, 并同意为你转发邮件。 -/etc/postfix/sasl__asswd 是您需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。 +/etc/postfix/sasl__asswd 是你需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。 ``` [smtp.example.com]:submission user:password ``` - 用你的 SMTP 服务器名称替换 smtp.example.com ,您已输入的 relayhost 认证。 用您创建的用户及其密码替换 user with _relay 。 + 用你的 SMTP 服务器名称替换 smtp.example.com ,你已输入的 relayhost 认证。 用你创建的用户及其密码替换 user with _relay 。 -若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。 +若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。 ``` chown root:root /etc/postfix/sasl_passwd chmod 0600 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd ``` -最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是您的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从您的系统中取出。 +最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是你的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从你的系统中取出。 ### Bonus 的部分 -好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。 +好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。 ``` [Unit] Description=Check Mail Every 10 minutes @@ -197,7 +197,7 @@ Unit=mailsync.service WantedBy=default.target ``` -下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。 +下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。 ``` [Unit] @@ -219,7 +219,7 @@ systemctl enable --user mailsync.service systemctl start --user mailsync.timer ``` -这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。 +这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。 -------------------------------------------------------------------------------- From 1cafa689f8fb0e38699d9171075c2abf378b7fe3 Mon Sep 17 00:00:00 2001 From: wwhio Date: Thu, 20 Dec 2018 00:56:59 +0800 Subject: [PATCH 0947/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=AF=95?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E6=B1=82=E6=A0=A1=E5=AF=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20180623 The IBM 029 Card Punch.md | 72 ------------------- .../talk/20180623 The IBM 029 Card Punch.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 72 deletions(-) delete mode 100644 sources/talk/20180623 The IBM 029 Card Punch.md create mode 100644 translated/talk/20180623 The IBM 029 Card Punch.md diff --git a/sources/talk/20180623 The IBM 029 Card Punch.md b/sources/talk/20180623 The IBM 029 Card Punch.md deleted file mode 100644 index 6b36845c2d..0000000000 --- a/sources/talk/20180623 The IBM 029 Card Punch.md +++ /dev/null @@ -1,72 +0,0 @@ -Translating by wwhio - - -The IBM 029 Card Punch -====== -Lines of code longer than 80 characters drive me crazy. I appreciate that this is pedantic. I’ve seen people on the internet make good arguments for why the 80-character limit ought to be respected even on our modern Retina-display screens, but those arguments hardly justify the visceral hatred I feel for even that one protruding 81st character. - -There was once a golden era in which it was basically impossible to go over the 80-character limit. The 80-character limit was a physical reality, because there was no 81st column for an 81st character to fit in. Any programmers attempting to name a function something horrendously long and awful would discover, in a moment of delicious, slow-dawning horror, that there literally isn’t room for their whole declaration. - -This golden era was the era of punch card programming. By the 1960s, IBM’s punch cards had set the standard and the standard was that punch cards had 80 columns. The 80-column standard survived into the teletype and dumb terminal era and from there embedded itself into the nooks and crannies of our operating systems. Today, when you launch your terminal emulator and open a new window, odds are it will be 80 characters wide, even though we now have plenty of screen real estate and tend to favor longer identifiers over inscrutable nonsense like `iswcntrl()`. - -If questions on Quora are any indication, many people have trouble imagining what it must have been like to program computers using punch cards. I will admit that for a long time I also didn’t understand how punch card programming could have worked, because it struck me as awfully labor-intensive to punch all those holes. This was a misunderstanding; programmers never punched holes in cards the same way a train conductor does. They had card punch machines (also known as key punches), which allowed them to punch holes in cards using a typewriter-style keyboard. And card punches were hardly new technology—they were around as early as the 1890s. - -One of the most widely used card punch machines was the IBM 029. It is perhaps the best remembered card punch today. - -![][1] - -The IBM 029 was released in 1964 as part of IBM’s System/360 rollout. System/360 was a family of computing systems and peripherals that would go on to dominate the mainframe computing market in the late 1960s. Like many of the other System/360 machines, the 029 was big. This was an era when the distinction between computing machinery and furniture was blurry—the 029 was not something you put on a table but an entire table in itself. The 029 improved upon its predecessor, the 026, by supporting new characters like parentheses and by generally being quieter. It had cool electric blue highlights and was flat and angular whereas the 026 had a 1940s rounded, industrial look. Another of its big selling points was that it could automatically left-pad numeric fields with zeros, demonstrating that JavaScript programmers were not the first programmers too lazy to do their own left-padding. - -But wait, you might say—IBM released a brand-new card punch in 1964? What about that photograph of the Unix gods at Bell Labs using teletype machines in, like, 1970? Weren’t card punching machines passé by the mid- to late-1960s? Well, it might surprise you to know that the 029 was available in IBM’s catalog until as late as 1984. In fact, most programmers programmed using punch cards until well into the 1970s. This doesn’t make much sense given that there were people using teletype machines during World War II. Indeed, the teletype is almost of the same vintage as the card punch. The limiting factor, it turns out, was not the availability of teletypes but the availability of computing time. What kept people from using teletypes was that teletypes assumed an interactive, “online” model of communication with the computer. Before Unix and the invention of timesharing operating systems, your interactive session with a computer would have stopped everyone else from using it, a delay potentially costing thousands of dollars. So programmers instead wrote their programs offline using card punch machines and then fed them into mainframe computers later as batch jobs. Punch cards had the added benefit of being a cheap data store in an era where cheap, reliable data storage was hard to come by. Your programs lived in stacks of cards on your shelves rather than in files on your hard drive. - -So what was it actually like using an IBM 029 card punch? That’s hard to explain without first taking a look at the cards themselves. A typical punch card had 12 rows and 80 columns. The bottom nine rows were the digit rows, numbered one through nine. These rows had the appropriate digit printed in each column. The top three rows, called the “zone” rows, consisted of two blank rows and usually a zero row. Row 12 was at the very top of the card, followed by row 11, then rows zero through nine. This somewhat confusing ordering meant that the top edge of the card was called the 12 edge while the bottom was called the nine edge. A corner of each card was usually clipped to make it easier to keep a stack of cards all turned around the right way. - -![][2] - -When they were first invented, punch cards were meant to be punched with circular holes, but IBM eventually realized that they could fit more columns on a card if the holes were narrow rectangles. Different combinations of holes in a column represented different characters. For human convenience, card punches like the 029 would print each column’s character at the top of the card at the same time as punching the necessary holes. Digits were represented by one punched hole in the appropriate digit row. Alphabetical and symbolic characters were represented by a hole in a zone row and then a combination of one or two holes in the digit rows. The letter A, for example, was represented by a hole in the 12 zone row and another hole in the one row. This was an encoding of sorts, sometimes called the Hollerith code, after the original inventor of the punch card machine. The encoding allowed for only a relatively small character set; lowercase letters, for example, were not represented. Some clever engineer today might wonder why punch cards didn’t just use a binary encoding—after all, with 12 rows, you could encode over 4000 characters. The Hollerith code was used instead because it ensured that no more than three holes ever appeared in a single column. This preserved the structural integrity of the card. A binary encoding would have entailed so many holes that the card would have fallen apart. - -Cards came in different flavors. By the 1960s, 80 columns was the standard, but those 80 columns could be used to represent different things. The basic punch card was unlabeled, but cards meant for COBOL programming, for example, divided the 80 columns into fields. On a COBOL card, the last eight columns were reserved for an identification number, which could be used to automatically sort a stack of cards if it were dropped (apparently a perennial hazard). Another column, column seven, could be used to indicate that the statement on this card was a continuation of a statement on a previous card. This meant that if you were truly desperate you could circumvent the 80-character limit, though whether a two-card statement counts as one long line or just two is unclear. FORTRAN cards were similar but had different fields. Universities often watermarked the punch cards handed out by their computing centers, while other kinds of designs were introduced for special occasions like the [1976 bicentennial][3]. - -Ultimately the cards had to be read and understood by a computer. IBM sold a System/360 peripheral called the IBM 2540 which could read up to 1000 cards per minute. The IBM 2540 ran electrical brushes across the surface of each card which made contact with a plate behind the cards wherever there was a hole. Once read, the System/360 family of computers represented the characters on each punch card using an 8-bit encoding called EBCDIC, which stood for Extended Binary Coded Decimal Interchange Code. EBCDIC was a proper binary encoding, but it still traced its roots back to the punch card via an earlier encoding called BCDIC, a 6-bit encoding which used the low four bits to represent a punch card’s digit rows and the high two bits to represent the zone rows. Punch card programmers would typically hand their cards to the actual computer operators, who would feed the cards into the IBM 2540 and then hand the printed results back to the programmer. The programmer usually didn’t see the computer at all. - -What the programmer did see a lot of was the card punch. The 029 was not a computer, but that doesn’t mean that it wasn’t a complicated machine. The best way to understand what it was like using the 029 is to watch [this instructional video][4] made by the computing center at the University of Michigan in 1967. I’m going to do my best to summarize it here, but if you don’t watch the video you will miss out on all the wonderful clacking and whooshing. - -The 029 was built around a U-shaped track that the punch cards traveled along. On the right-hand side, at the top of the U, was the card hopper, which you would typically load with a fresh stack of cards before using the machine. The IBM 029 worked primarily with 80-column cards, but the card hopper could accommodate smaller cards if needed. Your punch cards would start in the card hopper, travel along the line of the U, and then end up in the stacker, at the top of the U on the left-hand side. The cards would accumulate there in the order that you punched them. - -To turn the machine on, you flipped a switch under the desk at about the height of your knees. You then pressed the “FEED” key twice to get cards loaded into the machine. The business part of the card track, the bottom of the U, was made up of three separate stations: On the right was a kind of waiting area, in the middle was the punching station, and on the left was the reading station. Pressing the “FEED” key twice loaded one card into the punching station and one card into the waiting area behind it. A column number indicator right above the punching station told you which column you were currently punching. With every keystroke, the machine would punch the requisite holes, print the appropriate character at the top of the card, and then advance the card through the punching station by one column. If you punched all 80 columns, the card would automatically be released to the reading station and a new card would be loaded into the punching station. If you wanted this to happen before you reached the 80th column, you could press the “REL” key (for “release”). - -The printed characters made it easy to spot a mistake. But fixing a mistake, as the University of Michigan video warns, is not as easy as whiting out the printed character at the top of the card and writing in a new one. The holes are all that the computer will read. Nor is it as easy as backspacing one space and typing in a new character. The holes have already been punched in the column, after all, and cannot be unpunched. Punching more holes will only produce an invalid combination not associated with any character. The IBM 029 did have a backspace button that moved the punched card backward one column, but the button was placed on the face of the machine instead of on the keyboard. This was probably done to discourage its use, since backspacing was so seldom what the user actually wanted to do. - -Instead, the only way to correct a mistake was scrap the incorrect card and punch a new one. This is where the reading station came in handy. Say you made a mistake in the 68th column of a card. To fix your mistake, you could carefully repunch the first 67 columns of a new card and then punch the correct character in the 68th column. Alternatively, you could release the incorrect card to the reading station, load a new card into the punching station, and hold down the “DUP” key (for duplicate) until the column number indicator reads 68. You could then correct your mistake by punching the correct character. The reading station and the “DUP” key together allowed IBM 029 operators to easily copy the contents of one card to the next. There were all sorts of reasons to do this, but correcting mistakes was the most common. - -The “DUP” key allowed the 029’s operator to invoke the duplicate functionality manually. But the 029 could also duplicate automatically where necessary. This was particularly useful when punched cards were used to record data rather than programs. For example, you might be using each card to record information about a single undergraduate university student. On each card, you might have a field that contains the name of that student’s residence hall. Perhaps you find yourself entering data for all the students in one residence hall at one time. In that case, you’d want the 029 to automatically copy over the previous card’s residence hall field every time you reached the first column of the field. - -Automated behavior like this could be programmed into the 029 by using the program drum. The drum sat upright in the middle of the U above the punching station. You programmed the 029 by punching holes in a card and wrapping that card around the program drum. The punched card allowed you to specify the automatic behavior you expected from the machine at each column of the card currently in the punching station. You could specify that a column should automatically be copied from the previous card, which is how an 029 operator might more quickly enter student records. You could also specify, say, that a particular field should contain numeric or alphabetic characters, or that a given field should be left blank and skipped altogether. The program drum made it much easier to punch schematized cards where certain column ranges had special meanings. There is another [“advanced” instructional video][5] produced by the University of Michigan that covers the program drum that is worth watching, provided, of course, that you have already mastered the basics. - -Watching either of the University of Michigan videos today, what’s surprising is how easy the card punch is to operate. Correcting mistakes is tedious, but otherwise the machine seems to be less of an obstacle than I would have expected. Moving from one card to the next is so seamless that I can imagine COBOL or FORTRAN programmers forgetting that they are creating separate cards rather than one long continuous text file. On the other hand, it’s interesting to consider how card punches, even though they were only an input tool, probably limited how early programming languages evolved. Structured programming would eventually come along and encourage people to think of entire blocks of code as one unit, but I can see how punch card programming’s emphasis on each line made structured programming hard to conceive of. It’s no wonder that punch card programmers were not the ones that decided to enclose blocks with single curly braces entirely on their own lines. How wasteful that would have seemed! - -So even though nobody programs using punch cards anymore, every programmer ought to [try it][6] at least once—if only to understand why COBOL and FORTRAN look the way they do, or how 80 characters somehow became everybody’s favorite character limit. - -If you enjoyed this post, more like it come out every two weeks! Follow [@TwoBitHistory][7] on Twitter or subscribe to the [RSS feed][8] to make sure you know when a new post is out. - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.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]: https://twobithistory.org/images/ibm029_front.jpg -[2]: https://twobithistory.org/images/card.png -[3]: http://www.jkmscott.net/data/Punched%20card%20013.jpg -[4]: https://www.youtube.com/watch?v=kaQmAybWn-w -[5]: https://www.youtube.com/watch?v=SWD1PwNxpoU -[6]: http://www.masswerk.at/keypunch/ -[7]: https://twitter.com/TwoBitHistory -[8]: https://twobithistory.org/feed.xml diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md new file mode 100644 index 0000000000..a1283e70b2 --- /dev/null +++ b/translated/talk/20180623 The IBM 029 Card Punch.md @@ -0,0 +1,71 @@ +IBM 029 型打孔机 +====== +我知道这很学院派,可一行超过 80 个字符的代码还是让我抓狂。我也在网上见过不少人认为即在现代视网膜屏幕下也应当采用行长度为 80 个字符的标准,可他们都不理解我对破坏这一标准的怒火,就算 1 个字符也不行。 + +在这一标准的黄金时期,一行代码的长度几乎不会超过 80 个字符的限制。在那时,这一限制是物理的,没有第 81 列用于存放第 81 个字符。每一个试图把函数名起的又长又臭的程序员都会在短暂的愉悦后迎来更多的麻烦,而这仅仅时因为没有足够的空间放下整个函数的声明。 + +这一黄金时期也是打孔卡编程时期。在 20 世纪 60 年代, IBM 打孔卡的特性,也就是打孔卡的长度为 80 个字符成为了打孔卡的标准。这一标准在后来的电传打字机和哑终端时期得以延续,并逐渐成为操作系统中隐藏的细节。时至今日,即使我们用上了更大、更好的屏幕,偏向于使用更长的标识符而不是类似 `iswcntrl()` 这样令人难以猜测的函数名,可当你打开新的终端模拟器窗口时,默认的宽度依然是 80 个字符。 + +从 Quora 上的很多问题中可以发现,很多人并不能想象如何使用打孔卡给计算机编程。我承认,在很长的一段时间里我也不能理解卡编程成是如何工作的,因为这让我想到有很多劳工不停的给这些打孔卡打孔。当然,这是一个误解,程序员不需要亲自给打孔卡打孔,就像是火车调度员不用亲自扳道岔。程序员们有打孔机(也被称为键控打孔机key punches),这让他们可以使用打字机式的键盘给打孔卡打孔。这样的设备在 19 世纪 90 年代时就已经不是什么新技术了。 + +那时,最为广泛使用的打孔机之一便是 IBM 029 型打孔机。就算在今天,它也许是最棒的打孔机。 + +![][1] + +IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。 System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样, 029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比, 029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在数字区numeric fields左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做左填充left-padding的程序员。 +(译者注:这项功能需要额外的 4 张 [标准模块系统卡SMS card](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如数字区长度为 6 时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch)) + +等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年, IBM 的产品目录中才出现 029 型打孔机的身影。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了他的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用“在线”的传输方式"online" mode of communication。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为批任务batch job执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让他成为那时最流行的数据存储方式了。那时的程序是书架上一落的打孔卡而不是硬盘里的一堆文件。 + +那么实际使用 IBM 029 型打孔机是个什么样子呢?这很难向没有实际看过打孔卡的人解释。一张打孔卡通常有12行80列。打孔卡下面是从 1 到 9 的数字行digit rows,打孔卡上的每一列都有这些行所对应的数字。最上面的三行是空间行"zone" rows,通常由两行空白行和一行 0 行组成。第 12 行是打孔卡最顶层的行,接下来是 11 行,随后是从数字 0 到 9 所在的行。这个有点让人感到困惑的顺序的原因是打孔卡的上边缘被称为12 边12 edge、下边缘被称为 9 边9 edge。那时,为了让打孔卡便于整理,常常会剪去打孔卡的一个角。 + +![][2] +(译者注:可参考[EBCDIC 编码](https://zh.wikipedia.org/wiki/EBCDIC)) + +在打孔卡发明之初,孔洞的形状是圆形的,但是 IBM 最终意识到如果使用窄长方形作为孔洞,一张卡就可以放下更多的列了。每一列中孔洞的不同组合就可以表达不同的字符。像 029 型这样的拥有人性化设计的打孔机除了完成本质的打孔任务外,还会在打孔卡最上方打印出每一列所对应的字符。输入是数字就在对应的数字行上打孔。输入的是字母或符号就用一个在空间列的孔和一或俩个在数字列的孔的组合表示,例如字母 A 就用一个在第 12 空间行的空和一个数字 1 所在行的孔表示。这是一种顺序编码,在第一台打孔机被发明后,也叫 Hollerith 编码。这种编码只能表示相对较小的一套字符集,小写字母就没有包含在这套字符集中,但它的优势在于保留了打孔卡的结构强度。如果直接使用二进制编码,打孔卡可能会因为孔洞过于密集而断裂。 + +打孔卡也有不同。在 20 世纪 60 年代,80 列虽然是标准,但表达的方式不一定相同。基础打孔卡是无标注的,但用于 COBOL 编程的打孔卡会把最后的 8 列保留,供标识数保存使用。这一标识数可以在打孔卡被打乱 (例如一叠打孔卡掉在地上了) 后用于自动排序。此外,第 7 列被用于表示本张打孔卡上的是否是上一张打孔卡一起构成一条语句。也就是说当你真的对 80 字符的限制感到绝望的时候,还可以用两张卡甚至更多的卡拼接成一条长语句。用于 FORTRAN 编程的打孔卡和 COBOL 打孔卡类似,但是定义的列不同。大学里使用的打孔卡通常会由其计算机中心加上水印,其他的设计则会在如 [1976 年美国独立 200 周年][3] 的特殊场合才会加入。 + +最终,这些打孔卡都要被计算机读取和计算。 IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕, System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是扩展的二进制十数交换码Extended Binary Coded Decimal Interchange Code,简写为 EBCDIC 编码。它的源自于早期打孔卡所使用的 BCDIDC 编码,这一 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写玩程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。 + +程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学University of Michigan在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。 + +029 型打孔机的结构围绕着一个打孔卡穿过机器的 U 形轨道开始。使用打孔机时,右手边也就是 U 形轨道的右侧顶部是进卡卡槽hopper,使用前通常在里面放入一叠未使用的打孔卡。虽然 029 型打孔机主要使用 80 列打孔卡,但在需要的情况下也可以使用更小号的打孔卡。在打孔机的使用过程中,打孔卡离开轨道右上端的进卡卡槽,顺着 U 形轨道移动并最终进入左上端的出卡卡槽stacker。这一流程可以保证出卡卡槽中的打孔卡按打孔时的先后顺序排列。 + +029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入FEED” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放REL (for release)” 键完成上面的操作。 + +在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原unpunched,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。 + +实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “重复DUP (for duplicate)” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。 + +“重复”按键允许 029 型打孔机的操作员手动调用重复的函数。但是 029 型打孔机还可以设置为自动重复。当用于记录数据而不是编程时,这项功能十分有效。举个例子,当用打孔卡来记录大学生的信息时,每张卡片上都需要输入学生的宿舍楼的名字,如果发现所输入信息的学生都在同一栋楼,就可以使用 029 型打孔机的自动重复功能来完成宿舍楼名称的填写。 + +像这样的自动化操作可以通过打孔卡给 029 型打孔机编程控制。安装打孔卡的圆柱形装置drum就在 U 形轨道中间部分的右上角。通过使用 029 型在打孔卡上写下程序,然后把打孔卡的装入圆柱形装置,再将其安装到打孔机内后,就完成了一次给 029 型打孔机的编程任务。用户可以通过这种方式对打孔卡的每一列都按需要定义不同的自动化操作。029 型打孔机允许指定某些列重复上一张打孔卡相同位置的字符,这就是它能更快的输入学生信息的理由。它还允许指定某些列只能输入数字或者字母,指定特定的列为空或者到某一列时就直接跳过一整张打孔卡。这样的可编程特性使它在输入拥有固定格式的数据时效率很高。密歇根大学制作的[进阶教学视频][5]包括了给 029 型打孔机编程的过程,如果你已经掌握了它的基础操作,就快去看看吧。 + +这会儿,无论你是否看了密歇根大学制作的视频,都会感叹打孔机的操作之简便。虽然修正错误的过程很乏味,但除此之外,操作一台打孔机并不像想象的那样复杂。我甚至可以想象打孔卡之间的无缝切换让 COBOL 和 FORTRAN 程序员忘记了他们的程序是打在不同的打孔卡上而不是写在一个连续的文本文件内。另一方面,思考一下打孔机是如何影响编程语言的发展也是很有趣的,虽然它仅仅是一台输入设备。结构化编程最终会出现并鼓励程序员把整个代码块视为一个整体,但可以想象打孔卡程序员们强调每一行的作用且难以认同结构化编程的场景。同时你能够理解他们为什么不把代码块闭合所使用的括号放在单独的一行,只是因为这样会浪费打孔卡。 + +现在,虽然没有人再使用打孔卡编程了,每个程序员都该试试[这个][6],哪怕一次也好。或许你因此能够更好的理解 COBOL 和 FORTRAN 的历史,或许你就能体会到为什么每个人把 80 个字符作为长度限制的标注。 + +喜欢吗?这里每两周都会发表一篇这样的文章。请在推特上关注我们 [@TwoBitHistory][7] 或者订阅我们的 [RSS][8],这样你就能在第一时间收到新文章的通知。 + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[wwhio](https://github.com/wwhio) +校对:[校对者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://twobithistory.org/images/ibm029_front.jpg +[2]: https://twobithistory.org/images/card.png +[3]: http://www.jkmscott.net/data/Punched%20card%20013.jpg +[4]: https://www.youtube.com/watch?v=kaQmAybWn-w +[5]: https://www.youtube.com/watch?v=SWD1PwNxpoU +[6]: http://www.masswerk.at/keypunch/ +[7]: https://twitter.com/TwoBitHistory +[8]: https://twobithistory.org/feed.xml From 6abe0371b0c84efcec18609eb2656a360cf58121 Mon Sep 17 00:00:00 2001 From: wwhio Date: Thu, 20 Dec 2018 00:58:33 +0800 Subject: [PATCH 0948/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E7=94=B3=E8=AF=B7=E6=A0=A1=E5=AF=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/talk/20180623 The IBM 029 Card Punch.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md index a1283e70b2..f905ee1481 100644 --- a/translated/talk/20180623 The IBM 029 Card Punch.md +++ b/translated/talk/20180623 The IBM 029 Card Punch.md @@ -28,13 +28,13 @@ IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件 最终,这些打孔卡都要被计算机读取和计算。 IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕, System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是扩展的二进制十数交换码Extended Binary Coded Decimal Interchange Code,简写为 EBCDIC 编码。它的源自于早期打孔卡所使用的 BCDIDC 编码,这一 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写玩程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。 -程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学University of Michigan在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。 +程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学University of Michigan在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。 029 型打孔机的结构围绕着一个打孔卡穿过机器的 U 形轨道开始。使用打孔机时,右手边也就是 U 形轨道的右侧顶部是进卡卡槽hopper,使用前通常在里面放入一叠未使用的打孔卡。虽然 029 型打孔机主要使用 80 列打孔卡,但在需要的情况下也可以使用更小号的打孔卡。在打孔机的使用过程中,打孔卡离开轨道右上端的进卡卡槽,顺着 U 形轨道移动并最终进入左上端的出卡卡槽stacker。这一流程可以保证出卡卡槽中的打孔卡按打孔时的先后顺序排列。 -029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入FEED” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放REL (for release)” 键完成上面的操作。 +029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入FEED” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放REL (for release)” 键完成上面的操作。 -在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原unpunched,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。 +在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原unpunched,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。 实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “重复DUP (for duplicate)” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。 From 9a7e0dce391e93e9566f04297cdaef29ceff1ff8 Mon Sep 17 00:00:00 2001 From: wwhio Date: Thu, 20 Dec 2018 00:59:32 +0800 Subject: [PATCH 0949/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E7=94=B3=E8=AF=B7=E6=A0=A1=E5=AF=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/talk/20180623 The IBM 029 Card Punch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md index f905ee1481..e13a10593c 100644 --- a/translated/talk/20180623 The IBM 029 Card Punch.md +++ b/translated/talk/20180623 The IBM 029 Card Punch.md @@ -13,7 +13,7 @@ IBM 029 型打孔机 ![][1] IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。 System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样, 029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比, 029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在数字区numeric fields左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做左填充left-padding的程序员。 -(译者注:这项功能需要额外的 4 张 [标准模块系统卡SMS card](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如数字区长度为 6 时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch)) +(译者注:这项功能需要额外的 4 张 [标准模块系统卡SMS card](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如设置数字区域长度为 6 列时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch)) 等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年, IBM 的产品目录中才出现 029 型打孔机的身影。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了他的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用“在线”的传输方式"online" mode of communication。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为批任务batch job执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让他成为那时最流行的数据存储方式了。那时的程序是书架上一落的打孔卡而不是硬盘里的一堆文件。 From d12dfbfd5465731b90ad51d3c8ed9b8e98cffe65 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 Dec 2018 08:52:51 +0800 Subject: [PATCH 0950/1143] translated --- ...to The Matrix at the Linux command line.md | 54 ------------------- ...to The Matrix at the Linux command line.md | 54 +++++++++++++++++++ 2 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 sources/tech/20181212 Patch into The Matrix at the Linux command line.md create mode 100644 translated/tech/20181212 Patch into The Matrix at the Linux command line.md diff --git a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md b/sources/tech/20181212 Patch into The Matrix at the Linux command line.md deleted file mode 100644 index 108fb7c97d..0000000000 --- a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md +++ /dev/null @@ -1,54 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Patch into The Matrix at the Linux command line) -[#]: via: (https://opensource.com/article/18/12/linux-toy-cmatrix) -[#]: author: (Jason Baker https://opensource.com/users/jason-baker) - -Patch into The Matrix at the Linux command line -====== -Recreate the classic look and feel of everyone's favorite 1990s sci-fi movie code scroller with cmatrix. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr) - -You've found your way to today's entry from the Linux command-line toys advent calendar. If this is your first visit to the series, you might be wondering what a command-line toy even is? It's anything that's an entertaining diversion at the terminal, be it a game, a fun utility, or a simple distraction. - -Some of these are classics, and some are completely new (at least to me), but I hope all of you find something you enjoy in this series. - -As we come to the close of another year, it's a good time for looking back, and looking forward. What will 2019 hold for you? What does it mean to be 2019? - -I'm reminded that 2019 will mark the twentieth anniversary of one of my favorite science fiction movies from my teenage years, that at the time had me thinking a lot about what the future would hold: [The Matrix][1]. For a computer nerd kid like me, it was the ultimate story of a computer programmer rising up and becoming an action hero in a virtual universe by tapping into the power of his mind. - -At the time, there was no movie that seemed more futuristic to me; both in the story itself, and in the mesmerizing special effects. Realizing that it was filmed over twenty years ago doesn't change that in my mind. - -Bringing it back to our command-line toy for today, let's recreate the downward flowing code of the Matrix at our terminal with **cmatrix**. **cmatrix** was an easy install for me, packaged for Fedora, so installing it took simply: - -``` -$ dnf install cmatrix -``` - -Then, just type **cmatrix **at your terminal to run. -![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif) -You can find the source code for **** **cmatrix** [on GitHub][2] under a GPL license. - -Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. - -Check out yesterday's toy, [Winterize your Bash prompt in Linux][3], and check back tomorrow for another! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/linux-toy-cmatrix - -作者:[Jason Baker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/The_Matrix -[2]: https://github.com/abishekvashok/cmatrix -[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md new file mode 100644 index 0000000000..1793ec25ad --- /dev/null +++ b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Patch into The Matrix at the Linux command line) +[#]: via: (https://opensource.com/article/18/12/linux-toy-cmatrix) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +在命令行中步入黑客帝国 +====== +使用 cmatrix 重建每个人最喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr) + +你发现了今天的命令行玩具日历。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。 + +其中一些是经典,有些是全新的(至少对我而言),但我希望你们所有人都能在这个系列中找到你喜欢的东西。 + +在我们在接近下一年的时候,现在是回顾和期待的好时机。2019 年会为你带来什么?2019 年意味着什么? + +我想起 2019 年将是我青少年时期最喜欢的科幻电影之一[黑客帝国][1]的二十周年纪念日,它当时让我思考了未来将会发生什么。对于像我这样的痴迷计算机小孩来说,这是一个电脑程序员通过利用自己思维的力量崛起并成为虚拟宇宙中的动作英雄的终极故事。 + +当时,没有一部电影对我来说似乎更具未来感。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。 + +今天将它带回我们的命令行玩具,让我们在终端用 **cmatrix** 重建黑客帝国中那向下滚动的代码流。 **cmatrix** 对我来说很容易安装,它在 Fedora 中被打包了,所以安装它只需: + +``` +$ dnf install cmatrix +``` + +接着,只需在你的终端输入 **cmatrix** 即可运行。 +![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif) +你可以在 [GitHub][2] 上找到使用 GPL 许可的 **cmatrix** 的源代码。 + +你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。评论留言让我知道,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 + +了解一下昨天的玩具,[在 Linux 中让 Bash 提示符变得像冬天][2],还有记得明天再来! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-cmatrix + +作者:[Jason Baker][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/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/The_Matrix +[2]: https://github.com/abishekvashok/cmatrix +[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt \ No newline at end of file From d32cebf5e13418d3503d69ab39076dad932ea782 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 Dec 2018 08:59:40 +0800 Subject: [PATCH 0951/1143] translating --- sources/tech/20181208 Play Tetris at your Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181208 Play Tetris at your Linux terminal.md b/sources/tech/20181208 Play Tetris at your Linux terminal.md index d3a94bcaf6..db1fe62c24 100644 --- a/sources/tech/20181208 Play Tetris at your Linux terminal.md +++ b/sources/tech/20181208 Play Tetris at your Linux terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c2550effc87eb921631245f2c7209043d7d4d8ad Mon Sep 17 00:00:00 2001 From: zjon Date: Thu, 20 Dec 2018 11:09:22 +0800 Subject: [PATCH 0952/1143] Update 20171012 7 Best eBook Readers for Linux.md zjon is translating 20171012 7 Best eBook Readers for Linux --- sources/tech/20171012 7 Best eBook Readers for Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20171012 7 Best eBook Readers for Linux.md b/sources/tech/20171012 7 Best eBook Readers for Linux.md index 5198f1bdc0..9f69c6decb 100644 --- a/sources/tech/20171012 7 Best eBook Readers for Linux.md +++ b/sources/tech/20171012 7 Best eBook Readers for Linux.md @@ -1,3 +1,4 @@ +zjon is translating 7 Best eBook Readers for Linux ====== **Brief:** In this article, we are covering some of the best ebook readers for Linux. These apps give a better reading experience and some will even help in managing your ebooks. From 83278751d60a03c62e3dfe31a6d5bb8507078479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com> Date: Thu, 20 Dec 2018 20:26:31 +0800 Subject: [PATCH 0953/1143] Create 20180912 How to turn on an LED with Fedora IoT.md --- ...2 How to turn on an LED with Fedora IoT.md | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 translated/tech/20180912 How to turn on an LED with Fedora IoT.md diff --git a/translated/tech/20180912 How to turn on an LED with Fedora IoT.md b/translated/tech/20180912 How to turn on an LED with Fedora IoT.md new file mode 100644 index 0000000000..59bbc1280b --- /dev/null +++ b/translated/tech/20180912 How to turn on an LED with Fedora IoT.md @@ -0,0 +1,201 @@ +# 如何使用 Fedora IoT 开启 LED 灯 + +![](https://fedoramagazine.org/wp-content/uploads/2018/08/LED-IoT-816x345.jpg) + +你喜欢 Fedora、容器和树莓派吗?这三者结合操控 LED 会怎么样?本文介绍的是 Fedora IoT,将展示如何在树莓派上安装预览镜像。还将学习如何与 GPIO 交互以开启 LED。 + +### 什么是 Fedora IoT? + +Fedora IoT 是当前 Fedora 项目的目标之一,计划成为一个完整的 Fedora 版本。Fedora IoT 将是一个在ARM(目前仅限 aarch64)例如树莓派,以及 x86_64 架构设备上运行的系统。 + +![][1] + +Fedora IoT 基于 OSTree 开发, 就像[Fedora Silverblue][2] 和以往的 [Atomic Host][3]. + +### 下载和安装 Fedora IoT + +官方 Fedora IoT 镜像将和 Fedora 29 一起发布。但是在此期间你可以下载 [Fedora 28-based 镜像][4] 来进行这个实验。 + +你有两种方法来安装这个系统:使用 dd 命令闪存SD卡,或者使用 fedora-arm-installer 工具。Fedora 的 Wiki 里面提供了更多关于[设置物理设备][5] 的信息来开发 IoT。另外,你可能需要调整第三个分区的大小。 + +把 SD 卡插入到设备并运行,需要创建一个用户来完成安装。这个步骤需要串行连接或带键盘的 HDMI 显示器来与设备进行交互。 + +当系统安装完成后,下一步就是要设置网络连接。使用你刚才创建的用户登录系统,可以使用下列方式之一完成网络连接设置: + +- 如果你需要手动配置你的网络,可能需要执行类似如下命令,需要保证设置正确的网络地址: + +``` + $ nmcli connection add con-name cable ipv4.addresses \ + 192.168.0.10/24 ipv4.gateway 192.168.0.1 \ + connection.autoconnect true ipv4.dns "8.8.8.8,1.1.1.1" \ + type ethernet ifname eth0 ipv4.method manual + +``` + +- 如果你网络上运行着 DHCP 服务,可能需要类似如下命令: + +``` + $ nmcli con add type ethernet con-name cable ifname eth0 +``` + + + +### **Fedora 中的 GPIO 接口** + +许多关于 Linux 上 GPIO 的教程都关注传统的 GPIO sysfis 接口。这个接口已经不推荐使用了,并且上游 Linux 内核社区由于安全和其他问题的缘故打算完全删除它。 + +Fedora 已经不将这个传统的接口编译到内核了,因此在系统上没有 /sys/class/gpio 这个文件。此教程使用一个上游内核提供的一个新的字符设备 /dev/gpiochipN 。这是目前和 GPIO 交互的方式。 + +为了和这个新设备进行交互,你需要使用一个库和一系列命令行界面工具。公共命令行工具比如说 echo 和 cat 在此设备上无法正常工作。 + +你可以通过安装 libgpiod-utils 包来安装命令行界面工具。python3-libgpiod 包提供了相应的 Python 库。 + +### **使用 Podman 来创建一个容器** + +[Podman][6] 是一个容器运行环境,其命令行界面类似于Docker。Podman的一大优势是它不会在后台运行任何守护进程。这对于资源有限的设备尤其有用。Podman 还允许您使用 systemd 单元文件启动容器化服务。此外,它还有许多其他功能。 + +我们使用如下两步来创建一个容器: + +``` +1. 创建包含所需包的分层镜像。 +2. 使用分层镜像创建一个新容器。 +``` + + + +首先创建一个 Dockerfile 文件,内容如下。这些内容告诉 podman 基于可使用的最新 Fedora 镜像来构建我们的分层镜像。然后就是更新系统和安装一些软件包: + +``` +FROM fedora:latest +RUN dnf -y update +RUN dnf -y install libgpiod-utils python3-libgpiod + +``` + +这样你就完成了镜像的生成前的配置工作,这个镜像基于最新的 Fedora,而且包含了和 GPIO 交互的软件包。 + +现在你就可以运行下方命令来构建你的基本镜像了: + +``` +$ sudo podman build --tag fedora:gpiobase -f ./Dockerfile + +``` + +你已经成功创建了你的自定义镜像。这样以后你就可以不用每次都重新搭建环境了,而是基于你创建的镜像来完成工作。 + +### 使用 Podman 完成工作 + +为了确认当前的镜像,可以运行下方命令: + +``` +$ sudo podman images +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/fedora gpiobase 67a2b2b93b4b 10 minutes ago 488MB +docker.io/library/fedora latest c18042d7fac6 2 days ago 300MB + +``` + +现在,启动容器并进行一些实际的实验。 容器通常是隔离的,无法访问主机系统,包括GPIO接口。 因此需要在启动容器时将其挂载在容器内。 可以使用以下命令中的 -device 选项来解决: + +``` +$ sudo podman run -it --name gpioexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash + +``` + +运行之后就进入了正在运行的容器中。 在继续之前,这里有一些容器命令。 输入 exit 或者按下 **Ctrl+D** 来退出容器。 + +显示所有存在的容器可以运行如下命令: + +``` +$ sudo podman container ls -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +64e661d5d4e8 localhost/fedora:gpiobase /bin/bash 37 seconds ago Exited (0) Less than a second ago gpioexperiment + +``` + +使用如下命令创建一个新的容器: + +``` +$ sudo podman run -it --name newexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash + +``` + +如果想删除容器可以使用如下命令: + +``` +$ sudo podman rm newexperiment + +``` + +### **开启 LED 灯** + +现在可以使用已创建的容器。 如果容器已经退出,请使用以下命令再次启动它: + +``` +$ sudo podman start -ia gpioexperiment + +``` + +如前所述,可以使用 Fedora 中 libgpiod-utils 包提供的 CLI 工具。 要列出可用的 GPIO 芯片可以使用如下命令: + +``` +$ gpiodetect +gpiochip0 [pinctrl-bcm2835] (54 lines) + +``` + +要获取特定芯片的公开列表,请运行: + +``` +$ gpioinfo gpiochip0 + +``` + +请注意,物理引脚数与前一个命令打印的行数之间没有相关性。 重要的是 BCM 编号,如 [pinout.xyz][7] 所示。 建议不要使用没有相应 BCM 编号的线路。 + +现在,将 LED 连接到物理引脚40,也就是 BCM 21。请记住:LED的短腿(负极,称为阴极)必须连接到带有330欧姆电阻的树莓派的 GND 引脚, 并且长腿(阳极)到物理引脚40。 + +运行以下命令打开LED。,按下 **Ctrl + C ** 关闭: + +``` +$ gpioset --mode=wait gpiochip0 21=1 + +``` + +要点亮一段时间,请添加 -b(在后台运行)和 -s NUM(多少秒)参数,如下所示。 例如,要点亮 LED 5秒钟,运行如下命令: + +``` +$ gpioset -b -s 5 --mode=time gpiochip0 21=1 + +``` + +另一个有用的命令是 gpioget。 它可以获得引脚的状态(高或低),可用于检测按钮和开关。 + +![Closeup of LED connection with GPIO][8] + +### **总结** + +你也可以使用 Python 操控 LED - [这里有一些例子][9]。 也可以在容器内使用 i2c 设备。 此外,Podman 与此 Fedora 版本并不严格相关。 你可以在任何现有的 Fedora Edition 上安装它,或者在 Fedora 中使用两个基于 OSTree 的新系统进行尝试:[Fedora Silverblue][2] 和 [Fedora CoreOS][10]。 + +------ + +via: https://fedoramagazine.org/turnon-led-fedora-iot/ + +作者:[Alessio Ciregia][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[ScarboroughCoral](https://github.com/ScarboroughCoral) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://alciregi.id.fedoraproject.org/ +[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/oled-1024x768.png +[2]: https://teamsilverblue.org/ +[3]: https://www.projectatomic.io/ +[4]: https://kojipkgs.fedoraproject.org/compose/iot/latest-Fedora-IoT-28/compose/IoT/ +[5]: https://fedoraproject.org/wiki/InternetOfThings/GettingStarted#Setting_up_a_Physical_Device +[6]: https://github.com/containers/libpod +[7]: https://pinout.xyz/ +[8]: https://fedoramagazine.org/wp-content/uploads/2018/08/breadboard-1024x768.png +[9]: https://github.com/brgl/libgpiod/tree/master/bindings/python/examples +[10]: https://coreos.fedoraproject.org/ From 3c68a0d9d6b73f7ebd64bc1bca2a51bdc59cdb06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com> Date: Thu, 20 Dec 2018 20:28:22 +0800 Subject: [PATCH 0954/1143] Delete 20180912 How to turn on an LED with Fedora IoT.md --- ...2 How to turn on an LED with Fedora IoT.md | 202 ------------------ 1 file changed, 202 deletions(-) delete mode 100644 sources/tech/20180912 How to turn on an LED with Fedora IoT.md diff --git a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md b/sources/tech/20180912 How to turn on an LED with Fedora IoT.md deleted file mode 100644 index 5f1843fc83..0000000000 --- a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md +++ /dev/null @@ -1,202 +0,0 @@ -Translating by ScarboroughCoral -How to turn on an LED with Fedora IoT -====== - -![](https://fedoramagazine.org/wp-content/uploads/2018/08/LED-IoT-816x345.jpg) - -Do you enjoy running Fedora, containers, and have a Raspberry Pi? What about using all three together to play with LEDs? This article introduces Fedora IoT and shows you how to install a preview image on a Raspberry Pi. You’ll also learn how to interact with GPIO in order to light up an LED. - -### What is Fedora IoT? - -Fedora IoT is one of the current Fedora Project objectives, with a plan to become a full Fedora Edition. The result will be a system that runs on ARM (aarch64 only at the moment) devices such as the Raspberry Pi, as well as on the x86_64 architecture. - -![][1] - -Fedora IoT is based on OSTree, like [Fedora Silverblue][2] and the former [Atomic Host][3]. - -### Download and install Fedora IoT - -The official Fedora IoT images are coming with the Fedora 29 release. However, in the meantime you can download a [Fedora 28-based image][4] for this experiment. - -You have two options to install the system: either flash the SD card using a dd command, or use a fedora-arm-installer tool. The Fedora Wiki offers more information about [setting up a physical device][5] for IoT. Also, remember that you might need to resize the third partition. - -Once you insert the SD card into the device, you’ll need to complete the installation by creating a user. This step requires either a serial connection, or a HDMI display with a keyboard to interact with the device. - -When the system is installed and ready, the next step is to configure a network connection. Log in to the system with the user you have just created choose one of the following options: - - * If you need to configure your network manually, run a command similar to the following. Remember to use the right addresses for your network: -``` - $ nmcli connection add con-name cable ipv4.addresses \ - 192.168.0.10/24 ipv4.gateway 192.168.0.1 \ - connection.autoconnect true ipv4.dns "8.8.8.8,1.1.1.1" \ - type ethernet ifname eth0 ipv4.method manual - -``` - - * If there’s a DHCP service on your network, run a command like this: - -``` - $ nmcli con add type ethernet con-name cable ifname eth0 -``` - - - - -### **The GPIO interface in Fedora** - -Many tutorials about GPIO on Linux focus on a legacy GPIO sysfis interface. This interface is deprecated, and the upstream Linux kernel community plan to remove it completely, due to security and other issues. - -The Fedora kernel is already compiled without this legacy interface, so there’s no /sys/class/gpio on the system. This tutorial uses a new character device /dev/gpiochipN provided by the upstream kernel. This is the current way of interacting with GPIO. - -To interact with this new device, you need to use a library and a set of command line interface tools. The common command line tools such as echo or cat won’t work with this device. - -You can install the CLI tools by installing the libgpiod-utils package. A corresponding Python library is provided by the python3-libgpiod package. - -### **Creating a container with Podman** - -[Podman][6] is a container runtime with a command line interface similar to Docker. The big advantage of Podman is it doesn’t run any daemon in the background. That’s especially useful for devices with limited resources. Podman also allows you to start containerized services with systemd unit files. Plus, it has many additional features. - -We’ll create a container in these two steps: - - 1. Create a layered image containing the required packages. - 2. Create a new container starting from our image. - - - -First, create a file Dockerfile with the content below. This tells podman to build an image based on the latest Fedora image available in the registry. Then it updates the system inside and installs some packages: - -``` -FROM fedora:latest -RUN  dnf -y update -RUN  dnf -y install libgpiod-utils python3-libgpiod - -``` - -You have created a build recipe of a container image based on the latest Fedora with updates, plus packages to interact with GPIO. - -Now, run the following command to build your base image: - -``` -$ sudo podman build --tag fedora:gpiobase -f ./Dockerfile - -``` - -You have just created your custom image with all the bits in place. You can play with this base container images as many times as you want without installing the packages every time you run it. - -### Working with Podman - -To verify the image is present, run the following command: - -``` -$ sudo podman images -REPOSITORY                 TAG        IMAGE ID       CREATED          SIZE -localhost/fedora           gpiobase   67a2b2b93b4b   10 minutes ago  488MB -docker.io/library/fedora   latest     c18042d7fac6   2 days ago     300MB - -``` - -Now, start the container and do some actual experiments. Containers are normally isolated and don’t have an access to the host system, including the GPIO interface. Therefore, you need to mount it inside while starting the container. To do this, use the –device option in the following command: - -``` -$ sudo podman run -it --name gpioexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash - -``` - -You are now inside the running container. Before you move on, here are some more container commands. For now, exit the container by typing exit or pressing **Ctrl+D**. - -To list the the existing containers, including those not currently running, such as the one you just created, run: - -``` -$ sudo podman container ls -a -CONTAINER ID   IMAGE             COMMAND     CREATED          STATUS                              PORTS   NAMES -64e661d5d4e8   localhost/fedora:gpiobase   /bin/bash 37 seconds ago Exited (0) Less than a second ago           gpioexperiment - -``` - -To create a new container, run this command: - -``` -$ sudo podman run -it --name newexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash - -``` - -Delete it with the following command: - -``` -$ sudo podman rm newexperiment - -``` - -### **Turn on an LED** - -Now you can use the container you already created. If you exited from the container, start it again with this command: - -``` -$ sudo podman start -ia gpioexperiment - -``` - -As already discussed, you can use the CLI tools provided by the libgpiod-utils package in Fedora. To list the available GPIO chips, run: - -``` -$ gpiodetect -gpiochip0 [pinctrl-bcm2835] (54 lines) - -``` - -To get the list of the lines exposed by a specific chip, run: - -``` -$ gpioinfo gpiochip0 - -``` - -Notice there’s no correlation between the number of physical pins and the number of lines printed by the previous command. What’s important is the BCM number, as shown on [pinout.xyz][7]. It is not advised to play with the lines that don’t have a corresponding BCM number. - -Now, connect an LED to the physical pin 40, that is BCM 21. Remember: the shorter leg of the LED (the negative leg, called the cathode) must be connected to a GND pin of the Raspberry Pi with a 330 ohm resistor, and the long leg (the anode) to the physical pin 40. - -To turn the LED on, run the following command. It will stay on until you press **Ctrl+C** : - -``` -$ gpioset --mode=wait gpiochip0 21=1 - -``` - -To light it up for a certain period of time, add the -b (run in the background) and -s NUM (how many seconds) parameters, as shown below. For example, to light the LED for 5 seconds, run: - -``` -$ gpioset -b -s 5 --mode=time gpiochip0 21=1 - -``` - -Another useful command is gpioget. It gets the status of a pin (high or low), and can be useful to detect buttons and switches. - -![Closeup of LED connection with GPIO][8] - -### **Conclusion** - -You can also play with LEDs using Python — [there are some examples here][9]. And you can also use the i2c devices inside the container as well. In addition, Podman is not strictly related to this Fedora edition. You can install it on any existing Fedora Edition, or try it on the two new OSTree-based systems in Fedora: [Fedora Silverblue][2] and [Fedora CoreOS][10]. - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/turnon-led-fedora-iot/ - -作者:[Alessio Ciregia][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://alciregi.id.fedoraproject.org/ -[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/oled-1024x768.png -[2]: https://teamsilverblue.org/ -[3]: https://www.projectatomic.io/ -[4]: https://kojipkgs.fedoraproject.org/compose/iot/latest-Fedora-IoT-28/compose/IoT/ -[5]: https://fedoraproject.org/wiki/InternetOfThings/GettingStarted#Setting_up_a_Physical_Device -[6]: https://github.com/containers/libpod -[7]: https://pinout.xyz/ -[8]: https://fedoramagazine.org/wp-content/uploads/2018/08/breadboard-1024x768.png -[9]: https://github.com/brgl/libgpiod/tree/master/bindings/python/examples -[10]: https://coreos.fedoraproject.org/ From ccff8ae5e89141ad282f78a42bfe3c58950dc78f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Dec 2018 22:15:39 +0800 Subject: [PATCH 0955/1143] PRF:20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @geekpi --- ...roken Ubuntu OS Without Reinstalling It.md | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md index 2fbdc6f07e..858862096e 100644 --- a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md +++ b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It) [#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/) @@ -18,29 +18,20 @@ 首先,尝试使用 live cd 登录并**在外部驱动器中备份数据**。以防这个方法没用,你仍然可以获取数据并重新安装系统! -在登录页上,按下 **CTRL+ALT+F1** 切换到 **tty1**。你可以在[**此处**][1]了解有关在 TTY 之间切换的更多信息。 +在登录页上,按下 `CTRL+ALT+F1` 切换到 tty1。你可以在[此处][1]了解有关在 TTY 之间切换的更多信息。 现在,逐个输入以下命令来修复损坏的 Ubuntu Linux。 ``` $ sudo rm /var/lib/apt/lists/lock - $ sudo rm /var/lib/dpkg/lock - $ sudo rm /var/lib/dpkg/lock-frontend - $ sudo dpkg --configure -a - $ sudo apt clean - $ sudo apt update --fix-missing - $ sudo apt install -f - $ sudo dpkg --configure -a - $ sudo apt upgrade - $ sudo apt dist-upgrade ``` @@ -52,7 +43,7 @@ $ sudo reboot 你现在可以像往常一样登录到你的 Ubuntu 系统。 -我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的贴士对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。 +我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的技巧对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。 这是这些了。希望这篇文章有用。 @@ -69,10 +60,10 @@ via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling- 作者:[SK][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.ostechnix.com/author/sk/ [b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/ \ No newline at end of file +[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/ From b84383d0c6c5243606f103ae11a70a76f8efee3a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Dec 2018 22:16:47 +0800 Subject: [PATCH 0956/1143] PUB:20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @geekpi https://linux.cn/article-10367-1.html --- ...205 How To Fix Broken Ubuntu OS Without Reinstalling It.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md (97%) diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md similarity index 97% rename from translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md rename to published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md index 858862096e..4db620bf58 100644 --- a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md +++ b/published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It) [#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/) [#]: author: (SK https://www.ostechnix.com/author/sk/) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10367-1.html) 如何不重装修复损坏的 Ubuntu 系统 ====== From 39ffd0e98559e69ca53f58784373ebe2f81d7a63 Mon Sep 17 00:00:00 2001 From: jlztan Date: Thu, 20 Dec 2018 22:20:41 +0800 Subject: [PATCH 0957/1143] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20PR=EF=BC=9A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=B4=E9=83=A8=E7=9A=84=E5=85=83=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...brate Christmas In Linux Way With These Wallpapers.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md index 1132a52058..3c282ce7d5 100644 --- a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -1,3 +1,12 @@ +[#]: collector: (lujun9972) +[#]: translator: (jlztan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers) +[#]: via: (https://itsfoss.com/christmas-linux-wallpaper/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: url: ( ) + 使用这些壁纸以 Linux 的方式庆祝圣诞节 ====== From a99040998a1f6e1b2b9cedf7687234f9915cfd4a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Dec 2018 22:26:02 +0800 Subject: [PATCH 0958/1143] PRF:20181212 Patch into The Matrix at the Linux command line.md @geekpi --- ...to The Matrix at the Linux command line.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md index 1793ec25ad..9660bf046d 100644 --- a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md +++ b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Patch into The Matrix at the Linux command line) @@ -9,10 +9,12 @@ 在命令行中步入黑客帝国 ====== -使用 cmatrix 重建每个人最喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。 + +> 使用 cmatrix 重建每个人都喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr) -你发现了今天的命令行玩具日历。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。 +这是今天的命令行玩具日历推荐项目。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。 其中一些是经典,有些是全新的(至少对我而言),但我希望你们所有人都能在这个系列中找到你喜欢的东西。 @@ -20,17 +22,19 @@ 我想起 2019 年将是我青少年时期最喜欢的科幻电影之一[黑客帝国][1]的二十周年纪念日,它当时让我思考了未来将会发生什么。对于像我这样的痴迷计算机小孩来说,这是一个电脑程序员通过利用自己思维的力量崛起并成为虚拟宇宙中的动作英雄的终极故事。 -当时,没有一部电影对我来说似乎更具未来感。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。 +当时,对我来说没有比这部电影更具未来感了。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。 -今天将它带回我们的命令行玩具,让我们在终端用 **cmatrix** 重建黑客帝国中那向下滚动的代码流。 **cmatrix** 对我来说很容易安装,它在 Fedora 中被打包了,所以安装它只需: +今天将它带回我们的命令行玩具,让我们在终端用 `cmatrix` 重建黑客帝国中那向下滚动的代码流。 `cmatrix` 很容易安装,它在 Fedora 中被打包了,所以安装它只需: ``` $ dnf install cmatrix ``` -接着,只需在你的终端输入 **cmatrix** 即可运行。 +接着,只需在你的终端输入 `cmatrix` 即可运行。 + ![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif) -你可以在 [GitHub][2] 上找到使用 GPL 许可的 **cmatrix** 的源代码。 + +你可以在 [GitHub][2] 上找到使用 GPL 许可的 `cmatrix` 的源代码。 你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。评论留言让我知道,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 @@ -43,7 +47,7 @@ via: https://opensource.com/article/18/12/linux-toy-cmatrix 作者:[Jason Baker][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/) 荣誉推出 @@ -51,4 +55,4 @@ via: https://opensource.com/article/18/12/linux-toy-cmatrix [b]: https://github.com/lujun9972 [1]: https://en.wikipedia.org/wiki/The_Matrix [2]: https://github.com/abishekvashok/cmatrix -[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt \ No newline at end of file +[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt From cf6fc9935c5903a66f7daaaf932052d77dc28479 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Dec 2018 22:27:30 +0800 Subject: [PATCH 0959/1143] PUB:20181212 Patch into The Matrix at the Linux command line.md @geekpi https://linux.cn/article-10368-1.html --- .../20181212 Patch into The Matrix at the Linux command line.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181212 Patch into The Matrix at the Linux command line.md (100%) diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/published/20181212 Patch into The Matrix at the Linux command line.md similarity index 100% rename from translated/tech/20181212 Patch into The Matrix at the Linux command line.md rename to published/20181212 Patch into The Matrix at the Linux command line.md From eb69ee153ff6179759dad824fcdf2c253080127d Mon Sep 17 00:00:00 2001 From: lxy <524187166@qq.com> Date: Thu, 20 Dec 2018 22:41:16 +0800 Subject: [PATCH 0960/1143] commit --- ...en solutions to everything in education.md | 113 ------------------ ...en solutions to everything in education.md | 110 +++++++++++++++++ 2 files changed, 110 insertions(+), 113 deletions(-) delete mode 100644 sources/tech/20180101 27 open solutions to everything in education.md create mode 100644 translated/tech/20180101 27 open solutions to everything in education.md diff --git a/sources/tech/20180101 27 open solutions to everything in education.md b/sources/tech/20180101 27 open solutions to everything in education.md deleted file mode 100644 index eeba3692e4..0000000000 --- a/sources/tech/20180101 27 open solutions to everything in education.md +++ /dev/null @@ -1,113 +0,0 @@ -translating by lixinyuxx - -27 open solutions to everything in education -====== -![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo) - -Openness (from open source software, to open hardware, to open principles) is changing the paradigm of education. So, to celebrate all that's gone on this year, I collected 27 of the best articles published on Opensource.com in 2017 on the subject. I divided them into broad themes, rather than ordering them by popularity. And, if these 27 stories don't satisfy your appetite for information about open source in education, check out our companion article on how [education is leveraging Raspberry Pi and Linux][30]. - -### Open is better for everyone - -1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt reviews David Price's book OPEN, which explores the idea that "open" isn't just a technological shift, rather it's "how we'll work, live, and learn in the future." - -2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur points out how to get ahead in the workforce by learning open source. This advice isn't just for programmers; designers, writers, marketers, and other creative professionals are also essential to the success of open source. - -3. [A graduate degree could springboard you into an open source job][3]: Citing research that shows that Linux skills lead to higher pay, Joshua Pearce makes the case that open source proficiency and a graduate degree are an unbeatable career combination. - -4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger shows us how open practices are creating a more inclusive, agile, and open culture in a Pennsylvania school district. Charlie says it's not just about saving money; the district also gains from "open leadership principles that foster innovation among teachers and students, help to better engage the community, and create a more vibrant and inclusive learning community." - -5. [15 ways to empower students with open source tools][5]: I write how open source gives students the freedom to explore, tinker, and learn, whether they're learning basic digital literacy or expanding on those skills with fun projects. - -6. [Developer opportunities to code for good][6]: Open source is often the backbone of socially beneficial projects. As Ahn Bui, vice president of Benetech Labs, states in this interview: "Establishing open data standards is an integral step in breaking down data silos. Those open standards will provide the foundation for interoperability and in turn, translate to more organizations building together, often more cost effectively. The ultimate goal is to serve more people at the same cost or even less." - -### Open education resources for remixing and reusing - -1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis, director of programs for Wiki Ed, discusses how open educational resources (OERs), such as Wiki Ed, are providing high-quality and affordable open source learning resources as classroom teaching tools. - -2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, director of open education for Creative Commons, shares how the face of education is changing in higher education and what Creative Commons is doing to facilitate it. - -3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites, community evangelist and chief marketing officer of Open Up Resources, talks about the nonprofit organization's efforts to provide open, standards-aligned curricula for K-12 schools. - -4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke, educational technologist at the University of Hawaii at Manoa, says that transitioning to OER in college courses will "empower faculty to take control of what content they teach with, which we expect will result in their saving students money." - -5. [How open courses are slashing the cost of higher education][11]: Saylor Academy's director of education Devon Ritter reports how Saylor is building its college credit-eligible courses on openly licensed content, with the goal of making higher education affordable and accessible to more people. - -6. [Open educational resources movement gains speed][12]: Alexis Clifton, executive director of the State University of New York OER Services, describes how New York's US$ 8 million investment is spurring growth in open education and making college more affordable. - -7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik from Duke University explores OSPRI (Open Source Pedagogy Research and Innovation), a collaboration between Duke and Red Hat that's building a 21st-century, preK-12 learning ecosystem that is open by design. - -8. [Perma.cc stops scholarly link rot][14]: Virginia Tech's Phillip Young writes about Perma.cc, a solution to "link rot," which is the high probability that hyperlinks in academic papers will disappear or change over time. - -9. [Open education: How students save money by creating open textbooks][15]: OER pioneer Robin DeRosa talks about "the freedom that the openly licensed textbook introduced, and the overarching idea that education and learning should be contextualized in inclusive ecosystems that enhance the public good." - -### Open source tools in the classroom - -1. [How an open source board game is saving the planet][16]: Joshua Pearce writes about Save the Planet, a board game that empowers students to solve environmental problems while having fun and contributing to the maker community. - -2. [A new Android app for teaching kids how to read][17]: Michael Hall talks about Phoenicia, a children's literacy app he developed after his son was diagnosed with autism, the value of coding for good, and why user testing matters more than you think. - -3. [8 open source Android apps for education][18]: Joshua Allen Holm challenges us to use our smartphones as learning tools by recommending eight open source apps from the F-Droid repository to try. - -4. [3 open source alternatives to MATLAB][19]: Jason Baker's update to his 2016 survey of open source mathematical computing software presents alternatives to MATLAB, the expensive, proprietary solution nearly ubiquitous in mathematics, physical sciences, engineering, and economics. - -5. [What does SVG have to do with teaching kids to code?][20] Retired engineer Jay Nick talks about how he uses art as a creative way to introduce students to coding. He volunteers in schools, using Scalable Vector Graphics (SVG) to teach an approach to coding that combines principles of mathematics and art. - -6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, who holds a PhD in fine arts from Texas Tech, shares his experience using open source tools in a world ruled by proprietary solutions. Kyle says there's a bias against using open source in disciplines outside of computer science: "Many people think non-technical students can't use Linux, and they make a lot of assumptions about people who use it in their advanced degree programs. … Well, it is possible, and I'm proof." - -7. [A list of open source tools for college][22]: Aaron Cocker outlines the open source tools (including presentation, backup, and programming software) he uses while working on his undergraduate degree in computer science. - -8. [5 great KDE apps to help you study][23]: Zsolt Szakács offers five KDE applications that help anyone who wants to learn new skills or cultivate existing ones. - -### Coding in the classroom - -1. [How to get the next generation coding early][24]: Bryson Payne says we need to teach kids to code before high school: By ninth grade 80% of girls and 60% of boys have already self-selected out of a STEM career. But it's not only about jobs and closing the IT skills gap, he suggests. "Teaching a young person to code could be the single most life-changing skill you can give them. And it's not just a career-enhancer. Coding is about problem-solving, it's about creativity, and more importantly, it's about empowerment." - -2. [Kids can't code without computers][25]: Patrick Masson introduces the FLOSS Desktops for Kids program, which teaches students at underserved schools to repurpose older computers with open source software, such as Linux, LibreOffice, and GIMP. Not only is the program breathing new life into broken or decommissioned hardware, it's also giving students important skills that may translate into future careers. - -3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva offers suggestions for using [Scratch][27] to spark kids' interest in programming, just as LOGO did when he started using it in the 1980s. - -4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger describes App Inventor, a programming framework for building Android applications using a visual blocks language (similar to Scratch or [Snap][29]). - -Throughout the year we learned that there is an open solution to everything in education, and I expect this theme to continue in 2018 and beyond. Are there open education topics you'd like Opensource.com to cover in the coming year? If so, please share your ideas in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/1/best-open-education - -作者:[Don Watkins][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/don-watkins -[1]:https://opensource.com/article/17/7/book-review-open -[2]:https://opensource.com/article/17/8/jump-start-your-career -[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab -[4]:https://opensource.com/article/17/7/open-school-leadership -[5]:https://opensource.com/article/17/7/empower-students-open-source-tools -[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs -[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation -[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons -[9]:https://opensource.com/article/17/1/open-up-resources -[10]:https://opensource.com/article/17/2/interview-education-billy-meinke -[11]:https://opensource.com/article/17/7/college-alternatives -[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton -[13]:https://opensource.com/article/17/3/education-should-be-open-design -[14]:https://opensource.com/article/17/9/stop-link-rot-permacc -[15]:https://opensource.com/article/17/11/creating-open-textbooks -[16]:https://opensource.com/article/17/7/save-planet-board-game -[17]:https://opensource.com/article/17/4/phoenicia-education-software -[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education -[19]:https://opensource.com/alternatives/matlab -[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam -[21]:https://opensource.com/article/17/5/how-linux-higher-education -[22]:https://opensource.com/article/17/6/open-source-tools-university-student -[23]:https://opensource.com/article/17/6/kde-education-software -[24]:https://opensource.com/article/17/8/teach-kid-code-change-life -[25]:https://opensource.com/article/17/9/floss-desktops-kids -[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids -[27]:https://scratch.mit.edu/ -[28]:https://opensource.com/article/17/8/app-inventor-android-app-development -[29]:http://snap.berkeley.edu/ -[30]:https://opensource.com/article/17/12/best-opensourcecom-linux-and-raspberry-pi-education diff --git a/translated/tech/20180101 27 open solutions to everything in education.md b/translated/tech/20180101 27 open solutions to everything in education.md new file mode 100644 index 0000000000..43f4717c1f --- /dev/null +++ b/translated/tech/20180101 27 open solutions to everything in education.md @@ -0,0 +1,110 @@ +27个解决教学问题的开放式方法 +====== +![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo) + +开放式理念 (从开源软件到开放硬件, 再到开放原则) 正在改变教育的范式。因此, 为了庆祝今年发生的一切, 我收集了2017年在 Opensource.com 上发表的27篇关于这个主题的最好的文章。我把它们分成明确的主题, 而不是按人气来分类。而且, 如果这27个故事不能满足你对教育公开信息的胃口, 那就看看我们的合作文章吧 “ [education is leveraging Raspberry Pi and Linux][30]” + +### 开放对每个人都有好处 + +1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt 评价David Price 的书 'OPEN' ,该书探讨了 “开放” 不仅仅是技术转变的观点, 而是 “我们未来将如何工作、生活和学习”。 + +2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur 指出了如何利用开放式学习在工作群体中脱颖而出。 这个建议不仅仅是针对程序员的, 而是针对程序员的。设计师、作家、营销人员和其他创意专业人士也是开放式成功的关键。 + +3. [A graduate degree could springboard you into an open source job][3]: 引用的研究表明会 Linux 技能会带来更高的薪水, Joshua Pearce 说对开源的熟练和研究生学位是无与伦比的职业技能组合。 + +4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger 向我们展示了开放的做法是如何在宾夕法尼亚州的一个学区创造一种更具包容性、敏捷性和开放性的文化的。 Charlie 说, 这不仅仅是为了省钱;该区还受益于 “开放式领导原则, 促进师生创新, 帮助更好地吸引社区, 创造一个更有活力和包容性的学习社区”。 + +5. [15 ways to empower students with open source tools][5]: 我写开源是如何让学生自由探索、补拙和学习的, 不管他们是在学习基本的数字化素养, 还是通过有趣的项目来扩展这些技能。 + +6. [Developer opportunities to code for good][6]: 开源往往是对社会有益的项目的支柱。正如 Benetech Labs 副总裁 Ahn Bui 在这次采访中指出的那样: “建立开放数据标准是打破数据孤岛不可或缺的一步。这些开放标准将为互操作性提供基础, 进而转化为更多的组织共同建设, 往往更具成本效益。最终目标是以同样的成本甚至更低的成本为更多的人服务。” + +### 用于再融合和再利用的开放式教育资源 + +1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis,Wiki Ed 的, 项目总监,讨论开放教育资源 (OERs) ,如 Wiki Ed,如何提供高质量且经济实惠的开源学习资源作为课堂教学工具。 + +2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green,是 Creative Common 开放教育主任,分享高等教育中教育面貌是如何变化的, 以及 Creative Common 正在采取哪些措施来促进教育。 + +3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites,是 Open Up Resources 社区的福音传教士和首席营销官, 谈论非营利组织努力为 K-12 学校提供开放的, 标准一致的课程。 + +4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke , Hawaii 大学 Manoa 分校的教育技术专家,他说, 在大学课程中过渡到 ORE 将 “使教师能够控制他们教授的内容, 我们预计这将为他们节省学生的费用。” + +5. [How open courses are slashing the cost of higher education][11]: Saylor Academy 的教育主任 Devon Ritter 报告了 Saylor 是如何建立以公开许可内容为基础的大学学分课程, 目的是使更多的人能够负担得起和获得高等教育。 + +6. [Open educational resources movement gains speed][12]: Alexis Clifton,State University of New York 的 OER 服务的执行主任, 描述了纽约800万美元的投资如何刺激开放教育的增长, 并使大学更实惠。 + +7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik 在Duke University 探索 OSPRI (Open Source Pedagogy Research and Innovation,开源教育学的研究与创新), 在 Duke 和 Red Hat 的联合合作这是建立一个21世纪的, preK-12 学习生态系统, 是开放的设计。 + +8. [Perma.cc stops scholarly link rot][14]: Virginia Tech 的 Phillip Young 写关于 Perma.cc, “link rot”(链接失效) 的解决方案 很大可能在学术论文中的超链接随着时间的推移而消失或变化。 + +9. [Open education: How students save money by creating open textbooks][15]: OER 先驱 Robin DeRosa 谈到 “公开许可教科书引入的自由, 以及教育和学习应结合包容性生态系统, 以增强公益的总体理念”。 + +### 课堂上的开源工具 + +1. [How an open source board game is saving the planet][16]: Joshua Pearce 写的关于拯救地球的一个棋盘游戏, 使学生能够解决环境问题, 同时有乐趣, 并为制造商社区作出贡献。 + +2. [A new Android app for teaching kids how to read][17]: Michael Hall 谈到他的儿子 Phoenicia,他在儿子被诊断为自闭症后开发的儿童识字应用, 为了产生更好的编码价值, 以及为什么用户测试比你想象的更重要。 + +3. [8 open source Android apps for education][18]: Joshua Allen Holm 通过推荐 F-Droid 存储库中的8个开源应用来尝试, 这将挑战我们将智能手机用作学习工具。 + +4. [3 open source alternatives to MATLAB][19]: Jason Baker's 更新了他2016年的开源数学计算软件调查, 提出了 MATLAB 的替代方案, 这是数学、物理科学、工程和经济学中几乎无处不在的昂贵的专用解决方案。 + +5. [What does SVG have to do with teaching kids to code?][20] 退休工程师 Jay Nick 谈论他如何使用艺术作为一种创造性的方式, 向学生介绍编码。他在学校做志愿者, 使用可缩放矢量图形 (SVG,Scalable Vector Graphics) 教授一种结合数学和艺术原理的编码方法。 + +6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, 在 Texas Tech 拥有美术博士学位分享他在单一解决方案统治的世界中使用开源工具的经验。 Kyle 说有一种偏见, 反对在计算机科学以外的学科中使用开源:“很多人认为非技术专业的学生不能使用 Linux, 他们对在高级学位课程中使用 Linux 的人做出了很多假设。...嗯, 这是有可能的, 我就是证明。” + +7. [A list of open source tools for college][22]: Aaron Cocker 概述了他在攻读计算机科学本科学位时使用的开源工具 (包括演示、备份和编程软件)。 + +8. [5 great KDE apps to help you study][23]: Zsolt Szakács 提供五个 KDE 应用程序, 帮助任何想要学习新技能或培养现有技能的人。 + +### 在教室编码 + +1. [How to get the next generation coding early][24]: Bryson Payne 说我们需要教孩子们在高中前编码: 到了九年级, 80% 的女孩和60% 的男孩已经从 STEM 职业中自选。但他建议, 这不仅仅是就业和缩小 IT 技能差距的问题。“教一个年轻人编写代码可能是你能给他们的最改变生活的技能。而且这不仅仅是一个职业提升者。编码是关于解决问题, 它是关于创造力, 更重要的是, 它是关于授权。 + +2. [Kids can't code without computers][25]: Patrick Masson 推出了 FLOSS 儿童桌面计划, 该计划教授服务不足学校的学生使用开源软件 (如 Linux、LibreOffice 和 GIMP) 重新设计较旧的计算机。该计划不仅为破旧或退役的硬件注入新的生命, 还为学生提供了重要的技能, 这些技能可能会利于转化为未来的职业。 + +3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva 提出 [Scratch][27] 的使用建议以激发孩子们对编程的兴趣, 就像 LOGO 在20世纪80年代开始使用它时一样。 + +4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger 描述应用发明者, 一个编程框架, 用于构建 Android 应用程序使用可视块语言 (类似 Scratch 或者[Snap][29]). + +在这一年里, 我们了解到, 教育领域的一切都有一个开放的解决方案, 我预计这一主题将在2018年及以后继续下去。在未来的一年里, 你是否希望 Opensource.com 涵盖开放式的教育主题?如果是, 请在评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/1/best-open-education + +作者:[Don Watkins][a] +译者:[lixinyuxx](https://github.com/lixinyuxx) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/don-watkins +[1]:https://opensource.com/article/17/7/book-review-open +[2]:https://opensource.com/article/17/8/jump-start-your-career +[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab +[4]:https://opensource.com/article/17/7/open-school-leadership +[5]:https://opensource.com/article/17/7/empower-students-open-source-tools +[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs +[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation +[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons +[9]:https://opensource.com/article/17/1/open-up-resources +[10]:https://opensource.com/article/17/2/interview-education-billy-meinke +[11]:https://opensource.com/article/17/7/college-alternatives +[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton +[13]:https://opensource.com/article/17/3/education-should-be-open-design +[14]:https://opensource.com/article/17/9/stop-link-rot-permacc +[15]:https://opensource.com/article/17/11/creating-open-textbooks +[16]:https://opensource.com/article/17/7/save-planet-board-game +[17]:https://opensource.com/article/17/4/phoenicia-education-software +[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education +[19]:https://opensource.com/alternatives/matlab +[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam +[21]:https://opensource.com/article/17/5/how-linux-higher-education +[22]:https://opensource.com/article/17/6/open-source-tools-university-student +[23]:https://opensource.com/article/17/6/kde-education-software +[24]:https://opensource.com/article/17/8/teach-kid-code-change-life +[25]:https://opensource.com/article/17/9/floss-desktops-kids +[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids +[27]:https://scratch.mit.edu/ +[28]:https://opensource.com/article/17/8/app-inventor-android-app-development +[29]:http://snap.berkeley.edu/ From aaecf1d4609269144f95e5fe79a5dfa825cd36a3 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Thu, 20 Dec 2018 22:50:29 +0800 Subject: [PATCH 0961/1143] Translating by qhwdw --- sources/tech/20181212 How to Build a Netboot Server, Part 2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md b/sources/tech/20181212 How to Build a Netboot Server, Part 2.md index 0301a34da5..1d1ce2f68f 100644 --- a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md +++ b/sources/tech/20181212 How to Build a Netboot Server, Part 2.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qhwdw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5a97264a42ecefac7b2243aa65c0a80cba61fe13 Mon Sep 17 00:00:00 2001 From: wwhio Date: Thu, 20 Dec 2018 22:57:44 +0800 Subject: [PATCH 0962/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20171119 The Ruby Story.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20171119 The Ruby Story.md b/sources/talk/20171119 The Ruby Story.md index 90d5f41790..4c6b46b7de 100644 --- a/sources/talk/20171119 The Ruby Story.md +++ b/sources/talk/20171119 The Ruby Story.md @@ -1,3 +1,5 @@ +Translating by wwhio + The Ruby Story ====== Ruby has always been one of my favorite languages, though I’ve sometimes found it hard to express why that is. The best I’ve been able to do is this musical analogy: Whereas Python feels to me like punk rock—it’s simple, predictable, but rigid—Ruby feels like jazz. Ruby gives programmers a radical freedom to express themselves, though that comes at the cost of added complexity and can lead to programmers writing programs that don’t make immediate sense to other people. From 4a06c0160382196631c5cb6762b5305f5e47ddf8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 21 Dec 2018 07:13:26 +0800 Subject: [PATCH 0963/1143] PRF:20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @lixinyuxx --- ... - Notmuch, mbsync, postfix and dovecot.md | 83 ++++++++++--------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md index 01e5c82f08..12f45713d4 100644 --- a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md +++ b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @@ -1,33 +1,34 @@ -我的个人电子邮件系统 - Notmuch, mbsync,postfix and dovecot +我的个人电子邮件系统设置:notmuch、mbsync、Postfix 和 dovecot ====== -我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。 + +我使用个人电子邮件系统已经相当长的时间了,但是一直没有记录过文档。最近我换了我的笔记本电脑(职业变更导致的变动),我在试图重新创建本地邮件系统时迷茫了。所以这篇文章是一个给自己看的文档,这样我就不用费劲就能再次搭建出来。 ### 服务器端 -我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说) +我运行自己的邮件服务器,并使用 Postfix 作为 SMTP 服务器,用 Dovecot 实现 IMAP。我不打算详细介绍如何配置这些设置,因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill?(用 Jonas 自己的话说): -> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info) +> \ Redpill 是一个概念:一种设置 Debian hosts 去跨组织协作的方式 +> +> \ 我发展了这个概念,并将其首次用于 Redpill 网中网:redpill.dk,其中涉及到了我自己的网络(jones.dk),我的主要客户的网络(homebase.dk),一个包括 Skolelinux Germany(free-owl.de)的在德国的网络,和 Vasudev 的网络(copyninja.info) -除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。 +除此之外, 我还有一个 dovecot sieve 过滤,根据邮件的来源,对邮件进行高级分类,将其放到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 `~/dovecot.sieve` 文件中。 -再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。 +再次,我不会详细介绍如何设置这些东西,因为这不是我这个帖子的目标。 ### 在我的笔记本电脑上 -在我的笔记本电脑上,我已经按照4个部分设置 - - 1. 邮件同步: 使用 mbsync 命令完成 - 2. 分类: 使用 notmuch 完成 - 3. 阅读: 使用 notmuch-emacs 完成 - 4. 邮件发送: 使用作为转接服务器和 SMTP 客户端运行的 postfix 完成。 - +在我的笔记本电脑上,我已经按照 4 个部分设置 + 1. 邮件同步:使用 `mbsync` 命令完成 + 2. 分类:使用 notmuch 完成 + 3. 阅读:使用 notmuch-emacs 完成 + 4. 邮件发送:使用作为中继服务器和 SMTP 客户端运行的 Postfix 完成。 ### 邮件同步 -邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户,最近切换到 mbsync,因为我觉得它比 OfflineIMAP 的配置更轻,更简单。命令是由包 isync 提供的。 +邮件同步是使用 `mbsync` 工具完成的, 我以前是 OfflineIMAP 的用户,最近切换到 `mbsync`,因为我觉得它比 OfflineIMAP 的配置更轻量、更简单。该命令是由 isync 包提供的。 -配置文件是 ~/.mbsyncrc. 下面是我的例子与一些个人设置。 +配置文件是 `~/.mbsyncrc`。下面是我的例子与一些个人设置。 ``` IMAPAccount copyninja @@ -79,17 +80,17 @@ SyncState * Sync All ``` -对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许你提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。 +对上述配置中的一些有趣部分进行一下说明。一个是 PassCmd,它允许你提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我使用 gpg 的对称加密,并在我的磁盘上存储密码。这当然是由 Unix ACL 保护安全的。 -实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。 +实际上,我想使用我的公钥来加密文件,但当脚本在后台或通过 systemd 运行时,解锁文件看起来很困难 (或者说几乎不可能)。如果你有更好的建议,我洗耳恭听:-)。 -下一个指令部分是模式。这使你可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders. +下一个指令部分是 Patterns。这使你可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助,可以排除所有的 “[Gmail]/ folders” 垃圾目录。 ### 邮件分类 -一旦邮件在你本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。 +一旦邮件到达你的本地设备,我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步的 Maildir,并在 Gnus 中阅读。这种设置相比于设置所有的服务器软件是有点大题小作,但 Gnus 无法很好地应付 Maildir 格式,这是最好的方法。这个设置也有一个缺点,那就是在你快速搜索邮件时,要搜索大量邮件。而这就是 notmuch 的用武之地。 -不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。 +notmuch 允许我轻松索引上千兆字节的邮件档案而找到我需要的东西。我已经创建了一个小脚本,它结合了执行 `mbsync` 和 `notmuch`。我使用 dovecot sieve 来基于实际上创建在服务器端的 Maildirs 标记邮件。下面是我的完整 shell 脚本,它执行同步分类和删除垃圾邮件的任务。 ``` #!/bin/sh @@ -129,27 +130,28 @@ for mdir in $MDIR; do done ``` -因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对,这些邮件逃脱垃圾邮件过滤器进到我的 inbox ,并被我亲自标记为垃圾邮件。 +因此,在运行 `mbsync` 之前,我搜索所有标记为“deleted”的邮件,并将其从系统中删除。接下来,我在我的帐户上查找标记为“Spam”的邮件,并将其移动到“Spam”文件夹。你没看错,这些邮件逃脱了垃圾邮件过滤器进入到我的收件箱,并被我亲自标记为垃圾邮件。 -运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。 +运行 `mbsync` 后,我基于它们的文件夹标记邮件(搜索字符串 `folder:`)。这让我可以很容易地得到一个邮件列表的内容,而不需要记住列表地址。 ### 阅读邮件 -现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer),它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。你可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。 +现在,我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格,所以我花了一些时间写了一个私有层,它将我所有的快捷键和分类集中在一个地方,而不会扰乱我的整个 `.spacemacs` 文件。你可以在 [notmuch-emacs-layer 仓库][1] 找到我的私有层的代码。 ### 发送邮件 -如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。 +能阅读邮件这还不够,我们也需要能够回复邮件。而这是最近是我感到迷茫的一个略显棘手的部分,以至于不得不写这篇文章,这样我就不会再忘记了。(当然也不必在网络上参考一些过时的帖子。) -我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。 +我的系统发送邮件使用 Postfix 作为 SMTP 客户端,使用我自己的 SMTP 服务器作为它的中继主机。中继的问题是,它不能是具有动态 IP 的主机。有两种方法可以允许具有动态 IP 的主机使用中继服务器, 一种是将邮件来源的 IP 地址放入 `my_network` 或第二个使用 SASL 身份验证。 + +我的首选方法是使用 SASL 身份验证。为此,我首先要为每台机器创建一个单独的账户,它将把邮件中继到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主账户,但 Jonas 给出了可行的按账户的想法) -我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法) ``` adduser _relay - ``` -这里替换 与你的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行 +这里替换 `` 为你的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 Postfix 作为中继服务器。因此,在 Postfix 配置中添加以下行: + ``` # SASL authentication smtp_sasl_auth_enable = yes @@ -159,28 +161,30 @@ relayhost = [smtp.copyninja.info]:submission smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd ``` -因此, 这里的 relayhost 是你的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任你的移动主机, 并同意为你转发邮件。 +因此, 这里的 `relayhost` 是用于将邮件转发到互联网的 Postfix 实例的服务器名称。`submission` 的部分 Postfix 将邮件转发到端口 587(安全端口)。`smtp_sasl_tls_security_options` 设置为不允许匿名连接。这是必须的,以便中继服务器信任你的移动主机,并同意为你转发邮件。 + +`/etc/postfix/sasl_passwd` 是你需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。 -/etc/postfix/sasl__asswd 是你需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。 ``` [smtp.example.com]:submission user:password - ``` - 用你的 SMTP 服务器名称替换 smtp.example.com ,你已输入的 relayhost 认证。 用你创建的用户及其密码替换 user with _relay 。 +用你已放入 `relayhost` 配置的 SMTP 服务器名称替换 `smtp.example.com`。用你创建的 `_relay` 用户及其密码替换 `user` 和 `passwd`。 + +若要保护 `sasl_passwd` 文件,并为 Postfix 创建它的哈希文件,使用以下命令。 -若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。 ``` chown root:root /etc/postfix/sasl_passwd chmod 0600 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd ``` -最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是你的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从你的系统中取出。 +最后一条命令将创建 `/etc/postfix/sasl_passwd.db` 文件,它是你的文件的 `/etc/postfix/sasl_passwd` 的哈希文件,具有相同的所有者和权限。现在重新加载 Postfix,并使用 `mail` 命令检查邮件是否从你的系统中发出。 ### Bonus 的部分 -好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。 +好吧,因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器,以定期同步后台的邮件。就我而言,每 10 分钟一次。下面是 `mailsync.timer` 文件。 + ``` [Unit] Description=Check Mail Every 10 minutes @@ -197,7 +201,7 @@ Unit=mailsync.service WantedBy=default.target ``` -下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。 +下面是 mailsync.service 服务,这是 mailsync.timer 执行我们的脚本所需要的。 ``` [Unit] @@ -212,14 +216,15 @@ StandardOutput=syslog StandardError=syslog ``` -将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启它们 +将这些文件置于 `/etc/systemd/user` 目录下并运行以下代码去开启它们: + ``` systemctl enable --user mailsync.timer systemctl enable --user mailsync.service systemctl start --user mailsync.timer ``` -这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。 +这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew,他审阅了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置,当然还会有一个后续的帖子:-)。 -------------------------------------------------------------------------------- @@ -227,7 +232,7 @@ via: https://copyninja.info/blog/email_setup.html 作者:[copyninja][a] 译者:[lixinyuxx](https://github.com/lixinyuxx) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ed9ed4b2e62d59394b53735e5cceb8389d12f75a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 21 Dec 2018 07:13:56 +0800 Subject: [PATCH 0964/1143] PUB:20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @lixingyuxx https://linux.cn/article-10369-1.html --- ...personal Email setup - Notmuch, mbsync, postfix and dovecot.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md (100%) diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/published/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md similarity index 100% rename from translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md rename to published/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md From dd9c5382b4018acb20130115ab004985b810733b Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 Dec 2018 08:52:33 +0800 Subject: [PATCH 0965/1143] translated --- ...es for a Raspberry Pi Around the Office.md | 142 ------------------ ...es for a Raspberry Pi Around the Office.md | 142 ++++++++++++++++++ 2 files changed, 142 insertions(+), 142 deletions(-) delete mode 100644 sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md create mode 100644 translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md diff --git a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md deleted file mode 100644 index 4eb59ba1a0..0000000000 --- a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (11 Uses for a Raspberry Pi Around the Office) -[#]: via: (https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/) -[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) - -11 Uses for a Raspberry Pi Around the Office -====== - -Look, I know what you’re thinking: a Raspberry Pi is really just for tinkering, prototyping and hobby use. It’s not actually meant for running a business on. - -And it’s definitely true that this computer’s relatively low processing power, corruptible SD card, lack of battery backup and the DIY nature of the support means it’s not going to be a viable replacement for a [professionally installed and configured business server][1] for your most mission-critical operations any time soon. - -But the board is affordable, incredibly frugal with power, small enough to fit just about anywhere and endlessly flexible – it’s actually a pretty great way to handle some basic tasks around the office. - -And, even better, there’s a whole world of people out there who have done these projects before and are happy to share how they did it. - -### DNS Server - -Every time you type a website address or click a link in your browser, it needs to convert the domain name into a numeric IP address before it can show you anything. - -Normally this means a request to a DNS server somewhere on the internet – but you can speed up your browsing by handling this locally. - -You can also assign your own subdomains for local access to machines around the office. - -[Here’s how to get this working.][2] - -### Toilet Occupied Sign - -Ever get queues at the loos? - -That’s annoying for those left waiting and the time spent dealing with it is a drain on your whole office’s productivity. - -I guess you could always hang those signs they have on airplanes all through your office. - -[Occu-pi][3] is a much simpler solution, using a magnetic switch and a Raspberry Pi to tell when the bolt is closed and update a Slack channel as to when it’s in use – meaning that the whole office can tell at a glance of their computer or mobile device whether there’s a cubicle free. - -### Honeypot Trap for Hackers - -It should scare most business owners just a little bit that their first clue that a hacker’s breached the network is when something goes badly wrong. - -That’s where it can help to have a honeypot: a computer that serves no purpose except to sit on your network with certain ports open to masquerade as a juicy target to hackers. - -Security researchers often deploy honeypots on the exterior of a network, to collect data on what attackers are doing. - -But for the average small business, these are more usefully deployed in the interior, to serve as kind of a tripwire. Because no ordinary user has any real reason to want to connect to the honeypot, any login attempts that occur are a very good indicator that mischief is afoot. - -This can provide early warning of outsider intrusion, and of trusted insiders up to no good. - -In larger, client/server networks, it might be more practical to run something like this as a virtual machine. But in small-office/home-office situations with a peer-to-peer network running on a wireless router, something like [HoneyPi][4] is a great little burglar alarm. - -### Print Server - -Network-attached printers are so much more convenient. - -But it can be expensive to replace all your printers- especially if you’re otherwise happy with them. - -It might make a lot more sense to [set up a Raspberry Pi as a print server][5]. - -### Network Attached Storage - -Turning simple hard drives into network attached storage was one of the earliest practical uses for a Raspberry Pi, and it’s still one of the best. - -[Here’s how to create a NAS with your Raspberry Pi.][6] - -### Ticketing Server - -Looking for a way to manage the support tickets for your help desk on a shoestring budget? - -There’s a totally open source ticketing program called osTicket that you can install on your Pi, and it’s even available as [a ready-to-go SD card image][7]. - -### Digital Signage - -Whether it’s for events, advertising, a menu, or something else entirely, a lot of businesses need a way to display digital signage – and the Pi’s affordability and frugal electricity needs make it a very attractive choice. - -[There are a wealth of options to choose from here.][8] - -### Directories and Kiosks - -[FullPageOS][9] is a Linux distribution based on Raspbian that boots straight into a full screen version of Chromium – ideal for shopping directoriers, library catalogues and so on. - -### Basic Intranet Web Server - -For hosting a public-facing website, you’re really much better off just getting a hosting account. A Raspberry Pi is not really built to serve any real volume of web traffic. - -But for small offices, it can host an internal business wiki or basic company intranet. It can also work as a sandbox environment for experimenting with code and server configurations. - -[Here’s how to get Apache, MySQL and PHP running on a Pi.][10] - -### Penetration Tester - -Kali Linux is an operating system built specifically to probe networks for security vulnerabilities. By installing it on a Pi, you’ve got a super portable penetration tester with more than 600 tools included. - -[You can find a torrent link for the Raspberry Pi image here.][11] - -Be absolutely scrupulous to only use this on your own network or networks you’ve got permission to perform a security audit on – using this to hack other networks is a serious crime. - -### VPN Server - -When you’re out on the road, relying on public wireless internet, you’ve not really any say in who else might be on the network, snooping on all your traffic. That’s why it can be reassuring to encrypt everything with a VPN connection. - -There are any number of commercial VPN services you can subscribe to – and you can install your own in the cloud – but by running one from your office, you can also access the local network from anywhere. - -For light use – say, the occasional bit of business travel – a Raspberry Pi is a great, power-efficient way to set up a VPN server. (It’s also worth checking first that your router doesn’t offer this functionality already – very many do.) - -[Here’s how to install OpenVPN on a Raspberry Pi.][12] - -### Wireless Coffee Machine - -Ahh, ambrosia: sweet nectar of the gods and the backbone of all productive enterprise. - -So why not [hack the office coffee machine into a smart coffee machine][13] for precision temperature control and wireless network connectivity? - --------------------------------------------------------------------------------- - -via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/ - -作者:[James Mawson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/ -[b]: https://github.com/lujun9972 -[1]: https://dxmtechsupport.com.au/server-configuration -[2]: https://www.1and1.com/digitalguide/server/configuration/how-to-make-your-raspberry-pi-into-a-dns-server/ -[3]: https://blog.usejournal.com/occu-pi-the-bathroom-of-the-future-ed69b84e21d5 -[4]: https://trustfoundry.net/honeypi-easy-honeypot-raspberry-pi/ -[5]: https://opensource.com/article/18/3/print-server-raspberry-pi -[6]: https://howtoraspberrypi.com/create-a-nas-with-your-raspberry-pi-and-samba/ -[7]: https://everyday-tech.com/a-raspberry-pi-ticketing-system-image-with-osticket/ -[8]: https://blog.capterra.com/7-free-and-open-source-digital-signage-software-options-for-your-next-event/ -[9]: https://github.com/guysoft/FullPageOS -[10]: https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server -[11]: https://www.offensive-security.com/kali-linux-arm-images/ -[12]: https://medium.freecodecamp.org/running-your-own-openvpn-server-on-a-raspberry-pi-8b78043ccdea -[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine diff --git a/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md new file mode 100644 index 0000000000..88e7fbd86a --- /dev/null +++ b/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (11 Uses for a Raspberry Pi Around the Office) +[#]: via: (https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/) +[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) + +树莓派在办公室的 11 种用法 +====== + +我知道你在想什么:树莓派只能用在修修补补、原型设计和个人爱好中。它实际不能用在业务中。 + +毫无疑问,这台电脑的处理能力相对较低、易损坏的 SD 卡、缺乏电池备份以及支持的 DIY 性质,这意味着它不会是一个能在任何时候执行最关键的操作的[专业的已安装和已配置的商业服务器][1]的可行替代,。 + +但是它电路板便宜、功耗很小、很小几乎适合任何地方、无限灵活 - 这实际上是处理办公室一些基本任务的好方法。 + +而且,更好的是,已经有一些人完成了这些项目并很乐意分享他们是如何做到的。 + +### DNS 服务器 + +每次在浏览器中输入网站地址或者点击链接时,都需要将域名转换为数字 IP 地址,然后才能显示内容。 + +通常这意味着向互联网上某处 DNS 服务器发出请求 - 但你可以通过本地处理来加快浏览速度。 + +你还可以分配自己的子域,以便本地访问办公室中的计算机。 + +[这里是如何让这它工作。][2] + +### 厕所占用标志 + +在厕所排过队吗? + +这对于那些等待的人来说很烦人,花在处理它上面的时间会耗费你在办公室的工作效率。 + +我想你希望在办公室里也悬挂飞机上有的标志。 + +[Occu-pi][3] 是一个更简单的解决方案,使用磁性开关和树莓派来判断螺栓何时关闭并在 Slack 频道中更新厕所在使用中 - 这意味着整个办公室的人都可以看一眼电脑或者移动设备知道是否有空闲的隔间。 + +### 针对黑客的蜜罐陷阱 + +黑客破坏了网络的第一个线索是一些事情变得糟糕,这应该会吓到大多数企业主。 + +这就是可以用到蜜罐的地方:一台没有任何服务的计算机位于你的网络,将特定端口打开伪装成黑客喜欢的目标。 + +安全研究人员经常在网络外部部署蜜罐,以收集攻击者正在做的事情的数据。 + +但对于普通的小型企业来说,这些作为一种绊脚石部署在内部更有用。因为普通用户没有真正的理由想要连接到蜜罐,所以任何发生的登录尝试都是正在进行捣乱的非常好的指示。 + +这可以提供对外部人员入侵的预警,并且可信赖的内部人员也没有任何好处。 + +在较大的客户端/服务器网络中,将它作为虚拟机运行可能更为实际。但是在无线路由器上运行的点对点的小型办公室/家庭办公网络中,[HoneyPi][4] 之类的东西是一个很小的防盗报警器。 + +### 打印服务器 + +网络连接的打印机更方便。 + +但更换所有打印机可能会很昂贵 - 特别是如果你对它们感到满意的话。 + +[将树莓派设置为打印服务器][5]可能会更有意义。 + +### 网络附加存储 (NAS) + +将硬盘变为 NAS 是树莓派最早的实际应用之一,并且它仍然是最好的之一。 + +[这是如何使用树莓派创建NAS。][6] + +### 工单服务器 + +想要在预算不足的情况下在服务台中支持工单? + +有一个名为 osTicket 的完全开源的工单程序,它可以安装在你的树莓派上,它甚至还有[随时可用的 SD 卡镜像][7]。 + +### 数字标牌 + +无论是用于活动、广告、菜单还是其他任何东西,许多企业都需要一种显示数字标牌的方式 - 而树莓派的廉价和省电使其成为一个非常有吸引力的选择。 + +[这有很多可供选择的选项。] [8] + +### 目录和信息亭 + +[FullPageOS][9] 是一个基于 Raspbian 的 Linux 发行版,它直接引导到 Chromium 的全屏版本 - 这非常适合导购、图书馆目录等。 + +### 基本的内联网 Web 服务器 + +对于托管一个面向公众的网站,你最好有一个托管帐户。树莓派不适合面对真正的网络流量。 + +但对于小型办公室,它可以托管内部业务维基或基本的公司内网。它还可以用作沙箱环境,用于试验代码和服务器配置。 + +[这里是如何在树莓派上运行 Apache、MySQL 和 PHP。][10] + +### 渗透测试器 + +Kali Linux 是专为探测网络安全漏洞而构建的操作系统。通过将其安装在树莓派上,你就拥有了一个超便携式穿透测试器,其中包含 600 多种工具。 + +[你可以在这里找到树莓派镜像的种子链接。][11] + +绝对小心只在你自己的网络或你有权对它安全审计的网络中使用它 - 使用此方法来破解其他网络是严重的犯罪行为。 + +### VPN 服务器 + +当你外出时,依靠的是公共无线互联网,你无法控制还有谁在网络中、谁在窥探你的所有流量。这就是为什么通过 VPN 连接加密所有内容可以让人放心。 + +你可以订阅任意数量的商业 VPN 服务,并且你可以在云中安装自己的服务,但是在办公室运行一个 VPN,这样你也可以从任何地方访问本地网络。 + +对于轻度使用 - 比如偶尔的商务旅行 - 树莓派是一种强大的,节约能源的设置 VPN 服务器的方式。(首先要检查一下你的路由器是不是不支持这个功能,许多路由器是支持的。) + +[这是如何在树莓派上安装 OpenVPN。][12] + +### 无线咖啡机 + +啊,美味:美味的饮料还是公司内工作效率的支柱。 + +那么, 为什么不[将办公室的咖啡机变成可以精确控制温度和无线连接的智能咖啡机呢?][13] + +-------------------------------------------------------------------------------- + +via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/ + +作者:[James Mawson][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://blog.dxmtechsupport.com.au/author/james-mawson/ +[b]: https://github.com/lujun9972 +[1]: https://dxmtechsupport.com.au/server-configuration +[2]: https://www.1and1.com/digitalguide/server/configuration/how-to-make-your-raspberry-pi-into-a-dns-server/ +[3]: https://blog.usejournal.com/occu-pi-the-bathroom-of-the-future-ed69b84e21d5 +[4]: https://trustfoundry.net/honeypi-easy-honeypot-raspberry-pi/ +[5]: https://opensource.com/article/18/3/print-server-raspberry-pi +[6]: https://howtoraspberrypi.com/create-a-nas-with-your-raspberry-pi-and-samba/ +[7]: https://everyday-tech.com/a-raspberry-pi-ticketing-system-image-with-osticket/ +[8]: https://blog.capterra.com/7-free-and-open-source-digital-signage-software-options-for-your-next-event/ +[9]: https://github.com/guysoft/FullPageOS +[10]: https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server +[11]: https://www.offensive-security.com/kali-linux-arm-images/ +[12]: https://medium.freecodecamp.org/running-your-own-openvpn-server-on-a-raspberry-pi-8b78043ccdea +[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine \ No newline at end of file From 5dd95c43b49d1b427c2b2341bc725b9351b8f252 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 Dec 2018 08:59:20 +0800 Subject: [PATCH 0966/1143] translating --- ...o Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md b/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md index 1b52121add..379bbfd20a 100644 --- a/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md +++ b/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 17ba37122e923c2297b5e54c287781f60733a5fc Mon Sep 17 00:00:00 2001 From: Auk7F7 <34982730+Auk7F7@users.noreply.github.com> Date: Fri, 21 Dec 2018 11:31:10 +0800 Subject: [PATCH 0967/1143] Update 20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md translating by Auk7F7 --- ...Audit - A Tool To Check Vulnerable Packages In Arch Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md b/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md index 7c626bb0b2..3f77bee3d1 100644 --- a/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md +++ b/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md @@ -7,6 +7,8 @@ [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) [#]: url: ( ) +translating by Auk7F7 + Arch-Audit : A Tool To Check Vulnerable Packages In Arch Linux ====== From 0113da44dbfd713cb49fe7bc2d14dd1050656f45 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 11:53:43 +0800 Subject: [PATCH 0968/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Getting=20start?= =?UTF-8?q?ed=20with=20Prometheus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0181220 Getting started with Prometheus.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20181220 Getting started with Prometheus.md diff --git a/sources/tech/20181220 Getting started with Prometheus.md b/sources/tech/20181220 Getting started with Prometheus.md new file mode 100644 index 0000000000..79704addb7 --- /dev/null +++ b/sources/tech/20181220 Getting started with Prometheus.md @@ -0,0 +1,166 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Prometheus) +[#]: via: (https://opensource.com/article/18/12/introduction-prometheus) +[#]: author: (Michael Zamot https://opensource.com/users/mzamot) + +Getting started with Prometheus +====== +Learn to install and write queries for the Prometheus monitoring and alerting system. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_sysadmin_cloud.png?itok=sUciG0Cn) + +[Prometheus][1] is an open source monitoring and alerting system that directly scrapes metrics from agents running on the target hosts and stores the collected samples centrally on its server. Metrics can also be pushed using plugins like **collectd_exporter** —although this is not Promethius' default behavior, it may be useful in some environments where hosts are behind a firewall or prohibited from opening ports by security policy. + +Prometheus, a project of the [Cloud Native Computing Foundation][2], scales up using a federation model, which enables one Prometheus server to scrape another Prometheus server. This allows creation of a hierarchical topology, where a central system or higher-level Prometheus server can scrape aggregated data already collected from subordinate instances. + +Besides the Prometheus server, its most common components are its [Alertmanager][3] and its exporters. + +Alerting rules can be created within Prometheus and configured to send custom alerts to Alertmanager. Alertmanager then processes and handles these alerts, including sending notifications through different mechanisms like email or third-party services like [PagerDuty][4]. + +Prometheus' exporters can be libraries, processes, devices, or anything else that exposes the metrics that will be scraped by Prometheus. The metrics are available at the endpoint **/metrics** , which allows Prometheus to scrape them directly without needing an agent. The tutorial in this article uses **node_exporter** to expose the target hosts' hardware and operating system metrics. Exporters' outputs are plaintext and highly readable, which is one of Prometheus' strengths. + +In addition, you can configure [Grafana][5] to use Prometheus as a backend to provide data visualization and dashboarding functions. + +### Making sense of Prometheus' configuration file + +The number of seconds between when **/metrics** is scraped controls the granularity of the time-series database. This is defined in the configuration file as the **scrape_interval** parameter, which by default is set to 60 seconds. + +Targets are set for each scrape job in the **scrape_configs** section. Each job has its own name and a set of labels that can help filter, categorize, and make it easier to identify the target. One job can have many targets. + +### Installing Prometheus + +In this tutorial, for simplicity, we will install a Prometheus server and **node_exporter** with docker. Docker should already be installed and configured properly on your system. For a more in-depth, automated method, I recommend Steve Ovens' article [How to use Ansible to set up system monitoring with Prometheus][6]. + +Before starting, create the Prometheus configuration file **prometheus.yml** in your work directory as follows: + +``` +global: +  scrape_interval:      15s +  evaluation_interval: 15s + +scrape_configs: +  - job_name: 'prometheus' + +        static_configs: +        - targets: ['localhost:9090'] + +  - job_name: 'webservers' + +        static_configs: +        - targets: [':9100'] +``` + +Start Prometheus with Docker by running the following command: + +``` +$ sudo docker run -d -p 9090:9090 -v +/path/to/prometheus.yml:/etc/prometheus/prometheus.yml +prom/prometheus +``` + +By default, the Prometheus server will use port 9090. If this port is already in use, you can change it by adding the parameter **\--web.listen-address=" :"** at the end of the previous command. + +In the machine you want to monitor, download and run the **node_exporter** container by using the following command: + +``` +$ sudo docker run -d -v "/proc:/host/proc" -v "/sys:/host/sys" -v +"/:/rootfs" --net="host" prom/node-exporter --path.procfs +/host/proc --path.sysfs /host/sys --collector.filesystem.ignored- +mount-points "^/(sys|proc|dev|host|etc)($|/)" +``` + +For the purposes of this learning exercise, you can install **node_exporter** and Prometheus on the same machine. Please note that it's not wise to run **node_exporter** under Docker in production—this is for testing purposes only. + +To verify that **node_exporter** is running, open your browser and navigate to **http:// :9100/metrics**. All the metrics collected will be displayed; these are the same metrics Prometheus will scrape. + +![](https://opensource.com/sites/default/files/uploads/check-node_exporter.png) + +To verify the Prometheus server installation, open your browser and navigate to . + +You should see the Prometheus interface. Click on **Status** and then **Targets**. Under State, you should see your machines listed as **UP**. + +![](https://opensource.com/sites/default/files/uploads/targets-up.png) + +### Using Prometheus queries + +It's time to get familiar with [PromQL][7], Prometheus' query syntax, and its graphing web interface. Go to **** on your Prometheus server. You will see a query editor and two tabs: Graph and Console. + +Prometheus stores all data as time series, identifying each one with a metric name. For example, the metric **node_filesystem_avail_bytes** shows the available filesystem space. The metric's name can be used in the expression box to select all of the time series with this name and produce an instant vector. If desired, these time series can be filtered using selectors and labels—a set of key-value pairs—for example: + +``` +node_filesystem_avail_bytes{fstype="ext4"} +``` + +When filtering, you can match "exactly equal" ( **=** ), "not equal" ( **!=** ), "regex-match" ( **=~** ), and "do not regex-match" ( **!~** ). The following examples illustrate this: + +To filter **node_filesystem_avail_bytes** to show both ext4 and XFS filesystems: + +``` +node_filesystem_avail_bytes{fstype=~"ext4|xfs"} +``` + +To exclude a match: + +``` +node_filesystem_avail_bytes{fstype!="xfs"} +``` + +You can also get a range of samples back from the current time by using square brackets. You can use **s** to represent seconds, **m** for minutes, **h** for hours, **d** for days, **w** for weeks, and **y** for years. When using time ranges, the vector returned will be a range vector. + +For example, the following command produces the samples from five minutes to the present: + +``` +node_memory_MemAvailable_bytes[5m] +``` + +Prometheus also includes functions to allow advanced queries, such as this: + +``` +100 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated (1 - avg by(instance)(irate(node_cpu_seconds_total{job='webservers',mode='idle'}[5m]))) +``` + +Notice how the labels are used to filter the job and the mode. The metric **node_cpu_seconds_total** returns a counter, and the **irate()** function calculates the per-second rate of change based on the last two data points of the range interval (meaning the range can be smaller than five minutes). To calculate the overall CPU usage, you can use the idle mode of the **node_cpu_seconds_total** metric. The idle percent of a processor is the opposite of a busy processor, so the **irate** value is subtracted from 1. To make it a percentage, multiply it by 100. + +![](https://opensource.com/sites/default/files/uploads/cpu-usage.png) + +### Learn more + +Prometheus is a powerful, scalable, lightweight, and easy to use and deploy monitoring tool that is indispensable for every system administrator and developer. For these and other reasons, many companies are implementing Prometheus as part of their infrastructure. + +To learn more about Prometheus and its functions, I recommend the following resources: + ++ About [PromQL][8] ++ What [node_exporters collects][9] ++ [Prometheus functions][10] ++ [4 open source monitoring tools][11] ++ [Now available: The open source guide to DevOps monitoring tools][12] + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/introduction-prometheus + +作者:[Michael Zamot][a] +选题:[lujun9972][b] +译者:[译者ID](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://prometheus.io/ +[2]: https://www.cncf.io/ +[3]: https://prometheus.io/docs/alerting/alertmanager/ +[4]: https://en.wikipedia.org/wiki/PagerDuty +[5]: https://grafana.com/ +[6]: https://opensource.com/article/18/3/how-use-ansible-set-system-monitoring-prometheus +[7]: https://prometheus.io/docs/prometheus/latest/querying/basics/ +[8]: https://prometheus.io/docs/prometheus/latest/querying/basics/ +[9]: https://github.com/prometheus/node_exporter#collectors +[10]: https://prometheus.io/docs/prometheus/latest/querying/functions/ +[11]: https://opensource.com/article/18/8/open-source-monitoring-tools +[12]: https://opensource.com/article/18/8/now-available-open-source-guide-devops-monitoring-tools From a9b3773a74c7e41743ee2f62da56a500dab87614 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 11:55:44 +0800 Subject: [PATCH 0969/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Termtosvg=20?= =?UTF-8?q?=E2=80=93=20Record=20Your=20Terminal=20Sessions=20As=20SVG=20An?= =?UTF-8?q?imations=20In=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nal Sessions As SVG Animations In Linux.md | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20181218 Termtosvg - Record Your Terminal Sessions As SVG Animations In Linux.md diff --git a/sources/tech/20181218 Termtosvg - Record Your Terminal Sessions As SVG Animations In Linux.md b/sources/tech/20181218 Termtosvg - Record Your Terminal Sessions As SVG Animations In Linux.md new file mode 100644 index 0000000000..f25406a66a --- /dev/null +++ b/sources/tech/20181218 Termtosvg - Record Your Terminal Sessions As SVG Animations In Linux.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Termtosvg – Record Your Terminal Sessions As SVG Animations In Linux) +[#]: via: (https://www.2daygeek.com/termtosvg-record-your-terminal-sessions-as-svg-animations-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Termtosvg – Record Your Terminal Sessions As SVG Animations In Linux +====== + +By default everyone prefer history command to review/recall the previously entered commands in terminal. + +But unfortunately, that shows only the commands that we ran and doesn’t shows the commands output which was performed previously. + +There are many utilities available in Linux to record the terminal session activity. + +This tool will help us to record the users terminal activity, also will help us to identify other useful information from the output. + +Also, we had written about few utilities in the past and today also we are going to discuss about the same kind of topic. + +If you would like to check other utilities to record your Linux terminal session activity then you can give a try to **[Script Command][1]** and **[Terminalizer Tool][2]**. + +But if you are looking for **[GIF Recorder][3]** then try **[Gifine][4]** , **[Kgif][5]** and **[Peek][6]** utilities. + +Script is one of the best utility to record your terminal session on headless server. + +Script is a Unix command line utility that records a terminal session (in other terms, It’s record everything displayed on your terminal). + +It stores the output in the current directory as a text file and the default file name is typescript. + +### What is Termtosvg + +Termtosvg is a Unix terminal recorder written in Python that renders your command line sessions as standalone SVG animations. + +### Termtosvg Features + + * Produce lightweight and clean looking animations embeddable on a project page. + * Custom color themes, terminal UI and animation controls via SVG templates. + * Compatible with asciinema recording format. + * It requires Python >= 3.5 + + + +### How to Install Termtosvg In Linux + +It was written in Python and pip installation is a recommended method to install Termtosvg on Linux. + +Make sure you should have installed python-pip package on your system. If no, use the following command to install it. + +For Debian/Ubuntu users, use **[Apt Command][7]** or **[Apt-Get Command][8]** to install pip package. + +``` +$ sudo apt install python-pip +``` + +For Archlinux users, use **[Pacman Command][9]** to install pip package. + +``` +$ sudo pacman -S python-pip +``` + +For Fedora users, use **[DNF Command][10]** to install pip package. + +``` +$ sudo dnf install python-pip +``` + +For CentOS/RHEL users, use **[YUM Command][11]** to install pip package. + +``` +$ sudo yum install python-pip +``` + +For openSUSE users, use **[Zypper Command][12]** to install pip package. + +``` +$ sudo zypper install python-pip +``` + +Finally run the following **[pip command][13]** to install Termtosvg tool in Linux. + +``` +$ sudo pip3 install termtosvg pyte python-xlib svgwrite +``` + +### How to Record Your Terminal Session Using Termtosvg + +Once you successfully installed Termtosvg. Just run the following command to start recording. + +``` +$ termtosvg +Recording started, enter "exit" command or Control-D to end +``` + +For testing purpose run few commands and see whether it’s working fine or not. + +``` +$ uname -a +Linux daygeek-Y700 4.19.8-2-MANJARO #1 SMP PREEMPT Sat Dec 8 14:45:36 UTC 2018 x86_64 GNU/Linux +$ hostname +daygeek-Y700 +$ cat /etc/*-release +Manjaro Linux +DISTRIB_ID=ManjaroLinux +DISTRIB_RELEASE=18.0 +DISTRIB_CODENAME=Illyria +DISTRIB_DESCRIPTION="Manjaro Linux" +Manjaro Linux +NAME="Manjaro Linux" +ID=manjaro +ID_LIKE=arch +PRETTY_NAME="Manjaro Linux" +ANSI_COLOR="1;32" +HOME_URL="https://www.manjaro.org/" +SUPPORT_URL="https://www.manjaro.org/" +BUG_REPORT_URL="https://bugs.manjaro.org/" +$ free -g +free: Multiple unit options doesn't make sense. +$ free -m +free: Multiple unit options doesn't make sense. +$ pip3 --version +pip 18.1 from /usr/lib/python3.7/site-packages/pip (python 3.7) +``` + +Once you have done, simple press `CTRL+D` or type `exit` to stop the recording. The result will be saved in `/tmp` folder with a unique name. + +``` +$ exit +exit +Recording ended, SVG animation is /tmp/termtosvg_5waorper.svg +``` + +We can open the SVG file output with help of any web browser. + +``` +$ firefox /tmp/termtosvg_5waorper.svg +``` + +![][15] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/termtosvg-record-your-terminal-sessions-as-svg-animations-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/script-command-record-save-your-terminal-session-activity-linux/ +[2]: https://www.2daygeek.com/terminalizer-a-tool-to-record-your-terminal-and-generate-animated-gif-images/ +[3]: https://www.2daygeek.com/category/gif-recorder/ +[4]: https://www.2daygeek.com/gifine-create-animated-gif-vedio-recorder-linux-mint-debian-ubuntu/ +[5]: https://www.2daygeek.com/kgif-create-animated-gif-file-active-window-screen-recorder-capture-arch-linux-mint-fedora-ubuntu-debian-opensuse-centos/ +[6]: https://www.2daygeek.com/peek-create-animated-gif-screen-recorder-capture-arch-linux-mint-fedora-ubuntu/ +[7]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[11]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[12]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[13]: https://www.2daygeek.com/install-pip-manage-python-packages-linux/ +[14]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[15]: https://www.2daygeek.com/wp-content/uploads/2018/12/Termtosvg-Record-Your-Terminal-Sessions-As-SVG-Animations-In-Linux-1.gif From 72cac1ddd191b5564b8b85c744755bdaabb6bc72 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 11:58:26 +0800 Subject: [PATCH 0970/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Let=20your=20Li?= =?UTF-8?q?nux=20terminal=20speak=20its=20mind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Let your Linux terminal speak its mind.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20181220 Let your Linux terminal speak its mind.md diff --git a/sources/tech/20181220 Let your Linux terminal speak its mind.md b/sources/tech/20181220 Let your Linux terminal speak its mind.md new file mode 100644 index 0000000000..7f237c0962 --- /dev/null +++ b/sources/tech/20181220 Let your Linux terminal speak its mind.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Let your Linux terminal speak its mind) +[#]: via: (https://opensource.com/article/18/12/linux-toy-espeak) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Let your Linux terminal speak its mind +====== +eSpeak is an open source text-to-speech synthesizer that can be invoked from the Linux command line. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cava.png?itok=4EWYL8uZ) + +Greetings from another day in our 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +We hope that even if you've seen some of these before, there will be something new for everybody in our series. + +Some of you may be too young to remember, but before there was Alexa, Siri, or the Google Assistant, computers still had voices. + +Many of us will never forget HAL 9000 from [2001: A Space Odessey][1] helpfully conversing with the crew (sorry, Dave). But between 1960s science fiction and today, there was a whole generation of speaking computers. Some of them great, most of them, not so great. + +One of my favorites is the open source project [eSpeak][2]. It's available in many forms, including a library version you can use to include speech technology in your own project, but it also coms as a command-line program that you can install and use easily. In my distribution, this was as simple as: + +``` +$ sudo dnf install espeak +``` + +Invoking eSpeak then can be invoked either interactively, or by piping text to it using the output of another program or a simple echo command. There are a number of [voice files][3] available for eSpeak, and if you're especially bored over the holidays, you could even create your own. + +A fork of eSpeak called eSpeak NG ("Next Generation") was created in 2015 from some developers who wanted to continue development of the otherwise lightly-updated eSpeak. eSpeak is made available as open source under a GPL version 3 license, and you can find out more about the project and download the source code [on SourceForge][2]. + +I'll also throw in a bonus toy today, [cava][4]. Because I've been eager to give each of these articles a unique screenshot as the lead image, and today's toy outputs sound rather than something visual, I needed to find something to fill the space. Short for "console-based audio visualizer for ALSA" (although it supports more than just ALSA now), cava is a nice MIT-licensed terminal audio visualization tool that's fun to watch. Below, is a visualization of eSpeak's output of the following: + +``` +$ echo "Rudolph, the red-nosed reindeer, had a very shiny nose." | espeak +``` + +![](https://opensource.com/sites/default/files/uploads/linux-toy-cava.gif) + +Do you have a favorite command-line toy that you we should have included? Our calendar is basically set for the remainder of the series, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Solve a puzzle at the Linux command line with nudoku][5], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-espeak + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/2001:_A_Space_Odyssey_(film) +[2]: http://espeak.sourceforge.net/ +[3]: http://espeak.sourceforge.net/voices.html +[4]: https://github.com/karlstav/cava +[5]: https://opensource.com/article/18/12/linux-toy-nudoku From c3e4b8640c490d562dadc579d7f0b6430156a967 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:04:58 +0800 Subject: [PATCH 0971/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Head=20to=20the?= =?UTF-8?q?=20arcade=20in=20your=20Linux=20terminal=20with=20this=20Pac-ma?= =?UTF-8?q?n=20clone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Linux terminal with this Pac-man clone.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/tech/20181215 Head to the arcade in your Linux terminal with this Pac-man clone.md diff --git a/sources/tech/20181215 Head to the arcade in your Linux terminal with this Pac-man clone.md b/sources/tech/20181215 Head to the arcade in your Linux terminal with this Pac-man clone.md new file mode 100644 index 0000000000..3bd36352a4 --- /dev/null +++ b/sources/tech/20181215 Head to the arcade in your Linux terminal with this Pac-man clone.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Head to the arcade in your Linux terminal with this Pac-man clone) +[#]: via: (https://opensource.com/article/18/12/linux-toy-myman) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Head to the arcade in your Linux terminal with this Pac-man clone +====== +Want to recreate the magic of your favorite arcade game? Today's command-line toy will transport you back in time. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-myman.png?itok=9j1DFgH0) + +Welcome back to another day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what command-line toys are all about. Basically, they're games and simple diversions that help you have fun at the terminal. + +Some are new, and some are old classics. We hope you enjoy. + +Today's toy, MyMan, is a fun clone of the classic arcade game [Pac-Man][1]. (You didn't think this was going to be about the [similarly-named][2] Linux package manager, did you?) If you're anything like me, you spent more than your fair share of quarters trying to hit a high score Pac-Man back in the day, and still give it a go whenever you get a chance. + +MyMan isn't the only Pac-Man clone for the Linux terminal, but it's the one I chose to include because 1) I like its visual style, which rings true to the original and 2) it's conveniently packaged for my Linux distribution so it was an easy install. But you should check out your other options as well. Here's [another one][3] that looks like it may be promising, but I haven't tried it. + +Since MyMan was packaged for Fedora, installation was as simple as: + +``` +$ dnf install myman +``` + +MyMan is made available under an MIT license and you can check out the source code on [SourceForge][4]. +![](https://opensource.com/sites/default/files/uploads/linux-toy-myman-animated.gif) +Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [The Linux terminal is no one-trick pony][5], and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-myman + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Pac-Man +[2]: https://wiki.archlinux.org/index.php/pacman +[3]: https://github.com/YoctoForBeaglebone/pacman4console +[4]: https://myman.sourceforge.io/ +[5]: https://opensource.com/article/18/12/linux-toy-ponysay From d2f845b4078949550748fcb3cfedfe4d8c7989f8 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:08:07 +0800 Subject: [PATCH 0972/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20The=20Linux=20t?= =?UTF-8?q?erminal=20is=20no=20one-trick=20pony?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...The Linux terminal is no one-trick pony.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20181214 The Linux terminal is no one-trick pony.md diff --git a/sources/tech/20181214 The Linux terminal is no one-trick pony.md b/sources/tech/20181214 The Linux terminal is no one-trick pony.md new file mode 100644 index 0000000000..28964b249c --- /dev/null +++ b/sources/tech/20181214 The Linux terminal is no one-trick pony.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Linux terminal is no one-trick pony) +[#]: via: (https://opensource.com/article/18/12/linux-toy-ponysay) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +The Linux terminal is no one-trick pony +====== +Bring the magic of My Little Pony to your Linux command line. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-ponysay.png?itok=ehl6pTr_) + +Welcome to another day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Reader [Lori][1] made the suggestion of today's toy in a comment on my previous article on [cowsay][2]: + +"Hmmm, I've been playing with something called ponysay which seems to be a full-color variant on your cowsay." + +Intrigued, I had to check it out, and I was not disappointed with what I found. + +In a nutshell, **[ponysay][3]** is exactly that: a rewrite of **cowsay** that includes many full-color characters from [My Little Pony][4], that you can use to output phrases at the Linux command line. It's actually a really well-done project, that features over 400 characters and character combinations, and is incredibly well documented in a [78-page PDF][5] covering full usage. + +To install **ponysay** , you'll want to check out the project [README][6] to select the installation method that works best for your distribution and situation. Since ponysay didn't appear to be packaged for my distribution, Fedora, I opted to try out the Docker container image, but do what works best for you; installation from source may also work for you. + +I was curious to try out [**podman**][7] as a drop-in replacement for **docker** for a casual container users, and for me at least, it just worked! + +``` +$ podman run -ti --rm mpepping/ponysay 'Ponytastic' +``` + +The outputs are amazing, and I challenge you to try it out and let me know your favorite. Here was one of mine: + +![](https://opensource.com/sites/default/files/uploads/linux-toy-ponysay-output.png) + +It's developers chose to write the code in [Pony][8]! (Update: Sadly, I was wrong about this. It's written in Python, though GitHub believes it to be Pony because of the file extensions.) Ponysay is licensed under the GPL version 3, and you can pick up its source code [on GitHub][3]. + +Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [Relax by the fire at your Linux terminal][9], and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-ponysay + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/users/n8chz +[2]: https://opensource.com/article/18/12/linux-toy-cowsay +[3]: https://github.com/erkin/ponysay +[4]: https://en.wikipedia.org/wiki/My_Little_Pony +[5]: https://github.com/erkin/ponysay/blob/master/ponysay.pdf?raw=true +[6]: https://github.com/erkin/ponysay/blob/master/README.md +[7]: https://opensource.com/article/18/10/podman-more-secure-way-run-containers +[8]: https://opensource.com/article/18/5/pony +[9]: https://opensource.com/article/18/12/linux-toy-aafire From f58b4fd6bb05818338e59a0ed222dcab7d49a194 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:12:37 +0800 Subject: [PATCH 0973/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Relax=20by=20th?= =?UTF-8?q?e=20fire=20at=20your=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...elax by the fire at your Linux terminal.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sources/tech/20181213 Relax by the fire at your Linux terminal.md diff --git a/sources/tech/20181213 Relax by the fire at your Linux terminal.md b/sources/tech/20181213 Relax by the fire at your Linux terminal.md new file mode 100644 index 0000000000..f9a53fc4c4 --- /dev/null +++ b/sources/tech/20181213 Relax by the fire at your Linux terminal.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Relax by the fire at your Linux terminal) +[#]: via: (https://opensource.com/article/18/12/linux-toy-aafire) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Relax by the fire at your Linux terminal +====== +Chestnuts roasting on an open command prompt? Why not, with this fun Linux toy. + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-aafire.png?itok=pAttiVvG) + +Welcome back. Here we are, just past the halfway mark at day 13 of our 24 days of Linux command-line toys. If this is your first visit to the series, see the link to the previous article at the bottom of this one, and take a look back to learn what it's all about. In short, our command-line toys are anything that's a fun diversion at the terminal. + +Maybe some are familiar, and some aren't. Either way, we hope you have fun. + +If you're in the northern hemisphere outside of the tropics, perhaps winter is starting to rear its frigid face outside. At least it is where I live. And some I'd love nothing more than to curl up by the fire with a cup of tea and my favorite book (or a digital equivalent). + +The bad news is my house lacks a fireplace. The good news is that I can still pretend, thanks to the Linux terminal and today's command-line toy, **aafire**. + +On my system, I found **aafire** packed with **aalib** , a delightful library for converting visual images into the style of ASCII art and making it available at your terminal (or elsewhere). **aalib** enables all sorts of fun graphics at the Linux terminal, so we may revisit a toy or two that make use of it before the end of our series. On Fedora, this meant installation was as simple as: + +``` +$ sudo dnf install aalib +``` + +Then, it was simple to launch with the **aafire** command. By default, **aalib** attempted to draw to my GUI, so I had to manually override it to keep my fire in the terminal (this is a command-line series, after all). Fortunately, it comes with a [curses][1] driver, so this meant I just had to run the following to get my fire going: + +``` +$ aafire -driver curses +``` +![](https://opensource.com/sites/default/files/uploads/linux-toy-aafire-animated.gif) +You can find out more about the **aa-lib** library and download the source on [Sourceforge][2], under an LGPLv2 license. + +Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [Patch into The Matrix at the Linux command line][3] , and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-aafire + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Curses_(programming_library) +[2]: http://aa-project.sourceforge.net/aalib/ +[3]: https://opensource.com/article/18/12/linux-toy-cmatrix From ffdf4eb68ae6fed5fd3ec6a83c4dae451d764ead Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:13:29 +0800 Subject: [PATCH 0974/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Solve=20a=20puz?= =?UTF-8?q?zle=20at=20the=20Linux=20command=20line=20with=20nudoku?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e at the Linux command line with nudoku.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/tech/20181219 Solve a puzzle at the Linux command line with nudoku.md diff --git a/sources/tech/20181219 Solve a puzzle at the Linux command line with nudoku.md b/sources/tech/20181219 Solve a puzzle at the Linux command line with nudoku.md new file mode 100644 index 0000000000..7822a0cb98 --- /dev/null +++ b/sources/tech/20181219 Solve a puzzle at the Linux command line with nudoku.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Solve a puzzle at the Linux command line with nudoku) +[#]: via: (https://opensource.com/article/18/12/linux-toy-nudoku) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Solve a puzzle at the Linux command line with nudoku +====== +Sudokus are simple logic games that can be enjoyed just about anywhere, including in your Linux terminal. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-nudoku.png?itok=OS2o4Rot) + +Welcome back to another installment in our 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Every year for Christmas, my mother-in-law gives my wife a Sudoku calendar. It sits on our coffee table for the year to follow. Each day is a separate sheet (except for Saturday and Sunday, that are combined onto one page), with the idea being that you have a new puzzle every day while also having a functioning calendar. + +The problem, in practice, is that it's a great pad of puzzles but not a great calendar because it turns out some days are harder than others and we just don't get through them at the necessary rate of one a day. Then, we may have a week's worth that gets batched on a lazy Sunday. + +Since I've already given you a [calendar][1] as a part of this series, I figure it's only fair to give you a Sudoku puzzle as well, except our command-line versions are decoupled so there's no pressure to complete exactly one a day. + +I found **nudoku** in my default repositories on Fedora, so installing it was as simple as: + +``` +$ sudo dnf install nudoku +``` + +Once installed, just invoke **nudoku** by name to launch it, and it should be fairly self-explanatory from there. If you've never played Sudoku before, it's fairly simple: You need to make sure that each row, each column, and each of the nine 3x3 squares that make up the large square each have one of every digit, 1-9. + +You can find **nudoku** 's c source code [on GitHub][2] under a GPLv3 license. +![](https://opensource.com/sites/default/files/uploads/linux-toy-nudoku-animated.gif) +Do you have a favorite command-line toy that you we should have included? Our calendar is basically set for the remainder of the series, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Use your Linux terminal to celebrate a banner][3] [year][3], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-nudoku + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/article/18/12/linux-toy-cal +[2]: https://github.com/jubalh/nudoku +[3]: https://opensource.com/article/18/12/linux-toy-figlet From 10c05348c60c871ebdbf8ecd0f7148325613f0dc Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:16:37 +0800 Subject: [PATCH 0975/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Use=20your=20Li?= =?UTF-8?q?nux=20terminal=20to=20celebrate=20a=20banner=20year?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nux terminal to celebrate a banner year.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20181218 Use your Linux terminal to celebrate a banner year.md diff --git a/sources/tech/20181218 Use your Linux terminal to celebrate a banner year.md b/sources/tech/20181218 Use your Linux terminal to celebrate a banner year.md new file mode 100644 index 0000000000..da3f36b00f --- /dev/null +++ b/sources/tech/20181218 Use your Linux terminal to celebrate a banner year.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use your Linux terminal to celebrate a banner year) +[#]: via: (https://opensource.com/article/18/12/linux-toy-figlet) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Use your Linux terminal to celebrate a banner year +====== +Need make sure your command is heard? Pipe it to a banner and it won't be missed. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-figlet.png?itok=o4XmTL-b) + + +Hello again for another installment in our 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Today's toy if **figlet** , a utility for printing text in banner form across your Linux terminal. + +You'll likely find **figlet** packaged in your standard repositories. For me on Fedora, this meant installation was as simple as: + +``` +$ sudo dnf install figlet +``` + +After that, simply use the program's name to invoke it. You can either use it interactively, or, pipe some text to it, as below: + +``` +echo "Hello world" | figlet + _   _      _ _                            _     _ +| | | | ___| | | ___   __      _____  _ __| | __| | +| |_| |/ _ \ | |/ _ \  \ \ /\ / / _ \| '__| |/ _` | +|  _  |  __/ | | (_) |  \ V  V / (_) | |  | | (_| | +|_| |_|\___|_|_|\___/    \_/\_/ \___/|_|  |_|\__,_| +``` + +There are a number of different font options available for **figlet**. To see the options available to you, try the command **showfigfonts**. For me, this displayed over a dozen. I've copied out a few of my favorites below. + +``` +block : +                                            +_|        _|                      _|         +_|_|_|    _|    _|_|      _|_|_|  _|  _|     +_|    _|  _|  _|    _|  _|        _|_|       +_|    _|  _|  _|    _|  _|        _|  _|     +_|_|_|    _|    _|_|      _|_|_|  _|    _|   + + +bubble : +  _   _   _   _   _   _   + / \ / \ / \ / \ / \ / \ +( b | u | b | b | l | e ) + \_/ \_/ \_/ \_/ \_/ \_/ + + +lean : +                                      +    _/                               +   _/    _/_/      _/_/_/  _/_/_/     +  _/  _/_/_/_/  _/    _/  _/    _/   + _/  _/        _/    _/  _/    _/     +_/    _/_/_/    _/_/_/  _/    _/   + + +script : +                          +               o           + ,   __   ,_        _ _|_ +/ \_/    /  |  |  |/ \_|   + \/ \___/   |_/|_/|__/ |_/ +                 /|       +                 \|       +``` + +You can find out more about **figlet** on the project's [homepage][1]. The version I downloaded was made available as open source under an MIT license. + +You'll find that **figlet** isn't the only banner-printer available for the Linux terminal. Another option that you may choose to check out is [toilet][2], which comes with its own set of ASCII-art style printing options. + +Do you have a favorite command-line toy that you we should have included? Our calendar is basically set for the remainder of the series, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Take a swim at your Linux terminal with asciiquarium][3], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-figlet + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: http://www.figlet.org/ +[2]: http://caca.zoy.org/wiki/toilet +[3]: https://opensource.com/article/18/12/linux-toy-asciiquarium From 338b81eae6b865eda25a22f006d52263a63f369c Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:17:50 +0800 Subject: [PATCH 0976/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Take=20a=20swim?= =?UTF-8?q?=20at=20your=20Linux=20terminal=20with=20asciiquarium?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t your Linux terminal with asciiquarium.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md diff --git a/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md b/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md new file mode 100644 index 0000000000..d8253849ea --- /dev/null +++ b/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md @@ -0,0 +1,48 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Take a swim at your Linux terminal with asciiquarium) +[#]: via: (https://opensource.com/article/18/12/linux-toy-asciiquarium) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Take a swim at your Linux terminal with asciiquarium +====== +Darling it's better, when your command line is wetter, thanks to ASCII. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-asciiquarium.png?itok=ZhJ9P2Ft) + +We're now nearing the end of our 24-day-long Linux command-line toys advent calendar. Just one week left after today! If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Today's selection is a fishy one. Say hello to **asciiquarium** , an undersea adventure for your terminal. I found **asciiquarium** in my Fedora repositories, so installing it was as simple as: + +``` +$ sudo dnf install asciiquarium +``` + +If you're running a different distribution, chances are it's packaged for you too. Just run **asciiquarium** at your terminal to feel happy as a clam. The project has been translated outside of the terminal as well, with screensavers of all of the aquatic pals being made for several non-Linux operating systems, and even an Android live wallpaper version is floating around out there. + +Visit the **asciiquarium** [homepage][1] for more information or to download the Perl source code. The project is open source under a GPL version 2 license. And if you want to learn more about how open source, open data, and open science are making a difference in the actual oceans, take a moment to go learn about the [Ocean Health Index][2]. +![](https://opensource.com/sites/default/files/uploads/linux-toy-asciiquarium-animated.gif) +Do you have a favorite command-line toy that you think I ought to profile? We're running out of time, but I'd still love to hear your suggestions. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Schedule a visit with the Emacs psychiatrist][3], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-asciiquarium + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://robobunny.com/projects/asciiquarium/html/ +[2]: https://opensource.com/article/18/12/protecting-world-oceans +[3]: https://opensource.com/article/18/12/linux-toy-eliza From e766f5a3aa5578ff038e74d8010e6489efe83367 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:18:48 +0800 Subject: [PATCH 0977/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Schedule=20a=20?= =?UTF-8?q?visit=20with=20the=20Emacs=20psychiatrist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ule a visit with the Emacs psychiatrist.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md diff --git a/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md b/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md new file mode 100644 index 0000000000..6d72cda348 --- /dev/null +++ b/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Schedule a visit with the Emacs psychiatrist) +[#]: via: (https://opensource.com/article/18/12/linux-toy-eliza) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Schedule a visit with the Emacs psychiatrist +====== +Eliza is a natural language processing chatbot hidden inside of one of Linux's most popular text editors. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-eliza.png?itok=3ioiBik_) + +Welcome to another day of the 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Today's selection is a hidden gem inside of Emacs: Eliza, the Rogerian psychotherapist, a terminal toy ready to listen to everything you have to say. + +A brief aside: While this toy is amusing, your health is no laughing matter. Please take care of yourself this holiday season, physically and mentally, and if stress and anxiety from the holidays are having a negative impact on your wellbeing, please consider seeing a professional for guidance. It really can help. + +To launch [Eliza][1], first, you'll need to launch Emacs. There's a good chance Emacs is already installed on your system, but if it's not, it's almost certainly in your default repositories. + +Since I've been pretty fastidious about keeping this series in the terminal, launch Emacs with the **-nw** flag to keep in within your terminal emulator. + +``` +$ emacs -nw +``` + +Inside of Emacs, type M-x doctor to launch Eliza. For those of you like me from a Vim background who have no idea what this means, just hit escape, type x and then type doctor. Then, share all of your holiday frustrations. + +Eliza goes way back, all the way to the mid-1960s a the MIT Artificial Intelligence Lab. [Wikipedia][2] has a rather fascinating look at her history. + +Eliza isn't the only amusement inside of Emacs. Check out the [manual][3] for a whole list of fun toys. + + +![Linux toy: eliza animated][5] + +Do you have a favorite command-line toy that you think I ought to profile? We're running out of time, but I'd still love to hear your suggestions. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Head to the arcade in your Linux terminal with this Pac-man clone][6], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-eliza + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://www.emacswiki.org/emacs/EmacsDoctor +[2]: https://en.wikipedia.org/wiki/ELIZA +[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Amusements.html +[4]: /file/417326 +[5]: https://opensource.com/sites/default/files/uploads/linux-toy-eliza-animated.gif (Linux toy: eliza animated) +[6]: https://opensource.com/article/18/12/linux-toy-myman From 359ed1745fb21edfd6753183db5196e6dd5ff079 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:58:39 +0800 Subject: [PATCH 0978/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20open?= =?UTF-8?q?=20source=20your=20Python=20library?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to open source your Python library.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20181219 How to open source your Python library.md diff --git a/sources/tech/20181219 How to open source your Python library.md b/sources/tech/20181219 How to open source your Python library.md new file mode 100644 index 0000000000..cf59688484 --- /dev/null +++ b/sources/tech/20181219 How to open source your Python library.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to open source your Python library) +[#]: via: (https://opensource.com/article/18/12/tips-open-sourcing-python-libraries) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +How to open source your Python library +====== +This 12-step checklist will ensure a successful launch. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) + +You wrote a Python library. I'm sure it's amazing! Wouldn't it be neat if it was easy for people to use it? Here is a checklist of things to think about and concrete steps to take when open sourcing your Python library. + +### 1\. Source + +Put the code up on [GitHub][1], where most open source projects happen and where it is easiest for people to submit pull requests. + +### 2\. License + +Choose an open source license. A good, permissive default is the [MIT License][2]. If you have specific requirements, Creative Common's [Choose a License][3] can guide you through the alternatives. Most importantly, there are three rules to keep in mind when choosing a license: + + * Don't create your own license. + * Don't create your own license. + * Don't create your own license. + + + +### 3\. README + +Put a file called README.rst, formatted with ReStructured Text, at the top of your tree. + +GitHub will render ReStructured Text just as well as Markdown, and ReST plays better with Python's documentation ecosystem. + +### 4\. Tests + +Write tests. This is not useful just for you: it is useful for people who want to make patches that avoid breaking related functionality. + +Tests help collaborators collaborate. + +Usually, it is best if they are runnable with [**pytest**][4]. There are other test runners—but very little reason to use them. + +### 5\. Style + +Enforce style with a linter: PyLint, Flake8, or Black with **\--check**. Unless you use Black, make sure to specify configuration options in a file checked into source control. + +### 6\. API documentation + +Use docstrings to document modules, functions, classes, and methods. + +There are a few styles you can use. I prefer the [Google-style docstrings][5], but [ReST docstrings][6] are an option. + +Both Google-style and ReST docstrings can be processed by Sphinx to integrate API documentation with prose documentation. + +### 7\. Prose documentation + +Use [Sphinx][7]. (Read [our article on it][8].) A tutorial is useful, but it is also important to specify what this thing is, what it is good for, what it is bad for, and any special considerations. + +### 8\. Building + +Use **tox** or **nox** to automatically run your tests and linter and build the documentation. These tools support a "dependency matrix." These matrices tend to explode fast, but try to test against a reasonable sample, such as Python versions, versions of dependencies, and possibly optional dependencies you install. + +### 9\. Packaging + +Use [setuptools][9]. Write a **setup.py** and a **setup.cfg**. If you support both Python 2 and 3, specify universal wheels in the **setup.cfg**. + +One thing **tox** or **nox** should do is build a wheel and run tests against the installed wheel. + +Avoid C extensions. If you absolutely need them for performance or binding reasons, put them in a separate package. Properly packaging C extensions deserves its own post. There are a lot of gotchas! + +### 10\. Continuous integration + +### 11\. Versions + +Use a public continuous integration runner. [TravisCI][10] and [CircleCI][11] offer free tiers for open source projects. Configure GitHub or other repo to require passing checks before merging pull requests, and you'll never have to worry about telling people to fix their tests or their style in code reviews. + +Use either [SemVer][12] or [CalVer][13]. There are many tools to help manage versions: [incremental][14], [bumpversion][15], and [setuptools_scm][16] are all packages on PyPI that help manage versions for you. + +### 12\. Release + +Release by running **tox** or **nox** and using **twine** to upload the artifacts to PyPI. You can do a "test upload" by running [DevPI][17]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/tips-open-sourcing-python-libraries + +作者:[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://github.com/ +[2]: https://en.wikipedia.org/wiki/MIT_License +[3]: https://choosealicense.com/ +[4]: https://docs.pytest.org/en/latest/ +[5]: https://github.com/google/styleguide/blob/gh-pages/pyguide.md +[6]: https://www.python.org/dev/peps/pep-0287/ +[7]: http://www.sphinx-doc.org/en/master/ +[8]: https://opensource.com/article/18/11/building-custom-workflows-sphinx +[9]: https://pypi.org/project/setuptools/ +[10]: https://travis-ci.org/ +[11]: https://circleci.com/ +[12]: https://semver.org/ +[13]: https://calver.org/ +[14]: https://pypi.org/project/incremental/ +[15]: https://pypi.org/project/bumpversion/ +[16]: https://pypi.org/project/setuptools_scm/ +[17]: https://opensource.com/article/18/7/setting-devpi From e9e3ac094bea90525634b4f08b161462d1006769 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Fri, 21 Dec 2018 13:21:30 +0800 Subject: [PATCH 0979/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20180604 4 Firefox extensions worth checking out.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180604 4 Firefox extensions worth checking out.md b/sources/tech/20180604 4 Firefox extensions worth checking out.md index 2091afe6fe..2e6a22274b 100644 --- a/sources/tech/20180604 4 Firefox extensions worth checking out.md +++ b/sources/tech/20180604 4 Firefox extensions worth checking out.md @@ -1,3 +1,4 @@ +translated by lixinyuxx 4 Firefox extensions worth checking out ====== From c4788d46b1fc35b33b06c2397da23534f0b3502a Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Fri, 21 Dec 2018 14:17:20 +0800 Subject: [PATCH 0980/1143] Update 20180419 5 guiding principles you should know before you design a microservice.md --- ...rinciples you should know before you design a microservice.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20180419 5 guiding principles you should know before you design a microservice.md b/sources/talk/20180419 5 guiding principles you should know before you design a microservice.md index a74dbd26af..fae228867e 100644 --- a/sources/talk/20180419 5 guiding principles you should know before you design a microservice.md +++ b/sources/talk/20180419 5 guiding principles you should know before you design a microservice.md @@ -1,3 +1,4 @@ +translated by lixinyuxx 5 guiding principles you should know before you design a microservice ====== From 31ee603fe7cf978b0ea2410df44ea905197c2518 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Fri, 21 Dec 2018 14:20:51 +0800 Subject: [PATCH 0981/1143] Update 20180625 The life cycle of a software bug.md --- sources/tech/20180625 The life cycle of a software bug.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180625 The life cycle of a software bug.md b/sources/tech/20180625 The life cycle of a software bug.md index cacceb7a15..0f45d7a355 100644 --- a/sources/tech/20180625 The life cycle of a software bug.md +++ b/sources/tech/20180625 The life cycle of a software bug.md @@ -1,3 +1,4 @@ +translated by lixinyuxx The life cycle of a software bug ====== From aa63af0092018b6e5e0c14a259c6985907039a05 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Fri, 21 Dec 2018 14:24:38 +0800 Subject: [PATCH 0982/1143] Update 20180319 6 common questions about agile development practices for teams.md --- ...mmon questions about agile development practices for teams.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20180319 6 common questions about agile development practices for teams.md b/sources/talk/20180319 6 common questions about agile development practices for teams.md index 0de7cda81c..ef472374b4 100644 --- a/sources/talk/20180319 6 common questions about agile development practices for teams.md +++ b/sources/talk/20180319 6 common questions about agile development practices for teams.md @@ -1,3 +1,4 @@ +translated by lixinyuxx 6 common questions about agile development practices for teams ====== From ae65416d979ac55a7820ed6f6b5e8c27e68afb78 Mon Sep 17 00:00:00 2001 From: jlztan Date: Fri, 21 Dec 2018 16:04:26 +0800 Subject: [PATCH 0983/1143] =?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 --- ...at is PPA- Everything You Need to Know About PPA in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md b/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md index 194dc31ef3..d0132aebf8 100644 --- a/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md +++ b/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (jlztan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4219fe486ee2ab37f312740be93e7373ec5ee6bc Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:18:33 +0800 Subject: [PATCH 0984/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Tips=20for=20us?= =?UTF-8?q?ing=20Flood=20Element=20for=20performance=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g Flood Element for performance testing.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20181214 Tips for using Flood Element for performance testing.md diff --git a/sources/tech/20181214 Tips for using Flood Element for performance testing.md b/sources/tech/20181214 Tips for using Flood Element for performance testing.md new file mode 100644 index 0000000000..90994b0724 --- /dev/null +++ b/sources/tech/20181214 Tips for using Flood Element for performance testing.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tips for using Flood Element for performance testing) +[#]: via: (https://opensource.com/article/18/12/tips-flood-element-testing) +[#]: author: (Nicole van der Hoeven https://opensource.com/users/nicolevanderhoeven) + +Tips for using Flood Element for performance testing +====== +Get started with this powerful, intuitive load testing tool. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_sysadmin_cloud.png?itok=sUciG0Cn) + +In case you missed it, there’s a new performance test tool on the block: [Flood Element][1]. It’s a scalable, browser-based tool that allows you to write scripts in JavaScript that interact with web pages like a real user would. + +Browser Level Users is a [newer approach to load testing][2] that overcomes many of the common challenges we hear about traditional methods of testing. It offers: + + * Scripting that is akin to common functional tools like Selenium and easier to learn + * More realistic results that are based on true browser performance rather than API response + * The ability to test against all components of your web app, including things like JavaScript that are rendered via the browser + + + +Given the above benefits, it’s a no-brainer to check out Flood Element for your web load testing, especially if you have struggled with existing tools like JMeter or HP LoadRunner. + +Pairing Element with [Flood][3] turns it into a pretty powerful load test tool. We have a [great guide here][4] that you can follow if you’d like to get started. I’ve been using and testing Element for several months now, and I’d like to share some tips I’ve learned along the way. + +### Initializing your script + +You can always start from scratch, but the quickest way to get started is to type `element init myfirstelementtest` from your terminal, filling in your preferred project name. + +You’ll then be asked to type the title of your test as well as the URL you’d like to script against. After a minute, you’ll see that a new directory has been created: + +![](https://opensource.com/sites/default/files/uploads/image_1_-_new_directory.png) + +Element will automatically create a file called **test.ts**. This file contains the skeleton of a script, along with some sample code to help you find a button and then click on it. But before you open it, let’s move on to… + +### Choosing the right text editor + +Scripting in Element is already pretty simple, but two things that help are syntax highlighting and code completion. Syntax highlighting will greatly improve the experience of learning a new test tool like Element, and code completion will make your scripting lightning-fast as you become more experienced. My text editor of choice is [Visual Studio Code][5], which has both of those features. It’s slick and clean, and it does the job. + +Syntax highlighting is when the text editor intelligently changes the font color of your code according to its role in the programming language you’re using. Here’s a screenshot of the **test.ts** file we generated earlier in VS Code to show you what I mean: + +![](https://opensource.com/sites/default/files/uploads/image_2_test.ts_.png) + +This makes it easier to make sense of the code at a glance: Comments are in green, values and labels are in orange, etc. + +Code completion is when you start to type something, and VS Code helpfully opens a context menu with suggestions for methods you can use. + +![][6] + +I love this because it means I don’t need to remember the exact name of the method. It also suggests names of variables you’ve already defined and highlights code that doesn’t make sense. This will help to make your tests more maintainable and readable for others, which is a great benefit as you look to scale your testing out in the future. + +![](https://opensource.com/sites/default/files/image-4-element-visible-copy.gif) + +### Taking screenshots + +One of the most powerful features of Element is its ability to take screenshots. I find it immensely useful when debugging because sometimes it’s just easier to see what’s going on visually. With protocol-based tools, debugging can be a much more involved and technical process. + +There are two ways to take screenshots in Element: + + 1. Add a setting to automatically take a screenshot when an error is encountered. You can do this by setting `screenshotOnFailure` to "true" in `TestSettings`: + + + +``` +export const settings: TestSettings = { +        device: Device.iPadLandscape, +        userAgent: 'flood-chrome-test', +        clearCache: true, +        disableCache: true, +        screenshotOnFailure: true, +} +``` + + 2. Explicitly take a screenshot at a particular point in the script. You can do this by adding + + + +``` +await browser.takeScreenshot() +``` + +to your code. + +### Viewing screenshots + +Once you’ve taken screenshots within your tests, you will probably want to view them and know that they will be stored for future safekeeping. Whether you are running your test locally on have uploaded it to Flood to run with increased concurrency, Flood Element has you covered. + +**Locally run tests** + +Screenshots will be saved as .jpg files in a timestamped folder corresponding to your run. It should look something like this: **…myfirstelementtest/tmp/element-results/test/2018-11-20T135700.595Z/flood/screenshots/**. The screenshots will be uniquely named so that new screenshots, even for the same step, don’t overwrite older ones. + +However, I rarely need to look up the screenshots in that folder because I prefer to see them in iTerm2 for MacOS. iTerm is an alternative to the terminal that works particularly well with Element. When you take a screenshot, iTerm actually shows it in-line: + +![](https://opensource.com/sites/default/files/uploads/image_5_iterm_inline.png) + +**Tests run in Flood** + +Running an Element script on Flood is ideal when you need larger concurrency. Rather than accessing your screenshot locally, Flood will centralize the images into your account, so the images remain even after the cloud load injectors are destroyed. You can get to the screenshot files by downloading Archived Results: + +![](https://opensource.com/sites/default/files/image_6_archived_results.png) + +You can also click on a step on the dashboard to see a filmstrip of your test: + +![](https://opensource.com/sites/default/files/uploads/image_7_filmstrip_view.png) + +### Using logs + +You may need to check out the logs for more technical debugging, especially when the screenshots don’t tell the whole story. Again, whether you are running your test locally or have uploaded it to Flood to run with increased concurrency, Flood Element has you covered. + +**Locally run tests** + +You can print to the console by typing, for example: `console.log('orderValues = ’ + orderValues)` + +This will print the value of the variable `orderValues` at that point in the script. You would see this in your terminal if you’re running Element locally. + +**Tests run in Flood** + +If you’re running the script on Flood, you can either download the log (in the same Archived Results zipped file mentioned earlier) or click on the Logs tab: + +![](https://opensource.com/sites/default/files/uploads/image_8_logs_tab.png) + +### Fun with flags + +Element comes with a few flags that give you more control over how the script is run locally. Here are a few of my favorites: + +**Headless flag** + +When in doubt, run Element in non-headless mode to see the script actually opening the web app on Chrome and interacting with the page. This is only possible locally, but there’s nothing like actually seeing for yourself what’s happening in real time instead of relying on screenshots and logs after the fact. To enable this mode, add the flag when running your test: + +``` +element run myfirstelementtest.ts --no-headless +``` + +**Watch flag** + +Element will automatically close the browser window when it encounters an error or finishes the iteration. Adding `--watch` will leave the browser window open and then monitor the script. As soon as the script is saved, it will automatically run it in the same window from the beginning. Simply add this flag like the above example: + +``` +--watch +``` + +**Dev tools flag** + +This opens a browser instance and runs the script with the Chrome Dev Tools open, allowing you to find locators for the next action you want to script. Simply add this flag as in the first example: + +``` +--dev-tools +``` + +For more flags, use `element run --help`. + +### Try Element + +You’ve just gotten a crash course on Flood Element and are ready to get started. [Download Element][1] to start writing functional test scripts and reusing them as load test scripts on Flood. If you don’t have a Flood account, you can easily sign up for a free trial [on the Flood website][7]. + +We’re proud to contribute to the open source community and can’t wait to have you try this new addition to the Flood line. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/tips-flood-element-testing + +作者:[Nicole van der Hoeven][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/nicolevanderhoeven +[b]: https://github.com/lujun9972 +[1]: https://element.flood.io/ +[2]: https://flood.io/blog/why-you-should-load-test-with-browsers/ +[3]: https://flood.io/ +[4]: https://help.flood.io/getting-started-with-load-testing/step-by-step-guide-flood-element +[5]: https://code.visualstudio.com/ +[6]: https://flood.io/wp-content/uploads/2018/11/vscode-codecompletion2.gif +[7]: https://flood.io/load-performance-testing-tool/free-load-testing-trial/ From cedb354f0f0a64212d1656705e6c1824d7e63683 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:19:41 +0800 Subject: [PATCH 0985/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=208=20tips=20to?= =?UTF-8?q?=20help=20non-techies=20move=20to=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... tips to help non-techies move to Linux.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/talk/20181217 8 tips to help non-techies move to Linux.md diff --git a/sources/talk/20181217 8 tips to help non-techies move to Linux.md b/sources/talk/20181217 8 tips to help non-techies move to Linux.md new file mode 100644 index 0000000000..14a645e0a7 --- /dev/null +++ b/sources/talk/20181217 8 tips to help non-techies move to Linux.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 tips to help non-techies move to Linux) +[#]: via: (https://opensource.com/article/18/12/help-non-techies) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +8 tips to help non-techies move to Linux +====== +Help your friends dump their proprietary operating systems and make the move to open source. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_team_community_group.png?itok=Nc_lTsUK) + +Back in 2016, I took down the shingle for my technology coaching business. Permanently. Or so I thought. + +Over the last 10 months, a handful of friends and acquaintances have pulled me back into that realm. How? With their desire to dump That Other Operating System™ and move to Linux. + +This has been an interesting experience, in no small part because most of the people aren't at all technical. They know how to use a computer to do what they need to do. Beyond that, they're not interested in delving deeper. That said, they were (and are) attracted to Linux for a number of reasons—probably because I constantly prattle on about it. + +While bringing them to the Linux side of the computing world, I learned a few things about helping non-techies move to Linux. If someone asks you to help them make the jump to Linux, these eight tips can help you. + +### 1\. Be honest about Linux. + +Linux is great. It's not perfect, though. It can be perplexing and sometimes frustrating for new users. It's best to prepare the person you're helping with a short pep talk. + +What should you talk about? Briefly explain what Linux is and how it differs from other operating systems. Explain what you can and _can't_ do with it. Let them know some of the pain points they might encounter when using Linux daily. + +If you take a bit of time to [ease them into][1] Linux and open source, the switch won't be as jarring. + +### 2\. It's not about you. + +It's easy to fall into what I call the _power user fallacy_ : the idea that everyone uses technology the same way you do. That's rarely, if ever, the case. + +This isn't about you. It's not about your needs or how you use a computer. It's about the person you're helping's needs and intentions. Their needs, especially if they're not particularly technical, will be different from yours. + +It doesn't matter if Ubuntu or Elementary or Manjaro aren't your distros of choice. It doesn't matter if you turn your nose up at window managers like GNOME, KDE, or Pantheon in favor of i3 or Ratpoison. The person you're helping might think otherwise. + +Put your needs and prejudices aside and help them find the right Linux distribution for them. Find out what they use their computer for and tailor your recommendations for a distribution or three based on that. + +### 3\. Not everyone's a techie. + +And not everyone wants to be. Everyone I've helped move to Linux in the last 10 months has no interest in compiling kernels or code nor in editing and tweaking configuration files. Most of them will never crack open a terminal window. I don't expect them to be interested in doing any of that in the future, either. + +Guess what? There's nothing wrong with that. Maybe they won't _get the most out of_ Linux (whatever that means) by not embracing their inner geeks. Not everyone will want to take on challenges of, say, installing and configuring Slackware or Arch. They need something that will work out of the box. + +### 4\. Take stock of their hardware. + +In an ideal world, we'd all have tricked-out, high-powered laptops or desktops with everything maxed out. Sadly, that world doesn't exist. + +That probably includes the person you're helping move to Linux. They may have slightly (maybe more than slightly) older hardware that they're comfortable with and that works for them. Hardware that they might not be able to afford to upgrade or replace. + +Also, remember that not everyone needs a system for heavy-duty development or gaming or audio and video production. They just need a computer for browsing the web, editing photos, running personal productivity software, and the like. + +One person I recently helped adopt Linux had an Acer Aspire 1 laptop with 4GB of RAM and a 64GB SSD. That helped inform my recommendations, which revolved around a few lightweight Linux distributions. + +### 5\. Help them test-drive some distros. + +The [DistroWatch][2] database contains close to 900 Linux distributions. You should be able to find three to five Linux distributions to recommend. Make a short list of the distributions you think would be a good fit for them. Also, point them to reviews so they can get other perspectives on those distributions. + +When it comes time to take those Linux distributions for a spin, don't just hand someone a bunch of flash drives and walk away. You might be surprised to learn that most people have never run a live Linux distribution or installed an operating system. Any operating system. Beyond plugging the flash drives in, they probably won't know what to do. + +Instead, show them how to [create bootable flash drives][3] and set up their computer's BIOS to start from those drives. Then, let them spend some time running the distros off the flash drives. That will give them a rudimentary feel for the distros and their window managers' quirks. + +### 6\. Walk them through an installation. + +Running a live session with a flash drive tells someone only so much. They need to work with a Linux distribution for a couple or three weeks to really form an opinion of it and to understand its quirks and strengths. + +There's a myth that Linux is difficult to install. That might have been true back in the mid-1990s, but today most Linux distributions are easy to install. You follow a few graphical prompts and let the software do the rest. + +For someone who's never installed any operating system, installing Linux can be a bit daunting. They might not know what to choose when, say, they're asked which filesystem to use or whether or not to encrypt their hard disk. + +Guide them through at least one installation. While you should let them do most of the work, be there to answer questions. + +### 7\. Be prepared to do a couple of installs. + +As I mentioned a paragraph or two ago, using a Linux distribution for two weeks gives someone ample time to regularly interact with it and see if it can be their daily driver. It often works out. Sometimes, though, it doesn't. + +Remember the person with the Acer Aspire 1 laptop? She thought Xubuntu was the right distribution for her. After a few weeks of working with it, that wasn't the case. There wasn't a technical reason—Xubuntu ran smoothly on her laptop. It was just a matter of feel. Instead, she switched back to the first distro she test drove: [MX Linux][4]. She's been happily using MX ever since. + +### 8\. Teach them to fish. + +You can't always be there to be the guiding hand. Or to be the mechanic or plumber who can fix any problems the person encounters. You have a life, too. + +Once they've settled on a Linux distribution, explain that you'll offer a helping hand for two or three weeks. After that, they're on their own. Don't completely abandon them. Be around to help with big problems, but let them know they'll have to learn to do things for themselves. + +Introduce them to websites that can help them solve their problems. Point them to useful articles and books. Doing that will help make them more confident and competent users of Linux—and of computers and technology in general. + +### Final thoughts + +Helping someone move to Linux from another, more familiar operating system can be a challenge—a challenge for them and for you. If you take it slowly and follow the advice in this article, you can make the process smoother. + +Do you have other tips for helping a non-techie switch to Linux? Feel free to share them by leaving a comment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/help-non-techies + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/business/15/2/ato2014-lightning-talks-scott-nesbitt +[2]: https://distrowatch.com +[3]: https://opensource.com/article/18/7/getting-started-etcherio +[4]: https://opensource.com/article/18/2/mx-linux-17-distro-beginners From bb8278b5a0f8eb7b68e066c86a7d1a68467f51cc Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:21:18 +0800 Subject: [PATCH 0986/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20The=20Rise=20an?= =?UTF-8?q?d=20Demise=20of=20RSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20181218 The Rise and Demise of RSS.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/talk/20181218 The Rise and Demise of RSS.md diff --git a/sources/talk/20181218 The Rise and Demise of RSS.md b/sources/talk/20181218 The Rise and Demise of RSS.md new file mode 100644 index 0000000000..e260070c5c --- /dev/null +++ b/sources/talk/20181218 The Rise and Demise of RSS.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Rise and Demise of RSS) +[#]: via: (https://twobithistory.org/2018/12/18/rss.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +The Rise and Demise of RSS +====== + +This post was originally published on [September 16th, 2018][1]. What follows is a revision that includes additional information gleaned from interviews with Ramanathan Guha, Ian Davis, Dan Libby, and Kevin Werbach. + +About a decade ago, the average internet user might well have heard of RSS. Really Simple Syndication, or Rich Site Summary—what the acronym stands for depends on who you ask—is a standard that websites and podcasts can use to offer a feed of content to their users, one easily understood by lots of different computer programs. Today, though RSS continues to power many applications on the web, it has become, for most people, an obscure technology. + +The story of how this happened is really two stories. The first is a story about a broad vision for the web’s future that never quite came to fruition. The second is a story about how a collaborative effort to improve a popular standard devolved into one of the most contentious forks in the history of open-source software development. + +In the late 1990s, in the go-go years between Netscape’s IPO and the Dot-com crash, everyone could see that the web was going to be an even bigger deal than it already was, even if they didn’t know exactly how it was going to get there. One theory was that the web was about to be revolutionized by syndication. The web, originally built to enable a simple transaction between two parties—a client fetching a document from a single host server—would be broken open by new standards that could be used to repackage and redistribute entire websites through a variety of channels. Kevin Werbach, writing for Release 1.0, a newsletter influential among investors in the 1990s, predicted that syndication “would evolve into the core model for the Internet economy, allowing businesses and individuals to retain control over their online personae while enjoying the benefits of massive scale and scope.” + +He invited his readers to imagine a future in which fencing aficionados, rather than going directly to an “online sporting goods site” or “fencing equipment retailer,” could buy a new épée directly through e-commerce widgets embedded into their favorite website about fencing. Just like in the television world, where big networks syndicate their shows to smaller local stations, syndication on the web would allow businesses and publications to reach consumers through a multitude of intermediary sites. This would mean, as a corollary, that consumers would gain significant control over where and how they interacted with any given business or publication on the web. + +RSS was one of the standards that promised to deliver this syndicated future. To Werbach, RSS was “the leading example of a lightweight syndication protocol.” Another contemporaneous article called RSS the first protocol to realize the potential of XML. It was going to be a way for both users and content aggregators to create their own customized channels out of everything the web had to offer. And yet, two decades later, after the rise of social media and Google’s decision to shut down Google Reader, RSS appears to be [a slowly dying technology][2], now used chiefly by podcasters, programmers with tech blogs, and the occasional journalist. Though of course some people really do still rely on RSS readers, stubbornly adding an RSS feed to your blog, even in 2018, is a political statement. That little tangerine bubble has become a wistful symbol of defiance against a centralized web increasingly controlled by a handful of corporations, a web that hardly resembles the syndicated web of Werbach’s imagining. + +The future once looked so bright for RSS. What happened? Was its downfall inevitable, or was it precipitated by the bitter infighting that thwarted the development of a single RSS standard? + +### Muddied Water + +RSS was invented twice. This meant it never had an obvious owner, a state of affairs that spawned endless debate and acrimony. But it also suggests that RSS was an important idea whose time had come. + +In 1998, Netscape was struggling to envision a future for itself. Its flagship product, the Netscape Navigator web browser—once preferred by over 80 percent of web users—was quickly losing ground to Microsoft’s Internet Explorer. So Netscape decided to compete in a new arena. In May, a team was brought together to start work on what was known internally as “Project 60.” Two months later, Netscape announced “My Netscape,” a web portal that would fight it out with other portals like Yahoo, MSN, and Excite. + +The following year, in March, Netscape announced an addition to the My Netscape portal called the “My Netscape Network.” My Netscape users could now customize their My Netscape page so that it contained “channels” featuring the most recent headlines from sites around the web. As long as your favorite website published a special file in a format dictated by Netscape, you could add that website to your My Netscape page, typically by clicking an “Add Channel” button that participating websites were supposed to add to their interfaces. A little box containing a list of linked headlines would then appear. + +![A My Netscape Network Channel][3] A My Netscape Network channel for Mozilla.org, as it might look to users +about to add it to their My Netscape page. + +The special file that participating websites had to publish was an RSS file. In the My Netscape Network announcement, Netscape explained that RSS stood for “RDF Site Summary.” This was somewhat of a misnomer. RDF, or the Resource Description Framework, is basically a grammar for describing certain properties of arbitrary resources. (See [my article about the Semantic Web][4] if that sounds really exciting to you.) In 1999, a draft specification for RDF was being considered by the World Wide Web Consortium (W3C), the web’s main standards body. Though RSS was supposed to be based on RDF, the example RSS document Netscape actually released didn’t use any RDF tags at all. In a document that accompanied the Netscape RSS specification, Dan Libby, one of the specification’s authors, explained that “in this release of MNN, Netscape has intentionally limited the complexity of the RSS format.” The specification was given the 0.90 version number, the idea being that subsequent versions would bring RSS more in line with the W3C’s XML specification and the evolving draft of the RDF specification. + +RSS had been created by Libby and two other Netscape employees, Eckart Walther and Ramanathan Guha. According to an email to me from Guha, he and Walther cooked up RSS in the beginning with some input from Libby; after AOL bought Netscape in 1998, he and Walther left and it became Libby’s responsibility. Before Netscape, Guha had worked for Apple, where he came up with something called the Meta Content Framework. MCF was a format for representing metadata about anything from web pages to local files. Guha demonstrated its power by developing an application called [HotSauce][5] that visualized relationships between files as a network of nodes suspended in 3D space. Immediately after leaving Apple for Netscape, Guha worked with a Netscape consultant named Tim Bray, who in a post on his blog said that he and Guha eventually produced an XML-based version of MCF that in turn became the foundation for the W3C’s RDF draft. It’s no surprise, then, that Guha, Walther, and Libby were keen to build on Guha’s prior work and incorporate RDF into RSS. But Libby later wrote that the original vision for an RDF-based RSS was pared back because of time constraints and the perception that RDF was “‘too complex’ for the ‘average user.’” + +While Netscape was trying to win eyeballs in what became known as the “portal wars,” elsewhere on the web a new phenomenon known as “weblogging” was being pioneered. One of these pioneers was Dave Winer, CEO of a company called UserLand Software, which developed early content management systems that made blogging accessible to people without deep technical fluency. Winer ran his own blog, [Scripting News][6], which today is one of the oldest blogs on the internet. More than a year before Netscape announced My Netscape Network, on December 15, 1997, Winer published a post announcing that the blog would now be available in XML as well as HTML. + +Dave Winer’s XML format became known as the Scripting News format. It was supposedly similar to Microsoft’s Channel Definition Format (a “push technology” standard submitted to the W3C in March, 1997), but I haven’t been able to find a file in the original format to verify that claim. Like Netscape’s RSS, it structured the content of Winer’s blog so that it could be understood by other software applications. When Netscape released RSS 0.90, Winer and UserLand Software began to support both formats. But Winer believed that Netscape’s format was “woefully inadequate” and “missing the key thing web writers and readers need.” It could only represent a list of links, whereas the Scripting News format could represent a series of paragraphs, each containing one or more links. + +In June 1999, two months after Netscape’s My Netscape Network announcement, Winer introduced a new version of the Scripting News format, called ScriptingNews 2.0b1. Winer claimed that he decided to move ahead with his own format only after trying but failing to get anyone at Netscape to care about RSS 0.90’s deficiencies. The new version of the Scripting News format added several items to the `
          ` element that brought the Scripting News format to parity with RSS. But the two formats continued to differ in that the Scripting News format, which Winer nicknamed the “fat” syndication format, could include entire paragraphs and not just links. + +Netscape got around to releasing RSS 0.91 the very next month. The updated specification was a major about-face. RSS no longer stood for “RDF Site Summary”; it now stood for “Rich Site Summary.” All the RDF—and there was almost none anyway—was stripped out. Many of the Scripting News tags were incorporated. In the text of the new specification, Libby explained: + +> RDF references removed. RSS was originally conceived as a metadata format providing a summary of a website. Two things have become clear: the first is that providers want more of a syndication format than a metadata format. The structure of an RDF file is very precise and must conform to the RDF data model in order to be valid. This is not easily human-understandable and can make it difficult to create useful RDF files. The second is that few tools are available for RDF generation, validation and processing. For these reasons, we have decided to go with a standard XML approach. + +Winer was enormously pleased with RSS 0.91, calling it “even better than I thought it would be.” UserLand Software adopted it as a replacement for the existing ScriptingNews 2.0b1 format. For a while, it seemed that RSS finally had a single authoritative specification. + +### The Great Fork + +A year later, the RSS 0.91 specification had become woefully inadequate. There were all sorts of things people were trying to do with RSS that the specification did not address. There were other parts of the specification that seemed unnecessarily constraining—each RSS channel could only contain a maximum of 15 items, for example. + +By that point, RSS had been adopted by several more organizations. Other than Netscape, which seems to have lost interest after RSS 0.91, the big players were Dave Winer’s UserLand Software; O’Reilly Net, which ran an RSS aggregator called Meerkat; and Moreover.com, which also ran an RSS aggregator focused on news. Via mailing list, representatives from these organizations and others regularly discussed how to improve on RSS 0.91. But there were deep disagreements about what those improvements should look like. + +The mailing list in which most of the discussion occurred was called the Syndication mailing list. [An archive of the Syndication mailing list][7] is still available. It is an amazing historical resource. It provides a moment-by-moment account of how those deep disagreements eventually led to a political rupture of the RSS community. + +On one side of the coming rupture was Winer. Winer was impatient to evolve RSS, but he wanted to change it only in relatively conservative ways. In June, 2000, he published his own RSS 0.91 specification on the UserLand website, meant to be a starting point for further development of RSS. It made no significant changes to the 0.91 specification published by Netscape. Winer claimed in a blog post that accompanied his specification that it was only a “cleanup” documenting how RSS was actually being used in the wild, which was needed because the Netscape specification was no longer being maintained. In the same post, he argued that RSS had succeeded so far because it was simple, and that by adding namespaces (a way to explicitly distinguish between different RSS vocabularies) or RDF back to the format—some had suggested this be done in the Syndication mailing list—it “would become vastly more complex, and IMHO, at the content provider level, would buy us almost nothing for the added complexity.” In a message to the Syndication mailing list sent around the same time, Winer suggested that these issues were important enough that they might lead him to create a fork: + +> I’m still pondering how to move RSS forward. I definitely want ICE-like stuff in RSS2, publish and subscribe is at the top of my list, but I am going to fight tooth and nail for simplicity. I love optional elements. I don’t want to go down the namespaces and schema road, or try to make it a dialect of RDF. I understand other people want to do this, and therefore I guess we’re going to get a fork. I have my own opinion about where the other fork will lead, but I’ll keep those to myself for the moment at least. + +Arrayed against Winer were several other people, including Rael Dornfest of O’Reilly, Ian Davis (responsible for a search startup called Calaba), and a precocious, 14-year-old Aaron Swartz. This is the same Aaron Swartz that would later co-found Reddit and become famous for his hacktivism. (In 2000, according to an email to me from Davis, his dad often accompanied him to technology meetups.) Dornfest, Davis, and Swartz all thought that RSS needed namespaces in order to accommodate the many different things everyone wanted to do with it. On another mailing list hosted by O’Reilly, Davis proposed a namespace-based module system, writing that such a system would “make RSS as extensible as we like rather than packing in new features that over-complicate the spec.” The “namespace camp” believed that RSS would soon be used for much more than the syndication of blog posts, so namespaces, rather than being a complication, were the only way to keep RSS from becoming unmanageable as it supported more and more use cases. + +At the root of this disagreement about namespaces was a deeper disagreement about what RSS was even for. Winer had invented his Scripting News format to syndicate the posts he wrote for his blog. Netscape had released RSS as “RDF Site Summary” because it was a way of recreating a site in miniature within the My Netscape online portal. Some people felt that Netscape’s original vision should be honored. Writing to the Syndication mailing list, Davis explained his view that RSS was “originally conceived as a way of building mini sitemaps,” and that now he and others wanted to expand RSS “to encompass more types of information than simple news headlines and to cater for the new uses of RSS that have emerged over the last 12 months.” This was a sensible point to make because the goal of the Netscape RSS project in the beginning was even loftier than Davis suggests: Guha told me that he wanted to create a technology that could support not just website channels but feeds about arbitrary entities such as, for example, Madonna. Further developing RSS so that it could do this would indeed be in keeping with that original motivation. But Davis’ argument also overstates the degree to which there was a unified vision at Netscape by the time the RSS specification was published. According to Libby, who I talked to via email, there was eventually contention between a “Let’s Build the Semantic Web” group and “Let’s Make This Simple for People to Author” group even within Netscape. + +For his part, Winer argued that Netscape’s original goals were irrelevant because his Scripting News format was in fact the first RSS and it had been meant for a very different purpose. Given that the people most involved in the development of RSS disagreed about who had created RSS and why, a fork seems to have been inevitable. + +The fork happened after Dornfest announced a proposed RSS 1.0 specification and formed the RSS-DEV Working Group—which would include Davis, Swartz, and several others but not Winer—to get it ready for publication. In the proposed specification, RSS once again stood for “RDF Site Summary,” because RDF had been added back in to represent metadata properties of certain RSS elements. The specification acknowledged Winer by name, giving him credit for popularizing RSS through his “evangelism.” But it also argued that RSS could not be improved in the way that Winer was advocating. Just adding more elements to RSS without providing for extensibility with a module system would “sacrifice scalability.” The specification went on to define a module system for RSS based on XML namespaces. + +Winer felt that it was “unfair” that the RSS-DEV Working Group had arrogated the “RSS 1.0” name for themselves. In another mailing list about decentralization, he wrote that he had “recently had a standard stolen by a big name,” presumably meaning O’Reilly, which had convened the RSS-DEV Working Group. Other members of the Syndication mailing list also felt that the RSS-DEV Working Group should not have used the name “RSS” without unanimous agreement from the community on how to move RSS forward. But the Working Group stuck with the name. Dan Brickley, another member of the RSS-DEV Working Group, defended this decision by arguing that “RSS 1.0 as proposed is solidly grounded in the original RSS vision, which itself had a long heritage going back to MCF (an RDF precursor) and related specs (CDF etc).” He essentially felt that the RSS 1.0 effort had a better claim to the RSS name than Winer did, since RDF had originally been a part of RSS. The RSS-DEV Working Group published a final version of their specification in December. That same month, Winer published his own improvement to RSS 0.91, which he called RSS 0.92, on UserLand’s website. RSS 0.92 made several small optional improvements to RSS, among which was the addition of the `` tag soon used by podcasters everywhere. RSS had officially forked. + +The fork might have been avoided if a better effort had been made to include Winer in the RSS-DEV Working Group. He obviously belonged there. He was a prominent contributor to the Syndication mailing list and responsible for much of RSS’ popularity, as the members of the Working Group themselves acknowledged. But, as Davis wrote in an email to me, Winer “wanted control and wanted RSS to be his legacy so was reluctant to work with us.” Tim O’Reilly, founder and CEO of O’Reilly, explained in a UserLand discussion group in September, 2000 that Winer basically refused to participate: + +> A group of people involved in RSS got together to start thinking about its future evolution. Dave was part of the group. When the consensus of the group turned in a direction he didn’t like, Dave stopped participating, and characterized it as a plot by O’Reilly to take over RSS from him, despite the fact that Rael Dornfest of O’Reilly was only one of about a dozen authors of the proposed RSS 1.0 spec, and that many of those who were part of its development had at least as long a history with RSS as Dave had. + +To this, Winer said: + +> I met with Dale [Dougherty] two weeks before the announcement, and he didn’t say anything about it being called RSS 1.0. I spoke on the phone with Rael the Friday before it was announced, again he didn’t say that they were calling it RSS 1.0. The first I found out about it was when it was publicly announced. +> +> Let me ask you a straight question. If it turns out that the plan to call the new spec “RSS 1.0” was done in private, without any heads-up or consultation, or for a chance for the Syndication list members to agree or disagree, not just me, what are you going to do? +> +> UserLand did a lot of work to create and popularize and support RSS. We walked away from that, and let your guys have the name. That’s the top level. If I want to do any further work in Web syndication, I have to use a different name. Why and how did that happen Tim? + +I have not been able to find a discussion in the Syndication mailing list about using the RSS 1.0 name prior to the announcement of the RSS 1.0 proposal. Winer, in a message to me, said that he was not trying to control RSS and just wanted to use it in his products. + +RSS would fork again in 2003, when several developers frustrated with the bickering in the RSS community sought to create an entirely new format. These developers created Atom, a format that did away with RDF but embraced XML namespaces. Atom would eventually be specified by [a proposed IETF standard][8]. After the introduction of Atom, there were three competing versions of RSS: Winer’s RSS 0.92 (updated to RSS 2.0 in 2002 and renamed “Really Simple Syndication”), the RSS-DEV Working Group’s RSS 1.0, and Atom. + +### Decline + +The proliferation of competing RSS specifications may have hampered RSS in other ways that I’ll discuss shortly. But it did not stop RSS from becoming enormously popular during the 2000s. By 2004, the New York Times had started offering its headlines in RSS and had written an article explaining to the layperson what RSS was and how to use it. Google Reader, the RSS aggregator ultimately used by millions, was launched in 2005. By 2013, RSS seemed popular enough that the New York Times, in its obituary for Aaron Swartz, called the technology “ubiquitous.” For a while, before a third of the planet had signed up for Facebook, RSS was simply how many people stayed abreast of news on the internet. + +The New York Times published Swartz’ obituary in January 2013. By that point, though, RSS had actually turned a corner and was well on its way to becoming an obscure technology. Google Reader was shut down in July 2013, ostensibly because user numbers had been falling “over the years.” This prompted several articles from various outlets declaring that RSS was dead. But people had been declaring that RSS was dead for years, even before Google Reader’s shuttering. Steve Gillmor, writing for TechCrunch in May 2009, advised that “it’s time to get completely off RSS and switch to Twitter” because “RSS just doesn’t cut it anymore.” He pointed out that Twitter was basically a better RSS feed, since it could show you what people thought about an article in addition to the article itself. It allowed you to follow people and not just channels. Gillmor told his readers that it was time to let RSS recede into the background. He ended his article with a verse from Bob Dylan’s “Forever Young.” + +Today, RSS is not dead. But neither is it anywhere near as popular as it once was. Lots of people have offered explanations for why RSS lost its broad appeal. Perhaps the most persuasive explanation is exactly the one offered by Gillmor in 2009. Social networks, just like RSS, provide a feed featuring all the latest news on the internet. Social networks took over from RSS because they were simply better feeds. They also provide more benefits to the companies that own them. Some people have accused Google, for example, of shutting down Google Reader in order to encourage people to use Google+. Google might have been able to monetize Google+ in a way that it could never have monetized Google Reader. Marco Arment, the creator of Instapaper, wrote on his blog in 2013: + +> Google Reader is just the latest casualty of the war that Facebook started, seemingly accidentally: the battle to own everything. While Google did technically “own” Reader and could make some use of the huge amount of news and attention data flowing through it, it conflicted with their far more important Google+ strategy: they need everyone reading and sharing everything through Google+ so they can compete with Facebook for ad-targeting data, ad dollars, growth, and relevance. + +So both users and technology companies realized that they got more out of using social networks than they did out of RSS. + +Another theory is that RSS was always too geeky for regular people. Even the New York Times, which seems to have been eager to adopt RSS and promote it to its audience, complained in 2006 that RSS is a “not particularly user friendly” acronym coined by “computer geeks.” Before the RSS icon was designed in 2004, websites like the New York Times linked to their RSS feeds using little orange boxes labeled “XML,” which can only have been intimidating. The label was perfectly accurate though, because back then clicking the link would take a hapless user to a page full of XML. [This great tweet][9] captures the essence of this explanation for RSS’ demise. Regular people never felt comfortable using RSS; it hadn’t really been designed as a consumer-facing technology and involved too many hurdles; people jumped ship as soon as something better came along. + +RSS might have been able to overcome some of these limitations if it had been further developed. Maybe RSS could have been extended somehow so that friends subscribed to the same channel could syndicate their thoughts about an article to each other. Maybe browser support could have been improved. But whereas a company like Facebook was able to “move fast and break things,” the RSS developer community was stuck trying to achieve consensus. When they failed to agree on a single standard, effort that could have gone into improving RSS was instead squandered on duplicating work that had already been done. Davis told me, for example, that Atom would not have been necessary if the members of the Syndication mailing list had been able to compromise and collaborate, and “all that cleanup work could have been put into RSS to strengthen it.” So if we are asking ourselves why RSS is no longer popular, a good first-order explanation is that social networks supplanted it. If we ask ourselves why social networks were able to supplant it, then the answer may be that the people trying to make RSS succeed faced a problem much harder than, say, building Facebook. As Dornfest wrote to the Syndication mailing list at one point, “currently it’s the politics far more than the serialization that’s far from simple.” + +So today we are left with centralized silos of information. Even so, the syndicated web that Werbach foresaw in 1999 has been realized, just not in the way he thought it would be. After all, The Onion is a publication that relies on syndication through Facebook and Twitter the same way that Seinfeld relied on syndication to rake in millions after the end of its original run. I asked Werbach what he thinks about this and he more or less agrees. He told me that RSS, on one level, was clearly a failure, because it isn’t now “a technology that is really the core of the whole blogging world or content world or world of assembling different elements of things into sites.” But, on another level, “the whole social media revolution is partly about the ability to aggregate different content and resources” in a manner reminiscent of RSS and his original vision for a syndicated web. To Werbach, “it’s the legacy of RSS, even if it’s not built on RSS.” + +Unfortunately, syndication on the modern web still only happens through one of a very small number of channels, meaning that none of us “retain control over our online personae” the way that Werbach imagined we would. One reason this happened is garden-variety corporate rapaciousness—RSS, an open format, didn’t give technology companies the control over data and eyeballs that they needed to sell ads, so they did not support it. But the more mundane reason is that centralized silos are just easier to design than common standards. Consensus is difficult to achieve and it takes time, but without consensus spurned developers will go off and create competing standards. The lesson here may be that if we want to see a better, more open web, we have to get better at not screwing each other over. + +If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][10] on Twitter or subscribe to the [RSS feed][11] to make sure you know when a new post is out. + +Previously on TwoBitHistory… + +> I've long wondered if the Unix commands on my Macbook are built from the same code that they were built from 20 or 30 years ago. The answer, it turns, out, is "kinda"! +> +> My latest post, on how the implementation of cat has changed over the years: +> +> — TwoBitHistory (@TwoBitHistory) [November 12, 2018][12] + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2018/12/18/rss.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]: https://twobithistory.org/2018/09/16/the-rise-and-demise-of-rss.html +[2]: https://trends.google.com/trends/explore?date=all&geo=US&q=rss +[3]: https://twobithistory.org/images/mnn-channel.gif +[4]: https://twobithistory.org/2018/05/27/semantic-web.html +[5]: http://web.archive.org/web/19970703020212/http://mcf.research.apple.com:80/hs/screen_shot.html +[6]: http://scripting.com +[7]: https://groups.yahoo.com/neo/groups/syndication/info +[8]: https://tools.ietf.org/html/rfc4287 +[9]: https://twitter.com/mgsiegler/status/311992206716203008 +[10]: https://twitter.com/TwoBitHistory +[11]: https://twobithistory.org/feed.xml +[12]: https://twitter.com/TwoBitHistory/status/1062114484209311746?ref_src=twsrc%5Etfw From c12558dba34b6a2bf64a6f7a6c10fdde55dfefbc Mon Sep 17 00:00:00 2001 From: zjon Date: Fri, 21 Dec 2018 16:28:31 +0800 Subject: [PATCH 0987/1143] 20171012 7 Best eBook Readers for Linux has translated 20171012 7 Best eBook Readers for Linux has translated --- ...20171012 7 Best eBook Readers for Linux.md | 190 ------------------ ...20171012 7 Best eBook Readers for Linux.md | 182 +++++++++++++++++ 2 files changed, 182 insertions(+), 190 deletions(-) delete mode 100644 sources/tech/20171012 7 Best eBook Readers for Linux.md create mode 100644 translated/tech/20171012 7 Best eBook Readers for Linux.md diff --git a/sources/tech/20171012 7 Best eBook Readers for Linux.md b/sources/tech/20171012 7 Best eBook Readers for Linux.md deleted file mode 100644 index 9f69c6decb..0000000000 --- a/sources/tech/20171012 7 Best eBook Readers for Linux.md +++ /dev/null @@ -1,190 +0,0 @@ -zjon is translating -7 Best eBook Readers for Linux -====== -**Brief:** In this article, we are covering some of the best ebook readers for Linux. These apps give a better reading experience and some will even help in managing your ebooks. - -![Best eBook readers for Linux][1] - -Lately, the demand for digital books has increased as people find it more comfortable in reading a book on their handheld devices, Kindle or PC. When it comes to the Linux users, there are various ebook apps that will serve your purpose in reading and organizing your ebook collections. - -In this article, we have compiled seven best ebook readers for Linux. These ebook readers are best suited for pdf, epubs and other ebook formats. - -## Best eBook readers for Linux - -I have provided installation instructions for Ubuntu as I am using Ubuntu right now. If you use [non-Ubuntu Linux distributions][2], you can find most of these eBook applications in the software repositories of your distro. - -### 1. Calibre - -[Calibre][3] is one of the most popular eBook apps for Linux. To be honest, it's a lot more than just a simple eBook reader. It's a complete eBook solution. You can even [create professional eBooks with Calibre][4]. - -With a powerful eBook manager and easy to use interface, it features creation and editing of an eBook. Calibre supports a variety of formats and syncing with other ebook readers. It also lets you convert one eBook format to another with ease. - -The biggest drawback of Calibre is that it's too heavy on resources and that makes it a difficult choice as a standalone eBook reader. - -![Calibre][5] - -#### Features - - * Managing eBook: Calibre allows sorting and grouping eBooks by managing metadata. You can download metadata for an eBook from various sources or create and edit the existing field. - * Supports all major eBook formats: Calibre supports all major eBook formats and is compatible with various e-readers. - * File conversion: You can convert any ebook format to another one with the option of changing the book style, creating a table of content or improving margins while converting. You can convert your personal documents to an ebook too. - * Download magazines from the web: Calibre can deliver stories from various news sources or through RSS feed. - * Share and backup your library: It gives an option of hosting your eBook collection over its server which you can share with your friends or acccess from anywhere, using any device. Backup and import/export feature allows you to keep your collection safe and easy portability. - - - -#### Installation - -You can find it in the software repository of all major Linux distributions. For Ubuntu, search for it in Software Center or use he command below: - -`sudo apt-get install calibre` - -### 2. FBReader - -![FBReader: eBook reader for Linux][6] - -[FBReader][7] is an open source, lightweight, multi-platform ebook reader supporting various formats like ePub, fb2, mobi, rtf, html etc. It includes access to popular network libraries from where you can download ebooks for free or buy one. - -FBReader is highly customizable with options to choose colors, fonts, page-turning animations, bookmarks and dictionaries. - -#### Features - - * Supports a variety of file formats and devices like Android, iOS, Windows, Mac and more. - * Synchronize book collection, reading positions and bookmarks. - * Manage your library online by adding any book from your Linux desktop to all your devices. - * Web browser access to your stored collection. - * Supports storage of books in Google Drive and organizing of books by authors, series or other attributes. - - - -#### Installation - -You can install FBReader ebook reader from the official repository or by typing the below command in terminal. -``` -sudo apt-get install fbreader -``` - -Or, you can grab a .deb package from [here][8] and install it on your Debian based distributions. - -### 3. Okular - -[Okular][9] is another open source and cross-platform document viewer developed by KDE and is shipped as part of the KDE Application release. - -![Okular][10] - -#### Features - - * Okular supports various document formats like PDF, Postscript, DjVu, CHM, XPS, ePub and others. - * Supports features like commenting on PDF documents, highlighting and drawing different shapes etc. - * These changes are saved separately without modifying the original PDF file. - * Text from an eBook can be extracted to a text file and has an inbuilt text reading service called Jovie. - - - -Note: While checking the app, I did discover that the app doesn't support ePub file format in Ubuntu and its derivatives. The other distribution users can still utilize it's full potential. - -#### Installation - -Ubuntu users can install it by typing below command in Terminal : -``` -sudo apt-get install okular -``` - -### 4. Lucidor - -Lucidor is a handy e-book reader supporting epub file formats and catalogs in OPDS formats. It also features organizing the collection of e-books in local bookcase, searching and downloading from the internet and converting web feeds and web pages into e-books. - -Lucidor is XULRunner application giving you a look of Firefox with tabbed layout and behaves like it while storing data and configurations. It's the simplest ebook reader among the list and includes configurations like text justifications and scrolling options. - -![lucidor][11] - -You can look out for the definition from Wiktionary.org by selecting a word and right click > lookup word options. It also includes options to Web feeds or web pages as e-books. - -You can download and install the deb or RPM package from [here.][12] - -### 5. Bookworm - -![Bookworm eBook reader for Linux][13] - -Bookworm is another free and open source ebook reader supporting different file formats like epub, pdf, mobi, cbr and cbz. I wrote a dedicated article on features and installation for Bookworm apps, read it here: [Bookworm: A Simple yet Magnificent eBook Reader for Linux][14] - -#### Installation -``` -sudo apt-add-repository ppa:bookworm-team/bookworm -sudo apt-get update -sudo apt-get install bookworm -``` - -### 6. Easy Ebook Viewer - -[Easy Ebook Viewer][15] is another fantastic GTK Python app for reading ePub files. With features like basic chapter navigation, continuing from the last reading positions, importing from other ebook file formats, chapter jumping and more, Easy Ebook Viewer is a simple and minimalist ePub reader. - -![Easy-Ebook-Viewer][16] - -The app is still in its initial stage and has support for only ePub files. - -#### Installation - -You can install Easy Ebook Viewer by downloading the source code from [github][17] and compiling it yourself along with the dependencies. Alternatively, the following terminal commands will do the exact same job. -``` -sudo apt install git gir1.2-webkit-3.0 libwebkitgtk-3.0-0 gir1.2-gtk-3.0 python3-gi -git clone https://github.com/michaldaniel/Ebook-Viewer.git -cd Ebook-Viewer/ -sudo make install -``` - -After successful completion of the above steps, you can launch it from the Dash. - -### 7. Buka - -[Buka][18] is mostly an ebook manager with a simple and clean user interface. It currently supports PDF formats and is designed to help the user focus more on the content. With all the basic features of pdf reader, Buka lets you navigate through arrow keys, has zoom options and you can view 2 pages side by side. - -You can create separate lists of your PDF files and switch between them easily. Buka also provides a built-in translation tool but you need an active internet connection to use the feature. - -![Buka][19] - -#### Installation - -You can download an AppImage from the [official download page.][20] If you are not aware of it, read [how to use AppImage in Linux][21]. Alternatively, you can install it from the command line: -``` -sudo snap install buka -``` - -### Final Words - -Personally, I find Calibre best suited for my needs. Also, Bookworm looks promising to me and I am using it more often these days. Though, the selection of an ebook application totally depends on your preference. - -Which ebook app do you use? Let us know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-ebook-readers-linux/ - -作者:[Ambarish Kumar][a] -译者:[译者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/ambarish/ -[1]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/best-ebook-readers-linux-800x450.png -[2]:https://itsfoss.com/non-ubuntu-beginner-linux/ -[3]:https://www.calibre-ebook.com -[4]:https://itsfoss.com/create-ebook-calibre-linux/ -[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Calibre-800x603.jpeg -[6]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/fbreader-800x624.jpeg -[7]:https://fbreader.org -[8]:https://fbreader.org/content/fbreader-beta-linux-desktop -[9]:https://okular.kde.org/ -[10]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Okular-800x435.jpg -[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/lucidor-2.png -[12]:http://lucidor.org/lucidor/download.php -[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/08/bookworm-ebook-reader-linux-800x450.jpeg -[14]:https://itsfoss.com/bookworm-ebook-reader-linux/ -[15]:https://github.com/michaldaniel/Ebook-Viewer -[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Easy-Ebook-Viewer.jpg -[17]:https://github.com/michaldaniel/Ebook-Viewer.git -[18]:https://github.com/oguzhaninan/Buka -[19]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Buka2-800x555.png -[20]:https://github.com/oguzhaninan/Buka/releases -[21]:https://itsfoss.com/use-appimage-linux/ diff --git a/translated/tech/20171012 7 Best eBook Readers for Linux.md b/translated/tech/20171012 7 Best eBook Readers for Linux.md new file mode 100644 index 0000000000..89a222ea26 --- /dev/null +++ b/translated/tech/20171012 7 Best eBook Readers for Linux.md @@ -0,0 +1,182 @@ +Linux 7 个最佳电子书阅读器 +====== +**摘要:** 文章中我们涉及一些 Linux 最佳电子书阅读器。这些应用提供更佳阅读体验甚至会管理你的电子书。 + +![最佳 Linux 电子书阅读器][1] + +最近,随着人们发现在手持设备,Kindle 或者 PC 上阅读更佳舒适,对电子图书的需求有所增加。谈到 Linux 用户,有各种电子书应用满足你阅读和整理电子书的需求。 + +在本文中,我们选出了七个最佳 Linux 电子书阅读器。这些电子书阅读器最适合 pdf,epubs 和其他电子书格式。 + +## 最佳 Linux 电子书阅读器 + +我提供 Ubuntu 安装说明,因为我现在使用。如果你使用[非 Ubuntu 发行版][2],你能在你的发行版软件仓库中找到大多数这些电子书应用。 + +### 1. Calibre + +[Calibre][3] 是 Linux 最受欢迎的电子书应用。老实说,这不仅仅是一个简单的电子书阅读器。它是一个完整的电子书解决方案。你甚至能[通过 Calibre 创建私人电子][4] + +通过强大的电子书管理和易用的接口,它具有创建和编辑电子书。Calibre 支持多种格式和与其他电子书阅读器同步。它也可以让你轻松转换一种电子书格式到另一种。 + +Calibre 最大的缺点是,资源上太沉重,让它成为一个艰难的选择作为一个独立的电子阅读器。 + +![Calibre][5] + +#### 特性 + + * 管理电子书:Calibre 通过管理云数据允许存储和分组电子书。你能下载一本电子书的元数据从各种来源或创建和编辑现有的字段。 + * 支持所有主流电子书格式: Calibre 支持所有主流电子书格式并兼容多种电子阅读器。 + * 文件转换: 在转换时,你能通过改变电子书风格,创建内容表和调整边距的选项来转换任何一种电子书格式到另一种。你也能转换个人文档为电子书。 + * 从 web 下载杂志期刊:Calibre 能从各种新闻源或者通过 RSS 订阅源传递故事。 + * 分享和备份你的电子图书馆:它提供了一个选项,托管你电子书集合到它的服务端,从而你能与好友共享或用任何设备从任何地方访问。备份和导入/导出特性允许你保证你的收藏安全和方便携带。 + +#### 安装 + +你能在主流 Linux 发行版的软件库中找到它。对于 Ubuntu,在软件中心搜索它或者使用下面的命令: + +`sudo apt-get install calibre` + +### 2. FBReader + +![FBReader: Linux 电子书阅读器][6] + +[FBReader][7] 是一个开源的轻量级多平台电子书阅读器,它支持多种格式,比如 ePub,fb2,mobi,rtf,html 等。它包含一些允许访问的流行网络电子图书馆,那里你能免费或付费下载电子书。 + +#### 特性 + + * 支持多种文件格式和设备比如 Android,iOS,Windows,Mac 和更多。 + * 同步书籍收藏,阅读位置和书签。 + * 在线管理你图书馆中从你的 Linux 桌面添加到所有设备的任何书。 + * 支持 Web 浏览器允许你的存储集。 + * 支持 Google Drive 做书籍的存储和通过作者,系列或其他属性整理书籍。 + +#### 安装 + +你能从官方库或者在终端中输入一下命令安装 FBReader 电子阅读器。 +``` +sudo apt-get install fbreader +``` + +或者你能从[这里][8]抓取一个以 .deb 包并在你的基于 Debian 发行版的系统上安装它。 + +### 3. Okular + +[Okular][9] 是另一个开源的基于 KDE 开发的跨平台文档查看器,它已经作为 KDE 应用发布的一部分了。 + +![Okular][10] + +#### 特性 + + * Okular 支持多种文档格式像 PDF,Postscript,DjVu,DHM,XPS,ePub 和其他。 + * 支持在 PDF 文档中评论,高亮和绘制不通的形状等。 + * 无需修改原始 PDF 文件分别保存这些更改。 + * 电子书中的文本能被提取到一个文本文件,这个内置文本阅读服务叫 Jovie。 + +备注:检查应用的时候,我发现这个应用在 Ubuntu 和它的衍生系统不支持 ePub 文件格式。其他发行版用户仍然可以发挥它全部的潜力。 + +#### 安装 + +Ubuntu 用户可以在终端中键入下面的命令来安装它: +``` +sudo apt-get install okular +``` + +### 4. Lucidor + +Lucidor 是一个易用的支持 epub 文件格式和在 OPDS 格式中编目的电子阅读器。它也具有电子书集合在本地书柜里,搜索和下载互联网和 web 订阅和网页转换成电子书的功能。 + +Lucidor 是 XULRunner 应用程序,它向您展示了具有类火狐的选项卡式布局,和存储数据和配置时的展现。他是列表中最简单的电子阅读器,包括诸如文本说明和滚动选项之类的配置。 + +![lucidor][11] + +你可以通过选择单词并右击 > 查找单词来查找 Wiktionary.org 的定义。它也包含 web 订阅或 web 页面作为电子书的选项。 + +你能从[这里][12]下载和安装 deb 或者 RPM 包。 + +### 5. Bookworm + +![Bookworm Linux 电子阅读器][13] + +Bookworm 是另一个支持多种文件格式诸如 epub, pdf, mobi, cbr and cbz 的免费开源的电子阅读器。我写了一篇关于 Bookworm 应用程序的特性和安装的专题文章,到这里阅读: [Bookworm: 一个简单而强大的 Linux 电子阅读器][14] + +#### 安装 +``` +sudo apt-add-repository ppa:bookworm-team/bookworm +sudo apt-get update +sudo apt-get install bookworm +``` + +### 6. Easy Ebook Viewer + +[Easy Ebook Viewer][15] 是另外一个用于读取 ePub 文件的很棒的 GTK python 应用.具有基本章节导航、从上次阅读位置继续、从其他电子书文件格式导入、章节跳转等功能,Easy Ebook Viewer 是一个简单而简约的 ePub 阅读器. + +![Easy-Ebook-Viewer][16] + +这个应用仍然处于初始阶段,只支持ePub文件。 + +#### 安装 + +你可以从 [github][17] 下载源代码和自己编译以及依赖项来安装 Easy Ebook Viewer。或者,以下终端命令将执行完全相同的工作。 +``` +sudo apt install git gir1.2-webkit-3.0 libwebkitgtk-3.0-0 gir1.2-gtk-3.0 python3-gi +git clone https://github.com/michaldaniel/Ebook-Viewer.git +cd Ebook-Viewer/ +sudo make install +``` + +成功完成上述步骤后,你可以从Dash启动它。 + +### 7. Buka + +Buka 主要是一个具有简单而清爽的用户界面的电子书管理器。它目前支持 PDF 格式,旨在帮助用户更加关注内容。拥有 pdf 阅读器的所有基本特性,Buka 允许你通过箭头键导航,具有缩放选项,并且能并排查看 2 页。 + +你可以创建单独的 PDF 文件列表并轻松地在它们之间切换。Buka也提供了一个内置翻译工具,但是你需要有效的互联网连接来使用这个特性。 + +![Buka][19] + +#### 安装 + +你能从[官方下载页面][20]下载一个 AppImage。如果你不知道,请阅读[如何在 Linux 下使用 AppImage][21]。或者,你可以通过命令行安装它: +``` +sudo snap install buka +``` + +### 结束语 + +就我个人而言,我发现 Calibre 最适合我的需要。当然,Bookworm 看起来很有前途,这几天我经常使用它。不过,电子书应用的选择完全取决于你的喜好。 + +你使用哪个电子书应用呢?在下面的评论中让我们知道。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-ebook-readers-linux/ + +作者:[Ambarish Kumar][a] +译者:[zjon](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://itsfoss.com/author/ambarish/ +[1]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/best-ebook-readers-linux-800x450.png +[2]:https://itsfoss.com/non-ubuntu-beginner-linux/ +[3]:https://www.calibre-ebook.com +[4]:https://itsfoss.com/create-ebook-calibre-linux/ +[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Calibre-800x603.jpeg +[6]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/fbreader-800x624.jpeg +[7]:https://fbreader.org +[8]:https://fbreader.org/content/fbreader-beta-linux-desktop +[9]:https://okular.kde.org/ +[10]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Okular-800x435.jpg +[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/lucidor-2.png +[12]:http://lucidor.org/lucidor/download.php +[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/08/bookworm-ebook-reader-linux-800x450.jpeg +[14]:https://itsfoss.com/bookworm-ebook-reader-linux/ +[15]:https://github.com/michaldaniel/Ebook-Viewer +[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Easy-Ebook-Viewer.jpg +[17]:https://github.com/michaldaniel/Ebook-Viewer.git +[18]:https://github.com/oguzhaninan/Buka +[19]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Buka2-800x555.png +[20]:https://github.com/oguzhaninan/Buka/releases +[21]:https://itsfoss.com/use-appimage-linux/ From 84055453586a2a5118f5d790e14c1e852e4db091 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:31:08 +0800 Subject: [PATCH 0988/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Working=20with?= =?UTF-8?q?=20tarballs=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20181217 Working with tarballs on Linux.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20181217 Working with tarballs on Linux.md diff --git a/sources/tech/20181217 Working with tarballs on Linux.md b/sources/tech/20181217 Working with tarballs on Linux.md new file mode 100644 index 0000000000..29d7b6002f --- /dev/null +++ b/sources/tech/20181217 Working with tarballs on Linux.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Working with tarballs on Linux) +[#]: via: (https://www.networkworld.com/article/3328840/linux/working-with-tarballs-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Working with tarballs on Linux +====== +![](https://images.idgesg.net/images/article/2018/12/tarball-100783148-large.jpg) + +The word “tarball” is often used to describe the type of file used to back up a select group of files and join them into a single file. The name comes from the **.tar** file extension and the **tar** command that is used to group together the files into a single file that is then sometimes compressed to make it smaller for its move to another system. + +Tarballs are often used to back up personal or system files in place to create an archive, especially prior to making changes that might have to be reversed. Linux sysadmins, for example, will often create a tarball containing a series of configuration files before making changes to an application just in case they have to reverse those changes. Extracting the files from a tarball that’s sitting in place will generally be faster than having to retrieve the files from backups. + +### How to create a tarball on Linux + +You can create a tarball and compress it in a single step if you use a command like this one: + +``` +$ tar -cvzf PDFs.tar.gz *.pdf +``` + +The result in this case is a compressed (gzipped) file that contains all of the PDF files that are in the current directory. The compression is optional, of course. A slightly simpler command would just put all of the PDF files into an uncompressed tarball: + +``` +$ tar -cvf PDFs.tar *.pdf +``` + +Note that it’s the **z** in that list of options that causes the file to be compressed or “zipped”. The **c** specifies that you are creating the file and the **v** (verbose) indicates that you want some feedback while the command is running. Omit the **v** if you don't want to see the files listed. + +Another common naming convention is to give zipped tarballs the extension **.tgz** instead of the double extension **.tar.gz** as shown in this command: + +``` +$ tar cvzf MyPDFs.tgz *.pdf +``` + +### How to extract files from a tarball + +To extract all of the files from a gzipped tarball, you would use a command like this: + +``` +$ tar -xvzf file.tar.gz +``` + +If you use the .tgz naming convention, that command would look like this: + +``` +$ tar -xvzf MyPDFs.tgz +``` + +To extract an individual file from a gzipped tarball, you do almost the same thing but add the file name: + +``` +$ tar -xvzf PDFs.tar.gz ShenTix.pdf +ShenTix.pdf +ls -l ShenTix.pdf +-rw-rw-r-- 1 shs shs 122057 Dec 14 14:43 ShenTix.pdf +``` + +You can even delete files from a tarball if the tarball is not compressed. For example, if we wanted to remove tile file that we extracted above from the PDFs.tar.gz file, we would do it like this: + +``` +$ gunzip PDFs.tar.gz +$ ls -l PDFs.tar +-rw-rw-r-- 1 shs shs 10700800 Dec 15 11:51 PDFs.tar +$ tar -vf PDFs.tar --delete ShenTix.pdf +$ ls -l PDFs.tar +-rw-rw-r-- 1 shs shs 10577920 Dec 15 11:45 PDFs.tar +``` + +Notice that we shaved a little space off the tar file while deleting the ShenTix.pdf file. We can then compress the file again if we want: + +``` +$ gzip -f PDFs.tar +ls -l PDFs.tar.gz +-rw-rw-r-- 1 shs shs 10134499 Dec 15 11:51 PDFs.tar.gzFlickr / James St. John +``` + +The versatility of the command line options makes working with tarballs easy and very convenient. + +Join the Network World communities on [Facebook][1] and [LinkedIn][2] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3328840/linux/working-with-tarballs-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.facebook.com/NetworkWorld/ +[2]: https://www.linkedin.com/company/network-world From f61819dcf5b8b4c315deb1c7d060440b695ec21b Mon Sep 17 00:00:00 2001 From: zjon Date: Fri, 21 Dec 2018 16:33:09 +0800 Subject: [PATCH 0989/1143] update title updatetitle --- ...20171012 7 Best eBook Readers for Linux.md | 182 ++++++++++++++++++ ...20171012 7 Best eBook Readers for Linux.md | 2 +- 2 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 sources/tech/20171012 7 Best eBook Readers for Linux.md diff --git a/sources/tech/20171012 7 Best eBook Readers for Linux.md b/sources/tech/20171012 7 Best eBook Readers for Linux.md new file mode 100644 index 0000000000..520c9c4533 --- /dev/null +++ b/sources/tech/20171012 7 Best eBook Readers for Linux.md @@ -0,0 +1,182 @@ +7 个最佳 Linux 电子书阅读器 +====== +**摘要:** 文章中我们涉及一些 Linux 最佳电子书阅读器。这些应用提供更佳阅读体验甚至会管理你的电子书。 + +![最佳 Linux 电子书阅读器][1] + +最近,随着人们发现在手持设备,Kindle 或者 PC 上阅读更佳舒适,对电子图书的需求有所增加。谈到 Linux 用户,有各种电子书应用满足你阅读和整理电子书的需求。 + +在本文中,我们选出了七个最佳 Linux 电子书阅读器。这些电子书阅读器最适合 pdf,epubs 和其他电子书格式。 + +## 最佳 Linux 电子书阅读器 + +我提供 Ubuntu 安装说明,因为我现在使用。如果你使用[非 Ubuntu 发行版][2],你能在你的发行版软件仓库中找到大多数这些电子书应用。 + +### 1. Calibre + +[Calibre][3] 是 Linux 最受欢迎的电子书应用。老实说,这不仅仅是一个简单的电子书阅读器。它是一个完整的电子书解决方案。你甚至能[通过 Calibre 创建私人电子][4] + +通过强大的电子书管理和易用的接口,它具有创建和编辑电子书。Calibre 支持多种格式和与其他电子书阅读器同步。它也可以让你轻松转换一种电子书格式到另一种。 + +Calibre 最大的缺点是,资源上太沉重,让它成为一个艰难的选择作为一个独立的电子阅读器。 + +![Calibre][5] + +#### 特性 + + * 管理电子书:Calibre 通过管理云数据允许存储和分组电子书。你能下载一本电子书的元数据从各种来源或创建和编辑现有的字段。 + * 支持所有主流电子书格式: Calibre 支持所有主流电子书格式并兼容多种电子阅读器。 + * 文件转换: 在转换时,你能通过改变电子书风格,创建内容表和调整边距的选项来转换任何一种电子书格式到另一种。你也能转换个人文档为电子书。 + * 从 web 下载杂志期刊:Calibre 能从各种新闻源或者通过 RSS 订阅源传递故事。 + * 分享和备份你的电子图书馆:它提供了一个选项,托管你电子书集合到它的服务端,从而你能与好友共享或用任何设备从任何地方访问。备份和导入/导出特性允许你保证你的收藏安全和方便携带。 + +#### 安装 + +你能在主流 Linux 发行版的软件库中找到它。对于 Ubuntu,在软件中心搜索它或者使用下面的命令: + +`sudo apt-get install calibre` + +### 2. FBReader + +![FBReader: Linux 电子书阅读器][6] + +[FBReader][7] 是一个开源的轻量级多平台电子书阅读器,它支持多种格式,比如 ePub,fb2,mobi,rtf,html 等。它包含一些允许访问的流行网络电子图书馆,那里你能免费或付费下载电子书。 + +#### 特性 + + * 支持多种文件格式和设备比如 Android,iOS,Windows,Mac 和更多。 + * 同步书籍收藏,阅读位置和书签。 + * 在线管理你图书馆中从你的 Linux 桌面添加到所有设备的任何书。 + * 支持 Web 浏览器允许你的存储集。 + * 支持 Google Drive 做书籍的存储和通过作者,系列或其他属性整理书籍。 + +#### 安装 + +你能从官方库或者在终端中输入一下命令安装 FBReader 电子阅读器。 +``` +sudo apt-get install fbreader +``` + +或者你能从[这里][8]抓取一个以 .deb 包并在你的基于 Debian 发行版的系统上安装它。 + +### 3. Okular + +[Okular][9] 是另一个开源的基于 KDE 开发的跨平台文档查看器,它已经作为 KDE 应用发布的一部分了。 + +![Okular][10] + +#### 特性 + + * Okular 支持多种文档格式像 PDF,Postscript,DjVu,DHM,XPS,ePub 和其他。 + * 支持在 PDF 文档中评论,高亮和绘制不通的形状等。 + * 无需修改原始 PDF 文件分别保存这些更改。 + * 电子书中的文本能被提取到一个文本文件,这个内置文本阅读服务叫 Jovie。 + +备注:检查应用的时候,我发现这个应用在 Ubuntu 和它的衍生系统不支持 ePub 文件格式。其他发行版用户仍然可以发挥它全部的潜力。 + +#### 安装 + +Ubuntu 用户可以在终端中键入下面的命令来安装它: +``` +sudo apt-get install okular +``` + +### 4. Lucidor + +Lucidor 是一个易用的支持 epub 文件格式和在 OPDS 格式中编目的电子阅读器。它也具有电子书集合在本地书柜里,搜索和下载互联网和 web 订阅和网页转换成电子书的功能。 + +Lucidor 是 XULRunner 应用程序,它向您展示了具有类火狐的选项卡式布局,和存储数据和配置时的展现。他是列表中最简单的电子阅读器,包括诸如文本说明和滚动选项之类的配置。 + +![lucidor][11] + +你可以通过选择单词并右击 > 查找单词来查找 Wiktionary.org 的定义。它也包含 web 订阅或 web 页面作为电子书的选项。 + +你能从[这里][12]下载和安装 deb 或者 RPM 包。 + +### 5. Bookworm + +![Bookworm Linux 电子阅读器][13] + +Bookworm 是另一个支持多种文件格式诸如 epub, pdf, mobi, cbr and cbz 的免费开源的电子阅读器。我写了一篇关于 Bookworm 应用程序的特性和安装的专题文章,到这里阅读: [Bookworm: 一个简单而强大的 Linux 电子阅读器][14] + +#### 安装 +``` +sudo apt-add-repository ppa:bookworm-team/bookworm +sudo apt-get update +sudo apt-get install bookworm +``` + +### 6. Easy Ebook Viewer + +[Easy Ebook Viewer][15] 是另外一个用于读取 ePub 文件的很棒的 GTK python 应用.具有基本章节导航、从上次阅读位置继续、从其他电子书文件格式导入、章节跳转等功能,Easy Ebook Viewer 是一个简单而简约的 ePub 阅读器. + +![Easy-Ebook-Viewer][16] + +这个应用仍然处于初始阶段,只支持ePub文件。 + +#### 安装 + +你可以从 [github][17] 下载源代码和自己编译以及依赖项来安装 Easy Ebook Viewer。或者,以下终端命令将执行完全相同的工作。 +``` +sudo apt install git gir1.2-webkit-3.0 libwebkitgtk-3.0-0 gir1.2-gtk-3.0 python3-gi +git clone https://github.com/michaldaniel/Ebook-Viewer.git +cd Ebook-Viewer/ +sudo make install +``` + +成功完成上述步骤后,你可以从Dash启动它。 + +### 7. Buka + +Buka 主要是一个具有简单而清爽的用户界面的电子书管理器。它目前支持 PDF 格式,旨在帮助用户更加关注内容。拥有 pdf 阅读器的所有基本特性,Buka 允许你通过箭头键导航,具有缩放选项,并且能并排查看 2 页。 + +你可以创建单独的 PDF 文件列表并轻松地在它们之间切换。Buka也提供了一个内置翻译工具,但是你需要有效的互联网连接来使用这个特性。 + +![Buka][19] + +#### 安装 + +你能从[官方下载页面][20]下载一个 AppImage。如果你不知道,请阅读[如何在 Linux 下使用 AppImage][21]。或者,你可以通过命令行安装它: +``` +sudo snap install buka +``` + +### 结束语 + +就我个人而言,我发现 Calibre 最适合我的需要。当然,Bookworm 看起来很有前途,这几天我经常使用它。不过,电子书应用的选择完全取决于你的喜好。 + +你使用哪个电子书应用呢?在下面的评论中让我们知道。 + + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-ebook-readers-linux/ + +作者:[Ambarish Kumar][a] +译者:[zjon](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://itsfoss.com/author/ambarish/ +[1]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/best-ebook-readers-linux-800x450.png +[2]:https://itsfoss.com/non-ubuntu-beginner-linux/ +[3]:https://www.calibre-ebook.com +[4]:https://itsfoss.com/create-ebook-calibre-linux/ +[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Calibre-800x603.jpeg +[6]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/fbreader-800x624.jpeg +[7]:https://fbreader.org +[8]:https://fbreader.org/content/fbreader-beta-linux-desktop +[9]:https://okular.kde.org/ +[10]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Okular-800x435.jpg +[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/lucidor-2.png +[12]:http://lucidor.org/lucidor/download.php +[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/08/bookworm-ebook-reader-linux-800x450.jpeg +[14]:https://itsfoss.com/bookworm-ebook-reader-linux/ +[15]:https://github.com/michaldaniel/Ebook-Viewer +[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Easy-Ebook-Viewer.jpg +[17]:https://github.com/michaldaniel/Ebook-Viewer.git +[18]:https://github.com/oguzhaninan/Buka +[19]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Buka2-800x555.png +[20]:https://github.com/oguzhaninan/Buka/releases +[21]:https://itsfoss.com/use-appimage-linux/ diff --git a/translated/tech/20171012 7 Best eBook Readers for Linux.md b/translated/tech/20171012 7 Best eBook Readers for Linux.md index 89a222ea26..520c9c4533 100644 --- a/translated/tech/20171012 7 Best eBook Readers for Linux.md +++ b/translated/tech/20171012 7 Best eBook Readers for Linux.md @@ -1,4 +1,4 @@ -Linux 7 个最佳电子书阅读器 +7 个最佳 Linux 电子书阅读器 ====== **摘要:** 文章中我们涉及一些 Linux 最佳电子书阅读器。这些应用提供更佳阅读体验甚至会管理你的电子书。 From c39a24272d1dafb19525906c334f66a11b713cc9 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:34:50 +0800 Subject: [PATCH 0990/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Insync:=20The?= =?UTF-8?q?=20Hassleless=20Way=20of=20Using=20Google=20Drive=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...less Way of Using Google Drive on Linux.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md diff --git a/sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md b/sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md new file mode 100644 index 0000000000..c10e7ae4ed --- /dev/null +++ b/sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Insync: The Hassleless Way of Using Google Drive on Linux) +[#]: via: (https://itsfoss.com/insync-linux-review/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Insync: The Hassleless Way of Using Google Drive on Linux +====== + +Using Google Drive on Linux is a pain and you probably already know that. There is no official desktop client of Google Drive for Linux. It’s been [more than six years since Google promised Google Drive on Linux][1] but it doesn’t seem to be happening. + +In the absence of the official Google Drive client on Linux, you have no option other than trying the alternatives. I have already discussed a number of [tools that allow you to use Google Drive on Linux][2]. One of those to[ols is][3] Insync, and in my opinion, this is your best bet for a native Google Drive experience on desktop Linux. + +Note that Insync is not an open source software. Heck, it is not even free to use. + +But it has so many features that it becomes an essential tool for those Linux users who rely heavily on Google Drive. + +I briefly discussed Insync in the old article about [Google Drive and Linux][2]. In this article, I’ll discuss Insync features in detail. + +### Insync brings native Google Drive experience to Linux desktop + +![Use insync to access Google Drive in Linux][4] + +The core competency of Insync is syncing your Google Drive, but the app is much more than that. It has features to help you maximize and control your productivity, your Google Drive and your files such as: + + * Cross-platform access (supports Linux, Windows and macOS) + * Easy multiple Google Drive accounts access + * Choose your syncing location. Sync files to your hard drive, external drives and NAS! + * Support for features like file matching, symlink and ignore list + + + +Let me show you some of the main features in action: + +#### Cross-platform in true sense + +Insync claims to run the same app across all operating systems i.e., Linux, Windows, and macOS. That means that you can access the same UI across different OSes, making it easy for you to manage your files across multiple machines. + +![The UI of Insync and the default location of the Insync folder.][5]The UI of Insync and the default location of the Insync folder. + +#### Multiple Google account management + +Insync interface allows you to manage multiple Google Drive accounts seamlessly. You can easily switch between several accounts just by clicking your Google account. + +![Switching between multiple Google accounts in Insync][6]Switching between multiple Google accounts + +#### Custom sync folders + +Customize the way you sync your files and folders. You can easily set your syncing destination anywhere on your machine including external drive and network drives. + +![Customize sync location in Insync][7]Customize sync location + +The selective syncing mode also allows you to easily select a number of files and folders you’d want to sync (or unsync) in your local machine. This includes selectively syncing files within folders. + +![Selective synchronization in Insync][8]Selective synchronization + +It has features like file matching and ‘ignore list’ to help you filter files you don’t want to sync or files that you already have on your machine. + +![File matching feature in Insync][9]Avoids duplication of files + +The ‘ignore list’ allows you to set rules to exclude certain type of files from synchronization. + +![Selective syncing based on rules in Insync][10]Selective syncing based on rules + +If you prefer to work out of the desktop, you have an “Add to Insync” feature that will allow you to add any local file to your Drive. + +![Sync files right from your desktop][11]Sync files right from your desktop + +Insync also supports symlinks for those with workflows that use symbolic links. To learn more about Insync and symlinks, you can refer to [this article.][12] + +#### Exclusive features for Linux + +Insync supports the most commonly used 64-bit Linux distributions like **Ubuntu, Debian and Fedora**. You can check out the full list of distribution support [here][13]. + +Insync also has [headless][14] support for those looking to sync through the command line interface. This is perfect if you use a distro that is not fully supported by the GUI app or if you are working with servers or if you simply prefer the CLI. + +![Insync CLI][15]Command Line Interface + +You can learn more about installing and running Insync headless [here][16]. + +### Insync pricing and special discount + +Insync is a premium tool and it comes with a [price tag][17]. You have 2 licenses to choose from: + + * **Prime** is priced at $29.99 per Google account. You’ll get access to: cross-platform syncing, multiple accounts access and **support**. + * **Teams** is priced at $49.99 per Google account. You’ll be able to access all the Prime features + Team Drives syncing + + + +It’s a one-time fee which means once you buy it, you don’t have to pay it again. In a world where everything is paid monthly, it’s refreshing to pay for software that is still one-time! + +Each Google account has a 15-day free trial that will allow you to test the full suite of features, including [Team Drives][18] syncing. + +If you think it’s a bit expensive for your budget, I have good news for you. As an It’s FOSS reader, you get Insync at 25% discount. + +Just use the code ITSFOSS25 at checkout time and you will get 25% immediate discount on any license. Isn’t it cool? + +If you are not certain yet, you can try Insync free for 15 days. And if you think it’s worth the money, purchase the license with **ITSFOSS25** coupon code. + +You can download Insync from their website. + +I have used Insync from the time when it was available for free and I have always liked it. They have added more features over the time and improved its UI and performance. Overall, it’s a nice-to-have application if you use Google Drive a lot and do not mind paying for the efforts of the developers. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/insync-linux-review/ + +作者:[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://abevoelker.github.io/how-long-since-google-said-a-google-drive-linux-client-is-coming/ +[2]: https://itsfoss.com/use-google-drive-linux/ +[3]: https://www.insynchq.com +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/google-drive-linux-insync.jpeg?resize=800%2C450&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_interface.jpeg?fit=800%2C501&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_multiple_google_account.jpeg?ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_folder_settings.png?ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_selective_sync.png?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_file_matching.jpeg?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_ignore_list_1.png?ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/add-to-insync-shortcut.jpeg?ssl=1 +[12]: https://help.insynchq.com/key-features-and-syncing-explained/syncing-superpowers/using-symlinks-on-google-drive-with-insync +[13]: https://www.insynchq.com/downloads +[14]: https://en.wikipedia.org/wiki/Headless_software +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_cli.jpeg?fit=800%2C478&ssl=1 +[16]: https://help.insynchq.com/installation-on-windows-linux-and-macos/advanced/linux-controlling-insync-via-command-line-cli +[17]: https://www.insynchq.com/pricing +[18]: https://gsuite.google.com/learning-center/products/drive/get-started-team-drive/#!/ From 8771b92c553f2585ebb69a727d5d87511d345322 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:41:30 +0800 Subject: [PATCH 0991/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=206=20tips=20and?= =?UTF-8?q?=20tricks=20for=20using=20KeePassX=20to=20secure=20your=20passw?= =?UTF-8?q?ords?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...using KeePassX to secure your passwords.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md diff --git a/sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md b/sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md new file mode 100644 index 0000000000..ad688a7820 --- /dev/null +++ b/sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 tips and tricks for using KeePassX to secure your passwords) +[#]: via: (https://opensource.com/article/18/12/keepassx-security-best-practices) +[#]: author: (Michael McCune https://opensource.com/users/elmiko) + +6 tips and tricks for using KeePassX to secure your passwords +====== +Get more out of your password manager by following these best practices. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum) + +Our increasingly interconnected digital world makes security an essential and common discussion topic. We hear about [data breaches][1] with alarming regularity and are often on our own to make informed decisions about how to use technology securely. Although security is a deep and nuanced topic, there are some easy daily habits you can keep to reduce your attack surface. + +Securing passwords and account information is something that affects anyone today. Technologies like [OAuth][2] help make our lives simpler by reducing the number of accounts we need to create, but we are still left with a staggering number of places where we need new, unique information to keep our records secure. An easy way to deal with the increased mental load of organizing all this sensitive information is to use a password manager like [KeePassX][3]. + +In this article, I will explain the importance of keeping your password information secure and offer suggestions for getting the most out of KeePassX. For an introduction to KeePassX and its features, I highly recommend Ricardo Frydman's article "[Managing passwords in Linux with KeePassX][4]." + +### Why are unique passwords important? + +Using a different password for each account is the first step in ensuring that your accounts are not vulnerable to shared information leaks. Generating new credentials for every account is time-consuming, and it is extremely common for people to fall into the trap of using the same password on several accounts. The main problem with reusing passwords is that you increase the number of accounts an attacker could access if one of them experiences a credential breach. + +It may seem like a burden to create new credentials for each account, but the few minutes you spend creating and recording this information will pay for itself many times over in the event of a data breach. This is where password management tools like KeePassX are invaluable for providing convenience and reliability in securing your logins. + +### 3 tips for getting the most out of KeePassX + +I have been using KeePassX to manage my password information for many years, and it has become a primary resource in my digital toolbox. Overall, it's fairly simple to use, but there are a few best practices I've learned that I think are worth highlighting. + + 1. Add the direct login URL for each account entry. KeePassX has a very convenient shortcut to open the URL listed with an entry. (It's Control+Shift+U on Linux.) When creating a new account entry for a website, I spend some time to locate the site's direct login URL. Although most websites have a login widget in their navigation toolbars, they also usually have direct pages for login forms. By putting this URL into the URL field on the account entry setup form, I can use the shortcut to directly open the login page in my browser. + +![](https://opensource.com/sites/default/files/uploads/keepassx-tip1.png) + + 2. Use the Notes field to record extra security information. In addition to passwords, most websites will ask several questions to create additional authentication factors for an account. I use the Notes sections in my account entries to record these additional factors. + +![](https://opensource.com/sites/default/files/uploads/keepassx-tip2.png) + + 3. Turn on automatic database locking. In the **Application Settings** under the **Tools** menu, there is an option to lock the database after a period of inactivity. Enabling this option is a good common-sense measure, similar to enabling a password-protected screen lock, that will help ensure your password database is not left open and unprotected if someone else gains access to your computer. + +![](https://opensource.com/sites/default/files/uploads/keepassx_application-settings.png) + +### Food for thought + +Protecting your accounts with better password practices and daily habits is just the beginning. Once you start using a password manager, you need to consider issues like protecting the password database file and ensuring you don't forget or lose the master credentials. + +The cloud-native world of disconnected devices and edge computing makes having a central password store essential. The practices and methodologies you adopt will help minimize your risk while you explore and work in the digital world. + + 1. Be aware of retention policies when storing your database in the cloud. KeePassX's database has an open format used by several tools on multiple platforms. Sooner or later, you will want to transfer your database to another device. As you do this, consider the medium you will use to transfer the file. The best option is to use some sort of direct transfer between devices, but this is not always convenient. Always think about where the database file might be stored as it winds its way through the information superhighway; an email may get cached on a server, an object store may move old files to a trash folder. Learn about these interactions for the platforms you are using before deciding where and how you will share your database file. + + 2. Consider the source of truth for your database while you're making edits. After you share your database file between devices, you might need to create accounts for new services or change information for existing services while using a device. To ensure your information is always correct across all your devices, you need to make sure any edits you make on one device end up in all copies of the database file. There is no easy solution to this problem, but you might think about making all edits from a single device or storing the master copy in a location where all your devices can make edits. + + 3. Do you really need to know your passwords? This is more of a philosophical question that touches on the nature of memorable passwords, convenience, and secrecy. I hardly look at passwords as I create them for new accounts; in most cases, I don't even click the "Show Password" checkbox. There is an idea that you can be more secure by not knowing your passwords, as it would be impossible to compel you to provide them. This may seem like a worrisome idea at first, but consider that you can recover or reset passwords for most accounts through alternate verification methods. When you consider that you might want to change your passwords on a semi-regular basis, it almost makes more sense to treat them as ephemeral information that can be regenerated or replaced. + + + + +Here are a few more ideas to consider as you develop your best practices. + +I hope these tips and tricks have helped expand your knowledge of password management and KeePassX. You can find tools that support the KeePass database format on nearly every platform. If you are not currently using a password manager or have never tried KeePassX, I highly recommend doing so now! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/keepassx-security-best-practices + +作者:[Michael McCune][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elmiko +[b]: https://github.com/lujun9972 +[1]: https://vigilante.pw/ +[2]: https://en.wikipedia.org/wiki/OAuth +[3]: https://www.keepassx.org/ +[4]: https://opensource.com/business/16/5/keepassx From 89340410b931c436b1e7565b2ad2eff5dcca1e34 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:42:35 +0800 Subject: [PATCH 0992/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=204=20cool=20new?= =?UTF-8?q?=20projects=20to=20try=20in=20COPR=20for=20December=202018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ojects to try in COPR for December 2018.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md diff --git a/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md b/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md new file mode 100644 index 0000000000..9dc8b3390f --- /dev/null +++ b/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for December 2018) +[#]: via: (https://fedoramagazine.org/4-try-copr-december-2018/) +[#]: author: (Dominik Turecek https://fedoramagazine.org) + +4 cool new projects to try in COPR for December 2018 +====== +![](https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg) + +COPR is a [collection][1] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. + +Here’s a set of new and interesting projects in COPR. + +### MindForger + +[MindForger][2] is a Markdown editor and a notebook. In addition to features you’d expect from a Markdown editor, MindForger lets you split a single file into multiple notes. It’s easy to organize the notes and move them around between files, as well as search through them. I’ve been using MindForger for some time for my study notes, so it’s nice that it’s available through COPR now.![][3] + +#### Installation instructions + +The repo currently provides MindForger for Fedora 29 and Rawhide. To install MindForger, use these commands: + +``` +sudo dnf copr enable deadmozay/mindforger +sudo dnf install mindforger +``` + +### Clingo + +[Clingo][4] is a program for solving logical problems using [answer set programming][5] (ASP) modeling language. With ASP, you can declaratively describe a problem as a logical program that Clingo then solves. As a result, Clingo produces solutions to the problem in the form of logical models, called answer sets. + +#### Installation instructions + +The repo currently provides Clingo for Fedora 28 and 29. To install Clingo, use these commands: + +``` +sudo dnf copr enable timn/clingo +sudo dnf install clingo +``` + +### SGVrecord + +[SGVrecord][6] is a simple tool for recording your screen. It allows you to either capture the whole screen or select just a part of it. Furthermore, it is possible to make the record with or without sound. Sgvrecord produces files in WebM format.![][7] + +#### Installation instructions + +The repo currently provides SGVrecord for Fedora 28, 29, and Rawhide. To install SGVrecord, use these commands: + +``` +sudo dnf copr enable youssefmsourani/sgvrecord +sudo dnf install sgvrecord +``` + +### Watchman + +[Watchman][8] is a service for monitoring and recording when changes are done to files. +You can specify directory trees for Watchman to monitor, as well as define actions +that are triggered when specified files are changed. + +#### Installation instructions + +The repo currently provides Watchman for Fedora 29 and Rawhide. To install Watchman, use these commands: + +``` +sudo dnf copr enable eklitzke/watchman +sudo dnf install watchman +``` + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-try-copr-december-2018/ + +作者:[Dominik Turecek][a] +选题:[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 +[b]: https://github.com/lujun9972 +[1]: https://copr.fedorainfracloud.org/ +[2]: https://www.mindforger.com/ +[3]: https://fedoramagazine.org/wp-content/uploads/2018/12/mindforger.png +[4]: https://potassco.org/clingo/ +[5]: https://en.wikipedia.org/wiki/Answer_set_programming +[6]: https://github.com/yucefsourani/sgvrecord +[7]: https://fedoramagazine.org/wp-content/uploads/2018/12/SGVrecord.png +[8]: https://facebook.github.io/watchman/ From e64177708c5b39b098722086a7ed82c46ff65493 Mon Sep 17 00:00:00 2001 From: Auk7F7 <34982730+Auk7F7@users.noreply.github.com> Date: Fri, 21 Dec 2018 16:43:15 +0800 Subject: [PATCH 0993/1143] Update 20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md --- ...udit - A Tool To Check Vulnerable Packages In Arch Linux.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md b/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md index 3f77bee3d1..d359a4f57c 100644 --- a/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md +++ b/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( Auk7F7) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (Arch-Audit : A Tool To Check Vulnerable Packages In Arch Linux) @@ -7,7 +7,6 @@ [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) [#]: url: ( ) -translating by Auk7F7 Arch-Audit : A Tool To Check Vulnerable Packages In Arch Linux ====== From 46bad7ca22b757d16f411b8ccbc03d19cc813977 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Fri, 21 Dec 2018 16:54:45 +0800 Subject: [PATCH 0994/1143] hankchow translating --- sources/tech/20181219 How to open source your Python library.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181219 How to open source your Python library.md b/sources/tech/20181219 How to open source your Python library.md index cf59688484..e4d6adf3c6 100644 --- a/sources/tech/20181219 How to open source your Python library.md +++ b/sources/tech/20181219 How to open source your Python library.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1972e2fafdf7a438ceaf523eca15f98170203fb9 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:59:08 +0800 Subject: [PATCH 0995/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Inst?= =?UTF-8?q?all=20Rust=20Programming=20Language=20In=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tall Rust Programming Language In Linux.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/tech/20181214 How To Install Rust Programming Language In Linux.md diff --git a/sources/tech/20181214 How To Install Rust Programming Language In Linux.md b/sources/tech/20181214 How To Install Rust Programming Language In Linux.md new file mode 100644 index 0000000000..074c41e9f9 --- /dev/null +++ b/sources/tech/20181214 How To Install Rust Programming Language In Linux.md @@ -0,0 +1,179 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install Rust Programming Language In Linux) +[#]: via: (https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/) +[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) + +How To Install Rust Programming Language In Linux +====== + +Rust is often called rust-lang. + +Rust is a general-purpose, multi-paradigm, modern, cross-platform, and open source systems programming language sponsored by Mozilla Research. + +It was designed to be achieve a goals such as safety, speed, and concurrency. + +Rust is syntactically similar to C++,[14] but its designers intend it to provide better memory safety while still maintaining performance. + +Rust is currently used in many organization such as Firefox, Chef, Dropbox, Oracle, GNOME, etc,. + +### How to Install Runs Language in Linux? + +There are many ways we can install Rust but below is the officially recommended way to install it. + +``` +$ curl https://sh.rustup.rs -sSf | sh +info: downloading installer + +Welcome to Rust! + +This will download and install the official compiler for the Rust programming +language, and its package manager, Cargo. + +It will add the cargo, rustc, rustup and other commands to Cargo's bin +directory, located at: + + /home/daygeek/.cargo/bin + +This path will then be added to your PATH environment variable by modifying the +profile files located at: + + /home/daygeek/.profile + /home/daygeek/.bash_profile + +You can uninstall at any time with rustup self uninstall and these changes will +be reverted. + +Current installation options: + + default host triple: x86_64-unknown-linux-gnu + default toolchain: stable + modify PATH variable: yes + +1) Proceed with installation (default) +2) Customize installation +3) Cancel installation +>1 + +info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' +info: latest update on 2018-12-06, rust version 1.31.0 (abe02cefd 2018-12-04) +info: downloading component 'rustc' + 77.7 MiB / 77.7 MiB (100 %) 1.2 MiB/s ETA: 0 s +info: downloading component 'rust-std' + 54.2 MiB / 54.2 MiB (100 %) 1.2 MiB/s ETA: 0 s +info: downloading component 'cargo' + 4.7 MiB / 4.7 MiB (100 %) 1.2 MiB/s ETA: 0 s +info: downloading component 'rust-docs' + 8.5 MiB / 8.5 MiB (100 %) 1.2 MiB/s ETA: 0 s +info: installing component 'rustc' +info: installing component 'rust-std' +info: installing component 'cargo' +info: installing component 'rust-docs' +info: default toolchain set to 'stable' + + stable installed - rustc 1.31.0 (abe02cefd 2018-12-04) + + +Rust is installed now. Great! + +To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH +environment variable. Next time you log in this will be done automatically. + +To configure your current shell run source $HOME/.cargo/env +``` + +Run the following command to configure your current shell. + +``` +$ source $HOME/.cargo/env +``` + +Run the following command to verify the installed Rust version. + +``` +$ rustc --version +rustc 1.31.0 (abe02cefd 2018-12-04) +``` + +### How To Test Rust programming language? + +Once you installed Rust follow the below steps to check whether Rust programe language is working fine or not. + +``` +$ mkdir ~/projects +$ cd ~/projects +$ mkdir hello_world +$ cd hello_world +``` + +Create a file and add the below code and save the file. Make sure, Rust files always end in a .rs extension. + +``` +$ vi 2g.rs + +fn main() { + println!("Hello, It's 2DayGeek.com - Best Linux Practical Blog!"); +} +``` + +Run the following command to compile the rust code. + +``` +$ rustc 2g.rs +``` + +The above command will create a executable Rust program file in the same directory. + +``` +$ ls -lh +total 3.9M +-rwxr-xr-x 1 daygeek daygeek 3.9M Dec 14 11:09 2g +-rw-r--r-- 1 daygeek daygeek 86 Dec 14 11:09 2g.rs +``` + +Run the Rust executable file to get the output. + +``` +$ ./2g +Hello, It's 2DayGeek.com - Best Linux Practical Blog! +``` + +Yup! that’s working fine. + +To update Rust to latest version. + +``` +$ rustup update +info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' +info: checking for self-updates + + stable-x86_64-unknown-linux-gnu unchanged - rustc 1.31.0 (abe02cefd 2018-12-04) +``` + +Run the following command to remove the Rust package from your system. + +``` +$ rustup self uninstall +``` + +Once you uninstalled the Rust package, remove the Rust project directory. + +``` +$ rm -fr ~/projects +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/ + +作者:[Prakash Subramanian][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/prakash/ +[b]: https://github.com/lujun9972 From eb5a7af2f0bf8a5f671483e84417c16e53a7553a Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 17:01:00 +0800 Subject: [PATCH 0996/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20TLP=20=E2=80=93?= =?UTF-8?q?=20An=20Advanced=20Power=20Management=20Tool=20That=20Improve?= =?UTF-8?q?=20Battery=20Life=20On=20Linux=20Laptop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...at Improve Battery Life On Linux Laptop.md | 745 ++++++++++++++++++ 1 file changed, 745 insertions(+) create mode 100644 sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md diff --git a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md new file mode 100644 index 0000000000..e1e6a7f25e --- /dev/null +++ b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -0,0 +1,745 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) +[#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop +====== + +Laptop battery is highly optimized for Windows OS, that i had realized when i was using Windows OS in my laptop but it’s not same for Linux. + +Over the years Linux has improved a lot for battery optimization but still we need make some necessary things to improve laptop battery life in Linux. + +When i think about battery life, i got few options for that but i felt TLP is a better solutions for me so, i’m going with it. + +In this tutorial we are going to discuss about TLP in details to improve battery life. + +We had written three articles previously in our site about **[laptop battery saving utilities][1]** for Linux **[PowerTOP][2]** and **[Battery Charging State][3]**. + +### What is TLP? + +[TLP][4] is a free opensource advanced power management tool that improve your battery life without making any configuration change. + +Since it comes with a default configuration already optimized for battery life, so you may just install and forget it. + +Also, it is highly customizable to fulfill your specific requirements. TLP is a pure command line tool with automated background tasks. It does not contain a GUI. + +TLP runs on every laptop brand. Setting the battery charge thresholds is available for IBM/Lenovo ThinkPads only. + +All TLP settings are stored in `/etc/default/tlp`. The default configuration provides optimized power saving out of the box. + +The following TLP settings is available for customization and you need to make the necessary changes accordingly if you want it. + +### TLP Features + + * Kernel laptop mode and dirty buffer timeouts + * Processor frequency scaling including “turbo boost” / “turbo core” + * Limit max/min P-state to control power dissipation of the CPU + * HWP energy performance hints + * Power aware process scheduler for multi-core/hyper-threading + * Processor performance versus energy savings policy (x86_energy_perf_policy) + * Hard disk advanced power magement level (APM) and spin down timeout (per disk) + * AHCI link power management (ALPM) with device blacklist + * PCIe active state power management (PCIe ASPM) + * Runtime power management for PCI(e) bus devices + * Radeon graphics power management (KMS and DPM) + * Wifi power saving mode + * Power off optical drive in drive bay + * Audio power saving mode + * I/O scheduler (per disk) + * USB autosuspend with device blacklist/whitelist (input devices excluded automatically) + * Enable or disable integrated wifi, bluetooth or wwan devices upon system startup and shutdown + * Restore radio device state on system startup (from previous shutdown). + * Radio device wizard: switch radios upon network connect/disconnect and dock/undock + * Disable Wake On LAN + * Integrated WWAN and bluetooth state is restored after suspend/hibernate + * Untervolting of Intel processors – requires kernel with PHC-Patch + * Battery charge thresholds – ThinkPads only + * Recalibrate battery – ThinkPads only + + + +### How to Install TLP in Linux + +TLP package is available in most of the distributions official repository so, use the distributions **[Package Manager][5]** to install it. + +For **`Fedora`** system, use **[DNF Command][6]** to install TLP. + +``` +$ sudo dnf install tlp tlp-rdw +``` + +ThinkPads require an additional packages. + +``` +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +$ sudo dnf install http://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm +$ sudo dnf install akmod-tp_smapi akmod-acpi_call kernel-devel +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo dnf install smartmontools +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install TLP. + +``` +$ sudo apt install tlp tlp-rdw +``` + +ThinkPads require an additional packages. + +``` +$ sudo apt-get install tp-smapi-dkms acpi-call-dkms +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo apt-get install smartmontools +``` + +When the official package becomes outdated for Ubuntu based systems then use the following PPA repository which provides an up-to-date version. Run the following commands to install TLP using the PPA. + +``` +$ sudo apt-get install tlp tlp-rdw +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install TLP. + +``` +$ sudo pacman -S tlp tlp-rdw +``` + +ThinkPads require an additional packages. + +``` +$ pacman -S tp_smapi acpi_call +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo pacman -S smartmontools +``` + +Enable TLP & TLP-Sleep service on boot for Arch Linux based systems. + +``` +$ sudo systemctl enable tlp.service +$ sudo systemctl enable tlp-sleep.service +``` + +You should also mask the following services to avoid conflicts and assure proper operation of TLP’s radio device switching options for Arch Linux based systems. + +``` +$ sudo systemctl mask systemd-rfkill.service +$ sudo systemctl mask systemd-rfkill.socket +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install TLP. + +``` +$ sudo yum install tlp tlp-rdw +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo yum install smartmontools +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install TLP. + +``` +$ sudo zypper install TLP +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo zypper install smartmontools +``` + +After successfully TLP installed, use the following command to start the service. + +``` +$ systemctl start tlp.service +``` + +To show battery information. + +``` +$ sudo tlp-stat -b +or +$ sudo tlp-stat --battery + +--- TLP 1.1 -------------------------------------------- + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 48850 [mWh] +/sys/class/power_supply/BAT0/energy_now = 48850 [mWh] +/sys/class/power_supply/BAT0/power_now = 0 [mW] +/sys/class/power_supply/BAT0/status = Full + +Charge = 100.0 [%] +Capacity = 81.4 [%] +``` + +To show disk information. + +``` +$ sudo tlp-stat -d +or +$ sudo tlp-stat --disk + +--- TLP 1.1 -------------------------------------------- + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25775 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on +``` + +To show PCI device information. + +``` +$ sudo tlp-stat -e +or +$ sudo tlp-stat --pcie + +--- TLP 1.1 -------------------------------------------- + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) +/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) +/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) +/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) +/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) +/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) +/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) +/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) +/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) +/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) +/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) +/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) +``` + +To show graphics card information. + +``` +$ sudo tlp-stat -g +or +$ sudo tlp-stat --graphics + +--- TLP 1.1 -------------------------------------------- + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) +``` + +To show Processor information. + +``` +$ sudo tlp-stat -p +or +$ sudo tlp-stat --processor + +--- TLP 1.1 -------------------------------------------- + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. +``` + +To show system data information. + +``` +$ sudo tlp-stat -s +or +$ sudo tlp-stat --system + +--- TLP 1.1 -------------------------------------------- + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 596 sec(s) ago +Mode = battery +Power source = battery +``` + +To show temperatures and fan speed information. + +``` +$ sudo tlp-stat -t +or +$ sudo tlp-stat --temp + +--- TLP 1.1 -------------------------------------------- + ++++ Temperatures +CPU temp = 36 [°C] +Fan speed = (not available) +``` + +To show USB device data information. + +``` +$ sudo tlp-stat -u +or +$ sudo tlp-stat --usb + +--- TLP 1.1 -------------------------------------------- + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) +Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) +Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) +``` + +To show warnings. + +``` +$ sudo tlp-stat -w +or +$ sudo tlp-stat --warn + +--- TLP 1.1 -------------------------------------------- + +No warnings detected. +``` + +Status report with configuration and all active settings. + +``` +$ sudo tlp-stat + +--- TLP 1.1 -------------------------------------------- + ++++ Configured Settings: /etc/default/tlp +TLP_ENABLE=1 +TLP_DEFAULT_MODE=AC +TLP_PERSISTENT_DEFAULT=0 +DISK_IDLE_SECS_ON_AC=0 +DISK_IDLE_SECS_ON_BAT=2 +MAX_LOST_WORK_SECS_ON_AC=15 +MAX_LOST_WORK_SECS_ON_BAT=60 +CPU_HWP_ON_AC=balance_performance +CPU_HWP_ON_BAT=balance_power +SCHED_POWERSAVE_ON_AC=0 +SCHED_POWERSAVE_ON_BAT=1 +NMI_WATCHDOG=0 +ENERGY_PERF_POLICY_ON_AC=performance +ENERGY_PERF_POLICY_ON_BAT=power +DISK_DEVICES="sda sdb" +DISK_APM_LEVEL_ON_AC="254 254" +DISK_APM_LEVEL_ON_BAT="128 128" +SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" +SATA_LINKPWR_ON_BAT="med_power_with_dipm max_performance" +AHCI_RUNTIME_PM_TIMEOUT=15 +PCIE_ASPM_ON_AC=performance +PCIE_ASPM_ON_BAT=powersave +RADEON_POWER_PROFILE_ON_AC=default +RADEON_POWER_PROFILE_ON_BAT=low +RADEON_DPM_STATE_ON_AC=performance +RADEON_DPM_STATE_ON_BAT=battery +RADEON_DPM_PERF_LEVEL_ON_AC=auto +RADEON_DPM_PERF_LEVEL_ON_BAT=auto +WIFI_PWR_ON_AC=off +WIFI_PWR_ON_BAT=on +WOL_DISABLE=Y +SOUND_POWER_SAVE_ON_AC=0 +SOUND_POWER_SAVE_ON_BAT=1 +SOUND_POWER_SAVE_CONTROLLER=Y +BAY_POWEROFF_ON_AC=0 +BAY_POWEROFF_ON_BAT=0 +BAY_DEVICE="sr0" +RUNTIME_PM_ON_AC=on +RUNTIME_PM_ON_BAT=auto +RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon pcieport" +USB_AUTOSUSPEND=0 +USB_BLACKLIST_BTUSB=0 +USB_BLACKLIST_PHONE=0 +USB_BLACKLIST_PRINTER=1 +USB_BLACKLIST_WWAN=1 +RESTORE_DEVICE_STATE_ON_STARTUP=0 + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 684 sec(s) ago +Mode = battery +Power source = battery + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. + ++++ Temperatures +CPU temp = 42 [°C] +Fan speed = (not available) + ++++ File System +/proc/sys/vm/laptop_mode = 2 +/proc/sys/vm/dirty_writeback_centisecs = 6000 +/proc/sys/vm/dirty_expire_centisecs = 6000 +/proc/sys/vm/dirty_ratio = 20 +/proc/sys/vm/dirty_background_ratio = 10 + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25777 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on + ++++ PCIe Active State Power Management +/sys/module/pcie_aspm/parameters/policy = powersave + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) + ++++ Wireless +bluetooth = on +wifi = on +wwan = none (no device) + +hci0(btusb) : bluetooth, not connected +wlp8s0(iwlwifi) : wifi, connected, power management = on + ++++ Audio +/sys/module/snd_hda_intel/parameters/power_save = 1 +/sys/module/snd_hda_intel/parameters/power_save_controller = Y + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) +/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) +/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) +/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) +/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) +/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) +/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) +/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) +/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) +/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) +/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) +/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) +Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) +Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 51690 [mWh] +/sys/class/power_supply/BAT0/energy_now = 50140 [mWh] +/sys/class/power_supply/BAT0/power_now = 12185 [mW] +/sys/class/power_supply/BAT0/status = Discharging + +Charge = 97.0 [%] +Capacity = 86.2 [%] +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/ +[2]: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ +[3]: https://www.2daygeek.com/monitor-laptop-battery-charging-state-linux/ +[4]: https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html +[5]: https://www.2daygeek.com/category/package-management/ +[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From ac3e44e5b9e5ef0cae6e8020e47d0cf2eaccbba9 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 17:18:46 +0800 Subject: [PATCH 0997/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=204=20Unique=20Te?= =?UTF-8?q?rminal=20Emulators=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 4 Unique Terminal Emulators for Linux.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/tech/20181204 4 Unique Terminal Emulators for Linux.md diff --git a/sources/tech/20181204 4 Unique Terminal Emulators for Linux.md b/sources/tech/20181204 4 Unique Terminal Emulators for Linux.md new file mode 100644 index 0000000000..04110b670e --- /dev/null +++ b/sources/tech/20181204 4 Unique Terminal Emulators for Linux.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 Unique Terminal Emulators for Linux) +[#]: via: (https://www.linux.com/blog/learn/2018/12/4-unique-terminals-linux) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) + +4 Unique Terminal Emulators for Linux +====== +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_main.jpg?itok=e6av-5VO) +Let’s face it, if you’re a Linux administrator, you’re going to work with the command line. To do that, you’ll be using a terminal emulator. Most likely, your distribution of choice came pre-installed with a default terminal emulator that gets the job done. But this is Linux, so you have a wealth of choices to pick from, and that ideology holds true for terminal emulators as well. In fact, if you open up your distribution’s GUI package manager (or search from the command line), you’ll find a trove of possible options. Of those, many are pretty straightforward tools; however, some are truly unique. + +In this article, I’ll highlight four such terminal emulators, that will not only get the job done, but do so while making the job a bit more interesting or fun. So, let’s take a look at these terminals. + +### Tilda + +[Tilda][1] is designed for Gtk and is a member of the cool drop-down family of terminals. That means the terminal is always running in the background, ready to drop down from the top of your monitor (such as Guake and Yakuake). What makes Tilda rise above many of the others is the number of configuration options available for the terminal (Figure 1). +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_1.jpg?itok=bra6qb6X) + +Tilda can be installed from the standard repositories. On a Ubuntu- (or Debian-) based distribution, the installation is as simple as: + +``` +sudo apt-get install tilda -y +``` + +Once installed, open Tilda from your desktop menu, which will also open the configuration window. Configure the app to suit your taste and then close the configuration window. You can then open and close Tilda by hitting the F1 hotkey. One caveat to using Tilda is that, after the first run, you won’t find any indication as to how to reach the configuration wizard. No worries. If you run the command tilda -C it will open the configuration window, while still retaining the options you’ve previously set. + +Available options include: + + * Terminal size and location + + * Font and color configurations + + * Auto Hide + + * Title + + * Custom commands + + * URL Handling + + * Transparency + + * Animation + + * Scrolling + + * And more + + + + +What I like about these types of terminals is that they easily get out of the way when you don’t need them and are just a button click away when you do. For those that hop in and out of the terminal, a tool like Tilda is ideal. + +### Aterm + +Aterm holds a special place in my heart, as it was one of the first terminals I used that made me realize how flexible Linux was. This was back when AfterStep was my window manager of choice (which dates me a bit) and I was new to the command line. What Aterm offered was a terminal emulator that was highly customizable, while helping me learn the ins and outs of using the terminal (how to add options and switches to a command). “How?” you ask. Because Aterm never had a GUI for customization. To run Aterm with any special options, it had to run as a command. For example, say you want to open Aterm with transparency enabled, green text, white highlights, and no scroll bar. To do this, issue the command: + +``` +aterm -tr -fg green -bg white +xb +``` + +The end result (with the top command running for illustration) would look like that shown in Figure 2. + +![Aterm][3] + +Figure 2: Aterm with a few custom options. + +[Used with permission][4] + +Of course, you must first install Aterm. Fortunately, the application is still found in the standard repositories, so installing on the likes of Ubuntu is as simple as: + +``` +sudo apt-get install aterm -y +``` + +If you want to always open Aterm with those options, your best bet is to create an alias in your ~/.bashrc file like so: + +``` +alias=”aterm -tr -fg green -bg white +sb” +``` + +Save that file and, when you issue the command aterm, it will always open with those options. For more about creating aliases, check out [this tutorial][5]. + +### Eterm + +Eterm is the second terminal that really showed me how much fun the Linux command line could be. Eterm is the default terminal emulator for the Enlightenment desktop. When I eventually migrated from AfterStep to Enlightenment (back in the early 2000s), I was afraid I’d lose out on all those cool aesthetic options. That turned out to not be the case. In fact, Eterm offered plenty of unique options, while making the task easier with a terminal toolbar. With Eterm, you can easily select from a large number of background images (should you want one - Figure 3) by selecting from the Background > Pixmap menu entry. + +![Eterm][7] + +Figure 3: Selecting from one of the many background images for Eterm. + +[Used with permission][4] + +There are a number of other options to configure (such as font size, map alerts, toggle scrollbar, brightness, contrast, and gamma of background images, and more). The one thing you want to make sure is, after you’ve configured Eterm to suit your tastes, to click Eterm > Save User Settings (otherwise, all settings will be lost when you close the app). + +Eterm can be installed from the standard repositories, with a command such as: + +``` +sudo apt-get install eterm +``` + +### Extraterm + +[Extraterm][8] should probably win a few awards for coolest feature set of any terminal window project available today. The most unique feature of Extraterm is the ability to wrap commands in color-coded frames (blue for successful commands and red for failed commands - Figure 4). + +![Extraterm][10] + +Figure 4: Extraterm showing two failed command frames. + +[Used with permission][4] + +When you run a command, Extraterm will wrap the command in an isolated frame. If the command succeeds, the frame will be outlined in blue. Should the command fail, the frame will be outlined in red. + +Extraterm cannot be installed via the standard repositories. In fact, the only way to run Extraterm on Linux (at the moment) is to [download the precompiled binary][11] from the project’s GitHub page, extract the file, change into the newly created directory, and issue the command ./extraterm. + +Once the app is running, to enable frames you must first enable bash integration. To do that, open Extraterm and then right-click anywhere in the window to reveal the popup menu. Scroll until you see the entry for Inject Bash shell Integration (Figure 5). Select that entry and you can then begin using the frames option. + +![Extraterm][13] + +Figure 5: Injecting Bash integration for Extraterm. + +[Used with permission][4] + +If you run a command, and don’t see a frame appear, you probably have to create a new frame for the command (as Extraterm only ships with a few default frames). To do that, click on the Extraterm menu button (three horizontal lines in the top right corner of the window), select Settings, and then click the Frames tab. In this window, scroll down and click the New Rule button. You can then add a command you want to work with the frames option (Figure 6). + +![frames][15] + +Figure 6: Adding a new rule for frames. + +[Used with permission][4] + +If, after this, you still don’t see frames appearing, download the extraterm-commands file from the [Download page][11], extract the file, change into the newly created directory, and issue the command sh setup_extraterm_bash.sh. That should enable frames for Extraterm. +There’s plenty more options available for Extraterm. I’m convinced, once you start playing around with this new take on the terminal window, you won’t want to go back to the standard terminal. Hopefully the developer will make this app available to the standard repositories soon (as it could easily become one of the most popular terminal windows in use). + +### And Many More + +As you probably expected, there are quite a lot of terminals available for Linux. These four represent (at least for me) four unique takes on the task, each of which do a great job of helping you run the commands every Linux admin needs to run. If you aren’t satisfied with one of these, give your package manager a look to see what’s available. You are sure to find something that works perfectly for you. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2018/12/4-unique-terminals-linux + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/jlwallen +[b]: https://github.com/lujun9972 +[1]: http://tilda.sourceforge.net/tildadoc.php +[2]: https://www.linux.com/files/images/terminals2jpg +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_2.jpg?itok=gBkRLwDI (Aterm) +[4]: https://www.linux.com/licenses/category/used-permission +[5]: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands +[6]: https://www.linux.com/files/images/terminals3jpg +[7]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_3.jpg?itok=RVPTJAtK (Eterm) +[8]: http://extraterm.org +[9]: https://www.linux.com/files/images/terminals4jpg +[10]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_4.jpg?itok=2n01qdwO (Extraterm) +[11]: https://github.com/sedwards2009/extraterm/releases +[12]: https://www.linux.com/files/images/terminals5jpg +[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_5.jpg?itok=FdaE1Mpf (Extraterm) +[14]: https://www.linux.com/files/images/terminals6jpg +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_6.jpg?itok=lQ1Zv5wq (frames) From fbc982cce4ebcc088161997d1b87e313020e4104 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 17:26:20 +0800 Subject: [PATCH 0998/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20resolutions?= =?UTF-8?q?=20for=20open=20source=20project=20maintainers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ons for open source project maintainers.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20181212 5 resolutions for open source project maintainers.md diff --git a/sources/talk/20181212 5 resolutions for open source project maintainers.md b/sources/talk/20181212 5 resolutions for open source project maintainers.md new file mode 100644 index 0000000000..122cc3f2d2 --- /dev/null +++ b/sources/talk/20181212 5 resolutions for open source project maintainers.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 resolutions for open source project maintainers) +[#]: via: (https://opensource.com/article/18/12/resolutions-open-source-project-maintainers) +[#]: author: (Ben Cotton https://opensource.com/users/bcotton) + +5 resolutions for open source project maintainers +====== +No matter how you say it, good communication is essential to strong open source communities. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spark_sparkler_fire_new_year_idea.png?itok=rnyMpVP8) + +I'm generally not big on New Year's resolutions. I have no problem with self-improvement, of course, but I tend to anchor around other parts of the calendar. Even so, there's something about taking down this year's free calendar and replacing it with next year's that inspires some introspection. + +In 2017, I resolved to not share articles on social media until I'd read them. I've kept to that pretty well, and I'd like to think it has made me a better citizen of the internet. For 2019, I'm thinking about resolutions to make me a better open source software maintainer. + +Here are some resolutions I'll try to stick to on the projects where I'm a maintainer or co-maintainer. + +### 1\. Include a code of conduct + +Jono Bacon included "not enforcing the code of conduct" in his article "[7 mistakes you're probably making][1]." Of course, to enforce a code of conduct, you must first have a code of conduct. I plan on defaulting to the [Contributor Covenant][2], but you can use whatever you like. As with licenses, it's probably best to use one that's already written instead of writing your own. But the important thing is to find something that defines how you want your community to behave, whatever that looks like. Once it's written down and enforced, people can decide for themselves if it looks like the kind of community they want to be a part of. + +### 2\. Make the license clear and specific + +You know what really stinks? Unclear licenses. "This software is licensed under the GPL" with no further text doesn't tell me much. Which version of the [GPL][3]? Do I get to pick? For non-code portions of a project, "licensed under a Creative Commons license" is even worse. I love the [Creative Commons licenses][4], but there are several different licenses with significantly different rights and obligations. So, I will make it very clear which variant and version of a license applies to my projects. I will include the full text of the license in the repo and a concise note in the other files. + +Sort of related to this is using an [OSI][5]-approved license. It's tempting to come up with a new license that says exactly what you want it to say, but good luck if you ever need to enforce it. Will it hold up? Will the people using your project understand it? + +### 3\. Triage bug reports and questions quickly + +Few things in technology scale as poorly as open source maintainers. Even on small projects, it can be hard to find the time to answer every question and fix every bug. But that doesn't mean I can't at least acknowledge the person. It doesn't have to be a multi-paragraph reply. Even just labeling the GitHub issue shows that I saw it. Maybe I'll get to it right away. Maybe I'll get to it a year later. But it's important for the community to see that, yes, there is still someone here. + +### 4\. Don't push features or bug fixes without accompanying documentation + +For as much as my open source contributions over the years have revolved around documentation, my projects don't reflect the importance I put on it. There aren't many commits I can push that don't require some form of documentation. New features should obviously be documented at (or before!) the time they're committed. But even bug fixes should get an entry in the release notes. If nothing else, a push is a good opportunity to also make a commit to improving the docs. + +### 5\. Make it clear when I'm abandoning a project + +I'm really bad at saying "no" to things. I told the editors I'd write one or two articles for [Opensource.com][6] and here I am almost 60 articles later. Oops. But at some point, the things that once held my interests no longer do. Maybe the project is unnecessary because its functionality got absorbed into a larger project. Maybe I'm just tired of it. But it's unfair to the community (and potentially dangerous, as the recent [event-stream malware injection][7] showed) to leave a project in limbo. Maintainers have the right to walk away whenever and for whatever reason, but it should be clear that they have. + +Whether you're an open source maintainer or contributor, if you know other resolutions project maintainers should make, please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/resolutions-open-source-project-maintainers + +作者:[Ben Cotton][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/article/17/8/mistakes-open-source-avoid +[2]: https://www.contributor-covenant.org/ +[3]: https://opensource.org/licenses/gpl-license +[4]: https://creativecommons.org/share-your-work/licensing-types-examples/ +[5]: https://opensource.org/ +[6]: http://Opensource.com +[7]: https://arstechnica.com/information-technology/2018/11/hacker-backdoors-widely-used-open-source-software-to-steal-bitcoin/ From 1853cb8d91423c81742a97afb339f6d154255f3e Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 17:29:48 +0800 Subject: [PATCH 0999/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Podman=20and=20?= =?UTF-8?q?user=20namespaces:=20A=20marriage=20made=20in=20heaven?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r namespaces- A marriage made in heaven.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20181213 Podman and user namespaces- A marriage made in heaven.md diff --git a/sources/tech/20181213 Podman and user namespaces- A marriage made in heaven.md b/sources/tech/20181213 Podman and user namespaces- A marriage made in heaven.md new file mode 100644 index 0000000000..adc14c6111 --- /dev/null +++ b/sources/tech/20181213 Podman and user namespaces- A marriage made in heaven.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Podman and user namespaces: A marriage made in heaven) +[#]: via: (https://opensource.com/article/18/12/podman-and-user-namespaces) +[#]: author: (Daniel J Walsh https://opensource.com/users/rhatdan) + +Podman and user namespaces: A marriage made in heaven +====== +Learn how to use Podman to run containers in separate user namespaces. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/architecture_structure_planning_design_.png?itok=KL7dIDct) + +[Podman][1], part of the [libpod][2] library, enables users to manage pods, containers, and container images. In my last article, I wrote about [Podman as a more secure way to run containers][3]. Here, I'll explain how to use Podman to run containers in separate user namespaces. + +I have always thought of [user namespace][4], primarily developed by Red Hat's Eric Biederman, as a great feature for separating containers. User namespace allows you to specify a user identifier (UID) and group identifier (GID) mapping to run your containers. This means you can run as UID 0 inside the container and UID 100000 outside the container. If your container processes escape the container, the kernel will treat them as UID 100000. Not only that, but any file object owned by a UID that isn't mapped into the user namespace will be treated as owned by "nobody" (65534, kernel.overflowuid), and the container process will not be allowed access unless the object is accessible by "other" (world readable/writable). + +If you have a file owned by "real" root with permissions [660][5], and the container processes in the user namespace attempt to read it, they will be prevented from accessing it and will see the file as owned by nobody. + +### An example + +Here's how that might work. First, I create a file in my system owned by root. + +``` +$ sudo bash -c "echo Test > /tmp/test" +$ sudo chmod 600 /tmp/test +$ sudo ls -l /tmp/test +-rw-------. 1 root root 5 Dec 17 16:40 /tmp/test +``` + +Next, I volume-mount the file into a container running with a user namespace map 0:100000:5000. + +``` +$ sudo podman run -ti -v /tmp/test:/tmp/test:Z --uidmap 0:100000:5000 fedora sh +# id +uid=0(root) gid=0(root) groups=0(root) +# ls -l /tmp/test +-rw-rw----. 1 nobody nobody 8 Nov 30 12:40 /tmp/test +# cat /tmp/test +cat: /tmp/test: Permission denied +``` + +The **\--uidmap** setting above tells Podman to map a range of 5000 UIDs inside the container, starting with UID 100000 outside the container (so the range is 100000-104999) to a range starting at UID 0 inside the container (so the range is 0-4999). Inside the container, if my process is running as UID 1, it is 100001 on the host + +Since the real UID=0 is not mapped into the container, any file owned by root will be treated as owned by nobody. Even if the process inside the container has **CAP_DAC_OVERRIDE** , it can't override this protection. **DAC_OVERRIDE** enables root processes to read/write any file on the system, even if the process was not owned by root or world readable or writable. + +User namespace capabilities are not the same as capabilities on the host. They are namespaced capabilities. This means my container root has capabilities only within the container—really only across the range of UIDs that were mapped into the user namespace. If a container process escaped the container, it wouldn't have any capabilities over UIDs not mapped into the user namespace, including UID=0. Even if the processes could somehow enter another container, they would not have those capabilities if the container uses a different range of UIDs. + +Note that SELinux and other technologies also limit what would happen if a container process broke out of the container. + +### Using `podman top` to show user namespaces + +We have added features to **podman top** to allow you to examine the usernames of processes running inside a container and identify their real UIDs on the host. + +Let's start by running a sleep container using our UID mapping. + +``` +$ sudo podman run --uidmap 0:100000:5000 -d fedora sleep 1000 +``` + +Now run **podman top** : + +``` +$ sudo podman top --latest user huser +USER   HUSER +root   100000 + +$ ps -ef | grep sleep +100000   21821 21809  0 08:04 ?         00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 1000 +``` + +Notice **podman top** reports that the user process is running as root inside the container but as UID 100000 on the host (HUSER). Also the **ps** command confirms that the sleep process is running as UID 100000. + +Now let's run a second container, but this time we will choose a separate UID map starting at 200000. + +``` +$ sudo podman run --uidmap 0:200000:5000 -d fedora sleep 1000 +$ sudo podman top --latest user huser +USER   HUSER +root   200000 + +$ ps -ef | grep sleep +100000   21821 21809  0 08:04 ?         00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 1000 +200000   23644 23632  1 08:08 ?         00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 1000 +``` + +Notice that **podman top** reports the second container is running as root inside the container but as UID=200000 on the host. + +Also look at the **ps** command—it shows both sleep processes running: one as 100000 and the other as 200000. + +This means running the containers inside separate user namespaces gives you traditional UID separation between processes, which has been the standard security tool of Linux/Unix from the beginning. + +### Problems with user namespaces + +For several years, I've advocated user namespace as the security tool everyone wants but hardly anyone has used. The reason is there hasn't been any filesystem support or a shifting file system. + +In containers, you want to share the **base** image between lots of containers. The examples above use the Fedora base image in each example. Most of the files in the Fedora image are owned by real UID=0. If I run a container on this image with the user namespace 0:100000:5000, by default it sees all of these files as owned by nobody, so we need to shift all of these UIDs to match the user namespace. For years, I've wanted a mount option to tell the kernel to remap these file UIDs to match the user namespace. Upstream kernel storage developers continue to investigate and make progress on this feature, but it is a difficult problem. + + +Podman can use different user namespaces on the same image because of automatic [chowning][6] built into [containers/storage][7] by a team led by Nalin Dahyabhai. Podman uses containers/storage, and the first time Podman uses a container image in a new user namespace, container/storage "chowns" (i.e., changes ownership for) all files in the image to the UIDs mapped in the user namespace and creates a new image. Think of this as the **fedora:0:100000:5000** image. + +When Podman runs another container on the image with the same UID mappings, it uses the "pre-chowned" image. When I run the second container on 0:200000:5000, containers/storage creates a second image, let's call it **fedora:0:200000:5000**. + +Note if you are doing a **podman build** or **podman commit** and push the newly created image to a container registry, Podman will use container/storage to reverse the shift and push the image with all files chowned back to real UID=0. + +This can cause a real slowdown in creating containers in new UID mappings since the **chown** can be slow depending on the number of files in the image. Also, on a normal [OverlayFS][8], every file in the image gets copied up. The normal Fedora image can take up to 30 seconds to finish the chown and start the container. + +Luckily, the Red Hat kernel storage team, primarily Vivek Goyal and Miklos Szeredi, added a new feature to OverlayFS in kernel 4.19. The feature is called **metadata only copy-up**. If you mount an overlay filesystem with **metacopy=on** as a mount option, it will not copy up the contents of the lower layers when you change file attributes; the kernel creates new inodes that include the attributes with references pointing at the lower-level data. It will still copy up the contents if the content changes. This functionality is available in the Red Hat Enterprise Linux 8 Beta, if you want to try it out. + +This means container chowning can happen in a couple of seconds, and you won't double the storage space for each container. + +This makes running containers with tools like Podman in separate user namespaces viable, greatly increasing the security of the system. + +### Going forward + +I want to add a new flag, like **\--userns=auto** , to Podman that will tell it to automatically pick a unique user namespace for each container you run. This is similar to the way SELinux works with separate multi-category security (MCS) labels. If you set the environment variable **PODMAN_USERNS=auto** , you won't even need to set the flag. + +Podman is finally allowing users to run containers in separate user namespaces. Tools like [Buildah][9] and [CRI-O][10] will also be able to take advantage of user namespaces. For CRI-O, however, Kubernetes needs to understand which user namespace will run the container engine, and the upstream is working on that. + +In my next article, I will explain how to run Podman as non-root in a user namespace. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/podman-and-user-namespaces + +作者:[Daniel J Walsh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rhatdan +[b]: https://github.com/lujun9972 +[1]: https://podman.io/ +[2]: https://github.com/containers/libpod +[3]: https://opensource.com/article/18/10/podman-more-secure-way-run-containers +[4]: http://man7.org/linux/man-pages/man7/user_namespaces.7.html +[5]: https://chmodcommand.com/chmod-660/ +[6]: https://en.wikipedia.org/wiki/Chown +[7]: https://github.com/containers/storage +[8]: https://en.wikipedia.org/wiki/OverlayFS +[9]: https://buildah.io/ +[10]: http://cri-o.io/ From 1a70f8d07deb2cac814ad349136a3c13f5c912c8 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Fri, 21 Dec 2018 20:44:38 +0800 Subject: [PATCH 1000/1143] Translated by qhwdw --- ...2 How to Build a Netboot Server, Part 2.md | 127 +++++++++--------- 1 file changed, 63 insertions(+), 64 deletions(-) rename {sources => translated}/tech/20181212 How to Build a Netboot Server, Part 2.md (63%) diff --git a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md b/translated/tech/20181212 How to Build a Netboot Server, Part 2.md similarity index 63% rename from sources/tech/20181212 How to Build a Netboot Server, Part 2.md rename to translated/tech/20181212 How to Build a Netboot Server, Part 2.md index 1d1ce2f68f..8887d84ba1 100644 --- a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md +++ b/translated/tech/20181212 How to Build a Netboot Server, Part 2.md @@ -1,28 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: () +[#]: publisher: () +[#]: url: () [#]: subject: (How to Build a Netboot Server, Part 2) [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) -How to Build a Netboot Server, Part 2 +如何构建一台网络引导服务器(第二部分) ====== ![](https://fedoramagazine.org/wp-content/uploads/2018/12/netboot2-816x345.jpg) -The article [How to Build a Netboot Server, Part 1][1] showed you how to create a netboot image with a “liveuser” account whose home directory lives in volatile memory. Most users probably want to preserve files and settings across reboots, though. So this second part of the netboot series shows how to reconfigure the netboot image from part one so that [Active Directory][2] user accounts can log in and their home directories can be automatically mounted from a NFS server. +在 [如何构建一台网络引导服务器(第一部分)][1] 的文章中,我们展示了如何创建一个网络引导镜像,在那个镜像中使用了一个名为 “liveuser” 帐户,它的 home 目录位于内存中,重启后 home 中的内容将全部消失。然而很多用户都希望机器重启后保存他们的文件和设置。因此,在本系列的第二部分,我们将向你展示如何在第一部分的基础上,重新配置网络引导镜像,使它能够使用 [活动目录][2] 中的用户帐户进行登陆,然后能够从一个 NFS 服务器上自动挂载他们的 home 目录。 -Part 3 of this series will show how to make an interactive and centrally-configurable iPXE boot menu for the netboot clients. +本系列的第三部分,我们将向你展示网络引导客户端如何与中心化配置的 iPXE 引导菜单进行交互。 -### Setup NFS4 Home Directories with KRB5 Authentication +### 设置使用 KRB5 认证的 NFS4 Home 目录 -Follow the directions from the previous post “[Share NFS Home Directories Securely with Kerberos][3],” then return here. +按以前的文章 “[使用 Kerberos 强化共享的 NFS Home 目录安全性][3]” 的指导来做这个设置。 -### Remove the Liveuser Account +### 删除 Liveuser 帐户 -Remove the “liveuser” account created in part one of this series: +删除本系列文章第一部分中创建的 “liveuser” 帐户: ``` $ sudo -i @@ -31,9 +31,9 @@ $ sudo -i # for i in passwd shadow group gshadow; do sed -i '/^liveuser:/d' /fc28/etc/$i; done ``` -### Configure NTP, KRB5 and SSSD +### 配置 NTP、KRB5 和 SSSD -Next, we will need to duplicate the NTP, KRB5, and SSSD configuration that we set up on the server in the client image so that the same accounts will be available: +接下来,我们需要将 NTP、KRB5、和 SSSD 的配置文件复制进客户端使用的镜像中,以便于它们能够使用同一个帐户: ``` # MY_HOSTNAME=$(> /fc28/etc/$i; done ``` -### Join Active Directory +### 连接活动目录 -Next, you’ll perform a chroot to join the client image to Active Directory. Begin by deleting any pre-existing computer account with the same name your netboot image will use: +接下来,你将执行一个 chroot 将客户端镜像连接到活动目录。从删除预置在网络引导镜像中相同的计算机帐户开始: ``` # MY_USERNAME=jsmith @@ -73,20 +73,20 @@ Next, you’ll perform a chroot to join the client image to Active Directory. Be # adcli delete-computer "${MY_CLIENT_HOSTNAME%%.*}" -U "$MY_USERNAME" ``` -Also delete the krb5.keytab file from the netboot image if it exists: +在网络引导镜像中如果有 krb5.keytab 文件,也删除它: ``` # rm -f /fc28/etc/krb5.keytab ``` -Perform a chroot into the netboot image: +在网络引导镜像中执行一个 chroot 操作: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done # chroot /fc28 /usr/bin/bash --login ``` -Perform the join: +执行一个 join 操作: ``` # MY_USERNAME=jsmith @@ -97,7 +97,7 @@ Perform the join: # adcli join $MY_DOMAIN --login-user="$MY_USERNAME" --computer-name="${MY_HOSTNAME%%.*}" --host-fqdn="$MY_HOSTNAME" --user-principal="host/$MY_HOSTNAME@$MY_REALM" --domain-ou="$MY_OU" ``` -Now log out of the chroot and clear the root user’s command history: +现在登出 chroot,并清除命令历史: ``` # logout @@ -105,9 +105,9 @@ Now log out of the chroot and clear the root user’s command history: # > /fc28/root/.bash_history ``` -### Install and Configure PAM Mount +### 安装和配置 PAM Mount -We want our clients to automatically mount the user’s home directory when they log in. To accomplish this, we’ll use the “pam_mount” module. Install and configure pam_mount: +我们希望客户端登入后自动挂载它的 home 目录。为实现这个目的,我们将要使用 “pam_mount” 模块。安装和配置 pam_mount: ``` # dnf install -y --installroot=/fc28 pam_mount @@ -123,7 +123,7 @@ We want our clients to automatically mount the user’s home directory when they END ``` -Reconfigure PAM to use pam_mount: +重新配置 PAM 去使用 pam_mount: ``` # dnf install -y patch @@ -152,24 +152,24 @@ END # chroot /fc28 authselect select custom/sssd with-pammount --force ``` -Also ensure the NFS server’s hostname is always resolvable from the client: +另外,要确保从客户端上总是可解析 NFS 服务器的主机名: ``` # MY_IP=$(host -t A $MY_HOSTNAME | awk '{print $4}') # echo "$MY_IP $MY_HOSTNAME ${MY_HOSTNAME%%.*}" >> /fc28/etc/hosts ``` -Optionally, allow all users to run sudo: +可选,允许所有用户去使用 sudo: ``` # echo '%users ALL=(ALL) NOPASSWD: ALL' > /fc28/etc/sudoers.d/users ``` -### Convert the NFS Root to an iSCSI Backing-Store +### 转换 NFS Root 到一个 iSCSI 背后的存储 -Current versions of nfs-utils may have difficulty establishing a second connection from the client back to the NFS server for home directories when an nfsroot connection is already established. The client hangs when attempting to access the home directory. So, we will work around the problem by using a different protocol (iSCSI) for sharing our netboot image. +在一个 nfsroot 连接建立之后,目前版本的 nfs-utils 可能很难为 home 目录维护一个从客户端到 NFS 服务器的二次连接。当尝试去访问 home 目录时,客户端将被挂住。因此,为了网络引导镜像可共享使用,我们将使用一个不同的协议(iSCSI)来解决这个问题。 -First chroot into the image to reconfigure its initramfs for booting from an iSCSI root: +首先 chroot 到镜像中,去重新配置它的 initramfs,让它从一个 iSCSI root 中去引导: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done @@ -186,18 +186,18 @@ First chroot into the image to reconfigure its initramfs for booting from an iSC # > /fc28/root/.bash_history ``` -The qedi driver broke iscsi during testing, so it’s been disabled here. +在测试时,qedi 驱动会破坏 iscsi,因此我们将它禁用。 -Next, create a fc28.img [sparse file][4]. This file serves as the iSCSI target’s backing store: +接着,创建一个 fc28.img 的 [稀疏文件][4]。这个稀疏文件代表 iSCSI 目标的背后存储: ``` # FC28_SIZE=$(du -ms /fc28 | cut -f 1) # dd if=/dev/zero of=/fc28.img bs=1MiB count=0 seek=$(($FC28_SIZE*2)) ``` -(If you have one available, a separate partition or disk drive can be used instead of creating a file.) +(如果你有一个可使用的稀疏文件、一个单独的分区或磁盘驱动器,就可以代替它了,不用再去创建这个稀疏文件了。) -Next, format the image with a filesystem, mount it, and copy the netboot image into it: +接着,使用一个文件系统去格式化镜像、挂载它、然后将网络引导镜像复制进去: ``` # mkfs -t xfs -L NETROOT /fc28.img @@ -207,19 +207,19 @@ Next, format the image with a filesystem, mount it, and copy the netboot image i # umount $TEMP_MNT ``` -During testing using SquashFS, the client would occasionally stutter. It seems that SquashFS does not perform well when doing random I/O from a multiprocessor client. (See also [The curious case of stalled squashfs reads][5].) If you want to improve throughput performance with filesystem compression, [ZFS][6] is probably a better option. +在使用 SquashFS 测试时,客户端偶尔会出现小状况。似乎是因为 SquashFS 在多处理器客户端上没法执行一个随机 I/O。(更多内容见 [squashfs 读取卡顿的奇怪案例][5])。如果你希望使用一个压缩文件系统来提升吞吐性能,[ZFS][6] 或许是个很好的选择。 -If you need extremely high throughput from the iSCSI server (say, for hundreds of clients), it might be possible to [load balance][7] a [Ceph][8] cluster. For more information, see [Load Balancing Ceph Object Gateway Servers with HAProxy and Keepalived][9]. +如果你对 iSCSI 服务器的吞吐性能要求非常高(比如,成百上千的客户端要连接它),可能需要使用带 [负载均衡][7] 的 [Ceph][8] 集群了。更多相关内容,请查看 [使用 HAProxy 和 Keepalived 负载均衡的 Ceph 对象网关][9]。 -### Install and Configure iSCSI +### 安装和配置 iSCSI -Install the scsi-target-utils package which will provide the iSCSI daemon for serving our image out to our clients: +为了给我们的客户端提供网络引导镜像,安装 scsi-target-utils 包: ``` # dnf install -y scsi-target-utils ``` -Configure the iSCSI daemon to serve the fc28.img file: +配置 iSCSI 守护程序去提供 fc28.img 文件: ``` # MY_REVERSE_HOSTNAME=$(echo $MY_HOSTNAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_HOSTNAME}) @@ -231,9 +231,9 @@ Configure the iSCSI daemon to serve the fc28.img file: END ``` -The leading iqn. is expected by /usr/lib/dracut/modules.d/40network/net-lib.sh. +通过 /usr/lib/dracut/modules.d/40network/net-lib.sh 来指示预期的 iqn。 -Add an exception to the firewall and enable and start the service: +添加一个防火墙例外,并启用和启动这个服务: ``` # firewall-cmd --add-service=iscsi-target @@ -242,13 +242,13 @@ Add an exception to the firewall and enable and start the service: # systemctl start tgtd.service ``` -You should now be able to see the image being shared with the tgtadm command: +你现在应该能够使用 tatadm 命令看到这个共享后的镜像: ``` # tgtadm --mode target --op show ``` -The above command should output something similar to the following: +上述命令的输出应该类似如下的内容: ``` Target 1: iqn.edu.example.server-01:fc28 @@ -290,7 +290,7 @@ Target 1: iqn.edu.example.server-01:fc28 ALL ``` -We can now remove the NFS share that we created in part one of this series: +现在,我们可以去删除本系列文章的第一部分中创建的 NFS 共享了: ``` # rm -f /etc/exports.d/fc28.exports @@ -300,11 +300,11 @@ We can now remove the NFS share that we created in part one of this series: # sed -i '/^\/fc28 /d' /etc/fstab ``` -You can also delete the /fc28 filesystem, but you may want to keep it for performing future updates. +你也可以删除 /fc28 文件系统,但为了以后进一步更新,你可能需要保留它。 -### Update the ESP to use the iSCSI Kernel +### 更新 ESP 去使用 iSCSI 内核 -Ipdate the ESP to contain the iSCSI-enabled initramfs: +更新 ESP 去包含启用了 iSCSI 的 initramfs: ``` $ rm -vf $HOME/esp/linux/*.fc28.* @@ -313,7 +313,7 @@ $ cp $(find /fc28/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $MY_KRNL) $ cp $(find /fc28/boot -name 'init*' | grep -m 1 $MY_KRNL) $HOME/esp/linux/initramfs-$MY_KRNL.img ``` -Update the boot.cfg file to pass the new root and netroot parameters: +更新 boot.cfg 文件去传递新的 root 和 netroot 参数: ``` $ MY_NAME=server-01.example.edu @@ -322,52 +322,52 @@ $ MY_ADDR=$(host -t A $MY_NAME | awk '{print $4}') $ sed -i "s! root=[^ ]*! root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc28-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc28!" $HOME/esp/linux/boot.cfg ``` -Now you just need to copy the updated files from your $HOME/esp/linux directory out to the ESPs of all your client systems. You should see results similar to what is shown in the below screenshot: +现在,你只需要从 $HOME/esp/linux 目录中复制更新后的文件到所有客户端系统的 ESP 中。你应该会看到类似下面屏幕截图的结果: ![][10] -### Upgrading the Image +### 更新镜像 -First, make a copy of the current image: +首先,复制出一个当前镜像的副本: ``` # cp -a /fc28 /fc29 ``` -Chroot into the new copy of the image: +Chroot 进入到镜像的新副本: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc29/$i; done # chroot /fc29 /usr/bin/bash --login ``` -Allow updating the kernel: +允许更新内核: ``` # sed -i 's/^exclude=kernel-\*$/#exclude=kernel-*/' /etc/dnf/dnf.conf ``` -Perform the upgrade: +执行升级: ``` # dnf distro-sync -y --releasever=29 ``` -Prevent the kernel from being updated: +阻止更新过的内核被再次更新: ``` # sed -i 's/^#exclude=kernel-\*$/exclude=kernel-*/' /etc/dnf/dnf.conf ``` -The above command is optional, but saves you from having to copy a new kernel out to the clients if you add or update a few packages in the image at some future time. +上述命令是可选的,但是在以后,如果在镜像中添加和更新了几个包,在你的客户端之外保存有一个最新内核的副本,会在关键时刻对你非常有帮助。 -Clean up dnf’s package cache: +清理 dnf 的包缓存: ``` # dnf clean all ``` -Exit the chroot and clear root’s command history: +退出 chroot 并清理 root 的命令历史: ``` # logout @@ -375,7 +375,7 @@ Exit the chroot and clear root’s command history: # > /fc29/root/.bash_history ``` -Create the iSCSI image: +创建 iSCSI 镜像: ``` # FC29_SIZE=$(du -ms /fc29 | cut -f 1) @@ -387,7 +387,7 @@ Create the iSCSI image: # umount $TEMP_MNT ``` -Define a new iSCSI target that points to our new image and export it: +定义一个新的 iSCSI 目标,指向到新的镜像并导出它: ``` # MY_HOSTNAME=$( Date: Fri, 21 Dec 2018 22:32:27 +0800 Subject: [PATCH 1001/1143] Translating by qhwdw --- ...th PGP - Part 4- Moving Your Master Key to Offline Storage.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md b/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md index df00e7e05e..30c1bba4d5 100644 --- a/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md +++ b/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md @@ -1,3 +1,4 @@ +Translating by qhwdw Protecting Code Integrity with PGP — Part 4: Moving Your Master Key to Offline Storage ====== From 9ff115581de2af14e4a2ecf7db3fefa052eaedeb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 00:20:55 +0800 Subject: [PATCH 1002/1143] PRF:20180710 Users, Groups, and Other Linux Beasts.md @MjSeven --- ...0 Users, Groups, and Other Linux Beasts.md | 59 ++++++++++++------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md b/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md index 477d317d9f..65cbacecb2 100644 --- a/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md +++ b/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md @@ -1,51 +1,58 @@ -用户,组和其他 Linux 用户 +用户、组及其它 Linux 特性 ====== +> Linux 和其他类 Unix 操作系统依赖于用户组,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。 + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/flamingo-2458782_1920.jpg?itok=_gkzGGx5) -到这个阶段,[在看到如何操作目录或文件夹之后][1],但在让自己一头扎进文件之前,我们必须重新审视 _权限_, _users_ 和 _group_。幸运的是,[有一个网站上已经有了一个优秀而全面的教程,包括了权限][2],所以你应该去立刻阅读它。简而言之,你使用权限来确定谁可以对文件和目录执行操作,以及他们可以对每个文件和目录执行什么操作 -- 从中读取,写入,擦除等等。 +到这个阶段,[在看到如何操作目录或文件夹之后][1],但在让自己一头扎进文件之前,我们必须重新审视 _权限_、_用户_ 和 _组_。幸运的是,[有一个网站上已经有了一个优秀而全面的教程,讲到了权限][2],所以你应该去立刻阅读它。简而言之,你使用权限来确定谁可以对文件和目录执行操作,以及他们可以对每个文件和目录执行什么操作 —— 从中读取、写入、移动、擦除等等。 -要尝试本教程涵盖的所有内容,你需要在系统上创建新用户。让我们实践起来,为每一个需要借用你电脑的人创建一个用户,我们称之为 _guest 账户_。 +要尝试本教程涵盖的所有内容,你需要在系统上创建新用户。让我们实践起来,为每一个需要借用你电脑的人创建一个用户,我们称之为 `guest` 账户。 -**警告:** _例如,如果你错误地删除了自己的用户和目录,那么创建,特别是删除用户以及主目录会严重损坏系统。你可能不想在你日常的工作机中练习,那么请在另一台机器或者虚拟机上练习。无论你是否想要安全地练习,经常备份你的东西总是一个好主意。检查备份是否正常工作,为你自己以后避免很多咬牙切齿的事情。_ +**警告:** 例如,如果你错误地删除了自己的用户和目录,那么创建用户,特别是删除用户以及主目录会严重损坏系统。你可能不想在你日常的工作机中练习,那么请在另一台机器或者虚拟机上练习。无论你是否想要安全地练习,经常备份你的东西总是一个好主意。检查备份是否正常工作,为你自己以后避免很多咬牙切齿的事情。 ### 一个新用户 你可以使用 `useradd` 命令来创建一个新用户。使用超级用户或 root 权限运行 `useradd`,即使用 `sudo` 或 `su`,这具体取决于你的系统,你可以: + ``` sudo useradd -m guest ``` 然后输入你的密码。或者也可以这样: + ``` su -c "useradd -m guest" ``` 然后输入 root 或超级用户的密码。 -(_为了简洁起见,我们将从现在开始假设你使用 `sudo` 获得超级用户或 root 权限。_) +( _为了简洁起见,我们将从现在开始假设你使用 `sudo` 获得超级用户或 root 权限。_ ) -通过使用 `-m` 参数,`useradd` 将为新用户创建一个主目录。你可以通过列出 _/home/guest_ 来查看其内容。 +通过使用 `-m` 参数,`useradd` 将为新用户创建一个主目录。你可以通过列出 `/home/guest` 来查看其内容。 然后你可以使用以下命令来为新用户设置密码: + ``` sudo passwd guest ``` -或者你也可以使用 `adduser`,这是一个交互式的命令,它会询问你一些问题,包括你要为用户分配的 shell(是的,不止一个),你希望其主目录在哪里,你希望他们属于哪些组(有关这点稍后会讲到)等等。在运行 `adduser` 结束时,你可以设置密码。注意,默认情况下,在许多发行版中都没有安装 `adduser`,但安装了 `useradd`。 +或者你也可以使用 `adduser`,这是一个交互式的命令,它会询问你一些问题,包括你要为用户分配的 shell(是的,shell 有不止一种),你希望其主目录在哪里,你希望他们属于哪些组(有关这点稍后会讲到)等等。在运行 `adduser` 结束时,你可以设置密码。注意,默认情况下,在许多发行版中都没有安装 `adduser`,但安装了 `useradd`。 顺便说一下,你可以使用 `userdel` 来移除一个用户: + ``` sudo userdel -r guest ``` -使用 `-r` 选项,`userdel` 不仅删除了 _guest_ 用户,还删除了他们的主目录和邮件中的条目(如果有的话)。 +使用 `-r` 选项,`userdel` 不仅删除了 `guest` 用户,还删除了他们的主目录和邮件中的条目(如果有的话)。 -### home 中的内容 +### 主目录中的内容 -谈到用户的主目录,它依赖于你所使用的发行版。你可能已经注意到,当你使用 `-m` 选项时,`useradd` 使用子目录填充用户的目录,包括音乐,文档和诸如此类的内容以及各种各样的隐藏文件。要查看 guest 主目录中的所有内容,运行 `sudo ls -la /home/guest`。 +谈到用户的主目录,它依赖于你所使用的发行版。你可能已经注意到,当你使用 `-m` 选项时,`useradd` 使用子目录填充用户的目录,包括音乐、文档和诸如此类的内容以及各种各样的隐藏文件。要查看 `guest` 主目录中的所有内容,运行 `sudo ls -la /home/guest`。 + +进入新用户目录的内容通常是由 `/etc/skel` 架构目录确定的。有时它可能是一个不同的目录。要检查正在使用的目录,运行: -进入新用户目录的内容通常是由 _/etc/skel_ 架构目录确定的。有时它可能是一个不同的目录。要检查正在使用的目录,运行: ``` useradd -D GROUP=100 @@ -57,31 +64,36 @@ SKEL=/etc/skel CREATE_MAIL_SPOOL=no ``` -这给你一些额外的有趣信息,但你现在感兴趣的是 `SKEL=/etc/skel` 这一行,在这种情况下,按照惯例,它指向 _/etc/skel/_。 +这会给你一些额外的有趣信息,但你现在感兴趣的是 `SKEL=/etc/skel` 这一行,在这种情况下,按照惯例,它指向 `/etc/skel/`。 + +由于 Linux 中的所有东西都是可定制的,因此你可以更改那些放入新创建的用户目录的内容。试试这样做:在 `/etc/skel/` 中创建一个新目录: -由于 Linux 中的所有东西都是可定制的,因此你可以更改那些放入新创建的用户目录的内容。试试这样做:在 _/etc/skel/_ 中创建一个新目录: ``` sudo mkdir /etc/skel/Documents ``` 然后创建一个包含欢迎消息的文件,并将其复制过来: + ``` sudo cp welcome.txt /etc/skel/Documents ``` -现在删除 guest 账户: +现在删除 `guest` 账户: + ``` sudo userdel -r guest ``` 再次创建: + ``` sudo useradd -m guest ``` -嘿 presto!(to 校正:这个 presto 是什么?)你的 _Documents/_ 目录和 _welcome.txt_ 文件神奇地出现在了 guest 的主目录中。 +嘿!你的 `Documents/` 目录和 `welcome.txt` 文件神奇地出现在了 `guest` 的主目录中。 + +你还可以在创建用户时通过编辑 `/etc/default/useradd` 来修改其他内容。我的看起来像这样: -你还可以在创建用户时通过编辑 _/etc/default/useradd_ 来修改其他内容。我的看起来像这样: ``` GROUP=users HOME=/home @@ -96,11 +108,12 @@ CREATE_MAIL_SPOOL=no ### 群组心态 -Linux 和其他类 Unix 操作系统依赖于 _groups_,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。在你的系统上可能有一组允许使用打印机的用户,他们属于 _lp_(即 "_line printer_")组。传统上 _wheel_ 组的成员是唯一可以通过使用 _su_ 成为超级用户或 root 的成员。_network_ 用户组可以启动或关闭网络。还有许多诸如此类的。 +Linux 和其他类 Unix 操作系统依赖于用户组,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。在你的系统上可能有一组允许使用打印机的用户,他们属于 `lp`(即 “_line printer_”)组。传统上 `wheel` 组的成员是唯一可以通过使用 `su` 成为超级用户或 root 的成员。`network` 用户组可以启动或关闭网络。还有许多诸如此类的。 不同的发行版有不同的组,具有相同或相似名称的组具有不同的权限,这也取决于你使用的发行版。因此,如果你在前一段中读到的内容与你系统中的内容不匹配,不要感到惊讶。 -不管怎样g,要查看系统中有哪些组,你可以使用: +不管怎样,要查看系统中有哪些组,你可以使用: + ``` getent group ``` @@ -108,18 +121,20 @@ getent group `getent` 命令列出了某些系统数据库的内容。 要查找当前用户所属的组,尝试: + ``` groups ``` -当你使用 `useradd` 创建新用户时,除非你另行指定,否则用户讲只属于一个组:他们自己。一个 _guest_ 用户属于 _guest_ 组。组使用户有权管理自己的东西,仅此而已。 +当你使用 `useradd` 创建新用户时,除非你另行指定,否则用户将只属于一个组:他们自己。`guest` 用户属于 `guest` 组。组使用户有权管理自己的东西,仅此而已。 你可以使用 `groupadd` 命令创建新组,然后添加用户: + ``` sudo groupadd photos ``` -例如,这将创建 _photos_ 组。下一次,我们将使用它来构建一个共享目录,该组的所有成员都可以读取和写入,我们将更多地了解权限和特权。敬请关注! +例如,这将创建 `photos` 组。下一次,我们将使用它来构建一个共享目录,该组的所有成员都可以读取和写入,我们将更多地了解权限和特权。敬请关注! -------------------------------------------------------------------------------- @@ -129,11 +144,11 @@ via: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-li 作者:[Paul Brown][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[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/) 荣誉推出 [a]:https://www.linux.com/users/bro66 -[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux +[1]:https://linux.cn/article-10066-1.html [2]:https://www.linux.com/learn/understanding-linux-file-permissions [3]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From d6be9d773c9e6e45dda19970cd90a6e7030eabd2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 00:21:31 +0800 Subject: [PATCH 1003/1143] PUB:20180710 Users, Groups, and Other Linux Beasts.md @MjSeven https://linux.cn/article-10370-1.html --- .../20180710 Users, Groups, and Other Linux Beasts.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180710 Users, Groups, and Other Linux Beasts.md (100%) diff --git a/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md b/published/20180710 Users, Groups, and Other Linux Beasts.md similarity index 100% rename from translated/tech/20180710 Users, Groups, and Other Linux Beasts.md rename to published/20180710 Users, Groups, and Other Linux Beasts.md From f6cc86ebfa1572029a17ca13162337f3b79f3d5b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 09:51:55 +0800 Subject: [PATCH 1004/1143] PRF:20181115 3 best practices for continuous integration and deployment.md @ChiZelin --- ...r continuous integration and deployment.md | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/translated/tech/20181115 3 best practices for continuous integration and deployment.md b/translated/tech/20181115 3 best practices for continuous integration and deployment.md index 0706d70544..dcb4bd7c26 100644 --- a/translated/tech/20181115 3 best practices for continuous integration and deployment.md +++ b/translated/tech/20181115 3 best practices for continuous integration and deployment.md @@ -1,31 +1,33 @@ -持续集成与部署的3个最佳实践 +持续集成与部署的 3 个最佳实践 ====== -了解自动化,使用 Git 存储库以及参数化 Jenkins 管道。 + +> 了解自动化,使用 Git 存储库以及参数化 Jenkins 管道。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M) 本文涵盖了三个关键主题:自动化 CI/CD 配置、使用 Git 存储库处理常见的 CI/CD 工件、参数化 Jenkins 管道。 ### 术语 -首先,我们定义一些术语。**CI/CD** 是允许团队快速自动化测试、打包、部署其应用程序的实践。它通常通过利用名为 **[Jenkins][1]** 的服务器来实现,该服务器充当 CI/CD 协调器。Jenkins 侦听特定输入(通常是代码签入后的 Git hook),并在触发时启动管道。 +首先,我们定义一些术语。**CI/CD** 是允许团队快速自动化测试、打包、部署其应用程序的实践。它通常通过利用名为 [Jenkins][1] 的服务器来实现,该服务器充当 CI/CD 协调器。Jenkins 侦听特定输入(通常是代码签入后的 Git 挂钩),并在触发时启动一个管道。 -**pipeline** 由开发和/或运营团队编写的代码组成,这些代码指导 Jenkins 在 CI/CD 过程中采取哪些操作。这个流水线通常类似于“构建我的代码,然后测试我的代码,如果这些测试通过,则把我的应用程序部署到下一个最高环境(通常是开发、测试或生产环境)”。组织通常具有更复杂的流水线,并入了诸如工件存储库和代码分析器之类的工具,但是这提供了一个高级示例。 +管道pipeline 由开发和/或运营团队编写的代码组成,这些代码指导 Jenkins 在 CI/CD 过程中采取哪些操作。这个流水线通常类似于“构建我的代码,然后测试我的代码,如果这些测试通过,则把我的应用程序部署到下一个最高环境(通常是开发、测试或生产环境)”。组织通常具有更复杂的管道,并入了诸如工件存储库和代码分析器之类的工具,这里提供了一个高级示例。 现在我们了解了关键术语,让我们深入研究一些最佳实践。 -### 1\. 自动化是关键 +### 1、自动化是关键 要在 PaaS 上运行 CI/CD,需要在集群上配置适当的基础设施。在这个例子中,我将使用 [OpenShift][2]。 -"Hello, World" 的实现很容易实现。简单地运行 **oc new-app jenkins- ** 和 voilà, 你已经准备好运行 Jenkins 服务器了。然而,在企业中的使用要复杂得多。除了 Jenkins 服务器之外,管理员通常还需要部署代码分析工具(如 SonarQube)和构件库(如 Nexus)。然后,它们必须创建管道来执行 CI/CD 和 Jenkins 从服务器,以减少主服务器的负载。这些实体中的大多数都由 OpenShift 资源支持,需要创建这些资源来部署所需的 CI/CD 基础设施。 +“Hello, World” 的实现很容易实现。简单地运行 `oc new-app jenkins-`,然后,你就有了一个已经就绪的运行中的 Jenkins 服务器了。然而,在企业中的使用要复杂得多。除了 Jenkins 服务器之外,管理员通常还需要部署代码分析工具(如 SonarQube)和工件库(如 Nexus)。然后,它们必须创建管道来执行 CI/CD 和 Jenkins 从服务器,以减少主服务器的负载。这些实体中的大多数都由 OpenShift 资源支持,需要创建这些资源来部署所需的 CI/CD 基础设施。 -最后,部署 CI/CD 组件所需要的手动步骤可能是需要被重复的,并且你可能不想成为执行那些重复步骤的人。为了确保结果能够像以前一样快速、无错误和准确地产生,应该在创建基础设施的方式中结合自动化方法。这可以是一个 Ansible 剧本、一个 Bash 脚本,或者任何您希望自动化 CI/CD 基础设施部署的其他方式。我已经使用 [Ansible][3] 和 [OpenShift-Applier][4] 角色来自动化我的实现。您可能会发现这些工具很有价值,或者您可能会发现其他一些对您和组织更有效的工具。无论哪种方式,您都将发现自动化显著地减少了重新创建 CI/CD 组件所需的工作量。 +最后,部署 CI/CD 组件所需要的手动步骤可能是需要重复进行的,而且你可能不想成为执行那些重复步骤的人。为了确保结果能够像以前一样快速、无错误和准确地产生,应该在创建基础设施的方式中结合自动化方法。这可以是一个 Ansible 剧本、一个 Bash 脚本,或者任何您希望自动化 CI/CD 基础设施部署的其它方式。我已经使用 [Ansible][3] 和 [OpenShift-Applier][4] 角色来自动化我的实现。您可能会发现这些工具很有价值,或者您可能会发现其他一些对您和组织更有效的工具。无论哪种方式,您都将发现自动化显著地减少了重新创建 CI/CD 组件所需的工作量。 -#### 配置Jenkins主服务器 +#### 配置 Jenkins 主服务器 -除了一般的“自动化”之外,我想单独介绍一下 Jenkins 主服务器,并讨论管理员如何利用 OpenShift 来自动化配置 Jenkins。来自 [Red Hat Container Catalog][5] 的 Jenkins 映像已经安装了 [OpenShift-Sync plugin][6]。在 [视频][7] 中,我们将讨论如何使用这个插件来创建 Jenkins 管道和从设备。 +除了一般的“自动化”之外,我想单独介绍一下 Jenkins 主服务器,并讨论管理员如何利用 OpenShift 来自动化配置 Jenkins。来自 [Red Hat Container Catalog][5] 的 Jenkins 镜像已经安装了 [OpenShift-Sync plugin][6]。在 [该视频][7] 中,我们将讨论如何使用这个插件来创建 Jenkins 管道和从设备。 -要创建 Jenkins 流水线,请创建一个类似于下面的 OpenShift BuildConfig: +要创建 Jenkins 管道,请创建一个类似于下面的 OpenShift BuildConfig: ``` apiVersion: v1 @@ -43,7 +45,7 @@ spec:       type: JenkinsPipeline ``` -OpenShift-Sync 插件将注意到已经创建了带有 **jenkinsPipelineStrategy** 策略的 BuildConfig,并将其转换为 Jenkins 管道,从 Git 源指定的 Jenkins 文件中提取。也可以使用内联 Jenkinsfile,而不是从 Git 存储库中提取。有关更多信息,请参阅[文档][8]。 +OpenShift-Sync 插件将注意到已经创建了带有 `jenkinsPipelineStrategy` 策略的 BuildConfig,并将其转换为 Jenkins 管道,从 Git 源指定的 Jenkinsfile 中提取。也可以使用内联 Jenkinsfile,而不是从 Git 存储库中提取。有关更多信息,请参阅[文档][8]。 要创建 Jenkins 从站,请创建一个 OpenShift ImageStream,它从以下定义开始: @@ -55,12 +57,12 @@ metadata:     slave-label: jenkins-slave     labels:       role: jenkins-slave -… +... ``` -注意在这个 ImageStream 中定义的元数据。OpenShift-Sync 插件将把带有标签 **role: jenkins-slave** 的任何ImageStream 转换为 Jenkins 从站。Jenkins 从站将以 **slave-label** 注释中的值命名。 +注意在这个 ImageStream 中定义的元数据。OpenShift-Sync 插件将把带有标签 `role: jenkins-slave` 的任何 ImageStream 转换为 Jenkins 从站。Jenkins 从站将以 `slave-label` 注释中的值命名。 -ImageStreams 对于简单的 Jenkins 从属配置工作得很好,但是一些团队会发现有必要配置一些细节详情,比如资源限制、准备就绪和活动性探测,以及实例帽。这就是 ConfigMap 发挥作用的地方: +ImageStreams 对于简单的 Jenkins 从属配置工作得很好,但是一些团队会发现有必要配置一些细节详情,比如资源限制、准备就绪和活动性探测,以及实例上限。这就是 ConfigMap 发挥作用的地方: ``` apiVersion: v1 @@ -74,21 +76,21 @@ data:     ``` -注意,仍然需要角色:jenkins-slave 标签来将 ConfigMap 转换为 Jenkins slave。Kubernetes pod 模板由一长段 XML 组成,它将根据组织的喜好配置每个细节。要查看此 XML,以及有关将 ImageStreams 和 ConfigMaps 转换为 Jenkins 从属的更多信息,请参阅[文档][9]。 +注意,仍然需要角色:`jenkins-slave` 标签来将 ConfigMap 转换为 Jenkins 从站。Kubernetes pod 模板由一长段 XML 组成,它将根据组织的喜好配置每个细节。要查看此 XML,以及有关将 ImageStreams 和 ConfigMaps 转换为 Jenkins 从站的更多信息,请参阅[文档][9]。 请注意上面所示的三个示例,其中没有一个操作需要管理员对 Jenkins 控制台进行手动更改。通过使用 OpenShift 资源,可以简单的自动化方式配置 Jenkins。 -### 2\. 分享就是关心 +### 2、分享就是关爱 -第二个最佳实践是维护一个公共 CI/CD 工件的 Git 存储库。主要思想是防止团队重新发明轮子。假设您的团队需要执行到 OpenShift 环境的蓝色/绿色部署,作为管道 CD 阶段的一部分。负责编写流水线的团队成员可能不是 OpenShift 专家,也不可能具有从头开始编写此功能的能力。幸运的是,有人已经编写了一个将此功能合并到一个公共 CI/CD 存储库中的函数,因此您的团队可以使用该函数而不是花时间编写一个函数。 +第二个最佳实践是维护一个公共 CI/CD 工件的 Git 存储库。主要思想是防止团队重新发明轮子。假设您的团队需要执行到 OpenShift 环境的蓝/绿部署,作为管道 CD 阶段的一部分。负责编写管道的团队成员可能不是 OpenShift 专家,也不可能具有从头开始编写此功能的能力。幸运的是,有人已经编写了一个将此功能合并到一个公共 CI/CD 存储库中的函数,因此您的团队可以使用该函数而不是花时间编写一个函数。 -为了更进一步,您的组织可能决定维护整个管道。您可能会发现团队正在编写具有相似功能的流水线。对于那些团队来说,使用来自公共存储库的参数化管道要比从头开始编写自己的管道更有效。 +为了更进一步,您的组织可能决定维护整个管道。您可能会发现团队正在编写具有相似功能的管道。对于那些团队来说,使用来自公共存储库的参数化管道要比从头开始编写自己的管道更有效。 -### 3\. 少即是多 +### 3、少即是多 正如我在前一节中提到的,第三个也是最后一个最佳实践是参数化您的 CI/CD 管道。参数化将防止过多的管道,使您的 CI/CD 系统更容易维护。假设我有多个区域可以部署应用程序。如果没有参数化,我需要为每个区域设置单独的管道。 -要参数化作为 OpenShift 构建配置编写的管道,请将 **env** 节添加到配置: +要参数化一个作为 OpenShift 构建配置编写的管道,请将 `env` 节添加到配置: ``` ... @@ -103,9 +105,9 @@ spec:     type: JenkinsPipeline ``` -使用此配置,我可以传递 **REGION** 参数管道以将我的应用程序部署到指定区域。 +使用此配置,我可以传递 `REGION` 参数给管道以将我的应用程序部署到指定区域。 -这有一个[视频][7]提供了一个更实质性的情况,其中参数化是必须的。一些组织决定把他们的 CI/CD 管道分割成单独的 CI 和 CD 管道,通常是因为在部署之前有一些审批过程。假设我有四个映像和三个不同的环境要部署。如果没有参数化,我需要12个 CD 管道来允许所有部署可能性。这会很快失去控制。为了使 CD 流水线的维护更容易,组织会发现将映像和环境参数化以便允许一个流水线执行多个流水线的工作会更好。 +这有一个[视频][7]提供了一个更实质性的情况,其中参数化是必须的。一些组织决定把他们的 CI/CD 管道分割成单独的 CI 和 CD 管道,通常是因为在部署之前有一些审批过程。假设我有四个镜像和三个不同的环境要部署。如果没有参数化,我需要 12 个 CD 管道来允许所有部署可能性。这会很快失去控制。为了使 CD 流水线的维护更容易,组织会发现将镜像和环境参数化以便允许一个流水线执行多个流水线的工作会更好。 ### 总结 @@ -120,7 +122,7 @@ via: https://opensource.com/article/18/11/best-practices-cicd 作者:[Austin Dewey][a] 选题:[lujun9972][b] 译者:[ChiZelin](https://github.com/ChiZelin) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ce87014d8bf3389133f112890f0dc615e0f62f5b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 09:52:33 +0800 Subject: [PATCH 1005/1143] PUB:20181115 3 best practices for continuous integration and deployment.md @ChiZelin https://linux.cn/article-10371-1.html --- ... 3 best practices for continuous integration and deployment.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181115 3 best practices for continuous integration and deployment.md (100%) diff --git a/translated/tech/20181115 3 best practices for continuous integration and deployment.md b/published/20181115 3 best practices for continuous integration and deployment.md similarity index 100% rename from translated/tech/20181115 3 best practices for continuous integration and deployment.md rename to published/20181115 3 best practices for continuous integration and deployment.md From 7f591fb8429bfc305297884650d1ce453ecb3dba Mon Sep 17 00:00:00 2001 From: qhwdw Date: Sat, 22 Dec 2018 11:58:14 +0800 Subject: [PATCH 1006/1143] Translated by qhwdw --- ...ving Your Master Key to Offline Storage.md | 168 ------------------ ...ving Your Master Key to Offline Storage.md | 167 +++++++++++++++++ 2 files changed, 167 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md create mode 100644 translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md diff --git a/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md b/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md deleted file mode 100644 index 30c1bba4d5..0000000000 --- a/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md +++ /dev/null @@ -1,168 +0,0 @@ -Translating by qhwdw -Protecting Code Integrity with PGP — Part 4: Moving Your Master Key to Offline Storage -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/industry-1920.jpg?itok=gI3QraS8) -In this tutorial series, we're providing practical guidelines for using PGP. You can catch up on previous articles here: - -[Part 1: Basic Concepts and Tools][1] - -[Part 2: Generating Your Master Key][2] - -[Part 3: Generating PGP Subkeys][3] - -Here in part 4, we continue the series with a look at how and why to move your master key from your home directory to offline storage. Let's get started. - -### Checklist - - * Prepare encrypted detachable storage (ESSENTIAL) - - * Back up your GnuPG directory (ESSENTIAL) - - * Remove the master key from your home directory (NICE) - - * Remove the revocation certificate from your home directory (NICE) - - - - -#### Considerations - -Why would you want to remove your master [C] key from your home directory? This is generally done to prevent your master key from being stolen or accidentally leaked. Private keys are tasty targets for malicious actors -- we know this from several successful malware attacks that scanned users' home directories and uploaded any private key content found there. - -It would be very damaging for any developer to have their PGP keys stolen -- in the Free Software world, this is often tantamount to identity theft. Removing private keys from your home directory helps protect you from such events. - -##### Back up your GnuPG directory - -**!!!Do not skip this step!!!** - -It is important to have a readily available backup of your PGP keys should you need to recover them (this is different from the disaster-level preparedness we did with paperkey). - -##### Prepare detachable encrypted storage - -Start by getting a small USB "thumb" drive (preferably two!) that you will use for backup purposes. You will first need to encrypt them: - -For the encryption passphrase, you can use the same one as on your master key. - -##### Back up your GnuPG directory - -Once the encryption process is over, re-insert the USB drive and make sure it gets properly mounted. Find out the full mount point of the device, for example by running the mount command (under Linux, external media usually gets mounted under /media/disk, under Mac it's /Volumes). - -Once you know the full mount path, copy your entire GnuPG directory there: -``` -$ cp -rp ~/.gnupg [/media/disk/name]/gnupg-backup - -``` - -(Note: If you get any Operation not supported on socket errors, those are benign and you can ignore them.) - -You should now test to make sure everything still works: -``` -$ gpg --homedir=[/media/disk/name]/gnupg-backup --list-key [fpr] - -``` - -If you don't get any errors, then you should be good to go. Unmount the USB drive and distinctly label it, so you don't blow it away next time you need to use a random USB drive. Then, put in a safe place -- but not too far away, because you'll need to use it every now and again for things like editing identities, adding or revoking subkeys, or signing other people's keys. - -##### Remove the master key - -The files in our home directory are not as well protected as we like to think. They can be leaked or stolen via many different means: - - * By accident when making quick homedir copies to set up a new workstation - - * By systems administrator negligence or malice - - * Via poorly secured backups - - * Via malware in desktop apps (browsers, pdf viewers, etc) - - * Via coercion when crossing international borders - - - - -Protecting your key with a good passphrase greatly helps reduce the risk of any of the above, but passphrases can be discovered via keyloggers, shoulder-surfing, or any number of other means. For this reason, the recommended setup is to remove your master key from your home directory and store it on offline storage. - -###### Removing your master key - -Please see the previous section and make sure you have backed up your GnuPG directory in its entirety. What we are about to do will render your key useless if you do not have a usable backup! - -First, identify the keygrip of your master key: -``` -$ gpg --with-keygrip --list-key [fpr] - -``` - -The output will be something like this: -``` -pub rsa4096 2017-12-06 [C] [expires: 2019-12-06] - 111122223333444455556666AAAABBBBCCCCDDDD - Keygrip = AAAA999988887777666655554444333322221111 -uid [ultimate] Alice Engineer -uid [ultimate] Alice Engineer -sub rsa2048 2017-12-06 [E] - Keygrip = BBBB999988887777666655554444333322221111 -sub rsa2048 2017-12-06 [S] - Keygrip = CCCC999988887777666655554444333322221111 - -``` - -Find the keygrip entry that is beneath the pub line (right under the master key fingerprint). This will correspond directly to a file in your home .gnupg directory: -``` -$ cd ~/.gnupg/private-keys-v1.d -$ ls -AAAA999988887777666655554444333322221111.key -BBBB999988887777666655554444333322221111.key -CCCC999988887777666655554444333322221111.key - -``` - -All you have to do is simply remove the .key file that corresponds to the master keygrip: -``` -$ cd ~/.gnupg/private-keys-v1.d -$ rm AAAA999988887777666655554444333322221111.key - -``` - -Now, if you issue the --list-secret-keys command, it will show that the master key is missing (the # indicates it is not available): -``` -$ gpg --list-secret-keys -sec# rsa4096 2017-12-06 [C] [expires: 2019-12-06] - 111122223333444455556666AAAABBBBCCCCDDDD -uid [ultimate] Alice Engineer -uid [ultimate] Alice Engineer -ssb rsa2048 2017-12-06 [E] -ssb rsa2048 2017-12-06 [S] - -``` - -##### Remove the revocation certificate - -Another file you should remove (but keep in backups) is the revocation certificate that was automatically created with your master key. A revocation certificate allows someone to permanently mark your key as revoked, meaning it can no longer be used or trusted for any purpose. You would normally use it to revoke a key that, for some reason, you can no longer control -- for example, if you had lost the key passphrase. - -Just as with the master key, if a revocation certificate leaks into malicious hands, it can be used to destroy your developer digital identity, so it's better to remove it from your home directory. -``` -cd ~/.gnupg/openpgp-revocs.d -rm [fpr].rev - -``` - -Next time, you'll learn how to secure your subkeys as well. Stay tuned. - -Learn more about Linux through the free ["Introduction to Linux" ][4]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage - -作者:[Konstantin Ryabitsev][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/mricon -[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools -[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key -[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys -[4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md b/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md new file mode 100644 index 0000000000..8ca36884d9 --- /dev/null +++ b/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md @@ -0,0 +1,167 @@ +用 PGP 保护代码完整性(四):将主密钥移到离线存储中 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/industry-1920.jpg?itok=gI3QraS8) +在本系列教程中,我们为使用 PGP 提供了一个实用指南。你可以从下面的链接中查看前面的文章: + +[第一部分:基本概念和工具][1] + +[第二部分:生成你的主密钥][2] + +[第三部分:生成 PGP 子密钥][3] + +这是本系列教程的第四部分,我们继续本教程,我们将谈一谈如何及为什么要将主密钥从你的 Home 目录移到离线存储中。现在开始我们的教程。 + +### 清单 + + * 准备一个加密的可移除的存储(必要) + + * 备份你的 GnuPG 目录(必要) + + * 从你的 Home 目录中删除主密钥(推荐) + + * 从你的 Home 目录中删除吊销证书(推荐) + + + + +#### Considerations + +为什么要从你的 Home 目录中删除你的主密钥 [C] ?这样做的主要原因是防止你的主密钥失窃或意外泄露。对于心怀不轨的人来说,私钥对他们具有很大的诱惑力 —— 我们知道有几个恶意软件成功地实现了扫描用户的 Home 目录并将发现的任何私钥内容上传。 + +对于任何开发者来说,私钥失窃是非常危险的事情 —— 在自由软件的世界中,这无疑是身份证明失窃。从你的 Home 目录中删除私钥将帮你防范这类事件的发生。 + +##### 备份你的 GnuPG 目录 + +**!!!绝对不要跳过这一步!!!** + +备份你的 PGP 密钥将让你在需要的时候很容易地恢复它们,这很重要!(这与我们做的使用 paperkey 的灾难级备份是不一样的)。 + +##### 准备可移除的加密存储 + +我们从取得一个(最好是两个)小型的 USB “拇指“ 驱动器(可加密 U 盘)开始,我们将用它来做备份。你首先需要去加密它们: + +加密密码可以使用与主密钥相同的密码。 + +##### 备份你的 GnuPG 目录 + +加密过程结束之后,重新插入 USB 驱动器并确保它能够正常挂载。你可以通过运行 `mount` 命令去找到设备挂载点的完全路径。(在 Linux 下,外置介质一般挂载在 /media/disk 下,Mac 一般在它的 /Volumes 下) + +你知道了挂载点的全路径后,将你的整个 GnuPG 的目录复制进去: +``` +$ cp -rp ~/.gnupg [/media/disk/name]/gnupg-backup + +``` + +(注意:如果出现任何套接字不支持的错误,没有关系,直接忽略它们。) + +现在,用如下的命令去测试一下,确保它们能够正常地工作: +``` +$ gpg --homedir=[/media/disk/name]/gnupg-backup --list-key [fpr] + +``` + +如果没有出现任何错误,说明一切正常。弹出这个 USB 驱动器并给它粘上一个明确的标签,以便于你下次需要它时能够很快找到它。接着,将它放到一个安全的 —— 但不要太远 —— 的地方,因为从现在起,你需要偶尔使用它来做一些像编辑身份信息、添加或吊销子证书、或签署其它人的密钥这样的事情。 + +##### 删除主密钥 + +我们 Home 目录中的文件并没有像我们所想像的那样受到保护。它们可能会通过许多不同的方式被泄露或失窃: + + * 通过快速复制来配置一个新工作站时的偶尔事故 + + * 通过系统管理员的疏忽或恶意操作 + + * 通过安全性欠佳的备份 + + * 通过桌面应用中的恶意软件(浏览器、pdf 查看器等等) + + * 通过跨境胁迫 + + + + +使用一个很好的密码来保护你的密钥是降低上述风险的一个很好方法,但是密码能够通过键盘记录器、背后窥视、或其它方式被发现。基于以上原因,我们建议去配置一个从你的 Home 目录上可移除的主密钥,将它保存在一个离线存储中。 + +###### 删除主密钥 + +**请查看前面的节,确保你有完整的你的 GnuPG 目录的一个备份。如果你没有一个可用的备份,下面所做的操作将会使你的主密钥失效!!!** + +首先,识别你的主密钥的 keygrip: +``` +$ gpg --with-keygrip --list-key [fpr] + +``` + +它的输出应该像下面这样: +``` +pub rsa4096 2017-12-06 [C] [expires: 2019-12-06] + 111122223333444455556666AAAABBBBCCCCDDDD + Keygrip = AAAA999988887777666655554444333322221111 +uid [ultimate] Alice Engineer +uid [ultimate] Alice Engineer +sub rsa2048 2017-12-06 [E] + Keygrip = BBBB999988887777666655554444333322221111 +sub rsa2048 2017-12-06 [S] + Keygrip = CCCC999988887777666655554444333322221111 + +``` + +找到 pub 行下方的 keygrip 条目(就在主密钥指纹的下方)。它与你的 Home 目录下 `.gnupg` 目录下的一个文件是一致的: +``` +$ cd ~/.gnupg/private-keys-v1.d +$ ls +AAAA999988887777666655554444333322221111.key +BBBB999988887777666655554444333322221111.key +CCCC999988887777666655554444333322221111.key + +``` + +现在你做的全部操作就是简单地删除与主密钥 keygrip 一致的 `.key` 文件: +``` +$ cd ~/.gnupg/private-keys-v1.d +$ rm AAAA999988887777666655554444333322221111.key + +``` + +现在,如果运行 --list-secret-keys 命令将出现问题,它将显示主密钥丢失(# 表示不可用): +``` +$ gpg --list-secret-keys +sec# rsa4096 2017-12-06 [C] [expires: 2019-12-06] + 111122223333444455556666AAAABBBBCCCCDDDD +uid [ultimate] Alice Engineer +uid [ultimate] Alice Engineer +ssb rsa2048 2017-12-06 [E] +ssb rsa2048 2017-12-06 [S] + +``` + +##### 删除吊销证书 + +你应该去删除的另一个文件是吊销证书(**删除之前,确保你的备份中有它**),它是使用你的主密钥自动创建的。吊销证书允许一些人去永久标记你的证书为吊销状态,这意味着它无论在任何用途中将不再被使用或信任。一般是使用它来吊销由于某些原因不再受控的一个密钥 —— 比如,你丢失了密钥密码。 + +与使用主密钥一样,如果一个吊销证书泄露到恶意者手中,他们能够使用它去破坏你的开发者数字身份,因此,最好是从你的 Home 目录中删除它。 +``` +cd ~/.gnupg/openpgp-revocs.d +rm [fpr].rev + +``` + +在下一篇文章中,你将学习如何保护你的子密钥。敬请期待。 + +从来自 Linux 基金会和 edX 的免费课程 [“Linux 入门" ][4] 中学习更多 Linux 知识。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage + +作者:[Konstantin Ryabitsev][a] +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/mricon +[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools +[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key +[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys +[4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 22fce8a05011eb6382039c69021e153b7a91f081 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Sat, 22 Dec 2018 12:03:45 +0800 Subject: [PATCH 1007/1143] Translating by qhwdw --- ...ity with PGP - Part 5- Moving Subkeys to a Hardware Device.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md b/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md index ac862ff64e..8463598b4c 100644 --- a/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md +++ b/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md @@ -1,3 +1,4 @@ +Translating by qhwdw Protecting Code Integrity with PGP — Part 5: Moving Subkeys to a Hardware Device ====== From 69ca64dc5dbde7f012857a84669c3d5b33f5adaa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 18:16:25 +0800 Subject: [PATCH 1008/1143] PRF:20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @geekpi --- ...on Ubuntu and Other Linux Distributions.md | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md index 886d5ce5e8..f365ce1f32 100644 --- a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md +++ b/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions) @@ -10,11 +10,11 @@ 如何在 Ubuntu 和其他 Linux 发行版上安装 Putty ====== -如果我没错,[Putty][1] 可能是 Windows 最受欢迎的 SSH 客户端。 +如果我没弄错,[Putty][1] 可能是 Windows 最受欢迎的 SSH 客户端。 -I在 IT 公司中,开发环境通常在远程 Linux 系统上,而开发人员则使用 Windows 作为本地系统。Putty 用于从 Windows 机器连接到远程 Linux 系统。 +在 IT 公司中,开发环境通常在远程 Linux 系统上,而开发人员则使用 Windows 作为本地系统。Putty 用于从 Windows 机器连接到远程 Linux 系统。 -Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源软件。 +Putty 不是限定于 Windows 的。你也可以在 Linux 和 macOS 上使用此开源软件。 但是等等!当你已经拥有“真正的” Linux 终端时,为什么要在 Linux 上使用单独的 SSH 客户端?这有几个想在 Linux 上使用 Putty 的原因。 @@ -22,8 +22,6 @@ Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源 * 你发现很难手动编辑 SSH 配置文件以保存各种 SSH 会话。你更喜欢 Putty 图形化保存 SSH 连接的方式。 * 你想通过连接到原始套接字和串口进行调试。 - - 无论是什么原因,如果你想在 Ubuntu 或任何其他 Linux 上使用 Putty,你当然可以这样做。让我告诉你如何做到。 ### 在 Ubuntu Linux 上安装 Putty @@ -38,7 +36,7 @@ Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源 sudo add-apt-repository universe ``` -启用 universe 存储库后,应使用以下命令更新 Ubuntu: +启用 universe 仓库后,应使用以下命令更新 Ubuntu: ``` sudo apt update @@ -56,13 +54,13 @@ sudo apt install putty ![Putty in Linux][3] -当你输入远程系统的[主机名][4]或 IP 地址并连接到它时,Putty 将使用你主目录中已保存的 SSH 密钥。 +当你输入远程系统的[主机名][4]或 IP 地址并连接到它时,Putty 将使用你已保存在主目录中的 SSH 密钥。 ![Using Putty in Ubuntu Linux][5] ### 在其他 Linux 发行版上安装 Putty -[Putty 可用于 Debian][6],所以你只需要使用 apt-get 或 aptitude 来安装它。 +[Putty 可用于 Debian][6],所以你只需要使用 `apt-get` 或 `aptitude` 来安装它。 ``` sudo apt-get install putty @@ -82,7 +80,7 @@ sudo pacman -S putty 请记住,Putty 是一款开源软件。如果你真的想要,你也可以通过源代码安装它。你可以从下面的链接获取 Putty 的源代码。 -[下载 Putty 源代码][8] +- [下载 Putty 源代码][8] 我一直喜欢原生 Linux 终端而不是像 Putty 这样的 SSH 客户端。我觉得 GNOME 终端或 [Terminator][7] 更有家的感觉。但是,在 Linux 中使用默认终端或 Putty 是个人选择。 @@ -95,7 +93,7 @@ via: https://itsfoss.com/putty-linux/ 作者:[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/) 荣誉推出 @@ -108,4 +106,4 @@ via: https://itsfoss.com/putty-linux/ [5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1 [6]: https://packages.debian.org/jessie/putty [7]: https://launchpad.net/terminator -[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html \ No newline at end of file +[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html From 372c6927d49946ebc6d969176688f45a56815c16 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 18:18:58 +0800 Subject: [PATCH 1009/1143] PUB:20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @geekpi https://linux.cn/article-10373-1.html --- ...o Install Putty on Ubuntu and Other Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md (98%) diff --git a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/published/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md similarity index 98% rename from translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md rename to published/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md index f365ce1f32..980eb43558 100644 --- a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md +++ b/published/20181211 How to Install Putty on 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-10373-1.html) [#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/putty-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From deda2a3e472aa3f494d9fdc630c7d60ab1037f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 22 Dec 2018 19:45:31 +0800 Subject: [PATCH 1010/1143] Update and rename sources/tech/20180130 Graphics and music tools for game development.md to translated/tech/20180130 Graphics and music tools for game development.md --- ...cs and music tools for game development.md | 180 ------------------ ...cs and music tools for game development.md | 177 +++++++++++++++++ 2 files changed, 177 insertions(+), 180 deletions(-) delete mode 100644 sources/tech/20180130 Graphics and music tools for game development.md create mode 100644 translated/tech/20180130 Graphics and music tools for game development.md diff --git a/sources/tech/20180130 Graphics and music tools for game development.md b/sources/tech/20180130 Graphics and music tools for game development.md deleted file mode 100644 index db2cd04f3b..0000000000 --- a/sources/tech/20180130 Graphics and music tools for game development.md +++ /dev/null @@ -1,180 +0,0 @@ -robsean translating -Graphics and music tools for game development -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Life_opengame.png?itok=JPxruL3k) - -In early October, our club, [Geeks and Gadgets][1] from Marshall University, participated in the inaugural [Open Jam][2], a game jam that celebrated the best of open source tools. Game jams are events where participants work as teams to develop computer games for fun. Jams tend to be very short--only three days long--and very exhausting. Opensource.com [announced][3] Open Jam in late August, and more than [three dozen games][4] were entered into the competition. - -Our club likes to create and use open source software in our projects, so Open Jam was naturally the jam we wanted to participate in. Our submission was an experimental game called [Mark My Words][5]. We used a variety of free and open source (FOSS) tools to develop it; in this article we'll discuss some of the tools we used and potential stumbling blocks to be aware of. - -### Audio tools - -#### MilkyTracker - -[MilkyTracker][6] is one of the best software packages available for composing old-style video game music. It is an example of a [music tracker][7], a powerful MOD and XM file creator with a characteristic grid-based pattern editor. We used it to compose most of the musical pieces in our game. One of the great things about this program is that it consumed much less disk space and RAM than most of our other tools. Even so, MilkyTracker is still extremely powerful. - -![](https://opensource.com/sites/default/files/u128651/mtracker.png) - -The user interface took a while to get used to, so here are some pointers for any musician who wants to try out MilkyTracker: - - * Go to Config > Misc. and set the edit mode control style to "MilkyTracker." This will give you modern keyboard shortcuts for almost everything - * Undo with Ctrl+Z - * Redo with Ctrl+Y - * Toggle pattern-edit mode with the Spacebar - * Delete the previous note with the Backspace key - * Insert a row with the Insert key - * By default, a note will continue playing until it is replaced on that channel. You can end a note explicitly by inserting a KeyOff note with the backquote (`) key - * You will have to create or find samples before you can start composing. We recommend finding [Creative Commons][8] licensed samples at websites such as [Freesound][9] or [ccMixter][10] - - - -In addition, keep the [MilkyTracker documentation page][11] handy. It contains links to numerous tutorials and manuals. A good starting point is the [MilkyTracker Guide][12] on the project's wiki. - -#### LMMS - -Two of our musicians used the versatile and modern music creation tool [LMMS][13]. It comes with a library of cool samples and effects, plus a variety of flexible plugins for generating unique sounds. The learning curve for LMMS was surprisingly low, in part due to the nice beat/bassline editor. - -![](https://opensource.com/sites/default/files/u128651/lmms_plugins.png) - -We have one suggestion for musicians trying out LMMS: Use the plugins. For [chiptune][14]-style music, we recommend [sfxr][15], [BitInvader][16], and [FreeBoy][17]. For other styles, [ZynAddSubFX][18] is a good choice. It comes with a wide range of synthesized instruments that can be altered however you see fit. - -### Graphics tools - -#### Tiled - -[Tiled][19] is a popular tilemap editor in open source game development. We used it to assemble consistent, retro-looking backgrounds for our in-game scenes. - -![](https://opensource.com/sites/default/files/u128651/tiled.png) - -Tiled can export maps as XML, JSON, or as flattened images. It is stable and cross-platform. - -One of Tiled's features, which we did not use during the jam, allows you to define and place arbitrary game objects, such as coins and powerups, onto the map. All you have to do is load the object's graphics as a tileset, then place them using Insert Tile. - -Overall, Tiled is a stellar piece of software that we recommend for any project that needs a map editor. - -#### Piskel - -[Piskel][20] is a pixel art editor whose source code is licensed under the [Apache License, Version 2.0][21]. We used Piskel for almost all our graphical assets during the jam, and we will certainly be using it in future projects as well. - -Two features of Piskel that helped us immensely during the jam are onion skin and spritesheet exporting. - -##### Onion skin - -The onion skin feature will make Piskel show a ghostly overlay of the previous and next frames of your animation as you edit, like this: - -![](https://opensource.com/sites/default/files/u128651/onionshow.gif) - -Onion skin is handy because it serves as a drawing guide and helps you maintain consistent shapes and volumes on your characters throughout the animation process. To enable it, just click the onion-shaped icon underneath the preview window on the top-right of the screen. - -![](https://opensource.com/sites/default/files/u128651/onionenable.png) - -##### Spritesheet exporting - -Piskel's ability to export animations as a spritesheet was also very helpful. A spritesheet is a single raster image that contains all the frames of an animation. For example, here is a spritesheet we exported from Piskel: - -![](https://opensource.com/sites/default/files/u128651/sprite-artist.png) - -The spritesheet consists of two frames. One frame is in the top half of the image and the other frame is in the bottom half of the image. Spritesheets greatly simplify a game's code by enabling an entire animation to be loaded from a single file. Here is an animated version of the above spritesheet: - -![](https://opensource.com/sites/default/files/u128651/sprite-artist-anim.gif) - -##### Unpiskel.py - -There were several times during the jam when we wanted to batch convert Piskel files into PNGs. Since the Piskel file format is based on JSON, we wrote a small GPLv3-licensed Python script called [unpiskel.py][22] to do the conversion. - -It is invoked like this: -``` - - -python unpiskel.py input.piskel -``` - -The script will extract the PNG data frames and layers from a Piskel file (here `input.piskel`) and store them in their own files. The files follow the pattern `NAME_XX_YY.png` where `NAME` is the truncated name of the Piskel file, `XX` is the frame number, and `YY` is the layer number. - -Because the script can be invoked from a shell, it can be used on a whole list of files. -``` -for f in *.piskel; do python unpiskel.py "$f"; done -``` - -### Python, Pygame, and cx_Freeze - -#### Python and Pygame - -We used the [Python][23] language to make our game. It is a scripting language that is commonly used for text processing and desktop app development. It can also be used for game development, as projects like [Angry Drunken Dwarves][24] and [Ren'Py][25] have shown. Both of these projects use a Python library called [Pygame][26] to display graphics and produce sound, so we decided to use this library in Open Jam, too. - -Pygame turned out to be both stable and featureful, and it was great for the arcade-style game we were creating. The library's speed was fast enough at low resolutions, but its CPU-only rendering starts to slow down at higher resolutions. This is because Pygame does not use hardware-accelerated rendering. However, the infrastructure is there for developers to take full advantage of OpenGL. - -If you're looking for a good 2D game programming library, Pygame is one to keep your eye on. Its website has [a good tutorial][27] to get started. Be sure to check it out! - -#### cx_Freeze - -Prepping our game for distribution was interesting. We knew that Windows users were unlikely to have a Python installation, and asking them to install it would have been too much. On top of that, they would have had to also install Pygame, which is not an intuitive task on Windows. - -One thing was clear: We had to put our game into a more convenient form. Many of the other Open Jam participants used the proprietary game engine Unity, which enabled their games to be played in the web browser. This made them extremely convenient to play. Convenience was one thing our game didn't have even a sliver of. But, thanks to a vibrant Python ecosystem, we had options. Tools exist to help Python programmers prepare their programs for distribution on Windows. The two that we considered were [cx_Freeze][28] and [Pygame2exe][29] (which uses [py2exe][30]). We decided on cx_Freeze because it was cross-platform. - -In cx_Freeze, you can pack a single-script game for distribution just by running a command like this in the shell: -``` -cxfreeze main.py --target-dir dist -``` - -This invocation of `cxfreeze` will take your script (here `main.py`) and the Python interpreter on your system and bundle them up into the `dist` directory. Once this is done, all you have to do is manually copy your game's data files into the `dist` directory. You will find that the `dist` directory contains an executable file that can be run to start your game. - -There is a more involved way to use cx_Freeze that allows you to automate the copying of data files, but we found the straightforward invocation of `cxfreeze` to be good enough for our needs. Thanks to this tool, we made our game a little more convenient to play. - -### Celebrating open source - -Open Jam is important because it celebrates the open source model of software development. This is an opportunity to analyze the current state of open source tools and what we need to work on in the future. Game jams are perhaps the best time for game devs to try to push their tools to the limit, to learn what must be improved for the good of future game devs. - -Open source tools enable people to explore their creativity without compromising their freedom and without investing money upfront. Although we might not become professional game developers, we were still able to get a small taste of it with our short, experimental game called [Mark My Words][5]. It is a linguistically themed game that depicts the evolution of a fictional writing system throughout its history. There were many other delightful submissions to Open Jam, and they are all worth checking out. Really, [go look][31]! - -Before closing, we would like to thank all the [club members who participated][32] and made this experience truly worthwhile. We would also like to thank [Michael Clayton][33], [Jared Sprague][34], and [Opensource.com][35] for hosting Open Jam. It was a blast. - -Now, we have some questions for readers. Are you a FOSS game developer? What are your tools of choice? Be sure to leave a comment below! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/1/graphics-music-tools-game-dev - -作者:[Charlie Murphy][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/rsg167 -[1]:http://mugeeks.org/ -[2]:https://itch.io/jam/open-jam-1 -[3]:https://opensource.com/article/17/8/open-jam-announcement -[4]:https://opensource.com/article/17/11/open-jam -[5]:https://mugeeksalpha.itch.io/mark-omy-words -[6]:http://milkytracker.titandemo.org/ -[7]:https://en.wikipedia.org/wiki/Music_tracker -[8]:https://creativecommons.org/ -[9]:https://freesound.org/ -[10]:http://ccmixter.org/view/media/home -[11]:http://milkytracker.titandemo.org/documentation/ -[12]:https://github.com/milkytracker/MilkyTracker/wiki/MilkyTracker-Guide -[13]:https://lmms.io/ -[14]:https://en.wikipedia.org/wiki/Chiptune -[15]:https://github.com/grimfang4/sfxr -[16]:https://lmms.io/wiki/index.php?title=BitInvader -[17]:https://lmms.io/wiki/index.php?title=FreeBoy -[18]:http://zynaddsubfx.sourceforge.net/ -[19]:http://www.mapeditor.org/ -[20]:https://www.piskelapp.com/ -[21]:https://github.com/piskelapp/piskel/blob/master/LICENSE -[22]:https://raw.githubusercontent.com/MUGeeksandGadgets/MarkMyWords/master/tools/unpiskel.py -[23]:https://www.python.org/ -[24]:https://www.sacredchao.net/~piman/angrydd/ -[25]:https://renpy.org/ -[26]:https://www.Pygame.org/ -[27]:http://Pygame.org/docs/tut/PygameIntro.html -[28]:https://anthony-tuininga.github.io/cx_Freeze/ -[29]:https://Pygame.org/wiki/Pygame2exe -[30]:http://www.py2exe.org/ -[31]:https://itch.io/jam/open-jam-1/entries -[32]:https://github.com/MUGeeksandGadgets/MarkMyWords/blob/3e1e8aed12ebe13acccf0d87b06d4f3bd124b9db/README.md#credits -[33]:https://twitter.com/mwcz -[34]:https://twitter.com/caramelcode -[35]:https://opensource.com/ diff --git a/translated/tech/20180130 Graphics and music tools for game development.md b/translated/tech/20180130 Graphics and music tools for game development.md new file mode 100644 index 0000000000..1cdb157bc4 --- /dev/null +++ b/translated/tech/20180130 Graphics and music tools for game development.md @@ -0,0 +1,177 @@ +用于游戏开发的图形和音乐工具 +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Life_opengame.png?itok=JPxruL3k) + +在十月初,我们的俱乐部,来自马歇尔大学的 [Geeks and Gadgets][1] , 参加就职 [Open Jam][2], 一个游戏 jam ,庆祝最好的开源工具。游戏 jams 是参与者为娱乐像团队协作的来开发计算机游戏的事件。Jams 倾向于非常简短--仅三天时间长--并非常让人精疲力尽。Opensource.com 在八月下旬 [宣布][3] Open Jam ,更多 [three dozen games][4] 进入到竞赛中。 + +我们的俱乐部希望在我们的工程中创建和使用开放源码软件,所以 Open Jam 自然是我们想要参与的 jam 。我们的提交的文件是一个实验性的名称为 [Mark My Words][5] 的游戏。我们使用多种自由和开放源码 (FOSS) 工具来开发它;在这篇文章中,我们将讨论一些我们使用和意识到有潜在的障碍物的工具。 + +### 音频工具 + +#### MilkyTracker + +[MilkyTracker][6] 是最好的可用于构成旧样式电子游戏音乐的软件包中的一个。它是一个 [music tracker][7] 的一个示例,一个强大的带有特殊的基于网格的图形编辑器的 MOD 和 XM 文件创建器。在我们的游戏中,我们使用它来构成大多数的音乐片段。这个程序最好的特点是,它比我们其它的大多数工具消耗更少的硬盘空间和 RAM 。虽然如此,MilkyTracker 仍然非常强大。 + +![](https://opensource.com/sites/default/files/u128651/mtracker.png) + +用户界面需要一会来习惯,这里有对一些想试用MilkyTracker的音乐家的一些提示: + + * 转到 Config > Misc. ,设置 edit 模式控制样式为 "MilkyTracker." 这将给你几乎所有的现代键盘快捷方式 + * 撤销 Ctrl+Z + * 重做 Ctrl+Y + * 切换 pattern-edit 模式 空格键 + * 删除先前的注释 退格键 + * 插入一行 Insert键 + * 默认情况下,一个注释将持续作用,直到它在这频道上被替换。你可以明确地结束一个注释,通过使用一个反引号 (`) 键插入一个 KeyOff 注释 + * 在你开始谱写乐曲前,你将不得不创建或查找示例。我们建议在网站上查找 [Creative Commons][8] 协议的示例,例如 [Freesound][9] 或 [ccMixter][10] + + + +另外,保持 [MilkyTracker 文档页面][11] 在手边。它含有数不清的教程和手册的链接。一个好的开始点是在该项目 wiki 上的 [MilkyTracker 指南][12] 。 + +#### LMMS + +我们中的两个音乐家使用多用途和现代音乐创建工具 [LMMS][13] 。它带来一个绝妙的示例和效果库,加一个灵活的多种多样的插件来生成独特的声音。 The learning curve for LMMS 的学习曲线令人吃惊的低,在某种程度上是因为友好的节拍/低音线编辑器。 + +![](https://opensource.com/sites/default/files/u128651/lmms_plugins.png) + +我们对音乐家有一个建议,尝试 LMMS:使用插件。 对于 [chiptune][14]-样式音乐,我们推荐 [sfxr][15] ,[BitInvader][16] ,和 [FreeBoy][17] 。对于其它样式, [ZynAddSubFX][18] 是一个好的选择。它带来一个宽波段的可以被你任意更改的人工合成工具。 + +### 图形工具 + +#### Tiled + +在开放源码游戏开发中,[Tiled][19] 是一个流行的组件地图类(tilemap)编辑器。我们使用它为来为我们在游戏场景中组合连续的,复古的背景。 + +![](https://opensource.com/sites/default/files/u128651/tiled.png) + +Tiled 可以导出地图为 XM L,JSON ,或平坦的图像。它是稳定的和跨平台的。 + +Tiled 的特征一,在 jam 期间,我们不能使用, 允许你定义和随意的放置游戏对象,例如硬币和永久能力提升道具到地图上。你需要做的全部是加载对象的图像为一个平铺显示集,然后使用插入平铺显示放置它们。 + +一般来说,对于一些需要一个地图编辑器的工程,Tiled 是我们建议软件的一个主要的部分。 + +#### Piskel + +[Piskel][20] 是一个像素艺术编辑器,它的源文件代码是在 [Apache 协议, 版本 2.0][21] 协议下。在 jam 期间,我们对我们的大多数的图像资源使用 Piskel ,我们当然也将在未来的工程中使用它。 + +Piskel 的特征二,在 jam 的 onion skin和Spritesheet导出期间极大地帮助我们。 + +##### Onion skin + +onion skin 特征将使 Piskel 显示你编辑的动画的前一帧和后一帧的一个幽灵似的覆盖物,像这样: + +![](https://opensource.com/sites/default/files/u128651/onionshow.gif) + +Onion skin 是便于使用的,因为它适合作为一个绘制指南和在动画进程期间帮助你维护在你的角色上连续的图形和声音。为启用它,只需要在屏幕的右上方预览窗体的下面单击 onion-shaped 图标。 + +![](https://opensource.com/sites/default/files/u128651/onionenable.png) + +##### Spritesheet 导出 + +Piskel 的能力是导出动画为一个 spritesheet ,也是非常有用的。一个 spritesheet 是一个单个光栅图象,它包含一个动画的所有的帧。例如,这是一个我们从 Piskel 导出的 spritesheet : + +![](https://opensource.com/sites/default/files/u128651/sprite-artist.png) + +spritesheet 包含两幅帧。一幅帧是图像的上半部分,另一帧是图像的下半部分。Spritesheets 通过启用一个完整的动画来从单个文件加载,大大地简化一个游戏的代码。这是上面的 spritesheet 的一个动画版本: + +![](https://opensource.com/sites/default/files/u128651/sprite-artist-anim.gif) + +##### Unpiskel.py + +在 jam 期间,我们很多次想批量转换 Piskel 文件到 PNG 文件。尽管 Piskel 文件格式基于 JSON ,我们写一个小的 GPLv3 协议的称为 [unpiskel.py][22] 的 Python 脚本来做转换。 + +它像这样被引用: +``` +python unpiskel.py input.piskel +``` + +这个脚本将从一个 Piskel 文件(这里 `input.piskel`)中提取 PNG 数据帧和层,并存储它们在它们拥有的文件中。这些文件采用模式 `NAME_XX_YY.png` ,在这里 `NAME` 是 Piskel 文件的缩减名称,`XX` 是帧的编号,`YY` 是层的编号。 + +因为脚本可以从一个 shell 中引用,它可以被使用在文件的整个列表中。 +``` +for f in *.piskel; do python unpiskel.py "$f"; done +``` + +### Python, Pygame, 和 cx_Freeze + +#### Python 和 Pygame + +我们使用 [Python][23] 语言来自制作我们的游戏。它是一个脚本语言,通常被用于文本处理和桌面应用程序开发。它也可以用于游戏开发,例如工程,像 [Angry Drunken Dwarves][24] 和 [Ren'Py][25] 已经显示。这两个工程都使用一个称为 [Pygame][26] 的 Python 库来显示图形和产生声音,所以我们也决定在 Open Jam 中使用这个库。 + +Pygame 被证明是既稳定又富有特色,并且它对我们创建的街机游戏来说是优秀的。在低分辨率时,库的速度足够快的,但是在高分辨率时,它的仅 CPU 渲染开始变慢。这是因为 Pygame 不使用硬件加速渲染。然而,开发者可以充分利用 OpenGL 基础设施。 + +如果你正在寻找一个好的 2D 游戏编程库,Pygame 是值得密切注意的一个。它的网站有 [一个好的教程][27] 来开始。务必看看它! + +#### cx_Freeze + +准备发行我们的游戏是有趣的。我们知道,Windows 用户不喜欢有一个 Python 安装,并且要求他们来安装它可能很过分。除此之外,他们也可能不得不安装 Pygame ,在 Windows 上,这不是一个简单的工作。 + +有一件事很清楚:我们不得不放置我们的游戏到一个更方便的结构中。很多其他的 Open Jam 参与者使用专有的游戏引擎 Unity ,它能够使它们的游戏在网页浏览器中来玩。这使得它们非常方便地来玩。便利性是一个我们的游戏恰巧一丝的都没有的东西。但是,感谢生机勃勃的 Python 生态系统,我们有选择。在 Windows 上现有的工具帮助 Python 程序员准备发行他们的游戏。我们考虑的两个是 [cx_Freeze][28] 和 [Pygame2exe][29] (它使用 [py2exe][30])。我们下决心在 cx_Freeze 上,因为它是跨平台的。 + +在 cx_Freeze 中,你可以为发行版打包一个单个脚本游戏,只要在shell运行一个命令,像这样: +``` +cxfreeze main.py --target-dir dist +``` + +`cxfreeze` 的这个调用将拿你的脚本(这里 `main.py`) 和在你系统上的 Python 解释器,并捆绑定它们到 `dist` 目录。一旦完成它,你需要做的是手动复制你的游戏的数据文件到 `dist` 目录。你将发现,`dist` 目录包含一个可以运行来开始你的游戏的可执行文件。 + +这里有更复杂难解的方法来使用 cx_Freeze ,允许你自动地复制数据文件,但是我们发现简单的调用 `cxfreeze` 足够我们的需要。感谢这个工具,我们使我们的游戏稍微便利的运行。 + +### 庆祝开放源码 + +Open Jam 是重要的,因为它庆祝软件开发的开放源码模式。这是来分析开放源码工具的当前状态和我们在未来工作中需求的一个机会。,对于游戏开发者来设法推动它们的工具的使用范围,学习必需提高未来游戏开发者的益处,游戏 jams 或许是最好的时间。 + +开放源码工具使人们能够探索他们的创造性,而不妥协他们的自由和前期的投资。尽管我们可能不能成为专业的游戏开发者,我们仍然能获取它的一段小的体验,使用我们简短的,实验性的称为 [Mark My Words][5] 的游戏。它是一个语言学方面地的有特定主题的游戏,它描述一个小说写作系统在它历史期间的演化。Open Jam 有一些令人愉快的提交,并且它们是值得校核。真的, [去看看][31] ! + +在结束前,我们想要感谢所有的 [参加俱乐部的成员][32],使这次经历真正的有价值。我们也想要感谢 [Michael Clayton][33],[Jared Sprague][34] 和 [Opensource.com][35] 主办 open Jam。它是一次欢乐。 + +现在,我们对读者有一些问题。你是一个 FOSS 游戏开发者吗?你选择的工具是什么?务必在下面留下一个评论! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/1/graphics-music-tools-game-dev + +作者:[Charlie Murphy][a] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/rsg167 +[1]:http://mugeeks.org/ +[2]:https://itch.io/jam/open-jam-1 +[3]:https://opensource.com/article/17/8/open-jam-announcement +[4]:https://opensource.com/article/17/11/open-jam +[5]:https://mugeeksalpha.itch.io/mark-omy-words +[6]:http://milkytracker.titandemo.org/ +[7]:https://en.wikipedia.org/wiki/Music_tracker +[8]:https://creativecommons.org/ +[9]:https://freesound.org/ +[10]:http://ccmixter.org/view/media/home +[11]:http://milkytracker.titandemo.org/documentation/ +[12]:https://github.com/milkytracker/MilkyTracker/wiki/MilkyTracker-Guide +[13]:https://lmms.io/ +[14]:https://en.wikipedia.org/wiki/Chiptune +[15]:https://github.com/grimfang4/sfxr +[16]:https://lmms.io/wiki/index.php?title=BitInvader +[17]:https://lmms.io/wiki/index.php?title=FreeBoy +[18]:http://zynaddsubfx.sourceforge.net/ +[19]:http://www.mapeditor.org/ +[20]:https://www.piskelapp.com/ +[21]:https://github.com/piskelapp/piskel/blob/master/LICENSE +[22]:https://raw.githubusercontent.com/MUGeeksandGadgets/MarkMyWords/master/tools/unpiskel.py +[23]:https://www.python.org/ +[24]:https://www.sacredchao.net/~piman/angrydd/ +[25]:https://renpy.org/ +[26]:https://www.Pygame.org/ +[27]:http://Pygame.org/docs/tut/PygameIntro.html +[28]:https://anthony-tuininga.github.io/cx_Freeze/ +[29]:https://Pygame.org/wiki/Pygame2exe +[30]:http://www.py2exe.org/ +[31]:https://itch.io/jam/open-jam-1/entries +[32]:https://github.com/MUGeeksandGadgets/MarkMyWords/blob/3e1e8aed12ebe13acccf0d87b06d4f3bd124b9db/README.md#credits +[33]:https://twitter.com/mwcz +[34]:https://twitter.com/caramelcode +[35]:https://opensource.com/ From fb1bdd6d48ef62ce095f5724c4bc52f4dab3c4c0 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Sat, 22 Dec 2018 21:29:44 +0800 Subject: [PATCH 1011/1143] Translated by qhwdw --- ... 5- Moving Subkeys to a Hardware Device.md | 304 ------------------ ... 5- Moving Subkeys to a Hardware Device.md | 304 ++++++++++++++++++ 2 files changed, 304 insertions(+), 304 deletions(-) delete mode 100644 sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md create mode 100644 translated/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md diff --git a/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md b/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md deleted file mode 100644 index 8463598b4c..0000000000 --- a/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md +++ /dev/null @@ -1,304 +0,0 @@ -Translating by qhwdw -Protecting Code Integrity with PGP — Part 5: Moving Subkeys to a Hardware Device -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/pgp-keys.jpg?itok=aS6IWGpq) - -In this tutorial series, we're providing practical guidelines for using PGP. If you missed the previous article, you can catch up with the links below. But, in this article, we'll continue our discussion about securing your keys and look at some tips for moving your subkeys to a specialized hardware device. - -[Part 1: Basic Concepts and Tools][1] - -[Part 2: Generating Your Master Key][2] - -[Part 3: Generating PGP Subkeys][3] - -[Part 4: Moving Your Master Key to Offline Storage][4] - -### Checklist - - * Get a GnuPG-compatible hardware device (NICE) - - * Configure the device to work with GnuPG (NICE) - - * Set the user and admin PINs (NICE) - - * Move your subkeys to the device (NICE) - - - - -### Considerations - -Even though the master key is now safe from being leaked or stolen, the subkeys are still in your home directory. Anyone who manages to get their hands on those will be able to decrypt your communication or fake your signatures (if they know the passphrase). Furthermore, each time a GnuPG operation is performed, the keys are loaded into system memory and can be stolen from there by sufficiently advanced malware (think Meltdown and Spectre). - -The best way to completely protect your keys is to move them to a specialized hardware device that is capable of smartcard operations. - -#### The benefits of smartcards - -A smartcard contains a cryptographic chip that is capable of storing private keys and performing crypto operations directly on the card itself. Because the key contents never leave the smartcard, the operating system of the computer into which you plug in the hardware device is not able to retrieve the private keys themselves. This is very different from the encrypted USB storage device we used earlier for backup purposes -- while that USB device is plugged in and decrypted, the operating system is still able to access the private key contents. Using external encrypted USB media is not a substitute to having a smartcard-capable device. - -Some other benefits of smartcards: - - * They are relatively cheap and easy to obtain - - * They are small and easy to carry with you - - * They can be used with multiple devices - - * Many of them are tamper-resistant (depends on manufacturer) - - - - -#### Available smartcard devices - -Smartcards started out embedded into actual wallet-sized cards, which earned them their name. You can still buy and use GnuPG-capable smartcards, and they remain one of the cheapest available devices you can get. However, actual smartcards have one important downside: they require a smartcard reader, and very few laptops come with one. - -For this reason, manufacturers have started providing small USB devices, the size of a USB thumb drive or smaller, that either have the microsim-sized smartcard pre-inserted, or that simply implement the smartcard protocol features on the internal chip. Here are a few recommendations: - - * [Nitrokey Start][5]: Open hardware and Free Software: one of the cheapest options for GnuPG use, but with fewest extra security features - - * [Nitrokey Pro][6]: Similar to the Nitrokey Start, but is tamper-resistant and offers more security features (but not U2F, see the Fido U2F section of the guide) - - * [Yubikey 4][7]: Proprietary hardware and software, but cheaper than Nitrokey Pro and comes available in the USB-C form that is more useful with newer laptops; also offers additional security features such as U2F - - - - -Our recommendation is to pick a device that is capable of both smartcard functionality and U2F, which, at the time of writing, means a Yubikey 4. - -#### Configuring your smartcard device - -Your smartcard device should Just Work (TM) the moment you plug it into any modern Linux or Mac workstation. You can verify it by running: -``` -$ gpg --card-status - -``` - -If you didn't get an error, but a full listing of the card details, then you are good to go. Unfortunately, troubleshooting all possible reasons why things may not be working for you is way beyond the scope of this guide. If you are having trouble getting the card to work with GnuPG, please seek support via your operating system's usual support channels. - -##### PINs don't have to be numbers - -Note, that despite having the name "PIN" (and implying that it must be a "number"), neither the user PIN nor the admin PIN on the card need to be numbers. - -Your device will probably have default user and admin PINs set up when it arrives. For Yubikeys, these are 123456 and 12345678, respectively. If those don't work for you, please check any accompanying documentation that came with your device. - -##### Quick setup - -To configure your smartcard, you will need to use the GnuPG menu system, as there are no convenient command-line switches: -``` -$ gpg --card-edit -[...omitted...] -gpg/card> admin -Admin commands are allowed -gpg/card> passwd - -``` - -You should set the user PIN (1), Admin PIN (3), and the Reset Code (4). Please make sure to record and store these in a safe place -- especially the Admin PIN and the Reset Code (which allows you to completely wipe the smartcard). You so rarely need to use the Admin PIN, that you will inevitably forget what it is if you do not record it. - -Getting back to the main card menu, you can also set other values (such as name, sex, login data, etc), but it's not necessary and will additionally leak information about your smartcard should you lose it. - -#### Moving the subkeys to your smartcard - -Exit the card menu (using "q") and save all changes. Next, let's move your subkeys onto the smartcard. You will need both your PGP key passphrase and the admin PIN of the card for most operations. Remember, that [fpr] stands for the full 40-character fingerprint of your key. -``` -$ gpg --edit-key [fpr] - -Secret subkeys are available. - -pub rsa4096/AAAABBBBCCCCDDDD - created: 2017-12-07 expires: 2019-12-07 usage: C - trust: ultimate validity: ultimate -ssb rsa2048/1111222233334444 - created: 2017-12-07 expires: never usage: E -ssb rsa2048/5555666677778888 - created: 2017-12-07 expires: never usage: S -[ultimate] (1). Alice Engineer -[ultimate] (2) Alice Engineer - -gpg> - -``` - -Using --edit-key puts us into the menu mode again, and you will notice that the key listing is a little different. From here on, all commands are done from inside this menu mode, as indicated by gpg>. - -First, let's select the key we'll be putting onto the card -- you do this by typing key 1 (it's the first one in the listing, our [E] subkey): -``` -gpg> key 1 - -``` - -The output should be subtly different: -``` -pub rsa4096/AAAABBBBCCCCDDDD - created: 2017-12-07 expires: 2019-12-07 usage: C - trust: ultimate validity: ultimate -ssb* rsa2048/1111222233334444 - created: 2017-12-07 expires: never usage: E -ssb rsa2048/5555666677778888 - created: 2017-12-07 expires: never usage: S -[ultimate] (1). Alice Engineer -[ultimate] (2) Alice Engineer - -``` - -Notice the * that is next to the ssb line corresponding to the key -- it indicates that the key is currently "selected." It works as a toggle, meaning that if you type key 1 again, the * will disappear and the key will not be selected any more. - -Now, let's move that key onto the smartcard: -``` -gpg> keytocard -Please select where to store the key: - (2) Encryption key -Your selection? 2 - -``` - -Since it's our [E] key, it makes sense to put it into the Encryption slot. When you submit your selection, you will be prompted first for your PGP key passphrase, and then for the admin PIN. If the command returns without an error, your key has been moved. - -**Important:** Now type key 1 again to unselect the first key, and key 2 to select the [S] key: -``` -gpg> key 1 -gpg> key 2 -gpg> keytocard -Please select where to store the key: - (1) Signature key - (3) Authentication key -Your selection? 1 - -``` - -You can use the [S] key both for Signature and Authentication, but we want to make sure it's in the Signature slot, so choose (1). Once again, if your command returns without an error, then the operation was successful. - -Finally, if you created an [A] key, you can move it to the card as well, making sure first to unselect key 2. Once you're done, choose "q": -``` -gpg> q -Save changes? (y/N) y - -``` - -Saving the changes will delete the keys you moved to the card from your home directory (but it's okay, because we have them in our backups should we need to do this again for a replacement smartcard). - -##### Verifying that the keys were moved - -If you perform --list-secret-keys now, you will see a subtle difference in the output: -``` -$ gpg --list-secret-keys -sec# rsa4096 2017-12-06 [C] [expires: 2019-12-06] - 111122223333444455556666AAAABBBBCCCCDDDD -uid [ultimate] Alice Engineer -uid [ultimate] Alice Engineer -ssb> rsa2048 2017-12-06 [E] -ssb> rsa2048 2017-12-06 [S] - -``` - -The > in the ssb> output indicates that the subkey is only available on the smartcard. If you go back into your secret keys directory and look at the contents there, you will notice that the .key files there have been replaced with stubs: -``` -$ cd ~/.gnupg/private-keys-v1.d -$ strings *.key - -``` - -The output should contain shadowed-private-key to indicate that these files are only stubs and the actual content is on the smartcard. - -#### Verifying that the smartcard is functioning - -To verify that the smartcard is working as intended, you can create a signature: -``` -$ echo "Hello world" | gpg --clearsign > /tmp/test.asc -$ gpg --verify /tmp/test.asc - -``` - -This should ask for your smartcard PIN on your first command, and then show "Good signature" after you run gpg --verify. - -Congratulations, you have successfully made it extremely difficult to steal your digital developer identity! - -### Other common GnuPG operations - -Here is a quick reference for some common operations you'll need to do with your PGP key. - -In all of the below commands, the [fpr] is your key fingerprint. - -#### Mounting your master key offline storage - -You will need your master key for any of the operations below, so you will first need to mount your backup offline storage and tell GnuPG to use it. First, find out where the media got mounted, for example, by looking at the output of the mount command. Then, locate the directory with the backup of your GnuPG directory and tell GnuPG to use that as its home: -``` -$ export GNUPGHOME=/media/disk/name/gnupg-backup -$ gpg --list-secret-keys - -``` - -You want to make sure that you see sec and not sec# in the output (the # means the key is not available and you're still using your regular home directory location). - -##### Updating your regular GnuPG working directory - -After you make any changes to your key using the offline storage, you will want to import these changes back into your regular working directory: -``` -$ gpg --export | gpg --homedir ~/.gnupg --import -$ unset GNUPGHOME - -``` - -#### Extending key expiration date - -The master key we created has the default expiration date of 2 years from the date of creation. This is done both for security reasons and to make obsolete keys eventually disappear from keyservers. - -To extend the expiration on your key by a year from current date, just run: -``` -$ gpg --quick-set-expire [fpr] 1y - -``` - -You can also use a specific date if that is easier to remember (e.g. your birthday, January 1st, or Canada Day): -``` -$ gpg --quick-set-expire [fpr] 2020-07-01 - -``` - -Remember to send the updated key back to keyservers: -``` -$ gpg --send-key [fpr] - -``` - -#### Revoking identities - -If you need to revoke an identity (e.g., you changed employers and your old email address is no longer valid), you can use a one-liner: -``` -$ gpg --quick-revoke-uid [fpr] 'Alice Engineer ' - -``` - -You can also do the same with the menu mode using gpg --edit-key [fpr]. - -Once you are done, remember to send the updated key back to keyservers: -``` -$ gpg --send-key [fpr] - -``` - -Next time, we'll look at how Git supports multiple levels of integration with PGP. - -Learn more about Linux through the free ["Introduction to Linux" ][8]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-5-moving-subkeys-hardware-device - -作者:[KONSTANTIN RYABITSEV][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/mricon -[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools -[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key -[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys -[4]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage -[5]:https://shop.nitrokey.com/shop/product/nitrokey-start-6 -[6]:https://shop.nitrokey.com/shop/product/nitrokey-pro-3 -[7]:https://www.yubico.com/product/yubikey-4-series/ -[8]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/translated/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md b/translated/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md new file mode 100644 index 0000000000..8dadad1193 --- /dev/null +++ b/translated/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md @@ -0,0 +1,304 @@ +用 PGP 保护代码完整性(五):将子密钥移到一个硬件设备中 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/pgp-keys.jpg?itok=aS6IWGpq) + +在本系列教程中,我们将提供一个使用 PGP 的实用指南。如果你没有看过前面的文章,你可以通过下面的链接去查看。在这篇文章中,我们将继续讨论如何保护你的密钥,谈一谈将你的子密钥移到一个专门的硬件设备中的一些技巧。 + +[第一部分:基本概念和工具][1] + +[第二部分:生成你的主密钥][2] + +[第三部分:生成 PGP 子密钥][3] + +[第四部分:将主密钥移到离线存储中][4] + +### 清单 + + * 取得一个 GnuPG 兼容的硬件设备(必要) + + * 配置 GnuPG 在设备上工作(必要) + + * 设置 user 和 admin 的 PIN(必要) + + * 移动子密钥到设备中(必要) + + + + +### 考虑事项 + +虽然现在主密钥已经不用担心泄露或失窃了,但子密钥仍然在你的 Home 目录中。任何得到它的人都能够解密你的通讯或假冒你的签名(如果他们知道密钥的密码)。并且,每次执行一个 GnuPG 操作都要将密钥加载到操作系统内存中,这将使一些更高级的恶意软件有机会得到你的密钥(想想 Meltdown 和 Spectre)。 + +完全保护密钥的最好方式就是,将它移到一个专门的硬件设备中,这种硬件设备是一个可操作的智能卡。 + +#### 智能卡的好处 + +一个智能卡包含一个加密芯片,它能够存储私钥,并且直接在智能卡内部执行秘密操作。因为密钥内容从来没有离开过智能卡,计算机操作系统并不能检索你插入的智能卡上的私钥。这与前面用于备份目的的加密 USB 存储是不同的 —— 虽然 USB 设备也是插入并解密的,但操作系统是能够去访问私钥内容的。使用外置的加密 USB 介质并不能代替智能卡设备的功能。 + +智能卡的一些其它好处: + + * 它们很便宜且易于获得 + + * 它们小巧且易于携带 + + * 它们可以用于多种设备上 + + * 它们中的很多都具有防篡改功能(取决于制造商) + + + + +#### 可用的智能卡设备 + +智能卡最初是嵌入到真实钱包大小的卡中,故而得名智能卡。你总是可以买到并使用 GnuPG 功能的智能卡,并且它们是你能得到的最便宜的可用设备之一。但是,事实上智能卡有一个很重要的缺点:它们需要一个智能卡读卡器,只有极小数的笔记本电脑上有这种读卡器。 + +由于这个原因,制造商开始推出小型 USB 设备,它的大小和 U 盘类似,内置有微型智能卡,并且在芯片上简单地实现了智能卡协议特性。下面推荐几个这样的设备: + + * [Nitrokey Start][5]:开源硬件和自由软件,可用于 GnuPG 的最便宜的选择之一,但是额外的安全特性很少。 + + * [Nitrokey Pro][6]:类似于 Nitrokey Start,它提供防篡改及更多的安全特性(但没有 U2F,具体查看指南的 U2F 节)。 + + * [Yubikey 4][7]:专利硬件和软件,但比 Nitrokey Pro 便宜,并且可以用在最新的笔记本电脑上的 USB-C 接口;也提供像 U2F 这样的额外的安全特性。 + + + + +我们推荐选一个同时具备智能卡功能和 U2F 的设备,在写这篇文章时,只能选择 Yubikey 4。 + +#### 配置智能卡设备 + +你的智能卡设备插入任何一台现代的 Linux 或 Mac 工作站上都应该能正常工作。你可以通过运行如下的命令去验证它: +``` +$ gpg --card-status + +``` + +如果你没有收到错误,有一个完整的卡列表,就表示一切正常。不幸的是,排除为什么设备不能正常工作的所有可能原因,已经超出了本指南的范围。如果你的智能卡使用 GnuPG 时有问题,请通过你的操作系统的常见支持通道寻求支持。 + +##### PIN 不一定是数字 + +注意,尽管名为 “PIN”(暗示你它必须是一个“数字”),不论是 user PIN 还是 admin PIN 都不必非要是数字。 + +当你收到一个新设备时,它可能设置有一个默认的 user 和 admin PIN,对于 Yubikeys,它分别是 123456 和 12345678。如果它们的 PIN 不是默认的,请查看设备附带的说明书。 + +##### 快速设置 + +为配置你的智能卡,你需要使用 GnuPG 菜单系统,因此这里并没有更方便的命令行开关: +``` +$ gpg --card-edit +[...omitted...] +gpg/card> admin +Admin commands are allowed +gpg/card> passwd + +``` + +你应该去设置 user PIN (1)、admin PIN (3)、和 Reset Code (4)。请确保把它们记录并保存到一个安全的地方 —— 尤其是 Admin PIN 和 Reset Code(它允许你去擦除整个智能卡内容)。你很少使用到 Admin PIN,因此如果你不记录下来,很可能会忘掉它。 + +返回到智能卡主菜单,你也可以设置其它值(比如名字、性别、登入日期、等等),但是这些都不是必需的,一旦你的智能卡丢失了,将导致额外的信息泄露。 + +#### 将子密钥移到你的智能卡中 + +退出卡菜单(使用 “q” 命令)保存所有更改。接下来,我们将你的子密钥移到智能卡中。将需要用到你的 PGP 密钥的密码,在大多数的智能卡操作中都将用到 admin PIN。记住,那个 [fpr] 表示你的密钥的完整的 40 个字符的指纹。 +``` +$ gpg --edit-key [fpr] + +Secret subkeys are available. + +pub rsa4096/AAAABBBBCCCCDDDD + created: 2017-12-07 expires: 2019-12-07 usage: C + trust: ultimate validity: ultimate +ssb rsa2048/1111222233334444 + created: 2017-12-07 expires: never usage: E +ssb rsa2048/5555666677778888 + created: 2017-12-07 expires: never usage: S +[ultimate] (1). Alice Engineer +[ultimate] (2) Alice Engineer + +gpg> + +``` + +使用 --edit-key 再次进入到菜单模式,你将注意到那个密钥清单有一点小差别。从现在开始,所有的命令都是在这个菜单模式下运行,它用 gpg> 提示符来表示。 + +首先,我们来选择移到智能卡中的密钥 —— 你可以通过键入 `key 1`(它表示选择清单中的第一个密钥)来实现: +``` +gpg> key 1 + +``` + +这个输出会有一点细微的差别: +``` +pub rsa4096/AAAABBBBCCCCDDDD + created: 2017-12-07 expires: 2019-12-07 usage: C + trust: ultimate validity: ultimate +ssb* rsa2048/1111222233334444 + created: 2017-12-07 expires: never usage: E +ssb rsa2048/5555666677778888 + created: 2017-12-07 expires: never usage: S +[ultimate] (1). Alice Engineer +[ultimate] (2) Alice Engineer + +``` + +注意与密钥对应的 ssb 行旁边的 `*` —— 它表示这是当前选定的密钥。它是可切换的,意味着如果你再次输入 `key 1`,这个 `*` 将消失,这个密钥将不再被选中。 + +现在,我们来将密钥移到智能卡中: +``` +gpg> keytocard +Please select where to store the key: + (2) Encryption key +Your selection? 2 + +``` + +由于它是我们的 [E] 密钥,把它移到加密区中是有很有意义的。当你提交了你的选择之后,将会被提示输入你的 PGP 密钥的保护密码,接下来输入智能卡的 admin PIN。如果命令没有返回错误,表示你的密钥已经被移到智能卡中了。 + +**重要:** 现在再次输入 `key 1` 去取消选中第一个密钥,并输入 `key 2` 去选择 [S] 密钥: + +``` +gpg> key 1 +gpg> key 2 +gpg> keytocard +Please select where to store the key: + (1) Signature key + (3) Authentication key +Your selection? 1 + +``` + +你可以使用 [S] 密钥同时做签名和验证,但是我们希望确保它在签名区,因此,我们选择 (1)。完成后,如果你的命令没有返回错误,表示操作已成功。 + +最后,如果你创建了一个 [A] 密钥,你也可以将它移到智能卡中,但是你需要先取消选中 `key 2`。完成后,选择 “q": +``` +gpg> q +Save changes? (y/N) y + +``` + +保存变更将把你的子密钥移到智能卡后,把你的 Home 目录中的相应子密钥删除(没有关系,因为我们的备份中还有,如果更换了智能卡,你需要再做一遍)。 + +##### 验证移动后的密钥 + +现在,如果你执行一个` --list-secret-keys` 操作,你将看到一个稍有不同的输出: +``` +$ gpg --list-secret-keys +sec# rsa4096 2017-12-06 [C] [expires: 2019-12-06] + 111122223333444455556666AAAABBBBCCCCDDDD +uid [ultimate] Alice Engineer +uid [ultimate] Alice Engineer +ssb> rsa2048 2017-12-06 [E] +ssb> rsa2048 2017-12-06 [S] + +``` + +在 ssb> 的输出中的 `>` 表示子密钥仅在智能卡上有效。如果你进入到你的密钥目录中,查看目录的内容,你将会看到那个 `.key` 文件已经被存根替换: +``` +$ cd ~/.gnupg/private-keys-v1.d +$ strings *.key + +``` + +这个输出将包含一个影子私钥,它表示那个文件仅是个存根,真正的内容在智能卡中。 + +#### 验证智能卡的功能 + +验证智能卡能否如期正常运行,你可以通过创建一个签名来验证: +``` +$ echo "Hello world" | gpg --clearsign > /tmp/test.asc +$ gpg --verify /tmp/test.asc + +``` + +首次运行这个命令时将询问你智能卡的 PIN,在你运行 `gpg —verify` 之后,它将显示 "Good signature”。 + +祝贺你,你已经成功将窃取你的开发者数字身份变得更加困难了! + +### 其它常见 GnuPG 操作 + +下面是使用你的 PGP 密钥需要做的一些常见操作的快速指南。 + +在下面的所有命令中,[fpr] 表示你的密钥指纹。 + +#### 挂载主密钥离线存储 + +下面的一些操作将需要你的主密钥,因此首先需要去挂载你的主密钥离线存储,并告诉 GnuPG 去使用它。首先,找出介质挂载路径,可以通过查看 mount 命令的输出找到它。接着,设置你的 GnuPG 目录为你的介质上备份的目录,并告诉 GnuPG 将那个目录做为它的 Home: +``` +$ export GNUPGHOME=/media/disk/name/gnupg-backup +$ gpg --list-secret-keys + +``` + +确保你在输出中看到的是 `sec` 而不是 `sec#`(这个 `#` 表示密钥不可用,仍然使用的是惯常的那个 Home 目录)。 + +##### 更新你惯常使用的那个 GnuPG 工作目录 + +在你的离线存储上做了任何更改之后,你应该将这些更改同步应用到你惯常使用的工作目录中: +``` +$ gpg --export | gpg --homedir ~/.gnupg --import +$ unset GNUPGHOME + +``` + +#### 延长密钥过期日期 + +我们创建的主密钥的默认过期日期是自创建之日起两年后。这样做都是为安全考虑,这样将使淘汰密钥最终从密钥服务器上消失。 + +延长你的密钥过期日期,从当前日期延长一年,只需要运行如下命令: +``` +$ gpg --quick-set-expire [fpr] 1y + +``` + +如果为了好记住,你也可以使用一个特定日期(比如,你的生日、1 月 1 日、或加拿大国庆日): +``` +$ gpg --quick-set-expire [fpr] 2020-07-01 + +``` + +记得将更新后的密钥发送到密钥服务器: +``` +$ gpg --send-key [fpr] + +``` + +#### 吊销身份 + +如果你需要吊销一个身份(比如,你换了雇主并且旧的邮件地址不再有效了),你可以使用一行命令搞定: +``` +$ gpg --quick-revoke-uid [fpr] 'Alice Engineer ' + +``` + +你也可以通过使用 `gpg --edit-key [fpr]` 在菜单模式下完成同样的事情。 + +完成后,记得将更新后的密钥发送到密钥服务器上: +``` +$ gpg --send-key [fpr] + +``` + +下一篇文章中,我们将谈谈 Git 如何支持 PGP 的多级别集成。 + +通过来自 Linux 基金会和 edX 的免费课程 [“Linux 入门" ][8]学习更多 Linux 知识。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-5-moving-subkeys-hardware-device + +作者:[KONSTANTIN RYABITSEV][a] +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/mricon +[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools +[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key +[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys +[4]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage +[5]:https://shop.nitrokey.com/shop/product/nitrokey-start-6 +[6]:https://shop.nitrokey.com/shop/product/nitrokey-pro-3 +[7]:https://www.yubico.com/product/yubikey-4-series/ +[8]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 094a0a8c8cc37d0748475fe4d422d4018feabf34 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Sat, 22 Dec 2018 21:35:28 +0800 Subject: [PATCH 1012/1143] Translating by qhwdw --- ...cting Code Integrity with PGP - Part 6- Using PGP with Git.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md b/sources/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md index 0169d96ad6..d0de1b6c0f 100644 --- a/sources/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md +++ b/sources/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md @@ -1,3 +1,4 @@ +Translating by qhwdw Protecting Code Integrity with PGP — Part 6: Using PGP with Git ====== From 7d5b9e753274aab22f31187b8fd2d99ed9ca0099 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Dec 2018 15:12:44 +0800 Subject: [PATCH 1013/1143] PRF:20181205 Bash Variables- Environmental and Otherwise.md @HankChow --- ... Variables- Environmental and Otherwise.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md index c6786eef15..952300bbb4 100644 --- a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md +++ b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md @@ -1,28 +1,30 @@ Bash 环境变量的那些事 ====== +> 初学者可以在此教程中了解环境变量。 + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/wynand-van-poortvliet-40467-unsplash.jpg?itok=tr6Eb4N0) -bash 变量,尤其是讨厌的环境变量,已经是一个老生常谈的话题了。我们也更应该对它有一个详细的了解,让它为我们所用。 +bash 变量,尤其是讨厌的*环境变量*,已经是一个老生常谈的话题了。我们也更应该对它有一个详细的了解,让它为我们所用。 下面就打开终端,开始吧。 ### 环境变量 -`HOME` 除了是你脱下帽子惬意休息的地方,同时也是 Linux 中的一个变量,它是当前用户主目录的路径: +`HOME` (LCTT 译注:双关语)除了是你脱下帽子惬意休息的地方,同时也是 Linux 中的一个变量,它是当前用户主目录的路径: ``` echo $HOME ``` -以上这个命令会显示当前用户的主目录路径,通常都在 `/home/` 下。 +以上这个命令会显示当前用户的主目录路径,通常都在 `/home/` 下。 -顾名思义,一个变量的值并不是固定的。实际上,Linux 系统中每一个用户的 `HOME` 变量都是不一样的,当然你也可以这样自行更改 `HOME` 变量的值: +顾名思义,变量的值是可以根据上下文变化的。实际上,Linux 系统中每一个用户的 `HOME` 变量都是不一样的,当然你也可以这样自行更改 `HOME` 变量的值: ``` HOME=/home//Documents ``` -以上这个命令将会把 `HOME` 变量设置为 `/home//Documents` 目录。 +以上这个命令将会把 `HOME` 变量设置为你的 `Documents` 目录。 其中有三点需要留意: @@ -45,7 +47,7 @@ $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin ``` -每两个目录之间使用冒号(`:`)分隔。如果某个应用程序的所在目录不在 `PATH` 变量中,那么运行的时候就需要声明应用程序的目录让 shell 能够找到。 +每两个目录之间使用冒号 `:` 分隔。如果某个应用程序的所在目录不在 `PATH` 变量中,那么运行的时候就需要声明应用程序的目录让 shell 能够找到。 ``` /home//bin/my_program.sh @@ -67,9 +69,9 @@ PATH=$PATH:$HOME/bin 然后 `/home//bin/` 目录就会出现在 `PATH` 变量中了。但正如之前所说,这个变更只会在当前的 shell 生效,当前的 shell 一旦关闭,环境变量的值就又恢复原状了。 -如果要让变更对当前用户持续生效,就不能在 shell 中直接执行对应的变更,而是应该将这些变更操作卸载每次启动 shell 时都会运行的文件当中。这个文件就是当前用户主目录中的 `.bashrc` 文件。文件名前面的点号表明这是一个隐藏文件,执行普通的 `ls` 命令是不会将这个文件显示出来的,但只要在 `ls` 命令中加入 `-a` 参数就可以看到这个文件了。 +如果要让变更对当前用户持续生效,就不能在 shell 中直接执行对应的变更,而是应该将这些变更操作写在每次启动 shell 时都会运行的文件当中。这个文件就是当前用户主目录中的 `.bashrc` 文件。文件名前面的点号表明这是一个隐藏文件,执行普通的 `ls` 命令是不会将这个文件显示出来的,但只要在 `ls` 命令中加入 `-a` 参数就可以看到这个文件了。 -你可以使用诸如 [kate][1]、[gedit][2]、[nano][3] 或者 [vim][4] 这些文本编辑器来打开 `.bashrc` 文件(但不要用 LibreOffice Writer,它是一个文字处理软件,跟前面几个文字编辑器并不一个量级的东西)。打开 `.bashrc` 文件之后,你会看见里面放置了一些 shell 命令,是用于为当前用户设置环境的。 +你可以使用诸如 [kate][1]、[gedit][2]、[nano][3] 或者 [vim][4] 这些文本编辑器来打开 `.bashrc` 文件(但不要用 LibreOffice Writer,它是一个文字处理软件,跟前面几个文字编辑器完全不同)。打开 `.bashrc` 文件之后,你会看见里面放置了一些 shell 命令,是用于为当前用户设置环境的。 在文件的末尾添加新行并输入以下内容: @@ -97,13 +99,13 @@ source .bashrc new_variable="Hello" ``` -然后可以用一下的方式读取到已定义变量的值: +然后可以用以下的方式读取到已定义变量的值: ``` echo $new_variable ``` -程序的正常工作离不开各种变量,例如要将某个选项设置为 on,又或者让程序找到所需的代码库,都需要使用变量。在 bash 中运行程序的时候会生成一个子 shell,这个子 shell 和执行原程序的父 shell 并不是完全一样的,只是继承了父 shell 的部分内容,而且默认是不继承父 shell 中的变量的。因为变量默认情况下是局部变量,出于安全原因,一个 shell 中的局部变量不会被另一个 shell 读取到,即使是子 shell 也不可以。 +程序的正常工作离不开各种变量,例如要将某个选项设置为打开,又或者让程序找到所需的代码库,都需要使用变量。在 bash 中运行程序的时候会生成一个子 shell,这个子 shell 和执行原程序的父 shell 并不是完全一样的,只是继承了父 shell 的部分内容,而且默认是不继承父 shell 中的变量的。因为变量默认情况下是局部变量,出于安全原因,一个 shell 中的局部变量不会被另一个 shell 读取到,即使是子 shell 也不可以。 下面举一个例子。首先定义一个变量: @@ -198,7 +200,7 @@ via: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-o 作者:[Paul Brown][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 43535b61e5c30e20ff0bb28a74bdff9e293590c3 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Dec 2018 15:15:30 +0800 Subject: [PATCH 1014/1143] PUB:20181205 Bash Variables- Environmental and Otherwise.md @HankChow https://linux.cn/article-10374-1.html --- .../20181205 Bash Variables- Environmental and Otherwise.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181205 Bash Variables- Environmental and Otherwise.md (100%) diff --git a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md b/published/20181205 Bash Variables- Environmental and Otherwise.md similarity index 100% rename from translated/tech/20181205 Bash Variables- Environmental and Otherwise.md rename to published/20181205 Bash Variables- Environmental and Otherwise.md From 37d608098239f29b1b25b9a70b8b8a930c7b2a45 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Dec 2018 15:36:44 +0800 Subject: [PATCH 1015/1143] PRF:20180717 11 Uses for a Raspberry Pi Around the Office.md @geekpi --- ...es for a Raspberry Pi Around the Office.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md index 88e7fbd86a..e5cb91b108 100644 --- a/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md +++ b/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (11 Uses for a Raspberry Pi Around the Office) @@ -12,9 +12,9 @@ 我知道你在想什么:树莓派只能用在修修补补、原型设计和个人爱好中。它实际不能用在业务中。 -毫无疑问,这台电脑的处理能力相对较低、易损坏的 SD 卡、缺乏电池备份以及支持的 DIY 性质,这意味着它不会是一个能在任何时候执行最关键的操作的[专业的已安装和已配置的商业服务器][1]的可行替代,。 +毫无疑问,这台电脑的处理能力相对较低、易损坏的 SD 卡、缺乏电池备份以及支持的 DIY 性质,这意味着它不会是一个能在任何时候执行最关键的操作的[专业的、已安装好、配置好的商业服务器][1]的可行替代品。 -但是它电路板便宜、功耗很小、很小几乎适合任何地方、无限灵活 - 这实际上是处理办公室一些基本任务的好方法。 +但是它电路板便宜、功耗很小、小到几乎适合任何地方、无限灵活 —— 这实际上是处理办公室一些基本任务的好方法。 而且,更好的是,已经有一些人完成了这些项目并很乐意分享他们是如何做到的。 @@ -22,11 +22,11 @@ 每次在浏览器中输入网站地址或者点击链接时,都需要将域名转换为数字 IP 地址,然后才能显示内容。 -通常这意味着向互联网上某处 DNS 服务器发出请求 - 但你可以通过本地处理来加快浏览速度。 +通常这意味着向互联网上某处 DNS 服务器发出请求 —— 但你可以通过本地处理来加快浏览速度。 你还可以分配自己的子域,以便本地访问办公室中的计算机。 -[这里是如何让这它工作。][2] +[这里了解它是如何工作的。][2] ### 厕所占用标志 @@ -34,37 +34,37 @@ 这对于那些等待的人来说很烦人,花在处理它上面的时间会耗费你在办公室的工作效率。 -我想你希望在办公室里也悬挂飞机上有的标志。 +我想你希望在办公室里也悬挂飞机上那个厕所有人的标志。 -[Occu-pi][3] 是一个更简单的解决方案,使用磁性开关和树莓派来判断螺栓何时关闭并在 Slack 频道中更新厕所在使用中 - 这意味着整个办公室的人都可以看一眼电脑或者移动设备知道是否有空闲的隔间。 +[Occu-pi][3] 是一个非常简单的解决方案,使用磁性开关和树莓派来判断螺栓何时关闭,并在 Slack 频道中更新“厕所在使用中” —— 这意味着整个办公室的人都可以看一眼电脑或者移动设备知道是否有空闲的隔间。 ### 针对黑客的蜜罐陷阱 黑客破坏了网络的第一个线索是一些事情变得糟糕,这应该会吓到大多数企业主。 -这就是可以用到蜜罐的地方:一台没有任何服务的计算机位于你的网络,将特定端口打开伪装成黑客喜欢的目标。 +这就是可以用到蜜罐的地方:一台没有任何服务的计算机位于你的网络,将特定端口打开,伪装成黑客喜欢的目标。 安全研究人员经常在网络外部部署蜜罐,以收集攻击者正在做的事情的数据。 但对于普通的小型企业来说,这些作为一种绊脚石部署在内部更有用。因为普通用户没有真正的理由想要连接到蜜罐,所以任何发生的登录尝试都是正在进行捣乱的非常好的指示。 -这可以提供对外部人员入侵的预警,并且可信赖的内部人员也没有任何好处。 +这可以提供对外部人员入侵的预警,并且也可以提供对值得信赖的内部人员的预警。 -在较大的客户端/服务器网络中,将它作为虚拟机运行可能更为实际。但是在无线路由器上运行的点对点的小型办公室/家庭办公网络中,[HoneyPi][4] 之类的东西是一个很小的防盗报警器。 +在较大的客户端/服务器网络中,将它作为虚拟机运行可能更为实用。但是在无线路由器上运行的点对点的小型办公室/家庭办公网络中,[HoneyPi][4] 之类的东西是一个很小的防盗报警器。 ### 打印服务器 -网络连接的打印机更方便。 +联网打印机更方便。 -但更换所有打印机可能会很昂贵 - 特别是如果你对它们感到满意的话。 +但更换所有打印机可能会很昂贵 —— 特别是如果你对现有的打印机感到满意的话。 [将树莓派设置为打印服务器][5]可能会更有意义。 -### 网络附加存储 (NAS) +### 网络附加存储(NAS) 将硬盘变为 NAS 是树莓派最早的实际应用之一,并且它仍然是最好的之一。 -[这是如何使用树莓派创建NAS。][6] +[这是如何使用树莓派创建 NAS。][6] ### 工单服务器 @@ -74,13 +74,13 @@ ### 数字标牌 -无论是用于活动、广告、菜单还是其他任何东西,许多企业都需要一种显示数字标牌的方式 - 而树莓派的廉价和省电使其成为一个非常有吸引力的选择。 +无论是用于活动、广告、菜单还是其他任何东西,许多企业都需要一种显示数字标牌的方式 —— 而树莓派的廉价和省电使其成为一个非常有吸引力的选择。 [这有很多可供选择的选项。] [8] ### 目录和信息亭 -[FullPageOS][9] 是一个基于 Raspbian 的 Linux 发行版,它直接引导到 Chromium 的全屏版本 - 这非常适合导购、图书馆目录等。 +[FullPageOS][9] 是一个基于 Raspbian 的 Linux 发行版,它直接引导到 Chromium 的全屏版本 —— 这非常适合导购、图书馆目录等。 ### 基本的内联网 Web 服务器 @@ -96,7 +96,7 @@ Kali Linux 是专为探测网络安全漏洞而构建的操作系统。通过将 [你可以在这里找到树莓派镜像的种子链接。][11] -绝对小心只在你自己的网络或你有权对它安全审计的网络中使用它 - 使用此方法来破解其他网络是严重的犯罪行为。 +绝对要小心只在你自己的网络或你有权对它安全审计的网络中使用它 —— 使用此方法来破解其他网络是严重的犯罪行为。 ### VPN 服务器 @@ -104,15 +104,15 @@ Kali Linux 是专为探测网络安全漏洞而构建的操作系统。通过将 你可以订阅任意数量的商业 VPN 服务,并且你可以在云中安装自己的服务,但是在办公室运行一个 VPN,这样你也可以从任何地方访问本地网络。 -对于轻度使用 - 比如偶尔的商务旅行 - 树莓派是一种强大的,节约能源的设置 VPN 服务器的方式。(首先要检查一下你的路由器是不是不支持这个功能,许多路由器是支持的。) +对于轻度使用 —— 比如偶尔的商务旅行 —— 树莓派是一种强大的,节约能源的设置 VPN 服务器的方式。(首先要检查一下你的路由器是不是不支持这个功能,许多路由器是支持的。) [这是如何在树莓派上安装 OpenVPN。][12] ### 无线咖啡机 -啊,美味:美味的饮料还是公司内工作效率的支柱。 +啊,美味:好喝的饮料是神赐之物,也是公司内工作效率的支柱。 -那么, 为什么不[将办公室的咖啡机变成可以精确控制温度和无线连接的智能咖啡机呢?][13] +那么,为什么不[将办公室的咖啡机变成可以精确控制温度和无线连接的智能咖啡机呢?][13] -------------------------------------------------------------------------------- @@ -121,7 +121,7 @@ via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-of 作者:[James Mawson][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/) 荣誉推出 @@ -139,4 +139,4 @@ via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-of [10]: https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server [11]: https://www.offensive-security.com/kali-linux-arm-images/ [12]: https://medium.freecodecamp.org/running-your-own-openvpn-server-on-a-raspberry-pi-8b78043ccdea -[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine \ No newline at end of file +[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine From e62b11d81ddb3ebabb66b9b537bd5544c3e3023e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Dec 2018 15:37:25 +0800 Subject: [PATCH 1016/1143] PUB:20180717 11 Uses for a Raspberry Pi Around the Office.md @geekpi https://linux.cn/article-10375-1.html --- .../20180717 11 Uses for a Raspberry Pi Around the Office.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20180717 11 Uses for a Raspberry Pi Around the Office.md (99%) diff --git a/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/published/20180717 11 Uses for a Raspberry Pi Around the Office.md similarity index 99% rename from translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md rename to published/20180717 11 Uses for a Raspberry Pi Around the Office.md index e5cb91b108..cb5b51fe98 100644 --- a/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md +++ b/published/20180717 11 Uses for a Raspberry Pi Around the Office.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10375-1.html) [#]: subject: (11 Uses for a Raspberry Pi Around the Office) [#]: via: (https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/) [#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) From 6ab2e0d4518025ade17db9302932cfd4cb448e11 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Sun, 23 Dec 2018 16:52:51 +0800 Subject: [PATCH 1017/1143] Translated by qhwdw --- ...y with PGP - Part 6- Using PGP with Git.md | 319 ------------------ ...y with PGP - Part 6- Using PGP with Git.md | 318 +++++++++++++++++ 2 files changed, 318 insertions(+), 319 deletions(-) delete mode 100644 sources/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md create mode 100644 translated/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md diff --git a/sources/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md b/sources/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md deleted file mode 100644 index d0de1b6c0f..0000000000 --- a/sources/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md +++ /dev/null @@ -1,319 +0,0 @@ -Translating by qhwdw -Protecting Code Integrity with PGP — Part 6: Using PGP with Git -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/global-network.jpg?itok=h_hhZc36) -In this tutorial series, we're providing practical guidelines for using PGP, including basic concepts and generating and protecting your keys. If you missed the previous articles, you can catch up below. In this article, we look at Git's integration with PGP, starting with signed tags, then introducing signed commits, and finally adding support for signed pushes. - -[Part 1: Basic Concepts and Tools][1] - -[Part 2: Generating Your Master Key][2] - -[Part 3: Generating PGP Subkeys][3] - -[Part 4: Moving Your Master Key to Offline Storage][4] - -[Part 5: Moving Subkeys to a Hardware Device][5] - -One of the core features of Git is its decentralized nature -- once a repository is cloned to your system, you have full history of the project, including all of its tags, commits and branches. However, with hundreds of cloned repositories floating around, how does anyone verify that the repository you downloaded has not been tampered with by a malicious third party? You may have cloned it from GitHub or some other official-looking location, but what if someone had managed to trick you? - -Or what happens if a backdoor is discovered in one of the projects you've worked on, and the "Author" line in the commit says it was done by you, while you're pretty sure you had [nothing to do with it][6]? - -To address both of these issues, Git introduced PGP integration. Signed tags prove the repository integrity by assuring that its contents are exactly the same as on the workstation of the developer who created the tag, while signed commits make it nearly impossible for someone to impersonate you without having access to your PGP keys. - -### Checklist - - * Understand signed tags, commits, and pushes (ESSENTIAL) - - * Configure git to use your key (ESSENTIAL) - - * Learn how tag signing and verification works (ESSENTIAL) - - * Configure git to always sign annotated tags (NICE) - - * Learn how commit signing and verification works (ESSENTIAL) - - * Configure git to always sign commits (NICE) - - * Configure gpg-agent options (ESSENTIAL) - - - - -### Considerations - -Git implements multiple levels of integration with PGP, first starting with signed tags, then introducing signed commits, and finally adding support for signed pushes. - -#### Understanding Git Hashes - -Git is a complicated beast, but you need to know what a "hash" is in order to have a good grasp on how PGP integrates with it. We'll narrow it down to two kinds of hashes: tree hashes and commit hashes. - -##### Tree hashes - -Every time you commit a change to a repository, git records checksum hashes of all objects in it -- contents (blobs), directories (trees), file names and permissions, etc, for each subdirectory in the repository. It only does this for trees and blobs that have changed with each commit, so as not to re-checksum the entire tree unnecessarily if only a small part of it was touched. - -Then it calculates and stores the checksum of the toplevel tree, which will inevitably be different if any part of the repository has changed. - -##### Commit hashes - -Once the tree hash has been created, git will calculate the commit hash, which will include the following information about the repository and the change being made: - - * The checksum hash of the tree - - * The checksum hash of the tree before the change (parent) - - * Information about the author (name, email, time of authorship) - - * Information about the committer (name, email, time of commit) - - * The commit message - - - - -##### Hashing function - -At the time of writing, git still uses the SHA1 hashing mechanism to calculate checksums, though work is under way to transition to a stronger algorithm that is more resistant to collisions. Note, that git already includes collision avoidance routines, so it is believed that a successful collision attack against git remains impractical. - -#### Annotated tags and tag signatures - -Git tags allow developers to mark specific commits in the history of each git repository. Tags can be "lightweight" \-- more or less just a pointer at a specific commit, or they can be "annotated," which becomes its own object in the git tree. An annotated tag object contains all of the following information: - - * The checksum hash of the commit being tagged - - * The tag name - - * Information about the tagger (name, email, time of tagging) - - * The tag message - - - - -A PGP-signed tag is simply an annotated tag with all these entries wrapped around in a PGP signature. When a developer signs their git tag, they effectively assure you of the following: - - * Who they are (and why you should trust them) - - * What the state of their repository was at the time of signing: - - * The tag includes the hash of the commit - - * The commit hash includes the hash of the toplevel tree - - * Which includes hashes of all files, contents, and subtrees - * It also includes all information about authorship - - * Including exact times when changes were made - - - - -When you clone a git repository and verify a signed tag, that gives you cryptographic assurance that all contents in the repository, including all of its history, are exactly the same as the contents of the repository on the developer's computer at the time of signing. - -#### Signed commits - -Signed commits are very similar to signed tags -- the contents of the commit object are PGP-signed instead of the contents of the tag object. A commit signature also gives you full verifiable information about the state of the developer's tree at the time the signature was made. Tag signatures and commit PGP signatures provide exact same security assurances about the repository and its entire history. - -#### Signed pushes - -This is included here for completeness' sake, since this functionality needs to be enabled on the server receiving the push before it does anything useful. As we saw above, PGP-signing a git object gives verifiable information about the developer's git tree, but not about their intent for that tree. - -For example, you can be working on an experimental branch in your own git fork trying out a promising cool feature, but after you submit your work for review, someone finds a nasty bug in your code. Since your commits are properly signed, someone can take the branch containing your nasty bug and push it into master, introducing a vulnerability that was never intended to go into production. Since the commit is properly signed with your key, everything looks legitimate and your reputation is questioned when the bug is discovered. - -Ability to require PGP-signatures during git push was added in order to certify the intent of the commit, and not merely verify its contents. - -#### Configure git to use your PGP key - -If you only have one secret key in your keyring, then you don't really need to do anything extra, as it becomes your default key. - -However, if you happen to have multiple secret keys, you can tell git which key should be used ([fpr] is the fingerprint of your key): -``` -$ git config --global user.signingKey [fpr] - -``` - -NOTE: If you have a distinct gpg2 command, then you should tell git to always use it instead of the legacy gpg from version 1: -``` -$ git config --global gpg.program gpg2 - -``` - -#### How to work with signed tags - -To create a signed tag, simply pass the -s switch to the tag command: -``` -$ git tag -s [tagname] - -``` - -Our recommendation is to always sign git tags, as this allows other developers to ensure that the git repository they are working with has not been maliciously altered (e.g. in order to introduce backdoors). - -##### How to verify signed tags - -To verify a signed tag, simply use the verify-tag command: -``` -$ git verify-tag [tagname] - -``` - -If you are verifying someone else's git tag, then you will need to import their PGP key. Please refer to the "Trusted Team communication" document in the same repository for guidance on this topic. - -##### Verifying at pull time - -If you are pulling a tag from another fork of the project repository, git should automatically verify the signature at the tip you're pulling and show you the results during the merge operation: -``` -$ git pull [url] tags/sometag - -``` - -The merge message will contain something like this: -``` -Merge tag 'sometag' of [url] - -[Tag message] - -# gpg: Signature made [...] -# gpg: Good signature from [...] - -``` - -#### Configure git to always sign annotated tags - -Chances are, if you're creating an annotated tag, you'll want to sign it. To force git to always sign annotated tags, you can set a global configuration option: -``` -$ git config --global tag.forceSignAnnotated true - -``` - -Alternatively, you can just train your muscle memory to always pass the -s switch: -``` -$ git tag -asm "Tag message" tagname - -``` - -#### How to work with signed commits - -It is easy to create signed commits, but it is much more difficult to incorporate them into your workflow. Many projects use signed commits as a sort of "Committed-by:" line equivalent that records code provenance -- the signatures are rarely verified by others except when tracking down project history. In a sense, signed commits are used for "tamper evidence," and not to "tamper-proof" the git workflow. - -To create a signed commit, you just need to pass the -S flag to the git commit command (it's capital -S due to collision with another flag): -``` -$ git commit -S - -``` - -Our recommendation is to always sign commits and to require them of all project members, regardless of whether anyone is verifying them (that can always come at a later time). - -##### How to verify signed commits - -To verify a single commit you can use verify-commit: -``` -$ git verify-commit [hash] - -``` - -You can also look at repository logs and request that all commit signatures are verified and shown: -``` -$ git log --pretty=short --show-signature - -``` - -##### Verifying commits during git merge - -If all members of your project sign their commits, you can enforce signature checking at merge time (and then sign the resulting merge commit itself using the -S flag): -``` -$ git merge --verify-signatures -S merged-branch - -``` - -Note, that the merge will fail if there is even one commit that is not signed or does not pass verification. As it is often the case, technology is the easy part -- the human side of the equation is what makes adopting strict commit signing for your project difficult. - -##### If your project uses mailing lists for patch management - -If your project uses a mailing list for submitting and processing patches, then there is little use in signing commits, because all signature information will be lost when sent through that medium. It is still useful to sign your commits, just so others can refer to your publicly hosted git trees for reference, but the upstream project receiving your patches will not be able to verify them directly with git. - -You can still sign the emails containing the patches, though. - -#### Configure git to always sign commits - -You can tell git to always sign commits: -``` -git config --global commit.gpgSign true - -``` - -Or you can train your muscle memory to always pass the -S flag to all git commit operations (this includes --amend). - -#### Configure gpg-agent options - -The GnuPG agent is a helper tool that will start automatically whenever you use the gpg command and run in the background with the purpose of caching the private key passphrase. This way you only have to unlock your key once to use it repeatedly (very handy if you need to sign a bunch of git operations in an automated script without having to continuously retype your passphrase). - -There are two options you should know in order to tweak when the passphrase should be expired from cache: - - * default-cache-ttl (seconds): If you use the same key again before the time-to-live expires, the countdown will reset for another period. The default is 600 (10 minutes). - - * max-cache-ttl (seconds): Regardless of how recently you've used the key since initial passphrase entry, if the maximum time-to-live countdown expires, you'll have to enter the passphrase again. The default is 30 minutes. - - - - -If you find either of these defaults too short (or too long), you can edit your ~/.gnupg/gpg-agent.conf file to set your own values: -``` -# set to 30 minutes for regular ttl, and 2 hours for max ttl -default-cache-ttl 1800 -max-cache-ttl 7200 - -``` - -##### Bonus: Using gpg-agent with ssh - -If you've created an [A] (Authentication) key and moved it to the smartcard, you can use it with ssh for adding 2-factor authentication for your ssh sessions. You just need to tell your environment to use the correct socket file for talking to the agent. - -First, add the following to your ~/.gnupg/gpg-agent.conf: -``` -enable-ssh-support - -``` - -Then, add this to your .bashrc: -``` -export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) - -``` - -You will need to kill the existing gpg-agent process and start a new login session for the changes to take effect: -``` -$ killall gpg-agent -$ bash -$ ssh-add -L - -``` - -The last command should list the SSH representation of your PGP Auth key (the comment should say cardno:XXXXXXXX at the end to indicate it's coming from the smartcard). - -To enable key-based logins with ssh, just add the ssh-add -L output to ~/.ssh/authorized_keys on remote systems you log in to. Congratulations, you've just made your ssh credentials extremely difficult to steal. - -As a bonus, you can get other people's PGP-based ssh keys from public keyservers, should you need to grant them ssh access to anything: -``` -$ gpg --export-ssh-key [keyid] - -``` - -This can come in super handy if you need to allow developers access to git repositories over ssh. Next time, we'll provide tips for protecting your email accounts as well as your PGP keys. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-6-using-pgp-git - -作者:[KONSTANTIN RYABITSEV][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/mricon -[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools -[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key -[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys -[4]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage -[5]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-5-moving-subkeys-hardware-device -[6]:https://github.com/jayphelps/git-blame-someone-else diff --git a/translated/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md b/translated/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md new file mode 100644 index 0000000000..ba010bb0ec --- /dev/null +++ b/translated/tech/20180321 Protecting Code Integrity with PGP - Part 6- Using PGP with Git.md @@ -0,0 +1,318 @@ +保护代码完整性(六):在 Git 上使用 PGP +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/global-network.jpg?itok=h_hhZc36) +在本系列教程中,我们提供了一个使用 PGP 的实用指南,包括基本概念和工具、生成和保护你的密钥。如果你错过了前面的文章,你可以查看下面的链接。在这篇文章中,我们谈一谈在 Git 中如何集成 PGP、使用签名的标签,然后介绍签名提交,最后添加签名推送的支持。 + +[第一部分:基本概念和工具][1] + +[第二部分:生成你的主密钥][2] + +[第三部分:生成 PGP 子密钥][3] + +[第四部分:将主密钥移到离线存储中][4] + +[第五部分:将子密钥移到硬件设备中][5] + +Git 的核心特性之一就是它的去中心化本质 —— 一旦仓库克隆到你的本地系统,你就拥有了项目的完整历史,包括所有的标签、提交和分支。然而由于存在着成百上千的克隆仓库,如何才能验证你下载的仓库没有被恶意的第三方做过篡改?你可以从 GitHub 或一些貌似官方的位置来克隆它们,但是如果有些人故意欺骗了你怎么办? + +或者在你参与的一些项目上发现了后门,而 "Author" 行显示是你干的,然而你很确定 [不是你干的][6],会发生什么情况? + +为解决上述问题,Git 添加了 PGP 集成。签名的标签通过确认它的内容与创建这个标签的开发者的工作站上的内容完全一致来证明仓库的完整性,而签名的提交几乎是不可能在不访问你的 PGP 密钥的情况下能够假冒你。 + +### 清单 + + * 了解签名的标签、提交、和推送(必要) + + * 配置 git 使用你的密钥(必要) + + * 学习如何签名标签和验证工作(必要) + + * 配置 git 总是签名注释的标签(推荐) + + * 学习如何签名提交和验证工作(必要) + + * 配置 git 总是签名提交(推荐) + + * 配置 gpg-agent 选项(必要) + + + + +### 考虑事项 + +Git 实现了 PGP 的多级集成,首先从签名标签开始,接着介绍签名提交,最后添加签名推送的支持。 + +#### 了解 Git 哈希 + +Git 是一个复杂的东西,为了你能够更好地掌握它如何集成 PGP,你需要了解什么是”哈希“。我们将它归纳为两种类型的哈希:树哈希和提交哈希。 + +##### 树哈希 + +每次你向仓库提交一个变更,对于仓库中的每个子目录,git 都会记录它里面所有对象的校验和哈希 —— 内容(blobs)、目录(trees)、文件名和许可等等。它只对每次提交中发生变更的树和内容做此操作,这样在只变更树的一小部分时就不必去重新计算整个树的校验和。 + +然后再计算和存储处于顶级的树的校验和,这样如果仓库的任何一部分发生变化,校验和将不可避免地发生变化。 + +##### 提交哈希 + +一旦创建了树哈希,git 将计算提交哈希,它将包含有关仓库和变更的下列信息: + + * 树哈希的校验和 + + * 变更前树哈希的校验和(父级) + + * 有关作者的信息(名字、email、创作时间) + + * 有关提交者的信息(名字、email、提交时间) + + * 提交信息 + + + + +##### 哈希函数 + +在写这篇文章时,虽然研究一种更强大的、抗碰撞的算法的工作正在进行,但 git 仍然使用的是 SHA1 哈希机制去计算校验和。注意,git 已经包含了碰撞防范程序,因此认为对 git 成功进行碰撞攻击仍然是不可行的。 + +#### 注释的标签和标签签名 + +在每个 Git 仓库中,标签允许开发者标记特定的提交。标签可以是 “轻量级的” —— 几乎只是一个特定提交上的指针,或者它们可以是 “注释的”,它成为 git 树中自己的项目。一个注释的标签对象包含所有下列的信息: + + * 成为标签的提交哈希的校验和 + + * 标签名字 + + * 关于打标签的人的信息(名字、email、打标签时间) + + * 标签信息 + + + + +一个 PGP 签名的标签是一个带有将所有这些条目封装进一个 PGP 签名的注释标签。当开发者签名他们的 git 标签时,他们实际上是向你保证了如下的信息: + + * 他们是谁(以及他们为什么应该被信任) + + * 他们在签名时的仓库状态是什么样: + + * 标签包含提交的哈希 + + * 提交哈希包含了顶级树的哈希 + + * 顶级哈希包含了所有文件、内容和子树的哈希 + * 它也包含有关作者的所有信息 + + * 包含变更发生时的精确时间 + + + + +当你克隆一个仓库并验证一个签名标签时,就是向你以密码方式保证仓库中的所有内容、包括所有它的历史,与开发者签名时在它的计算机上的仓库完全一致。 + +#### 签名的提交 + +签名的提交与签名的标签非常类似 —— 提交对象的内容是 PGP 签名过的,而不是标签对象的内容。一个提交签名也给你提供了开发者签名时,开发者树上的全部可验证信息。标签签名和提交 PGP 签名提供了有关仓库和它的完整历史的完全一致的安全保证。 + +#### 签名的推送 + +为了完整起见,在这里包含了签名的推送这一功能,因为在你使用这个功能之前,需要在接收推送的服务器上先启用它。正如我们在上面所说过的,PGP 签名一个 git 对象就是提供了开发者的 git 树当时的可验证信息,但不提供开发者对那个树意图相关的信息。 + +比如,你可以在你自己 fork 的 git 仓库的一个实验分支上尝试一个很酷的特性,为了评估它,你提交了你的工作,但是有人在你的代码中发现了一个恶意的 bug。由于你的提交是经过正确签名的,因此有人可能将包含有恶意 bug 的分支推入到 master 分支中,从而在生产系统中引入一个漏洞。由于提交是经过你的密钥正确签名的,所以一切看起来都是合理合法的,而当 bug 被发现时,你的声誉就会因此而受到影响。 + +在 `git push` 时,为了验证提交的意图而不仅仅是验证它的内容,添加了要求 PGP 推送签名的功能。 + +#### 配置 git 使用你的 PGP 密钥 + +如果在你的钥匙环上只有一个密钥,那么你就不需要再做额外的事了,因为它是你的默认密钥。 + +然而,如果你有多个密钥,那么你必须要告诉 git 去使用哪一个密钥。([fpr] 是你的密钥的指纹): +``` +$ git config --global user.signingKey [fpr] + +``` + +注意:如果你有一个不同的 gpg2 命令,那么你应该告诉 git 总是去使用它,而不是传统的版本 1 的 gpg: +``` +$ git config --global gpg.program gpg2 + +``` + +#### 如何使用签名标签 + +创建一个签名的标签,只要传递一个简单地 -s 开关给 tag 命令即可: +``` +$ git tag -s [tagname] + +``` + +我们建议始终对 git 标签签名,这样让其它的开发者确信他们使用的 git 仓库没有被恶意地修改过(比如,引入后门): + +##### 如何验证签名的标签 + +验证一个签名的标签,只需要简单地使用 verify-tag 命令即可: +``` +$ git verify-tag [tagname] + +``` + +如果你要验证其他人的 git 标签,那么就需要你导入他的 PGP 公钥。请参考 “可信任的团队沟通” 一文中关于此主题的指导。 + +##### 在拉取时验证 + +如果你从项目仓库的其它 fork 中拉取一个标签,git 将自动验证签名,并在合并操作时显示结果: +``` +$ git pull [url] tags/sometag + +``` + +合并信息将包含类似下面的内容: +``` +Merge tag 'sometag' of [url] + +[Tag message] + +# gpg: Signature made [...] +# gpg: Good signature from [...] + +``` + +#### 配置 git 始终签名注释的标签 + +很可能的是,你正在创建一个带注释的标签,你应该去签名它。强制 git 始终签名带注释的标签,你可以设置一个全局配置选项: +``` +$ git config --global tag.forceSignAnnotated true + +``` + +或者,你始终记得每次都传递一个 -s 开关: +``` +$ git tag -asm "Tag message" tagname + +``` + +#### 如何使用签名提交 + +创建一个签名提交很容易,但是将它纳入到你的工作流中却很困难。许多项目使用签名提交作为一种 "Committed-by:” 的等价行,它记录了代码来源 —— 除了跟踪项目历史外,签名很少有人去验证。在某种意义上,签名的提交用于 ”篡改证据“,而不是 git 工作流的 ”篡改证明“。 + +为创建一个签名的提交,你只需要 `git commit` 命令传递一个 -S 标志即可(由于它与另一个标志冲突,所以改为大写的 -S): +``` +$ git commit -S + +``` + +我们建议始终使用签名提交,并要求项目所有成员都这样做,这样其它人就可以验证它们(下面就讲到如何验证)。 + +##### 如何去验证签名的提交 + +验证签名的提交需要使用 verify-commit 命令: +``` +$ git verify-commit [hash] + +``` + +你也可以查看仓库日志,要求所有提交签名是被验证和显示的: +``` +$ git log --pretty=short --show-signature + +``` + +##### 在 git merge 时验证提交 + +如果项目的所有成员都签名了他们的提交,你可以在合并时强制进行签名检查(然后使用 -S 标志对合并操作本身进行签名): +``` +$ git merge --verify-signatures -S merged-branch + +``` + +注意,如果有一个提交没有签名或验证失败,将导致合并操作失败。通常情况下,技术是最容易的部分 —— 而人的因素使得项目中很难采用严格的提交验证。 + +##### 如果你的项目在补丁管理上采用邮件列表 + +如果你的项目在提交和处理补丁时使用一个邮件列表,那么一般很少使用签名提交,因为通过那种方式发送时,签名信息将会丢失。对提交进行签名仍然是非常有用的,这样引用你托管在公开 git 树的其他人就能以它作为参考,但是上游项目接收你的补丁时,仍然不能直接使用 git 去验证它们。 + +尽管,你仍然可以签名包含补丁的电子邮件。 + +#### 配置 git 始终签名提交 + +你可以告诉 git 总是签名提交: +``` +git config --global commit.gpgSign true + +``` + +或者你每次都记得给 `git commit` 操作传递一个 -S 标志(包括 —amend)。 + +#### 配置 gpg-agent 选项 + +GnuPG agent 是一个守护工具,它能在你使用 gpg 命令时随时自动启动,并运行在后台来缓存私钥的密码。这种方式让你只需要解锁一次密钥就可以重复地使用它(如果你需要在一个自动脚本中签署一组 git 操作,而不需要重复输入密钥,这种方式就很方便)。 + +为了调整缓存中的密钥过期时间,你应该知道这两个选项: + + * default-cache-ttl(秒):如果在 time-to-live 过期之前再次使用同一个密钥,这个倒计时将重置成另一个倒计时周期。缺省值是 600(10 分钟)。 + + * max-cache-ttl(秒):自首次密钥输入以后,不论最近一次使用密钥是什么时间,只要最大值的 time-to-live 倒计时过期,你将被要求再次输入密码。它的缺省值是 30 分钟。 + + + + +如果你认为这些缺省值过短(或过长),你可以编辑 ~/.gnupg/gpg-agent.conf 文件去设置你自己的值: +``` +# set to 30 minutes for regular ttl, and 2 hours for max ttl +default-cache-ttl 1800 +max-cache-ttl 7200 + +``` + +##### 额外好处:与 ssh 一起使用 gpg-agent + +如果你创建了一个 [A](验证)密钥,并将它移到了智能卡,你可以将它用到 ssh 上,为你的 ssh 会话添加一个双因子验证。为了与 agent 沟通你只需要告诉你的环境去使用正确的套接字文件即可。 + +首先,添加下列行到你的 ~/.gnupg/gpg-agent.conf 文件中: +``` +enable-ssh-support + +``` + +接着,添加下列行到你的 .bashrc 文件中: +``` +export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + +``` + +为了让改变生效,你需要 kill 掉正在运行的 gpg-agent 进程,并重新启动一个新的登入会话: +``` +$ killall gpg-agent +$ bash +$ ssh-add -L + +``` + +最后的命令将列出代表你的 PGP Auth 密钥的 SSH(注释应该会在结束的位置显示: cardno:XXXXXXXX,表示它来自智能卡)。 + +为了启用 ssh 的基于密钥的登入,只需要在你要登入的远程系统上添加 `ssh-add -L` 的输出到 ~/.ssh/authorized_keys 中。祝贺你,这将使你的 SSH 登入凭据更难以窃取。 + +作为一个福利,你可以从公共密钥服务器上下载其它人的基于 PGP 的 ssh 公钥,这样就可以赋予他登入 ssh 的权利: +``` +$ gpg --export-ssh-key [keyid] + +``` + +如果你有让开发人员通过 ssh 来访问 git 仓库的需要,这将让你非常方便。下一篇文章,我们将提供像保护你的密钥那样保护电子邮件帐户的小技巧。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-6-using-pgp-git + +作者:[KONSTANTIN RYABITSEV][a] +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/mricon +[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools +[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key +[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys +[4]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage +[5]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-5-moving-subkeys-hardware-device +[6]:https://github.com/jayphelps/git-blame-someone-else From eebbca924755a5389ea83de42162505386db02f8 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 23 Dec 2018 19:44:35 +0800 Subject: [PATCH 1018/1143] Translatng by MjSeven --- .../20180716 Users, Groups and Other Linux Beasts- Part 2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md b/sources/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md index b164bb6cf5..b6d2552264 100644 --- a/sources/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md +++ b/sources/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md @@ -1,3 +1,4 @@ +Translating by MjSeven Users, Groups and Other Linux Beasts: Part 2 ====== ![](https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2) From fe7f9a5b237dcf71bc0ab103d715f14b114f676e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 23 Dec 2018 20:54:35 +0800 Subject: [PATCH 1019/1143] PRF:20171111 A CEOs Guide to Emacs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @oneforalone 翻译辛苦了,我用了比较长的时间才算是初步校对完。希望你可以看看我的校对是否合适。此外,角注的内容,你没有翻译,这个部分也应该翻译一下。这篇是挺有 价值的文章。 --- .../tech/20171111 A CEOs Guide to Emacs.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20171111 A CEOs Guide to Emacs.md b/translated/tech/20171111 A CEOs Guide to Emacs.md index 9ddbab89d2..d7a5f8ad0d 100644 --- a/translated/tech/20171111 A CEOs Guide to Emacs.md +++ b/translated/tech/20171111 A CEOs Guide to Emacs.md @@ -123,7 +123,7 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] #### 字体及风格 -我推荐在 Emacs 中使用很棒的字体系列。它们可以使用不同的括号、0和其他字符进行自定义。你可以在字体文件本身中构建额外的行间距。我推荐 1\.5 倍的行间距,并在代码和数据中使用它们适应比例的字体。写作中我用 `Serif` 字体,它有一种紧凑但时髦的感觉。你可以在 [http://input.fontbureau.com/][40] 上找到它们,在那里你可以根据自己的喜好进行定制。你可以使用 Emacs 中的菜单手动设置字体,但这会将代码保存到你的 `.emacs` 文件中,如果您使用多个设备,您可能需要一些不同的设置。我我将我的 `.emacs` 设置位根据使用的机器的名称,并配置适当的屏幕机字体。代码如下: +我推荐在 Emacs 中使用漂亮的字体族。它们可以使用不同的括号、0 和其他字符进行自定义。你可以在字体文件本身中构建额外的行间距。我推荐 1.5 倍的行间距,并在代码和数据中使用不等宽字体。写作中我用 `Serif` 字体,它有一种紧凑但时髦的感觉。你可以在 [http://input.fontbureau.com/][40] 上找到它们,在那里你可以根据自己的喜好进行定制。你可以使用 Emacs 中的菜单手动设置字体,但这会将代码保存到你的 `.emacs` 文件中,如果您使用多个设备,您可能需要一些不同的设置。我将我的 `.emacs` 设置为根据使用的机器的名称来相应配置屏幕。代码如下: ``` ;; set up fonts for different OSes. OSX toggles to full screen. @@ -140,9 +140,9 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] (set-face-attribute 'default nil :font myfont :height 104))) ``` -您应该将你的 Emacs 副本中 `system-name` 的值替换成你使用命令 `(system-name)` 得到的值。注意,在 Sampo (我的 MacBook)上,我还将 Emacs 设置为全屏。我也想在 Windows 实现这个,但是 Windows 和 Emacs 并不真正喜欢对方,当我尝试这个时,它总是不稳定。相反,我只是在启动后手动全屏。 +您应该将你的 Emacs 中的 `system-name` 的值替换成你通过 `(system-name)` 得到的值。注意,在 Sampo (我的 MacBook)上,我还将 Emacs 设置为全屏。我也想在 Windows 实现这个,但是 Windows 和 Emacs 并不真正喜欢对方,当我尝试这个时,它总是不稳定。相反,我只能在启动后手动全屏。 -我还建议去掉 Emacs 中在 90 年代获得的难看的工具栏,当时最酷的事情是在应用程序中使用工具栏。我还去掉了一些其他的 `chrome`,这样我就有了一个简单、高效的界面。把这些加到你的 `.emacs` 的文件中,来去掉工具栏和滚动条,但要保留菜单 (在 OS X 上,它将被隐藏,除非你将鼠标到屏幕顶部): +我还建议去掉 Emacs 中的上世纪 90 年代出现的难看工具栏,当时最酷的事情是在应用程序中使用工具栏。我还去掉了一些其它的“电镀层”,这样我就有了一个简单、高效的界面。把这些加到你的 `.emacs` 的文件中来去掉工具栏和滚动条,但要保留菜单(在 OS X 上,它将被隐藏,除非你将鼠标到屏幕顶部): ``` (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) @@ -152,9 +152,9 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] #### Org 模式 -我基本上 `Org` 模式下处理工作的。它是我创作文档、记笔记、列任务清单以及 90% 其他工作的首选环境。`Org` 最初是由一个在会议中使用笔记本电脑的家伙构想出来的,它是笔记和待办事项列表的组合工具。我反对在会议中使用笔记本电脑,自己也不使用,所以我的用法与他的有些不同。对我来说,`Org` 主要是一种处理结构中内容的方式。在 `Org` 模式中有标题和副标题等,它们的作用就像一个大纲。`Org` 允许你展开或隐藏文本内容,还可以重新排列文本。这非常很符合我的想法,而且我发现用这种方式使用它是一种乐趣。 +我基本上是在 Org 模式下处理工作的。它是我创作文档、记笔记、列任务清单以及 90% 其他工作的首选环境。Org 模式最初是由一个在会议中使用笔记本电脑的家伙构想出来的,它是笔记和待办事项列表的组合工具。我反对在会议中使用笔记本电脑,自己也不使用,所以我的用法与他的有些不同。对我来说,Org 模式主要是一种处理结构中内容的方式。在 Org 模式中有标题和副标题等,它们的作用就像一个大纲。Org 模式允许你展开或隐藏大纲树,还可以重新排列该树。这非常很符合我的想法,而且我发现用这种方式使用它是一种乐趣。 -`Org` 模式也有很多让生活愉快的小功能。例如,脚注处理非常好,`LaTeX/PDF` 输出也很好。`Org` 能够根据所有文档中的待办事项生成议程,并能很好地将它们与日期/时间联系起来。我不把它用在任何形式的外部任务上,这些任务都是在一个共享的日历上处理的,但是在创建事物和跟踪我未来需要创建的东西时,它是无价的。安装它,你只要将 `org-mode.el` 放到你的 `lisp` 目录下,然后再在你的 `.emacs` 文件中添加如下代码,如果你想要它基于文档的结构进行缩进并在打开时全部展开的话: +Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常好,LaTeX/PDF 输出也很好。Org 模式能够根据所有文档中的待办事项生成议程,并能很好地将它们与日期/时间联系起来。我不把它用在任何形式的外部任务上,这些任务都是在一个共享的日历上处理的,但是在创建事物和跟踪我未来需要创建的东西时,它是无价的。安装它,你只要将 `org-mode.el` 放到你的 `lisp` 目录下,并且如果你想要它基于文档的结构进行缩进并在打开时全部展开的话,在你的 `.emacs` 文件中添加如下代码: ``` ;; set up org mode @@ -163,15 +163,15 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] (setq org-directory "~/org") ``` -最后一行是让 `Org` 知道在哪里查找要包含在议程和其他事情中的文件。我把 `Org` 保存在我的主目录中,也就是说,像前面介绍的一样,它是 Dropbox 目录的一个符号链接。 +最后一行是让 Org 模式知道在哪里查找要包含在议程和其他事情中的文件。我把 Org 模式保存在我的主目录中,也就是说,像前面介绍的一样,它是 Dropbox 目录的一个符号链接。 -我有一个总是在缓冲区中打开的 `stuff.org` 文件。我把它当作记事本。`Org` 使得提取待办事项和有期限的事情变得很容易。当你在内联 `Lisp` 代码并在需要计算它时,它特别有用。拥有包含内容的代码非常方便。同样,你可以使用 Emacs 访问实际的计算机,这是一种解放。 +我有一个总是在缓冲区中打开的 `stuff.org` 文件。我把它当作记事本。Org 模式使得提取待办事项和有期限的事情变得很容易。当你能够内联 Lisp 代码并在需要计算它时,它特别有用。拥有包含内容的代码非常方便。同样,你可以使用 Emacs 访问实际的计算机,这是一种解放。 -##### 用 `Org` 模式进行发布 +##### 用 Org 模式进行发布 -我关心的是文档的外观和格式。我我刚开始工作时是个设计师,而且我认为信息可以,也应该表现得清晰和美丽。`Org` 对将 `LaTeX` 生成 PDF 支持的很好, `LaTeX` 有自己的学习曲线,但是做简单的事情非常简单。 +我关心的是文档的外观和格式化。我刚开始工作时是个设计师,而且我认为信息可以,也应该表现得清晰和美丽。Org 模式对将 LaTeX 生成 PDF 支持的很好,LaTeX 虽然也有学习曲线,但是做简单的事情非常简单。 -如果你想使用字体和样式,而不是典型的 `LaTeX` 字体和样式,你需要做些事。首先,你要用到 `XeLaTeX`,这样就可以使用普通的系统字体,而不是 `LaTeX` 的特殊字体。接下来,您需要将一下代码添加到 `.emacs` 中: +如果你想使用字体和样式,而不是典型的 LaTeX 字体和样式,你需要做些事。首先,你要用到 XeLaTeX,这样就可以使用普通的系统字体,而不是 LaTeX 的特殊字体。接下来,您需要将以下代码添加到 `.emacs` 中: ``` (setq org-latex-pdf-process @@ -179,7 +179,7 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] "xelatex -interaction nonstopmode %f")) ``` -我把这个放在 `.emacs` 中 `Org` 配置部分的末尾来保持整洁。这让你在从 `Org` 发布时使用更多格式化选项。例如,我经常使用: +我把这个放在 `.emacs` 中 Org 模式配置部分的末尾来保持整洁。这让你在从 Org 模式发布时可以使用更多格式化选项。例如,我经常使用: ``` #+LaTeX_HEADER: \usepackage{fontspec} @@ -193,11 +193,11 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] 这些都可以在你的 `.org` 文件中找到。我们的公司规定的正文字体是 `Maison Neue`,但你也可以在这写上任何适当的东西。我强烈反对使用 `Maison Neue`。它是一种糟糕的字体,任何人都不应该使用它。 -这个文件是一个使用该配置输出为 PDF 的实例。这就是开箱即用的 `LaTeX` 一样。在我看来这还不错,但是字体很无聊,而且有点奇怪。此外,如果你使用标准格式,人们会认为他们正在阅读的东西是或假装是一篇学术论文。别怪我没提醒你。 +这个文件是一个使用该配置输出为 PDF 的实例。这就是开箱即用的 LaTeX 一样。在我看来这还不错,但是字体很平淡,而且有点奇怪。此外,如果你使用标准格式,人们会觉得他们正在阅读的东西是、或者假装是一篇学术论文。别怪我没提醒你。 -#### `Ace Jump` 模式 +#### Ace Jump 模式 -如果你想使用的话,这是个辅助而不是主要功能。它的工作原理有点像 Jef Raskin 的 `Leap` 功能[^9] 。 按下 `C-c` `C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。您只需键入所需位置的字母,光标就会跳转到该位置。我自己经常用这个作为导航键或搜索。将 `.el` 文件下到你的 `Lisp` 目录下,并在 `.emacs` 文件添加如下代码: +这是个辅助而不是主要功能,但是或许你想使用。它的工作原理有点像之前的 Jef Raskin 的 Leap 功能[^9] 。 按下 `C-c C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。您只需键入所需位置的字母,光标就会跳转到该位置。我自己经常用这个作为导航键或搜索。将 `.el` 文件下到你的 `lisp` 目录下,并在 `.emacs` 文件添加如下代码: ``` ;; set up ace-jump-mode @@ -208,7 +208,7 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] ### 更多 -这篇文章已经够详细了,你能在其中的到你所想要的。我很想了解除编程(或编程)之外你对 Emacs 的使用,以及这是否有用。在我使用 Emacs 的过程中,可能存在一些自作聪明的想法,如果你能指出它们,我将感激不尽。之后,我可能会写一些更新来引入其他特性或模式。我很确定我将会向你展示如何在 Emacs 和 `Ludwig` 模式下使用 `Fugue`,因为我会将它发展成比代码突出显示更有用的东西。把你的想法发到 [@fugueHQ][41] 上。 +这篇文章已经够详细了,你能在其中的到你所想要的。我很想了解除了编程之外(或用于编程)你对 Emacs 的使用情况,以及这是否有用。在我使用 Emacs 的过程中,可能存在一些自作聪明的老板式想法,如果你能指出它们,我将感激不尽。之后,我可能会写一些更新来介绍其它特性或模式。我很确定我将会向你展示如何在 Emacs 和 Ludwig 模式下使用 Fugue,因为我会将它发展成比代码高亮更有用的东西。请把你的想法发到 [@fugueHQ][41] 上。 [^1]: If you are now a PHB of some sort, but were never technical, Emacs likely isn’t for you. There may be a handful of folks for whom Emacs will form a path into the more technical aspects of computing, but this is probably a small population. It’s helpful to know how to use a Unix or Windows terminal, to have edited a dotfile or two, and to have written some code at some point in your life for Emacs to make much sense. @@ -225,9 +225,9 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] via: https://blog.fugue.co/2015-11-11-guide-to-emacs.html -作者:[Josh Stella ][a] +作者:[Josh Stella][a] 译者:[oneforalone](https://github.com/oneforalone) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9684a00296651f93a2977db69d73664e6b617c31 Mon Sep 17 00:00:00 2001 From: qhwdw <33189910+qhwdw@users.noreply.github.com> Date: Sun, 23 Dec 2018 22:18:41 +0800 Subject: [PATCH 1020/1143] Translating by qhwdw --- ...de Integrity with PGP - Part 7- Protecting Online Accounts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md b/sources/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md index 8ebb9af3f6..1c5cf7ff09 100644 --- a/sources/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md +++ b/sources/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md @@ -1,3 +1,4 @@ +Translating by qhwdw Protecting Code Integrity with PGP — Part 7: Protecting Online Accounts ====== From 1fcee3b5fe7bc5fedd9cf439938612e493d88139 Mon Sep 17 00:00:00 2001 From: alim0x Date: Sun, 23 Dec 2018 22:27:21 +0800 Subject: [PATCH 1021/1143] [translated]20181211 DevOps is for everyone --- .../talk/20181121 DevOps is for everyone.md | 75 ------------------- .../talk/20181121 DevOps is for everyone.md | 74 ++++++++++++++++++ 2 files changed, 74 insertions(+), 75 deletions(-) delete mode 100644 sources/talk/20181121 DevOps is for everyone.md create mode 100644 translated/talk/20181121 DevOps is for everyone.md diff --git a/sources/talk/20181121 DevOps is for everyone.md b/sources/talk/20181121 DevOps is for everyone.md deleted file mode 100644 index 256a4e9fc3..0000000000 --- a/sources/talk/20181121 DevOps is for everyone.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (alim0x) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (DevOps is for everyone) -[#]: via: (https://opensource.com/article/18/11/how-non-engineer-got-devops) -[#]: author: (Dawn Parych https://opensource.com/users/dawnparzych) -[#]: url: ( ) - -DevOps is for everyone -====== - -A non-engineer explains why you don't need to be a developer or an operations person to fall for DevOps. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1) - -I've never held a job as a developer nor in operations—so what am I doing writing an article about [DevOps][1]? I've always been interested in computers and technology. I also have a passion for people, psychology, and helping others. When I first heard about DevOps, the concept piqued my interest, as it seemed to merge many of the things I was interested in, even if I don't write code. - -My first computer was a TRS-80, and I loved writing BASIC programs on it. I took the only two computer programming classes my high school offered. A few years later, I started a computer company. I made custom mailing labels, stationery, and built a database to store addresses. - -The problem was I didn't enjoy writing code. I wanted to teach and to help people, and I didn't see writing code as an opportunity to do this. Yes, technology can help people and change lives, but writing code didn't spark my passion. I need to feel excited about my work and do something I love. - - * The culture, not the code - * The journey, not the result - * Building an environment where everybody can continuously improve - * Communicating and collaborating, not working independently - - - -I found that I love DevOps. To me, DevOps is about: - -Ultimately, DevOps is about being part of a community working towards the same goal. DevOps merges psychology, people, and technology. DevOps isn't a job title; it is a philosophy for life and work. - -### Finding my people - -Almost four years ago, I attended my first [DevOpsDays][2] conference in Seattle. I felt like I had found my people. I felt welcomed and accepted, even though I work in marketing and don't have a computer science degree. I could geek out over psychology and technology. - -At DevOpsDays, I learned about the ["Three Ways" of DevOps][3]—flow, feedback, and continuous experimentation and learning—and new (to me) concepts such as Kaizen and Kaikaku. As I learned, I found myself saying things like, "I do this! I didn't know there was a name for this!" - -[Kaizen][4] is the practice of continuous improvement and learning. Small, incremental changes over time can yield significant results. I found parallels between this and Carol Dweck's idea of a [growth mindset][5]. People aren't born experts. Becoming skilled at something takes time, practice, and often failure. Recognizing incremental improvement is necessary to make sure we don't give up. - -[Kaikaku][6], on the other hand, is the notion that small changes over time sometimes won't work, and you need to make a radical or disruptive change. Quitting a job without having a new one lined up or moving to a new city can be pretty disruptive—yes, I've done both. But these radical changes can reap great rewards. I might not have learned about DevOps if I hadn't quit my job and taken some time off. Once I decided to return to work, I kept hearing about DevOps and started researching it. This led me to attend my first DevOpsDays, where I began to see all my passions come together. Since then, I have presented at five DevOpsDays and regularly write about DevOps topics. - -### Putting the Three Ways to work - -Change is hard and learning something new can be scary. The Three Ways of DevOps provide a framework for managing change. For example: How is information flowing? What is driving you to make a change? Once you know a change is needed, how do you get feedback about whether the changes you are making are the right changes? How do you know if you're making progress? Feedback is essential and should include both positive and constructive elements. The hard part is making sure the constructive elements don't outweigh the positive. - -For me, the third Way—continuous experimentation and learning—is the most important part of DevOps. Having an environment where people are free to experiment and take risks can lead to unexpected outcomes. Sometimes those outcomes are good, sometimes not so good—and that's OK. Creating an environment where it is acceptable if things don't work out encourages people to take risks. We should all strive to continuously experiment and learn something new on a regular basis. - -The Three Ways of DevOps provides a method of trying something, getting feedback, and learning from our mistakes. A few years ago, my son told me, "I don't ever want to be the best at something, because then I can't learn from my mistakes." We all make mistakes, and learning from them helps us grow and improve. We aren't willing to make mistakes if our culture doesn't support experimentation and learning. - -### Being part of the community - -I've worked in technology for over 20 years and often felt like an outsider until I found the DevOps community. If you're like me—passionate about technology but not the engineering or operations side of things—you can still be a part of DevOps, even if you work in sales, marketing, product marketing, technical writing, support, and more. DevOps is for everyone. - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/11/how-non-engineer-got-devops - -作者:[Dawn Parych][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dawnparzych -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/resources/devops -[2]: https://www.devopsdays.org/ -[3]: https://itrevolution.com/the-three-ways-principles-underpinning-devops/ -[4]: https://en.wikipedia.org/wiki/Kaizen -[5]: https://en.wikipedia.org/wiki/Mindset#Fixed_and_growth -[6]: https://en.wikipedia.org/wiki/Kaikaku diff --git a/translated/talk/20181121 DevOps is for everyone.md b/translated/talk/20181121 DevOps is for everyone.md new file mode 100644 index 0000000000..778656640d --- /dev/null +++ b/translated/talk/20181121 DevOps is for everyone.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: (alim0x) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (DevOps is for everyone) +[#]: via: (https://opensource.com/article/18/11/how-non-engineer-got-devops) +[#]: author: (Dawn Parych https://opensource.com/users/dawnparzych) +[#]: url: ( ) + +所有人的 DevOps +====== + +让一名非工程师来解释为什么你不必成为一位开发者或运维就能爱上 DevOps。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1) + +我没有过开发或运维的工作——那怎么我在写一篇关于 [DevOps][1] 的文章?我一直都对计算机和技术有兴趣。我还对社群、心理学以及帮助他人充满热情。当我第一次听到 DevOps 时,这个概念激起了我的兴趣,因为它看起来融合了很多我感兴趣的东西,即便我是不写代码的。 + +我的第一台电脑是 TRS-80,我喜欢在上面编写 BASIC 程序。我只上过两门我的高中开设的计算机编程课程。若干年后,我创办了一家计算机公司。我定制邮件标签和信纸,并建立了一个数据库来存储地址。 + +问题是我并不能从写代码中获得享受。我想要教育和帮助人们,我没法将写代码看作这样的一个机会。是的,技术可以帮助人们并改变生活,但是写代码没有点燃我的热情。我需要对我的工作感到兴奋并做我喜欢的事情。 + + * 文化,而不是代码 + * 过程,而不是结果 + * 建立一个所有人可以持续提升的环境 + * 沟通与合作,而不是独立工作 + + +我发现我爱 DevOps。对我而言,DevOps 指的是: + +归根结底,DevOps 是指成为社区工作的一部分,实现共同的目标。DevOps 融合了心理学、社群、技术。DevOps 不是一个职位名称,它是一种生活和工作的哲学。 + +### 找到我的社群 + +快四年前,我在西雅图参加了我的第一个 [DevOps 日][2] 会议。我感觉我找到了我的社群。我觉得受到了欢迎和接受,尽管我从事营销工作而且没有计算机科学文凭。我可以从心理学和技术中寻找乐趣。 + +在 DevOps 日,我学到了 [DevOps“三步工作法”][3]——流动,反馈,持续实验和学习——以及新(对我而言)的概念,如Kaizen(改善)和Kaikaku(改革)。随着我的学习深入,我发现我在说这样的话,“我是这样做的!我都不知道这样做还有个名字!” + +[Kaizen(改善)][4]是持续改进和学习的实践。小的量变积累随着时间的推移可以引起质变。我发现它和卡罗尔.德韦克的[成长型思维][5]的想法很相似。人们不是生来就是专家。在某方面拥有经验需要花费时间,练习,以及常常还有失败。承认增量的改善对确保我们不会放弃是很有必要的。 + +另一方面,[Kaikaku(改革)][6]的概念是指,长时间的小的改变有时不能起作用,你需要做一些完全的或破坏性的改变。在没有找到下份工作前就辞职或移居新城市就足够有破坏性——是的,两者我都做过。但这些彻底的改变收获巨大。如果我没有辞职并休息一段时间,我也许不会接触到 DevOps。等我决定继续工作的时候,我一直听到 DevOps,我开始研究它。这引导我参加了我的第一个 DevOps 日,从那里我开始看到我的所有热情开始聚集。从那时起,我已经参加了五次 DevOps 日活动,并且定期撰写关于 DevOps 话题的文章。 + +### 将三步工作法用到工作中 + +改变是困难的,学习新事物可以听起来很吓人。DevOps 的三步工作法提供了一个管理改变的框架。比如:信息流动是怎样的?是什么驱动着你做出改变?一旦你认为一个改变是必需的,你如何获得这个改变是否正确的反馈?你如何知道你在取得进展?反馈是必要的,并且应该包含积极和有建设性的要素。困难的地方在于保证建设性的要素不要重于积极要素。 + +对我而言,第三步——持续实验和学习——是 DevOps 最重要的部分。有一个可以自由地实验和冒险的环境,人们可以获得意想不到的结果。有时这些结果是好的,有时不是太好——但这没事。创建一个可以接受失败结果的环境可以鼓励人们冒险。我们都应该力争定期的持续实验和学习。 + +DevOps 的三步工作法提供了一个尝试,获得反馈,以及从错误中获取经验的方法。几年前,我的儿子告诉我,“我从来就没想做到最好,因为那样我就没法从我的错误中学到东西了。”我们都会犯错,从中获得经验帮助我们成长和改善。如果我们的文化不支持尝试和学习,我们就不会愿意去犯错。 + +### 成为社区的一部分 + +我已经在技术领域工作了超过 20 年,直到我发现 DevOps 社区前,我还经常感觉自己是个外行。如果你像我一样——对技术充满热情,但不是工程和运维那方面——你仍然可以成为 DevOps 的一部分,即便你从事的是销售、营销、产品营销、技术写作、支持或其他工作。DevOps 是属于所有人的。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/11/how-non-engineer-got-devops + +作者:[Dawn Parych][a] +选题:[lujun9972][b] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/resources/devops +[2]: https://www.devopsdays.org/ +[3]: https://itrevolution.com/the-three-ways-principles-underpinning-devops/ +[4]: https://en.wikipedia.org/wiki/Kaizen +[5]: https://en.wikipedia.org/wiki/Mindset#Fixed_and_growth +[6]: https://en.wikipedia.org/wiki/Kaikaku From d71dd1f80d916eb41ffb1b3372a120d441e1f534 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Sun, 23 Dec 2018 22:49:09 +0800 Subject: [PATCH 1022/1143] Update 20181217 Take a swim at your Linux terminal with asciiquarium.md --- ...1217 Take a swim at your Linux terminal with asciiquarium.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md b/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md index d8253849ea..63741b5ccd 100644 --- a/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md +++ b/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6ad5b97e7aaf3f41b96c9c212519c2c26485451c Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Mon, 24 Dec 2018 00:33:34 +0800 Subject: [PATCH 1023/1143] translated over translated over --- ... with challenge-response authentication.md | 185 ------------------ ... with challenge-response authentication.md | 182 +++++++++++++++++ 2 files changed, 182 insertions(+), 185 deletions(-) delete mode 100644 sources/tech/20181022 Improve login security with challenge-response authentication.md create mode 100644 translated/tech/20181022 Improve login security with challenge-response authentication.md diff --git a/sources/tech/20181022 Improve login security with challenge-response authentication.md b/sources/tech/20181022 Improve login security with challenge-response authentication.md deleted file mode 100644 index ff5cdba354..0000000000 --- a/sources/tech/20181022 Improve login security with challenge-response authentication.md +++ /dev/null @@ -1,185 +0,0 @@ -translating by hopefully2333 - -Improve login security with challenge-response authentication -====== - -![](https://fedoramagazine.org/wp-content/uploads/2018/10/challenge-response-816x345.png) - -### Introduction - -Today, Fedora offers multiple ways to improve the secure authentication of our user accounts. Of course it has the familiar user name and password to login. It also offers additional authentication options such as biometric, fingerprint, smart card, one-time password, and even challenge-response authentication. - -Each authentication method has clear pros and cons. That, in itself, could be a topic for a rather lengthy article. Fedora Magazine has covered a few of these options previously: - - -+ [Using the YubiKey4 with Fedora][1] -+ [Fedora 28: Better smart card support in OpenSSH][2] - - -One of the most secure methods in modern Fedora releases is offline hardware challenge-response. It’s also one of the easiest to deploy. Here’s how. - -### Challenge-response authentication - -Technically, when you provide a password, you’re responding to a user name challenge. The offline challenge response covered here requires your user name first. Next, Fedora challenges you to provide an encrypted physical hardware token. The token responds to the challenge with another encrypted key it stores via the Pluggable Authentication Modules (PAM) framework. Finally, Fedora prompts you for the password. This prevents someone from just using a found hardware token, or just using a user name and password without the correct encrypted key. - -This means that in addition to your user name and password, you must have previously registered one or more encrypted hardware tokens with the OS. And you have to provide that physical hardware token to be able to authenticate with your user name. - -Some challenge-response methods, like one time passwords (OTP), take an encrypted code key on the hardware token, and pass that key across the network to a remote authentication server. The server then tells Fedora’s PAM framework if it’s is a valid token for that user name. This is great if the authentication server(s) are on the local network. The downside is if the network connection is down or you’re working remote without a network connection, you can’t use this remote authentication method. You could be locked out of the system until you can connect through the network to the server. - -Sometimes a workplace requires use of Yubikey One Time Passwords (OTP) configuration. However, on home or personal systems you may prefer a local challenge-response configuration. Everything is local, and the method requires no remote network calls. The following process works on Fedora 27, 28, and 29. - -### Preparation - -#### Hardware token keys - -First you need a secure hardware token key. Specifically, this process requires a Yubikey 4, Yubikey NEO, or a recently released Yubikey 5 series device which also supports FIDO2. You should purchase two of them to provide a backup in case one becomes lost or damaged. You can use these keys on numerous workstations. The simpler FIDO or FIDO U2F only versions don’t work for this process, but are great for online services that use FIDO. - -#### Backup, backup, and backup - -Next, make a backup of all your important data. You may want to test the configuration in a Fedora 27/28/29 cloned VM to make sure you understand the process before setting up your personal workstation. - -#### Updating and installing - -Now make sure Fedora is up to date. Then install the required Fedora Yubikey packages via these dnf commands: - -``` -$ sudo dnf upgrade -$ sudo dnf install ykclient* ykpers* pam_yubico* -$ cd -``` - -If you’re in a VM environment, such as Virtual Box, make sure the Yubikey device is inserted in a USB port, and enable USB access to the Yubikey in the VM control. - -### Configuring Yubikey - -Verify that your user account has access to the USB Yubikey: - -``` -$ ykinfo -v -version: 3.5.0 -``` - -If the YubiKey is not detected, the following error message appears: - -``` -Yubikey core error: no yubikey present -``` - -Next, initialize each of your new Yubikeys with the following ykpersonalize command. This sets up the Yubikey configuration slot 2 with a Challenge Response using the HMAC-SHA1 algorithm, even with less than 64 characters. If you have already setup your Yubikeys for challenge-response, you don’t need to run ykpersonalize again. - -``` -ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -oserial-api-visible -``` - -Some users leave the YubiKey in their workstation while using it, and even use challenge-response for virtual machines. However, for more security you may prefer to manually trigger the Yubikey to respond to challenge. - -To add that manual challenge button trigger, add the -ochal-btn-trig flag. This flag causes the Yubikey to flash the yubikey LED on a request. It waits for you to press the button on the hardware key area within 15 seconds to produce the response key. - -``` -$ ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -ochal-btn-trig -oserial-api-visible -``` - -Do this for each of your new hardware keys, only once per key. Once you have programmed your keys, store the Yubikey configuration to ~/.yubico with the following command: - -``` -$ ykpamcfg -2 -v -debug: util.c:222 (check_firmware_version): YubiKey Firmware version: 4.3.4 - -Sending 63 bytes HMAC challenge to slot 2 -Sending 63 bytes HMAC challenge to slot 2 -Stored initial challenge and expected response in '/home/chuckfinley/.yubico/challenge-9992567'. -``` - -If you are setting up multiple keys for backup purposes, configure all the keys the same, and store each key’s challenge-response using the ykpamcfg utility. If you run the command ykpersonalize on an existing registered key, you must store the configuration again. - -### Configuring /etc/pam.d/sudo - -Now to verify this configuration worked, **in the same terminal window** you’ll setup sudo to require the use of the Yubikey challenge-response. Insert the following line into the /etc/pam.d/sudo file: - -``` -auth required pam_yubico.so mode=challenge-response -``` - -Insert the above auth line into the file above the auth include system-auth line. Then save the file and exit the editor. In a default Fedora 29 setup, /etc/pam.d/sudo should now look like this: - -``` -#%PAM-1.0 -auth required pam_yubico.so mode=challenge-response -auth include system-auth -account include system-auth -password include system-auth -session optional pam_keyinit.so revoke -session required pam_limits.so -session include system-auth -``` - -**Keep this original terminal window open** , and test by opening another new terminal window. In the new terminal window type: - -``` -$ sudo echo testing -``` - -You should notice the LED blinking on the key. Tap the Yubikey button and you should see a prompt for your sudo password. After you enter your password, you should see “testing” echoed in the terminal screen. - -Now test to ensure a correct failure. Start another terminal window and remove the Yubikey from the USB port. Verify that sudo no longer works without the Yubikey with this command: - -``` -$ sudo echo testing fail -``` - -You should immediately be prompted for the sudo password. Even if you enter the password, it should fail. - -### Configuring Gnome Desktop Manager - -Once your testing is complete, now you can add challenge-response support for the graphical login. Re-insert your Yubikey into the USB port. Next you’ll add the following line to the /etc/pam.d/gdm-password file: - -``` -auth required pam_yubico.so mode=challenge-response -``` - -Open a terminal window, and issue the following command. You can use another editor if desired: - -``` -$ sudo vi /etc/pam.d/gdm-password -``` - -You should see the yubikey LED blinking. Press the yubikey button, then enter the password at the prompt. - -Modify the /etc/pam.d/gdm-password file to add the new auth line above the existing line auth substack password-auth. The top of the file should now look like this: - -``` -auth [success=done ignore=ignore default=bad] pam_selinux_permit.so -auth required pam_yubico.so mode=challenge-response -auth substack password-auth -auth optional pam_gnome_keyring.so -auth include postlogin - -account required pam_nologin.so -``` - -Save the changes and exit the editor. If you use vi, the key sequence is to hit the **Esc** key, then type wq! at the prompt to save and exit. - -### Conclusion - -Now log out of GNOME. With the Yubikey inserted into the USB port, click on your user name in the graphical login. The Yubikey LED begins to flash. Touch the button, and you will be prompted for your password. - -If you lose the Yubikey, you can still use the secondary backup Yubikey in addition to your set password. You can also add additional Yubikey configurations to your user account. - -If someone gains access to your password, they still can’t login without your physical hardware Yubikey. Congratulations! You’ve now dramatically increased the security of your workstation login. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/login-challenge-response-authentication/ - -作者:[nabooengineer][a] -选题:[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/nabooengineer/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/using-the-yubikey4-with-fedora/ -[2]: https://fedoramagazine.org/fedora-28-better-smart-card-support-openssh/ - diff --git a/translated/tech/20181022 Improve login security with challenge-response authentication.md b/translated/tech/20181022 Improve login security with challenge-response authentication.md new file mode 100644 index 0000000000..1d227c2839 --- /dev/null +++ b/translated/tech/20181022 Improve login security with challenge-response authentication.md @@ -0,0 +1,182 @@ +通过询问-响应身份认证提高登陆安全 +====== + +![](https://fedoramagazine.org/wp-content/uploads/2018/10/challenge-response-816x345.png) + +### 介绍 + +今天,Fedora 提供了多种方式来提高我们账户的身份认证的安全性。当然,它有我们熟悉的用户名密码登陆,它也同样提供了其他的身份认证选项,比如生物识别、指纹、智能卡、一次性密码,甚至是询问-响应身份认证。 + +每种认证方式都有明确的优缺点。这点本身就可以成为一篇相当冗长的文章的主题。Fedora 杂志之前就已经介绍过了这其中的一些选项: + + ++ [Using the YubiKey4 with Fedora][1] ++ [Fedora 28: Better smart card support in OpenSSH][2] + + +在现在的 Fedora 版本中,最安全的方法之一就是离线硬件询问-响应。它也同样是最容易部署的方法之一。下面是具体方法: + +### 询问-响应认证 + +从技术上来讲,当你输入密码的时候,你就正在响应用户名询问。离线的询问、响应包含了这些部分:首先是需要你的用户名,接下来,Fedora 会要你提供一个加密的物理硬件的令牌。令牌会将另一个通过可插入式身份认证模块(PAM)框架进行存储的加密密钥来响应询问。最后,Fedora 才会提示你输入密码。这可以防止其他人仅仅使用了找到的硬件令牌,或是只使用了账户名密码而没有正确的加密密钥。 + +这意味着除了你的账户名密码之外,你必须事先在你的操作系统中注册了一个或多个加密硬件令牌。你必须保证你的物理硬件令牌能够匹配你的用户名。 + +一些询问-响应的方法,比如一次性密码(OTP),在硬件令牌上获取加密代码密钥,然后将这个密钥通过网络传输到远程身份认证服务器。然后这个服务器会告诉 Fedora 的 PAM 框架,这是否是该用户的一个有效令牌。如果身份认证服务器在本地网络上,这个方法非常好。但它的缺点是如果网络连接断开或是你在没有网的远程端工作。你会被锁在系统之外,直到你能通过网络连接到身份认证服务器。 + +有时候,生产环境会需要通过 Yubikey 使用一次性密码(OTP)设置,然而,在家庭或个人的系统上,你可能更喜欢询问-响应设置。一切都是本地的,这种方法不需要通过远程网络呼叫。下面这些过程适用于 Fedora 27、28和29. + +### 准备 + +#### 硬件令牌密钥 + +首先,你需要一个安全的硬件令牌密钥。具体来说,这个过程需要一个 Yubikey 4,Yubikey NEO,或者是最近发布的、同样支持 FIDO2 的 Yubikey 5 系列设备。你应该购买它们中的两个来有一个备份,以避免其中一个丢失或遭到损坏。你可以在不同的工作地点使用这些密钥。较为简单的 FIDO 和 FIDO U2F 版本不适用与这个过程,但是非常适合使用 FIDO 的在线服务。 + +#### 备份、备份,以及备份 + +接下来,为你所有的重要数据制作备份,你可能想在克隆在 VM 里的 Fedora 27/28/29 里测试配置,来确保你在设置你自己的个人工作环境之前理解这个过程。 + +#### 升级,然后安装 + +现在,确定你的 Fedora 是最新的,然后通过 dnf 命令安装所需要的 Fedora Yubikey 包。 + +``` +$ sudo dnf upgrade +$ sudo dnf install ykclient* ykpers* pam_yubico* +$ cd +``` + +如果你使用的是 VM 环境,例如 Virtual Box,确保 Yubikey 设备已经插进了 USB 口,然后允许 VM 控制的 USB 访问 Yubikey。 + +### 配置 Yubikey + +通过 USB Yubikey 验证你的账户: + +``` +$ ykinfo -v +version: 3.5.0 +``` + +如果 Yubikey 没有被检测到,会出现下面这些错误信息: + +``` +Yubikey core error: no yubikey present +``` + +接下来,通过下面这些 ykpersonalize 命令初始化你每个新的 Yubikeys。使用 HMAC-SHA1 算法进行询问响应,以此来设置 Yubikey 配置插槽 2。即使少于 64 个字符,如果你已经为询问响应设置好了你的 Yubikey。你就不需要再运行 ykpersonalize 了。 + +``` +ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -oserial-api-visible +``` + +一些用户在使用的时候将 YubiKey 留在了工作环境里,甚至对虚拟机使用了询问响应。然而,为了更好的安全性,你可能会更愿意使用手动触发 YubiKey 来响应询问。 + +要添加手动询问按钮触发器,请添加 -ochal-btn-trig 标记,这个标记可以在请求中使得 Yubikey 闪烁 Yubikey LED。等待你在 15 秒内按下硬件密钥区域上的按钮来生成响应密钥。 + +``` +$ ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -ochal-btn-trig -oserial-api-visible +``` + +为你的每个新的硬件密钥执行此操作。每个密钥执行以此,使用下面的命令将 Yubikey 配置存储到 ~/.yubico: + +``` +$ ykpamcfg -2 -v +debug: util.c:222 (check_firmware_version): YubiKey Firmware version: 4.3.4 + +Sending 63 bytes HMAC challenge to slot 2 +Sending 63 bytes HMAC challenge to slot 2 +Stored initial challenge and expected response in '/home/chuckfinley/.yubico/challenge-9992567'. +``` + +如果你要设置多个密钥用于备份。请将所有的密钥设置为相同,然后使用 ykpamcfg utility 存储每个密钥的询问-响应。如果你在一个已经存在的注册密钥上运行 ykpersonalize 命令,你就必须再次存储配置信息。 + +### 配置 /etc/pam.d/sudo + +现在要去验证配置是否有效,在相同的终端窗口中,你需要设置 sudo 来要求使用 Yubikey 的询问-响应。将下面这几行插入到 /etc/pam.d/sudo 文件中。 + +``` +auth required pam_yubico.so mode=challenge-response +``` + +将上面的 auth 行插入到 auth 文件中的 system-auth 行的上面,然后保存并退出编辑器。在默认的 Fedora 29 设置中,/etc/pam.d/sudo 应该像下面这样: + +``` +#%PAM-1.0 +auth required pam_yubico.so mode=challenge-response +auth include system-auth +account include system-auth +password include system-auth +session optional pam_keyinit.so revoke +session required pam_limits.so +session include system-auth +``` + +保持原始终端窗口打开,然后打开一个新的终端窗口进行测试,在新的终端窗口中输入: + +``` +$ sudo echo testing +``` + +你应该注意到了 key 上的 LED 在闪烁。点击 Yubikey 按钮,你应该会看见一个输入 sudo 密码的提示。在你输入你的密码之后,你应该会在终端屏幕上看见 ”testing“ 的字样。 + +现在去测试确保正常的失败,启动另一个终端窗口,并从 USB 插口中拔掉 Yubikey。使用下面这条命令验证,在没有 Yubikey 的情况下,sudo 是否会不再正常工作。 + +``` +$ sudo echo testing fail +``` +你应该立刻被提示输入 sudo 密码,即使你输入了正确密码,登陆也应该失败。 + +### 设置 Gnome 桌面管理 + +一旦你的测试完成后,你就可以为图形登陆添加询问-响应支持了。将你的 Yubikey 再次插入进 USB 插口中。然后将下面这几行添加到 /etc/pam.d/gdm-password 文件中: + +``` +auth required pam_yubico.so mode=challenge-response +``` + +打开一个终端窗口,然后运行下面这些命令。如果需要,你可以使用其他的编辑器: + +``` +$ sudo vi /etc/pam.d/gdm-password +``` + +你应该看到 yubikey 上的 LED 在闪烁,按下 yubikey 按钮,然后在提示符出输入密码。 + +修改 /etc/pam.d/gdm-password 文件,在已有的 password-auth 上添加新的 auth 行。这个文件的顶部应该像下面这样: + +``` +auth [success=done ignore=ignore default=bad] pam_selinux_permit.so +auth required pam_yubico.so mode=challenge-response +auth substack password-auth +auth optional pam_gnome_keyring.so +auth include postlogin + +account required pam_nologin.so +``` + +保存更改并退出编辑器,如果你使用的是 vi,输入键是按 Esc 键,然后在提示符出输入 wq! 来保存并退出。 + +### 结论 + +现在注销 GNOME。将 Yubikey 插入到 USB 口,在图形登陆界面上点击你的用户名。Yubikey LED 会开始闪烁。触摸那个按钮,你会被提示输入你的密码。 + +如果你丢失了 Yubikey,除了重置密码之外,你还可以使用备份的 Yubikey。你还可以给你的账户增加额外的 Yubikey 配置。 + +如果有其他人获得了你的密码,他们在没有你的物理硬件 Yubikey 的情况下,仍然不能登陆。恭喜!你已经显著提高了你的工作环境登陆的安全性了。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/login-challenge-response-authentication/ + +作者:[nabooengineer][a] +选题:[lujun9972][b] +译者:[hopefully2333](https://github.com/hopefully2333) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/nabooengineer/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/using-the-yubikey4-with-fedora/ +[2]: https://fedoramagazine.org/fedora-28-better-smart-card-support-openssh/ + From 0ee2f3d8cd5f8c5ca38a63afebb5a36ab705e880 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 24 Dec 2018 08:53:01 +0800 Subject: [PATCH 1024/1143] translated --- ...Locally As Virtual File System In Linux.md | 135 ----------------- ...Locally As Virtual File System In Linux.md | 136 ++++++++++++++++++ 2 files changed, 136 insertions(+), 135 deletions(-) delete mode 100644 sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md create mode 100644 translated/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md diff --git a/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md b/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md deleted file mode 100644 index ae559de4c6..0000000000 --- a/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md +++ /dev/null @@ -1,135 +0,0 @@ -translating---geekpi - -Dbxfs – Mount Dropbox Folder Locally As Virtual File System In Linux -====== - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/dbxfs-720x340.png) - -A while ago, we summarized all the possible ways to **[mount Google drive locally][1]** as a virtual file system and access the files stored in the google drive from your Linux operating system. Today, we are going to learn to mount Dropbox folder in your local file system using **dbxfs** utility. The dbxfs is used to mount your Dropbox folder locally as a virtual filesystem in Unix-like operating systems. While it is easy to [**install Dropbox client**][2] in Linux, this approach slightly differs from the official method. It is a command line dropbox client and requires no disk space for access. The dbxfs application is free, open source and written for Python 3.5+. - -### Installing dbxfs - -The dbxfs officially supports Linux and Mac OS. However, it should work on any POSIX system that provides a **FUSE-compatible library** or has the ability to mount **SMB** shares. Since it is written for Python 3.5, it can installed using **pip3** package manager. Refer the following guide if you haven’t installed PIP yet. - -And, install FUSE library as well. - -On Debian-based systems, run the following command to install FUSE: - -``` -$ sudo apt install libfuse2 - -``` - -On Fedora: - -``` -$ sudo dnf install fuse - -``` - -Once you installed all required dependencies, run the following command to install dbxfs utility: - -``` -$ pip3 install dbxfs - -``` - -### Mount Dropbox folder locally - -Create a mount point to mount your dropbox folder in your local file system. - -``` -$ mkdir ~/mydropbox - -``` - -Then, mount the dropbox folder locally using dbxfs utility as shown below: - -``` -$ dbxfs ~/mydropbox - -``` - -You will be asked to generate an access token: - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Generate-access-token-1.png) - -To generate an access token, just navigate to the URL given in the above output from your web browser and click **Allow** to authenticate Dropbox access. You need to log in to your dropbox account to complete authorization process. - -A new authorization code will be generated in the next screen. Copy the code and head back to your Terminal and paste it into cli-dbxfs prompt to finish the process. - -You will be then asked to save the credentials for future access. Type **Y** or **N** whether you want to save or decline. And then, you need to enter a passphrase twice for the new access token. - -Finally, click **Y** to accept **“/home/username/mydropbox”** as the default mount point. If you want to set different path, type **N** and enter the location of your choice. - -[![Generate access token 2][3]][4] - -All done! From now on, you can see your Dropbox folder is locally mounted in your filesystem. - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Dropbox-in-file-manager.png) - -### Change Access Token Storage Path - -By default, the dbxfs application will store your Dropbox access token in the system keyring or an encrypted file. However, you might want to store it in a **gpg** encrypted file or something else. If so, get an access token by creating a personal app on the [Dropbox developers app console][5]. - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/access-token.png) - -Once the app is created, click **Generate** button in the next button. This access token can be used to access your Dropbox account via the API. Don’t share your access token with anyone. - -![](https://www.ostechnix.com/wp-content/uploads/2018/10/Create-a-new-app.png) - -Once you created an access token, encrypt it using any encryption tools of your choice, such as [**Cryptomater**][6], [**Cryptkeeper**][7], [**CryptGo**][8], [**Cryptr**][9], [**Tomb**][10], [**Toplip**][11] and [**GnuPG**][12] etc., and store it in your preferred location. - -Next edit the dbxfs configuration file and add the following line in it: - -``` -"access_token_command": ["gpg", "--decrypt", "/path/to/access/token/file.gpg"] - -``` - -You can find the dbxfs configuration file by running the following command: - -``` -$ dbxfs --print-default-config-file - -``` - -For more details, refer dbxfs help section: - -``` -$ dbxfs -h - -``` - -As you can see, mounting Dropfox folder locally in your file system using Dbxfs utility is no big deal. As far tested, dbxfs just works fine as expected. Give it a try if you’re interested to see how it works and let us know about your experience in the comment section below. - -And, that’s all for now. Hope this was useful. More good stuff to come. Stay tuned! - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/dbxfs-mount-dropbox-folder-locally-as-virtual-file-system-in-linux/ - -作者:[SK][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[1]: https://www.ostechnix.com/how-to-mount-google-drive-locally-as-virtual-file-system-in-linux/ -[2]: https://www.ostechnix.com/install-dropbox-in-ubuntu-18-04-lts-desktop/ -[3]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[4]: http://www.ostechnix.com/wp-content/uploads/2018/10/Generate-access-token-2.png -[5]: https://dropbox.com/developers/apps -[6]: https://www.ostechnix.com/cryptomator-open-source-client-side-encryption-tool-cloud/ -[7]: https://www.ostechnix.com/how-to-encrypt-your-personal-foldersdirectories-in-linux-mint-ubuntu-distros/ -[8]: https://www.ostechnix.com/cryptogo-easy-way-encrypt-password-protect-files/ -[9]: https://www.ostechnix.com/cryptr-simple-cli-utility-encrypt-decrypt-files/ -[10]: https://www.ostechnix.com/tomb-file-encryption-tool-protect-secret-files-linux/ -[11]: https://www.ostechnix.com/toplip-strong-file-encryption-decryption-cli-utility/ -[12]: https://www.ostechnix.com/an-easy-way-to-encrypt-and-decrypt-files-from-commandline-in-linux/ diff --git a/translated/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md b/translated/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md new file mode 100644 index 0000000000..889fb00ac8 --- /dev/null +++ b/translated/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md @@ -0,0 +1,136 @@ +Dbxfs - 在 Linux 中本地挂载 Dropbox 文件夹作为虚拟文件系统 +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/dbxfs-720x340.png) + +不久前,我们总结了所有**[在本地挂载 Google Drive][1]**作为虚拟文件系统,并从 Linux 系统访问存储在 Google Drive 中的文件的方法。今天,我们将学习使用 **dbxfs**将 Dropbox 文件夹挂载到本地文件系统中。dbxfs 用于在类 Unix 操作系统中本地挂载 Dropbox 文件夹作为虚拟文件系统。虽然在 Linux 中很容易[**安装 Dropbox 客户端**][2],但这种方法与官方方法略有不同。它是一个命令行 dropbox 客户端,且无需磁盘空间即可访问。dbxfs 是免费、开源的,并且是用 Python 3.5+ 编写的。 + +### 安装 dbxfs + +dbxfs 官方支持 Linux 和 Mac OS。但是,它应该适用于任何提供 **FUSE 兼容库**或能够挂载 **SMB** 共享的 POSIX 系统。由于它是用 Python 3.5 编写的,因此可以使用 **pip3** 包管理器进行安装。如果尚未安装 PIP,请参阅以下指南。 + +[如何使用 pip 管理 Python 包][13] + +并且也要安装 FUSE 库。 + +在基于 Debian 的系统上,运行以下命令以安装 FUSE: + +``` +$ sudo apt install libfuse2 + +``` + +在 Fedora 上: + +``` +$ sudo dnf install fuse + +``` + +安装完所有必需的依赖项后,运行以下命令以安装 dbxfs: + +``` +$ pip3 install dbxfs + +``` + +### 在本地挂载 Dropbox 文件夹 + +创建一个挂载点以将 Dropbox 文件夹挂载到本地文件系统中。 + +``` +$ mkdir ~/mydropbox + +``` + +然后,使用 dbxfs 在本地挂载 dropbox 文件夹,如下所示: + +``` +$ dbxfs ~/mydropbox + +``` + +你将被要求生成一个访问令牌: + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Generate-access-token-1.png) + +要生成访问令牌,只需在 Web 浏览器中输入上面输出的 URL,然后单击**允许** 以授权 Dropbox 访问。你需要登录 Dropbox 帐户才能完成授权过程。 + +下一个页面将生成新的授权码。复制代码并返回终端将其粘贴到 cli-dbxfs 提示符中以完成该过程。 + +然后,系统会要求你保存凭据以供将来访问。无论你是要保存还是拒绝,输入 **Y** 或 **N**。然后,你需要为新的访问令牌输入两次密码。 + +最后,输入 **Y** 接受 **“/home/username/mydropbox”** 作为默认挂载点。如果你要设置不同的路径,输入 **N** 并输入你选择的位置。 + +[![Generate access token 2][3]][4] + +完成了!从现在开始,你可以看到你的 Dropbox 文件夹已挂载到本地文件系统中。 + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Dropbox-in-file-manager.png) + +### 更改访问令牌存储路径 + +默认情况下,dbxfs 会将 Dropbox 访问令牌存储在系统密钥环或加密文件中。但是,你可能希望将其存储在 **gpg** 加密文件或其他地方。如果是这样,请在 [Dropbox 开发者应用控制台][5]上创建个人应用来获取访问令牌。 + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/access-token.png) + +创建应用后,单击下一步中的**生成**按钮。此令牌可用于通过 API 访问你的 Dropbox 帐户。不要与任何人共享你的访问令牌。 + +![](https://www.ostechnix.com/wp-content/uploads/2018/10/Create-a-new-app.png) + +创建访问令牌后,使用任何你选择的加密工具对其进行加密,例如 [**Cryptomater**][6]、[**Cryptkeeper**][7]、[**CryptGo**][8]、[**Cryptr**][9]、[**Tomb**][10]、[**Toplip**][11] 和 [**GnuPG**][12] 等,并在你喜欢的位置保存。 + +接下来编辑 dbxfs 配置文件并添加以下行: + +``` +"access_token_command": ["gpg", "--decrypt", "/path/to/access/token/file.gpg"] + +``` + +你可以通过运行以下命令找到 dbxfs 配置文件: + +``` +$ dbxfs --print-default-config-file + +``` + +有关更多详细信息,请参阅 dbxfs 帮助: + +``` +$ dbxfs -h + +``` + +如你所见,使用 dbxfs 在你的文件系统中本地挂载 Dropfox 文件夹没什么大不了的。经过测试,dbxfs 如常工作。如果你有兴趣了解它是如何工作的,请尝试一下,并在下面的评论栏告诉我们你的体验。 + +就是这些了。希望这篇文章有用。还有更多好东西。敬请期待! + +干杯! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/dbxfs-mount-dropbox-folder-locally-as-virtual-file-system-in-linux/ + +作者:[SK][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[1]: https://www.ostechnix.com/how-to-mount-google-drive-locally-as-virtual-file-system-in-linux/ +[2]: https://www.ostechnix.com/install-dropbox-in-ubuntu-18-04-lts-desktop/ +[3]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[4]: http://www.ostechnix.com/wp-content/uploads/2018/10/Generate-access-token-2.png +[5]: https://dropbox.com/developers/apps +[6]: https://www.ostechnix.com/cryptomator-open-source-client-side-encryption-tool-cloud/ +[7]: https://www.ostechnix.com/how-to-encrypt-your-personal-foldersdirectories-in-linux-mint-ubuntu-distros/ +[8]: https://www.ostechnix.com/cryptogo-easy-way-encrypt-password-protect-files/ +[9]: https://www.ostechnix.com/cryptr-simple-cli-utility-encrypt-decrypt-files/ +[10]: https://www.ostechnix.com/tomb-file-encryption-tool-protect-secret-files-linux/ +[11]: https://www.ostechnix.com/toplip-strong-file-encryption-decryption-cli-utility/ +[12]: https://www.ostechnix.com/an-easy-way-to-encrypt-and-decrypt-files-from-commandline-in-linux/ +[13]:https://www.ostechnix.com/manage-python-packages-using-pip/ \ No newline at end of file From 9028d7c70ec81862b3df219fa8cf66ac8ea58c17 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 24 Dec 2018 09:03:09 +0800 Subject: [PATCH 1025/1143] translated --- ...0181214 How To Install Rust Programming Language In Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181214 How To Install Rust Programming Language In Linux.md b/sources/tech/20181214 How To Install Rust Programming Language In Linux.md index 074c41e9f9..c39e037d6d 100644 --- a/sources/tech/20181214 How To Install Rust Programming Language In Linux.md +++ b/sources/tech/20181214 How To Install Rust Programming Language In Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 62c118328fbf2b163c1253624448c165e4cd47c8 Mon Sep 17 00:00:00 2001 From: zjon Date: Mon, 24 Dec 2018 09:54:35 +0800 Subject: [PATCH 1026/1143] Delete 20171012 7 Best eBook Readers for Linux.md delete 20171012 7 Best eBook Readers for Linux.md from sources dir --- ...20171012 7 Best eBook Readers for Linux.md | 182 ------------------ 1 file changed, 182 deletions(-) delete mode 100644 sources/tech/20171012 7 Best eBook Readers for Linux.md diff --git a/sources/tech/20171012 7 Best eBook Readers for Linux.md b/sources/tech/20171012 7 Best eBook Readers for Linux.md deleted file mode 100644 index 520c9c4533..0000000000 --- a/sources/tech/20171012 7 Best eBook Readers for Linux.md +++ /dev/null @@ -1,182 +0,0 @@ -7 个最佳 Linux 电子书阅读器 -====== -**摘要:** 文章中我们涉及一些 Linux 最佳电子书阅读器。这些应用提供更佳阅读体验甚至会管理你的电子书。 - -![最佳 Linux 电子书阅读器][1] - -最近,随着人们发现在手持设备,Kindle 或者 PC 上阅读更佳舒适,对电子图书的需求有所增加。谈到 Linux 用户,有各种电子书应用满足你阅读和整理电子书的需求。 - -在本文中,我们选出了七个最佳 Linux 电子书阅读器。这些电子书阅读器最适合 pdf,epubs 和其他电子书格式。 - -## 最佳 Linux 电子书阅读器 - -我提供 Ubuntu 安装说明,因为我现在使用。如果你使用[非 Ubuntu 发行版][2],你能在你的发行版软件仓库中找到大多数这些电子书应用。 - -### 1. Calibre - -[Calibre][3] 是 Linux 最受欢迎的电子书应用。老实说,这不仅仅是一个简单的电子书阅读器。它是一个完整的电子书解决方案。你甚至能[通过 Calibre 创建私人电子][4] - -通过强大的电子书管理和易用的接口,它具有创建和编辑电子书。Calibre 支持多种格式和与其他电子书阅读器同步。它也可以让你轻松转换一种电子书格式到另一种。 - -Calibre 最大的缺点是,资源上太沉重,让它成为一个艰难的选择作为一个独立的电子阅读器。 - -![Calibre][5] - -#### 特性 - - * 管理电子书:Calibre 通过管理云数据允许存储和分组电子书。你能下载一本电子书的元数据从各种来源或创建和编辑现有的字段。 - * 支持所有主流电子书格式: Calibre 支持所有主流电子书格式并兼容多种电子阅读器。 - * 文件转换: 在转换时,你能通过改变电子书风格,创建内容表和调整边距的选项来转换任何一种电子书格式到另一种。你也能转换个人文档为电子书。 - * 从 web 下载杂志期刊:Calibre 能从各种新闻源或者通过 RSS 订阅源传递故事。 - * 分享和备份你的电子图书馆:它提供了一个选项,托管你电子书集合到它的服务端,从而你能与好友共享或用任何设备从任何地方访问。备份和导入/导出特性允许你保证你的收藏安全和方便携带。 - -#### 安装 - -你能在主流 Linux 发行版的软件库中找到它。对于 Ubuntu,在软件中心搜索它或者使用下面的命令: - -`sudo apt-get install calibre` - -### 2. FBReader - -![FBReader: Linux 电子书阅读器][6] - -[FBReader][7] 是一个开源的轻量级多平台电子书阅读器,它支持多种格式,比如 ePub,fb2,mobi,rtf,html 等。它包含一些允许访问的流行网络电子图书馆,那里你能免费或付费下载电子书。 - -#### 特性 - - * 支持多种文件格式和设备比如 Android,iOS,Windows,Mac 和更多。 - * 同步书籍收藏,阅读位置和书签。 - * 在线管理你图书馆中从你的 Linux 桌面添加到所有设备的任何书。 - * 支持 Web 浏览器允许你的存储集。 - * 支持 Google Drive 做书籍的存储和通过作者,系列或其他属性整理书籍。 - -#### 安装 - -你能从官方库或者在终端中输入一下命令安装 FBReader 电子阅读器。 -``` -sudo apt-get install fbreader -``` - -或者你能从[这里][8]抓取一个以 .deb 包并在你的基于 Debian 发行版的系统上安装它。 - -### 3. Okular - -[Okular][9] 是另一个开源的基于 KDE 开发的跨平台文档查看器,它已经作为 KDE 应用发布的一部分了。 - -![Okular][10] - -#### 特性 - - * Okular 支持多种文档格式像 PDF,Postscript,DjVu,DHM,XPS,ePub 和其他。 - * 支持在 PDF 文档中评论,高亮和绘制不通的形状等。 - * 无需修改原始 PDF 文件分别保存这些更改。 - * 电子书中的文本能被提取到一个文本文件,这个内置文本阅读服务叫 Jovie。 - -备注:检查应用的时候,我发现这个应用在 Ubuntu 和它的衍生系统不支持 ePub 文件格式。其他发行版用户仍然可以发挥它全部的潜力。 - -#### 安装 - -Ubuntu 用户可以在终端中键入下面的命令来安装它: -``` -sudo apt-get install okular -``` - -### 4. Lucidor - -Lucidor 是一个易用的支持 epub 文件格式和在 OPDS 格式中编目的电子阅读器。它也具有电子书集合在本地书柜里,搜索和下载互联网和 web 订阅和网页转换成电子书的功能。 - -Lucidor 是 XULRunner 应用程序,它向您展示了具有类火狐的选项卡式布局,和存储数据和配置时的展现。他是列表中最简单的电子阅读器,包括诸如文本说明和滚动选项之类的配置。 - -![lucidor][11] - -你可以通过选择单词并右击 > 查找单词来查找 Wiktionary.org 的定义。它也包含 web 订阅或 web 页面作为电子书的选项。 - -你能从[这里][12]下载和安装 deb 或者 RPM 包。 - -### 5. Bookworm - -![Bookworm Linux 电子阅读器][13] - -Bookworm 是另一个支持多种文件格式诸如 epub, pdf, mobi, cbr and cbz 的免费开源的电子阅读器。我写了一篇关于 Bookworm 应用程序的特性和安装的专题文章,到这里阅读: [Bookworm: 一个简单而强大的 Linux 电子阅读器][14] - -#### 安装 -``` -sudo apt-add-repository ppa:bookworm-team/bookworm -sudo apt-get update -sudo apt-get install bookworm -``` - -### 6. Easy Ebook Viewer - -[Easy Ebook Viewer][15] 是另外一个用于读取 ePub 文件的很棒的 GTK python 应用.具有基本章节导航、从上次阅读位置继续、从其他电子书文件格式导入、章节跳转等功能,Easy Ebook Viewer 是一个简单而简约的 ePub 阅读器. - -![Easy-Ebook-Viewer][16] - -这个应用仍然处于初始阶段,只支持ePub文件。 - -#### 安装 - -你可以从 [github][17] 下载源代码和自己编译以及依赖项来安装 Easy Ebook Viewer。或者,以下终端命令将执行完全相同的工作。 -``` -sudo apt install git gir1.2-webkit-3.0 libwebkitgtk-3.0-0 gir1.2-gtk-3.0 python3-gi -git clone https://github.com/michaldaniel/Ebook-Viewer.git -cd Ebook-Viewer/ -sudo make install -``` - -成功完成上述步骤后,你可以从Dash启动它。 - -### 7. Buka - -Buka 主要是一个具有简单而清爽的用户界面的电子书管理器。它目前支持 PDF 格式,旨在帮助用户更加关注内容。拥有 pdf 阅读器的所有基本特性,Buka 允许你通过箭头键导航,具有缩放选项,并且能并排查看 2 页。 - -你可以创建单独的 PDF 文件列表并轻松地在它们之间切换。Buka也提供了一个内置翻译工具,但是你需要有效的互联网连接来使用这个特性。 - -![Buka][19] - -#### 安装 - -你能从[官方下载页面][20]下载一个 AppImage。如果你不知道,请阅读[如何在 Linux 下使用 AppImage][21]。或者,你可以通过命令行安装它: -``` -sudo snap install buka -``` - -### 结束语 - -就我个人而言,我发现 Calibre 最适合我的需要。当然,Bookworm 看起来很有前途,这几天我经常使用它。不过,电子书应用的选择完全取决于你的喜好。 - -你使用哪个电子书应用呢?在下面的评论中让我们知道。 - - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-ebook-readers-linux/ - -作者:[Ambarish Kumar][a] -译者:[zjon](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://itsfoss.com/author/ambarish/ -[1]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/best-ebook-readers-linux-800x450.png -[2]:https://itsfoss.com/non-ubuntu-beginner-linux/ -[3]:https://www.calibre-ebook.com -[4]:https://itsfoss.com/create-ebook-calibre-linux/ -[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Calibre-800x603.jpeg -[6]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/fbreader-800x624.jpeg -[7]:https://fbreader.org -[8]:https://fbreader.org/content/fbreader-beta-linux-desktop -[9]:https://okular.kde.org/ -[10]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Okular-800x435.jpg -[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/lucidor-2.png -[12]:http://lucidor.org/lucidor/download.php -[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/08/bookworm-ebook-reader-linux-800x450.jpeg -[14]:https://itsfoss.com/bookworm-ebook-reader-linux/ -[15]:https://github.com/michaldaniel/Ebook-Viewer -[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Easy-Ebook-Viewer.jpg -[17]:https://github.com/michaldaniel/Ebook-Viewer.git -[18]:https://github.com/oguzhaninan/Buka -[19]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Buka2-800x555.png -[20]:https://github.com/oguzhaninan/Buka/releases -[21]:https://itsfoss.com/use-appimage-linux/ From 30d258a85352887e90efd5e04f636340b46a4674 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Dec 2018 12:38:13 +0800 Subject: [PATCH 1027/1143] PRF:20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md @qhwdw --- ...mputing with Open Source Cirq Framework.md | 83 +++++++++---------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md index fcbc89e77c..c1be5d0ddf 100644 --- a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md +++ b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md @@ -1,24 +1,25 @@ 量子计算的开源框架 Cirq 介绍 ====== + 我们即将讨论的内容正如标题所示,本文通过使用 Cirq 的一个开源视角,尝试去了解我们已经在量子计算领域取得多大的成就,和该领域的发展方向,以加快科学和技术研究。 -首先,我们将引领你进入量子计算的世界。在我们深入了解 Cirq 在未来的量子计算中扮演什么样的重要角色之前,我们将尽量向你解释其背后的基本概念。Cirq,你最近可能听说过,在这个领域中已经发生了重大新闻,在 Open Science 上的文章中,我们将去尝试找出答案。 +首先,我们将引领你进入量子计算的世界。在我们深入了解 Cirq 在未来的量子计算中扮演什么样的重要角色之前,我们将尽量向你解释其背后的基本概念。你最近可能听说过,在这个领域中有件重大新闻,就是 Cirq。在这篇开放科学栏目的文章中,我们将去尝试找出答案。 - +- [How it Works - Quantum Computing](https://www.youtube.com/WVv5OAR4Nik) -在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2] 这个词来自拉丁语 Quantus,意思是 “有多少”,在下面的短视频链接中有描述: +在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2]Quantum 这个词来自拉丁语 Quantus,意思是 “有多小”,在下面的短视频链接中有描述: - +- [What is a quantum Why is it significant](https://www.youtube.com/-pUOxVsxu3o) -为了易于我们理解量子计算,我们将量子计算与经典计算Classical Computing(也有译做传统计算)进行比较。经典计算是指设计用于工作的、正在使用的计算机,正如你现在用于阅读本文的设备,就是我们所谓的经典计算设备。 +为了易于我们理解量子计算,我们将量子计算Quantum Computing经典计算Classical Computing(LCTT 译注:也有译做“传统计算”)进行比较。经典计算是指今天的传统计算机如何设计工作的,正如你现在用于阅读本文的设备,就是我们所谓的经典计算设备。 ### 经典计算 -经典计算是描述计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。经典计算机不会理解除 1 或 0 之外的任何其它东西。 +经典计算只是描述计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。经典计算机不会理解除 1 或 0 之外的任何其它东西。 -直白来说,在计算机内部一个晶体管只能是开(1)或关(0)。我们输入的任何信息都被转换为无数个 1 和 0,所以计算机只能理解和存储 1 和 0。所有的东西都只能用无数个 1 和 0 的组合来表示。 +直白来说,在计算机内部一个晶体管只能是开(1)或关(0)。我们输入的任何信息都被转换为无数个 1 和 0,以便计算机能理解和存储。所有的东西都只能用无数个 1 和 0 的组合来表示。 - +- [Why Do Computers Use 1s and 0s Binary and Transistors Explained](https://www.youtube.com/Xpk67YzOn5w) ### 量子计算 @@ -26,39 +27,39 @@ 请注意,叠加和纠缠 [不是同一个现象][4]。 - +- [How Do Quantum Computers Work!](https://www.youtube.com/jiXuVIEg10Q) ![][5] -就像在经典计算中,我们有比特bit,在量子计算中,我们相应也有量子比特qubits(或 Quantum bits)。想了解它们二者之间的巨大差异之处,请查看这个 [页面][6],从那里的图片中可以得到答案。 +就像在经典计算中,我们有比特bit,在量子计算中,我们相应也有量子比特qubit(即 Quantum bit)。想了解它们二者之间的巨大差异之处,请查看这个 [页面][6],从那里的图片中可以得到答案。 量子计算机并不是来替代我们的经典计算机的。但是,有一些非常巨大的任务用我们的经典计算机是无法完成的,而那些正是量子计算机大显身手的好机会。下面链接的视频详细描述了上述情况,同时也描述了量子计算机的原理。 - +- [Quantum Computers Explained – Limits of Human Technology](https://www.youtube.com/JhHMJCUmq28) 下面的视频全面描述了量子计算领域到目前为止的最新进展: - +- [Quantum Computing 2018 Update](https://www.youtube.com/CeuIop_j2bI) ### 嘈杂中型量子 -根据最新更新的(2018 年 7 月 31 日)研究论文,术语 “Noisy” 是指由于对量子比特未能完全控制所产生的不准确性。正是这种不准确性严重制约了量子设备短期内实现其目标。 +根据最新更新的(2018 年 7 月 31 日)研究论文,术语 “嘈杂Noisy” 是指由于对量子比特未能完全控制所产生的不准确性。正是这种不准确性在短期内严重制约了量子设备实现其目标。 -“中型” 指的是在接下来的几年中,量子计算机将要实现的量子规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力][7] 模拟能力。更多信息请阅读 [这里的][9] 论文。 +“中型” 指的是在接下来的几年中,量子计算机将要实现的量子规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力破解][7] 所能比拟的计算能力。更多信息请阅读 [这里的][9] 论文。 随着 Cirq 出现,许多事情将会发生变化。 ### Cirq 是什么? -Cirq 是一个 python 框架,它用于创建、编辑和调用我们前面讨论的嘈杂中型量子(NISQ)。换句话说,Cirq 能够解决挑战,去改善精确度和降低量子计算中的噪声。 +Cirq 是一个 Python 框架,它用于创建、编辑和调用我们前面讨论的嘈杂中型量子(NISQ)。换句话说,Cirq 能够解决挑战,去改善精确度和降低量子计算中的噪声。 Cirq 并不需要必须有一台真实的量子计算机。Cirq 能够使用一个类似模拟器的界面去执行量子电路模拟。 -Cirq 的前进步伐越来越快了,[Zapata][10] 是使用它的首批用户之一,Zapata 是由来自哈佛大学的一群专注于量子计算的科学家在去年成立的。 +Cirq 的前进步伐越来越快了,[Zapata][10] 是使用它的首批用户之一,Zapata 是由来自哈佛大学的专注于量子计算的[一群科学家][11]在去年成立的。 ### Linux 上使用 Cirq 入门 -开源的 [Cirq 库][12] 开发者建议将它安装在像 [virtualenv][14] 这样的一个 [虚拟 python 环境][13] 中。在 Linux 上的开发者安装指南可以在 [这里][15] 找到。 +开源的 [Cirq 库][12] 开发者建议将它安装在像 [virtualenv][14] 这样的一个 [虚拟 Python 环境][13] 中。在 Linux 上的开发者安装指南可以在 [这里][15] 找到。 但我们在 Ubuntu 16.04 的系统上成功地安装和测试了 Python3 的 Cirq 库,安装步骤如下: @@ -66,43 +67,41 @@ Cirq 的前进步伐越来越快了,[Zapata][10] 是使用它的首批用户 ![Cirq Framework for Quantum Computing in Linux][16] -首先,我们需要 pip 或 pip3 去安装 Cirq。[Pip][17] 是推荐用于安装和管理 Python 包的工具。 +首先,我们需要 `pip` 或 `pip3` 去安装 Cirq。[Pip][17] 是推荐用于安装和管理 Python 包的工具。 对于 Python 3.x 版本,Pip 能够用如下的命令来安装: + ``` sudo apt-get install python3-pip - ``` Python3 包能够通过如下的命令来安装: + ``` pip3 install - ``` 我们继续去使用 Pip3 为 Python3 安装 Cirq 库: + ``` pip3 install cirq - ``` #### 启用 Plot 和 PDF 生成(可选) -可选系统的依赖没有安装的,可以使用 pip 去安装它: +可选系统的依赖没有被 Pip 安装的,可以使用如下命令去安装它: + ``` sudo apt-get install python3-tk texlive-latex-base latexmk - ``` * python3-tk 是 Python 自有的启用了绘图功能的图形库 * texlive-latex-base 和 latexmk 启动了 PDF 输出功能。 - - 最后,我们使用如下的命令和代码成功测试了 Cirq: + ``` python3 -c 'import cirq; print(cirq.google.Foxtail)' - ``` 我们得到的输出如下图: @@ -113,27 +112,27 @@ python3 -c 'import cirq; print(cirq.google.Foxtail)' 我们也配置了一个 Python IDE [PyCharm][19] 去测试同样的结果: -因为在我们的 Linux 系统上为 Python3 安装了 Cirq,我们在 IDE 中配置项目解释器路径: +因为在我们的 Linux 系统上为 Python3 安装了 Cirq,我们在 IDE 中配置项目解释器路径为: + ``` /usr/bin/python3 - ``` ![][20] -在上面的输出中,你可能注意到我们刚设置的项目解释器路径与测试程序文件(test.py)的路径显示在一起。退出代码 0 表示程序已经成功退出,没有错误。 +在上面的输出中,你可能注意到我们刚设置的项目解释器路径与测试程序文件(`test.py`)的路径显示在一起。退出代码 0 表示程序已经成功退出,没有错误。 -因此,那是一个现成的 IDE 环境,你可以导入 Cirq 库去开始使用 Python 去编程和模拟量子电路。 +因此,那是一个已经就绪的 IDE 环境,你可以导入 Cirq 库去开始使用 Python 去编程和模拟量子电路。 #### Cirq 使用入门 Criq 入门的一个好的开端就是它 GitHub 页面上的 [示例][21]。 -Cirq 的开发者在 GitHub 上已经放了学习 [教程][22]。如果你想认真地学习量子计算,他们推荐你去看一本非常好的书,它是[由 Nielsen 和 Chuang 写的名为 “量子计算和量子信息“][23]。 +Cirq 的开发者在 GitHub 上已经放置了学习 [教程][22]。如果你想认真地学习量子计算,他们推荐你去看一本非常好的书,它是[由 Nielsen 和 Chuang 写的名为 《量子计算和量子信息》][23]。 #### OpenFermion-Cirq -[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵代表的费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米— 狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。 +[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵代表的费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米—狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。 OpenFermion 被称为从事 [量子化学][29] 的化学家和研究人员的 [一个极好的实践工具][28]。量子化学主要专注于 [量子力学][30] 在物理模型和化学系统实验中的应用。量子化学也被称为 [分子量子力学][31]。 @@ -141,7 +140,7 @@ Cirq 的出现使 OpenFermion 通过提供程序和工具去扩展功能成为 #### Google Bristlecone -2018 年 3 月 5 日,在洛杉矶举行的一年一度的 [美国物理学会会议][33] 上,Google 发布了 [Bristlecone][32],这是他们的最新的量子处理器。这个 [基于门的超导系统][34] 为 Google 提供了一个测试平台,用以研究 [量子比特技术][37] 的 [系统错误率][35] 和 [扩展性][36] ,以及在量子 [仿真][38]、[优化][39]、和 [机器学习][40] 方面的应用。 +2018 年 3 月 5 日,在洛杉矶举行的一年一度的 [美国物理学会会议][33] 上,Google 发布了 [Bristlecone][32],这是他们的最新的量子处理器。这个 [基于门的超导系统][34] 为 Google 提供了一个测试平台,用以研究 [量子比特技术][37] 的 [系统错误率][35] 和 [扩展性][36] ,以及在量子 [仿真][38]、[优化][39] 和 [机器学习][40] 方面的应用。 Google 希望在不久的将来,能够制造出它的 [云可访问][41] 的 72 个量子比特的 Bristlecone 量子处理器。Bristlecone 将越来越有能力完成一个经典超级计算机无法在合理时间内完成的任务。 @@ -154,11 +153,9 @@ Cirq 将允许我们去: * 在设备上放置适当的门 * 并调度这个门的时刻 +### 开放科学关于 Cirq 的观点 - -### Open Science 关于 Cirq 的观点 - -我们知道 Cirq 是在 GitHub 上开源的,它除了在 Open Science 社区之外,特别是那些专注于量子研究的人们,都可以高效率地合作,通过开发新方法,去降低现有量子模型中的错误率和提升精确度,以解决目前在量子计算中所面临的挑战。 +我们知道 Cirq 是在 GitHub 上开源的,在开源科学社区之外,特别是那些专注于量子研究的人们,都可以通过高效率地合作,通过开发新方法,去降低现有量子模型中的错误率和提升精确度,以解决目前在量子计算中所面临的挑战。 如果 Cirq 不走开源模型的路线,事情可能变得更具挑战。一个伟大的创举可能就此错过,我们可能在量子计算领域止步不前。 @@ -170,7 +167,7 @@ Cirq 将允许我们去: 最后,我们看了两个示例 OpenFermion 和 Bristlecone,介绍了在量子计算中,Cirq 在开发研究中具有什么样的基本优势。最后我们以 Open Science 社区的视角对 Cirq 进行了一些精彩的思考,结束了我们的话题。 -我们希望能以一种易于理解的方式向你介绍量子计算框架 Cirq 的使用。如果你有与此相关的任何反馈,请在下面的评论区告诉我们。感谢阅读,希望我们能在 Open Science 的下一篇文章中再见。 +我们希望能以一种易于理解的方式向你介绍量子计算框架 Cirq 的使用。如果你有与此相关的任何反馈,请在下面的评论区告诉我们。感谢阅读,希望我们能在开放科学栏目的下一篇文章中再见。 -------------------------------------------------------------------------------- @@ -179,7 +176,7 @@ via: https://itsfoss.com/qunatum-computing-cirq-framework/ 作者:[Avimanyu Bandyopadhyay][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -188,7 +185,7 @@ via: https://itsfoss.com/qunatum-computing-cirq-framework/ [2]:https://en.wikipedia.org/wiki/Quantum [3]:https://www.clerro.com/guide/491/quantum-superposition-and-entanglement-explained [4]:https://physics.stackexchange.com/questions/148131/can-quantum-entanglement-and-quantum-superposition-be-considered-the-same-phenom -[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/bit-vs-qubit.jpg +[5]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/08/bit-vs-qubit.jpg?w=576&ssl=1 [6]:http://www.rfwireless-world.com/Terminology/Difference-between-Bit-and-Qubit.html [7]:https://en.wikipedia.org/wiki/Proof_by_exhaustion [8]:https://www.explainthatstuff.com/how-supercomputers-work.html @@ -199,11 +196,11 @@ via: https://itsfoss.com/qunatum-computing-cirq-framework/ [13]:https://itsfoss.com/python-setup-linux/ [14]:https://virtualenv.pypa.io [15]:https://cirq.readthedocs.io/en/latest/install.html#installing-on-linux -[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-framework-linux.jpeg +[16]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/08/cirq-framework-linux.jpeg [17]:https://pypi.org/project/pip/ -[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-test-output.jpg +[18]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/08/cirq-test-output.jpg [19]:https://itsfoss.com/install-pycharm-ubuntu/ -[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-tested-on-pycharm.jpg +[20]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/08/cirq-tested-on-pycharm.jpg [21]:https://github.com/quantumlib/Cirq/tree/master/examples [22]:https://github.com/quantumlib/Cirq/blob/master/docs/tutorial.md [23]:http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf From 8708ba3fc8c0d68f354c3c589d9d1b83eb5517e1 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Dec 2018 12:38:46 +0800 Subject: [PATCH 1028/1143] PUB:20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md @qhwdw https://linux.cn/article-10376-1.html --- ...uction to Quantum Computing with Open Source Cirq Framework.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md (100%) diff --git a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/published/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md similarity index 100% rename from translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md rename to published/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md From 4f808d9693a13f8b54a964f4663290b2c768c62c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Dec 2018 12:54:29 +0800 Subject: [PATCH 1029/1143] PRF:20181212 Aliases- DIY Shell Commands.md @HankChow --- .../20181212 Aliases- DIY Shell Commands.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/translated/tech/20181212 Aliases- DIY Shell Commands.md b/translated/tech/20181212 Aliases- DIY Shell Commands.md index d7d0c9d096..cbce2581af 100644 --- a/translated/tech/20181212 Aliases- DIY Shell Commands.md +++ b/translated/tech/20181212 Aliases- DIY Shell Commands.md @@ -1,9 +1,10 @@ 命令别名:定义自己的命令 ====== +> 学习如何创建别名:你可以将太长或难以记忆的命令打包成你自己构建的命令。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/jodi-mucha-540841-unsplash.jpg?itok=n1d1VDUV) -命令别名Alias在 Linux shell 中指的是将一些太长或者太难记的多个命令组合起来,成为一个由用户自定义构建的命令。 +命令别名Alias在 Linux shell 中指的是将一些太长或者太难记的多个命令组合起来,成为一个由用户自己构建的命令。 可以通过 `alias` 命令来创建命令别名。在 `alias` 后面跟上想要创建的别名名称、一个等号(`=`),以及希望使用这个别名来执行的命令,这样一个命令别名就创建好了。举个例子,`ls` 命令在默认情况下是不会对输出的内容进行着色的,这样就不能让用户一眼分辨出目录、文件和连接了。对此,可以创建这样一个命令别名,在输出目录内容的时候为输出内容着色: @@ -11,7 +12,7 @@ alias lc='ls --color=auto' ``` -其中 `lc` 是自定义的命令别名,代表“list with color”的意思。在创建命令别名的时候,需要先确认使用的别名是不是已经有对应的命令了,如果有的话,原本的命令就会被覆盖掉了。注意,定义命令别名的时候,`=` 两端是没有空格的。当运行 `lc` 的时候,就相当于执行了 `ls --color` 命令。 +其中 `lc` 是自定义的命令别名,代表 “list with color” 的意思。在创建命令别名的时候,需要先确认使用的别名是不是已经有对应的命令了,如果有的话,原本的命令就会被覆盖掉了。注意,定义命令别名的时候,`=` 两端是没有空格的。当运行 `lc` 的时候,就相当于执行了 `ls --color` 命令。 此后,执行 `lc` 列出目录内容的时候,就会输出带有着色的内容了。 @@ -25,9 +26,7 @@ alias lc='ls --color=auto' * `alias cp='cp -i'`:`-i` 参数代表“交互interactive”。在使用 `cp` 命令复制文件的时候,可能会无意中覆盖现有的文件,在使用了 `-i` 参数之后,`cp` 命令会在一些关键操作前向用户发出询问。 * `alias free='free -m'`:在 `free` 命令后面加上 `-m` 参数,就可以将输出的内存信息以 MiB 这个更方面阅读和计算的单位输出,而不是默认的 Byte 单位。 - - -你使用的发行版自带的命令别名可能多多少少和上面有些差别。但你都可以在命令前面加上 `\` 修饰符来使用命令的最基本形式。例如: +你使用的发行版自带的命令别名可能多多少少和上面有些差别。但你都可以在命令前面加上 `\` 修饰符来使用命令的最基本形式(而不是别名)。例如: ``` \free @@ -41,7 +40,7 @@ alias lc='ls --color=auto' 执行的就是不带有`--color=auto` 参数的 `ls`。 -如果想要持久地保存命令别名,可以在 `.bashrc` 文件中进行修改。 +如果想要持久地保存命令别名,可以在 `.bashrc` 文件中进行修改,而它[来源于我们的 /etc/skel 目录][1]。 ### 使用命令别名纠正错误 @@ -62,7 +61,7 @@ alias move='mv' 也可以在尚未完全熟悉 Linux 的时候用得顺手。 -还有一种情况,就是在经常出现输入错误的场合中做出容错,例如 Administration 这个单词就很难快速正确地输入,因此很多用户都会设置 +还有一种情况,就是在经常出现输入错误的场合中做出容错,例如,对于我来说, Administration 这个单词就很难快速正确地输入,因此很多用户都会设置类似这样的别名: ``` alias sl='ls' @@ -74,7 +73,7 @@ alias sl='ls' alias gerp='echo "You did it *again*!"; grep' ``` - `grep` 命令最基本的用途就是在文件中查找字符串,在熟悉这个命令之后,它一定是最常用的命令之一,因此输入错误导致不得不重输命令就很令人抓狂。 +`grep` 命令最基本的用途就是在文件中查找字符串,在熟悉这个命令之后,它一定是最常用的命令之一,因此输入错误导致不得不重输命令就很令人抓狂。 在上面 `gerp` 的例子中,包含的不只是一条命令,而是两条。第一条命令 `echo "You did it *again*!"` 输出了一条提醒用户拼写错误的消息,然后使用分号(`;`)把两条命令隔开,再往后才是 `grep` 这一条正确的命令。 @@ -82,16 +81,16 @@ alias gerp='echo "You did it *again*!"; grep' ``` $ gerp -R alias /etc/skel/.bashrc -You did it *again*! - alias ls='ls --color=auto' - alias grep='grep --colour=auto' - alias egrep='egrep --colour=auto' - alias fgrep='fgrep --colour=auto' +You did it *again*! + alias ls='ls --color=auto' + alias grep='grep --colour=auto' + alias egrep='egrep --colour=auto' + alias fgrep='fgrep --colour=auto' alias cp="cp -i" alias df='df -h' alias free='free -m' -alias np='nano -w PKGBUILD' -alias more=less +alias np='nano -w PKGBUILD' +alias more=less shopt -s expand_aliases ``` @@ -112,12 +111,12 @@ via: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands 作者:[Paul Brown][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.linux.com/users/bro66 [b]: https://github.com/lujun9972 -[1]: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts -[2]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise +[1]: https://linux.cn/article-10370-1.html +[2]: https://linux.cn/article-10374-1.html From cafad9ce13f9798efe68b08260e8eb40f4574de9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Dec 2018 12:54:52 +0800 Subject: [PATCH 1030/1143] PUB:20181212 Aliases- DIY Shell Commands.md @HankChow https://linux.cn/article-10377-1.html --- .../tech => published}/20181212 Aliases- DIY Shell Commands.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181212 Aliases- DIY Shell Commands.md (100%) diff --git a/translated/tech/20181212 Aliases- DIY Shell Commands.md b/published/20181212 Aliases- DIY Shell Commands.md similarity index 100% rename from translated/tech/20181212 Aliases- DIY Shell Commands.md rename to published/20181212 Aliases- DIY Shell Commands.md From 3882e486275897ba08622fb9c212fd6bd6508a4d Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Mon, 24 Dec 2018 13:33:18 +0800 Subject: [PATCH 1031/1143] Translating How to Update Ubuntu. --- ...untu -Terminal - GUI Methods- It-s FOSS.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md index 00864bffa9..85d88129e7 100644 --- a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md +++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md @@ -77,45 +77,45 @@ apt list --upgradable ### 通过 GUI 更新 Ubuntu[适用于桌面用户] -If you are using Ubuntu as a desktop, you don’t have to go to terminal just for updating the system. You can still use the command line but it’s optional for you. +如果你使用桌面版 Ubuntu,你并不需要为了更新系统而打开终端。你可以仍可以使用命令行更新,但这只是一个选择。 -In the menu, look for ‘Software Updater’ and run it. +在菜单力,找到 `Software Updater` 并运行它。 -![Run Software Updater in Ubuntu][8] +![在 Ubuntu 中运行 Software Updater][8] -It will check if there are updates available for your system. +它将检查你的系统是否有可用的更新。 -![Checking if updates are available for Ubuntu][9] +![检查 Ubuntu 是否有可用更新][9] -If there are updates available, it will give provide you with options to install the updates. +如果有可用的更新,它将给你提供安装更新的选择。 -![Install Updates via Update Manager in Ubuntu][10] +![在 Ubuntu 中通过更新管理器安装更新][10] -Click on Install Now, it may ask for your password. +现在,点击 `Install`,它可能会向你询问密码。 -![Installing Updates in Ubuntu Linux via GUI][11] +![通过 GUI 在 Ubuntu Linux 中安装更新][11] -Once you enter your password, it will start installing the updates. +一旦你输入你的密码,它将开始安装更新。 -![Updating Ubuntu via GUI][12] +![通过 GUI 更新 Ubuntu][12] -In some cases, you may need to reboot the system for the installed updates to work properly. You’ll be notified at the end of the update if you need to restart the system. +在某些情况下,你可能需要重启系统才能使已安装的更新正常工作。如果需要重启系统,你将在更新结束时收到通知。 -![Updating Ubuntu via GUI][12] +![通过 GUI 更新 Ubuntu][12] -You can choose to restart later if you don’t want to reboot your system straightaway. +如果你不希望马上重启你的系统,可以选择稍后重启。 -![Installing updates via GUI in Ubuntu][13] +![通过 GUI 在 Ubuntu 中安装更新][13] -Tip: If the software updater returns an error, you should use the command ‘sudo apt update’ in the terminal. The last few lines of the output will contain the actual error message. You can search on the internet for that error and fix the problem. +提示:如果 `software updater` 返回一个错误,你需要在终端是使用命令 `sudo apt update`。输出的最后几行将包含真正的错误信息。你可以在因特网上搜索该错误并解决问题。 ### 更新 Ubuntu 时要记住几件事 -You just learned how to update your Ubuntu system. If you are interested, you should also know these few things around Ubuntu updates. +你刚学习了如何更新你的 Ubuntu 系统。如果你感兴趣,你还需要了解一些关于 Ubuntu 更新的内容。 #### 更新后清理 -Your system will have some unnecessary packages that won’t be required after the updates. You can remove such packages and [free up some space][14] using this command: +你的系统将会有一些更新后不再需要的软件包。你可用使用这条命令删除这些软件包并[释放空间][14]: ``` sudo apt autoremove From 567491369fe42af7b7434d18e9d19a7d53573254 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Dec 2018 13:43:13 +0800 Subject: [PATCH 1032/1143] PRF:20181022 Improve login security with challenge-response authentication.md @hopefully2333 --- ... with challenge-response authentication.md | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/translated/tech/20181022 Improve login security with challenge-response authentication.md b/translated/tech/20181022 Improve login security with challenge-response authentication.md index 1d227c2839..7b360ab755 100644 --- a/translated/tech/20181022 Improve login security with challenge-response authentication.md +++ b/translated/tech/20181022 Improve login security with challenge-response authentication.md @@ -1,36 +1,34 @@ -通过询问-响应身份认证提高登陆安全 +通过询问-响应身份认证提高桌面登录安全 ====== ![](https://fedoramagazine.org/wp-content/uploads/2018/10/challenge-response-816x345.png) ### 介绍 -今天,Fedora 提供了多种方式来提高我们账户的身份认证的安全性。当然,它有我们熟悉的用户名密码登陆,它也同样提供了其他的身份认证选项,比如生物识别、指纹、智能卡、一次性密码,甚至是询问-响应身份认证。 +今天,Fedora 提供了多种方式来提高我们账户的身份认证的安全性。当然,它有我们熟悉的用户名密码登录方式,它也同样提供了其他的身份认证选项,比如生物识别、指纹、智能卡、一次性密码,甚至是询问-响应challenge-response身份认证。 每种认证方式都有明确的优缺点。这点本身就可以成为一篇相当冗长的文章的主题。Fedora 杂志之前就已经介绍过了这其中的一些选项: +- [在 Fedora 中使用 YubiKey4][1] +- [Fedora 28:在 OpenSSH 中更好的支持智能卡][2] -+ [Using the YubiKey4 with Fedora][1] -+ [Fedora 28: Better smart card support in OpenSSH][2] - - -在现在的 Fedora 版本中,最安全的方法之一就是离线硬件询问-响应。它也同样是最容易部署的方法之一。下面是具体方法: +在现在的 Fedora 版本中,最安全的方法之一就是离线硬件询问-响应。它也同样是最容易部署的方法之一。下面是具体方法。 ### 询问-响应认证 -从技术上来讲,当你输入密码的时候,你就正在响应用户名询问。离线的询问、响应包含了这些部分:首先是需要你的用户名,接下来,Fedora 会要你提供一个加密的物理硬件的令牌。令牌会将另一个通过可插入式身份认证模块(PAM)框架进行存储的加密密钥来响应询问。最后,Fedora 才会提示你输入密码。这可以防止其他人仅仅使用了找到的硬件令牌,或是只使用了账户名密码而没有正确的加密密钥。 +从技术上来讲,当你输入密码的时候,你就正在响应用户名询问。离线的询问、响应包含了这些部分:首先是需要你的用户名,接下来,Fedora 会要你提供一个加密的物理硬件的令牌。令牌会把另一个其存储的加密密钥通过可插入式身份认证Pluggable Authentication Module模块(PAM)框架来响应询问。最后,Fedora 才会提示你输入密码。这可以防止其他人仅仅使用了找到的硬件令牌,或是只使用了账户名密码而没有正确的加密密钥。 这意味着除了你的账户名密码之外,你必须事先在你的操作系统中注册了一个或多个加密硬件令牌。你必须保证你的物理硬件令牌能够匹配你的用户名。 -一些询问-响应的方法,比如一次性密码(OTP),在硬件令牌上获取加密代码密钥,然后将这个密钥通过网络传输到远程身份认证服务器。然后这个服务器会告诉 Fedora 的 PAM 框架,这是否是该用户的一个有效令牌。如果身份认证服务器在本地网络上,这个方法非常好。但它的缺点是如果网络连接断开或是你在没有网的远程端工作。你会被锁在系统之外,直到你能通过网络连接到身份认证服务器。 +一些询问-响应的方法,比如一次性密码(OTP),在硬件令牌上获取加密的代码密钥,然后将这个密钥通过网络传输到远程身份认证服务器。然后这个服务器会告诉 Fedora 的 PAM 框架,这是否是该用户的一个有效令牌。如果身份认证服务器在本地网络上,这个方法非常好。但它的缺点是如果网络连接断开或是你在没有网的远程端工作。你会被锁在系统之外,直到你能通过网络连接到身份认证服务器。 -有时候,生产环境会需要通过 Yubikey 使用一次性密码(OTP)设置,然而,在家庭或个人的系统上,你可能更喜欢询问-响应设置。一切都是本地的,这种方法不需要通过远程网络呼叫。下面这些过程适用于 Fedora 27、28和29. +有时候,生产环境会采用通过 Yubikey 使用一次性密码(OTP)的设置,然而,在家庭或个人的系统上,你可能更喜欢询问-响应设置。一切都是本地的,这种方法不需要通过远程网络调用。下面这些过程适用于 Fedora 27、28 和 29. ### 准备 #### 硬件令牌密钥 -首先,你需要一个安全的硬件令牌密钥。具体来说,这个过程需要一个 Yubikey 4,Yubikey NEO,或者是最近发布的、同样支持 FIDO2 的 Yubikey 5 系列设备。你应该购买它们中的两个来有一个备份,以避免其中一个丢失或遭到损坏。你可以在不同的工作地点使用这些密钥。较为简单的 FIDO 和 FIDO U2F 版本不适用与这个过程,但是非常适合使用 FIDO 的在线服务。 +首先,你需要一个安全的硬件令牌密钥。具体来说,这个过程需要一个 Yubikey 4、Yubikey NEO,或者是最近发布的、同样支持 FIDO2 的 Yubikey 5 系列设备。你应该购买它们中的两个,一个做备份,以避免其中一个丢失或遭到损坏。你可以在不同的工作地点使用这些密钥。较为简单的 FIDO 和 FIDO U2F 版本不适用于这个过程,但是非常适合使用 FIDO 的在线服务。 #### 备份、备份,以及备份 @@ -38,19 +36,18 @@ #### 升级,然后安装 -现在,确定你的 Fedora 是最新的,然后通过 dnf 命令安装所需要的 Fedora Yubikey 包。 +现在,确定你的 Fedora 是最新的,然后通过 `dnf` 命令安装所需要的 Fedora Yubikey 包。 ``` $ sudo dnf upgrade $ sudo dnf install ykclient* ykpers* pam_yubico* -$ cd ``` -如果你使用的是 VM 环境,例如 Virtual Box,确保 Yubikey 设备已经插进了 USB 口,然后允许 VM 控制的 USB 访问 Yubikey。 +如果你使用的是 VM 环境,例如 Virtual Box,确保 Yubikey 设备已经插进了 USB 口,然后允许 VM 控制的 USB 访问 Yubikey。 ### 配置 Yubikey -通过 USB Yubikey 验证你的账户: +确认你的账户访问到了 USB Yubikey: ``` $ ykinfo -v @@ -63,21 +60,21 @@ version: 3.5.0 Yubikey core error: no yubikey present ``` -接下来,通过下面这些 ykpersonalize 命令初始化你每个新的 Yubikeys。使用 HMAC-SHA1 算法进行询问响应,以此来设置 Yubikey 配置插槽 2。即使少于 64 个字符,如果你已经为询问响应设置好了你的 Yubikey。你就不需要再运行 ykpersonalize 了。 +接下来,通过下面这些 `ykpersonalize` 命令初始化你每个新的 Yubikey。这将设置 Yubikey 配置插槽 2 使用 HMAC-SHA1 算法(即使少于 64 个字符)进行询问响应。如果你已经为询问响应设置好了你的 Yubikey。你就不需要再次运行 `ykpersonalize` 了。 ``` ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -oserial-api-visible ``` -一些用户在使用的时候将 YubiKey 留在了工作环境里,甚至对虚拟机使用了询问响应。然而,为了更好的安全性,你可能会更愿意使用手动触发 YubiKey 来响应询问。 +一些用户在使用的时候将 YubiKey 留在了他们的工作站上,甚至用于对虚拟机进行询问-响应。然而,为了更好的安全性,你可能会更愿意使用手动触发 YubiKey 来响应询问。 -要添加手动询问按钮触发器,请添加 -ochal-btn-trig 标记,这个标记可以在请求中使得 Yubikey 闪烁 Yubikey LED。等待你在 15 秒内按下硬件密钥区域上的按钮来生成响应密钥。 +要添加手动询问按钮触发器,请添加 `-ochal-btn-trig` 选项,这个选项可以使得 Yubikey 在请求中闪烁其 LED。等待你在 15 秒内按下硬件密钥区域上的按钮来生成响应密钥。 ``` $ ykpersonalize -2 -ochal-resp -ochal-hmac -ohmac-lt64 -ochal-btn-trig -oserial-api-visible ``` -为你的每个新的硬件密钥执行此操作。每个密钥执行以此,使用下面的命令将 Yubikey 配置存储到 ~/.yubico: +为你的每个新的硬件密钥执行此操作。每个密钥执行一次。完成编程之后,使用下面的命令将 Yubikey 配置存储到 `~/.yubico`: ``` $ ykpamcfg -2 -v @@ -88,17 +85,17 @@ Sending 63 bytes HMAC challenge to slot 2 Stored initial challenge and expected response in '/home/chuckfinley/.yubico/challenge-9992567'. ``` -如果你要设置多个密钥用于备份。请将所有的密钥设置为相同,然后使用 ykpamcfg utility 存储每个密钥的询问-响应。如果你在一个已经存在的注册密钥上运行 ykpersonalize 命令,你就必须再次存储配置信息。 +如果你要设置多个密钥用于备份,请将所有的密钥设置为相同,然后使用 `ykpamcfg` 工具存储每个密钥的询问-响应。如果你在一个已经存在的注册密钥上运行 `ykpersonalize` 命令,你就必须再次存储配置信息。 ### 配置 /etc/pam.d/sudo -现在要去验证配置是否有效,在相同的终端窗口中,你需要设置 sudo 来要求使用 Yubikey 的询问-响应。将下面这几行插入到 /etc/pam.d/sudo 文件中。 +现在要去验证配置是否有效,**在同一个终端窗口中**,你需要设置 `sudo` 来要求使用 Yubikey 的询问-响应。将下面这几行插入到 `/etc/pam.d/sudo` 文件中。 ``` auth required pam_yubico.so mode=challenge-response ``` -将上面的 auth 行插入到 auth 文件中的 system-auth 行的上面,然后保存并退出编辑器。在默认的 Fedora 29 设置中,/etc/pam.d/sudo 应该像下面这样: +将上面的 `auth` 行插入到文件中的 `auth include system-auth` 行的上面,然后保存并退出编辑器。在默认的 Fedora 29 设置中,`/etc/pam.d/sudo` 应该像下面这样: ``` #%PAM-1.0 @@ -111,24 +108,25 @@ session required pam_limits.so session include system-auth ``` -保持原始终端窗口打开,然后打开一个新的终端窗口进行测试,在新的终端窗口中输入: +**保持这个初始的终端窗口打开**,然后打开一个新的终端窗口进行测试,在新的终端窗口中输入: ``` $ sudo echo testing ``` -你应该注意到了 key 上的 LED 在闪烁。点击 Yubikey 按钮,你应该会看见一个输入 sudo 密码的提示。在你输入你的密码之后,你应该会在终端屏幕上看见 ”testing“ 的字样。 +你应该注意到了 Yubikey 上的 LED 在闪烁。点击 Yubikey 按钮,你应该会看见一个输入 `sudo` 密码的提示。在你输入你的密码之后,你应该会在终端屏幕上看见 “testing” 的字样。 -现在去测试确保正常的失败,启动另一个终端窗口,并从 USB 插口中拔掉 Yubikey。使用下面这条命令验证,在没有 Yubikey 的情况下,sudo 是否会不再正常工作。 +现在去测试确保失败也正常,启动另一个终端窗口,并从 USB 插口中拔掉 Yubikey。使用下面这条命令验证,在没有 Yubikey 的情况下,`sudo` 是否会不再正常工作。 ``` $ sudo echo testing fail ``` -你应该立刻被提示输入 sudo 密码,即使你输入了正确密码,登陆也应该失败。 -### 设置 Gnome 桌面管理 +你应该立刻被提示输入 `sudo` 密码,但即使你输入了正确密码,登录也应该失败。 -一旦你的测试完成后,你就可以为图形登陆添加询问-响应支持了。将你的 Yubikey 再次插入进 USB 插口中。然后将下面这几行添加到 /etc/pam.d/gdm-password 文件中: +### 设置 Gnome 桌面管理器(GDM) + +一旦你的测试完成后,你就可以为图形登录添加询问-响应支持了。将你的 Yubikey 再次插入进 USB 插口中。然后将下面这几行添加到 `/etc/pam.d/gdm-password` 文件中: ``` auth required pam_yubico.so mode=challenge-response @@ -140,9 +138,9 @@ auth required pam_yubico.so mode=challenge-response $ sudo vi /etc/pam.d/gdm-password ``` -你应该看到 yubikey 上的 LED 在闪烁,按下 yubikey 按钮,然后在提示符出输入密码。 +你应该看到 Yubikey 上的 LED 在闪烁,按下 Yubikey 按钮,然后在提示符处输入密码。 -修改 /etc/pam.d/gdm-password 文件,在已有的 password-auth 上添加新的 auth 行。这个文件的顶部应该像下面这样: +修改 `/etc/pam.d/gdm-password` 文件,在已有的 `auth substack password-auth` 行上添加新的行。这个文件的顶部应该像下面这样: ``` auth [success=done ignore=ignore default=bad] pam_selinux_permit.so @@ -154,15 +152,15 @@ auth include postlogin account required pam_nologin.so ``` -保存更改并退出编辑器,如果你使用的是 vi,输入键是按 Esc 键,然后在提示符出输入 wq! 来保存并退出。 +保存更改并退出编辑器,如果你使用的是 vi,输入键是按 `Esc` 键,然后在提示符处输入 `wq!` 来保存并退出。 ### 结论 -现在注销 GNOME。将 Yubikey 插入到 USB 口,在图形登陆界面上点击你的用户名。Yubikey LED 会开始闪烁。触摸那个按钮,你会被提示输入你的密码。 +现在注销 GNOME。将 Yubikey 插入到 USB 口,在图形登录界面上点击你的用户名。Yubikey LED 会开始闪烁。触摸那个按钮,你会被提示输入你的密码。 -如果你丢失了 Yubikey,除了重置密码之外,你还可以使用备份的 Yubikey。你还可以给你的账户增加额外的 Yubikey 配置。 +如果你丢失了 Yubikey,除了重置密码之外,你还可以使用备份的 Yubikey。你还可以给你的账户增加额外的 Yubikey 配置。 -如果有其他人获得了你的密码,他们在没有你的物理硬件 Yubikey 的情况下,仍然不能登陆。恭喜!你已经显著提高了你的工作环境登陆的安全性了。 +如果有其他人获得了你的密码,他们在没有你的物理硬件 Yubikey 的情况下,仍然不能登录。恭喜!你已经显著提高了你的工作环境登录的安全性了。 -------------------------------------------------------------------------------- @@ -171,7 +169,7 @@ via: https://fedoramagazine.org/login-challenge-response-authentication/ 作者:[nabooengineer][a] 选题:[lujun9972][b] 译者:[hopefully2333](https://github.com/hopefully2333) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e0856a2eb56d29dbcfb0d410e229a6f46764f8a2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Dec 2018 13:43:35 +0800 Subject: [PATCH 1033/1143] PUB:20181022 Improve login security with challenge-response authentication.md @hopefully2333 https://linux.cn/article-10378-1.html --- ...prove login security with challenge-response authentication.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181022 Improve login security with challenge-response authentication.md (100%) diff --git a/translated/tech/20181022 Improve login security with challenge-response authentication.md b/published/20181022 Improve login security with challenge-response authentication.md similarity index 100% rename from translated/tech/20181022 Improve login security with challenge-response authentication.md rename to published/20181022 Improve login security with challenge-response authentication.md From bd6dbed6ea649bc2509275249cd441e0ab01a8f1 Mon Sep 17 00:00:00 2001 From: Ryze-Borgia <42087725+Ryze-Borgia@users.noreply.github.com> Date: Mon, 24 Dec 2018 15:38:39 +0800 Subject: [PATCH 1034/1143] Update and rename sources/talk/20180128 Getting Linux Jobs.md to translated/talk/20180128 Getting Linux Jobs.md --- sources/talk/20180128 Getting Linux Jobs.md | 99 ------------------- .../talk/20180128 Getting Linux Jobs.md | 94 ++++++++++++++++++ 2 files changed, 94 insertions(+), 99 deletions(-) delete mode 100644 sources/talk/20180128 Getting Linux Jobs.md create mode 100644 translated/talk/20180128 Getting Linux Jobs.md diff --git a/sources/talk/20180128 Getting Linux Jobs.md b/sources/talk/20180128 Getting Linux Jobs.md deleted file mode 100644 index 4cb79e9834..0000000000 --- a/sources/talk/20180128 Getting Linux Jobs.md +++ /dev/null @@ -1,99 +0,0 @@ -translating by ryze-borgia -Getting Linux Jobs -====== - -In a qualitative review of job posting websites, even highly skilled Linux administrators would be hamstrung to succeed in getting to the stage of an interview. - -All of this results in hundreds of decent and skilled people being snubbed without cause simply because today's job market requires a few extra tools to increase the odds. - -I have two colleagues and a cousin who have all received certifications with RedHat, managed quite extensive server rooms, and received earnest recommendations from former employers. - -All of these skills, certifications and experience come to naught as they apply to employer ads that are crudely constructed by someone hurriedly cutting and pasting snippets of "skill words" from a list of technical terms. - -Not surprisingly, today's politeness has gone the way of the bird, and a **non-response** from companies posting ads seems to be the new way of communicating. - -Unfortunately, it also means that these recruiters/HR personnel probably did **not** get the best candidate. - -The reason I can say this with such conviction is because of the type of buffoonery that takes place so often when creating job ads in the first place. - -Walter, another [Reallylinux.com][3] guest writer, presented how [**Job Want Ads Have Gone Mad**][4]. - -Perhaps he's right. However, I believe every Linux job seeker can avoid pitfalls of a job hunt by keeping in mind **three key facts** about job ads. - -First, few advertisements for Linux administrators are exclusively about Linux. - -Bear in mind the occasional Linux system administrator job, where you would actually be using Linux on servers. Instead, many jobs that rise up on a "Linux administrator" search are actually referring to a plethora of 'NX operating systems. - -For example, here is a quote from a **"Linux Administrator"** job posting: -This role will provide support for build system integration, especially operating system installation support for BSD applications... - -Or another ad declares in the bowels of its content: -Windows administration experience required. - -Ironically, if you show up to interview for any of these types of jobs and focus on Linux, they probably will not choose you. - -Even more importantly, if you simply include Linux as your expertise, they may not even bother with your resume, because they can't tell the difference between UNIX, BSD, Linux, etc. - -As a result, if you are conscientious and only include Linux on your resume, you are automatically out. But change that Linux to UNIX/Linux and you end up getting a bit farther in the human resources bureaucracy. - -I had two colleagues that ended up changing this on their resumes and getting a much better hit ratio for interviews, which were still slim pickings because most job ads are tailored with some particular person already in mind. The main intent behind such job ads being a cover for the ass of the department making the claim of having an open job. - -Second, the only person at the company who cares at all about the system administrator position is the technical lead/manager hiring for the slot. Others at the company, including the HR contact or the management could not care less. - -I remember sitting in a board room as a fly on the wall, hearing one executive vice president refer to server administrators as "dime a dozen geeks." How wrong they are to suggest this. - -Ironically, one day should the mail system fail, or the PBX connectivity hiccup, or perhaps core business files disappear from the intranet, these same executives are the first to get on the phone and threaten to fire the system admins. - -Perhaps if they would stop leaving so many hot air telephone messages, or filling their emails with 35MB photographs of another vice president's fishing trip and wife, the servers wouldn't be so problematic. - -Be aware that a Linux administrator ad, or any job posting for server administrator is placed because someone at the TECHNICAL level sees an urgent need for staffing. You're not going to get any empathy talking to HR or any leader of the company. Instead, take the time to find out who the hiring technical manager is and try to telephone them. - -You can always call them directly because you have some "specific technical questions" you know the HR person could not answer. This opens the dialogue with the person who actually cares that the position is filled and ensures you get a foot in because you took the time for personal contact, even if it was a 60 second phone call. - -What if the HR beauracracy won't let you through? - -Start asking as many tech questions as possible direct to the HR hiring contact, such as how their Linux clusters are setup and do they run VMs exclusively? Anything relatively technical will send these HR people in a tizzy and allow you the question: "may I contact the technical manager of the team?" - -If the response is a fluffy "maybe" or "I'll get back to you on that" they already filled the slot in their mind with someone else two weeks earlier, such as the HR staff member's fiance. They simply wanted it to look less like nepotism and more like indeterminism with a dash of egoism. - -``` -"They simply wanted it to look less like nepotism and more like indeterminism with a dash of egoism." -``` - -So take the time to find out who is the direct TECHNICAL leader hiring for the position and talk to them. It can make a difference and get you past some of the baloney. - -Third, few job ads today include any semblance of reality. - -I've seen enough ads requiring a junior system administrator with expertise that senior level experts don't have, to know the plan is to list the blue sky wish list and then find out who applies. - -In this situation, the Linux administrator ad you apply for, should include some key phrases for which you already have experience or certifications. - -The trick is to so overload your resume with the key phrases that MATCH their ad, it becomes almost impossible for them to determine which phrases you left out. - -This doesn't necessarily translate to a job, but it often adds enough intrigue to get you an interview, which now a days is a major step. - -By understanding and applying these three techniques, hopefully those seeking Linux administrator jobs have a head start on those who have only a slim chance in hell. - -Even if these tips don't get you interviews right away, you can use the experience and awareness when you go to the next trade show, or company sponsored technical conference. - -I strongly recommend you regularly attend these as well, especially if they are reasonably close, as they always provide a kick start to networking. - -Remember that job networking now a days is a pseudonym for "getting the gossip on which companies are actually hiring and which ones are just lying about jobs to give the appearance of growth for shareholders." - - - --------------------------------------------------------------------------------- - -via: http://reallylinux.com/docs/gettinglinuxjobs.shtml - -作者:[Andrea W.Codingly][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://reallylinux.com -[1]:http://www.reallylinux.com -[2]:http://reallylinux.com/docs/linuxrecessionproof.shtml -[3]:http://reallylinux.com -[4]:http://reallylinux.com/docs/wantadsmad.shtml diff --git a/translated/talk/20180128 Getting Linux Jobs.md b/translated/talk/20180128 Getting Linux Jobs.md new file mode 100644 index 0000000000..1f7b5791af --- /dev/null +++ b/translated/talk/20180128 Getting Linux Jobs.md @@ -0,0 +1,94 @@ +Linux 求职建议 +====== + +通过对招聘网站数据的仔细研究,我们发现,即使是非常有经验的 Linux 程序员,也很难在面试中表现的很出色。 + +这就导致了很多优秀并且有经验的人找不到合适的工作,所以我们可能需要一些手段来提高自己的竞争力。 + +我有两个同事和一个表哥,他们都有 RedHat 认证,管理过比较大的服务器机房,也都收到过老员工的推荐。 + +可是,在他们应聘的时候,所有的这些证书、本身的能力、工作经验好像都没有起到任何作用,他们面对的是一些 +从术语列表中临时挑选的一些技术词汇片段所组成的问题。 + +现如今,礼貌变得过时了,**不回应**变成了公司招人时最好的沟通方式。 + +这同样也意味着大多公司的招聘或者人事可能会**错过**非常优秀的应聘者。 + +我之所以敢说的如此肯定,是因为现在招聘广告大多数看上去都非常的滑稽。 + +Walter ,[Reallylinux.com][3] 另一位特约撰稿人,发表过一篇关于 [招聘广告疯掉了][4] 的文章。 + +他说的没错,可是我认为 Linux 工作应聘者可以通过注意招聘广告的**三个关键词**避免落入陷阱。 + +首先,很少会有 Linux 领域的招聘广告只对 Linux 有要求 。 + +一定要注意 Linux 相关工作的工作场合,公司很有可能会要求你在服务器上跑 Linux ,另外,通过 “Linux” 搜索得到的结果有很多实际上是会涉及到 NX (数字化产品开发系统)的。 + +举个例子,现在有一则关于 **Linux 管理员招聘** 的招聘广告: +参与建立系统集成,尤其是 BSD 应用的系统安装... + +或者有一些其他的要求: +有 Windows 系统管理经验的 + +最为讽刺的是,如果你在应聘面试的时候表现出精通 Linux 的话,你可能不会被聘用。 + +另外,如果你直接把 Linux 写在你的特长或者专业上,他们可能都不会仔细看你的简历,因为他们根本区分不了 UNIX, BSD, Linux。 + +最终的结果就是,如果你只在简历上写了 Linux ,你可能会被直接掉,但是如果你改成 UNIX/Linux 的话,可能会走得更远。 + +我有两个同事最后修改了他们的简历,然后获得了更好的面试机会,但是依旧没有被聘用,因为大多数招聘广告其实已经内定人员了,这些招聘信息被放出来仅仅是为了表现出他们有招聘的想法。 + +第二点,公司里真正需要了解系统管理的只有特聘的科技主管,其他人包括人事或管理层根本不关心这个。 + +我记得有一次开会的时候,听见一个执行副总裁把服务器管理人员说成“一毛钱一打的人”,这种想法是多么的奇怪啊。 + +讽刺的是,等到邮件系统出故障,交换机连接时不时会断开,或者核心商业文件从企业内网中消失的时候,这些总裁又是最先打电话给系统管理员的。 + +或许如果他们不整天说些空话,或者不往邮件里塞满妻子的照片和旅行途中的照片的话,服务器可能就不会崩溃。 + +在找工作的时候一定要关注招聘 Linux 运维或者服务器管理人员的广告,因为这种一般都是在公司技术层有迫切的需求的时候才会有的。你也不需要和人事或者公司高层聊什么,搞清楚谁要招聘然后打电话给他们。 + +你需要直接联系他们因为有些技术问题人事是解决不了的,即使你只有 60 秒的时间可以和他们交流,你也必须抓住这个机会和真正有需求并且懂技术的人沟通。 + +那如果人事不让你进怎么办呢? + +记得问人事一些技术性问题,比如说他们的 Linux 群组是如何建立的,能不能独立运行虚拟机。这些技术性的问题会让人事变得不耐烦,最后让你有机会问出“我能不能直接联系你们团队的技术人员”。 + +如果对方的回答是“应该可以”或者“稍后回复你”,那么他们可能已经在两周前就已经计划好了找一个人来填补这个空缺,比如说人事部员工的未婚夫。他们只是不希望看起来太像裙带主义,而是带有一点利己主义的不确定主义。 + +所以一定要记得花点时间弄清楚到底谁是发布招聘广告的直接技术负责人然后和他们聊一聊,这可能会让你少一番胡扯并且让你更有可能应聘成功。 + +第三点,现在的广告很少有完全真实的内容了。 + +我以前见过一个招聘具有高级专家所不具备的专门知识的初级系统管理员的广告,计划是列出公司的发展计划蓝图,然后找到应聘者。 + +在这种情况下,你应聘 Linux 管理员职位应该提供几个关键性信息,例如工作经验和相关证书。 + +诀窍在于,在你的简历中给出与他们的招聘信息相匹配的关键词,这样他们就基本找不到你存在的问题。 + +这并不一定会让你成功找到一份工作,但它可以让你获得一次面试机会,这也算是一个巨大的进步。 + +通过理解和应用以上三点,或许可以让那些寻求 Linux 管理员工作的人能够比那些在地狱中只有一线希望的人有一个好的开始。 + +即使这些建议不能让你马上得到面试机会,你也可以利用这些经验和意识去参加贸易展或公司主办的技术会议等活动。 + +我强烈建议你们也经常参加这种活动,尤其是当它们时间比较接近的时候,可以给你一个扩展人脉的机会。 + +请记住,如今的“求职网日”已经失去了原来的意义了,现在只是可以用来获取“哪些公司实际上在招聘、哪些公司只是为了给股东带来增长的表象而在工作方面撒谎”的小道消息。 + + +-------------------------------------------------------------------------------- + +via: http://reallylinux.com/docs/gettinglinuxjobs.shtml + +作者:[Andrea W.Codingly][a] +译者:[Ryze-Borgia](https://github.com/Ryze-Borgia) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://reallylinux.com +[1]:http://www.reallylinux.com +[2]:http://reallylinux.com/docs/linuxrecessionproof.shtml +[3]:http://reallylinux.com +[4]:http://reallylinux.com/docs/wantadsmad.shtml From 128cf37c5433db41731ee4c9fec303cde41282de Mon Sep 17 00:00:00 2001 From: WangYue <815420852@qq.com> Date: Mon, 24 Dec 2018 17:07:37 +0800 Subject: [PATCH 1035/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成删除原文 20180826 How to Install and Use FreeDOS on VirtualBox.md --- ...o Install and Use FreeDOS on VirtualBox.md | 156 ------------------ 1 file changed, 156 deletions(-) delete mode 100644 sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md diff --git a/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md b/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md deleted file mode 100644 index f6d36e718b..0000000000 --- a/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md +++ /dev/null @@ -1,156 +0,0 @@ -WangYueScream Tanslating ---------------- -How to Install and Use FreeDOS on VirtualBox -====== -This step-by-step guide shows you how to install FreeDOS on VirtualBox in Linux. - -### Installing FreeDOS on VirtualBox in Linux - - - -In November of 2017, I [interviewed Jim Hall][1] about the history behind the [FreeDOS project][2]. Today, I’m going to tell you how to install and use FreeDOS. Please note: I will be using [VirtualBox][3] 5.2.14 on [Solus][4]. - -Note: I used Solus as the host operating system for this tutorial because it is very easy to setup. One thing you should keep in mind is that Solus’ Software Center contains two versions of VirtualBox: `virtualbox` and `virtualbox-current`. Solus gives you the option to use the linux-lts kernel and the linux-current kernel. `virtualbox`is modified for linux-lts and `virtualbox-current` is for linux-current. - -#### Step 1 – Create New Virtual Machine - -![][5] - -Once you open VirtualBox, press the “New” button to create a new virtual machine. You can name it whatever you want, I just use “FreeDOS”. You can use the label to specify what version of FreeDOS you are installing. You also need to select the type and version of the operating system you will be installing. Select “Other” and “DOS”. - -#### Step 2 – Select Memory Size - -![][6] - -The next dialog box will ask you how much of the host computer’s memory you want to make available to FreeDOS. The default is 32MB. Don’t change it. Back in the day, this would be a huge amount of RAM for a DOS machine. If you need to, you can increase it later by right-clicking on the virtual machine you created for FreeDOS and selecting Settings -> System. - -![][7] - -#### Step 3 – Create Virtual Hard Disk - -![][8] - -Next, you will be asked to create a virtual hard drive where FreeDOS and its files will be stored. Since you haven’t created one yet, just click “Create”. - -The next dialog box will ask you what hard disk file type you want to use. This default (VirtualBox Disk Image) works just fine. Click “Next”. - -The next question you will encounter is how you want the virtual disk to act. Do you want it to start small and gradually grow to its full size as you create files and install programs? Then choose dynamically allocated. If you prefer that the virtual hard drive (vhd) is created at full size, then choose fixed size. Dynamically allocated is nice if you don’t plan to use the whole vhd or if you don’t have very much free space on your hard drive. (Keep in mind that while the size of a dynamically allocated vhd increases as you add files, it will not drop when you remove files.) I prefer dynamically allocated, but you can choose the option that serves your needs best and click “Next”. - -![][9] - -Now, you can choose the size and location of the vhd. 500 MB should be plenty of space. Remember most of the programs you will be using will be text-based, thus fairly small. Once you make your adjustments, click Create, - -#### Step 4 – Attach .iso file - -Before we continue, you will need to [download][10] the FreeDOS .iso file. You will need to choose the CDROM “standard” installer. - -![][11] - -Once the file has been downloaded, return to VirtualBox. Select your virtual machine and open the settings. You can do this by either right-clicking on the virtual machine and selecting “Settings” or highlight the virtual machine and click the “Settings” button. - -Now, click the “Storage” tab. Under “Storage Devices”, select the CD icon. (It should say “Empty” next to it.) In the “Attributes” panel on the right, click on the CD icon and select the location of the .iso file you just downloaded. - -Note: Typically, after you install an operating system on VirtualBox you can delete the original .iso file. Not with FreeDOS. You need the .iso file if you want to install applications via the FreeDOS package manager. I generally keep the ,iso file attached the virtual machine in case I want to install something. If you do that, you have to make sure that you tell FreeDOS you want to boot from the hard drive each time you boot it up because it defaults to the attached CD/iso. If you forget to attach the .iso, don’t worry. You can do so by selecting “Devices” on the top of your FreeDOS virtual machine window. The .iso files are listed under “Optical Drives”. - -#### Step 5 – Install FreeDOS - -![][12] - -Now that we’ve completed all of the preparations, let’s install FreeDOS. - -First, you need to be aware of a bug in the most recent version of VirtualBox. If you start the virtual machine that we just created and select “Install to harddisk” when the FreeDOS welcome screen appears, you will see an unending, scrolling mass of machine code. I’ve only run into this issue recently and it affects both the Linux and Windows versions of VirtualBox. (I know first hand.) - -To get around this, you need to make a simple edit. When you see the FreeDOS welcome screen, press Tab. (Make sure that the “Install to harddrive” option is selected.) Type the word `raw` after “fdboot.img” and hit Enter. The FreeDOS installer will then start. - -![][13] - -The first part of the installer will handle formatting your virtual drive. Once formatting is completed, the installer will reboot. When the FreeDOS welcome screen appears again, you will have to re-enter the `raw` comment you used earlier. - -Make sure that you select “Yes” on all of the questions in the installer. One important question that doesn’t have a “Yes” or “No” answer is: “What FreeDOS packages do you want to install?. The two options are “Base packages” or “Full installation”. Base packages are for those who want a DOS experience most like the original MS-DOS. The Full installation includes a bunch of tools and utilities to improve DOS. - -At the end of the installation, you will be given the option to reboot or stay on DOS. Select “reboot”. - -#### Step 6 – Setup Networking - -Unlike the original DOS, FreeDOS can access the internet. You can install new packages and update the ones already you have installed. In order to use networking, you need to install several applications in FreeDOS. - -![][14] - -First, boot into your newly created FreeDOS virtual machine. At the FreeDOS selection screen, select “Boot from System harddrive”. - -![][15] - -Now, to access the FreeDOS package manager, type `fdimples`. You can navigate around the package manager with the arrow keys and select categories or packages with the space bar. From the “Networking” category, you need to select `fdnet`. The FreeDOS Project also recommends installing `mtcp` and `wget`. Hit “Tab” several times until “OK” is selected and press “Enter”. Once the installation is complete, type `reboot` and hit enter. After the system reboots, boot to your system drive. If the network installation was successful, you will see several new messages at the terminal listing your network information. - -![][16] - -##### Note - -Sometimes the default VirtualBox setup doesn’t work. If that happens, close your FreeDOS VirtualBox window. Right-click your virtual machine from the main VirtualBox screen and select “Settings”. The default VirtualBox network setting is “NAT”. Change it to “Bridged Adapter” and retry installing the FreeDOS packages. It should work now. - -#### Step 7 – Basic Usage of FreeDOS - -##### Commons Commands - -Now that you have installed FreeDOS, let’s look at a few basic commands. If you have ever used the Command Prompt on Windows, you will be familiar with some of these commands. - - * `DIR`– display the contents of the current directory - * `CD` – change the directory you are currently in - * `COPY OLD.TXT NEW.TXT`– copy files - * `TYPE TEST.TXT` – display content of file - * `DEL TEST.TXT` – delete file - * `XCOPY DIR NEWDIR` – copy directory and all of its contents - * `EDIT TEST.TXT`– edit a file - * `MKDIR NEWDIR` – create a new directory - * `CLS` – clear the screen - - - -You can find more basic DOS commands on the web or the [handy cheat sheet][17] created by Jim Hall. - -##### Running a Program - -Running program on FreeDos is fairly easy. When you install an application with the `fdimples` package manager, be sure to note where the .EXE file of the application is located. This is shown in the application’s details. To run the application, you generally need to navigate to the application folder and type the application’s name. - -For example, FreeDOS has an editor named `FED` that you can install. After installing it, all you need to do is navigate to `C:\FED` and type `FED`. - -Sometimes a program, such as Pico, is stored in the `\bin` folder. These programs can be called up from any folder. - -Games usually have an .EXE program or two that you have to run before you can play the game. These setup file usually fix sound, video, or control issues. - -If you run into problems that this tutorial didn’t cover, don’t forget to visit the [home of FreeDOS][2]. They have a wiki and several other support options. - -Have you ever used FreeDOS? What tutorials would you like to see in the future? Please let us know in the comments below. - -If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][18]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-freedos/ - -作者:[John Paul][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[1]:https://itsfoss.com/interview-freedos-jim-hall/ -[2]:http://www.freedos.org/ -[3]:https://www.virtualbox.org/ -[4]:https://solus-project.com/home/ -[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-1.jpg -[6]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-2.jpg -[7]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-3.jpg -[8]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-4.jpg -[9]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-6.jpg -[10]:http://www.freedos.org/download/ -[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-7.jpg -[12]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-8.png -[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-9.png -[14]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-10.png -[15]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-11.png -[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/freedos-tutorial-12.png -[17]:https://opensource.com/article/18/6/freedos-commands-cheat-sheet -[18]:http://reddit.com/r/linuxusersgroup From 8b3c24fd40630f9140b48981cd0897ddefdb6c20 Mon Sep 17 00:00:00 2001 From: WangYue <815420852@qq.com> Date: Mon, 24 Dec 2018 17:08:51 +0800 Subject: [PATCH 1036/1143] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 20180826 How to Install and Use FreeDOS on VirtualBox.md 翻译完成添加译文 --- ...o Install and Use FreeDOS on VirtualBox.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md diff --git a/translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md b/translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md new file mode 100644 index 0000000000..e8b0d30183 --- /dev/null +++ b/translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md @@ -0,0 +1,157 @@ + +如何在 VirtualBox 上安装并使用 FreeDOS? +====== +这份指南将带你如何一步一步在 Linux 平台下利用 VirtualBox 安装 FreeDOS。 + +### Linux 下借助 VirtualBox 安装 FreeDOS + + + +2017 年的 11 月份,我[采访了 Jim Hall][1] 关于 [FreeDOS project][2] 背后的历史故事。今天,我将告诉你如何安装并使用 FreeDOS。需要注意到是:我将在 [Solus][4](一种针对家庭用户的 Linux 桌面发行版)下使用 5.2.14 版本的 [VirtualBox][3] 来完成这些操作。 + +注意:在本教程我将使用 Solus 作为主机系统因为它很容易设置。另一个你需要注意的事情是 Solus 的软件中心有两个版本的 VirtualBox:`virtualbox` 和 `virtualbox-current`。Solus 会让你选择是使用 linux-lts 内核还是 linux-current 内核。最终区别就是,`virtualbox` 适用于 linux-lts 而 `virtualbx-current` 适用于 linux-current。 + + +#### 第一步 – 创建新的虚拟机 + +![][5] + +当你打开 VirtualBox,点击 "New" 按钮来新建一个虚拟机。你可以自定义这台虚拟机的名字,我将它命名为 “FreeDOS”。你也可以在标注栏内指明你正在安装的 FreeDOS 的版本。你还需要选择你将要安装的操作系统的类型和版本。选择 “Other” 下的 “DOS”。 + +#### 第二步 – 设置内存大小 + +![][6] + +下一个对话框会问你要给 FreeDOS 主机分配多少可用的内存空间。默认分配 32 MB。不必更改它。在 DOS 系统盛行的年代,32 MB 大小的内存对于一台搭载 FreeDOS 的机器已经很足够了。如果你有需要,你可以通过对你针对 FreeDOS 新建的虚拟机右键并选择 Setting -> Symtem 来增加内存。 + +![][7] + +#### 第三步 – 创建虚拟硬盘 + +![][8] + +下一步,你会被要求创建一个虚拟硬盘用来存储 FreeDOS 和它的文件。如果你还没有创建,只需要点击 “Create”。 + +下一个对话框会问你想用什么磁盘文件类型。默认的类型 (VirtualBox Disk Image) 效果就挺好。点击 “Next”。 + +下一个你遇到的问题是你想虚拟硬盘以何种方式创建。你是否希望虚拟硬盘占据的空间刚开始很小然后会随着你创建文件和安装软件逐渐增加直至达到你设置的上限?那么选择动态分配。如果你更喜欢虚拟硬盘 (VHD) 按照既定大小直接创建,选择固定大小即可。如果你不打算使用整个 VHD 或者你的硬盘空余空间不是太足够,那么动态分配是个很不错的分配方式。(需要注意的是,动态分配的虚拟硬盘占据的空间会随着你增加文件而增加,但不会因为你删除文件而变小) 我个人更喜欢动态分配,但你可以根据实际需要来选择最合适你的分配类型然后点击 “Next”。 + +![][9] + +现在,你可以选择虚拟磁盘的大小和位置。500 MB 已经很足够了。需要注意的是很多你之后用到的程序都是基于文本的,这意味着它们占据的空间非常小。在你做好这些调整后,点击 Creat。 + + +#### 第四步 – 关联 .iso 文件 + +在我们继续之前,你需要[下载][10] FreeDOS 的 .iso 文件。你需要选择 CDROM 格式的 “standard” 安装程序。 + +![][11] + +当文件下载完毕后,返回到 VirtualBox。选中你的虚拟机并打开设置。你可以通过对虚拟机右键并选中 “Setting” 或者 选中虚拟机并点击 “Setting” 按钮。 + +接下来,点击 “Storage” 选项卡。在 “Storage Devices” 下面,选中 CD 图标。(它应该会在图标旁边显示 “Empty”。) 在右边的 “Attribute” 面板,点中 CD 图标然后在对应路径选中你刚下载的 .iso 文件。 + +提示:通常,在你通过 VirtualBox 安装完一个操作系统后你就可以删除对应的 .iso 文件了。但这并不适合 FreeDOS 。如果你想通过 FreeDOS 的包管理器来安装应用程序,你需要这个 .iso 文件。我通常会让这个 .iso 文件连接到虚拟机以便我安装一些程序。如果你也这么做了,你必须要确认下你让 FreeDOS 虚拟机每次启动的时候是从硬盘启动因为虚拟机的默认设置是从已关联的 .iso 文件启动。如果你忘了关联 .iso 文件,也不用担心。你可以通过选择 FreeDOS 虚拟机窗口上方的 “Devices” 来关联。然后就会发现 .iso 文件列在 “Optical Drives”。 + + +#### 第五步 – 安装 FreeDOS + +![][12] + +既然我们已经完成了所有的准备工作,让我们来开始安装 FreeDOS 吧。 + +首先,你需要知道关于最新版本的 VirtualBox 的一个 bug。当我们创建好虚拟硬盘然后选中 “Install to harddisk” 后,如果你开启虚拟机你会发现在 FreeDOS 的欢迎界面出现过后就是不断滚动无群无尽的机器代码。我最近就遇到过这个问题而且不管是 Linux 还是 Windows 平台的 VirtualBox 都会碰到这个问题。(我知道解决办法。) + +为了避开这个问题,你需要做一个简单的修改。当你看到 FreeDOS 的欢迎界面的时候,按下 Tab 键。(确认 “Install to harddrive” 已经选中。)在 “fdboot.img” 之后输入 `raw` 然后按下 Enter 键。接下来就会启动 FreeDOS 的安装程序。 + +![][13] + +安装程序会首先处理你的虚拟磁盘的格式化。当格式化完成后,安装程序会重启。当 FreeDOS 的欢迎界面再次出现的时候,你不得不重新输入 `raw` 就像你之前输入的内容那样。 + +要确保在安装过程中你遇到的所有问题你选的都是 “Yes”。但也要注意有一个很重要的问题:“What FreeDOS packages do you want to install?” 的答案并不是 “Yes” 或者 “No”。答案有两个选择分别是 “Base packages” 和 “Full installation”。“Base packages” 针对的是想体验类似原始的 MS-DOS 环境的人群。“Full installation” 则包括了一系列工具和实用的程序来提升 DOS。 + +在整个安装过程的最后,你可以选择重启或者继续停留在 DOS。选择“reboot”。 + +#### 第六步 – 设置网络 + +不同于原始的 DOS,FreeDOS 可以访问互联网。你可以安装新的软件包或者更新你已经安装的软件包。要想使用网络,你还需要在 FreeDOS 安装些应用程序。 + +![][14] + +首先,启动进入你新创建的 FreeDOS 虚拟机。在 FreeDOS 的选择界面,选中 “Boot from System harddrive”。 + +![][15] + +现在,你可以通过输入 `fdimples` 来访问 FreeDOS 的软件包管理工具。你也可以借助方向键来浏览软件包管理器然后用空格键选择类别或者软件包。在 “Networking” 类别中,你需要选中 `fdnet`。FreeDOS project 推荐也安装 `mtcp` 和 `wget`。多次点击 “Tab” 键直到选中 “OK” 然后在按下 “Enter” 键。安装完成后,输入 `reboot` 并按下 “Enter” 键确认执行。系统重启后,引导你的系统驱动。如果网络安装成功的话,你会在终端看到一些关于你的网络信息的新消息。 + +![][16] + +##### 注意 + +有时候 VirtualBox 的默认设置并没有生效。如果遇到这种情况,先关闭你的 FreeDOS 虚拟机窗口。在 VirtualBox 主界面右键你的虚拟机并选中 “Setting”。VirtualBox 默认的网络设置是 “NAT”。将它改为 “Bridged Adapter” 后再尝试安装 FreeDOS 的软件包。现在就应该能正常运作了。 + + +#### 第七步 – FreeDOS 的基本使用 + +##### 常见命令 + +既然你已经成功安装了 FreeDOS,让我们来看些基础命令。如果你已经在 Windows 平台使用过命令提示符,那么你会发现有很多命令都是相似的。 + + * `DIR`– 显示当前目录的内容 + * `CD` – 改变当前所在的目录 + * `COPY OLD.TXT NEW.TXT`– 复制文件 + * `TYPE TEST.TXT` – 显示文件内容 + * `DEL TEST.TXT` – 删除文件 + * `XCOPY DIR NEWDIR` – 复制目录及目录下的所有内容 + * `EDIT TEST.TXT`– 编辑一个文件 + * `MKDIR NEWDIR` – 创建一个新目录 + * `CLS` – 清除屏幕 + +你可以借助互联网或者 Jim Hall 所创建的 [handy cheat sheet][17] 来找到更多基本的 DOS 命令。 + +##### 运行一个程序 + +在 FreeDOS 上运行程序相当简单。需要注意的是当你借助 `fdimples` 软件包管理器来安装一个应用程序的时候,要确保你指定了待安装程序的 .EXE 文件的路径。这个路径会在应用程序的详细信息中显示。要想运行程序,通常你还需要进入到程序所在文件夹并输入该程序的名字。 + +例如,FreeDOS 中你可以安装一个叫 `FED` 的编辑器。安装完成后,你还需要做的就是进入 `C:\FED` 这个文件夹下并输入 `FED`。 + +对于位于 `\bin` 这个文件夹的程序,比如 Pico。这些程序可以在任意文件夹中被调用。 + +对于游戏通常会有一个或者两个 .EXE 程序,你玩游戏之前不得不先运行它们。这些设置文件通常能够修复你遇到的声音,视频,或者控制问题。 + +如果你遇到一些本教程中没指出的问题,别忘记访问 [home of FreeDOS][2] 来寻求解决办法。他们有一个 wiki 和一些其他的支持选项。 + +你使用过 FreeDOS 吗?你还想看关于 FreeDOS 哪些方面的教程?请在下面的评论区告诉我们。 + +如果你觉得本篇文章很有趣,请花一分钟的时间将它分享在你的社交媒体,Hacker News 或者 [Reddit][18]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-freedos/ + +作者:[John Paul][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[WangYueScream](https://github.com/WangYueScream) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[1]:https://itsfoss.com/interview-freedos-jim-hall/ +[2]:http://www.freedos.org/ +[3]:https://www.virtualbox.org/ +[4]:https://solus-project.com/home/ +[5]:https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-1.jpg?w=787&ssl=1 +[6]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-2.jpg?w=792&ssl=1 +[7]:https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-3.jpg?w=797&ssl=1 +[8]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-4.jpg?w=684&ssl=1 +[9]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-6.jpg?w=705&ssl=1 +[10]:http://www.freedos.org/download/ +[11]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-7.jpg?w=800&ssl=1 +[12]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-8.png?w=789&ssl=1 +[13]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-9.png?w=748&ssl=1 +[14]:https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-10.png?w=792&ssl=1 +[15]:https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-11.png?w=739&ssl=1 +[16]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/07/freedos-tutorial-12.png?w=744&ssl=1 +[17]:https://opensource.com/article/18/6/freedos-commands-cheat-sheet +[18]:http://reddit.com/r/linuxusersgroup From 5bacf6d82b9f66e3d93bc42b59769865298aa829 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 17:37:49 +0800 Subject: [PATCH 1037/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20The=20Linux=20c?= =?UTF-8?q?ommand=20line=20can=20fetch=20fun=20from=20afar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ux command line can fetch fun from afar.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20181223 The Linux command line can fetch fun from afar.md diff --git a/sources/tech/20181223 The Linux command line can fetch fun from afar.md b/sources/tech/20181223 The Linux command line can fetch fun from afar.md new file mode 100644 index 0000000000..3b5e77fa27 --- /dev/null +++ b/sources/tech/20181223 The Linux command line can fetch fun from afar.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Linux command line can fetch fun from afar) +[#]: via: (https://opensource.com/article/18/12/linux-toy-remote) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +The Linux command line can fetch fun from afar +====== +Use these tools to access weather, reading material, and more from remote locations. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-remote.png?itok=mHm9POPi) + +We're almost to the end of our 24-day-long Linux command-line toys advent calendar. Hopefully, you've been following along, but if not, start back at [the beginning][1] and work your way through. You'll find plenty of games, diversions, and oddities for your Linux terminal. + +And while you may have seen some toys from our calendar before, we hope there’s at least one new thing for everyone. + +Today's toy (or actually, collection of toys) is a little different. So far I've mostly tried to focus on toys that are self-contained, and completely usable under an open source license. But I've gotten some great suggestions from readers which utilize an open source tool to access something remotely that may or may not be open source. Today, I'll round up a few of those. + +The first one is a total classic: use Telnet to watch an ASCII-rendition of Star Wars. Chances are that Telnet is already installed on your system, so all you'll need to do is run: + +``` +$ telnet towel.blinkenlights.nl +``` + +I feel like I first saw this one over a decade ago, so it's a bit amazing to me that it's still alive and online. If you've never watched it, set aside some time and go check it out. You won't regret it. + +![](https://opensource.com/sites/default/files/uploads/linux-toy-star-wars.png) + +Next, Opensource.com contributor [Manuel Dewald][2] suggested a way to fetch your local weather from the terminal. It's easy, and only requires that you have **curl** (or, well, **** **wget** ) installed. + +``` +$ curl wttr.in +``` + +![](https://opensource.com/sites/default/files/uploads/linux-toy-weather.png) + +Finally, while you can spend the holidays reading your favorite sites (including Opensource.com) from your favorite [command-line web browser][3], there are a few of my favorite sites that are more easily browsed with a dedicated client. Two of these include Reddit and Hacker News, for which there are clients that have been recommended to me that you may wish to try, mostly available under open source licenses. I've poked around with [haxor-news][4] (Hacker News) and [rtv][5] (Reddit), and both seem pretty cool. + +Do you have a favorite command-line toy that we should have included? It's a little late to submit a suggestion for this year, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Watch YouTube videos at the Linux terminal][6], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-remote + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/article/18/12/linux-toy-boxes +[2]: https://opensource.com/users/ntlx +[3]: https://opensource.com/article/16/12/web-browsers-linux-command-line +[4]: https://github.com/donnemartin/haxor-news +[5]: https://github.com/michael-lazar/rtv +[6]: https://opensource.com/article/18/12/linux-toy-youtube-dl From ce9506bca4f84d991f8a05d611e89897e8a8f95e Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:02:11 +0800 Subject: [PATCH 1038/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=207=20CI/CD=20too?= =?UTF-8?q?ls=20for=20sysadmins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20181220 7 CI-CD tools for sysadmins.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/talk/20181220 7 CI-CD tools for sysadmins.md diff --git a/sources/talk/20181220 7 CI-CD tools for sysadmins.md b/sources/talk/20181220 7 CI-CD tools for sysadmins.md new file mode 100644 index 0000000000..d645cf2561 --- /dev/null +++ b/sources/talk/20181220 7 CI-CD tools for sysadmins.md @@ -0,0 +1,136 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 CI/CD tools for sysadmins) +[#]: via: (https://opensource.com/article/18/12/cicd-tools-sysadmins) +[#]: author: (Dan Barker https://opensource.com/users/barkerd427) + +7 CI/CD tools for sysadmins +====== +An easy guide to the top open source continuous integration, continuous delivery, and continuous deployment tools. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cicd_continuous_delivery_deployment_gears.png?itok=kVlhiEkc) + +Continuous integration, continuous delivery, and continuous deployment (CI/CD) have all existed in the developer community for many years. Some organizations have involved their operations counterparts, but many haven't. For most organizations, it's imperative for their operations teams to become just as familiar with CI/CD tools and practices as their development compatriots are. + +CI/CD practices can equally apply to infrastructure and third-party applications and internally developed applications. Also, there are many different tools but all use similar models. And possibly most importantly, leading your company into this new practice will put you in a strong position within your company, and you'll be a beacon for others to follow. + +Some organizations have been using CI/CD practices on infrastructure, with tools like [Ansible][1], [Chef][2], or [Puppet][3], for several years. Other tools, like [Test Kitchen][4], allow tests to be performed on infrastructure that will eventually host applications. In fact, those tests can even deploy the application into a production-like environment and execute application-level tests with production loads in more advanced configurations. However, just getting to the point of being able to test the infrastructure individually is a huge feat. Terraform can also use Test Kitchen for even more [ephemeral][5] and [idempotent][6] infrastructure configurations than some of the original configuration-management tools. Add in Linux containers and Kubernetes, and you can now test full infrastructure and application deployments with prod-like specs and resources that come and go in hours rather than months or years. Everything is wiped out before being deployed and tested again. + +However, you can also focus on getting your network configurations or database data definition language (DDL) files into version control and start running small CI/CD pipelines on them. Maybe it just checks syntax or semantics or some best practices. Actually, this is how most development pipelines started. Once you get the scaffolding down, it will be easier to build on. You'll start to find all kinds of use cases for pipelines once you get started. + +For example, I regularly write a newsletter within my company, and I maintain it in version control using [MJML][7]. I needed to be able to host a web version, and some folks liked being able to get a PDF, so I built a [pipeline][8]. Now when I create a new newsletter, I submit it for a merge request in GitLab. This automatically creates an index.html with links to HTML and PDF versions of the newsletter. The HTML and PDF files are also created in the pipeline. None of this is published until someone comes and reviews these artifacts. Then, GitLab Pages publishes the website and I can pull down the HTML to send as a newsletter. In the future, I'll automatically send the newsletter when the merge request is merged or after a special approval step. This seems simple, but it has saved me a lot of time. This is really at the core of what these tools can do for you. They will save you time. + +The key is creating tools to work in the abstract so that they can apply to multiple problems with little change. I should also note that what I created required almost no code except [some light HTML templating][9], some [node to loop through the HTML files][10], and some more [node to populate the index page with all the HTML pages and PDFs][11]. + +Some of this might look a little complex, but most of it was taken from the tutorials of the different tools I'm using. And many developers are happy to work with you on these types of things, as they might also find them useful when they're done. The links I've provided are to a newsletter we plan to start for [DevOps KC][12], and all the code for creating the site comes from the work I did on our internal newsletter. + +Many of the tools listed below can offer this type of interaction, but some offer a slightly different model. The emerging model in this space is that of a declarative description of a pipeline in something like YAML with each stage being ephemeral and idempotent. Many of these systems also ensure correct sequencing by creating a [directed acyclic graph][13] (DAG) over the different stages of the pipeline. + +These stages are often run in Linux containers and can do anything you can do in a container. Some tools, like [Spinnaker][14], focus only on the deployment component and offer some operational features that others don't normally include. [Jenkins][15] has generally kept pipelines in an XML format and most interactions occur within the GUI, but more recent implementations have used a [domain specific language][16] (DSL) using [Groovy][17]. Further, Jenkins jobs normally execute on nodes with a special Java agent installed and consist of a mix of plugins and pre-installed components. + +Jenkins introduced pipelines in its tool, but they were a bit challenging to use and contained several caveats. Recently, the creator of Jenkins decided to move the community toward a couple different initiatives that will hopefully breathe new life into the project—which is the one that really brought CI/CD to the masses. I think its most interesting initiative is creating a Cloud Native Jenkins that can turn a Kubernetes cluster into a Jenkins CI/CD platform. + +As you learn more about these tools and start bringing these practices into your company or your operations division, you'll quickly gain followers. You will increase your own productivity as well as that of others. We all have years of backlog to get to—how much would your co-workers love if you could give them enough time to start tackling that backlog? Not only that, but your customers will start to see increased application reliability, and your management will see you as a force multiplier. That certainly can't hurt during your next salary negotiation or when interviewing with all your new skills. + +Let's dig into the tools a bit more. We'll briefly cover each one and share links to more information. + +### GitLab CI + +GitLab is a fairly new entrant to the CI/CD space, but it's already achieved the top spot in the [Forrester Wave for Continuous Integration Tools][20]. That's a huge achievement in such a crowded and highly qualified field. What makes GitLab CI so great? It uses a YAML file to describe the entire pipeline. It also has a functionality called Auto DevOps that allows for simpler projects to have a pipeline built automatically with multiple tests built-in. This system uses [Herokuish buildpacks][21] to determine the language and how to build the application. Some languages can also manage databases, which is a real game-changer for building new applications and getting them deployed to production from the beginning of the development process. The system has native integrations into Kubernetes and will deploy your application automatically into a Kubernetes cluster using one of several different deployment methodologies, like percentage-based rollouts and blue-green deployments. + +In addition to its CI functionality, GitLab offers many complementary features like operations and monitoring with Prometheus deployed automatically with your application; portfolio and project management using GitLab Issues, Epics, and Milestones; security checks built into the pipeline with the results provided as an aggregate across multiple projects; and the ability to edit code right in GitLab using the WebIDE, which can even provide a preview or execute part of a pipeline for faster feedback. + +### GoCD + +GoCD comes from the great minds at Thoughtworks, which is testimony enough for its capabilities and efficiency. To me, GoCD's main differentiator from the rest of the pack is its [Value Stream Map][22] (VSM) feature. In fact, pipelines can be chained together with one pipeline providing the "material" for the next pipeline. This allows for increased independence for different teams with different responsibilities in the deployment process. This may be a useful feature when introducing this type of system in older organizations that intend to keep these teams separate—but having everyone using the same tool will make it easier later to find bottlenecks in the VSM and reorganize the teams or work to increase efficiencies. + +It's incredibly valuable to have a VSM for each product in a company; that GoCD allows this to be [described in JSON or YAML][23] in version control and presented visually with all the data around wait times makes this tool even more valuable to an organization trying to understand itself better. Start by installing GoCD and mapping out your process with only manual approval gates. Then have each team use the manual approvals so you can start collecting data on where bottlenecks might exist. + +### Travis CI + +Travis CI was my first experience with a Software as a Service (SaaS) CI system, and it's pretty awesome. The pipelines are stored as YAML with your source code, and it integrates seamlessly with tools like GitHub. I don't remember the last time a pipeline failed because of Travis CI or the integration—Travis CI has a very high uptime. Not only can it be used as SaaS, but it also has a version that can be hosted. I haven't run that version—there were a lot of components, and it looked a bit daunting to install all of it. I'm guessing it would be much easier to deploy it all to Kubernetes with [Helm charts provided by Travis CI][26]. Those charts don't deploy everything yet, but I'm sure it will grow even more in the future. There is also an enterprise version if you don't want to deal with the hassle. + +However, if you're developing open source code, you can use the SaaS version of Travis CI for free. That is an awesome service provided by an awesome team! This alleviates a lot of overhead and allows you to use a fairly common platform for developing open source code without having to run anything. + +### Jenkins + +Jenkins is the original, the venerable, de facto standard in CI/CD. If you haven't already, you need to read "[Jenkins: Shifting Gears][27]" from Kohsuke, the creator of Jenkins and CTO of CloudBees. It sums up all of my feelings about Jenkins and the community from the last decade. What he describes is something that has been needed for several years, and I'm happy CloudBees is taking the lead on this transformation. Jenkins will be a bit overwhelming to most non-developers and has long been a burden on its administrators. However, these are items they're aiming to fix. + +[Jenkins Configuration as Code][28] (JCasC) should help fix the complex configuration issues that have plagued admins for years. This will allow for a zero-touch configuration of Jenkins masters through a YAML file, similar to other CI/CD systems. [Jenkins Evergreen][29] aims to make this process even easier by providing predefined Jenkins configurations based on different use cases. These distributions should be easier to maintain and upgrade than the normal Jenkins distribution. + +Jenkins 2 introduced native pipeline functionality with two types of pipelines, which [I discuss][30] in a LISA17 presentation. Neither is as easy to navigate as YAML when you're doing something simple, but they're quite nice for doing more complex tasks. + +[Jenkins X][31] is the full transformation of Jenkins and will likely be the implementation of Cloud Native Jenkins (or at least the thing most users see when using Cloud Native Jenkins). It will take JCasC and Evergreen and use them at their best natively on Kubernetes. These are exciting times for Jenkins, and I look forward to its innovation and continued leadership in this space. + +### Concourse CI + +I was first introduced to Concourse through folks at Pivotal Labs when it was an early beta version—there weren't many tools like it at the time. The system is made of microservices, and each job runs within a container. One of its most useful features that other tools don't have is the ability to run a job from your local system with your local changes. This means you can develop locally (assuming you have a connection to the Concourse server) and run your builds just as they'll run in the real build pipeline. Also, you can rerun failed builds from your local system and inject specific changes to test your fixes. + +Concourse also has a simple extension system that relies on the fundamental concept of resources. Basically, each new feature you want to provide to your pipeline can be implemented in a Docker image and included as a new resource type in your configuration. This keeps all functionality encapsulated in a single, immutable artifact that can be upgraded and modified independently, and breaking changes don't necessarily have to break all your builds at the same time. + +### Spinnaker + +Spinnaker comes from Netflix and is more focused on continuous deployment than continuous integration. It can integrate with other tools, including Travis and Jenkins, to kick off test and deployment pipelines. It also has integrations with monitoring tools like Prometheus and Datadog to make decisions about deployments based on metrics provided by these systems. For example, the canary deployment uses a judge concept and the metrics being collected to determine if the latest canary deployment has caused any degradation in pertinent metrics and should be rolled back or if deployment can continue. + +A couple of additional, unique features related to deployments cover an area that is often overlooked when discussing continuous deployment, and might even seem antithetical, but is critical to success: Spinnaker helps make continuous deployment a little less continuous. It will prevent a stage from running during certain times to prevent a deployment from occurring during a critical time in the application lifecycle. It can also enforce manual approvals to ensure the release occurs when the business will benefit the most from the change. In fact, the whole point of continuous integration and continuous deployment is to be ready to deploy changes as quickly as the business needs to change. + +### Screwdriver + +Screwdriver is an impressively simple piece of engineering. It uses a microservices approach and relies on tools like Nomad, Kubernetes, and Docker to act as its execution engine. There is a pretty good [deployment tutorial][34] for deploying to AWS and Kubernetes, but it could be improved once the in-progress [Helm chart][35] is completed. + +Screwdriver also uses YAML for its pipeline descriptions and includes a lot of sensible defaults, so there's less boilerplate configuration for each pipeline. The configuration describes an advanced workflow that can have complex dependencies among jobs. For example, a job can be guaranteed to run after or before another job. Jobs can run in parallel and be joined afterward. You can also use logical operators to run a job, for example, if any of its dependencies are successful or only if all are successful. Even better is that you can specify certain jobs to be triggered from a pull request. Also, dependent jobs won't run when this occurs, which allows easy segregation of your pipeline for when an artifact should go to production and when it still needs to be reviewed. + +This is only a brief description of these CI/CD tools—each has even more cool features and differentiators you can investigate. They are all open source and free to use, so go deploy them and see which one fits your needs best. + +### What to read next + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/cicd-tools-sysadmins + +作者:[Dan Barker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/barkerd427 +[b]: https://github.com/lujun9972 +[1]: https://www.ansible.com/ +[2]: https://www.chef.io/ +[3]: https://puppet.com/ +[4]: https://github.com/test-kitchen/test-kitchen +[5]: https://www.merriam-webster.com/dictionary/ephemeral +[6]: https://en.wikipedia.org/wiki/Idempotence +[7]: https://mjml.io/ +[8]: https://gitlab.com/devopskc/newsletter/blob/master/.gitlab-ci.yml +[9]: https://gitlab.com/devopskc/newsletter/blob/master/index/index.html +[10]: https://gitlab.com/devopskc/newsletter/blob/master/html-to-pdf.js +[11]: https://gitlab.com/devopskc/newsletter/blob/master/populate-index.js +[12]: https://devopskc.com/ +[13]: https://en.wikipedia.org/wiki/Directed_acyclic_graph +[14]: https://www.spinnaker.io/ +[15]: https://jenkins.io/ +[16]: https://martinfowler.com/books/dsl.html +[17]: http://groovy-lang.org/ +[18]: https://about.gitlab.com/product/continuous-integration/ +[19]: https://gitlab.com/gitlab-org/gitlab-ce/ +[20]: https://about.gitlab.com/2017/09/27/gitlab-leader-continuous-integration-forrester-wave/ +[21]: https://github.com/gliderlabs/herokuish +[22]: https://www.gocd.org/getting-started/part-3/#value_stream_map +[23]: https://docs.gocd.org/current/advanced_usage/pipelines_as_code.html +[24]: https://docs.travis-ci.com/ +[25]: https://github.com/travis-ci/travis-ci +[26]: https://github.com/travis-ci/kubernetes-config +[27]: https://jenkins.io/blog/2018/08/31/shifting-gears/ +[28]: https://jenkins.io/projects/jcasc/ +[29]: https://github.com/jenkinsci/jep/blob/master/jep/300/README.adoc +[30]: https://danbarker.codes/talk/lisa17-becoming-plumber-building-deployment-pipelines/ +[31]: https://jenkins-x.io/ +[32]: https://concourse-ci.org/ +[33]: https://github.com/concourse/concourse +[34]: https://docs.screwdriver.cd/cluster-management/kubernetes +[35]: https://github.com/screwdriver-cd/screwdriver-chart From 8942b1cc62d410fcf30597ce1758fc72bf997925 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:03:38 +0800 Subject: [PATCH 1039/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Buil?= =?UTF-8?q?d=20a=20Netboot=20Server,=20Part=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1 How to Build a Netboot Server, Part 3.md | 284 ++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 sources/tech/20181221 How to Build a Netboot Server, Part 3.md diff --git a/sources/tech/20181221 How to Build a Netboot Server, Part 3.md b/sources/tech/20181221 How to Build a Netboot Server, Part 3.md new file mode 100644 index 0000000000..7c4501b58b --- /dev/null +++ b/sources/tech/20181221 How to Build a Netboot Server, Part 3.md @@ -0,0 +1,284 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Build a Netboot Server, Part 3) +[#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-3/) +[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) + +How to Build a Netboot Server, Part 3 +====== + +![](https://fedoramagazine.org/wp-content/uploads/2018/12/netboot3-816x345.jpg) + +The [How to Build a Netboot Server, Part 1][1] article provided a minimal [iPXE][2] boot script for your netboot image. Many users probably have a local operating system that they want to use in addition to the netboot image. But switching bootloaders using the typical workstation’s BIOS can be cumbersome. This part of the series shows how to set up some more complex iPXE configurations. These allow the end user to easily choose which operating system they want to boot. They also let the system administrator manage the boot menus from a central server. + +### An interactive iPXE boot menu + +The commands below redefine the netboot image’s boot.cfg as an interactive iPXE boot menu with a 5 second countdown timer: + +``` +$ MY_FVER=29 +$ MY_KRNL=$(ls -c /fc$MY_FVER/lib/modules | head -n 1) +$ MY_DNS1=192.0.2.91 +$ MY_DNS2=192.0.2.92 +$ MY_NAME=server-01.example.edu +$ MY_EMAN=$(echo $MY_NAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_NAME}) +$ MY_ADDR=$(host -t A $MY_NAME | awk '{print $4}') +$ cat << END > $HOME/esp/linux/boot.cfg +#!ipxe + +set timeout 5000 + +:menu +menu iPXE Boot Menu +item --key 1 lcl 1. Microsoft Windows 10 +item --key 2 f$MY_FVER 2. RedHat Fedora $MY_FVER +choose --timeout \${timeout} --default lcl selected || goto shell +set timeout 0 +goto \${selected} + +:failed +echo boot failed, dropping to shell... +goto shell + +:shell +echo type 'exit' to get the back to the menu +set timeout 0 +shell +goto menu + +:lcl +exit + +:f$MY_FVER +kernel --name kernel.efi \${prefix}/vmlinuz-$MY_KRNL initrd=initrd.img ro ip=dhcp rd.peerdns=0 nameserver=$MY_DNS1 nameserver=$MY_DNS2 root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc$MY_FVER-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc$MY_FVER console=tty0 console=ttyS0,115200n8 audit=0 selinux=0 quiet +initrd --name initrd.img \${prefix}/initramfs-$MY_KRNL.img +boot || goto failed +END +``` + +The above menu has five sections: + + * **menu** defines the actual menu that will be shown on the screen. + * **failed** notifies the user that something went wrong and drops the user to a shell so they can troubleshot the problem. + * **shell** provides an interactive command prompt. You can reach it either by pressing the **Esc** key while at the boot menu or if the “boot” command returns with a failure code. + * **lcl** contains a single command that tells iPXE to exit and return control back to the BIOS. Whatever you want to boot by default (e.g. the workstation’s local hard drive) **must** be listed as the next boot item right after iPXE in your workstation’s BIOS. + * **f29** contains the same netboot code used earlier but with the final exit replaced with goto failed. + + + +Copy the updated boot.cfg from your $HOME/esp/linux directory out to the ESPs of all your client systems. If all goes well, you should see results similar to the image below: + +![][3] + +### A server hosted boot menu + +Another feature you can add to the netboot server is the ability to manage all the client boot menus from one central location. This feature can be especially useful when rolling out a new version of the OS. It lets you perform a sort of [atomic transaction][4] to switch all clients over to the new OS after you’ve copied the new kernel and initramfs out to the ESPs of all the clients. + +Install Mojolicious: + +``` +$ sudo -i +# dnf install -y perl-Mojolicious +``` + +Define the “bootmenu” app: + +``` +# mkdir /opt/bootmenu +# cat << END > /opt/bootmenu/bootmenu.pl +#!/usr/bin/env perl +use Mojolicious::Lite; +use Mojolicious::Plugins; + +plugin 'Config'; + +get '/menu'; + +app->start; +END +# chmod 755 /opt/bootmenu/bootmenu.pl +``` + +Define the configuration file for the bootmenu app: + +``` +# cat << END > /opt/bootmenu/bootmenu.conf +{ + hypnotoad => { + listen => ['http://*:80'], + pid_file => '/run/bootmenu/bootmenu.pid', + } +} +END +``` + +This is an extremely simple Mojolicious application that listens on port 80 and only answers to /menu requests. If you want a quick introduction to what Mojolicious can do, run man Mojolicious::Guides::Growing to view the manual. Use the **Q** key to quit the manual. + +Move boot.cfg over to our netboot app as a template named menu.html.ep: + +``` +# mkdir /opt/bootmenu/templates +# mv $HOME/esp/linux/boot.cfg /opt/bootmenu/templates/menu.html.ep +``` + +Define a systemd service to manage the bootmenu app: + +``` +# cat << END > /etc/systemd/system/bootmenu.service +[Unit] +Description=Serves iPXE Menus over HTTP +After=network-online.target + +[Service] +Type=forking +DynamicUser=true +RuntimeDirectory=bootmenu +PIDFile=/run/bootmenu/bootmenu.pid +ExecStart=/usr/bin/hypnotoad /opt/bootmenu/bootmenu.pl +ExecReload=/usr/bin/hypnotoad /opt/bootmenu/bootmenu.pl +AmbientCapabilities=CAP_NET_BIND_SERVICE +KillMode=process + +[Install] +WantedBy=multi-user.target +END +``` + +Add an exception for the HTTP service to the local firewall and start the bootmenu service: + +``` +# firewall-cmd --add-service http +# firewall-cmd --runtime-to-permanent +# systemctl enable bootmenu.service +# systemctl start bootmenu.service +``` + +Test it with wget: + +``` +$ sudo dnf install -y wget +$ MY_BOOTMENU_SERVER=server-01.example.edu +$ wget -q -O - http://$MY_BOOTMENU_SERVER/menu +``` + +The above command should output something similar to the following: + +``` +#!ipxe + +set timeout 5000 + +:menu +menu iPXE Boot Menu +item --key 1 lcl 1. Microsoft Windows 10 +item --key 2 f29 2. RedHat Fedora 29 +choose --timeout ${timeout} --default lcl selected || goto shell +set timeout 0 +goto ${selected} + +:failed +echo boot failed, dropping to shell... +goto shell + +:shell +echo type 'exit' to get the back to the menu +set timeout 0 +shell +goto menu + +:lcl +exit + +:f29 +kernel --name kernel.efi ${prefix}/vmlinuz-4.19.4-300.fc29.x86_64 initrd=initrd.img ro ip=dhcp rd.peerdns=0 nameserver=192.0.2.91 nameserver=192.0.2.92 root=/dev/disk/by-path/ip-192.0.2.158:3260-iscsi-iqn.edu.example.server-01:fc29-lun-1 netroot=iscsi:192.0.2.158::::iqn.edu.example.server-01:fc29 console=tty0 console=ttyS0,115200n8 audit=0 selinux=0 quiet +initrd --name initrd.img ${prefix}/initramfs-4.19.4-300.fc29.x86_64.img +boot || goto failed +``` + +Now that the boot menu server is working, rebuild the ipxe.efi bootloader with an init script that points to it. + +First, update the init.ipxe script created in part one of this series: + +``` +$ MY_BOOTMENU_SERVER=server-01.example.edu +$ cat << END > $HOME/ipxe/init.ipxe +#!ipxe + +dhcp || exit +set prefix file:///linux +chain http://$MY_BOOTMENU_SERVER/menu || exit +END +``` + +Now, rebuild the boot loader: + +``` +$ cd $HOME/ipxe/src +$ make clean +$ make bin-x86_64-efi/ipxe.efi EMBED=../init.ipxe +``` + +Copy the updated bootloader to your ESP: + +``` +$ cp $HOME/ipxe/src/bin-x86_64-efi/ipxe.efi $HOME/esp/efi/boot/bootx64.efi +``` + +After you’ve copied the updated bootloader to all your clients, you can make future updates to the boot menu simply by editing /opt/bootmenu/templates/menu.html.ep and running: + +``` +$ sudo systemctl restart bootmenu.service +``` + +### Making further changes + +If the boot menu server is working properly, you’ll longer need the the boot.cfg file on your client systems. + +For example, re-add the Fedora 28 image to the boot menu: + +``` +$ sudo -i +# MY_FVER=28 +# MY_KRNL=$(ls -c /fc$MY_FVER/lib/modules | head -n 1) +# MY_DNS1=192.0.2.91 +# MY_DNS2=192.0.2.92 +# MY_NAME=$(> /opt/bootmenu/templates/menu.html.ep + +:f$MY_FVER +kernel --name kernel.efi \${prefix}/vmlinuz-$MY_KRNL initrd=initrd.img ro ip=dhcp rd.peerdns=0 nameserver=$MY_DNS1 nameserver=$MY_DNS2 root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc$MY_FVER-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc$MY_FVER console=tty0 console=ttyS0,115200n8 audit=0 selinux=0 quiet +initrd --name initrd.img \${prefix}/initramfs-$MY_KRNL.img +boot || goto failed +END +# sed -i "/item --key 2/a item --key 3 f$MY_FVER 3. RedHat Fedora $MY_FVER" /opt/bootmenu/templates/menu.html.ep +# systemctl restart bootmenu.service +``` + +If all goes well, your clients should see results similar to the image below the next time they boot: + +![][5] + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-3/ + +作者:[Gregory Bartholomew][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/glb/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ +[2]: https://ipxe.org/ +[3]: https://fedoramagazine.org/wp-content/uploads/2018/11/netboot-menu-1024x641.png +[4]: https://en.wikipedia.org/wiki/Atomicity_(database_systems) +[5]: https://fedoramagazine.org/wp-content/uploads/2018/11/netboot-menu-updated-1024x641.png From c970813fb07650d8caea5de0d5bff7b5014c4f0b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:06:26 +0800 Subject: [PATCH 1040/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Inst?= =?UTF-8?q?all=20Microsoft=20.NET=20Core=20SDK=20On=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nstall Microsoft .NET Core SDK On Linux.md | 337 ++++++++++++++++++ 1 file changed, 337 insertions(+) create mode 100644 sources/tech/20181220 How To Install Microsoft .NET Core SDK On Linux.md diff --git a/sources/tech/20181220 How To Install Microsoft .NET Core SDK On Linux.md b/sources/tech/20181220 How To Install Microsoft .NET Core SDK On Linux.md new file mode 100644 index 0000000000..728db3b7be --- /dev/null +++ b/sources/tech/20181220 How To Install Microsoft .NET Core SDK On Linux.md @@ -0,0 +1,337 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install Microsoft .NET Core SDK On Linux) +[#]: via: (https://www.ostechnix.com/how-to-install-microsoft-net-core-sdk-on-linux/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +How To Install Microsoft .NET Core SDK On Linux +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/NET-Core-SDK-720x340.png) + +The **.NET Core** is a free, cross platform and open source framework developed by Microsoft to build desktop applications, mobile apps, web apps, IoT apps and gaming apps etc. If you’re dotnet developer coming from Windows platform, .NET core helps you to setup your development environment easily on any Linux and Unix-like operating systems. This step by step guide explains how to install Microsoft .NET Core SDK on Linux and how to write your first app using .Net. + +### Install Microsoft .NET Core SDK On Linux + +The .NET core supports GNU/Linux, Mac OS and Windows. .Net core can be installed on popular GNU/Linux operating systems including Debian, Fedora, CentOS, Oracle Linux, RHEL, SUSE/openSUSE, and Ubuntu. As of writing this guide, the latest .NET core version was **2.2**. + +On **Debian 9** , you can install .NET Core SDK as shown below. + +First of all, you need to register Microsoft key and add .NET repository by running the following commands: + +``` +$ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg +$ sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ +$ wget -q https://packages.microsoft.com/config/debian/9/prod.list +$ sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list +$ sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg +$ sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list +``` + +After registering the key and adding the repository, install .NET SDK using commands: + +``` +$ sudo apt-get update +$ sudo apt-get install dotnet-sdk-2.2 +``` + +**On Debian 8:** + +Add Microsoft key and enable .NET repository: + +``` +$ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg +$ sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ +$ wget -q https://packages.microsoft.com/config/debian/8/prod.list +$ sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list +$ sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg +$ sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list +``` + +Install .NET SDK: + +``` +$ sudo apt-get update +$ sudo apt-get install dotnet-sdk-2.2 +``` + +**On Fedora 28:** + +Add Microsoft key and enable .NET repository: + +``` +$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc +$ wget -q https://packages.microsoft.com/config/fedora/27/prod.repo +$ sudo mv prod.repo /etc/yum.repos.d/microsoft-prod.repo +$ sudo chown root:root /etc/yum.repos.d/microsoft-prod.repo +``` + +Now, Install .NET SDK: + +``` +$ sudo dnf update +$ sudo dnf install dotnet-sdk-2.2 +``` + +On **Fedora 27** , add the key and repository using commands: + +``` +$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc +$ wget -q https://packages.microsoft.com/config/fedora/27/prod.repo +$ sudo mv prod.repo /etc/yum.repos.d/microsoft-prod.repo +$ sudo chown root:root /etc/yum.repos.d/microsoft-prod.repo +``` + +And install .NET SDK using commands: + +``` +$ sudo dnf update +$ sudo dnf install dotnet-sdk-2.2 +``` + +**On CentOS/Oracle Linux:** + +Add Microsoft key and enable .NET core repository: + +``` +$ sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm +``` + +Update the repositories and install .NET SDK: + +``` +$ sudo yum update +$ sudo yum install dotnet-sdk-2.2 +``` + +**On openSUSE Leap:** + +Add key, enable repository and install necessary dependencies using the following commands: + +``` +$ sudo zypper install libicu +$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc +$ wget -q https://packages.microsoft.com/config/opensuse/42.2/prod.repo +$ sudo mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo +$ sudo chown root:root /etc/zypp/repos.d/microsoft-prod.repo +``` + +Update the repositories and Install .NET SDK using commands: + +``` +$ sudo zypper update +$ sudo zypper install dotnet-sdk-2.2 +``` + +**On Ubuntu 18.04 LTS:** + +Register the Microsoft key and .NET core repository using commands: + +``` +$ wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb +$ sudo dpkg -i packages-microsoft-prod.deb +``` + +Enable ‘Universe’ repository using: + +``` +$ sudo add-apt-repository universe +``` + +Then, install .NET Core SDK using command: + +``` +$ sudo apt-get install apt-transport-https +$sudo apt-get update +$ sudo apt-get install dotnet-sdk-2.2 +``` + +**On Ubuntu 16.04 LTS:** + +Register Microsoft key and .NET repository using commands: + +``` +$ wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb +$ sudo dpkg -i packages-microsoft-prod.deb +``` + +And then, Install .NET core SDK: + +``` +$ sudo apt-get install apt-transport-https +$ sudo apt-get update +$ sudo apt-get install dotnet-sdk-2.2 +``` + +### Create Your First App + +We have successfully installed .Net Core SDK in our Linux box. It is time to create our first app using dotnet. + +For the purpose of this guide, I am going to create a new app called **“ostechnixApp”**. To do so, simply run the following command: + +``` +$ dotnet new console -o ostechnixApp +``` + +**Sample output:** + +``` +Welcome to .NET Core! +--------------------- +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs + +Telemetry +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + +ASP.NET Core +------------ +Successfully installed the ASP.NET Core HTTPS Development Certificate. +To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establishing trust on other platforms refer to the platform specific documentation. +For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054. +Getting ready... +The template "Console Application" was created successfully. + +Processing post-creation actions... +Running 'dotnet restore' on ostechnixApp/ostechnixApp.csproj... +Restoring packages for /home/sk/ostechnixApp/ostechnixApp.csproj... +Generating MSBuild file /home/sk/ostechnixApp/obj/ostechnixApp.csproj.nuget.g.props. +Generating MSBuild file /home/sk/ostechnixApp/obj/ostechnixApp.csproj.nuget.g.targets. +Restore completed in 894.27 ms for /home/sk/ostechnixApp/ostechnixApp.csproj. + +Restore succeeded. +``` + +As you can see in the above output, .Net has created a new application of type console. The parameter -o creates a directory named “ostechnixApp” where you store your app data with all necessary files. + +Let us switch to ostechnixApp directory and see what’s in there. + +``` +$ cd ostechnixApp/ +$ ls +obj ostechnixApp.csproj Program.cs +``` + +As you there are three files named **ostechnixApp.csproj** and **Program.cs** and one directory named **obj**. By default, the Program.cs file will contain the code to run the ‘Hello World’ program in the console. Let us have a look at the code. + +``` +$ cat Program.cs +using System; + +namespace ostechnixApp +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} +``` + +To run the newly created app, simply run the following command: + +``` +$ dotnet run +Hello World! +``` + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/run-dotnet.png) + +Simple, isn’t it? Yes, it is! Now, you can write your code in the **Program.cs** file and run it as shown above. + +Alternatively, you can create a new directory, for example mycode, using commands: + +``` +$ mkdir ~/.mycode + +$ cd mycode/ +``` + +…and make that as your new development environment by running the following command: + +``` +$ dotnet new console +``` + +Sample output: + +``` +The template "Console Application" was created successfully. + +Processing post-creation actions... +Running 'dotnet restore' on /home/sk/mycode/mycode.csproj... +Restoring packages for /home/sk/mycode/mycode.csproj... +Generating MSBuild file /home/sk/mycode/obj/mycode.csproj.nuget.g.props. +Generating MSBuild file /home/sk/mycode/obj/mycode.csproj.nuget.g.targets. +Restore completed in 331.87 ms for /home/sk/mycode/mycode.csproj. + +Restore succeeded. +``` + +The above command will create two files named **mycode.csproj** and **Program.cs** and one directory named **obj**. Open the Program.cs file in your favorite editor, delete or modify the existing ‘hello world’ code with your own code. + +Once the code is written, save and close the Program.cs file and run the app using command: + +``` +$ dotnet run +``` + +To check the installed .NET core SDK version, simply run: + +``` +$ dotnet --version +2.2.101 +``` + +To get help, run: + +``` +$ dotnet --help +``` + +### Get Microsoft Visual Studio Code Editor + +To write the code, you can use your favorite editors of your choice. Microsoft has also its own editor named “ **Microsoft Visual Studio Code** ” with support for .NET. It is an open source, lightweight and powerful source code editor. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Python, PHP, Go) and runtimes (such as .NET and Unity). It is a cross-platform code editor, so you can use it in Microsoft Windows, GNU/Linux, and Mac OS X. You can use it if you’re interested. + +To know how to install and use it on Linux, please refer the following guide. + +[Install Microsoft Visual Studio Code In Linux][3] + +[**This page**][1] has some basic tutorials to learn .NET Core and .NET Core SDK tools using Visual Studio Code editor. Go and check them to learn more. + +### Telemetry + +By default, the .NET core SDK will collect the usage data using a feature called **‘Telemetry’**. The collected data is anonymous and shared to the development team and community under the [Creative Commons Attribution License][2]. So the .NET team will understand how the tools are used and decide how they can be improved over time. If you don’t want to share your usage information, you can simply opt-out of telemetry by setting the **DOTNET_CLI_TELEMETRY_OPTOUT** environment variable to **‘1’** or **‘true’** using your favorite shell. + +And, that’s all. You know how to install .NET Core SDK on various Linux platforms and how to create a basic app using it. TO learn more about .NET usage, refer the links given at the end of this guide. + +More good stuffs to come. Stay tuned! + +Cheers! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-install-microsoft-net-core-sdk-on-linux/ + +作者:[SK][a] +选题:[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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://docs.microsoft.com/en-us/dotnet/core/tutorials/index +[2]: https://creativecommons.org/licenses/by/4.0/ +[3]: https://www.ostechnix.com/install-microsoft-visual-studio-code-linux/ From dfe81d4ea0255144219dbbbaee1b93915ecb2a96 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:12:10 +0800 Subject: [PATCH 1041/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20PowerTOP=20?= =?UTF-8?q?=E2=80=93=20Monitors=20Power=20Usage=20and=20Improve=20Laptop?= =?UTF-8?q?=20Battery=20Life=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nd Improve Laptop Battery Life in Linux.md | 411 ++++++++++++++++++ 1 file changed, 411 insertions(+) create mode 100644 sources/tech/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md diff --git a/sources/tech/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md b/sources/tech/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md new file mode 100644 index 0000000000..a615ffc73a --- /dev/null +++ b/sources/tech/20181219 PowerTOP - Monitors Power Usage and Improve Laptop Battery Life in Linux.md @@ -0,0 +1,411 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PowerTOP – Monitors Power Usage and Improve Laptop Battery Life in Linux) +[#]: via: (https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/) +[#]: author: (Vinoth Kumar https://www.2daygeek.com/author/vinoth/) + +PowerTOP – Monitors Power Usage and Improve Laptop Battery Life in Linux +====== + +We all know, we almost 80-90% migrated from PC (Desktop) to laptop. + +But one thing we want from a laptop, it’s long battery life and we want to use every drop of power. + +So it’s good to know where our power is going and getting waste. + +You can use the powertop utility to see what’s drawing power when your system’s not plugged in. + +You need to run the powertop utility in terminal with super user privilege. + +It will access the hardware and measure power usage. + +### What is PowerTOP + +PowerTOP is a Linux tool to diagnose issues with power consumption and power management. + +It was developed by Intel to enable various power-saving modes in kernel, userspace, and hardware. + +In addition to being a diagnostic tool, PowerTOP also has an interactive mode where the user can experiment various power management settings for cases where the Linux distribution has not enabled these settings. + +It is possible to monitor processes and show which of them are utilizing the CPU and wake it from its Idle-States, allowing to identify applications with particular high power demands. + +### How to Install PowerTOP + +PowerTOP package is available in most of the distributions official repository so, use the distributions **[Package Manager][1]** to install it. + +For **`Fedora`** system, use **[DNF Command][2]** to install PowerTOP. + +``` +$ sudo dnf install powertop +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][3]** or **[APT Command][4]** to install PowerTOP. + +``` +$ sudo apt install powertop +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][5]** to install PowerTOP. + +``` +$ sudo pacman -S powertop +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][6]** to install PowerTOP. + +``` +$ sudo yum install powertop +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][7]** to install PowerTOP. + +``` +$ sudo zypper install powertop +``` + +### How To Access PowerTOP + +PowerTOP requires super user privilege so, run as root to use PowerTOP utility on your Linux system. + +By default it shows `Overview` tab where we can see the power usage consumption for all the devices. Also shows your system wakeups seconds. + +``` +$ sudo powertop + +PowerTOP v2.9 Overview Idle stats Frequency stats Device stats Tunables + +The battery reports a discharge rate of 12.6 W +The power consumed was 259 J +The estimated remaining time is 1 hours, 52 minutes + +Summary: 1692.9 wakeups/second, 0.0 GPU ops/seconds, 0.0 VFS ops/sec and 54.9% CPU use + + Usage Events/s Category Description + 9.3 ms/s 529.4 Timer tick_sched_timer + 378.5 ms/s 139.8 Process [PID 2991] /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 8314 -prefMapSize 173895 -schedulerPrefs 00 + 7.5 ms/s 141.7 Timer hrtimer_wakeup + 3.3 ms/s 102.7 Process [PID 1527] /usr/lib/firefox/firefox --new-window + 11.6 ms/s 69.1 Process [PID 1568] /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 173895 -schedulerPrefs 0001, + 6.2 ms/s 59.0 Process [PID 1496] /usr/lib/firefox/firefox --new-window + 2.1 ms/s 59.6 Process [PID 2466] /usr/lib/firefox/firefox -contentproc -childID 3 -isForBrowser -prefsLen 5814 -prefMapSize 173895 -schedulerPrefs 00 + 1.8 ms/s 52.3 Process [PID 2052] /usr/lib/firefox/firefox -contentproc -childID 4 -isForBrowser -prefsLen 5814 -prefMapSize 173895 -schedulerPrefs 00 + 1.8 ms/s 50.8 Process [PID 3034] /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 8314 -prefMapSize 173895 -schedulerPrefs 00 + 3.6 ms/s 48.4 Process [PID 3009] /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 8314 -prefMapSize 173895 -schedulerPrefs 00 + 7.5 ms/s 46.2 Process [PID 2996] /usr/lib/firefox/firefox -contentproc -childID 7 -isForBrowser -prefsLen 8314 -prefMapSize 173895 -schedulerPrefs 00 + 25.2 ms/s 33.6 Process [PID 1528] /usr/lib/firefox/firefox --new-window + 5.7 ms/s 32.2 Interrupt [7] sched(softirq) + 2.1 ms/s 32.2 Process [PID 1811] /usr/lib/firefox/firefox -contentproc -childID 4 -isForBrowser -prefsLen 5814 -prefMapSize 173895 -schedulerPrefs 00 + 19.7 ms/s 25.0 Process [PID 1794] /usr/lib/firefox/firefox -contentproc -childID 4 -isForBrowser -prefsLen 5814 -prefMapSize 173895 -schedulerPrefs 00 + 1.9 ms/s 31.5 Process [PID 1596] /usr/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 1 -prefMapSize 173895 -schedulerPrefs 0001, + 3.1 ms/s 29.9 Process [PID 1535] /usr/lib/firefox/firefox --new-window + 7.1 ms/s 28.2 Process [PID 1488] /usr/lib/firefox/firefox --new-window + 1.8 ms/s 29.5 Process [PID 1762] /usr/lib/firefox/firefox -contentproc -childID 3 -isForBrowser -prefsLen 5814 -prefMapSize 173895 -schedulerPrefs 00 + 8.8 ms/s 23.3 Process [PID 1121] /usr/bin/gnome-shell + 1.2 ms/s 21.8 Process [PID 1657] /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 920 -prefMapSize 173895 -schedulerPrefs 000 + 13.3 ms/s 13.9 Process [PID 1746] /usr/lib/firefox/firefox -contentproc -childID 3 -isForBrowser -prefsLen 5814 -prefMapSize 173895 -schedulerPrefs 00 + 2.7 ms/s 11.1 Process [PID 3410] /usr/lib/gnome-terminal-server + 3.8 ms/s 10.8 Process [PID 1057] /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty + 3.1 ms/s 9.8 Process [PID 1629] /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 920 -prefMapSize 173895 -schedulerPrefs 000 + 0.9 ms/s 6.7 Interrupt [136] xhci_hcd + 278.0 us/s 6.4 Process [PID 414] [irq/141-iwlwifi] + 128.7 us/s 5.7 Process [PID 1] /sbin/init + 118.5 us/s 5.2 Process [PID 10] [rcu_preempt] + 49.0 us/s 4.7 Interrupt [0] HI_SOFTIRQ + 459.3 us/s 3.1 Interrupt [142] i915 + 2.1 ms/s 2.3 Process [PID 3451] powertop + 8.4 us/s 2.7 kWork intel_atomic_helper_free_state_ + 1.2 ms/s 1.8 kWork intel_atomic_commit_work + 374.2 us/s 2.1 Interrupt [9] acpi + 42.1 us/s 1.8 kWork intel_atomic_cleanup_work + 3.5 ms/s 0.25 kWork delayed_fput + 238.0 us/s 1.5 Process [PID 907] /usr/lib/upowerd + 17.7 us/s 1.5 Timer intel_uncore_fw_release_timer + 26.4 us/s 1.4 Process [PID 576] [i915/signal:0] + 19.8 us/s 1.3 Timer watchdog_timer_fn + 1.1 ms/s 0.00 Process [PID 206] [kworker/7:2] + 2.4 ms/s 0.00 Interrupt [1] timer(softirq) + 13.4 us/s 0.9 Process [PID 9] [ksoftirqd/0] + + Exit | / Navigate | +``` + +The powertop output looks similar to the above screenshot, it will be slightly different based on your hardware. This have many screen you can switch between screen the using `Tab` and `Shift+Tab` button. + +### Idle Stats Tab + +It displays various information about the processor. + +``` +PowerTOP v2.9 Overview Idle stats Frequency stats Device stats Tunables + + + Package | Core | CPU 0 CPU 4 + | | C0 active 6.7% 7.2% + | | POLL 0.0% 0.1 ms 0.0% 0.1 ms + | | C1E 1.2% 0.2 ms 1.6% 0.3 ms +C2 (pc2) 7.5% | | +C3 (pc3) 25.2% | C3 (cc3) 0.7% | C3 0.5% 0.2 ms 0.6% 0.1 ms +C6 (pc6) 0.0% | C6 (cc6) 7.1% | C6 6.6% 0.5 ms 6.3% 0.5 ms +C7 (pc7) 0.0% | C7 (cc7) 59.8% | C7s 0.0% 0.0 ms 0.0% 0.0 ms +C8 (pc8) 0.0% | | C8 33.9% 1.6 ms 32.3% 1.5 ms +C9 (pc9) 0.0% | | C9 2.1% 3.4 ms 0.7% 2.8 ms +C10 (pc10) 0.0% | | C10 39.5% 4.7 ms 41.4% 4.7 ms + + | Core | CPU 1 CPU 5 + | | C0 active 8.3% 7.2% + | | POLL 0.0% 0.0 ms 0.0% 0.1 ms + | | C1E 1.3% 0.2 ms 1.4% 0.3 ms + | | + | C3 (cc3) 0.5% | C3 0.5% 0.2 ms 0.4% 0.2 ms + | C6 (cc6) 6.0% | C6 5.3% 0.5 ms 4.7% 0.5 ms + | C7 (cc7) 59.3% | C7s 0.0% 0.8 ms 0.0% 1.0 ms + | | C8 27.2% 1.5 ms 23.8% 1.4 ms + | | C9 1.6% 3.0 ms 0.5% 3.0 ms + | | C10 44.5% 4.7 ms 52.2% 4.6 ms + + | Core | CPU 2 CPU 6 + | | C0 active 11.2% 8.4% + | | POLL 0.0% 0.0 ms 0.0% 0.0 ms + | | C1E 1.4% 0.4 ms 1.3% 0.3 ms + | | + | C3 (cc3) 0.3% | C3 0.2% 0.1 ms 0.4% 0.2 ms + | C6 (cc6) 4.0% | C6 3.7% 0.5 ms 4.3% 0.5 ms + | C7 (cc7) 54.2% | C7s 0.0% 0.0 ms 0.0% 1.0 ms + | | C8 20.0% 1.5 ms 20.7% 1.4 ms + | | C9 1.0% 3.4 ms 0.4% 3.8 ms + | | C10 48.8% 4.6 ms 52.3% 5.0 ms + + | Core | CPU 3 CPU 7 + | | C0 active 8.8% 8.1% + | | POLL 0.0% 0.1 ms 0.0% 0.0 ms + | | C1E 1.2% 0.2 ms 1.2% 0.2 ms + | | + | C3 (cc3) 0.6% | C3 0.6% 0.2 ms 0.4% 0.2 ms + | C6 (cc6) 7.0% | C6 7.5% 0.5 ms 4.4% 0.5 ms + | C7 (cc7) 56.8% | C7s 0.0% 0.0 ms 0.0% 0.9 ms + | | C8 29.4% 1.4 ms 23.8% 1.4 ms + | | C9 1.1% 2.7 ms 0.7% 3.9 ms + | | C10 41.0% 4.0 ms 50.0% 4.8 ms + + + Exit | / Navigate | +``` + +### Frequency Stats Tab + +It displays the frequency of CPU. + +``` +PowerTOP v2.9 Overview Idle stats Frequency stats Device stats Tunables + + + Package | Core | CPU 0 CPU 4 + | | Average 930 MHz 1101 MHz +Idle | Idle | Idle + + | Core | CPU 1 CPU 5 + | | Average 1063 MHz 979 MHz + | Idle | Idle + + | Core | CPU 2 CPU 6 + | | Average 976 MHz 942 MHz + | Idle | Idle + + | Core | CPU 3 CPU 7 + | | Average 924 MHz 957 MHz + | Idle | Idle + +``` + +### Device Stats Tab + +It displays power usage information against only devices. + +``` +PowerTOP v2.9 Overview Idle stats Frequency stats Device stats Tunables + + +The battery reports a discharge rate of 13.8 W +The power consumed was 280 J + + Usage Device name + 46.7% CPU misc + 46.7% DRAM + 46.7% CPU core + 19.0% Display backlight + 0.0% Audio codec hwC0D0: Realtek + 0.0% USB device: Lenovo EasyCamera (160709000341) + 100.0% PCI Device: Intel Corporation HD Graphics 530 + 100.0% Radio device: iwlwifi + 100.0% PCI Device: O2 Micro, Inc. SD/MMC Card Reader Controller + 100.0% PCI Device: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + 100.0% USB device: Lenovo Wireless Optical Mouse N100 + 100.0% PCI Device: Intel Corporation Wireless 8260 + 100.0% PCI Device: Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] + 100.0% Radio device: btusb + 100.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #4 + 100.0% USB device: xHCI Host Controller + 100.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller + 100.0% PCI Device: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller + 100.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #3 + 100.0% PCI Device: Samsung Electronics Co Ltd NVMe SSD Controller SM951/PM951 + 100.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #2 + 100.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #9 + 100.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family SMBus + 26.1 pkts/s Network interface: wlp8s0 (iwlwifi) + 0.0% USB device: usb-device-8087-0a2b + 0.0% runtime-reg-dummy + 0.0% Audio codec hwC0D2: Intel + 0.0 pkts/s Network interface: enp9s0 (r8168) + 0.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller + 0.0% PCI Device: Intel Corporation HM170 Chipset LPC/eSPI Controller + 0.0% PCI Device: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) + 0.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 + 0.0% PCI Device: NVIDIA Corporation GM107M [GeForce GTX 960M] + 0.0% I2C Adapter (i2c-8): nvkm-0000:01:00.0-bus-0005 + 0.0% runtime-PNP0C14:00 + 0.0% PCI Device: Intel Corporation 100 Series/C230 Series Chipset Family HD Audio Controller + 0.0% runtime-PNP0C0C:00 + 0.0% USB device: xHCI Host Controller + 0.0% runtime-ACPI000C:00 + 0.0% runtime-regulatory.0 + 0.0% runtime-PNP0C14:01 + 0.0% runtime-vesa-framebuffer.0 + 0.0% runtime-coretemp.0 + 0.0% runtime-alarmtimer + + Exit | / Navigate | +``` + +### Tunables Stats Tab + +This tab is important area that provides suggestions to optimize your laptop battery. + +``` +PowerTOP v2.9 Overview Idle stats Frequency stats Device stats Tunables + + +>> Bad Enable SATA link power management for host2 + Bad Enable SATA link power management for host3 + Bad Enable SATA link power management for host0 + Bad Enable SATA link power management for host1 + Bad VM writeback timeout + Bad Autosuspend for USB device Lenovo Wireless Optical Mouse N100 [1-2] + Good Bluetooth device interface status + Good Enable Audio codec power management + Good NMI watchdog should be turned off + Good Runtime PM for I2C Adapter i2c-7 (nvkm-0000:01:00.0-bus-0002) + Good Autosuspend for unknown USB device 1-11 (8087:0a2b) + Good Runtime PM for I2C Adapter i2c-3 (i915 gmbus dpd) + Good Autosuspend for USB device Lenovo EasyCamera [160709000341] + Good Runtime PM for I2C Adapter i2c-1 (i915 gmbus dpc) + Good Runtime PM for I2C Adapter i2c-12 (nvkm-0000:01:00.0-bus-0009) + Good Autosuspend for USB device xHCI Host Controller [usb1] + Good Runtime PM for I2C Adapter i2c-13 (nvkm-0000:01:00.0-aux-000a) + Good Runtime PM for I2C Adapter i2c-2 (i915 gmbus dpb) + Good Runtime PM for I2C Adapter i2c-8 (nvkm-0000:01:00.0-bus-0005) + Good Runtime PM for I2C Adapter i2c-15 (nvkm-0000:01:00.0-aux-000c) + Good Runtime PM for I2C Adapter i2c-16 (nvkm-0000:01:00.0-aux-000d) + Good Runtime PM for I2C Adapter i2c-5 (nvkm-0000:01:00.0-bus-0000) + Good Runtime PM for I2C Adapter i2c-0 (SMBus I801 adapter at 6040) + Good Runtime PM for I2C Adapter i2c-11 (nvkm-0000:01:00.0-bus-0008) + Good Runtime PM for I2C Adapter i2c-14 (nvkm-0000:01:00.0-aux-000b) + Good Autosuspend for USB device xHCI Host Controller [usb2] + Good Runtime PM for I2C Adapter i2c-9 (nvkm-0000:01:00.0-bus-0006) + Good Runtime PM for I2C Adapter i2c-10 (nvkm-0000:01:00.0-bus-0007) + Good Runtime PM for I2C Adapter i2c-6 (nvkm-0000:01:00.0-bus-0001) + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family HD Audio Controller + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller + Good Runtime PM for PCI Device Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #9 + Good Runtime PM for PCI Device Intel Corporation HD Graphics 530 + Good Runtime PM for PCI Device Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #3 + Good Runtime PM for PCI Device O2 Micro, Inc. SD/MMC Card Reader Controller + Good Runtime PM for PCI Device Intel Corporation HM170 Chipset LPC/eSPI Controller + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 + Good Runtime PM for PCI Device Samsung Electronics Co Ltd NVMe SSD Controller SM951/PM951 + Good Runtime PM for PCI Device Intel Corporation HM170/QM170 Chipset SATA Controller [AHCI Mode] + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #2 + Good Runtime PM for PCI Device Intel Corporation Wireless 8260 + Good Runtime PM for PCI Device Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #4 + Good Runtime PM for PCI Device Intel Corporation 100 Series/C230 Series Chipset Family SMBus + Good Runtime PM for PCI Device NVIDIA Corporation GM107M [GeForce GTX 960M] + + Exit | Toggle tunable | Window refresh +``` + +### How To Generate PowerTop HTML Report + +Run the following command to generate the PowerTop HTML report. + +``` +$ sudo powertop --html=powertop.html +modprobe cpufreq_stats failedLoaded 100 prior measurements +Cannot load from file /var/cache/powertop/saved_parameters.powertop +File will be loaded after taking minimum number of measurement(s) with battery only +RAPL device for cpu 0 +RAPL Using PowerCap Sysfs : Domain Mask f +RAPL device for cpu 0 +RAPL Using PowerCap Sysfs : Domain Mask f +Devfreq not enabled +glob returned GLOB_ABORTED +Cannot load from file /var/cache/powertop/saved_parameters.powertop +File will be loaded after taking minimum number of measurement(s) with battery only +Preparing to take measurements +To show power estimates do 182 measurement(s) connected to battery only +Taking 1 measurement(s) for a duration of 20 second(s) each. +PowerTOP outputing using base filename powertop.html +``` + +Navigate to `file:///home/daygeek/powertop.html` file to access the generated PowerTOP HTML report. +![][9] + +### Auto-Tune mode + +This feature sets all tunable options from `BAD` to `GOOD` which increase the laptop battery life in Linux. + +``` +$ sudo powertop --auto-tune +modprobe cpufreq_stats failedLoaded 210 prior measurements +Cannot load from file /var/cache/powertop/saved_parameters.powertop +File will be loaded after taking minimum number of measurement(s) with battery only +RAPL device for cpu 0 +RAPL Using PowerCap Sysfs : Domain Mask f +RAPL device for cpu 0 +RAPL Using PowerCap Sysfs : Domain Mask f +Devfreq not enabled +glob returned GLOB_ABORTED +Cannot load from file /var/cache/powertop/saved_parameters.powertop +File will be loaded after taking minimum number of measurement(s) with battery only +To show power estimates do 72 measurement(s) connected to battery only +Leaving PowerTOP +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ + +作者:[Vinoth 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://www.2daygeek.com/author/vinoth/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/category/package-management/ +[2]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[3]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[4]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[5]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[6]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[7]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[8]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[9]: https://www.2daygeek.com/wp-content/uploads/2015/07/powertop-html-output.jpg From ede5c1de34601550ad3f9c779fc2c0676d2462f6 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:13:33 +0800 Subject: [PATCH 1042/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Watch=20YouTube?= =?UTF-8?q?=20videos=20at=20the=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ch YouTube videos at the Linux terminal.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20181222 Watch YouTube videos at the Linux terminal.md diff --git a/sources/tech/20181222 Watch YouTube videos at the Linux terminal.md b/sources/tech/20181222 Watch YouTube videos at the Linux terminal.md new file mode 100644 index 0000000000..d2ba12dbeb --- /dev/null +++ b/sources/tech/20181222 Watch YouTube videos at the Linux terminal.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Watch YouTube videos at the Linux terminal) +[#]: via: (https://opensource.com/article/18/12/linux-toy-youtube-dl) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Watch YouTube videos at the Linux terminal +====== +Thought video content was just for your GUI? Think again. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-youtube-dl.png?itok=HYR5vU2a) + +We're almost to the end of our 24-day-long Linux command-line toys advent calendar. Hopefully, you've been following along, but if not, start back at [the beginning][1] and work your way through. You'll find plenty of games, diversions, and oddities for your Linux terminal. + +And while you may have seen some toys from our calendar before, we hope there’s at least one new thing for everyone. + +Today we're going to double-down on yesterday's toy, [MPlayer][2], and add in one more, [**youtube-dl**][3]. + +As its name would imply, **youtube-dl** is a command-line utility for downloading YouTube videos, but it can capture video from a number of other sites as well, and it's a really quite full-featured application with [thorough documentation][4] to make video acquisition easy. A note: please don't use **youtube-dl** in any context that would violate the copyright laws in your jurisdiction. + +**youtube-dl** is licensed under a public domain dedication known as [the][5] [Unlicense][5] that's similar to Creative Common's [CC0][6]. There are some interesting [legal opinions][7] out there about where public domain dedication fits into the open source landscape, but it's generally considered compatible with existing open source licenses even by organizations who don't recommend its use. + +In its simplest form, we're going to use **youtube-dl** to grab a video for playback in our terminal. First, [install][8] it using a method appropriate for your distribution. For me, in Fedora, it was packaged in my repositories, so installation was as simple as: + +``` +$ sudo dnf install youtube-dl +``` + +Then, let's grab a video. YouTube allows you to search by license, so today, we're going to take a look at a fireplace [video][9] from [Gemmy's Videos][10] available under a Creative Commons attribution license. For YouTube videos, you can download with the file ID alone, like this, and we'll specify an output file name as well. I intentionally picked a short video, since long videos can get quite large! + +``` +$ youtube-dl pec8P5K4s8c -o fireplace.mp4 +``` + +If you didn't install [MPlayer][2] yesterday, go ahead and do that, and you may need to install **libcaca** for your system as well if you did not install it previously. If you just use MPlayer to launch the video from the command line as-is ( **$** **mplayer fireplace.webm** ), it will play, but in a window all of its own; not exactly what we were going for. + +First, I set my **libcaca** settings to force it to use **ncurses** **** as the display driver, keeping the output in my terminal, with: + +``` +$ export CACA_DRIVER=ncurses +``` + +Then, I zoomed way out in my terminal (the more "pixels", the better), and played the file with the following (forcing the use of **libcaca** and silencing text output from MPlayer): + +``` +$ mplayer -really-quiet -vo caca fireplace.mp4 +``` + +And, there you go! +![](https://opensource.com/sites/default/files/uploads/linux-toy-youtube-dl.gif) + +Do you have a favorite command-line toy that we should have included? It's a little late to submit a suggestion for this year, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Listen to the radio at the Linux terminal][2], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-youtube-dl + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/article/18/12/linux-toy-boxes +[2]: https://opensource.com/article/18/12/linux-toy-mplayer +[3]: https://rg3.github.io/youtube-dl/ +[4]: https://github.com/rg3/youtube-dl/blob/master/README.md#readme +[5]: https://unlicense.org/ +[6]: https://creativecommons.org/share-your-work/public-domain/cc0/ +[7]: https://opensource.org/faq#public-domain +[8]: https://github.com/rg3/youtube-dl/blob/master/README.md#installation +[9]: https://www.youtube.com/watch?v=pec8P5K4s8c +[10]: https://www.youtube.com/channel/UCwwaepmpWZVDd605MIRC20A From 064d04c6b62c113c2970bd1ace0409e68ce6e60b Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:15:07 +0800 Subject: [PATCH 1043/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20A=20Tale=20of?= =?UTF-8?q?=20HTTP/2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20181222 A Tale of HTTP-2.md | 75 +++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20181222 A Tale of HTTP-2.md diff --git a/sources/tech/20181222 A Tale of HTTP-2.md b/sources/tech/20181222 A Tale of HTTP-2.md new file mode 100644 index 0000000000..5484e67148 --- /dev/null +++ b/sources/tech/20181222 A Tale of HTTP-2.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A Tale of HTTP/2) +[#]: via: (https://veronneau.org/a-tale-of-http2.html) +[#]: author: (Louis-Philippe Véronneau https://veronneau.org/) + +A Tale of HTTP/2 +====== + +Around a month ago, someone mentioned the existence of [HTTP/2][1] in an IRC channel I lurk in. For some reason, I had never heard of it and some of the features of this new protocol (like mutiplexing requests without having to open multiple TCP connections) seemed cool. + +To be honest, I had just finished re-writing the Puppet code that manages our backup procedures and enabling HTTP/2 seemed like a productive way to procrastinate before moving on to an another large project. How hard could this be? + +Turns out it took me around 25 hours of work... Sit back and put on comfortable slippers, for this is a tale of HTTP/2! + +[![The Yule Log][2]][3] + +### Cursed Be the HTTP/1.1 + +When I first looked up how to enable HTTP/2 on Apache it seemed a pretty simple task. The documentation mentioned loading the `http2` module and making sure to prioritise the new protocol via a configuration file like this one: + +``` +Protocols h2 h2c http/1.1 + +H2Push on +H2PushPriority core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated after +H2PushPriority text/css before +H2PushPriority image/jpeg after 32 +H2PushPriority image/png after 32 +H2PushPriority application/javascript interleaved +``` + +This would of course have been too easy. Even if everything in Apache was set up properly, websites kept being served as HTTP/1.1. I was obviously doing something right though, since my websites were now sending a new HTTP header: `Upgrade: h2, h2c`. + +After wasting a good deal of time debugging TLS ciphers (HTTP/2 is [incompatible with TLS 1.1][4]), I finally found out the problem was that we weren't using the right multi-processing module for Apache. + +Turns out Apache won't let you serve HTTP/2 while using `mpm_prefork` (the default MPM), as it is not supported by `mod_http2`. Even though there are two other MPM you can use with Apache, only `mpm_prefork` supports `mod_php`. Suddenly, adding support for HTTP/2 meant switching all our webapps built in PHP to PHP-FPM... + +### Down the Rabbit Hole + +![A clip from Alice in Wonderlands][5] + +For the longest time, a close friend has been trying to convince me of the virtues of [PHP-FPM][6]. As great as it looked on paper, I never really did anything about it. It seemed so ... complicated. Regular ol' `mod_php` did the trick just fine and other things required my attention. + +This whole HTTP/2 thing turned out to be the perfect excuse for me to dive into it after all. Once I understood how FPM pools worked, it was actually pretty easy to set up. Since I had to rewrite the Puppet profiles we're using to deploy websites, also I took that opportunity to harden a bunch of things left and right. + +PHP-FPM let's you run websites under different Unix users for added separation. On top of that, I decided it was time for PHP code on our servers to be ran in read-only mode and had to tweak a bunch of things for our Wordpress, Nextcloud, KanBoard and Drupal instances to stop complaining about it. + +After too much time passed automating tasks in Puppet, I finally was able to turn off `mod_php` and `mpm_prefork` everywhere and to enable `mpm_event` and `mod_http2`. The speed bonus offered by PHP-FPM and HTTP/2 is nice, but more than anything I'm happy this whole ordeal forced me to harden the way our Apache servers deal with PHP. + +![Victory!][7] + +-------------------------------------------------------------------------------- + +via: https://veronneau.org/a-tale-of-http2.html + +作者:[Louis-Philippe Véronneau][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://veronneau.org/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/HTTP/2 +[2]: https://veronneau.org/media/blog/2018-12-22/yule_log.jpg (The Yule Log) +[3]: https://commons.wikimedia.org/wiki/File:The_Yule_Log.jpg +[4]: https://http2.github.io/http2-spec/#TLSUsage +[5]: https://veronneau.org/media/blog/2018-12-22/mod_php.gif (A clip from Alice in Wonderlands) +[6]: https://wiki.apache.org/httpd/PHP-FPM +[7]: https://veronneau.org/media/blog/2018-12-22/victory.png (Victory!) From 88f18f9a0c8618915ab90ec9db8ca5bcb2b7a521 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:18:45 +0800 Subject: [PATCH 1044/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20dete?= =?UTF-8?q?ct=20automatically=20generated=20emails?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o detect automatically generated emails.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20181222 How to detect automatically generated emails.md diff --git a/sources/tech/20181222 How to detect automatically generated emails.md b/sources/tech/20181222 How to detect automatically generated emails.md new file mode 100644 index 0000000000..23b509a77b --- /dev/null +++ b/sources/tech/20181222 How to detect automatically generated emails.md @@ -0,0 +1,144 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to detect automatically generated emails) +[#]: via: (https://arp242.net/weblog/autoreply.html) +[#]: author: (Martin Tournoij https://arp242.net/) + +How to detect automatically generated emails +====== + +### How to detect automatically generated emails + + +When you send out an auto-reply from an email system you want to take care to not send replies to automatically generated emails. At best, you will get a useless delivery failure. At words, you will get an infinite email loop and a world of chaos. + +Turns out that reliably detecting automatically generated emails is not always easy. Here are my observations based on writing a detector for this and scanning about 100,000 emails with it (extensive personal archive and company archive). + +### Auto-submitted header + +Defined in [RFC 3834][1]. + +This is the ‘official’ standard way to indicate your message is an auto-reply. You should **not** send a reply if `Auto-Submitted` is present and has a value other than `no`. + +### X-Auto-Response-Suppress header + +Defined [by Microsoft][2] + +This header is used by Microsoft Exchange, Outlook, and perhaps some other products. Many newsletters and such also set this. You should **not** send a reply if `X-Auto-Response-Suppress` contains `DR` (“Suppress delivery reports”), `AutoReply` (“Suppress auto-reply messages other than OOF notifications”), or `All`. + +### List-Id and List-Unsubscribe headers + +Defined in [RFC 2919][3] + +You usually don’t want to send auto-replies to mailing lists or news letters. Pretty much all mail lists and most newsletters set at least one of these headers. You should **not** send a reply if either of these headers is present. The value is unimportant. + +### Feedback-ID header + +Defined [by Google][4]. + +Gmail uses this header to identify mail newsletters, and uses it to generate statistics/reports for owners of those newsletters. You should **not** send a reply if this headers is present; the value is unimportant. + +### Non-standard ways + +The above methods are well-defined and clear (even though some are non-standard). Unfortunately some email systems do not use any of them :-( Here are some additional measures. + +#### Precedence header + +Not really defined anywhere, mentioned in [RFC 2076][5] where its use is discouraged (but this header is commonly encountered). + +Note that checking for the existence of this field is not recommended, as some ails use `normal` and some other (obscure) values (this is not very common though). + +My recommendation is to **not** send a reply if the value case-insensitively matches `bulk`, `auto_reply`, or `list`. + +#### Other obscure headers + +A collection of other (somewhat obscure) headers I’ve encountered. I would recommend **not** sending an auto-reply if one of these is set. Most mails also set one of the above headers, but some don’t (but it’s not very common). + + * `X-MSFBL`; can’t really find a definition (Microsoft header?), but I only have auto-generated mails with this header. + + * `X-Loop`; not really defined anywhere, and somewhat rare, but sometimes it’s set. It’s most often set to the address that should not get emails, but `X-Loop: yes` is also encountered. + + * `X-Autoreply`; fairly rare, and always seems to have a value of `yes`. + + + + +#### Email address + +Check if the `From` or `Reply-To` headers contains `noreply`, `no-reply`, or `no_reply` (regex: `^no.?reply@`). + +#### HTML only + +If an email only has a HTML part, but no text part it’s a good indication this is an auto-generated mail or newsletter. Pretty much all mail clients also set a text part. + +#### Delivery failures + +Many delivery failure messages don’t really indicate that they’re failures. Some ways to check this: + + * `From` contains `mailer-daemon` or `Mail Delivery Subsystem` + + + +Many mail libraries leave some sort of footprint, and most regular mail clients override this with their own data. Checking for this seems to work fairly well. + + * `X-Mailer: Microsoft CDO for Windows 2000` – Set by some MS software; I can only find it on autogenerated mails. Yes, it’s still used in 2015. + + * `Message-ID` header contains `.JavaMail.` – I’ve found a few (5 on 50k) regular messages with this, but not many; the vast majority (thousends) of messages are news-letters, order confirmations, etc. + + * `^X-Mailer` starts with `PHP`. This should catch both `X-Mailer: PHP/5.5.0` and `X-Mailer: PHPmailer blah blah`. The same as `JavaMail` applies. + + * `X-Library` presence; only [Indy][6] seems to set this. + + * `X-Mailer` starts with `wdcollect`. Set by some Plesk mails. + + * `X-Mailer` starts with `MIME-tools`. + + + + +### Final precaution: limit the number of replies + +Even when following all of the above advice, you may still encounter an email program that will slip through. This can very dangerous, as email systems that simply `IF email THEN send_email` have the potential to cause infinite email loops. + +For this reason, I recommend keeping track of which emails you’ve sent an autoreply to and rate limiting this to at most n emails in n minutes. This will break the back-and-forth chain. + +We use one email per five minutes, but something less strict will probably also work well. + +### What you need to set on your auto-response + +The specifics for this will vary depending on what sort of mails you’re sending. This is what we use for auto-reply mails: + +``` +Auto-Submitted: auto-replied +X-Auto-Response-Suppress: All +Precedence: auto_reply +``` + +### Feedback + +You can mail me at [martin@arp242.net][7] or [create a GitHub issue][8] for feedback, questions, etc. + +-------------------------------------------------------------------------------- + +via: https://arp242.net/weblog/autoreply.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]: http://tools.ietf.org/html/rfc3834 +[2]: https://msdn.microsoft.com/en-us/library/ee219609(v=EXCHG.80).aspx +[3]: https://tools.ietf.org/html/rfc2919) +[4]: https://support.google.com/mail/answer/6254652?hl=en +[5]: http://www.faqs.org/rfcs/rfc2076.html +[6]: http://www.indyproject.org/index.en.aspx +[7]: mailto:martin@arp242.net +[8]: https://github.com/Carpetsmoker/arp242.net/issues/new From a5904dada661270b96bb72413f35cac575a936a8 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:24:25 +0800 Subject: [PATCH 1045/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Top=2011=20best?= =?UTF-8?q?=20Image=20Viewer=20for=20Ubuntu=20and=20other=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Image Viewer for Ubuntu and other Linux.md | 344 ++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md diff --git a/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md b/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md new file mode 100644 index 0000000000..5aea9702e7 --- /dev/null +++ b/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md @@ -0,0 +1,344 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 11 best Image Viewer for Ubuntu and other Linux) +[#]: via: (https://itsfoss.com/image-viewers-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Top 11 best Image Viewer for Ubuntu and other Linux +====== + +It is probably a good idea to stick with the default system image viewer unless you want a specific feature (that’s missing) or if you crave for better user experience. + +However, if you like to experiment, you may try out different image viewers. You could end up loving the new user experience of viewing the images or get hooked on to the extra features offered. + +In this article, we have mentioned every kind of image viewers ranging from the simplest to the most advanced tool available for Ubuntu or any other Linux distro. + +### Best Image Viewers for Linux + +![Best image viewers for Ubuntu and other Linux distributions][1] + +**Note:** You should be able to find these image viewers listed in your software center or AppCenter. If you don’t find it there, we’ve mentioned the instructions for manual installation as well. + +#### 1. Nomacs + +![nomacs image viewer][2] + +**What’s good about it?** + + * Simple & Fast UI + * Image adjustment tools (color & size) + * Geolocation of the image + * Metadata information panel + * LAN Synchronization + * Fullscreen mode + + + +A free and open source image viewer that does not come baked with any fancy features. However, Nomacs does support most of the common image file formats if you want to use it. + +The user interface is very simple but it does offer some essential features for image adjustment (color, brightness, resize, crop, & cut). In addition to that, it also supports fullscreen mode, histogram, and a lot of different panels that you can toggle for metadata, edit history, and more such information. + +**How do I install it?** + +You can find it listed in the software center/AppCenter for easy installation. If you want to install it via terminal, you can take a look at their [GitHub page][3] or type in the command below: + +``` +sudo apt install nomacs +``` + +#### 2. Eye Of Gnome +![eye of gnome][4] + +**What’s good about it?** + + * A dead simple image viewer + * Slideshow style (if that’s what you like) + * An image viewer tailored for GNOME desktop environment + + + +This is a classic image viewer developed as a part of The GNOME Project a lot of years ago. Do note that this isn’t actively maintained anymore. But, it still works on Ubuntu’s latest LTS release and several other Linux distros. + +If you want a dead simple image viewer where you browse through the images in a slideshow-type UI and get the meta info in the sidebar, Eye of GNOME should be your choice. One of the best for GNOME desktop environment! + +**How do I install it?** + +To manually install it on Ubuntu (or Ubuntu-based Linux distros) type in the following command: + +``` +sudo apt install eog +``` + +For other distros and source, you should follow the [GitHub page.][5] + +#### 3. Eye Of MATE Image Viewer + +![eye of mate image viewer][6] + +**What’s good about it?** + + * A simple image viewer + * Plugins supported + * An image viewer tailored for MATE desktop environment + + + +Yet another simple image viewer with the basic functionalities of slideshow view and rotating images. + +Even if doesn’t support any image manipulation feature, it does support numerous image file formats and can handle big image files. + +**How do I install it?** + +For Ubuntu/Ubuntu-based distros, type in the following command: + +``` +sudo apt install eom +``` + +If you need help for other distros and the source, follow their [GitHub page][7]. + +#### 4. Geeqie +![geeqie image viewer][8] + +**What’s good about it?** + + * A flexible image manager that supports plugins (you’ll find other image viewers supported as well) + * Information about the color profile + + + +Geeqie is an impressive image manager and viewer. It supports other image viewers as plugins but does not offer any image manipulation tools. + +If you need to know the color profile, image info, and manage/view a collection of images. It should be a good choice for that. + +**How do I install it?** + +Type in the terminal: + +``` +sudo apt install geeqie +``` + +For the source, you can refer the [GitHub page][9]. + +#### 5. gThumb Image Viewer + +![gthumb image viewer][10] + +**What’s good about it?** + + * An all-in-one image viewer with the ability to manage, edit and view the images + * Reset EXIF orientation + * Convert image formats + * Find duplicate images + + + +gThumb is an amazing image viewer with a lot of features. You get an impressive user interface to view/manage your images along with the basic image manipulation tools (crop, resize, color, and so on.) + +You can also add comments to an image or reset the EXIF orientation info. It also gives you the ability to find duplicate images and convert image formats. + +**How do I install it?** + +You can enter this command in the terminal: + +``` +sudo apt install gthumb +``` + +If that doesn’t work, head to the [GitHub page][11] for more info. + +#### 6. Gwenview +![gwenview image viewer][12] + +**What’s good about it?** + + * A basic image viewer with common image manipulation tools to rotate and resize + * Feature extension using KIPI plugins + + + +Gwenview is just another basic image viewer tailored for KDE desktop environment. However, you can install it on other desktop environments as well. + +If you utilize the Konqueror web browser, you can use it as an embedded image viewer. Here, you can add comments/description to the image as well. In addition, it supports [KIPI][13] plugins. + +**How do I install it?** + +Type the following in the terminal to install it: + +``` +sudo apt install gwenview +``` + +For the source, check out their [GitHub page][14]. + +#### 7. Mirage + +![mirage image viewer][15] + +**What’s good about it?** + + * Customizable interface even it is a basic UI + * Basic image manipulation tools + * Command-line access + + + +If you want a decent image viewer along with the ability to access it via command line, a fullscreen mode, slideshow mode, basic editing tools to resize/crop/rotate/flip, and a configurable interface – Mirage would be the simplest option. + +It is a very fast and capable image viewer that supports a lot of image formats that include png, jpg, svg, xpm, gif, bmp, and tifff. + +**How do I install it?** + +You need to type in the following: + +``` +sudo apt install mirage +``` + +For the source code and other installation instructions, refer the [GitHub page][16]. + +#### 8. KPhotoAlbum +![][17] + +**What’s good about it?** + + * Perfect image manager to tag and manage the pictures + * Demo databases + * Image compression + * Merge/Remove images to/from Stack + + + +KPhotoAlbum is not exactly a dedicated image viewer but a photo manager to tag and manage the pictures you’ve got. + +You can opt for slideshows to view the image along with the ability to compress images and search them using the labels/tags. + +**How do I install it?** + +You can install it via the terminal by typing in: + +``` +sudo apt kphotoalbum +``` + +In either case, you can check for the [official instructions on their website][18] to get it installed on your Linux distro. + +#### 9. Shotwell + +![shotwell][19] + +**What’s good about it?** + + * Red-eye correction tool + * Upload photos to Facebook, Flickr, etc. + * Supports RAW file formats as well + + + +Shotwell is a feature-rich photo manager. You can view and manage your photos. Although you do not get all the basic image manipulation tools baked in it – you can easily crop and enhance your photos in a single click (auto brightness/contrast adjustments). + +**How do I install it?** + +Go to the terminal and enter the following (Ubuntu/Ubuntu-based distros): + +sudo apt install shotwell + +For more information, check out their [GitHub page][20]. + +#### 10. Ristretto + +![ristretto][21] + +**What’s good about it?** + + * A dead simple image viewer + * Fullscreen mode & Slideshow + + + +A very straightforward image viewer where you just get the ability to zoom, view in fullscreen mode and view the images as a slideshow. + +It is tailored for Xfce desktop environment – but you can install it anywhere. + +**How do I install it?** + +Even though it’s built for Xfce desktop environment, you can install it on any Ubuntu/Ubuntu-based distro by typing the following command in the terminal: + +``` +sudo apt install ristretto +``` +#### 11. digiKam + +![digikam image viewer][22] + +**What’s good about it?** + + * An all-in-one image viewer with advanced photo management features (editing/managing/viewing) + * Batch Queue Manager + * [Light Table][23] + + + +digiKam is an advanced photo manager with some additional image manipulation tools. You get the ability to configure the database using SQLite or MySQL. + +To enhance your experience of viewing images, it lets you choose the reduced version of images while you preview them. So, that becomes super fast even if you have a lot of images. You get several import/export options via Google, Facebook, Imgur, and so on. If you want a feature-rich image viewer, this is the one you should have installed. + +**How do I install it?** + +Type in the following command: + +``` +sudo apt install digikam +``` + +For more information, visit their [GitHub page][24]. + +### Wrapping Up + +So, no matter whether you want a different user experience or a rich set of features and powerful tools to manage your photos – there’s something everyone. + +Which image viewer do you prefer to use? Is it the system’s default viewer? + +Let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/image-viewers-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/best-image-viewers-linux.png?resize=800%2C450&ssl=1 +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/nomacs-image-viewer.jpg?resize=800%2C455&ssl=1 +[3]: https://github.com/nomacs/nomacs +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/eye-of-gnome-image-viewer.jpg?resize=800%2C470&ssl=1 +[5]: https://github.com/GNOME/eog +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/eye-of-mate-image-viewer.jpg?resize=800%2C464&ssl=1 +[7]: https://github.com/mate-desktop/eom +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/geeqie-image-viewer.jpg?resize=800%2C444&ssl=1 +[9]: https://github.com/BestImageViewer/geeqie +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/gthumb-image-viewer.jpg?resize=800%2C515&ssl=1 +[11]: https://github.com/GNOME/gthumb +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/gwenview-image-viewer.jpg?resize=800%2C517&ssl=1 +[13]: https://en.wikipedia.org/wiki/KDE_Image_Plugin_Interface +[14]: https://github.com/KDE/gwenview +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/mirage-image-viewer.jpg?resize=800%2C475&ssl=1 +[16]: https://github.com/xiongchiamiov/Mirage +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/kphotoalbum-viewer.jpg?fit=800%2C522&ssl=1 +[18]: https://www.kphotoalbum.org/download/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/shotwell-image-viewer.jpg?resize=800%2C473&ssl=1 +[20]: https://github.com/GNOME/shotwell +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/ristretto-image-viewer.jpg?resize=800%2C437&ssl=1 +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/digitkam-image-viewer.jpg?resize=800%2C550&ssl=1 +[23]: https://docs.kde.org/trunk5/en/extragear-graphics/digikam/using-lighttable.html +[24]: https://github.com/KDE/digikam From 4a8a185e089337c534547e94d6146f02cfa90697 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:28:03 +0800 Subject: [PATCH 1046/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Large=20files?= =?UTF-8?q?=20with=20Git:=20LFS=20and=20git-annex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Large files with Git- LFS and git-annex.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20181221 Large files with Git- LFS and git-annex.md diff --git a/sources/tech/20181221 Large files with Git- LFS and git-annex.md b/sources/tech/20181221 Large files with Git- LFS and git-annex.md new file mode 100644 index 0000000000..29a76f810f --- /dev/null +++ b/sources/tech/20181221 Large files with Git- LFS and git-annex.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Large files with Git: LFS and git-annex) +[#]: via: (https://anarc.at/blog/2018-12-21-large-files-with-git/) +[#]: author: (Anarc.at https://anarc.at/) + +Large files with Git: LFS and git-annex +====== + +Git does not handle large files very well. While there is work underway to handle large repositories through the [commit graph work][2], Git's internal design has remained surprisingly constant throughout its history, which means that storing large files into Git comes with a significant and, ultimately, prohibitive performance cost. Thankfully, other projects are helping Git address this challenge. This article compares how Git LFS and git-annex address this problem and should help readers pick the right solution for their needs. + +### The problem with large files + +As readers probably know, Linus Torvalds wrote Git to manage the history of the kernel source code, which is a large collection of small files. Every file is a "blob" in Git's object store, addressed by its cryptographic hash. A new version of that file will store a new blob in Git's history, with no deduplication between the two versions. The pack file format can store binary deltas between similar objects, but if many objects of similar size change in a repository, that algorithm might fail to properly deduplicate. In practice, large binary files (say JPEG images) have an irritating tendency of changing completely when even the smallest change is made, which makes delta compression useless. + +There have been different attempts at fixing this in the past. In 2006, Torvalds worked on [improving the pack-file format][3] to reduce object duplication between the index and the pack files. Those changes were eventually reverted because, as Nicolas Pitre [put it][4]: "that extra loose object format doesn't appear to be worth it anymore". + +Then in 2009, [Caca Labs][5] worked on improving the `fast-import` and `pack-objects` Git commands to do special handling for big files, in an effort called [git-bigfiles][6]. Some of those changes eventually made it into Git: for example, since [1.7.6][7], Git will stream large files directly to a pack file instead of holding them all in memory. But files are still kept forever in the history. + +An example of trouble I had to deal with is for the Debian security tracker, which follows all security issues in the entire Debian history in a single file. That file is around 360,000 lines for a whopping 18MB. The resulting repository takes 1.6GB of disk space and a local clone takes 21 minutes to perform, mostly taken up by Git resolving deltas. Commit, push, and pull are noticeably slower than a regular repository, taking anywhere from a few seconds to a minute depending one how old the local copy is. And running annotate on that large file can take up to ten minutes. So even though that is a simple text file, it's grown large enough to cause significant problems for Git, which is otherwise known for stellar performance. + +Intuitively, the problem is that Git needs to copy files into its object store to track them. Third-party projects therefore typically solve the large-files problem by taking files out of Git. In 2009, Git evangelist Scott Chacon released [GitMedia][8], which is a Git filter that simply takes large files out of Git. Unfortunately, there hasn't been an official release since then and it's [unclear][9] if the project is still maintained. The next effort to come up was [git-fat][10], first released in 2012 and still maintained. But neither tool has seen massive adoption yet. If I would have to venture a guess, it might be because both require manual configuration. Both also require a custom server (rsync for git-fat; S3, SCP, Atmos, or WebDAV for GitMedia) which limits collaboration since users need access to another service. + +### Git LFS + +That was before GitHub [released][11] Git Large File Storage (LFS) in August 2015. Like all software taking files out of Git, LFS tracks file hashes instead of file contents. So instead of adding large files into Git directly, LFS adds a pointer file to the Git repository, which looks like this: + +``` +version https://git-lfs.github.com/spec/v1 +oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 +size 12345 +``` + +LFS then uses Git's smudge and clean filters to show the real file on checkout. Git only stores that small text file and does so efficiently. The downside, of course, is that large files are not version controlled: only the latest version of a file is kept in the repository. + +Git LFS can be used in any repository by installing the right hooks with `git lfs install` then asking LFS to track any given file with `git lfs track`. This will add the file to the `.gitattributes` file which will make Git run the proper LFS filters. It's also possible to add patterns to the `.gitattributes` file, of course. For example, this will make sure Git LFS will track MP3 and ZIP files: + +``` +$ cat .gitattributes +*.mp3 filter=lfs -text +*.zip filter=lfs -text +``` + +After this configuration, we use Git normally: `git add`, `git commit`, and so on will talk to Git LFS transparently. + +The actual files tracked by LFS are copied to a path like `.git/lfs/objects/{OID-PATH}`, where `{OID-PATH}` is a sharded file path of the form `OID[0:2]/OID[2:4]/OID` and where `OID` is the content's hash (currently SHA-256) of the file. This brings the extra feature that multiple copies of the same file in the same repository are automatically deduplicated, although in practice this rarely occurs. + +Git LFS will copy large files to that internal storage on `git add`. When a file is modified in the repository, Git notices, the new version is copied to the internal storage, and the pointer file is updated. The old version is left dangling until the repository is pruned. + +This process only works for new files you are importing into Git, however. If a Git repository already has large files in its history, LFS can fortunately "fix" repositories by retroactively rewriting history with [git lfs migrate][12]. This has all the normal downsides of rewriting history, however --- existing clones will have to be reset to benefit from the cleanup. + +LFS also supports [file locking][13], which allows users to claim a lock on a file, making it read-only everywhere except in the locking repository. This allows users to signal others that they are working on an LFS file. Those locks are purely advisory, however, as users can remove other user's locks by using the `--force` flag. LFS can also [prune][14] old or unreferenced files. + +The main [limitation][15] of LFS is that it's bound to a single upstream: large files are usually stored in the same location as the central Git repository. If it is hosted on GitHub, this means a default quota of 1GB storage and bandwidth, but you can purchase additional "packs" to expand both of those quotas. GitHub also limits the size of individual files to 2GB. This [upset][16] some users surprised by the bandwidth fees, which were previously hidden in GitHub's cost structure. + +While the actual server-side implementation used by GitHub is closed source, there is a [test server][17] provided as an example implementation. Other Git hosting platforms have also [implemented][18] support for the LFS [API][19], including GitLab, Gitea, and BitBucket; that level of adoption is something that git-fat and GitMedia never achieved. LFS does support hosting large files on a server other than the central one --- a project could run its own LFS server, for example --- but this will involve a different set of credentials, bringing back the difficult user onboarding that affected git-fat and GitMedia. + +Another limitation is that LFS only supports pushing and pulling files over HTTP(S) --- no SSH transfers. LFS uses some [tricks][20] to bypass HTTP basic authentication, fortunately. This also might change in the future as there are proposals to add [SSH support][21], resumable uploads through the [tus.io protocol][22], and other [custom transfer protocols][23]. + +Finally, LFS can be slow. Every file added to LFS takes up double the space on the local filesystem as it is copied to the `.git/lfs/objects` storage. The smudge/clean interface is also slow: it works as a pipe, but buffers the file contents in memory each time, which can be prohibitive with files larger than available memory. + +### git-annex + +The other main player in large file support for Git is git-annex. We [covered the project][24] back in 2010, shortly after its first release, but it's certainly worth discussing what has changed in the eight years since Joey Hess launched the project. + +Like Git LFS, git-annex takes large files out of Git's history. The way it handles this is by storing a symbolic link to the file in `.git/annex`. We should probably credit Hess for this innovation, since the Git LFS storage layout is obviously inspired by git-annex. The original design of git-annex introduced all sorts of problems however, especially on filesystems lacking symbolic-link support. So Hess has implemented different solutions to this problem. Originally, when git-annex detected such a "crippled" filesystem, it switched to [direct mode][25], which kept files directly in the work tree, while internally committing the symbolic links into the Git repository. This design turned out to be a little confusing to users, including myself; I have managed to shoot myself in the foot more than once using this system. + +Since then, git-annex has adopted a different v7 mode that is also based on smudge/clean filters, which it called "[unlocked files][26]". Like Git LFS, unlocked files will double disk space usage by default. However it is possible to reduce disk space usage by using "thin mode" which uses hard links between the internal git-annex disk storage and the work tree. The downside is, of course, that changes are immediately performed on files, which means previous file versions are automatically discarded. This can lead to data loss if users are not careful. + +Furthermore, git-annex in v7 mode suffers from some of the performance problems affecting Git LFS, because both use the smudge/clean filters. Hess actually has [ideas][27] on how the smudge/clean interface could be improved. He proposes changing Git so that it stops buffering entire files into memory, allows filters to access the work tree directly, and adds the hooks he found missing (for `stash`, `reset`, and `cherry-pick`). Git-annex already implements some tricks to work around those problems itself but it would be better for those to be implemented in Git natively. + +Being more distributed by design, git-annex does not have the same "locking" semantics as LFS. Locking a file in git-annex means protecting it from changes, so files need to actually be in the "unlocked" state to be editable, which might be counter-intuitive to new users. In general, git-annex has some of those unusual quirks and interfaces that often come with more powerful software. + +And git-annex is much more powerful: it not only addresses the "large-files problem" but goes much further. For example, it supports "partial checkouts" --- downloading only some of the large files. I find that especially useful to manage my video, music, and photo collections, as those are too large to fit on my mobile devices. Git-annex also has support for location tracking, where it knows how many copies of a file exist and where, which is useful for archival purposes. And while Git LFS is only starting to look at transfer protocols other than HTTP, git-annex already supports a [large number][28] through a [special remote protocol][29] that is fairly easy to implement. + +"Large files" is therefore only scratching the surface of what git-annex can do: I have used it to build an [archival system for remote native communities in northern Québec][30], while others have built a [similar system in Brazil][31]. It's also used by the scientific community in projects like [GIN][32] and [DataLad][33], which manage terabytes of data. Another example is the [Japanese American Legacy Project][34] which manages "upwards of 100 terabytes of collections, transporting them from small cultural heritage sites on USB drives". + +Unfortunately, git-annex is not well supported by hosting providers. GitLab [used to support it][35], but since it implemented Git LFS, it [dropped support for git-annex][36], saying it was a "burden to support". Fortunately, thanks to git-annex's flexibility, it may eventually be possible to treat [LFS servers as just another remote][37] which would make git-annex capable of storing files on those servers again. + +### Conclusion + +Git LFS and git-annex are both mature and well maintained programs that deal efficiently with large files in Git. LFS is easier to use and is well supported by major Git hosting providers, but it's less flexible than git-annex. + +Git-annex, in comparison, allows you to store your content anywhere and espouses Git's distributed nature more faithfully. It also uses all sorts of tricks to save disk space and improve performance, so it should generally be faster than Git LFS. Learning git-annex, however, feels like learning Git: you always feel you are not quite there and you can always learn more. It's a double-edged sword and can feel empowering for some users and terrifyingly hard for others. Where you stand on the "power-user" scale, along with project-specific requirements will ultimately determine which solution is the right one for you. + +Ironically, after thorough evaluation of large-file solutions for the Debian security tracker, I ended up proposing to rewrite history and [split the file by year][38] which improved all performance markers by at least an order of magnitude. As it turns out, keeping history is critical for the security team so any solution that moves large files outside of the Git repository is not acceptable to them. Therefore, before adding large files into Git, you might want to think about organizing your content correctly first. But if large files are unavoidable, the Git LFS and git-annex projects allow users to keep using most of their current workflow. + +> This article [first appeared][39] in the [Linux Weekly News][40]. + +-------------------------------------------------------------------------------- + +via: https://anarc.at/blog/2018-12-21-large-files-with-git/ + +作者:[Anarc.at][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://anarc.at/ +[b]: https://github.com/lujun9972 +[1]: https://anarc.at/blog/ +[2]: https://github.com/git/git/blob/master/Documentation/technical/commit-graph.txt +[3]: https://public-inbox.org/git/Pine.LNX.4.64.0607111010320.5623@g5.osdl.org/ +[4]: https://public-inbox.org/git/alpine.LFD.0.99.0705091422130.24220@xanadu.home/ +[5]: http://caca.zoy.org/ +[6]: http://caca.zoy.org/wiki/git-bigfiles +[7]: https://public-inbox.org/git/7v8vsnz2nc.fsf@alter.siamese.dyndns.org/ +[8]: https://github.com/alebedev/git-media +[9]: https://github.com/alebedev/git-media/issues/15 +[10]: https://github.com/jedbrown/git-fat +[11]: https://blog.github.com/2015-04-08-announcing-git-large-file-storage-lfs/ +[12]: https://github.com/git-lfs/git-lfs/blob/master/docs/man/git-lfs-migrate.1.ronn +[13]: https://github.com/git-lfs/git-lfs/wiki/File-Locking +[14]: https://github.com/git-lfs/git-lfs/blob/master/docs/man/git-lfs-prune.1.ronn +[15]: https://github.com/git-lfs/git-lfs/wiki/Limitations +[16]: https://medium.com/@megastep/github-s-large-file-storage-is-no-panacea-for-open-source-quite-the-opposite-12c0e16a9a91 +[17]: https://github.com/git-lfs/lfs-test-server +[18]: https://github.com/git-lfs/git-lfs/wiki/Implementations%0A +[19]: https://github.com/git-lfs/git-lfs/tree/master/docs/api +[20]: https://github.com/git-lfs/git-lfs/blob/master/docs/api/authentication.md +[21]: https://github.com/git-lfs/git-lfs/blob/master/docs/proposals/ssh_adapter.md +[22]: https://tus.io/ +[23]: https://github.com/git-lfs/git-lfs/blob/master/docs/custom-transfers.md +[24]: https://lwn.net/Articles/419241/ +[25]: http://git-annex.branchable.com/direct_mode/ +[26]: https://git-annex.branchable.com/tips/unlocked_files/ +[27]: http://git-annex.branchable.com/todo/git_smudge_clean_interface_suboptiomal/ +[28]: http://git-annex.branchable.com/special_remotes/ +[29]: http://git-annex.branchable.com/special_remotes/external/ +[30]: http://isuma-media-players.readthedocs.org/en/latest/index.html +[31]: https://github.com/RedeMocambos/baobaxia +[32]: https://web.gin.g-node.org/ +[33]: https://www.datalad.org/ +[34]: http://www.densho.org/ +[35]: https://docs.gitlab.com/ee/workflow/git_annex.html +[36]: https://gitlab.com/gitlab-org/gitlab-ee/issues/1648 +[37]: https://git-annex.branchable.com/todo/LFS_API_support/ +[38]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908678#52 +[39]: https://lwn.net/Articles/774125/ +[40]: http://lwn.net/ From 3051b5772bb5aef0b5a6cb4bcce8db27adc7d725 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:29:18 +0800 Subject: [PATCH 1047/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Listen=20to=20t?= =?UTF-8?q?he=20radio=20at=20the=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sten to the radio at the Linux terminal.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/tech/20181221 Listen to the radio at the Linux terminal.md diff --git a/sources/tech/20181221 Listen to the radio at the Linux terminal.md b/sources/tech/20181221 Listen to the radio at the Linux terminal.md new file mode 100644 index 0000000000..268ba37568 --- /dev/null +++ b/sources/tech/20181221 Listen to the radio at the Linux terminal.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Listen to the radio at the Linux terminal) +[#]: via: (https://opensource.com/article/18/12/linux-toy-mplayer) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Listen to the radio at the Linux terminal +====== +MPlayer is an extremely versatile open source media player that can be surprisingly useful at the Linux command line. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-mplayer.png?itok=6iTm3Xi7) + +You've found your way to our 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. It could be a game or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +There are many ways to listen to music at the command line; if you've got media stored locally, **cmus** is a great option, but there are [plenty of others][1] as well. + +Lots of times when I'm at the terminal, though, I'd really rather just zone out and not pay close attention to picking each song, and let someone else do the work. While I've got plenty of playlists that work for just such a purpose, after a while, even though go stale, and I'll switch over to an internet radio station. + +Today's toy, MPlayer, is a versatile multimedia player that will support just about any media format you throw at it. If MPlayer is not already installed, you can probably find it packaged for your distribution. On Fedora, I found it in [RPM Fusion][2] (be aware that this is not an "official" repository for Fedora, so exercise caution): + +``` +$ sudo dnf install mplayer +``` + +MPlayer has a slew of command-line options to set depending on your situation. I wanted to listen to the local college radio station here in Raleigh ([88.1 WKNC,][3] they're pretty good!), and so after grabbing the streaming URL from their website, all that took to get my radio up and running, no GUI or web player needed, was: + +``` +$ mplayer -nocache -afm ffmpeg http://wknc.sma.ncsu.edu:8000/wknchd1.mp3 +``` + +MPlayer is open source under the GPLv3, and you can find out more about the project and download source code from the project's [website][4]. + +As I mentioned in yesterday's article, I'm trying to use a screenshot of each toy as the lead image for each article, but as we moved into the world of audio, I had to fudge it a little. So today's image was created from a public domain icon of a radio tower using **img2txt** , which is provided by the **libcaca** package. + +Do you have a favorite command-line toy that you we should have included? Our calendar is basically set for the remainder of the series, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Let you Linux terminal speak its mind][5], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-mplayer + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/life/16/8/3-command-line-music-players-linux +[2]: https://rpmfusion.org/ +[3]: https://wknc.org/index.php +[4]: http://www.mplayerhq.hu/ +[5]: https://opensource.com/article/18/12/linux-toy-espeak From 0d058dbd84f57bb0cae635a3861a1557e97f9341 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:34:17 +0800 Subject: [PATCH 1048/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20An=20Easy=20Way?= =?UTF-8?q?=20To=20Remove=20Programs=20Installed=20From=20Source=20In=20Li?= =?UTF-8?q?nux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Programs Installed From Source In Linux.md | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 sources/tech/20181221 An Easy Way To Remove Programs Installed From Source In Linux.md diff --git a/sources/tech/20181221 An Easy Way To Remove Programs Installed From Source In Linux.md b/sources/tech/20181221 An Easy Way To Remove Programs Installed From Source In Linux.md new file mode 100644 index 0000000000..7e3378b4e3 --- /dev/null +++ b/sources/tech/20181221 An Easy Way To Remove Programs Installed From Source In Linux.md @@ -0,0 +1,200 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An Easy Way To Remove Programs Installed From Source In Linux) +[#]: via: (https://www.ostechnix.com/an-easy-way-to-remove-programs-installed-from-source-in-linux/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +An Easy Way To Remove Programs Installed From Source In Linux +====== + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/stow-1-720x340.jpg) + +Not all programs available in the official or third-party repositories, so you can’t install them using the regular package managers. Some times, you have to install the programs by manually compiling from source. As you may already know, when you install programs from source, the package files will be copied to multiple locations, such as **/usr/local/bin** , **/usr/local/etc/** , on the filesystem. If the installed program from source doesn’t have a built-in uninstaller, it is going to be a tedious task to remove the packages when you don’t need it anymore. You may need to spend couple (or several) minutes to find those package files and remove them manually. This is what I have been doing up until I stumbled upon a utility named **“GNU Stow”**. Thankfully, Stow has a fantastic way to easily manage programs installed from source. + +To quote the official website, + +> **GNU Stow is a symlink farm manager which takes distinct packages of software and/or data located in separate directories on the filesystem, and makes them appear to be installed in the same place.** + +To put this simply, Stow helps you to keep the package files organized in a way to easily manageable. In this method, the files will not be copied to multiple locations. Instead, all files are saved in a specific folder, usually under the program name itself, and Stow creates symbolic links to all the programs’ files into the appropriate places. For example, **/usr/local/bin** could contain symlinks to files within **/usr/local/stow/vim/bin** , **/usr/local/stow/python/bin** etc., and likewise recursively for any other subdirectories such as **…/share** , **…/man** , and so on. In this tutorial, I will show you how to easily manage programs installed from source using Stow with a practical example. Read on. + +### Installing GNU Stow + +GNU Stow is available in the default repositories of popular Linux operating systems. + +On **Arch Linux** and its variants, run the following command to install Stow. + +``` +$ sudo pacman -S stow +``` + +On **Debian** , **Ubuntu** , **Linux Mint** : + +``` +$ sudo apt install stow +``` + +On **Fedora** : + +``` +$ sudo dnf install stow +``` + +On **RHEL/CentOS** : + +``` +$ sudo yum install epel-release + +$ sudo yum install stow +``` + +### Easily Remove Programs Installed From Source In Linux + +As I already mentioned earlier, all program files of a package will be saved in a root folder located in **/usr/local/stow/**. Under this root or parent directory, each package will be saved in its own private sub-directory. For example, if we install Vim editor from source, all program files and directories related to Vim will be saved under **/usr/local/stow/vim** folder. If you install python from source, all files related to python will be kept under **/usr/local/stow/python** and so on. + +Let me install a program, for example **hello** , from source. + +First download the ‘hello’ program’s tarball. + +``` +$ wget http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz +``` + +Extract the downloaded tarball using command: + +``` +$ tar -zxvf hello-2.10.tar.gz +``` + +The above command will create a directory named ‘hello-2.10’ in the current working directory and extract all contents in it. + +Switch to the extracted directory: + +``` +$ cd hello-2.10/ +``` + +Run the following command with –prefix option. + +``` +$ ./configure --prefix=/usr/local/stow/hello +``` + +The above command will save the build files in the specified location i.e **/usr/local/stow/hello** in our case. + +Finally, build and install the hello program using the following commands: + +``` +$ make + +$ sudo make install +``` + +That’s it. The hello program has been installed in **/usr/local/stow/hello/** location. You can verify it with ‘ls’ command as shown below. + +``` +$ ls /usr/local/stow/hello/ +bin share +``` + +Finally, go to the **/usr/local/stow/** directory and run the following command to generate the necessary symlinks. + +``` +$ cd /usr/local/stow/ + +$ sudo stow hello +``` + +All done! + +What just happened is all the files and directories contained in the hello package have been symlinked to the directory **/usr/local/**. In other words, **/usr/local/stow/hello/bin** has been symlinked to **/usr/local/bin** and **/usr/local/stow/hello/share** has been symlinked to **/usr/local/share** and **/usr/local/stow/hello/share/man** has been symlinked to **/usr/local/share/man** and so on. + +You can verify them using ‘ls’ command: + +``` +$ ls /usr/local/bin/ +hello +``` + +Let us check if the hello program is working or not using command: + +``` +$ hello +Hello, world! +``` + +Yeah, it is working!! + +Similarly, you can install programs as described above under its own sub-directory. + +Here is the contents of the Stow root directory: + +``` +$ tree /usr/local/stow/ +``` + +![][2] + +See? The hello program is installed /usr/local/stow/hello/ location. Like wise, all packages will be kept under their own directory. + +Here comes the main part. Let us remove the hello program. To do so, go to **/usr/local/stow/** directory: + +``` +$ cd /usr/local/stow/ +``` + +..and run the following command: + +``` +$ sudo stow --delete hello +``` + +The hello program has just been removed. You can verify if it is really removed using command: + +``` +$ hello +-bash: /usr/local/bin/hello: No such file or directory +``` + +![][3] + +See? Hello program is removed! + +Please note that Stow has removed the symlinks only. All program files and directories related to hello program are still available in **/usr/local/stow/hello** folder. So, you can install the hello program again without having to download the actual source file. If you don’t want it anymore, simply delete the folder. + +``` +$ sudo rm -fr /usr/local/stow/hello/ +``` + +To know more details about Stow, refer the man pages. + +``` +$ man stow +``` + + +Stow helps you to uninstall the programs as easily as you install them. If you are wondering how to effectively manage a lot of programs installed from source, GNU Stow is one such program to make this task a lot easier. Give it a try, you won’t be disappointed. + +And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned! + +Cheers! + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/an-easy-way-to-remove-programs-installed-from-source-in-linux/ + +作者:[SK][a] +选题:[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.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: http://www.ostechnix.com/wp-content/uploads/2018/12/tree-command.png +[3]: http://www.ostechnix.com/wp-content/uploads/2018/12/hello-world.png From 662d780561106a788e782e5a47b07e1469a0c9e4 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:40:13 +0800 Subject: [PATCH 1049/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Top=206=20open?= =?UTF-8?q?=20source=20desktop=20email=20clients?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Top 6 open source desktop email clients.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20180119 Top 6 open source desktop email clients.md diff --git a/sources/tech/20180119 Top 6 open source desktop email clients.md b/sources/tech/20180119 Top 6 open source desktop email clients.md new file mode 100644 index 0000000000..7493714453 --- /dev/null +++ b/sources/tech/20180119 Top 6 open source desktop email clients.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 6 open source desktop email clients) +[#]: via: (https://opensource.com/business/18/1/desktop-email-clients) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Top 6 open source desktop email clients +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_mail.png?itok=XTkwePLK) + +This article was originally published on October 8, 2015, and has been updated to reflect new information and project changes. + +Mobile and web technologies still haven't made the desktop obsolete, and despite some regular claims to the contrary, desktop clients don't seem to be going away anytime soon. + +And with good reason. For many, the preference for a native application (and corresponding native performance), easy offline use, a vast array of plugins, and meeting security needs will long outweigh pressures to switch to a webmail email client. Whether you're sticking with a desktop email client because of a corporate mandate or just personal preference, there are still many great options to choose from. And just because you may be stuck on Windows doesn't mean Outlook is your only option; many open source clients are cross-platform. + +In this roundup, we take a quick look at six open source options for desktop email, share a little bit about each, and provide you with some options you may want to try yourself. + +### Thunderbird + +For many years, Mozilla [Thunderbird][1] was the king of the open source email clients. It was available on all major platforms, and it had great success alongside Mozilla's now-flagship project, Firefox. Thunderbird has been around for over a decade and was immediately popular from the start, receiving over a million downloads in its first 10 days of public release. + +In recent years, the thunder behind Thunderbird got a little quieter, and in mid-2017 the project announced it would move off Mozilla's infrastructure, but keep the Mozilla Foundation as its legal and fiscal home. Several [new hires][2] were made to advance the project, with plans to bring in new developers to fix lingering issues and transform the codebase to be based on web technologies. + +Thunderbird is full-featured, with a number of well-supported plugins adding everything from calendar support to advanced address book integration, and many specialized features including theming and large file management. Out of the box, it supports POP and IMAP email syncing, spam filtering, and many other features you would expect, and it works flawlessly across Windows, macOS, and Linux. + +Thunderbird is made available under the [Mozilla Public License][3]. + +![Thunderbird][4] + +### Claws Mail + +[Claws Mail][5], a fork of [Sylpheed][6], is a fast and flexible alternative that might be appealing to anyone concerned about performance and minimal resource usage. It's a good option, for example, if you're working within the limited processing and memory capacity of a [Raspberry Pi][7], for example. + +But even for those with virtually unlimited computing resources to throw at a mail client, Claws Mail might be a good option. It's flexible, probably more so than Thunderbird or some of the other options in this list, and it has a number of plugins available for those who want to extend it. And it prides itself on being fast and reliable, too, in addition to sporting a simple interface that's perhaps ideal for new users. + +Claws Mail is based on the GTK+ framework and made available under the [GPL][8]. + +![](https://opensource.com/sites/default/files/images/business-uploads/desktop-email-claws.png) + +### Evolution + +If you're a user of the popular Fedora or Debian distributions, you're probably already familiar with the next option on our list, [Evolution][9]. Evolution is an official part of the GNOME project, but it didn't start out that way. Originally developed at Ximian, and later Novell, Evolution was designed from the ground up to be an enterprise-ready email application. + +To this end, Evolution supports Exchange Server and a number of other email setups you might find in a corporate environment. It's also a full personal information manager (PIM), sporting a calendar, task list, contact manager, and note taking application, in addition to handling your email. Even if it's not the default mail application in your distribution, you might want to take a look if you're interested in these features or the included spam filtering, GNU Privacy Guard (GPG) support, integration with LibreOffice, or a slew of other features. + +Evolution is made available as open source under the [LGPL][10]. + +![](https://opensource.com/sites/default/files/images/business-uploads/desktop-email-evolution.png) + +### Geary + +[Geary][11] is a project originally developed by Yorba Foundation, which made a number of different GNOME software tools. Geary supports a number of popular webmail services as the mail backend through IMAP. + +Geary doesn't have a lot of features compared to some other clients on this list, but its simple interface might be appealing to users frustrated with unnecessary complexity in other email programs. Geary is available under the [LGPL][10]. + +![](https://opensource.com/sites/default/files/images/business-uploads/desktop-email-geary.png) + +### KMail + +[KMail][12] is the mail component of [Kontact][13], the personal information manager included with KDE. KMail supports a variety of email protocols, including IMAP, SMTP, and POP3, and through its integration with the other Kontact components, it could be considered a complete groupware suite. Despite its Linux routes, a Windows build is also available. + +With its long history, KMail has developed most of the features you would expect to find in a modern mail program. While it fits nicely into the KDE group of applications, some may find its interface clunky compared to others. But give it a try and see what you think. + +KMail is made available under the [GPL][14]. + +![](https://opensource.com/sites/default/files/images/business-uploads/desktop-email-kmail.png) + +### Mailspring + +[Mailspring][15], the new kid on the block, is a relaunch of the now-defunct Nylas Mail by one of the original authors. It replaces Nylas' JavaScript sync engine with a C++ core, which is said to minimize the application's RAM and power demands, and removes heavy dependencies to add speed. Its features include a unified inbox, support for IMAP (but not ActiveSync), Gmail-style search, themes, and message translation. + +Mailspring is available for macOS, Windows, and Linux, and it's licensed under [GPLv3][16]. + +![Mailspring][17] + +Of course, there are many more options above and beyond these, including the full-featured PIM [Zimbra Desktop][18] or one of the [lightweight alternatives][19] like [GNUMail][20] that might be the best choice for your situation. What's your favorite open source desktop email client? And with webmail as the first choice of many users, what do you see as the role of the desktop email client in the years to come? Let us know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/18/1/desktop-email-clients + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://www.mozilla.org/en-US/thunderbird/ +[2]: https://blog.mozilla.org/thunderbird/2017/12/new-thunderbird-releases-and-new-thunderbird-staff/ +[3]: https://www.mozilla.org/en-US/MPL/ +[4]: https://opensource.com/sites/default/files/u128651/desktop-email-thunderbird57.png (Thunderbird) +[5]: http://www.claws-mail.org/ +[6]: http://sylpheed.sraoss.jp/en/ +[7]: https://opensource.com/resources/what-raspberry-pi +[8]: http://www.claws-mail.org/COPYING +[9]: https://wiki.gnome.org/Apps/Evolution +[10]: http://www.gnu.org/licenses/lgpl-3.0.en.html +[11]: https://wiki.gnome.org/Apps/Geary +[12]: https://userbase.kde.org/KMail +[13]: https://userbase.kde.org/Kontact +[14]: http://www.gnu.org/licenses/gpl-3.0.en.html +[15]: https://getmailspring.com/ +[16]: https://github.com/Foundry376/Mailspring/blob/master/LICENSE.md +[17]: https://opensource.com/sites/default/files/u128651/desktop-email-mailspring.png (Mailspring) +[18]: https://www.zimbra.com/open-source-email-overview/ +[19]: https://opensource.com/article/17/7/email-alternatives-thunderbird +[20]: http://wiki.gnustep.org/index.php/GNUMail From cbbad162bd7b49b10533e1138ca58c3c69065f82 Mon Sep 17 00:00:00 2001 From: darksun Date: Mon, 24 Dec 2018 19:44:28 +0800 Subject: [PATCH 1050/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Fragmentation?= =?UTF-8?q?=20is=20Why=20Linux=20Hasn=E2=80=99t=20Succeeded=20on=20Desktop?= =?UTF-8?q?:=20Linus=20Torvalds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t Succeeded on Desktop- Linus Torvalds.md" | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 "sources/talk/\\20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md" diff --git "a/sources/talk/\\20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md" "b/sources/talk/\\20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md" new file mode 100644 index 0000000000..e2d519439a --- /dev/null +++ "b/sources/talk/\\20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md" @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fragmentation is Why Linux Hasn’t Succeeded on Desktop: Linus Torvalds) +[#]: via: (https://itsfoss.com/desktop-linux-torvalds/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Fragmentation is Why Linux Hasn’t Succeeded on Desktop: Linus Torvalds +====== + +**Brief: Linus Torvalds has finally spoken his mind over why Linux that rules the servers and the clouds has not succeeded on the desktop front.** + +![Linus Torvalds voices his opinion on why desktop Linux didn't succeed][1] + +Too many cooks spoil the broth. + +Too many choices overwhelm the consumer/customer/user. + +Too many desktop choices held Linux back from succeeding as a desktop operating system? Linux creator Linus Torvalds certainly thinks so. + +In an interview with [TFiR][2], Torvalds expressed his views on the ‘failure’ of desktop Linux. + +> I still wish we were better at having a standardize desktop that goes across all the distributions… It’s not a kernel issue. It’s more of a personal annoyance how the fragmentation of the different vendors have, I think, held the desktop back a bit. + +You can watch the entire interview on [TFiR’s YouTube channel][3]. It’s a short video where Torvalds has expressed his views on desktop Linux and Chromebooks. + + + +### Chromebooks and Android are the future of desktop Linux! + +When I met Jim Zemlin, executive director of the Linux Foundation, at Open Source Summit in 2017, I asked him why Linux Foundation doesn’t work on creating an affordable Linux laptop for masses. Jim answered that Chromebooks are essentially Linux desktop and they are doing exactly that so there is no need of going after a new entry-level Linux laptop. + +Interestingly, Torvalds also puts his weight behind Chromebooks (and Android). + +> It seems to be that Chromebooks and Android are the paths towards the desktop. + +In case you didn’t know, [Chromebooks will soon be able to run native Debian apps][4]. Using Chromebook will give a slightly better ‘Linux feel’. For now, Chromebooks and Chrome OS are nowhere close to the traditional desktop feel despite the fact they run on top of the Linux kernel. + +### What do you think? + +I, along with many other Linux users, have felt the same reason behind the not-so-successful state of the desktop Linux. There are too many choices available when it comes to desktop Linux and this is overwhelming to the new users to the extent that they just avoid using it. + +Do I feel vindicated that Torvalds thinks the same? Kind of. + +What do you think? Do you agree with the opinion that the fragmentation held back desktop Linux? Or do you think that the multitude of choices symbolize the freedom Linux provides to the users? Share your view with us. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/desktop-linux-torvalds/ + +作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/torvalds-why-desktop-linux-failed.jpeg?resize=800%2C450&ssl=1 +[2]: https://www.tfir.io/ +[3]: https://www.youtube.com/watch?v=VHFdoFKDuQA +[4]: https://itsfoss.com/linux-apps-chromebook/ From 3ff4c04288d14c9e67c63a300eb8670e70681339 Mon Sep 17 00:00:00 2001 From: qhwdw <33189910+qhwdw@users.noreply.github.com> Date: Mon, 24 Dec 2018 22:24:37 +0800 Subject: [PATCH 1051/1143] Translated by qhwdw --- ...GP - Part 7- Protecting Online Accounts.md | 147 ------------------ ...GP - Part 7- Protecting Online Accounts.md | 145 +++++++++++++++++ 2 files changed, 145 insertions(+), 147 deletions(-) delete mode 100644 sources/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md create mode 100644 translated/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md diff --git a/sources/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md b/sources/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md deleted file mode 100644 index 1c5cf7ff09..0000000000 --- a/sources/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md +++ /dev/null @@ -1,147 +0,0 @@ -Translating by qhwdw -Protecting Code Integrity with PGP — Part 7: Protecting Online Accounts -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/online-pgp.jpg?itok=BWc_Bk6q) -So far in this tutorial series, we've provided practical guidelines for using PGP, including basic concepts and steps for generating and protecting your keys. If you missed the previous articles, you can catch up below. In this final article, we offer additional guidance for protecting your online accounts, which is of paramount importance today. - -[Part 1: Basic Concepts and Tools][1] - -[Part 2: Generating Your Master Key][2] - -[Part 3: Generating PGP Subkeys][3] - -[Part 4: Moving Your Master Key to Offline Storage][4] - -[Part 5: Moving Subkeys to a Hardware Device][5] - -[Part 6: Using PGP with Git][6] - -### Checklist - - * Get a U2F-capable device (ESSENTIAL) - - * Enable 2-factor authentication for your online accounts (ESSENTIAL) - - * GitHub/GitLab - - * Google - - * Social media - - * Use U2F as primary mechanism, with TOTP as fallback (ESSENTIAL) - - - - -#### Considerations - -You may have noticed how a lot of your online developer identity is tied to your email address. If someone can gain access to your mailbox, they would be able to do a lot of damage to you personally, and to your reputation as a free software developer. Protecting your email accounts is just as important as protecting your PGP keys. - -##### Two-factor authentication with Fido U2F - -[Two-factor authentication][7] is a mechanism to improve account security by requiring a physical token in addition to a username and password. The goal is to make sure that even if someone steals your password (via keylogging, shoulder surfing, or other means), they still wouldn't be able to gain access to your account without having in their possession a specific physical device ("something you have" factor). - -The most widely known mechanisms for 2-factor authentication are: - - * SMS-based verification - - * Time-based One-Time Passwords (TOTP) via a smartphone app, such as the "Google Authenticator" or similar solutions - - * Hardware tokens supporting Fido U2F - - - - -SMS-based verification is easiest to configure, but has the following important downsides: it is useless in areas without signal (e.g. most building basements), and can be defeated if the attacker is able to intercept or divert SMS messages, for example by cloning your SIM card. - -TOTP-based multi-factor authentication offers more protection than SMS, but has important scaling downsides (there are only so many tokens you can add to your smartphone app before finding the correct one becomes unwieldy). Plus, there's no avoiding the fact that your secret key ends up stored on the smartphone itself -- which is a complex, globally connected device that may or may not have been receiving timely security patches from the manufacturer. - -Most importantly, neither TOTP nor SMS methods protect you from phishing attacks -- if the phisher is able to steal both your account password and the 2-factor token, they can replay them on the legitimate site and gain access to your account. - -[Fido U2F][8] is a standard developed specifically to provide a mechanism for 2-factor authentication and to combat credential phishing. The U2F protocol will store each site's unique key on the USB token and will prevent you from accidentally giving the attacker both your password and your one-time token if you try to use it on anything other than the legitimate website. - -Both Chrome and Firefox support U2F 2-factor authentication, and hopefully other browsers will soon follow. - -##### Get a token capable of Fido U2F - -There are [many options available][9] for hardware tokens with Fido U2F support, but if you're already ordering a smartcard-capable physical device, then your best option is a Yubikey 4, which supports both. - -##### Enable 2-factor authentication on your online accounts - -You definitely want to enable this option on the email provider you are using (especially if it is Google, which has excellent support for U2F). Other sites where this functionality should be enabled are: - - * GitHub: it probably occurred to you when you uploaded your PGP public key that if anyone else is able to gain access to your account, they can replace your key with their own. If you publish code on GitHub, you should take care of your account security by protecting it with U2F-backed authentication. - - * GitLab: for the same reasons as above. - - * Google: if you have a google account, you will be surprised how many sites allow logging in with Google authentication instead of site-specific credentials. - - * Facebook: same as above, a lot of online sites offer the option to authenticate using a Facebook account. You should 2-factor protect your Facebook account even if you do not use it. - - * Other sites, as you deem necessary. See [dongleauth.info][10] for inspiration. - - - - -##### Configure TOTP failover, if possible - -Many sites will allow you to configure multiple 2-factor mechanisms, and the recommended setup is: - - * U2F token as the primary mechanism - - * TOTP phone app as the secondary mechanism - - - - -This way, even if you lose your U2F token, you should be able to re-gain access to your account. Alternatively, you can enroll multiple U2F tokens (e.g. you can get another cheap token that only does U2F and use it for backup reasons). - -### Further reading - -By this point you have accomplished the following important tasks: - - 1. Created your developer identity and protected it using PGP cryptography. - - 2. Configured your environment so your identity is not easily stolen by moving your master key offline and your subkeys to an external hardware device. - - 3. Configured your git environment to ensure that anyone using your project is able to verify the integrity of the repository and its entire history. - - 4. Secured your online accounts using 2-factor authentication. - - - - -You are already in a good place, but you should also read up on the following topics: - - * How to secure your team communication (see the document in this repository). Decisions regarding your project development and governance require just as much careful protection as any committed code, if not so. Make sure that your team communication is trusted and the integrity of all decisions is verified. - - * How to secure your workstation (see the document in this repository). Your goal is to minimize risky behaviour that would cause your project code to be contaminated, or your developer identity to be stolen. - - * How to write secure code (see various documentation related to the programming languages and libraries used by your project). Bad, insecure code is still bad, insecure code even if there is a PGP signature on the commit that introduced it. - - - - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-7-protecting-online-accounts - -作者:[Konstantin Ryabitsev][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) -选题:[lujun9972](https://github.com/lujun9972) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/mricon -[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools -[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key -[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys -[4]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage -[5]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-5-moving-subkeys-hardware-device -[6]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-6-using-pgp-git -[7]:https://en.wikipedia.org/wiki/Multi-factor_authentication -[8]:https://en.wikipedia.org/wiki/Universal_2nd_Factor -[9]:http://www.dongleauth.info/dongles/ -[10]:http://www.dongleauth.info/ diff --git a/translated/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md b/translated/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md new file mode 100644 index 0000000000..4cf1f321c1 --- /dev/null +++ b/translated/tech/20180327 Protecting Code Integrity with PGP - Part 7- Protecting Online Accounts.md @@ -0,0 +1,145 @@ +保护代码完整性(七):保护在线帐户 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/online-pgp.jpg?itok=BWc_Bk6q) +到目前为止,本系列教程已经提供了 PGP 的实用指南,包括基本概念和工具、生成和保护你的密钥的步骤。如果你错过了前面的文章,可以通过下面的链接查看。在本系列的最后一篇文章中,我们将为你保护在线帐户提供一个额外的指南,保护在线帐户是当今非常重要的一件事情。 + +[第一部分:基本概念和工具][1] + +[第二部分:生成你的主密钥][2] + +[第三部分:生成 PGP 子密钥][3] + +[第四部分:将主密钥移到离线存储中][4] + +[第五部分:将子密钥移到硬件设备中][5] + +[第六部分:在 Git 中使用 PGP][6] + +### 清单 + + * 取得一个具备 U2F 功能的设备(必要) + + * 为你的在线帐户启用双因子认证(必要) + + * GitHub/GitLab + + * Google + + * 社交媒体 + + * 使用 U2F 作为主验证机制,使用 TOTP 作为备选(必要) + + + + +#### 考虑事项 + +你可能注意到,很多在线开发者身份是捆绑了你的 email 地址。如果有人能够访问你的邮箱,他们就能够去做一些对你会产生危害的事情,进而会损害你作为自由软件开发者的声誉。应该像保护你的 PGP 密钥那样保护你的 email 地址。 + +##### 使用 Fido U2F 的双因子认证 + +[双因子认证][7] 是一种提升帐户安全性的机制,它除了要求用户名和密码之外,还要求一个物理令牌。它的目标是即便在有人窃取了你的密码(通过按键记录器、肩窥攻击、或其它方式)的情况下,仍然能确保你的帐户安全,他们在没有得到你的一个专用的物理设备(“必备”的那个因子)的情况下,始终不能获取你的帐户。 + +广为人知的双因子认证机制有: + + * 基于 SMS 的验证 + + * 借助智能手机应用的基于时间的一次性令牌(TOTP),比如 "Google Authenticator" 或类似解决方案 + + * 支持 Fido U2F 的硬件令牌 + + + + +基于 SMS 的验证很容易配置,但是它有如下的缺点:它在没有手机信号的地方无法使用(比如,建筑物的地下室),并且如果攻击者能够阻断或转向 SMS 信息,这种方式可能就会失败,比如通过克隆你的 SIM 卡。 + +基于 TOTP 的多因子认证提供了比 SMS 更好的安全保护,但它也有一些重要的缺点(在你能够找到一个合适的令牌之前,你只能在智能手机中添加那么多令牌)。此外,还不能避免一个事实,那就是你的密钥最终还是保存在你的智能手机中 —— 它是一个复杂的、全球连接的设备,它有可能还没有及时从制造商那儿收到安全补丁。 + +更重要的是,不论是使用 TOTP 还是 SMS 的方法保护你免受诱骗攻击 —— 如果诱骗攻击者能够窃取你的帐户密码和双因子令牌,他们就可以在合法的站点上使用它们,访问你的帐户。 + +[Fido U2F][8] 是一个按标准开发的专用设备,它能够提供双因子认证机制来对付诱骗攻击。U2F 协议在 USB 令牌中保存每个站点的的唯一密钥,如果你在任何合法站点以外的地方尝试使用它,它将阻止你,以防范偶然让攻击者获得你的密码和一次性令牌。 + +Chrome 和 Firefox 都支持 U2F 双因子认证,希望其它浏览器也能够提供对 U2F 的支持。 + +##### 获得一个支持 Fido U2F 功能的令牌 + +支持 U2F 的硬件令牌的 [可选目标很多][9],但如果你已经订购了一个支持智能卡的物理设备,那么你最好的选择就是 Yubikey 4,它两者都支持。 + +##### 启用你的在线帐户的双因子认证 + +你要确定你想去启用的选项,你的 email 提供商已经使用了(特别是 Google,它对 U2F 的支持非常好)。其它的站点这个功能应该是启用了: + + * GitHub:当你上传你的 PGP 公钥时,你应该要想到,如果其他人能够获得访问你的帐户,他们可以用他们自己的 PGP 公钥替换掉你的 PGP 公钥。如果在 GitHub 上发布代码,你应该使用 U2F 认证来保护你的帐户安全。 + + * GitLab:理由同上 + + * Google:如果你有 google 帐户,你就惊奇地发现,许多帐户都允许以 Google 帐户来代替站点专用的认证来登入它们。 + + * Facebook:理由同上,许多在线站点都提供一个选择让你以 Facebook 的帐户来认证。即便你不使用 Facebook 也应该使用双因子认证来保护你的 Facebook 帐户。 + + * 你认为必要的其它站点。查看 [dongleauth.info][10] 去找找灵感。 + + + + +##### 如有可能,配置 TOTP 作为备选 + +许多站点都允许你配置多个双因子认证机制,推荐的设置是: + + * U2F 令牌作为主认证机制 + + * TOTP 手机 app 作为辅助认证机制 + + + + +通过这种方式,即便你丢失了你的 U2F 令牌,你仍然能够重新获取对你的帐户的访问。或者,你可以注册多个 U2F 令牌(即:你可以用一个便宜的令牌仅用它做 U2F,并且将它用作备份)。 + +### 延伸阅读 + +到目前为止,你已经完成了下列的重要任务: + + 1. 创建你的开发者身份并使用 PGP 加密来保护它。 + + 2. 通过将你的主密钥移到一个离线存储中并将子密钥移到一个外置硬件设备中的方式来配置你的环境,让窃取你的身份变得极为困难。 + + 3. 配置你的 Git 环境去确保任何使用你项目的人都能够验证仓库的完整性和它的整个历史。 + + 4. 使用双因子认证强化你的在线帐户。 + + + + +在安全保护方面,你已经做的很好了,但是你还应该去阅读以下的主题: + + * 如何去强化你的团队沟通(在这个仓库中查看相关文档)。你的项目开发和治理决策的要求应该和保护提交代码那样去保护,如果不这样做,应该确保你的团队沟通是可信任的,并且所有决策的完整性是可验证的。 + + * 如何去强化你的工作站的安全(在这个仓库中查看相关文档)。你的目标是最小化可能导致项目代码被污染的危险或你的开发者身份被窃的行为。 + + * 如何写出安全的代码(查看相关编程语言和你项目所使用的库的各种文档)。即便引入它的提交代码上有一个 PGP 签名,糟糕的、不安全的代码仍然是糟糕的、不安全的代码! + + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-7-protecting-online-accounts + +作者:[Konstantin Ryabitsev][a] +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) +选题:[lujun9972](https://github.com/lujun9972) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/mricon +[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools +[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key +[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys +[4]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage +[5]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-5-moving-subkeys-hardware-device +[6]:https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-6-using-pgp-git +[7]:https://en.wikipedia.org/wiki/Multi-factor_authentication +[8]:https://en.wikipedia.org/wiki/Universal_2nd_Factor +[9]:http://www.dongleauth.info/dongles/ +[10]:http://www.dongleauth.info/ From 3357a9baa663287c5414b4ee36aa147489ecb5e0 Mon Sep 17 00:00:00 2001 From: qhwdw <33189910+qhwdw@users.noreply.github.com> Date: Mon, 24 Dec 2018 22:36:18 +0800 Subject: [PATCH 1052/1143] Translating by qhwdw --- sources/tech/20181221 How to Build a Netboot Server, Part 3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181221 How to Build a Netboot Server, Part 3.md b/sources/tech/20181221 How to Build a Netboot Server, Part 3.md index 7c4501b58b..08c1a8a12e 100644 --- a/sources/tech/20181221 How to Build a Netboot Server, Part 3.md +++ b/sources/tech/20181221 How to Build a Netboot Server, Part 3.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qhwdw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f252552cf222439d5c004a7e1e36a4cf24263f2c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Dec 2018 23:49:40 +0800 Subject: [PATCH 1053/1143] PRF:20181123 How to Build a Netboot Server, Part 1.md @qhwdw --- ...3 How to Build a Netboot Server, Part 1.md | 169 +++++++++--------- 1 file changed, 84 insertions(+), 85 deletions(-) diff --git a/translated/tech/20181123 How to Build a Netboot Server, Part 1.md b/translated/tech/20181123 How to Build a Netboot Server, Part 1.md index f2711ac3d1..1888f4ab2b 100644 --- a/translated/tech/20181123 How to Build a Netboot Server, Part 1.md +++ b/translated/tech/20181123 How to Build a Netboot Server, Part 1.md @@ -1,47 +1,51 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: -[#]: publisher: +[#]: reviewer: (wxy) +[#]: publisher: ( ) [#]: subject: (How to Build a Netboot Server, Part 1) - [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) +[#]: url: ( ) -[#]: url: - -如何构建一台网络引导服务器(第一部分) -====== +如何构建一台网络引导服务器(一) +====== ![](https://fedoramagazine.org/wp-content/uploads/2018/11/build-netboot-816x345.jpg) -有些计算机网络需要在各个物理机器上维护相同的软件和配置。学校的计算机实验室就是这样的一个环境。一台 [网络引导][1] 服务器能够被配置为基于网络去提供一个完整的操作系统,以便于客户端计算机从一个中央位置获取配置。本教程将向你展示构建一台网络引导服务器的一种方法。 +有些计算机网络需要在各个物理机器上维护相同的软件和配置。学校的计算机实验室就是这样的一个环境。 [网络引导][1] 服务器能够被配置为基于网络去提供一个完整的操作系统,以便于客户端计算机从一个中央位置获取配置。本教程将向你展示构建一台网络引导服务器的一种方法。 -本教程的第一部分将包括创建一台网络引导服务器和镜像。第二部分将展示如何去添加 Kerberos 验证的 home 目录到网络引导配置中。 +本教程的第一部分将包括创建一台网络引导服务器和镜像。第二部分将展示如何去添加 Kerberos 验证的家目录到网络引导配置中。 ### 初始化配置 -首先去下载 Fedora 服务器的 [netinst][2] 镜像,将它刻录到一张光盘上,然后它将引导服务器去重新格式化。我们只需要一个典型的 Fedora Server 的“最小化安装”来作为我们的开端,安装完成后,我们可以使用命令行去添加我们需要的任何额外的包。 +首先去下载 Fedora 服务器的 [netinst][2] 镜像,将它刻录到一张光盘上,然后用它引导服务器来重新格式化。我们只需要一个典型的 Fedora Server 的“最小化安装”来作为我们的开端,安装完成后,我们可以使用命令行去添加我们需要的任何额外的包。 ![][3] > 注意:本教程中我们将使用 Fedora 28。其它版本在“最小化安装”中包含的包可能略有不同。如果你使用的是不同的 Fedora 版本,如果一个预期的文件或命令不可用,你可能需要做一些调试。 -最小化安装的 Fedora Server 运行起来之后,以 root 用户登入并设置主机名字: +最小化安装的 Fedora Server 运行起来之后,以 root 用户登入: -```javascript +``` +$ sudo -i +``` + +并设置主机名字: + +``` $ MY_HOSTNAME=server-01.example.edu $ hostnamectl set-hostname $MY_HOSTNAME ``` > 注意:Red Hat 建议静态和临时名字应都要与这个机器在 DNS 中的完全合格域名相匹配,比如 host.example.com([了解主机名字][4])。 > -> 注意:本指南为了你“复制粘贴”友好。需要自定义的任何值都声明为一个 MY_* 变量,在你运行剩余命令之前,你可能需要调整它。如果你注销之后,变量的赋值将被清除。 +> 注意:本指南为了方便“复制粘贴”。需要自定义的任何值都声明为一个 `MY_*` 变量,在你运行剩余命令之前,你可能需要调整它。如果你注销之后,变量的赋值将被清除。 > -> 注意:Fedora 28 Server 在默认情况下往往会转储大量的日志到控制台上。你可以通过运行命令:sysctl -w kernel.printk=0 去禁用控制台日志输出。 +> 注意:Fedora 28 Server 在默认情况下往往会转储大量的日志到控制台上。你可以通过运行命令:`sysctl -w kernel.printk=0` 去禁用控制台日志输出。 接下来,我们需要在我们的服务器上配置一个静态网络地址。运行下面的一系列命令将找到并重新配置你的默认网络连接: -```javascript +``` $ MY_DNS1=192.0.2.91 $ MY_DNS2=192.0.2.92 $ MY_IP=192.0.2.158 @@ -66,7 +70,7 @@ nmcli con up br0-slave0 END ``` -> 注意:上面最后的一组命令被封装到一个 “nohup” 脚本中,因为它将临时禁用网络。这个 nohup 命令将允许 nmcli 命令去完成运行,直到你的 SSH 连接断开。注意,连接恢复可能需要 10 秒左右的时间,如果你改变了服务器 IP 地址,你将需要重新启动一个新的 SSH 连接。 +> 注意:上面最后的一组命令被封装到一个 `nohup` 脚本中,因为它将临时禁用网络。这个 `nohup` 命令可以让 `nmcli` 命令运行完成,即使你的 SSH 连接断开。注意,连接恢复可能需要 10 秒左右的时间,如果你改变了服务器 IP 地址,你将需要重新启动一个新的 SSH 连接。 > > 注意:上面的网络配置在默认的连接之上创建了一个 [网桥][5],这样我们在后面的测试中就可以直接运行一个虚拟机实例。如果你不想在这台服务器上去直接测试网络引导镜像,你可以跳过创建网桥的命令,并直接在你的默认网络连接上配置静态 IP 地址。 @@ -80,26 +84,26 @@ $ dnf install -y nfs-utils 为发布 NFS 去创建一个顶级的 [伪文件系统][6],然后在你的网络上共享它: -```javascript +``` $ MY_SUBNET=192.0.2.0 $ mkdir /export $ echo "/export -fsid=0,ro,sec=sys,root_squash $MY_SUBNET/$MY_PREFIX" > /etc/exports ``` -SELinux 将干扰网络引导服务器的运行。在本教程中我们将不涉及为它配置例外的部分,因此我们直接禁用它: +SELinux 会干扰网络引导服务器的运行。为它配置例外规则超出了本教程中,因此我们这里直接禁用它: -```javascript +``` $ sed -i '/GRUB_CMDLINE_LINUX/s/"$/ audit=0 selinux=0"/' /etc/default/grub $ grub2-mkconfig -o /boot/grub2/grub.cfg $ sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux $ setenforce 0 ``` -> 注意:编辑 grub 命令行应该是不需要的,但在测试过程中发现,简单地编辑 /etc/sysconfig/selinux 被证明重启后是无效的,因此再次确保设置了 “selinux=0” 标志。 +> 注意:应该不需要编辑 grub 命令行,但我们在测试过程中发现,直接编辑 `/etc/sysconfig/selinux` 被证明重启后是无效的,因此这样做再次确保设置了 `selinux=0` 标志。 -现在,在本地防火墙中为 NFS 服务添加一个例外,然后启动 NFS 服务: +现在,在本地防火墙中为 NFS 服务添加一个例外规则,然后启动 NFS 服务: -```javascript +``` $ firewall-cmd --add-service nfs $ firewall-cmd --runtime-to-permanent $ systemctl enable nfs-server.service @@ -116,76 +120,70 @@ $ systemctl start nfs-server.service $ mkdir /fc28 ``` -使用 “dnf” 命令在新目录下用几个基础包去构建镜像: +使用 `dnf` 命令在新目录下用几个基础包去构建镜像: -```javascript +``` $ dnf -y --releasever=28 --installroot=/fc28 install fedora-release systemd passwd rootfiles sudo dracut dracut-network nfs-utils vim-minimal dnf ``` -在上面的命令中省略了很重要的 “kernel” 包。在它们被安装完成之前,我们需要去调整一下 “initramfs” 镜像中包含的驱动程序集,“kernel” 首次安装时将自动构建这个镜像。尤其是,我们需要禁用 “hostonly” 模式,以便于 initramfs 镜像能够在各种硬件平台上正常工作,并且我们还需要添加对网络和 NFS 的支持: +在上面的命令中省略了很重要的 `kernel` 包。在它们被安装完成之前,我们需要去调整一下 `initramfs` 镜像中包含的驱动程序集,`kernel` 首次安装时将自动构建这个镜像。尤其是,我们需要禁用 `hostonly` 模式,以便于 `initramfs` 镜像能够在各种硬件平台上正常工作,并且我们还需要添加对网络和 NFS 的支持: -```javascript +``` $ echo 'hostonly=no' > /fc28/etc/dracut.conf.d/hostonly.conf $ echo 'add_dracutmodules+=" network nfs "' > /fc28/etc/dracut.conf.d/netboot.conf ``` -现在,安装 kernel: +现在,安装 `kernel` 包: -```javascript +``` $ dnf -y --installroot=/fc28 install kernel ``` -设置一个阻止 kernel 被更新的规则: +设置一个阻止 `kernel` 包被更新的规则: -```javascript +``` $ echo 'exclude=kernel-*' >> /fc28/etc/dnf/dnf.conf ``` 设置 locale: -```javascript +``` $ echo 'LANG="en_US.UTF-8"' > /fc28/etc/locale.conf ``` > 注意:如果 locale 没有正确配置,一些程序(如 GNOME Terminal)将无法正常工作。 -root 用户密码留空: - -```javascript -$ sed -i 's/^root:\*/root:/' /fc28/etc/shadow -``` - 设置客户端的主机名字: -```javascript +``` $ MY_CLIENT_HOSTNAME=client-01.example.edu $ echo $MY_CLIENT_HOSTNAME > /fc28/etc/hostname ``` 禁用控制台日志输出: -```javascript +``` $ echo 'kernel.printk = 0 4 1 7' > /fc28/etc/sysctl.d/00-printk.conf ``` -定义网络引导镜像中的本地 “liveuser” 用户: +定义网络引导镜像中的本地 `liveuser` 用户: -```javascript +``` $ echo 'liveuser:x:1000:1000::/home/liveuser:/bin/bash' >> /fc28/etc/passwd $ echo 'liveuser::::::::' >> /fc28/etc/shadow $ echo 'liveuser:x:1000:' >> /fc28/etc/group $ echo 'liveuser:!::' >> /fc28/etc/gshadow ``` -在 sudo 中启用 “liveuser”: +允许 `liveuser` 使用 `sudo`: -```javascript +``` $ echo 'liveuser ALL=(ALL) NOPASSWD: ALL' > /fc28/etc/sudoers.d/liveuser ``` -启用自动 home 目录创建: +启用自动创建家目录: -```livescript +``` $ dnf install -y --installroot=/fc28 authselect oddjob-mkhomedir $ echo 'dirs /home' > /fc28/etc/rwtab.d/home $ chroot /fc28 authselect select sssd with-mkhomedir --force @@ -194,19 +192,19 @@ $ chroot /fc28 systemctl enable oddjobd.service 由于多个客户端将会同时挂载我们的镜像,我们需要去配置镜像工作在只读模式中: -```livescript +``` $ sed -i 's/^READONLY=no$/READONLY=yes/' /fc28/etc/sysconfig/readonly-root ``` 配置日志输出到内存而不是持久存储中: -```livescript +``` $ sed -i 's/^#Storage=auto$/Storage=volatile/' /fc28/etc/systemd/journald.conf ``` 配置 DNS: -```livescript +``` $ MY_DNS1=192.0.2.91 $ MY_DNS2=192.0.2.92 $ cat << END > /fc28/etc/resolv.conf @@ -215,9 +213,9 @@ nameserver $MY_DNS2 END ``` -解决编写本教程时存在的只读 root 挂载 bug([BZ1542567][7]): +绕开编写本教程时存在的根目录只读挂载的 bug([BZ1542567][7]): -```livescript +``` $ echo 'dirs /var/lib/gssproxy' > /fc28/etc/rwtab.d/gssproxy $ cat << END > /fc28/etc/rwtab.d/systemd dirs /var/lib/systemd/catalog @@ -227,7 +225,7 @@ END 最后,为我们镜像创建 NFS 文件系统,并将它共享到我们的子网中: -```livescript +``` $ mkdir /export/fc28 $ echo '/fc28 /export/fc28 none bind 0 0' >> /etc/fstab $ mount /export/fc28 @@ -237,20 +235,20 @@ $ exportfs -vr ### 创建引导加载器 -现在,我们已经有了可以进行网络引导的操作系统,我们需要一个引导加载器去从客户端系统上启动它。在本教程中我们使用的是 [iPXE][8]. +现在,我们已经有了可以进行网络引导的操作系统,我们需要一个引导加载器去从客户端系统上启动它。在本教程中我们使用的是 [iPXE][8]。 -> 注意:本节和接下来的节 — 使用 QEMU 测试 — 能在另外一台单独的计算机上来完成;它们不需要在网络引导服务器上来运行。 +> 注意:本节和接下来的节使用 QEMU 测试,也能在另外一台单独的计算机上来完成;它们并不需要在网络引导服务器上来运行。 -安装 git 并使用它去下载 iPXE: +安装 `git` 并使用它去下载 iPXE: -```livescript +``` $ dnf install -y git $ git clone http://git.ipxe.org/ipxe.git $HOME/ipxe ``` 现在我们需要去为我们的引导加载器创建一个指定的启动脚本: -```livescript +``` $ cat << 'END' > $HOME/ipxe/init.ipxe #!ipxe @@ -264,19 +262,19 @@ END 启动 “file” 下载协议: -```livescript +``` $ echo '#define DOWNLOAD_PROTO_FILE' > $HOME/ipxe/src/config/local/general.h ``` 安装 C 编译器以及相关的工具和库: -```livescript +``` $ dnf groupinstall -y "C Development Tools and Libraries" ``` 构建引导加载器: -```livescript +``` $ cd $HOME/ipxe/src $ make clean $ make bin-x86_64-efi/ipxe.efi EMBED=../init.ipxe @@ -284,7 +282,7 @@ $ make bin-x86_64-efi/ipxe.efi EMBED=../init.ipxe 记下新编译的引导加载器的存储位置。我们将在接下来的节中用到它: -```livescript +``` $ IPXE_FILE="$HOME/ipxe/src/bin-x86_64-efi/ipxe.efi" ``` @@ -292,13 +290,13 @@ $ IPXE_FILE="$HOME/ipxe/src/bin-x86_64-efi/ipxe.efi" 这一节是可选的,但是你需要去复制下面显示在物理机器上的 [EFI 系统分区][9] 的布局,在网络引导时需要去配置它们。 -> 注意:如果你想实现一个完全的无盘系统,你也可以复制那个文件到一个 TFTP 服务器,然后从 DHCP 上引用那台服务器。 +> 注意:如果你想实现一个完全的无盘系统,你也可以复制那个文件到一个 TFTP 服务器,然后从 DHCP 上指向那台服务器。 为了使用 QEMU 去测试我们的引导加载器,我们继续去创建一个仅包含一个 EFI 系统分区和我们的启动文件的、很小的磁盘镜像。 从创建 EFI 系统分区所需要的目录布局开始,然后把我们在前面节中创建的引导加载器复制进去: -```livescript +``` $ mkdir -p $HOME/esp/efi/boot $ mkdir $HOME/esp/linux $ cp $IPXE_FILE $HOME/esp/efi/boot/bootx64.efi @@ -306,13 +304,13 @@ $ cp $IPXE_FILE $HOME/esp/efi/boot/bootx64.efi 下面的命令将识别我们的引导加载器镜像正在使用的内核版本,并将它保存到一个变量中,以备后续的配置命令去使用它: -```livescript +``` $ DEFAULT_VER=$(ls -c /fc28/lib/modules | head -n 1) ``` 定义我们的客户端计算机将使用的引导配置: -```livescript +``` $ MY_DNS1=192.0.2.91 $ MY_DNS2=192.0.2.92 $ MY_NFS4=server-01.example.edu @@ -329,14 +327,14 @@ END 复制 Linux 内核并分配 initramfs 给 EFI 系统分区: -```livescript +``` $ cp $(find /fc28/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $DEFAULT_VER) $HOME/esp/linux/vmlinuz-$DEFAULT_VER $ cp $(find /fc28/boot -name 'init*' | grep -m 1 $DEFAULT_VER) $HOME/esp/linux/initramfs-$DEFAULT_VER.img ``` 我们最终的目录布局应该看起来像下面的样子: -```livescript +``` esp ├── efi │   └── boot @@ -347,17 +345,17 @@ esp └── vmlinuz-4.18.18-200.fc28.x86_64 ``` -使用 QEMU 去使用我们的 EFI 系统分区,我们需要去创建一个小的 “uefi.img” 磁盘镜像来包含它,然后将它连接到 QEMU 作为主引导驱动器。 +要让 QEMU 去使用我们的 EFI 系统分区,我们需要去创建一个小的 `uefi.img` 磁盘镜像来包含它,然后将它连接到 QEMU 作为主引导驱动器。 开始安装必需的工具: -```livescript +``` $ dnf install -y parted dosfstools ``` -现在创建 “uefi.img” 文件,并将 “esp” 目录中文件复制进去: +现在创建 `uefi.img` 文件,并将 `esp` 目录中的文件复制进去: -```livescript +``` $ ESP_SIZE=$(du -ks $HOME/esp | cut -f 1) $ dd if=/dev/zero of=$HOME/uefi.img count=$((${ESP_SIZE}+5000)) bs=1KiB $ UEFI_DEV=$(losetup --show -f $HOME/uefi.img) @@ -370,54 +368,55 @@ $ umount $HOME/mnt $ losetup -d ${UEFI_DEV} ``` -> 注意:在物理计算机上,你只需要从 “esp” 目录中复制文件到计算机上已存在的 EFI 系统分区中。你不需要使用 “uefi.img” 文件去引导物理计算机。 +> 注意:在物理计算机上,你只需要从 `esp` 目录中复制文件到计算机上已存在的 EFI 系统分区中。你不需要使用 `uefi.img` 文件去引导物理计算机。 > -> 注意:在一个物理计算机上,如果文件名已存在,你可以重命名 “bootx64.efi” 文件,如果你重命名了它,就需要去编辑计算机的 BIOS 设置,并添加重命令后的 efi 文件到引导列表中。 +> 注意:在一个物理计算机上,如果文件名已存在,你可以重命名 `bootx64.efi` 文件,如果你重命名了它,就需要去编辑计算机的 BIOS 设置,并添加重命令后的 efi 文件到引导列表中。 接下来我们需要去安装 qemu 包: -```livescript +``` $ dnf install -y qemu-system-x86 ``` 允许 QEMU 访问我们在本教程“初始化配置”一节中创建的网桥: -```livescript +``` $ echo 'allow br0' > /etc/qemu/bridge.conf ``` -创建一个 “OVMF_VARS.fd” 镜像的副本去保存我们虚拟机的持久 BIOS 配置: +创建一个 `OVMF_VARS.fd` 镜像的副本去保存我们虚拟机的持久 BIOS 配置: -```livescript +``` $ cp /usr/share/edk2/ovmf/OVMF_VARS.fd $HOME ``` 现在,启动虚拟机: -```livescript +``` $ qemu-system-x86_64 -machine accel=kvm -nographic -m 1024 -drive if=pflash,format=raw,unit=0,file=/usr/share/edk2/ovmf/OVMF_CODE.fd,readonly=on -drive if=pflash,format=raw,unit=1,file=$HOME/OVMF_VARS.fd -drive if=ide,format=raw,file=$HOME/uefi.img -net bridge,br=br0 -net nic,model=virtio ``` 如果一切顺利,你将看到类似下图所示的结果: ![][10] -你可以使用 “shutdown” 命令关闭虚拟机回到我们的服务器上: -```livescript +你可以使用 `shutdown` 命令关闭虚拟机回到我们的服务器上: + +``` $ sudo shutdown -h now ``` -> 注意:如果出现了错误或虚拟机挂住了,你可能需要启动一个新的 SSH 会话去连接服务器,使用 “kill” 命令去终止 “qemu-system-x86_64” 进程。 +> 注意:如果出现了错误或虚拟机挂住了,你可能需要启动一个新的 SSH 会话去连接服务器,使用 `kill` 命令去终止 `qemu-system-x86_64` 进程。 ### 镜像中添加包 -镜像中添加包应该是一个很简单的问题,在服务器上 chroot 进镜像,然后运行 “dnf install ”。 +镜像中添加包应该是一个很简单的问题,在服务器上 `chroot` 进镜像,然后运行 `dnf install `。 在网络引导镜像中并不限制你能安装什么包。一个完整的图形化安装应该能够完美地工作。 下面是一个如何将最小化安装的网络引导镜像变成完整的图形化安装的示例: -```livescript +``` $ for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done $ chroot /fc28 /usr/bin/bash --login $ dnf -y groupinstall "Fedora Workstation" @@ -430,9 +429,9 @@ $ logout $ for i in run sys proc dev/shm dev/pts dev; do umount /fc28/$i; done ``` -可选,你可能希望去启用 “liveuser” 用户的自动登陆: +可选地,你可能希望去启用 `liveuser` 用户的自动登录: -```livescript +``` $ sed -i '/daemon/a AutomaticLoginEnable=true' /fc28/etc/gdm/custom.conf $ sed -i '/daemon/a AutomaticLogin=liveuser' /fc28/etc/gdm/custom.conf ``` @@ -444,7 +443,7 @@ via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7af8488185a01b1db58102d771e956ea6111ee55 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 24 Dec 2018 23:50:47 +0800 Subject: [PATCH 1054/1143] PUB:20181123 How to Build a Netboot Server, Part 1.md @qhwdw https://linux.cn/article-10379-1.html --- .../20181123 How to Build a Netboot Server, Part 1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181123 How to Build a Netboot Server, Part 1.md (99%) diff --git a/translated/tech/20181123 How to Build a Netboot Server, Part 1.md b/published/20181123 How to Build a Netboot Server, Part 1.md similarity index 99% rename from translated/tech/20181123 How to Build a Netboot Server, Part 1.md rename to published/20181123 How to Build a Netboot Server, Part 1.md index 1888f4ab2b..ac64617de8 100644 --- a/translated/tech/20181123 How to Build a Netboot Server, Part 1.md +++ b/published/20181123 How to Build a Netboot Server, Part 1.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (How to Build a Netboot Server, Part 1) [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10379-1.html) 如何构建一台网络引导服务器(一) ====== From 0a6c32e789f12bfc6c40d519657a2d228eee6f02 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 00:28:46 +0800 Subject: [PATCH 1055/1143] PRF:20180912 How to turn on an LED with Fedora IoT.md @ScarboroughCoral --- ...2 How to turn on an LED with Fedora IoT.md | 87 ++++++++----------- 1 file changed, 36 insertions(+), 51 deletions(-) diff --git a/translated/tech/20180912 How to turn on an LED with Fedora IoT.md b/translated/tech/20180912 How to turn on an LED with Fedora IoT.md index 59bbc1280b..f72d8cb0bc 100644 --- a/translated/tech/20180912 How to turn on an LED with Fedora IoT.md +++ b/translated/tech/20180912 How to turn on an LED with Fedora IoT.md @@ -1,116 +1,105 @@ -# 如何使用 Fedora IoT 开启 LED 灯 +如何使用 Fedora IoT 点亮 LED 灯 +====== ![](https://fedoramagazine.org/wp-content/uploads/2018/08/LED-IoT-816x345.jpg) -你喜欢 Fedora、容器和树莓派吗?这三者结合操控 LED 会怎么样?本文介绍的是 Fedora IoT,将展示如何在树莓派上安装预览镜像。还将学习如何与 GPIO 交互以开启 LED。 +如果你喜欢 Fedora、容器,而且有一块树莓派,那么这三者结合操控 LED 会怎么样?本文介绍的是 Fedora IoT,将展示如何在树莓派上安装预览镜像。还将学习如何与 GPIO 交互以点亮 LED。 ### 什么是 Fedora IoT? -Fedora IoT 是当前 Fedora 项目的目标之一,计划成为一个完整的 Fedora 版本。Fedora IoT 将是一个在ARM(目前仅限 aarch64)例如树莓派,以及 x86_64 架构设备上运行的系统。 +Fedora IoT 是当前 Fedora 项目的目标之一,计划成为一个完整的 Fedora 版本。Fedora IoT 将是一个在 ARM(目前仅限 aarch64)设备上(例如树莓派),以及 x86_64 架构上运行的系统。 ![][1] -Fedora IoT 基于 OSTree 开发, 就像[Fedora Silverblue][2] 和以往的 [Atomic Host][3]. +Fedora IoT 基于 OSTree 开发,就像 [Fedora Silverblue][2] 和以往的 [Atomic Host][3]。 ### 下载和安装 Fedora IoT -官方 Fedora IoT 镜像将和 Fedora 29 一起发布。但是在此期间你可以下载 [Fedora 28-based 镜像][4] 来进行这个实验。 +官方 Fedora IoT 镜像将和 Fedora 29 一起发布。但是在此期间你可以下载 [基于 Fedora 28 的镜像][4] 来进行这个实验。(LCTT 译注:截止至本译文发布,[Fedora 29 已经发布了][11],但是 IoT 版本并未随同发布,或许会在 Fedora 30 一同发布?) -你有两种方法来安装这个系统:使用 dd 命令闪存SD卡,或者使用 fedora-arm-installer 工具。Fedora 的 Wiki 里面提供了更多关于[设置物理设备][5] 的信息来开发 IoT。另外,你可能需要调整第三个分区的大小。 +你有两种方法来安装这个系统:要么使用 `dd` 命令烧录 SD 卡,或者使用 `fedora-arm-installer` 工具。Fedora 的 Wiki 里面提供了为 IoT [设置物理设备][5] 的更多信息。另外,你可能需要调整第三个分区的大小。 -把 SD 卡插入到设备并运行,需要创建一个用户来完成安装。这个步骤需要串行连接或带键盘的 HDMI 显示器来与设备进行交互。 +把 SD 卡插入到设备后,你需要创建一个用户来完成安装。这个步骤需要串行连接或一个 HDMI 显示器和键盘来与设备进行交互。 当系统安装完成后,下一步就是要设置网络连接。使用你刚才创建的用户登录系统,可以使用下列方式之一完成网络连接设置: -- 如果你需要手动配置你的网络,可能需要执行类似如下命令,需要保证设置正确的网络地址: +* 如果你需要手动配置你的网络,可能需要执行类似如下命令,需要保证设置正确的网络地址: -``` + ``` $ nmcli connection add con-name cable ipv4.addresses \ 192.168.0.10/24 ipv4.gateway 192.168.0.1 \ connection.autoconnect true ipv4.dns "8.8.8.8,1.1.1.1" \ type ethernet ifname eth0 ipv4.method manual - ``` -- 如果你网络上运行着 DHCP 服务,可能需要类似如下命令: +* 如果你网络上运行着 DHCP 服务,可能需要类似如下命令: -``` + ``` $ nmcli con add type ethernet con-name cable ifname eth0 ``` - - -### **Fedora 中的 GPIO 接口** +### Fedora 中的 GPIO 接口 许多关于 Linux 上 GPIO 的教程都关注传统的 GPIO sysfis 接口。这个接口已经不推荐使用了,并且上游 Linux 内核社区由于安全和其他问题的缘故打算完全删除它。 -Fedora 已经不将这个传统的接口编译到内核了,因此在系统上没有 /sys/class/gpio 这个文件。此教程使用一个上游内核提供的一个新的字符设备 /dev/gpiochipN 。这是目前和 GPIO 交互的方式。 +Fedora 已经不将这个传统的接口编译到内核了,因此在系统上没有 `/sys/class/gpio` 这个文件。此教程使用一个上游内核提供的一个新的字符设备 `/dev/gpiochipN` 。这是目前和 GPIO 交互的方式。 -为了和这个新设备进行交互,你需要使用一个库和一系列命令行界面工具。公共命令行工具比如说 echo 和 cat 在此设备上无法正常工作。 +为了和这个新设备进行交互,你需要使用一个库和一系列命令行界面的工具。常用的命令行工具比如说 `echo` 和 `cat` 在此设备上无法正常工作。 你可以通过安装 libgpiod-utils 包来安装命令行界面工具。python3-libgpiod 包提供了相应的 Python 库。 -### **使用 Podman 来创建一个容器** +### 使用 Podman 来创建一个容器 -[Podman][6] 是一个容器运行环境,其命令行界面类似于Docker。Podman的一大优势是它不会在后台运行任何守护进程。这对于资源有限的设备尤其有用。Podman 还允许您使用 systemd 单元文件启动容器化服务。此外,它还有许多其他功能。 +[Podman][6] 是一个容器运行环境,其命令行界面类似于 Docker。Podman 的一大优势是它不会在后台运行任何守护进程。这对于资源有限的设备尤其有用。Podman 还允许您使用 systemd 单元文件启动容器化服务。此外,它还有许多其他功能。 我们使用如下两步来创建一个容器: -``` 1. 创建包含所需包的分层镜像。 2. 使用分层镜像创建一个新容器。 -``` - - -首先创建一个 Dockerfile 文件,内容如下。这些内容告诉 podman 基于可使用的最新 Fedora 镜像来构建我们的分层镜像。然后就是更新系统和安装一些软件包: +首先创建一个 Dockerfile 文件,内容如下。这些内容告诉 Podman 基于可使用的最新 Fedora 镜像来构建我们的分层镜像。然后就是更新系统和安装一些软件包: ``` FROM fedora:latest RUN dnf -y update RUN dnf -y install libgpiod-utils python3-libgpiod - ``` 这样你就完成了镜像的生成前的配置工作,这个镜像基于最新的 Fedora,而且包含了和 GPIO 交互的软件包。 -现在你就可以运行下方命令来构建你的基本镜像了: +现在你就可以运行如下命令来构建你的基本镜像了: ``` $ sudo podman build --tag fedora:gpiobase -f ./Dockerfile - ``` 你已经成功创建了你的自定义镜像。这样以后你就可以不用每次都重新搭建环境了,而是基于你创建的镜像来完成工作。 ### 使用 Podman 完成工作 -为了确认当前的镜像,可以运行下方命令: +为了确认当前的镜像是否就绪,可以运行如下命令: ``` $ sudo podman images REPOSITORY TAG IMAGE ID CREATED SIZE localhost/fedora gpiobase 67a2b2b93b4b 10 minutes ago 488MB docker.io/library/fedora latest c18042d7fac6 2 days ago 300MB - ``` -现在,启动容器并进行一些实际的实验。 容器通常是隔离的,无法访问主机系统,包括GPIO接口。 因此需要在启动容器时将其挂载在容器内。 可以使用以下命令中的 -device 选项来解决: +现在,启动容器并进行一些实际的实验。容器通常是隔离的,无法访问主机系统,包括 GPIO 接口。因此需要在启动容器时将其挂载在容器内。可以使用以下命令中的 `-device` 选项来解决: ``` $ sudo podman run -it --name gpioexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash - ``` -运行之后就进入了正在运行的容器中。 在继续之前,这里有一些容器命令。 输入 exit 或者按下 **Ctrl+D** 来退出容器。 +运行之后就进入了正在运行的容器中。在继续之前,这里有一些容器命令。输入 `exit` 或者按下 `Ctrl+D` 来退出容器。 -显示所有存在的容器可以运行如下命令: +显示所有存在的容器可以运行如下命令,这包括当前没有运行的,比如你刚刚创建的那个: ``` $ sudo podman container ls -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 64e661d5d4e8 localhost/fedora:gpiobase /bin/bash 37 seconds ago Exited (0) Less than a second ago gpioexperiment - ``` 使用如下命令创建一个新的容器: @@ -127,55 +116,50 @@ $ sudo podman rm newexperiment ``` -### **开启 LED 灯** +### 点亮 LED 灯 -现在可以使用已创建的容器。 如果容器已经退出,请使用以下命令再次启动它: +现在可以使用已创建的容器。如果已经从容器退出,请使用以下命令再次启动它: ``` $ sudo podman start -ia gpioexperiment - ``` -如前所述,可以使用 Fedora 中 libgpiod-utils 包提供的 CLI 工具。 要列出可用的 GPIO 芯片可以使用如下命令: +如前所述,可以使用 Fedora 中 libgpiod-utils 包提供的命令行工具。要列出可用的 GPIO 芯片可以使用如下命令: ``` $ gpiodetect gpiochip0 [pinctrl-bcm2835] (54 lines) - ``` -要获取特定芯片的公开列表,请运行: +要获取特定芯片的连线列表,请运行: ``` $ gpioinfo gpiochip0 - ``` -请注意,物理引脚数与前一个命令打印的行数之间没有相关性。 重要的是 BCM 编号,如 [pinout.xyz][7] 所示。 建议不要使用没有相应 BCM 编号的线路。 +请注意,物理引脚数与前一个命令所打印的连线数之间没有相关性。重要的是 BCM 编号,如 [pinout.xyz][7] 所示。建议不要使用没有相应 BCM 编号的连线。 -现在,将 LED 连接到物理引脚40,也就是 BCM 21。请记住:LED的短腿(负极,称为阴极)必须连接到带有330欧姆电阻的树莓派的 GND 引脚, 并且长腿(阳极)到物理引脚40。 +现在,将 LED 连接到物理引脚 40,也就是 BCM 21。请记住:LED 的短腿(负极,称为阴极)必须连接到带有 330 欧姆电阻的树莓派的 GND 引脚, 并且长腿(阳极)到物理引脚 40。 -运行以下命令打开LED。,按下 **Ctrl + C ** 关闭: +运行以下命令点亮 LED,按下 `Ctrl + C` 关闭: ``` $ gpioset --mode=wait gpiochip0 21=1 - ``` -要点亮一段时间,请添加 -b(在后台运行)和 -s NUM(多少秒)参数,如下所示。 例如,要点亮 LED 5秒钟,运行如下命令: +要点亮一段时间,请添加 `-b`(在后台运行)和 `-s NUM`(多少秒)参数,如下所示。 例如,要点亮 LED 5 秒钟,运行如下命令: ``` $ gpioset -b -s 5 --mode=time gpiochip0 21=1 - ``` -另一个有用的命令是 gpioget。 它可以获得引脚的状态(高或低),可用于检测按钮和开关。 +另一个有用的命令是 `gpioget`。 它可以获得引脚的状态(高或低),可用于检测按钮和开关。 ![Closeup of LED connection with GPIO][8] -### **总结** +### 总结 -你也可以使用 Python 操控 LED - [这里有一些例子][9]。 也可以在容器内使用 i2c 设备。 此外,Podman 与此 Fedora 版本并不严格相关。 你可以在任何现有的 Fedora Edition 上安装它,或者在 Fedora 中使用两个基于 OSTree 的新系统进行尝试:[Fedora Silverblue][2] 和 [Fedora CoreOS][10]。 +你也可以使用 Python 操控 LED —— [这里有一些例子][9]。 也可以在容器内使用 i2c 设备。 此外,Podman 与此 Fedora 版本并不严格相关。你可以在任何现有的 Fedora 版本上安装它,或者在 Fedora 中使用两个基于 OSTree 的新系统进行尝试:[Fedora Silverblue][2] 和 [Fedora CoreOS][10]。 ------ @@ -184,7 +168,7 @@ via: https://fedoramagazine.org/turnon-led-fedora-iot/ 作者:[Alessio Ciregia][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[ScarboroughCoral](https://github.com/ScarboroughCoral) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -199,3 +183,4 @@ via: https://fedoramagazine.org/turnon-led-fedora-iot/ [8]: https://fedoramagazine.org/wp-content/uploads/2018/08/breadboard-1024x768.png [9]: https://github.com/brgl/libgpiod/tree/master/bindings/python/examples [10]: https://coreos.fedoraproject.org/ +[11]: https://fedoramagazine.org/announcing-fedora-29/ From 0b47390027f6c47b7aaeb9eda119c43a61515d79 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 00:29:13 +0800 Subject: [PATCH 1056/1143] PUB:20180912 How to turn on an LED with Fedora IoT.md @ScarboroughCoral https://linux.cn/article-10380-1.html --- .../20180912 How to turn on an LED with Fedora IoT.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180912 How to turn on an LED with Fedora IoT.md (100%) diff --git a/translated/tech/20180912 How to turn on an LED with Fedora IoT.md b/published/20180912 How to turn on an LED with Fedora IoT.md similarity index 100% rename from translated/tech/20180912 How to turn on an LED with Fedora IoT.md rename to published/20180912 How to turn on an LED with Fedora IoT.md From 861c58e526212cae696ef929fc33c0a4af3f91dc Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 01:31:15 +0800 Subject: [PATCH 1057/1143] PRF:20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @jlztan --- ...tmas In Linux Way With These Wallpapers.md | 79 ++++++++++++------- 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md index 3c282ce7d5..5bd416a424 100644 --- a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -1,24 +1,38 @@ [#]: collector: (lujun9972) [#]: translator: (jlztan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers) [#]: via: (https://itsfoss.com/christmas-linux-wallpaper/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: url: ( ) -使用这些壁纸以 Linux 的方式庆祝圣诞节 +以 Linux 的方式庆祝圣诞节 ====== -当前正是假日季节,很多人可能已经在庆祝圣诞节了。我代表 It's FOSS 团队祝你圣诞快乐,新年快乐。 +当前正是假日季,很多人可能已经在庆祝圣诞节了。祝你圣诞快乐,新年快乐。 -为了延续节日氛围,我将向你展示一些非常棒的圣诞主题 [Linux壁纸][1]。在呈现这些壁纸之前,先来看一棵 Linux 终端下的圣诞树。 +为了延续节日氛围,我将向你展示一些非常棒的圣诞主题的 [Linux 壁纸][1]。在呈现这些壁纸之前,先来看一棵 Linux 终端下的圣诞树。 + +### 让你的桌面飘雪(针对 GNOME 用户) + +- [Let it Snow on Your Linux Desktop](https://youtu.be/1QI1ludzZuA) + +如果您在 Ubuntu 18.04 或任何其他 Linux 发行版中使用 GNOME 桌面,您可以使用一个小的 [GNOME 扩展][55]并在桌面上飘雪。 + +您可以从软件中心或 GNOME 扩展网站获取此 gsnow 扩展。我建议您阅读一些关于[使用 GNOME 扩展][55]的内容。 + +安装此扩展程序后,您会在顶部面板上看到一个小雪花图标。 如果您单击一次,您会看到桌面屏幕上的小絮状物掉落。 + +![](https://itsfoss.com/wp-content/uploads/2018/12/snowfall-on-linux-desktop-1.webm) + +你可以再次点击该图标来禁止雪花落下。 ### 在 Linux 终端下显示圣诞树 -圣诞树的效果如 [这个页面](https://giphy.com/embed/xUNda6KphvbpYxL3tm) 所示。 +![Display Christmas Tree in Linux Terminal](https://i.giphy.com/xUNda6KphvbpYxL3tm.gif) -使用以下命令在终端中显示一棵动画圣诞树: +如果你想要在终端里显示一个动画的圣诞树,你可以使用如下命令: ``` curl https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh | bash @@ -40,7 +54,7 @@ perl -MCPAN -e 'install Acme::POE::Tree' 你可以阅读 [原文][5] 来了解更多信息。 -## 下载 Linux 圣诞主题壁纸 +### 下载 Linux 圣诞主题壁纸 所有这些 Linux 圣诞主题壁纸都是由 Mark Riedesel 制作的,你可以在 [他的网站][6] 上找到很多其他艺术品。 @@ -48,87 +62,95 @@ perl -MCPAN -e 'install Acme::POE::Tree' 注意一个小地方,这里显示的图片都是高度压缩的,因此你要通过图片下方提供的链接进行下载。 +![Christmas Linux Wallpaper][56] + +*[下载此壁纸][57]* + ![Christmas Linux Wallpaper][7] -[下载此壁纸][8] +*[下载此壁纸][8]* [![Christmas Linux Wallpapers][9]][10] -[下载此壁纸][11] +*[下载此壁纸][11]* [![Christmas Linux Wallpapers][12]][13] -[下载此壁纸][14] +*[下载此壁纸][14]* [![Christmas Linux Wallpapers][15]][16] -[下载此壁纸][17] +*[下载此壁纸][17]* [![Christmas Linux Wallpapers][18]][19] -[下载此壁纸][20] +*[下载此壁纸][20]* [![Christmas Linux Wallpapers][21]][22] -[下载此壁纸][23] +*[下载此壁纸][23]* [![Christmas Linux Wallpapers][24]][25] -[下载此壁纸][26] +*[下载此壁纸][26]* [![Christmas Linux Wallpapers][27]][28] -[下载此壁纸][29] +*[下载此壁纸][29]* [![Christmas Linux Wallpapers][30]][31] -[下载此壁纸][32] +*[下载此壁纸][32]* [![Christmas Linux Wallpapers][33]][34] -[下载此壁纸][35] +*[下载此壁纸][35]* [![Christmas Linux Wallpapers][36]][37] -[下载此壁纸][38] +*[下载此壁纸][38]* [![Christmas Linux Wallpapers][39]][40] -[下载此壁纸][41] +*[下载此壁纸][41]* [![Christmas Linux Wallpapers][42]][43] -[下载此壁纸][44] +*[下载此壁纸][44]* [![Christmas Linux Wallpapers][45]][46] -[下载此壁纸][47] +*[下载此壁纸][47]* [![Christmas Linux Wallpapers][48]][49] -[下载此壁纸][50] +*[下载此壁纸][50]* ### 福利:Linux 圣诞颂歌 这是给你的一份福利,给像我们一样的 Linux 爱好者的关于 Linux 的圣诞颂歌。 -在 [计算机世界的一篇文章][51] 中,[Sandra Henry-Stocker][52] 分享了这些圣诞颂歌。摘录片段如下: +在 [《计算机世界》的一篇文章][51] 中,[Sandra Henry-Stocker][52] 分享了这些圣诞颂歌。摘录片段如下: 这一段用的 [Chestnuts Roasting on an Open Fire][53] 的曲调: -> Running merrily on open source +> Running merrily on open source +> > With users happy as can be +> > We’re using Linux and getting lots done + > And happy everything is free 这一段用的 [The Twelve Days of Christmas][54] 的曲调: -> On my first day with Linux, my admin gave to me a password and a login ID +> On my first day with Linux, my admin gave to me a password and a login ID +> > On my second day with Linux my admin gave to me two new commands and a password and a login ID 在 [这里][51] 阅读完整的颂歌。 -祝你享受 Linux! +Linux 快乐! ------ @@ -137,7 +159,7 @@ via: https://itsfoss.com/christmas-linux-wallpaper/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[jlztan](https://github.com/jlztan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -197,3 +219,6 @@ via: https://itsfoss.com/christmas-linux-wallpaper/ [52]: https://twitter.com/bugfarm [53]: https://www.youtube.com/watch?v=dhzxQCTCI3E [54]: https://www.youtube.com/watch?v=oyEyMjdD2uk +[55]: https://itsfoss.com/gnome-shell-extensions/ +[56]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2018.jpeg?w=800&ssl=1 +[57]: http://www.klowner.com/wallery/christmas_tux_2018/download/ChristmasTux2018_4K_3840x2160.png From f4d4fcbd6a1450f476790a478e07b485f56987f7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 01:32:10 +0800 Subject: [PATCH 1058/1143] PUB:20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @jlztan https://linux.cn/article-10381-1.html --- ... Celebrate Christmas In Linux Way With These Wallpapers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md (99%) diff --git a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/published/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md similarity index 99% rename from translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md rename to published/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md index 5bd416a424..3aa2e6f3ea 100644 --- a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ b/published/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (jlztan) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers) [#]: via: (https://itsfoss.com/christmas-linux-wallpaper/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10381-1.html) 以 Linux 的方式庆祝圣诞节 ====== From b79701152bd84f5d8ba01c4737947967656861f9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Dec 2018 08:44:40 +0800 Subject: [PATCH 1059/1143] translated --- ...1208 Play Tetris at your Linux terminal.md | 57 ------------------- ...1208 Play Tetris at your Linux terminal.md | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+), 57 deletions(-) delete mode 100644 sources/tech/20181208 Play Tetris at your Linux terminal.md create mode 100644 translated/tech/20181208 Play Tetris at your Linux terminal.md diff --git a/sources/tech/20181208 Play Tetris at your Linux terminal.md b/sources/tech/20181208 Play Tetris at your Linux terminal.md deleted file mode 100644 index db1fe62c24..0000000000 --- a/sources/tech/20181208 Play Tetris at your Linux terminal.md +++ /dev/null @@ -1,57 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Play Tetris at your Linux terminal) -[#]: via: (https://opensource.com/article/18/12/linux-toy-tetris) -[#]: author: (Jason Baker https://opensource.com/users/jason-baker) - -Play Tetris at your Linux terminal -====== - -Recreate the magic of the 1980s with everyone's favorite tile-matching game, Tetris. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-tetris.png?itok=_UXtpgzN) - -Thanks for joining us for today's installment of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. Even I'm not quite sure, but generally, it could be a game or any simple diversion that helps you have fun at the terminal. - -It's quite possible that some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. - -I promised when I started this series I'd be including games, but so far I've neglected to, so let's fix that with today's selection: Tetris. - -Tetris and I are almost exactly the same age, having first come into the world in the summer of 1984. Instead of rural North Carolina, though, Tetris originated in Moscow in what was at the time the Soviet Union. - -After taking the world by storm, Tetris was cloned many, many times. I would suspect you could find a Tetris clone for just about any operating system in any language you looked for. Seriously, go look. There are some fun ones out there. - -The [version][1] I'm bringing you for today's command-line toy is [written in Haskell,][1] and it's one of the better-done versions I've seen, with on-screen preview, score, help, and a clean look. - -If you're willing to run a compiled binary from an untrusted source (I wouldn't recommend it), you can grab that directly, but for a safer approach, it's also easy to use a containerized version with [dex][2], or to install from source with [stack][3]. - -This particular Tetris clone is by Sam Tay and available under a BSD license. [Check it out][1]! - -![](https://opensource.com/sites/default/files/uploads/linux-toy-tetris-animated.gif) - -If you've got your own favorite Tetris clone (or maybe you've written your own?), let us know! - -Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. - -Check out yesterday's toy, [Plan your own holiday calendar at the Linux command line][4], and check back tomorrow for another! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/linux-toy-tetris - -作者:[Jason Baker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[b]: https://github.com/lujun9972 -[1]: https://github.com/samtay/tetris -[2]: https://github.com/dockerland/dex -[3]: https://docs.haskellstack.org/en/stable/README/#how-to-install -[4]: https://opensource.com/article/18/12/linux-toy-cal diff --git a/translated/tech/20181208 Play Tetris at your Linux terminal.md b/translated/tech/20181208 Play Tetris at your Linux terminal.md new file mode 100644 index 0000000000..110990cc61 --- /dev/null +++ b/translated/tech/20181208 Play Tetris at your Linux terminal.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Play Tetris at your Linux terminal) +[#]: via: (https://opensource.com/article/18/12/linux-toy-tetris) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +在 Linux 终端上玩俄罗斯方块 +====== + +用每个人最喜欢的砖块配对游戏俄罗斯方块重新创造 20 世纪 80 年代的魔力。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-tetris.png?itok=_UXtpgzN) + +感谢你来浏览我们今天的 Linux 命令行玩具日历。如果这是你第一次访问该系列,你可能会问自己,什么是命令行玩具。即使我不太确定,但一般来说,它可能是一个游戏或任何消遣,可以帮助你在终端获得乐趣。 + +很可能你们中的一些人之前会看到过我们日历中的各种选择,但我们希望每个人至少遇到一件新事物。 + +我承诺在我开始这个系列时,我会介绍游戏,但到目前为止,我忽略了它,所以我们今天的选择就是游戏:俄罗斯方块。 + +俄罗斯方块和我差不多年纪,都在 1984 年夏天来到世界。不过,俄罗斯方块不是来自北卡罗来纳州的农村地区,而是来自当时苏联的莫斯科。。 + +在风靡世界之后,俄罗斯方块被克隆过很多次。我怀疑你可以找到任何你想找的任何语言、操作系统的俄罗斯方块的克隆。说真的,去看看吧。会有一些有趣的。 + +我今天带来的命令行[版本][1]是[用 Haskell 编写]的,它是我见过的做得更好的版本之一,有屏幕预览、得分、帮助、干净的外观。 + +如果你愿意从不受信任的来源运行已编译的二进制文件(我不推荐它),你可以直接获取它,但有个更安全的方法,使用 [dex][2] 的容器化版本也很容易,或者使用 [stack][3] 从源代码安装。 + +这个俄罗斯方块克隆版是由 Sam Tay 编写的,并且在 BSD 许可证下。[请看这里][1]! + +![](https://opensource.com/sites/default/files/uploads/linux-toy-tetris-animated.gif) + +如果你有自己喜欢的俄罗斯方块克隆版(或者你自己写的?),请告诉我们! + +你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 + +查看昨天的玩具,[在 Linux 命令行中计划你自己的假期日历][4],明天再回来查看! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-tetris + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://github.com/samtay/tetris +[2]: https://github.com/dockerland/dex +[3]: https://docs.haskellstack.org/en/stable/README/#how-to-install +[4]: https://opensource.com/article/18/12/linux-toy-cal \ No newline at end of file From 4f3d40b41af408e55a32f63aaacfb6da58c1b084 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Dec 2018 09:00:02 +0800 Subject: [PATCH 1060/1143] Rename \20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md to 20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md --- ...on is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "sources/talk/\\20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md" => sources/talk/20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md (100%) diff --git "a/sources/talk/\\20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md" b/sources/talk/20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md similarity index 100% rename from "sources/talk/\\20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md" rename to sources/talk/20181219 Fragmentation is Why Linux Hasn-t Succeeded on Desktop- Linus Torvalds.md From 4a1613b4caef0c54d8fde93b3e4c3870fb3b7ac6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 25 Dec 2018 09:04:33 +0800 Subject: [PATCH 1061/1143] translating --- .../tech/20181221 Listen to the radio at the Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181221 Listen to the radio at the Linux terminal.md b/sources/tech/20181221 Listen to the radio at the Linux terminal.md index 268ba37568..1d4b241ccb 100644 --- a/sources/tech/20181221 Listen to the radio at the Linux terminal.md +++ b/sources/tech/20181221 Listen to the radio at the Linux terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a6af6f8bc235092736ed32104a87ead725d4aef1 Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Tue, 25 Dec 2018 13:36:29 +0800 Subject: [PATCH 1062/1143] Translating How to Update Ubuntu. --- ...buntu -Terminal - GUI Methods- It-s FOSS.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md index 85d88129e7..13d393b381 100644 --- a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md +++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md @@ -121,25 +121,25 @@ apt list --upgradable sudo apt autoremove ``` -#### 在 Ubuntu Server 中热修复内核以避免重启 +#### 在 Ubuntu Server 中内核热修复以避免重启 -In case of a Linux kernel updates, you’ll have to restart the system after the update. This is an issue when you don’t want downtime for your server. +如果是 Linux 内核更新,你将需要在系统更新后重启。当你不希望服务器停机时,这将是一个问题。 -[Live patching][15] feature allows the patching of Linux kernel while the kernel is still running. In other words, you don’t have to reboot your system. +[热修复][15]功能允许Linux内核在持续运行时打补丁。换句话说就是你不需要重启你的系统。 -If you manage servers, you may want to [enable live patching in Ubuntu][16]. +如果你在管理服务器,你可能需要[在 Ubuntu 中启用热修复][16]。 #### 版本升级是不同的 -The updates discussed here is to keep your Ubuntu install fresh and updated. It doesn’t cover the [version upgrades][17] (for example upgrading Ubuntu 16.04 to 18.04). +本文讨论的更新是使你安装的 Ubuntu 保持最新。它不包括[版本升级][17](例如从 Ubuntu 16.04 升级到 18.04)。 -[Ubuntu version][18] upgrades are entirely a different thing. It updates the entire operating system core. You need to make proper backups before starting this lengthy process. +[Ubuntu 版本][18] 升级完全是另一回事。它更新整个操作系统核心。你需要在这个漫长的过程开始前做好备份。 ### 总结 -I hope you liked this tutorial on updating the Ubuntu system and you learned a few new things. +我希望你喜欢这个关于 Ubuntu 系统更新的教程并学到一些新东西。 -If you have any questions, please fee free to ask. If you are an experienced Linux users and have some tip that can make this tutorial more useful, please share it with the rest of us. +如果你有其他问题,请随时提出。如果你是一位经验丰富的 Linux 用户并且有些更好的技巧,请同我们分享。 -------------------------------------------------------------------------------- @@ -147,7 +147,7 @@ via: https://itsfoss.com/update-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[LazyWolfLin](https://github.com/LazyWolfLin) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 71af7c7c1083d003517db5621245fd2f95b3a9f4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 14:48:05 +0800 Subject: [PATCH 1063/1143] PRF:20180623 The IBM 029 Card Punch.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wwhio 翻译的很棒!经典的文章。 --- .../talk/20180623 The IBM 029 Card Punch.md | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md index e13a10593c..07002cef6e 100644 --- a/translated/talk/20180623 The IBM 029 Card Punch.md +++ b/translated/talk/20180623 The IBM 029 Card Punch.md @@ -1,46 +1,49 @@ IBM 029 型打孔机 ====== -我知道这很学院派,可一行超过 80 个字符的代码还是让我抓狂。我也在网上见过不少人认为即在现代视网膜屏幕下也应当采用行长度为 80 个字符的标准,可他们都不理解我对破坏这一标准的怒火,就算 1 个字符也不行。 -在这一标准的黄金时期,一行代码的长度几乎不会超过 80 个字符的限制。在那时,这一限制是物理的,没有第 81 列用于存放第 81 个字符。每一个试图把函数名起的又长又臭的程序员都会在短暂的愉悦后迎来更多的麻烦,而这仅仅时因为没有足够的空间放下整个函数的声明。 +我知道这很学院派,可一行超过 80 个字符的代码还是让我抓狂。我也在网上见过不少人认为即使在现代的视网膜屏幕下也应当采用行长度为 80 个字符的标准,可他们都不理解我对破坏这一标准的怒火,就算多 1 个字符也不行。 -这一黄金时期也是打孔卡编程时期。在 20 世纪 60 年代, IBM 打孔卡的特性,也就是打孔卡的长度为 80 个字符成为了打孔卡的标准。这一标准在后来的电传打字机和哑终端时期得以延续,并逐渐成为操作系统中隐藏的细节。时至今日,即使我们用上了更大、更好的屏幕,偏向于使用更长的标识符而不是类似 `iswcntrl()` 这样令人难以猜测的函数名,可当你打开新的终端模拟器窗口时,默认的宽度依然是 80 个字符。 +在这一标准的黄金时期,一行代码的长度几乎不会超过 80 个字符的限制。在那时,这一限制是物理的,没有第 81 列用于存放第 81 个字符。每一个试图把函数名起的又长又臭的程序员都会在短暂的愉悦后迎来更多的麻烦,而这仅仅是因为没有足够的空间放下整个函数的声明。 -从 Quora 上的很多问题中可以发现,很多人并不能想象如何使用打孔卡给计算机编程。我承认,在很长的一段时间里我也不能理解卡编程成是如何工作的,因为这让我想到有很多劳工不停的给这些打孔卡打孔。当然,这是一个误解,程序员不需要亲自给打孔卡打孔,就像是火车调度员不用亲自扳道岔。程序员们有打孔机(也被称为键控打孔机key punches),这让他们可以使用打字机式的键盘给打孔卡打孔。这样的设备在 19 世纪 90 年代时就已经不是什么新技术了。 +这一黄金时期也是打孔卡punch card编程时期。在 20 世纪 60 年代,IBM 打孔卡设立了标准,这个标准就是打孔卡的宽度为 80 列。这个 80 列标准在后来的电传打字机和哑终端时期得以延续,并逐渐成为操作系统中隐藏的细节。时至今日,即使我们用上了更大、更好的屏幕,偏向于使用更长的标识符而不是类似 `iswcntrl()` 这样令人难以猜测的函数名,可当你打开新的终端模拟器窗口时,默认的宽度依然是 80 个字符。 + +从 Quora 上的很多问题中可以发现,很多人并不能想象如何使用打孔卡给计算机编程。我承认,在很长的一段时间里我也不能理解打孔卡编程是如何工作的,因为这让我想到就像劳工一样不停的给这些打孔卡打孔。当然,这是一个误解,程序员不需要亲自给打孔卡打孔,就像是火车调度员不用亲自扳道岔。程序员们有打孔机card punch machines(也被称为键控打孔机key punches),这让他们可以使用打字机式的键盘给打孔卡打孔。这样的设备在 19 世纪 90 年代时就已经不是什么新技术了。 那时,最为广泛使用的打孔机之一便是 IBM 029 型打孔机。就算在今天,它也许是最棒的打孔机。 ![][1] -IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。 System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样, 029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比, 029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在数字区numeric fields左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做左填充left-padding的程序员。 -(译者注:这项功能需要额外的 4 张 [标准模块系统卡SMS card](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如设置数字区域长度为 6 列时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch)) +IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样,029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比,029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在数字区numeric field左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做左填充left-padding的程序员。(LCTT 译注:这项功能需要额外的 4 张 [标准模块系统卡](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)SMS card才能使用。例如设置数字区域长度为 6 列时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch)) -等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年, IBM 的产品目录中才出现 029 型打孔机的身影。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了他的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用“在线”的传输方式"online" mode of communication。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为批任务batch job执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让他成为那时最流行的数据存储方式了。那时的程序是书架上一落的打孔卡而不是硬盘里的一堆文件。 +等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年,IBM 的产品目录中还会出现 029 型打孔机的身影 [^1]。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了它的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用“在线”的传输方式"online" mode of communication。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为批任务batch job执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让它成为那时最流行的数据存储方式了。那时的程序是书架上一摞打孔卡而不是硬盘里的一堆文件。 -那么实际使用 IBM 029 型打孔机是个什么样子呢?这很难向没有实际看过打孔卡的人解释。一张打孔卡通常有12行80列。打孔卡下面是从 1 到 9 的数字行digit rows,打孔卡上的每一列都有这些行所对应的数字。最上面的三行是空间行"zone" rows,通常由两行空白行和一行 0 行组成。第 12 行是打孔卡最顶层的行,接下来是 11 行,随后是从数字 0 到 9 所在的行。这个有点让人感到困惑的顺序的原因是打孔卡的上边缘被称为12 边12 edge、下边缘被称为 9 边9 edge。那时,为了让打孔卡便于整理,常常会剪去打孔卡的一个角。 +那么实际使用 IBM 029 型打孔机是个什么样子呢?这很难向没有实际看过打孔卡的人解释。一张打孔卡通常有 12 行 80 列。打孔卡下面是从 1 到 9 的数字行digit rows,打孔卡上的每一列都有这些行所对应的数字。最上面的三行是空间行"zone" rows,通常由两行空白行和一行 0 行组成。第 12 行是打孔卡最顶部的行,接下来是 11 行,随后是从数字 0 到 9 所在的行。这个有点让人感到困惑的顺序的原因是打孔卡的上边缘被称为12 边12 edge、下边缘被称为 9 边9 edge。那时,为了让打孔卡便于整理,常常会剪去打孔卡的一个角。 ![][2] -(译者注:可参考[EBCDIC 编码](https://zh.wikipedia.org/wiki/EBCDIC)) -在打孔卡发明之初,孔洞的形状是圆形的,但是 IBM 最终意识到如果使用窄长方形作为孔洞,一张卡就可以放下更多的列了。每一列中孔洞的不同组合就可以表达不同的字符。像 029 型这样的拥有人性化设计的打孔机除了完成本质的打孔任务外,还会在打孔卡最上方打印出每一列所对应的字符。输入是数字就在对应的数字行上打孔。输入的是字母或符号就用一个在空间列的孔和一或俩个在数字列的孔的组合表示,例如字母 A 就用一个在第 12 空间行的空和一个数字 1 所在行的孔表示。这是一种顺序编码,在第一台打孔机被发明后,也叫 Hollerith 编码。这种编码只能表示相对较小的一套字符集,小写字母就没有包含在这套字符集中,但它的优势在于保留了打孔卡的结构强度。如果直接使用二进制编码,打孔卡可能会因为孔洞过于密集而断裂。 +(LCTT 译注:可参考[EBCDIC 编码](https://zh.wikipedia.org/wiki/EBCDIC)) -打孔卡也有不同。在 20 世纪 60 年代,80 列虽然是标准,但表达的方式不一定相同。基础打孔卡是无标注的,但用于 COBOL 编程的打孔卡会把最后的 8 列保留,供标识数保存使用。这一标识数可以在打孔卡被打乱 (例如一叠打孔卡掉在地上了) 后用于自动排序。此外,第 7 列被用于表示本张打孔卡上的是否是上一张打孔卡一起构成一条语句。也就是说当你真的对 80 字符的限制感到绝望的时候,还可以用两张卡甚至更多的卡拼接成一条长语句。用于 FORTRAN 编程的打孔卡和 COBOL 打孔卡类似,但是定义的列不同。大学里使用的打孔卡通常会由其计算机中心加上水印,其他的设计则会在如 [1976 年美国独立 200 周年][3] 的特殊场合才会加入。 +在打孔卡发明之初,孔洞的形状是圆形的,但是 IBM 最终意识到如果使用窄长方形作为孔洞,一张卡就可以放下更多的列了。每一列中孔洞的不同组合就可以表达不同的字符。像 029 型这样的拥有人性化设计的打孔机除了完成本质的打孔任务外,还会在打孔卡最上方打印出每一列所对应的字符。输入是数字就在对应的数字行上打孔。输入的是字母或符号就用一个在空间列的孔和一或俩个在数字列的孔的组合表示,例如字母 A 就用一个在第 12 空间行的空和一个数字 1 所在行的孔表示。这是一种顺序编码,在第一台打孔机被发明后,也叫 Hollerith 编码。这种编码只能表示相对较小的一套字符集,小写字母就没有包含在这套字符集中。如今一些聪明的工程师可能想知道为什么打卡不干脆使用二进制编码 —— 毕竟,有 12 行,你可以编码超过 4000 个字符。 使用 Hollerith 编码是因为它确保在单个列中出现不超过三个孔。这保留了卡的结构强度。二进制编码会带来太多的孔,会因为孔洞过于密集而断裂。 -最终,这些打孔卡都要被计算机读取和计算。 IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕, System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是扩展的二进制十数交换码Extended Binary Coded Decimal Interchange Code,简写为 EBCDIC 编码。它的源自于早期打孔卡所使用的 BCDIDC 编码,这一 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写玩程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。 +打孔卡也有不同。在 20 世纪 60 年代,80 列虽然是标准,但表达的方式不一定相同。基础打孔卡是无标注的,但用于 COBOL 编程的打孔卡会把最后的 8 列保留,供标识数保存使用。这一标识数可以在打孔卡被打乱 (例如一叠打孔卡掉在地上了) 后用于自动排序。此外,第 7 列被用于表示本张打孔卡上的是否与上一张打孔卡一起构成一条语句。也就是说当你真的对 80 字符的限制感到绝望的时候,还可以用两张卡甚至更多的卡拼接成一条长语句。用于 FORTRAN 编程的打孔卡和 COBOL 打孔卡类似,但是定义的列不同。大学里使用的打孔卡通常会由其计算机中心加上水印,其它的设计则会在如 [1976 年美国独立 200 周年][3] 的特殊场合才会加入。 -程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学University of Michigan在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。 +最终,这些打孔卡都要被计算机读取和计算。IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片[^2] 。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕,System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是扩增二进式十进交换码Extended Binary Coded Decimal Interchange Code,简写为 EBCDIC 编码。它是一种二进制编码,可以追溯自早期打孔卡所使用的 BCDIDC 编码 —— 其 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写完程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。 + +程序员们真正能见到的是很多打孔机。029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学University of Michigan计算机中心在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。 029 型打孔机的结构围绕着一个打孔卡穿过机器的 U 形轨道开始。使用打孔机时,右手边也就是 U 形轨道的右侧顶部是进卡卡槽hopper,使用前通常在里面放入一叠未使用的打孔卡。虽然 029 型打孔机主要使用 80 列打孔卡,但在需要的情况下也可以使用更小号的打孔卡。在打孔机的使用过程中,打孔卡离开轨道右上端的进卡卡槽,顺着 U 形轨道移动并最终进入左上端的出卡卡槽stacker。这一流程可以保证出卡卡槽中的打孔卡按打孔时的先后顺序排列。 -029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入FEED” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放REL (for release)” 键完成上面的操作。 +029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入FEED” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放REL” 键完成上面的操作。 -在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原unpunched,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。 +在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原unpunched,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。 -实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “重复DUP (for duplicate)” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。 +实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列重新打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “重复DUP” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。 + +(LCTT 译注:有一种说法是“补丁”这个用于对已经发布的软件进行修复的术语来源于对打孔纸带或打孔卡上打错的孔贴上补丁的做法。可能对于长长的一卷打孔纸带来说,由于个别字母的错误而整个废弃成本过高,会采用“补丁”的方式;而对于这种单张式的打孔卡来说,重新打印一张正确的更为方便。) “重复”按键允许 029 型打孔机的操作员手动调用重复的函数。但是 029 型打孔机还可以设置为自动重复。当用于记录数据而不是编程时,这项功能十分有效。举个例子,当用打孔卡来记录大学生的信息时,每张卡片上都需要输入学生的宿舍楼的名字,如果发现所输入信息的学生都在同一栋楼,就可以使用 029 型打孔机的自动重复功能来完成宿舍楼名称的填写。 -像这样的自动化操作可以通过打孔卡给 029 型打孔机编程控制。安装打孔卡的圆柱形装置drum就在 U 形轨道中间部分的右上角。通过使用 029 型在打孔卡上写下程序,然后把打孔卡的装入圆柱形装置,再将其安装到打孔机内后,就完成了一次给 029 型打孔机的编程任务。用户可以通过这种方式对打孔卡的每一列都按需要定义不同的自动化操作。029 型打孔机允许指定某些列重复上一张打孔卡相同位置的字符,这就是它能更快的输入学生信息的理由。它还允许指定某些列只能输入数字或者字母,指定特定的列为空或者到某一列时就直接跳过一整张打孔卡。这样的可编程特性使它在输入拥有固定格式的数据时效率很高。密歇根大学制作的[进阶教学视频][5]包括了给 029 型打孔机编程的过程,如果你已经掌握了它的基础操作,就快去看看吧。 +像这样的自动化操作可以通过程序鼓program drum编程到 029 型打孔机里面。程序鼓就安装在打孔操作区上方的 U 形轨道中间部分的右上角。通过在打孔卡上写下程序,然后把打孔卡装入程序鼓中,就完成了一次给 029 型打孔机的编程任务。用户可以通过这种方式对打孔卡的每一列都按需要定义不同的自动化操作。029 型打孔机允许指定某些列重复上一张打孔卡相同位置的字符,这就是它能更快的输入学生信息的理由。它还允许指定某些列只能输入数字或者字母,指定特定的列为空或者到某一列时就直接跳过一整张打孔卡。编程鼓使它在打孔特定列有特殊含义的固定模式卡片时很容易。密歇根大学制作的另一个[进阶教学视频][5]包括了给 029 型打孔机编程的过程,如果你已经掌握了它的基础操作,就快去看看吧。 这会儿,无论你是否看了密歇根大学制作的视频,都会感叹打孔机的操作之简便。虽然修正错误的过程很乏味,但除此之外,操作一台打孔机并不像想象的那样复杂。我甚至可以想象打孔卡之间的无缝切换让 COBOL 和 FORTRAN 程序员忘记了他们的程序是打在不同的打孔卡上而不是写在一个连续的文本文件内。另一方面,思考一下打孔机是如何影响编程语言的发展也是很有趣的,虽然它仅仅是一台输入设备。结构化编程最终会出现并鼓励程序员把整个代码块视为一个整体,但可以想象打孔卡程序员们强调每一行的作用且难以认同结构化编程的场景。同时你能够理解他们为什么不把代码块闭合所使用的括号放在单独的一行,只是因为这样会浪费打孔卡。 @@ -48,6 +51,9 @@ IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件 喜欢吗?这里每两周都会发表一篇这样的文章。请在推特上关注我们 [@TwoBitHistory][7] 或者订阅我们的 [RSS][8],这样你就能在第一时间收到新文章的通知。 +[^1]: “IBM 29 Card Punch,” IBM Archives, accessed June 23, 2018, https://www-03.ibm.com/ibm/history/exhibits/vintage/vintage_4506VV4002.html. +[^2]: IBM, IBM 2540 Component Description and Operation Procedures (Rochester, MN: IBM Product Publications, 1965), September 06, 2009, accessed June 23, 2018, http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/25xx/A21-9033-1_2540_Card_Punch_Component_Description_1965.pdf. + -------------------------------------------------------------------------------- via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html @@ -55,7 +61,7 @@ via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html 作者:[Two-Bit History][a] 选题:[lujun9972][b] 译者:[wwhio](https://github.com/wwhio) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 441afeddb9a87fdf9b6dbf9d24e3fc9e3aefcd03 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 14:48:32 +0800 Subject: [PATCH 1064/1143] PUB:20180623 The IBM 029 Card Punch.md @wwhio https://linux.cn/article-10382-1.html --- {translated/talk => published}/20180623 The IBM 029 Card Punch.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180623 The IBM 029 Card Punch.md (100%) diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/published/20180623 The IBM 029 Card Punch.md similarity index 100% rename from translated/talk/20180623 The IBM 029 Card Punch.md rename to published/20180623 The IBM 029 Card Punch.md From 4948a9861a515121340154a44b4b5bf65f3a8cee Mon Sep 17 00:00:00 2001 From: amwps290 Date: Tue, 25 Dec 2018 21:10:16 +0800 Subject: [PATCH 1065/1143] Delete 20181217 Take a swim at your Linux terminal with asciiquarium.md --- ...t your Linux terminal with asciiquarium.md | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md diff --git a/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md b/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md deleted file mode 100644 index 63741b5ccd..0000000000 --- a/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md +++ /dev/null @@ -1,48 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( amwps290) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Take a swim at your Linux terminal with asciiquarium) -[#]: via: (https://opensource.com/article/18/12/linux-toy-asciiquarium) -[#]: author: (Jason Baker https://opensource.com/users/jason-baker) - -Take a swim at your Linux terminal with asciiquarium -====== -Darling it's better, when your command line is wetter, thanks to ASCII. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-asciiquarium.png?itok=ZhJ9P2Ft) - -We're now nearing the end of our 24-day-long Linux command-line toys advent calendar. Just one week left after today! If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. - -Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. - -Today's selection is a fishy one. Say hello to **asciiquarium** , an undersea adventure for your terminal. I found **asciiquarium** in my Fedora repositories, so installing it was as simple as: - -``` -$ sudo dnf install asciiquarium -``` - -If you're running a different distribution, chances are it's packaged for you too. Just run **asciiquarium** at your terminal to feel happy as a clam. The project has been translated outside of the terminal as well, with screensavers of all of the aquatic pals being made for several non-Linux operating systems, and even an Android live wallpaper version is floating around out there. - -Visit the **asciiquarium** [homepage][1] for more information or to download the Perl source code. The project is open source under a GPL version 2 license. And if you want to learn more about how open source, open data, and open science are making a difference in the actual oceans, take a moment to go learn about the [Ocean Health Index][2]. -![](https://opensource.com/sites/default/files/uploads/linux-toy-asciiquarium-animated.gif) -Do you have a favorite command-line toy that you think I ought to profile? We're running out of time, but I'd still love to hear your suggestions. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. - -Be sure to check out yesterday's toy, [Schedule a visit with the Emacs psychiatrist][3], and come back tomorrow for another! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/linux-toy-asciiquarium - -作者:[Jason Baker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[b]: https://github.com/lujun9972 -[1]: https://robobunny.com/projects/asciiquarium/html/ -[2]: https://opensource.com/article/18/12/protecting-world-oceans -[3]: https://opensource.com/article/18/12/linux-toy-eliza From b7feec1a6143dffedd57a04d4dbe7441b3dfe9f0 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Tue, 25 Dec 2018 21:13:26 +0800 Subject: [PATCH 1066/1143] Create 20181217 Take a swim at your Linux terminal with asciiquarium.md --- ...t your Linux terminal with asciiquarium.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md diff --git a/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md b/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md new file mode 100644 index 0000000000..04ba82841c --- /dev/null +++ b/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md @@ -0,0 +1,51 @@ +[#]: collector: "lujun9972" +[#]: translator: " amwps290" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Take a swim at your Linux terminal with asciiquarium" +[#]: via: "https://opensource.com/article/18/12/linux-toy-asciiquarium" +[#]: author: "Jason Baker https://opensource.com/users/jason-baker" + +# 使用 asciiquarium 在你的终端里探索海洋的秘密 + +亲爱的,当您的命令行变得更湿润的时候会更好。这多亏了 ASCII。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-asciiquarium.png?itok=ZhJ9P2Ft) + +现在,我们即将数完长达 24 天的 Linux 命令行玩具倒数日历。离今天只剩一周了!如果这是您第一次访问本系列文章,那么您可能会问自己什么是命令行玩具。我们一边走,一边说,但一般来说,这可能是一个游戏,或者可以帮助你在终端玩得开心的任何简单的娱乐活动。 + +你们其中的一些人可能已经在以前的系列文章中看到了各种各样的命令行玩具。但是,我们希望每个人都能够获得一个新玩具。 + +今天的玩具有一点鱼的味道。先和 **asciiquarium** 打个招呼,一个在你终端里海底冒险的玩具。我是在我的 Fedora 仓库里发现 asciiquarium 的,因此安装它非常容易: + +``` +$ sudo dnf install asciiquarium +``` + +如果您正在运行不同的发行版,那么它也可能已经为您打包。 只需在您的终端中运行 **asciiquarium** 即可感受到蛤蜊的快乐。 该项目也在终端之外进行了“翻译”,所有水族伙伴的屏保都是为非 Linux 操作系统制作的,甚至还有一个 Android 动态壁纸版本。 + +访问 **asciiquarium** [主页][1]了解更多信息或下载 Perl 源代码。 该项目是 GPL 第 2 版许可证下的开源项目。 如果你想更多地了解开源,开放数据和开放科学如何在实际的海洋中发挥作用,请花点时间去了解[海洋健康指数][2]。 + +![](https://opensource.com/sites/default/files/uploads/linux-toy-asciiquarium-animated.gif) + + +你觉得我应该介绍一下你最喜欢的命令行玩具吗?时间不多了,但我还是想听听你的建议。请在下面的评论中告诉我,我会查阅的。让我知道你对今天的娱乐有什么看法。 + +一定要看看昨天的玩具,[安排一次与 Emacs 精神病医生的访问][3],明天再来看另一个玩具! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-asciiquarium + +作者:[Jason Baker][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/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://robobunny.com/projects/asciiquarium/html/ +[2]: https://opensource.com/article/18/12/protecting-world-oceans +[3]: https://opensource.com/article/18/12/linux-toy-eliza From 75ad593185d633f2465bf9d65dd2512d0494154c Mon Sep 17 00:00:00 2001 From: amwps290 Date: Tue, 25 Dec 2018 21:49:24 +0800 Subject: [PATCH 1067/1143] Update 20171114 Finding Files with mlocate- Part 2.md --- sources/tech/20171114 Finding Files with mlocate- Part 2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20171114 Finding Files with mlocate- Part 2.md b/sources/tech/20171114 Finding Files with mlocate- Part 2.md index 19c546a917..7a99b3793a 100644 --- a/sources/tech/20171114 Finding Files with mlocate- Part 2.md +++ b/sources/tech/20171114 Finding Files with mlocate- Part 2.md @@ -1,3 +1,4 @@ +translating by amwps290 Finding Files with mlocate: Part 2 ====== From ca79380c77093ceef4ad9c53feaa6e71745ecd7c Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 25 Dec 2018 22:01:13 +0800 Subject: [PATCH 1068/1143] zhs852 is translating --- .../tech/20181213 Relax by the fire at your Linux terminal.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20181213 Relax by the fire at your Linux terminal.md b/sources/tech/20181213 Relax by the fire at your Linux terminal.md index f9a53fc4c4..7eae421047 100644 --- a/sources/tech/20181213 Relax by the fire at your Linux terminal.md +++ b/sources/tech/20181213 Relax by the fire at your Linux terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zhs852) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,6 +7,8 @@ [#]: via: (https://opensource.com/article/18/12/linux-toy-aafire) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) +zhs852 is translating. + Relax by the fire at your Linux terminal ====== Chestnuts roasting on an open command prompt? Why not, with this fun Linux toy. From 5f03c1fc10ecd3f1ae32aa5add57034fe44f2a39 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 22:17:47 +0800 Subject: [PATCH 1069/1143] PRF:20171012 7 Best eBook Readers for Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zjon 翻译后,应该再次阅读以保证通顺。 --- ...20171012 7 Best eBook Readers for Linux.md | 102 +++++++++--------- 1 file changed, 54 insertions(+), 48 deletions(-) diff --git a/translated/tech/20171012 7 Best eBook Readers for Linux.md b/translated/tech/20171012 7 Best eBook Readers for Linux.md index 520c9c4533..346eed6bb6 100644 --- a/translated/tech/20171012 7 Best eBook Readers for Linux.md +++ b/translated/tech/20171012 7 Best eBook Readers for Linux.md @@ -1,63 +1,65 @@ 7 个最佳 Linux 电子书阅读器 ====== -**摘要:** 文章中我们涉及一些 Linux 最佳电子书阅读器。这些应用提供更佳阅读体验甚至会管理你的电子书。 + +**摘要:** 本文中我们涉及一些 Linux 最佳电子书阅读器。这些应用提供更佳的阅读体验甚至可以管理你的电子书。 ![最佳 Linux 电子书阅读器][1] -最近,随着人们发现在手持设备,Kindle 或者 PC 上阅读更佳舒适,对电子图书的需求有所增加。谈到 Linux 用户,有各种电子书应用满足你阅读和整理电子书的需求。 +最近,随着人们发现在手持设备、Kindle 或者 PC 上阅读更加舒适,对电子图书的需求有所增加。至于 Linux 用户,也有各种电子书应用满足你阅读和整理电子书的需求。 -在本文中,我们选出了七个最佳 Linux 电子书阅读器。这些电子书阅读器最适合 pdf,epubs 和其他电子书格式。 +在本文中,我们选出了七个最佳 Linux 电子书阅读器。这些电子书阅读器最适合 pdf、epub 和其他电子书格式。 -## 最佳 Linux 电子书阅读器 - -我提供 Ubuntu 安装说明,因为我现在使用。如果你使用[非 Ubuntu 发行版][2],你能在你的发行版软件仓库中找到大多数这些电子书应用。 +我提供的是 Ubuntu 安装说明,因为我现在使用它。如果你使用的是[非 Ubuntu 发行版][2],你能在你的发行版软件仓库中找到大多数这些电子书应用。 ### 1. Calibre -[Calibre][3] 是 Linux 最受欢迎的电子书应用。老实说,这不仅仅是一个简单的电子书阅读器。它是一个完整的电子书解决方案。你甚至能[通过 Calibre 创建私人电子][4] +[Calibre][3] 是 Linux 最受欢迎的电子书应用。老实说,这不仅仅是一个简单的电子书阅读器。它是一个完整的电子书解决方案。你甚至能[通过 Calibre 创建专业的电子书][4]。 -通过强大的电子书管理和易用的接口,它具有创建和编辑电子书。Calibre 支持多种格式和与其他电子书阅读器同步。它也可以让你轻松转换一种电子书格式到另一种。 +通过强大的电子书管理和易用的界面,它提供了创建和编辑电子书的功能。Calibre 支持多种格式和与其它电子书阅读器同步。它也可以让你轻松转换一种电子书格式到另一种。 -Calibre 最大的缺点是,资源上太沉重,让它成为一个艰难的选择作为一个独立的电子阅读器。 +Calibre 最大的缺点是,资源消耗太多,因此作为一个独立的电子阅读器来说是一个艰难的选择。 ![Calibre][5] #### 特性 - * 管理电子书:Calibre 通过管理云数据允许存储和分组电子书。你能下载一本电子书的元数据从各种来源或创建和编辑现有的字段。 - * 支持所有主流电子书格式: Calibre 支持所有主流电子书格式并兼容多种电子阅读器。 - * 文件转换: 在转换时,你能通过改变电子书风格,创建内容表和调整边距的选项来转换任何一种电子书格式到另一种。你也能转换个人文档为电子书。 + * 管理电子书:Calibre 通过管理元数据来排序和分组电子书。你能从各种来源下载一本电子书的元数据或创建和编辑现有的字段。 + * 支持所有主流电子书格式:Calibre 支持所有主流电子书格式并兼容多种电子阅读器。 + * 文件转换:在转换时,你能通过改变电子书风格,创建内容表和调整边距的选项来转换任何一种电子书格式到另一种。你也能转换个人文档为电子书。 * 从 web 下载杂志期刊:Calibre 能从各种新闻源或者通过 RSS 订阅源传递故事。 - * 分享和备份你的电子图书馆:它提供了一个选项,托管你电子书集合到它的服务端,从而你能与好友共享或用任何设备从任何地方访问。备份和导入/导出特性允许你保证你的收藏安全和方便携带。 + * 分享和备份你的电子图书馆:它提供了一个选项,可以托管你电子书集合到它的服务端,从而你能与好友共享或用任何设备从任何地方访问。备份和导入/导出特性可以确保你的收藏安全和方便携带。 #### 安装 你能在主流 Linux 发行版的软件库中找到它。对于 Ubuntu,在软件中心搜索它或者使用下面的命令: -`sudo apt-get install calibre` +``` +sudo apt-get install calibre +``` ### 2. FBReader ![FBReader: Linux 电子书阅读器][6] -[FBReader][7] 是一个开源的轻量级多平台电子书阅读器,它支持多种格式,比如 ePub,fb2,mobi,rtf,html 等。它包含一些允许访问的流行网络电子图书馆,那里你能免费或付费下载电子书。 +[FBReader][7] 是一个开源的轻量级多平台电子书阅读器,它支持多种格式,比如 ePub、fb2、mobi、rtf、html 等。它包括了一些可以访问的流行网络电子图书馆,那里你能免费或付费下载电子书。 #### 特性 - * 支持多种文件格式和设备比如 Android,iOS,Windows,Mac 和更多。 - * 同步书籍收藏,阅读位置和书签。 - * 在线管理你图书馆中从你的 Linux 桌面添加到所有设备的任何书。 - * 支持 Web 浏览器允许你的存储集。 - * 支持 Google Drive 做书籍的存储和通过作者,系列或其他属性整理书籍。 + * 支持多种文件格式和设备比如 Android、iOS、Windows、Mac 和更多。 + * 同步书集、阅读位置和书签。 + * 在线管理你图书馆,可以从你的 Linux 桌面添加任何书到所有设备。 + * 支持 Web 浏览器访问你的书集。 + * 支持将书籍存储在 Google Drive ,可以通过作者,系列或其他属性整理书籍。 #### 安装 -你能从官方库或者在终端中输入一下命令安装 FBReader 电子阅读器。 +你能从官方库或者在终端中输入以下命令安装 FBReader 电子阅读器。 + ``` sudo apt-get install fbreader ``` -或者你能从[这里][8]抓取一个以 .deb 包并在你的基于 Debian 发行版的系统上安装它。 +或者你能从[这里][8]抓取一个以 .deb 包,并在你的基于 Debian 发行版的系统上安装它。 ### 3. Okular @@ -67,29 +69,30 @@ sudo apt-get install fbreader #### 特性 - * Okular 支持多种文档格式像 PDF,Postscript,DjVu,DHM,XPS,ePub 和其他。 - * 支持在 PDF 文档中评论,高亮和绘制不通的形状等。 - * 无需修改原始 PDF 文件分别保存这些更改。 - * 电子书中的文本能被提取到一个文本文件,这个内置文本阅读服务叫 Jovie。 + * Okular 支持多种文档格式像 PDF、Postscript、DjVu、CHM、XPS、ePub 和其他。 + * 支持在 PDF 文档中评论、高亮和绘制不同的形状等。 + * 无需修改原始 PDF 文件,分别保存上述这些更改。 + * 电子书中的文本能被提取到一个文本文件,并且有个名为 Jovie 的内置文本阅读服务。 -备注:检查应用的时候,我发现这个应用在 Ubuntu 和它的衍生系统不支持 ePub 文件格式。其他发行版用户仍然可以发挥它全部的潜力。 +备注:查看这个应用的时候,我发现这个应用在 Ubuntu 和它的衍生系统中不支持 ePub 文件格式。其他发行版用户仍然可以发挥它全部的潜力。 #### 安装 Ubuntu 用户可以在终端中键入下面的命令来安装它: + ``` sudo apt-get install okular ``` ### 4. Lucidor -Lucidor 是一个易用的支持 epub 文件格式和在 OPDS 格式中编目的电子阅读器。它也具有电子书集合在本地书柜里,搜索和下载互联网和 web 订阅和网页转换成电子书的功能。 +Lucidor 是一个易用的、支持 epub 文件格式和在 OPDS 格式中编目的电子阅读器。它也具有在本地书架里组织电子书集、从互联网搜索和下载,和将 Web 订阅和网页转换成电子书的功能。 -Lucidor 是 XULRunner 应用程序,它向您展示了具有类火狐的选项卡式布局,和存储数据和配置时的展现。他是列表中最简单的电子阅读器,包括诸如文本说明和滚动选项之类的配置。 +Lucidor 是 XULRunner 应用程序,它向您展示了具有类似火狐的选项卡式布局,和存储数据和配置时的行为。它是这个列表中最简单的电子阅读器,包括诸如文本说明和滚动选项之类的配置。 ![lucidor][11] -你可以通过选择单词并右击 > 查找单词来查找 Wiktionary.org 的定义。它也包含 web 订阅或 web 页面作为电子书的选项。 +你可以通过选择单词并右击“查找单词”来查找该单词在 Wiktionary.org 的定义。它也包含 web 订阅或 web 页面作为电子书的选项。 你能从[这里][12]下载和安装 deb 或者 RPM 包。 @@ -97,9 +100,10 @@ Lucidor 是 XULRunner 应用程序,它向您展示了具有类火狐的选项 ![Bookworm Linux 电子阅读器][13] -Bookworm 是另一个支持多种文件格式诸如 epub, pdf, mobi, cbr and cbz 的免费开源的电子阅读器。我写了一篇关于 Bookworm 应用程序的特性和安装的专题文章,到这里阅读: [Bookworm: 一个简单而强大的 Linux 电子阅读器][14] +Bookworm 是另一个支持多种文件格式诸如 epub、pdf、mobi、cbr 和 cbz 的自由开源的电子阅读器。我写了一篇关于 Bookworm 应用程序的特性和安装的专题文章,到这里阅读:[Bookworm:一个简单而强大的 Linux 电子阅读器][14] #### 安装 + ``` sudo apt-add-repository ppa:bookworm-team/bookworm sudo apt-get update @@ -108,15 +112,16 @@ sudo apt-get install bookworm ### 6. Easy Ebook Viewer -[Easy Ebook Viewer][15] 是另外一个用于读取 ePub 文件的很棒的 GTK python 应用.具有基本章节导航、从上次阅读位置继续、从其他电子书文件格式导入、章节跳转等功能,Easy Ebook Viewer 是一个简单而简约的 ePub 阅读器. +[Easy Ebook Viewer][15] 是又一个用于读取 ePub 文件的很棒的 GTK Python 应用。具有基本章节导航、从上次阅读位置继续、从其他电子书文件格式导入、章节跳转等功能,Easy Ebook Viewer 是一个简单而简约的 ePub 阅读器. ![Easy-Ebook-Viewer][16] -这个应用仍然处于初始阶段,只支持ePub文件。 +这个应用仍然处于初始阶段,只支持 ePub 文件。 #### 安装 -你可以从 [github][17] 下载源代码和自己编译以及依赖项来安装 Easy Ebook Viewer。或者,以下终端命令将执行完全相同的工作。 +你可以从 [GitHub][17] 下载源代码,并自己编译它及依赖项来安装 Easy Ebook Viewer。或者,以下终端命令将执行完全相同的工作。 + ``` sudo apt install git gir1.2-webkit-3.0 libwebkitgtk-3.0-0 gir1.2-gtk-3.0 python3-gi git clone https://github.com/michaldaniel/Ebook-Viewer.git @@ -124,19 +129,20 @@ cd Ebook-Viewer/ sudo make install ``` -成功完成上述步骤后,你可以从Dash启动它。 +成功完成上述步骤后,你可以从 Dash 启动它。 ### 7. Buka -Buka 主要是一个具有简单而清爽的用户界面的电子书管理器。它目前支持 PDF 格式,旨在帮助用户更加关注内容。拥有 pdf 阅读器的所有基本特性,Buka 允许你通过箭头键导航,具有缩放选项,并且能并排查看 2 页。 +Buka 主要是一个具有简单而清爽的用户界面的电子书管理器。它目前支持 PDF 格式,旨在帮助用户更加关注内容。拥有 PDF 阅读器的所有基本特性,Buka 允许你通过箭头键导航,具有缩放选项,并且能并排查看两页。 -你可以创建单独的 PDF 文件列表并轻松地在它们之间切换。Buka也提供了一个内置翻译工具,但是你需要有效的互联网连接来使用这个特性。 +你可以创建单独的 PDF 文件列表并轻松地在它们之间切换。Buka 也提供了一个内置翻译工具,但是你需要有效的互联网连接来使用这个特性。 ![Buka][19] #### 安装 -你能从[官方下载页面][20]下载一个 AppImage。如果你不知道,请阅读[如何在 Linux 下使用 AppImage][21]。或者,你可以通过命令行安装它: +你能从[官方下载页面][20]下载一个 AppImage。如果你不知道如何做,请阅读[如何在 Linux 下使用 AppImage][21]。或者,你可以通过命令行安装它: + ``` sudo snap install buka ``` @@ -153,30 +159,30 @@ sudo snap install buka via: https://itsfoss.com/best-ebook-readers-linux/ 作者:[Ambarish Kumar][a] -译者:[zjon](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[zjon](https://github.com/zjon) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://itsfoss.com/author/ambarish/ -[1]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/best-ebook-readers-linux-800x450.png +[1]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/10/best-ebook-readers-linux.png [2]:https://itsfoss.com/non-ubuntu-beginner-linux/ [3]:https://www.calibre-ebook.com [4]:https://itsfoss.com/create-ebook-calibre-linux/ -[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Calibre-800x603.jpeg -[6]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/10/fbreader-800x624.jpeg +[5]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/09/Calibre-800x603.jpeg +[6]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/10/fbreader-800x624.jpeg [7]:https://fbreader.org [8]:https://fbreader.org/content/fbreader-beta-linux-desktop [9]:https://okular.kde.org/ -[10]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Okular-800x435.jpg -[11]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/lucidor-2.png +[10]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/09/Okular-800x435.jpg +[11]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/09/lucidor-2.png [12]:http://lucidor.org/lucidor/download.php -[13]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/08/bookworm-ebook-reader-linux-800x450.jpeg +[13]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/08/bookworm-ebook-reader-linux-800x450.jpeg [14]:https://itsfoss.com/bookworm-ebook-reader-linux/ [15]:https://github.com/michaldaniel/Ebook-Viewer -[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Easy-Ebook-Viewer.jpg +[16]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/09/Easy-Ebook-Viewer.jpg [17]:https://github.com/michaldaniel/Ebook-Viewer.git [18]:https://github.com/oguzhaninan/Buka -[19]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2017/09/Buka2-800x555.png +[19]:https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/09/Buka2-800x555.png [20]:https://github.com/oguzhaninan/Buka/releases [21]:https://itsfoss.com/use-appimage-linux/ From 7359ce880cbe791ae06b95f4d0d1ac78d0417945 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 22:20:12 +0800 Subject: [PATCH 1070/1143] PUB:20171012 7 Best eBook Readers for Linux.md @zjon https://linux.cn/article-10383-1.html --- .../tech => published}/20171012 7 Best eBook Readers for Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171012 7 Best eBook Readers for Linux.md (100%) diff --git a/translated/tech/20171012 7 Best eBook Readers for Linux.md b/published/20171012 7 Best eBook Readers for Linux.md similarity index 100% rename from translated/tech/20171012 7 Best eBook Readers for Linux.md rename to published/20171012 7 Best eBook Readers for Linux.md From 2244788472742c5dd92fd8836da7e68cc96cbe19 Mon Sep 17 00:00:00 2001 From: qhwdw <33189910+qhwdw@users.noreply.github.com> Date: Tue, 25 Dec 2018 22:59:31 +0800 Subject: [PATCH 1071/1143] Translated by qhwdw --- ...1 How to Build a Netboot Server, Part 3.md | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) rename {sources => translated}/tech/20181221 How to Build a Netboot Server, Part 3.md (59%) diff --git a/sources/tech/20181221 How to Build a Netboot Server, Part 3.md b/translated/tech/20181221 How to Build a Netboot Server, Part 3.md similarity index 59% rename from sources/tech/20181221 How to Build a Netboot Server, Part 3.md rename to translated/tech/20181221 How to Build a Netboot Server, Part 3.md index 08c1a8a12e..e174248f62 100644 --- a/sources/tech/20181221 How to Build a Netboot Server, Part 3.md +++ b/translated/tech/20181221 How to Build a Netboot Server, Part 3.md @@ -1,22 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: () +[#]: publisher: () +[#]: url: () [#]: subject: (How to Build a Netboot Server, Part 3) [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-3/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) -How to Build a Netboot Server, Part 3 +如何构建一台网络引导服务器(第三部分) ====== ![](https://fedoramagazine.org/wp-content/uploads/2018/12/netboot3-816x345.jpg) -The [How to Build a Netboot Server, Part 1][1] article provided a minimal [iPXE][2] boot script for your netboot image. Many users probably have a local operating system that they want to use in addition to the netboot image. But switching bootloaders using the typical workstation’s BIOS can be cumbersome. This part of the series shows how to set up some more complex iPXE configurations. These allow the end user to easily choose which operating system they want to boot. They also let the system administrator manage the boot menus from a central server. +在 [如何构建一台网络引导服务器(第一部分)][1] 的文章中,我们提供了一个极简的 [iPXE][2] 引导脚本来引导你的网络引导镜像。许多用户除了使用网络引导镜像外,可能在机器本地也有一个操作系统。但是使用常见的工作站的 BIOS 去切换引导加载器是很笨拙的。在本系列文件的第三部分,我们将向你展示如何设置一个更复杂的 iPXE 配置。它将允许终端用户以更容易的方式去选择引导哪个操作系统。它也可以配置为让系统管理员从一台中央服务器来统一管理引导菜单。 -### An interactive iPXE boot menu +### 一个交互式 iPXE 引导菜单 -The commands below redefine the netboot image’s boot.cfg as an interactive iPXE boot menu with a 5 second countdown timer: +下面这些命令重定义了网络引导镜像的 boot.cfg 来作为一个交互式的 iPXE 引导菜单,并使用了一个 5 秒倒计时的定时器: ``` $ MY_FVER=29 @@ -59,32 +59,33 @@ boot || goto failed END ``` -The above menu has five sections: +上述菜单有五个节: - * **menu** defines the actual menu that will be shown on the screen. - * **failed** notifies the user that something went wrong and drops the user to a shell so they can troubleshot the problem. - * **shell** provides an interactive command prompt. You can reach it either by pressing the **Esc** key while at the boot menu or if the “boot” command returns with a failure code. - * **lcl** contains a single command that tells iPXE to exit and return control back to the BIOS. Whatever you want to boot by default (e.g. the workstation’s local hard drive) **must** be listed as the next boot item right after iPXE in your workstation’s BIOS. - * **f29** contains the same netboot code used earlier but with the final exit replaced with goto failed. + * **menu** 定义了显示在屏幕上的实际菜单内容。 + * **failed** 提示用户发生了错误,并将用户带到 shell 以错误错误。 + * **shell** 提供了交互式命令提示符。你可以在引导菜单出现时按下 **Esc** 键进入,或者是 + “boot” 命令失败时也会进入到命令提示符。 + * **lcl** 包含一个提供给 iPXE 退出的简单命令,以及返还控制权给 BIOS。在 iPXE 之后,无论你希望缺省引导的设备(即:工作站的本地硬件)是什么,都必须在你的工作站的 BIOS 中正确地作为下一个引导设备列出来。 + * **f29** 包含前面文章提到同一个网络引导代码,但使用最终的退出代码来替换掉 goto failed。 -Copy the updated boot.cfg from your $HOME/esp/linux directory out to the ESPs of all your client systems. If all goes well, you should see results similar to the image below: +从你的 `$HOME/esp/linux` 目录中复制更新后的 boot.cfg 到所有客户端系统的 ESP 中。如果一切顺利,你应该会看到类似下面图片的结果: ![][3] -### A server hosted boot menu +### 一个服务器托管的引导菜单 -Another feature you can add to the netboot server is the ability to manage all the client boot menus from one central location. This feature can be especially useful when rolling out a new version of the OS. It lets you perform a sort of [atomic transaction][4] to switch all clients over to the new OS after you’ve copied the new kernel and initramfs out to the ESPs of all the clients. +你可以添加到网络引导服务器的另一个特性是,能够从一台中央位置去管理所有客户端的引导菜单。这个特性尤其适用于批量安装(升级)一个新版本的操作系统。在你将新内核和新的 initramfs 复制到所有客户端的 ESP 之后,这个特性可以让你执行一种 [原子事务][4] 去切换所有客户端到新操作系统。 -Install Mojolicious: +安装 Mojolicious: ``` $ sudo -i # dnf install -y perl-Mojolicious ``` -Define the “bootmenu” app: +定义 “bootmenu” 应用程序: ``` # mkdir /opt/bootmenu @@ -102,7 +103,7 @@ END # chmod 755 /opt/bootmenu/bootmenu.pl ``` -Define the configuration file for the bootmenu app: +为 “bootmenu” 应用程序定义配置文件: ``` # cat << END > /opt/bootmenu/bootmenu.conf @@ -115,16 +116,16 @@ Define the configuration file for the bootmenu app: END ``` -This is an extremely simple Mojolicious application that listens on port 80 and only answers to /menu requests. If you want a quick introduction to what Mojolicious can do, run man Mojolicious::Guides::Growing to view the manual. Use the **Q** key to quit the manual. +这是一个非常简单的 Mojolicious 应用程序,它监听 80 端口,并且只回复到 /menu 的请求。如果你想快速了解 Mojolicious 能做什么,运行 `man Mojolicious::Guides::Growing` 去查看手册。按 **Q** 键退出手册。 -Move boot.cfg over to our netboot app as a template named menu.html.ep: +将 boot.cfg 移到我们的网络引导应用程序中作为一个名为 menu.html.ep 的模板: ``` # mkdir /opt/bootmenu/templates # mv $HOME/esp/linux/boot.cfg /opt/bootmenu/templates/menu.html.ep ``` -Define a systemd service to manage the bootmenu app: +定义一个 systemd 服务去管理引导菜单应用程序: ``` # cat << END > /etc/systemd/system/bootmenu.service @@ -147,7 +148,7 @@ WantedBy=multi-user.target END ``` -Add an exception for the HTTP service to the local firewall and start the bootmenu service: +在本地防火墙中为 HTTP 服务添加一个例外规则,并启动 bootmenu 服务: ``` # firewall-cmd --add-service http @@ -156,7 +157,7 @@ Add an exception for the HTTP service to the local firewall and start the bootme # systemctl start bootmenu.service ``` -Test it with wget: +用 wget 测试它: ``` $ sudo dnf install -y wget @@ -164,7 +165,7 @@ $ MY_BOOTMENU_SERVER=server-01.example.edu $ wget -q -O - http://$MY_BOOTMENU_SERVER/menu ``` -The above command should output something similar to the following: +以上的命令应该会输出类似下面的内容: ``` #!ipxe @@ -198,9 +199,9 @@ initrd --name initrd.img ${prefix}/initramfs-4.19.4-300.fc29.x86_64.img boot || goto failed ``` -Now that the boot menu server is working, rebuild the ipxe.efi bootloader with an init script that points to it. +现在,引导菜单服务器已经正常工作了,重新构建 ipxe.efi 引导加载器,使用一个 init 脚本指向它。 -First, update the init.ipxe script created in part one of this series: +第一步,先更新我们在本系列文章的第一部分中创建的 init.ipxe 脚本: ``` $ MY_BOOTMENU_SERVER=server-01.example.edu @@ -213,7 +214,7 @@ chain http://$MY_BOOTMENU_SERVER/menu || exit END ``` -Now, rebuild the boot loader: +现在,重新构建引导加载器: ``` $ cd $HOME/ipxe/src @@ -221,23 +222,23 @@ $ make clean $ make bin-x86_64-efi/ipxe.efi EMBED=../init.ipxe ``` -Copy the updated bootloader to your ESP: +将更新后的引导加载器复制到你的 ESP 中: ``` $ cp $HOME/ipxe/src/bin-x86_64-efi/ipxe.efi $HOME/esp/efi/boot/bootx64.efi ``` -After you’ve copied the updated bootloader to all your clients, you can make future updates to the boot menu simply by editing /opt/bootmenu/templates/menu.html.ep and running: +将更新后的引导加载器复制到所有的客户端中之后,以后更新引导菜单只需要简单地编辑 `/opt/bootmenu/templates/menu.html.ep` 文件,然后再运行如下命令: ``` $ sudo systemctl restart bootmenu.service ``` -### Making further changes +### 做一步的改变 -If the boot menu server is working properly, you’ll longer need the the boot.cfg file on your client systems. +如果引导菜单服务器工作正常,在你的客户端系统上的 boot.cfg 文件将更长。 -For example, re-add the Fedora 28 image to the boot menu: +比如,重新添加 Fedora 28 镜像到引导菜单中: ``` $ sudo -i @@ -259,18 +260,17 @@ END # systemctl restart bootmenu.service ``` -If all goes well, your clients should see results similar to the image below the next time they boot: +如果一切顺利,你的客户端下次引导时,应该看到如下图所示的结果: ![][5] - -------------------------------------------------------------------------------- via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-3/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[qhwdw](https://github.com/qhwdw) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2d43837b186966010e7b4ea567c1dd2c07d7bec4 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Tue, 25 Dec 2018 23:33:33 +0800 Subject: [PATCH 1072/1143] Translated --- ...elax by the fire at your Linux terminal.md | 59 ------------------- ...elax by the fire at your Linux terminal.md | 59 +++++++++++++++++++ 2 files changed, 59 insertions(+), 59 deletions(-) delete mode 100644 sources/tech/20181213 Relax by the fire at your Linux terminal.md create mode 100644 translated/tech/20181213 Relax by the fire at your Linux terminal.md diff --git a/sources/tech/20181213 Relax by the fire at your Linux terminal.md b/sources/tech/20181213 Relax by the fire at your Linux terminal.md deleted file mode 100644 index 7eae421047..0000000000 --- a/sources/tech/20181213 Relax by the fire at your Linux terminal.md +++ /dev/null @@ -1,59 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (zhs852) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Relax by the fire at your Linux terminal) -[#]: via: (https://opensource.com/article/18/12/linux-toy-aafire) -[#]: author: (Jason Baker https://opensource.com/users/jason-baker) - -zhs852 is translating. - -Relax by the fire at your Linux terminal -====== -Chestnuts roasting on an open command prompt? Why not, with this fun Linux toy. - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-aafire.png?itok=pAttiVvG) - -Welcome back. Here we are, just past the halfway mark at day 13 of our 24 days of Linux command-line toys. If this is your first visit to the series, see the link to the previous article at the bottom of this one, and take a look back to learn what it's all about. In short, our command-line toys are anything that's a fun diversion at the terminal. - -Maybe some are familiar, and some aren't. Either way, we hope you have fun. - -If you're in the northern hemisphere outside of the tropics, perhaps winter is starting to rear its frigid face outside. At least it is where I live. And some I'd love nothing more than to curl up by the fire with a cup of tea and my favorite book (or a digital equivalent). - -The bad news is my house lacks a fireplace. The good news is that I can still pretend, thanks to the Linux terminal and today's command-line toy, **aafire**. - -On my system, I found **aafire** packed with **aalib** , a delightful library for converting visual images into the style of ASCII art and making it available at your terminal (or elsewhere). **aalib** enables all sorts of fun graphics at the Linux terminal, so we may revisit a toy or two that make use of it before the end of our series. On Fedora, this meant installation was as simple as: - -``` -$ sudo dnf install aalib -``` - -Then, it was simple to launch with the **aafire** command. By default, **aalib** attempted to draw to my GUI, so I had to manually override it to keep my fire in the terminal (this is a command-line series, after all). Fortunately, it comes with a [curses][1] driver, so this meant I just had to run the following to get my fire going: - -``` -$ aafire -driver curses -``` -![](https://opensource.com/sites/default/files/uploads/linux-toy-aafire-animated.gif) -You can find out more about the **aa-lib** library and download the source on [Sourceforge][2], under an LGPLv2 license. - -Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. - -Check out yesterday's toy, [Patch into The Matrix at the Linux command line][3] , and check back tomorrow for another! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/linux-toy-aafire - -作者:[Jason Baker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Curses_(programming_library) -[2]: http://aa-project.sourceforge.net/aalib/ -[3]: https://opensource.com/article/18/12/linux-toy-cmatrix diff --git a/translated/tech/20181213 Relax by the fire at your Linux terminal.md b/translated/tech/20181213 Relax by the fire at your Linux terminal.md new file mode 100644 index 0000000000..b3532cbd83 --- /dev/null +++ b/translated/tech/20181213 Relax by the fire at your Linux terminal.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: (zhs852) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Relax by the fire at your Linux terminal) +[#]: via: (https://opensource.com/article/18/12/linux-toy-aafire) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +在 Linux 终端中观看火焰 +====== +何不在命令行中进行一次“烧烤”呢? + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-aafire.png?itok=pAttiVvG) + +这里是《24 天了解 Linux 命令行小玩意》。如果你未曾读过本系列的文章,可以在本文的结尾部分获取上一篇文章的链接,以了解本系列的大概内容。我们所介绍的命令行小玩意可供你消遣无聊时光。 + +你或许知道它们其中的一些,也可能不曾知晓它们。无论如何,我们都希望你能度过一段愉快的时光。 + +如果你住在北半球的非热带地区,可能冬季来临时你会被冻得满脸通红。住在这里的我,最喜欢的事情便是在火炉旁惬意地边喝茶边读书。 + +不幸的是,我家刚好缺个放火炉的地方。不过,多亏了今天我要介绍的 **aafire** ,我仍然可以假装我坐在火炉旁。 + +在我所使用的系统里, **aafire** 被打包进了 **aalib** 。 **aalib** 是一个受人喜爱的库,它可以很方便地将图像转换成 ASCII 图并输出到终端(或其它任何地方)。 **aalib** 将多种多样的图像带入了 Linux 终端。你可以看看本系列的其它文章,了解一下其它小程序,以便配合使用并充分利用它们。在 Fedora 中,你可以通过以下命令来安装 **aalib** : + +``` +$ sudo dnf install aalib +``` + +接着,试着运行 **aafire** 命令。 **aalib** 默认会使用 GUI 模式,我们要进行一些操作来让它在终端中运行(毕竟这一系列文章都讲的是命令行)。十分幸运的是,仅需安装 [curses][1] 就能实现我们想要的效果。请执行: + +``` +$ aafire -driver curses +``` + +![](https://opensource.com/sites/default/files/uploads/linux-toy-aafire-animated.gif) + +如果你觉得 **aa-lib** 挺有意思,可以在 [Sourceforge][2] 上找到它的源码(以 LGPLv2 许可证开源)。 + +欢迎将你觉得有意思的命令行小程序投稿到原作者处,只需在原文下留言即可。 + +如果有兴趣,可以查看原作者的上一篇文章: [Patch into The Matrix at the Linux command line][3] 。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-aafire + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[zhs852](https://github.com/zhs852) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Curses_(programming_library) +[2]: http://aa-project.sourceforge.net/aalib/ +[3]: https://opensource.com/article/18/12/linux-toy-cmatrix From 5d5abfae1b5eea9507e6d1d0ad0a3a03fe9d139a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 23:43:20 +0800 Subject: [PATCH 1073/1143] PRF:20181208 Play Tetris at your Linux terminal.md @geekpi --- ...81208 Play Tetris at your Linux terminal.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20181208 Play Tetris at your Linux terminal.md b/translated/tech/20181208 Play Tetris at your Linux terminal.md index 110990cc61..1998aad851 100644 --- a/translated/tech/20181208 Play Tetris at your Linux terminal.md +++ b/translated/tech/20181208 Play Tetris at your Linux terminal.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Play Tetris at your Linux terminal) @@ -10,25 +10,25 @@ 在 Linux 终端上玩俄罗斯方块 ====== -用每个人最喜欢的砖块配对游戏俄罗斯方块重新创造 20 世纪 80 年代的魔力。 +> 用每个人最喜欢的砖块配对游戏“俄罗斯方块”重新创造 20 世纪 80 年代的魔力。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-tetris.png?itok=_UXtpgzN) 感谢你来浏览我们今天的 Linux 命令行玩具日历。如果这是你第一次访问该系列,你可能会问自己,什么是命令行玩具。即使我不太确定,但一般来说,它可能是一个游戏或任何消遣,可以帮助你在终端获得乐趣。 -很可能你们中的一些人之前会看到过我们日历中的各种选择,但我们希望每个人至少遇到一件新事物。 +很可能你们中的一些人之前会看到过我们日历中的各种推荐,但我们希望每个人至少遇到一件新事物。 我承诺在我开始这个系列时,我会介绍游戏,但到目前为止,我忽略了它,所以我们今天的选择就是游戏:俄罗斯方块。 -俄罗斯方块和我差不多年纪,都在 1984 年夏天来到世界。不过,俄罗斯方块不是来自北卡罗来纳州的农村地区,而是来自当时苏联的莫斯科。。 +俄罗斯方块和我差不多年纪,都在 1984 年夏天来到世界。不过,俄罗斯方块不是来自北卡罗来纳州的农村地区,而是来自当时苏联的莫斯科。 在风靡世界之后,俄罗斯方块被克隆过很多次。我怀疑你可以找到任何你想找的任何语言、操作系统的俄罗斯方块的克隆。说真的,去看看吧。会有一些有趣的。 -我今天带来的命令行[版本][1]是[用 Haskell 编写]的,它是我见过的做得更好的版本之一,有屏幕预览、得分、帮助、干净的外观。 +我今天带来的命令行[版本][1]是[用 Haskell 编写][1]的,它是我见过的做得更好的版本之一,有屏幕预览、得分、帮助、干净的外观。 如果你愿意从不受信任的来源运行已编译的二进制文件(我不推荐它),你可以直接获取它,但有个更安全的方法,使用 [dex][2] 的容器化版本也很容易,或者使用 [stack][3] 从源代码安装。 -这个俄罗斯方块克隆版是由 Sam Tay 编写的,并且在 BSD 许可证下。[请看这里][1]! +这个俄罗斯方块克隆版是由 Sam Tay 编写的,并且在 BSD 许可证下发布。[请看这里获取][1]! ![](https://opensource.com/sites/default/files/uploads/linux-toy-tetris-animated.gif) @@ -44,8 +44,8 @@ via: https://opensource.com/article/18/12/linux-toy-tetris 作者:[Jason Baker][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/) 荣誉推出 @@ -54,4 +54,4 @@ via: https://opensource.com/article/18/12/linux-toy-tetris [1]: https://github.com/samtay/tetris [2]: https://github.com/dockerland/dex [3]: https://docs.haskellstack.org/en/stable/README/#how-to-install -[4]: https://opensource.com/article/18/12/linux-toy-cal \ No newline at end of file +[4]: https://opensource.com/article/18/12/linux-toy-cal From f07f8ca2c8dfe4e96e35f520f28e21040f1e168c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 25 Dec 2018 23:44:27 +0800 Subject: [PATCH 1074/1143] PUB:20181208 Play Tetris at your Linux terminal.md @geekpi https://linux.cn/article-10384-1.html --- .../20181208 Play Tetris at your Linux terminal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181208 Play Tetris at your Linux terminal.md (97%) diff --git a/translated/tech/20181208 Play Tetris at your Linux terminal.md b/published/20181208 Play Tetris at your Linux terminal.md similarity index 97% rename from translated/tech/20181208 Play Tetris at your Linux terminal.md rename to published/20181208 Play Tetris at your Linux terminal.md index 1998aad851..da78a64766 100644 --- a/translated/tech/20181208 Play Tetris at your Linux terminal.md +++ b/published/20181208 Play Tetris at your Linux terminal.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10384-1.html) [#]: subject: (Play Tetris at your Linux terminal) [#]: via: (https://opensource.com/article/18/12/linux-toy-tetris) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) From 008cead5e38521babe20e486787ca6946789a14d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 00:53:18 +0800 Subject: [PATCH 1075/1143] PRF:20180826 How to Install and Use FreeDOS on VirtualBox.md @WangYueScream --- ...o Install and Use FreeDOS on VirtualBox.md | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md b/translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md index e8b0d30183..3474815526 100644 --- a/translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md +++ b/translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md @@ -1,28 +1,27 @@ - 如何在 VirtualBox 上安装并使用 FreeDOS? ====== -这份指南将带你如何一步一步在 Linux 平台下利用 VirtualBox 安装 FreeDOS。 + +> 这份指南将带你如何一步一步在 Linux 平台下利用 VirtualBox 安装 FreeDOS。 ### Linux 下借助 VirtualBox 安装 FreeDOS - +- [How to Install FreeDOS in Linux using Virtual Box](https://www.youtube.com/p1MegqzFAqA) -2017 年的 11 月份,我[采访了 Jim Hall][1] 关于 [FreeDOS project][2] 背后的历史故事。今天,我将告诉你如何安装并使用 FreeDOS。需要注意到是:我将在 [Solus][4](一种针对家庭用户的 Linux 桌面发行版)下使用 5.2.14 版本的 [VirtualBox][3] 来完成这些操作。 - -注意:在本教程我将使用 Solus 作为主机系统因为它很容易设置。另一个你需要注意的事情是 Solus 的软件中心有两个版本的 VirtualBox:`virtualbox` 和 `virtualbox-current`。Solus 会让你选择是使用 linux-lts 内核还是 linux-current 内核。最终区别就是,`virtualbox` 适用于 linux-lts 而 `virtualbx-current` 适用于 linux-current。 +2017 年的 11 月份,我[采访了 Jim Hall][1] 关于 [FreeDOS 项目][2] 背后的历史故事。今天,我将告诉你如何安装并使用 FreeDOS。需要注意到是:我将在 [Solus][4](一种针对家庭用户的 Linux 桌面发行版)下使用 5.2.14 版本的 [VirtualBox][3] 来完成这些操作。 +> 注意:在本教程我将使用 Solus 作为主机系统因为它很容易设置。另一个你需要注意的事情是 Solus 的软件中心有两个版本的 VirtualBox:`virtualbox` 和 `virtualbox-current`。Solus 会让你选择是使用 linux-lts 内核还是 linux-current 内核。最终区别就是,`virtualbox` 适用于 linux-lts 而 `virtualbx-current` 适用于 linux-current。 #### 第一步 – 创建新的虚拟机 ![][5] -当你打开 VirtualBox,点击 "New" 按钮来新建一个虚拟机。你可以自定义这台虚拟机的名字,我将它命名为 “FreeDOS”。你也可以在标注栏内指明你正在安装的 FreeDOS 的版本。你还需要选择你将要安装的操作系统的类型和版本。选择 “Other” 下的 “DOS”。 +当你打开 VirtualBox,点击 “New” 按钮来新建一个虚拟机。你可以自定义这台虚拟机的名字,我将它命名为 “FreeDOS”。你也可以在标注栏内指明你正在安装的 FreeDOS 的版本。你还需要选择你将要安装的操作系统的类型和版本。选择 “Other” 下的 “DOS”。 #### 第二步 – 设置内存大小 ![][6] -下一个对话框会问你要给 FreeDOS 主机分配多少可用的内存空间。默认分配 32 MB。不必更改它。在 DOS 系统盛行的年代,32 MB 大小的内存对于一台搭载 FreeDOS 的机器已经很足够了。如果你有需要,你可以通过对你针对 FreeDOS 新建的虚拟机右键并选择 Setting -> Symtem 来增加内存。 +下一个对话框会问你要给 FreeDOS 主机分配多少可用的内存空间。默认分配 32 MB。不必更改它。在 DOS 系统盛行的年代,32 MB 大小的内存对于一台搭载 FreeDOS 的机器已经很足够了。如果你有需要,你可以通过对你针对 FreeDOS 新建的虚拟机右键并选择 “Setting -> Symtem” 来增加内存。 ![][7] @@ -38,8 +37,7 @@ ![][9] -现在,你可以选择虚拟磁盘的大小和位置。500 MB 已经很足够了。需要注意的是很多你之后用到的程序都是基于文本的,这意味着它们占据的空间非常小。在你做好这些调整后,点击 Creat。 - +现在,你可以选择虚拟磁盘的大小和位置。500 MB 已经很足够了。需要注意的是很多你之后用到的程序都是基于文本的,这意味着它们占据的空间非常小。在你做好这些调整后,点击 “Create”。 #### 第四步 – 关联 .iso 文件 @@ -47,12 +45,11 @@ ![][11] -当文件下载完毕后,返回到 VirtualBox。选中你的虚拟机并打开设置。你可以通过对虚拟机右键并选中 “Setting” 或者 选中虚拟机并点击 “Setting” 按钮。 +当文件下载完毕后,返回到 VirtualBox。选中你的虚拟机并打开设置。你可以通过对虚拟机右键并选中 “Setting” 或者选中虚拟机并点击 “Setting” 按钮。 接下来,点击 “Storage” 选项卡。在 “Storage Devices” 下面,选中 CD 图标。(它应该会在图标旁边显示 “Empty”。) 在右边的 “Attribute” 面板,点中 CD 图标然后在对应路径选中你刚下载的 .iso 文件。 -提示:通常,在你通过 VirtualBox 安装完一个操作系统后你就可以删除对应的 .iso 文件了。但这并不适合 FreeDOS 。如果你想通过 FreeDOS 的包管理器来安装应用程序,你需要这个 .iso 文件。我通常会让这个 .iso 文件连接到虚拟机以便我安装一些程序。如果你也这么做了,你必须要确认下你让 FreeDOS 虚拟机每次启动的时候是从硬盘启动因为虚拟机的默认设置是从已关联的 .iso 文件启动。如果你忘了关联 .iso 文件,也不用担心。你可以通过选择 FreeDOS 虚拟机窗口上方的 “Devices” 来关联。然后就会发现 .iso 文件列在 “Optical Drives”。 - +> 提示:通常,在你通过 VirtualBox 安装完一个操作系统后你就可以删除对应的 .iso 文件了。但这并不适合 FreeDOS 。如果你想通过 FreeDOS 的包管理器来安装应用程序,你需要这个 .iso 文件。我通常会让这个 .iso 文件连接到虚拟机以便我安装一些程序。如果你也这么做了,你必须要确认下你让 FreeDOS 虚拟机每次启动的时候是从硬盘启动因为虚拟机的默认设置是从已关联的 .iso 文件启动。如果你忘了关联 .iso 文件,也不用担心。你可以通过选择 FreeDOS 虚拟机窗口上方的 “Devices” 来关联。然后就会发现 .iso 文件列在 “Optical Drives”。 #### 第五步 – 安装 FreeDOS @@ -62,11 +59,11 @@ 首先,你需要知道关于最新版本的 VirtualBox 的一个 bug。当我们创建好虚拟硬盘然后选中 “Install to harddisk” 后,如果你开启虚拟机你会发现在 FreeDOS 的欢迎界面出现过后就是不断滚动无群无尽的机器代码。我最近就遇到过这个问题而且不管是 Linux 还是 Windows 平台的 VirtualBox 都会碰到这个问题。(我知道解决办法。) -为了避开这个问题,你需要做一个简单的修改。当你看到 FreeDOS 的欢迎界面的时候,按下 Tab 键。(确认 “Install to harddrive” 已经选中。)在 “fdboot.img” 之后输入 `raw` 然后按下 Enter 键。接下来就会启动 FreeDOS 的安装程序。 +为了避开这个问题,你需要做一个简单的修改。当你看到 FreeDOS 的欢迎界面的时候,按下 Tab 键。(确认 “Install to harddrive” 已经选中。)在 “fdboot.img” 之后输入 `raw` 然后按下回车键。接下来就会启动 FreeDOS 的安装程序。 ![][13] -安装程序会首先处理你的虚拟磁盘的格式化。当格式化完成后,安装程序会重启。当 FreeDOS 的欢迎界面再次出现的时候,你不得不重新输入 `raw` 就像你之前输入的内容那样。 +安装程序会首先处理你的虚拟磁盘的格式化。当格式化完成后,安装程序会重启。当 FreeDOS 的欢迎界面再次出现的时候,你必须重新输入 `raw` 就像你之前输入的内容那样。 要确保在安装过程中你遇到的所有问题你选的都是 “Yes”。但也要注意有一个很重要的问题:“What FreeDOS packages do you want to install?” 的答案并不是 “Yes” 或者 “No”。答案有两个选择分别是 “Base packages” 和 “Full installation”。“Base packages” 针对的是想体验类似原始的 MS-DOS 环境的人群。“Full installation” 则包括了一系列工具和实用的程序来提升 DOS。 @@ -82,15 +79,14 @@ ![][15] -现在,你可以通过输入 `fdimples` 来访问 FreeDOS 的软件包管理工具。你也可以借助方向键来浏览软件包管理器然后用空格键选择类别或者软件包。在 “Networking” 类别中,你需要选中 `fdnet`。FreeDOS project 推荐也安装 `mtcp` 和 `wget`。多次点击 “Tab” 键直到选中 “OK” 然后在按下 “Enter” 键。安装完成后,输入 `reboot` 并按下 “Enter” 键确认执行。系统重启后,引导你的系统驱动。如果网络安装成功的话,你会在终端看到一些关于你的网络信息的新消息。 +现在,你可以通过输入 `fdimples` 来访问 FreeDOS 的软件包管理工具。你也可以借助方向键来浏览软件包管理器,然后用空格键选择类别或者软件包。在 “Networking” 类别中,你需要选中 `fdnet`。FreeDOS project 推荐也安装 `mtcp` 和 `wget`。多次点击 Tab 键直到选中 “OK” 然后在按下回车键。安装完成后,输入 `reboot` 并按下回车键确认执行。系统重启后,引导你的系统驱动。如果网络安装成功的话,你会在终端看到一些关于你的网络信息的新消息。 ![][16] -##### 注意 +注意: 有时候 VirtualBox 的默认设置并没有生效。如果遇到这种情况,先关闭你的 FreeDOS 虚拟机窗口。在 VirtualBox 主界面右键你的虚拟机并选中 “Setting”。VirtualBox 默认的网络设置是 “NAT”。将它改为 “Bridged Adapter” 后再尝试安装 FreeDOS 的软件包。现在就应该能正常运作了。 - #### 第七步 – FreeDOS 的基本使用 ##### 常见命令 @@ -107,7 +103,7 @@ * `MKDIR NEWDIR` – 创建一个新目录 * `CLS` – 清除屏幕 -你可以借助互联网或者 Jim Hall 所创建的 [handy cheat sheet][17] 来找到更多基本的 DOS 命令。 +你可以借助互联网或者 Jim Hall 所创建的 [方便的速查表][17] 来找到更多基本的 DOS 命令。 ##### 运行一个程序 @@ -119,7 +115,7 @@ 对于游戏通常会有一个或者两个 .EXE 程序,你玩游戏之前不得不先运行它们。这些设置文件通常能够修复你遇到的声音,视频,或者控制问题。 -如果你遇到一些本教程中没指出的问题,别忘记访问 [home of FreeDOS][2] 来寻求解决办法。他们有一个 wiki 和一些其他的支持选项。 +如果你遇到一些本教程中没指出的问题,别忘记访问 [FreeDOS 主站][2] 来寻求解决办法。他们有一个 wiki 和一些其他的支持选项。 你使用过 FreeDOS 吗?你还想看关于 FreeDOS 哪些方面的教程?请在下面的评论区告诉我们。 @@ -132,7 +128,7 @@ via: https://itsfoss.com/install-freedos/ 作者:[John Paul][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[WangYueScream](https://github.com/WangYueScream) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d5f2d0163e0aa0fe4265f143ee3ae117622d784b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 00:53:40 +0800 Subject: [PATCH 1076/1143] PUB:20180826 How to Install and Use FreeDOS on VirtualBox.md @WangYueScream https://linux.cn/article-10385-1.html --- .../20180826 How to Install and Use FreeDOS on VirtualBox.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180826 How to Install and Use FreeDOS on VirtualBox.md (100%) diff --git a/translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md b/published/20180826 How to Install and Use FreeDOS on VirtualBox.md similarity index 100% rename from translated/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md rename to published/20180826 How to Install and Use FreeDOS on VirtualBox.md From ab64e2f074c2ecb25ee35cf781db1eead064990c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 26 Dec 2018 08:41:29 +0800 Subject: [PATCH 1077/1143] translated --- ... Mode Or Emergency Mode In Ubuntu 18.04.md | 106 ------------------ ... Mode Or Emergency Mode In Ubuntu 18.04.md | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md create mode 100644 translated/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md diff --git a/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md b/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md deleted file mode 100644 index 379bbfd20a..0000000000 --- a/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04) -[#]: via: (https://www.ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/) -[#]: author: (SK https://www.ostechnix.com/author/sk/) - -How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04 -====== -![](https://www.ostechnix.com/wp-content/uploads/2018/12/Boot-Into-Rescue-Mode-Or-Emergency-Mode-720x340.png) - -As you might already know, **Runlevels** are replaced with **Systemd targets** in many recent Linux distributions like RHEL 7 and Ubuntu 16.04 LTS. For more details about runlevels and systemd target, refer [**this guide**][1]. In this brief tutorial, we are going to see how to boot into **rescue mode** and/or **emergency mode**. This guide is tested in Ubuntu 18.04 LTS, however the steps given below would work on most Linux distributions that uses Systemd as default service manager. Before going further, let me clarify what is rescue mode and emergency mode and what is the purpose of the both modes. - -### What is Rescue mode? - -The **rescue mode** is equivalent to **single user mode** in Linux distributions that uses **SysV** as the default service manager. In rescue mode, all local filesystems will be mounted, only some important services will be started. However, no normal services (E.g network services) won’t be started. The rescue mode is helpful in situations where the system can’t boot normally. Also, we can perform some important rescue operations, such as [**reset root password**][2], in rescue mode. - -### What is Emergency mode? - -In contrast to the rescue mode, nothing is started in the **emergency mode**. No services are started, no mount points mounted, no sockets established, nothing. All you will have is just a **raw shell**. Emergency mode is suitable for debugging purposes. - -### Boot Into Rescue Mode In Ubuntu 18.04 LTS - -Boot your Ubuntu system. When Grub menu appears, choose the first entry and press **e** to edit. - -![](https://www.ostechnix.com/wp-content/uploads/2018/12/Grub-menu.png) - -If you don’t see the Grub menu, just hit ESC key right after the BIOS logo disappears. - -Find the line that starts with word **“linux”** and add the following line at the end of that line (To reach the end, just press **CTRL+e** or use END key or LEFT/RIGHT arrows in your keyboard): - -``` -systemd.unit=rescue.target -``` - -![](https://www.ostechnix.com/wp-content/uploads/2018/12/Edit-grub-menu.png) - -Once you added the above line, just press **CTRL+x** or **F10** to continue to boot into rescue mode. After a few seconds, you will be ended up in the rescue mode (single user mode) as root user. Here is how rescue mode looks like in Ubuntu 18.04 LTS server: - -![](https://www.ostechnix.com/wp-content/uploads/2018/12/Ubuntu-rescue-mode.png) - -Next, type the following command to mount root (/) file system into read/write mode. - -``` -mount -n -o remount,rw / -``` - -### Boot Into Emergency Mode - -Booting your Ubuntu into emergency is as same as above method. All you have to do is replace “systemd.unit=rescue.target” with “systemd.unit=emergency.target” when editing grub menu. - -[![emergency mode][3]][4] - -Once you added “systemd.unit=emergency.target”, press **Ctrl+x** or **F10** to continue booting into emergency mode. - -![](https://www.ostechnix.com/wp-content/uploads/2018/12/emergency-mode-1.png) - -Finally, you can mount root filesystem into read/write mode with command: - -``` -mount -n -o remount,rw / -``` - -### Switch between Rescue to Emergency mode and vice versa - -If you are in rescue mode, you don’t have to edit the grub boot entry as I mentioned above. Instead, just type the following command to switch to emergency mode instantly: - -``` -systemctl emergency -``` - -Similarly, to switch from emergency to rescue mode, type: - -``` -systemctl rescue -``` - -You know now what is rescue and emergency modes and how to boot into those modes in Ubuntu 18.04. Like I already mentioned, the steps provided here will work on many recent Linux versions that uses Systemd. - -And, that’s all for now. Hope this was useful. - -More good stuffs to come. Stay tuned! - -Cheers! - - - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/ - -作者:[SK][a] -选题:[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.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/check-runlevel-linux/ -[2]: https://www.ostechnix.com/how-to-reset-or-recover-root-user-password-in-linux/ -[3]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 -[4]: http://www.ostechnix.com/wp-content/uploads/2018/12/emergency-mode.png diff --git a/translated/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md b/translated/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md new file mode 100644 index 0000000000..9d5836b921 --- /dev/null +++ b/translated/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04) +[#]: via: (https://www.ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/) +[#]: author: (SK https://www.ostechnix.com/author/sk/) + +如何在 Ubuntu 18.04 中启动到救援模式或紧急模式 +====== +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Boot-Into-Rescue-Mode-Or-Emergency-Mode-720x340.png) + +正如你可能已经知道的那样,**runlevel** 在许多最近的 Linux 发行版(如 RHEL 7 和 Ubuntu 16.04 LTS)中被 **systemd target** 替换。有关 runlevel 和 systemd target 的更多详细信息,请参阅[**本指南**][1]。在这个简短的教程中,我们将看到如何启动**救援模式**以及**紧急模式**。本指南在 Ubuntu 18.04 LTS 中进行了测试,但是下面给出的步骤适用于大多数使用 systemd 作为默认服务管理器的 Linux 发行版。在进一步讨论之前,让我澄清什么是救援模式和紧急模式以及这两种模式的目的是什么。 + +### 什么是救援模式? + +**救援模式**相当于使用 **SysV** 作为默认服务管理器的 Linux 发行版中的 **单用户模式**。在救援模式下,将挂载所有本地文件系统,仅启动一些重要服务。但是,不会启动正常服务(例如网络服务)。救援模式在系统无法正常启动的情况下很有用。此外,我们可以在救援模式下执行一些重要的救援操作,例如[**重置 root 密码**][2]。 + +### 什么是紧急模式? + +与救援模式相比,在**紧急模式**中不启动任何东西。没有服务启动、没有挂载点、没有建立套接字,什么也没有。你所拥有的只是一个**原始的 shell**。紧急模式适用于调试目的。 + +### 在 Ubuntu 18.04 LTS 中进入救援模式 + +启动你的 Ubuntu 系统。出现 Grub 菜单时,选择第一条并按下 **e** 进行编辑。 + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Grub-menu.png) + +如果你没有看到 Grub 菜单,只需在 BIOS logo 消失后立即按下 ESC 键。 + +找到以单词 **“linux”** 开头的行,并在该行的末尾添加以下行(要到达末尾,只需按下 **CTRL+e** 或使用 END 键或左右箭头键): + +``` +systemd.unit=rescue.target +``` + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Edit-grub-menu.png) + +添加完成后,只需按下 **CTRL+x** 或 **F10** 即可继续启动救援模式。几秒钟后,你将以 root 用户身份进入救援模式(单用户模式)。以下是 Ubuntu 18.04 LTS 服务器版中救援模式的样子: + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/Ubuntu-rescue-mode.png) + +接下来,输入以下命令将根 (/) 文件系统挂载成读/写模式。 + +``` +mount -n -o remount,rw / +``` + +### 启动到紧急模式 + +将 Ubuntu 引导到紧急模式与上述方法相同。你只需在编辑 grub 菜单时将 “systemd.unit=rescue.target” 替换为 “systemd.unit=emergency.target” 即可。 + +[![emergency mode][3]][4] + +添加 “systemd.unit=emergency.target” 后,按下 **Ctrl+x** 或 **F10** 继续启动到紧急模式。 + +![](https://www.ostechnix.com/wp-content/uploads/2018/12/emergency-mode-1.png) + +最后,你可以使用以下命令将根文件系统挂载成读/写模式: + +``` +mount -n -o remount,rw / +``` + +### 在救援模式和紧急模式之间切换 + +如果你处于救援模式,则不必像上面提到的那样编辑 grub 条目。相反,只需输入以下命令即可立即切换到紧急模式: + +``` +systemctl emergency +``` + +同样,要从紧急模式切换到救援模式,请输入: + +``` +systemctl rescue +``` + +你现在知道了什么是救援模式和紧急模式以及如何在 Ubuntu 18.04 中启动这些模式。就像我已经提到的,这里提供的步骤将适用于许多使用 systemd 的 Linux 版本。 + +就是这些了。希望这篇文章有用。 + +还有更多好东西。敬请期待! + +干杯! + + + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/ + +作者:[SK][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/check-runlevel-linux/ +[2]: https://www.ostechnix.com/how-to-reset-or-recover-root-user-password-in-linux/ +[3]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[4]: http://www.ostechnix.com/wp-content/uploads/2018/12/emergency-mode.png \ No newline at end of file From 869b39f33f241f80a22c1a20fcaed053e4021d8c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 26 Dec 2018 08:48:22 +0800 Subject: [PATCH 1078/1143] translating --- sources/tech/20181222 A Tale of HTTP-2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181222 A Tale of HTTP-2.md b/sources/tech/20181222 A Tale of HTTP-2.md index 5484e67148..897fd83fc5 100644 --- a/sources/tech/20181222 A Tale of HTTP-2.md +++ b/sources/tech/20181222 A Tale of HTTP-2.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1be827d677fdbf18f75c6bf06acca89967c60d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com> Date: Wed, 26 Dec 2018 11:05:11 +0800 Subject: [PATCH 1079/1143] ScarboroughCoral translating! --- ...803 How to use Fedora Server to create a router - gateway.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180803 How to use Fedora Server to create a router - gateway.md b/sources/tech/20180803 How to use Fedora Server to create a router - gateway.md index 0394826c10..934693d1cf 100644 --- a/sources/tech/20180803 How to use Fedora Server to create a router - gateway.md +++ b/sources/tech/20180803 How to use Fedora Server to create a router - gateway.md @@ -1,3 +1,5 @@ +ScarboroughCoral translating! + How to use Fedora Server to create a router / gateway ====== From 51dfff4fe1faa32bcdb0c7ac8b4b67ef0bbfd22c Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Wed, 26 Dec 2018 13:36:37 +0800 Subject: [PATCH 1080/1143] Check translation of How to Update Ubuntu. --- ...untu -Terminal - GUI Methods- It-s FOSS.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md index 13d393b381..9d7a8ebf92 100644 --- a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md +++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md @@ -10,11 +10,11 @@ 如何更新 Ubuntu [终端及GUI方式] It's FOSS ====== -**这篇教程将向你展示如何更新服务器版本或者桌面版本的Ubuntu。它还解释了更新和升级之间的区别以及你应该了解的有关于Ubuntu Linux中的更新的一些其他内容。** +**这篇教程将向你展示如何更新服务器版本或者桌面版本的 Ubuntu。它还解释了更新和升级之间的区别以及你应该了解的有关于 Ubuntu Linux 中的更新的一些其他内容。** -如果你是一个新手并已经体验Ubuntu数天或几周,你可能想知道如何更新你的[Ubuntu][1]系统以获取安全补丁,错误修复和应用升级。 +如果你是一个新手并已经体验 Ubuntu 数天或几周,你可能想知道如何更新你的 [Ubuntu][1] 系统以获取安全补丁,错误修复和应用升级。 -更新 Ubuntu 非常简单。我并不夸张的说。它简单得只要运行两个命令。让我来告诉你更多更新细节。 +更新 Ubuntu 非常简单。我并不是瞎说。它简单得只要运行两个命令。让我来告诉你这两个命令的更多细节。 请注意,本教程适用于 Ubuntu 18.04,16.04 或任何其他版本。命令行方式也适用于基于 Ubuntu 的发行版如 Linux Mint,Linux Lite,elementary OS 等。 @@ -22,7 +22,7 @@ ![如何更新 Ubuntu][2] -在桌面上,打开终端。你可以在菜单里找到它或者使用 Ctrl+Alt+T [快捷键][3]。如果你登陆到一台 [Ubuntu 服务器][4],那你已经在访问一个终端了。 +在桌面上,打开终端。你可以在菜单里找到它或者使用 Ctrl+Alt+T [快捷键][3]。如果你是登陆到一台 [Ubuntu 服务器][4],那你已经在访问一个终端了。 在终端里,你只需要使用以下命令: @@ -30,7 +30,7 @@ sudo apt update && sudo apt upgrade -y ``` -它将询问密码,而你可以使用你账号的密码。输入时,你将不会看到任何内容在屏幕上,所以请继续输入你的密码并按回车键。 +它将询问密码,而你可以使用你的账号密码。输入时,你将不会看到任何内容在屏幕上,所以请继续输入你的密码并按回车键。 现在,我来解释下上面的命令。 @@ -49,9 +49,9 @@ sudo apt upgrade #### 说明:sudo apt update -这条命令更新了可用软件包的本地数据库。如果你没运行这条命令,本地数据库将不会更新而你的系统将不会知道是否又可用的新版本。 +这条命令更新了可用软件包的本地数据库。如果你没运行这条命令,本地数据库将不会被更新,而你的系统将不会知道是否有可用的新版本。 -这就是为什么当你运行 `sudo apt update`,你会在输出中看到大量的 URLs。这条命令从对应的储存库(你在输出中看到的 URLs)中获取软件包信息。 +这就是为什么当你运行 `sudo apt update`,你会在输出中看到大量的 URLs。这条命令会从对应的储存库(你在输出中看到的 URLs)中获取软件包信息。 ![更新 Ubuntu Linux][5] @@ -69,7 +69,7 @@ apt list --upgradable ![通过命令行更新 Ubuntu Linux][7] -你可以键入 `yes`,`y` 或者只敲回车键去确认安装这些更新。 +你可以键入 `yes`,`y` 或者只敲回车键去确认安装这些更新。 所以总的来说,`sudo apt update` 会检查可用的新版本,而 `sudo apt upgrade` 实际上会执行更新。 @@ -123,7 +123,7 @@ sudo apt autoremove #### 在 Ubuntu Server 中内核热修复以避免重启 -如果是 Linux 内核更新,你将需要在系统更新后重启。当你不希望服务器停机时,这将是一个问题。 +如果是 Linux 内核更新,你将需要在系统更新后重启。当你不希望服务器停机时,这将会是一个问题。 [热修复][15]功能允许Linux内核在持续运行时打补丁。换句话说就是你不需要重启你的系统。 @@ -131,7 +131,7 @@ sudo apt autoremove #### 版本升级是不同的 -本文讨论的更新是使你安装的 Ubuntu 保持最新。它不包括[版本升级][17](例如从 Ubuntu 16.04 升级到 18.04)。 +本文讨论的更新是使你安装的 Ubuntu 保持最新。但它不包括[版本升级][17](例如从 Ubuntu 16.04 升级到 18.04)。 [Ubuntu 版本][18] 升级完全是另一回事。它更新整个操作系统核心。你需要在这个漫长的过程开始前做好备份。 From 1048b330a6021410854cb658918fec7c7fb9d98e Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Wed, 26 Dec 2018 13:37:29 +0800 Subject: [PATCH 1081/1143] Delete 20181210 How to Update Ubuntu.md --- ...untu -Terminal - GUI Methods- It-s FOSS.md | 175 ------------------ 1 file changed, 175 deletions(-) delete mode 100644 sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md diff --git a/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md deleted file mode 100644 index 3a9036f403..0000000000 --- a/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md +++ /dev/null @@ -1,175 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (LazyWolfLin) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Update Ubuntu [Terminal & GUI Methods] It's FOSS) -[#]: via: (https://itsfoss.com/update-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Translating by LazyWolfLin - -How to Update Ubuntu [Terminal & GUI Methods] It's FOSS -====== - -**This tutorial shows you how to update Ubuntu for both server and desktop versions. It also explains the difference between update and upgrade along with a few other things you should know about updates in Ubuntu Linux.** - -If you are a new user and have been using Ubuntu for a few days or weeks, you might be wondering how to update your [Ubuntu][1] system for security patches, bug fixes and application upgrades. - -Updating Ubuntu is absolutely simple. I am not exaggerating. It’s as simple as running two commands. Let me give you more details on it. - -Please note that the tutorial is valid for Ubuntu 18.04, 16.04 or any other version. The command line way is also valid for Ubuntu-based distributions like Linux Mint, Linux Lite, elementary OS etc. - -### Update Ubuntu via Command Line - -![How to Update Ubuntu][2] - -On the desktop, open the terminal. You can find it in the menu or use the Ctrl+Alt+T [keyboard shortcut][3]. If you are logged on to an [Ubuntu server][4], you already have access to a terminal. - -In the terminal, you just have to use the following command: - -``` -sudo apt update && sudo apt upgrade -y -``` - -It will ask for password and you can use your account’s password. You won’t see the anything on the screen while typing so keep on typing your password and hit enter. - -Now let me explain the above command. - -Actually, it’s not a single command. It’s a combination of two commands. The && is a way to combine two commands in a way that the second command runs only when the previous command ran successfully. - -The ‘-y’ in the end automatically enters yes when the command ‘apt upgrade’ ask for your confirmation before installing the updates. - -Note that you can also use the two commands separately, one by one: - -``` -sudo apt update -sudo apt upgrade -``` - -It will take a little longer because you have to wait for one command to finish and then enter the second command. - -#### Explanation: sudo apt update - -This command updates the local database of available packages. If you won’t run this command, the local database won’t be updated and your system will not know if there are any new versions available. - -This is why when you run the sudo apt update, you’ll see lots of URLs in the output. The command fetches the package information from the respective repositories (the URLs you see in the output). - -![Updating Ubuntu Linux][5] - -At the end of the command, it tells you how many packages can be upgraded. You can see these packages by running the following command: - -``` -apt list --upgradable -``` - -**Additional Reading:** Read this article to learn [what is Ign, Hit and Get in the apt update command output][6]. - -#### Explanation: sudo apt upgrade - -This command matches the versions of installed packages with the local database. It collects all of them and then it will list all of the packages that have a newer version available. At this point, it will ask if you want to upgrade (the installed packages to the newer version). - -![Update Ubuntu Linux via Command Line][7] - -You can type ‘yes’, ‘y’ or just press enter to confirm the installation of updates. - -So the bottom line is that the sudo apt update checks for the availability of new versions while as the sudo apt upgrade actually performs the update. - -The term update might be confusing as you might expect the apt update command to update the system by installing the updates but that doesn’t happen. - -### Update Ubuntu via GUI [For Desktop Users] - -If you are using Ubuntu as a desktop, you don’t have to go to terminal just for updating the system. You can still use the command line but it’s optional for you. - -In the menu, look for ‘Software Updater’ and run it. - -![Run Software Updater in Ubuntu][8] - -It will check if there are updates available for your system. - -![Checking if updates are available for Ubuntu][9] - -If there are updates available, it will give provide you with options to install the updates. - -![Install Updates via Update Manager in Ubuntu][10] - -Click on Install Now, it may ask for your password. - -![Installing Updates in Ubuntu Linux via GUI][11] - -Once you enter your password, it will start installing the updates. - -![Updating Ubuntu via GUI][12] - -In some cases, you may need to reboot the system for the installed updates to work properly. You’ll be notified at the end of the update if you need to restart the system. - -![Updating Ubuntu via GUI][12] - -You can choose to restart later if you don’t want to reboot your system straightaway. - -![Installing updates via GUI in Ubuntu][13] - -Tip: If the software updater returns an error, you should use the command ‘sudo apt update’ in the terminal. The last few lines of the output will contain the actual error message. You can search on the internet for that error and fix the problem. - -### Few things to keep in mind abou updating Ubuntu - -You just learned how to update your Ubuntu system. If you are interested, you should also know these few things around Ubuntu updates. - -#### Clean up after an update - -Your system will have some unnecessary packages that won’t be required after the updates. You can remove such packages and [free up some space][14] using this command: - -``` -sudo apt autoremove -``` - -#### Live patching kernel in Ubuntu Server to avoid rebooting - -In case of a Linux kernel updates, you’ll have to restart the system after the update. This is an issue when you don’t want downtime for your server. - -[Live patching][15] feature allows the patching of Linux kernel while the kernel is still running. In other words, you don’t have to reboot your system. - -If you manage servers, you may want to [enable live patching in Ubuntu][16]. - -#### Version upgrades are different - -The updates discussed here is to keep your Ubuntu install fresh and updated. It doesn’t cover the [version upgrades][17] (for example upgrading Ubuntu 16.04 to 18.04). - -[Ubuntu version][18] upgrades are entirely a different thing. It updates the entire operating system core. You need to make proper backups before starting this lengthy process. - -### Conclusion - -I hope you liked this tutorial on updating the Ubuntu system and you learned a few new things. - -If you have any questions, please fee free to ask. If you are an experienced Linux users and have some tip that can make this tutorial more useful, please share it with the rest of us. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/update-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.ubuntu.com/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/how-to-update-ubuntu.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/ubuntu-shortcuts/ -[4]: https://www.ubuntu.com/download/server -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubunt-1.jpeg?resize=800%2C357&ssl=1 -[6]: https://itsfoss.com/apt-get-linux-guide/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubunt-2.jpeg?ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-via-GUI-1.jpeg?resize=800%2C250&ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-via-GUI-2.jpeg?resize=800%2C250&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-GUI-3.jpeg?resize=800%2C365&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/install-update-ubuntu-1.jpg?resize=800%2C450&ssl=1 -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/installing-updates-ubuntu.jpg?ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/installing-updates-ubuntu-2.jpeg?ssl=1 -[14]: https://itsfoss.com/free-up-space-ubuntu-linux/ -[15]: https://www.ubuntu.com/livepatch -[16]: https://www.cyberciti.biz/faq/howto-live-patch-ubuntu-linux-server-kernel-without-rebooting/ -[17]: https://itsfoss.com/upgrade-ubuntu-version/ -[18]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ From 0957306a56214ca0eafe1e6d48aab05594ef05e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Wed, 26 Dec 2018 15:35:55 +0800 Subject: [PATCH 1082/1143] Translating by robsean --- sources/tech/20170523 Best Websites to Download Linux Games.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20170523 Best Websites to Download Linux Games.md b/sources/tech/20170523 Best Websites to Download Linux Games.md index e6d4636fdb..b29afc1dfb 100644 --- a/sources/tech/20170523 Best Websites to Download Linux Games.md +++ b/sources/tech/20170523 Best Websites to Download Linux Games.md @@ -1,3 +1,4 @@ +Translating by robsean Best Websites to Download Linux Games ====== Brief: New to Linux gaming and wondering where to **download Linux games** from? We list the best resources from where you can **download free Linux games** as well as buy premium Linux games. From 3024918a2f19b2e92a01e8712e82a84439ce50d6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 19:51:08 +0800 Subject: [PATCH 1083/1143] PRF:20181121 DevOps is for everyone.md @alim0x --- .../talk/20181121 DevOps is for everyone.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/translated/talk/20181121 DevOps is for everyone.md b/translated/talk/20181121 DevOps is for everyone.md index 778656640d..df9e41ffd1 100644 --- a/translated/talk/20181121 DevOps is for everyone.md +++ b/translated/talk/20181121 DevOps is for everyone.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (alim0x) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (DevOps is for everyone) [#]: via: (https://opensource.com/article/18/11/how-non-engineer-got-devops) @@ -10,41 +10,40 @@ 所有人的 DevOps ====== -让一名非工程师来解释为什么你不必成为一位开发者或运维就能爱上 DevOps。 +> 让一名非工程师来解释为什么你不必成为一位开发者或运维就能爱上 DevOps。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-game-play-inclusive-diversity-collaboration.png?itok=8sUXV7W1) -我没有过开发或运维的工作——那怎么我在写一篇关于 [DevOps][1] 的文章?我一直都对计算机和技术有兴趣。我还对社群、心理学以及帮助他人充满热情。当我第一次听到 DevOps 时,这个概念激起了我的兴趣,因为它看起来融合了很多我感兴趣的东西,即便我是不写代码的。 +我从未做过开发或运维的工作 —— 那怎么我在写一篇关于 [DevOps][1] 的文章?我一直都对计算机和技术有兴趣。我还对社群、心理学以及帮助他人充满热情。当我第一次听到 DevOps 时,这个概念激起了我的兴趣,因为它看起来融合了很多我感兴趣的东西,即便我是不写代码的。 我的第一台电脑是 TRS-80,我喜欢在上面编写 BASIC 程序。我只上过两门我的高中开设的计算机编程课程。若干年后,我创办了一家计算机公司。我定制邮件标签和信纸,并建立了一个数据库来存储地址。 问题是我并不能从写代码中获得享受。我想要教育和帮助人们,我没法将写代码看作这样的一个机会。是的,技术可以帮助人们并改变生活,但是写代码没有点燃我的热情。我需要对我的工作感到兴奋并做我喜欢的事情。 +我发现我爱 DevOps。对我而言,DevOps 指的是: + * 文化,而不是代码 * 过程,而不是结果 * 建立一个所有人可以持续提升的环境 * 沟通与合作,而不是独立工作 - -我发现我爱 DevOps。对我而言,DevOps 指的是: - 归根结底,DevOps 是指成为社区工作的一部分,实现共同的目标。DevOps 融合了心理学、社群、技术。DevOps 不是一个职位名称,它是一种生活和工作的哲学。 ### 找到我的社群 快四年前,我在西雅图参加了我的第一个 [DevOps 日][2] 会议。我感觉我找到了我的社群。我觉得受到了欢迎和接受,尽管我从事营销工作而且没有计算机科学文凭。我可以从心理学和技术中寻找乐趣。 -在 DevOps 日,我学到了 [DevOps“三步工作法”][3]——流动,反馈,持续实验和学习——以及新(对我而言)的概念,如Kaizen(改善)和Kaikaku(改革)。随着我的学习深入,我发现我在说这样的话,“我是这样做的!我都不知道这样做还有个名字!” +在 DevOps 日,我学到了 [DevOps“三步工作法”][3] —— 流动、反馈、持续实验和学习 —— 以及新(对我而言)的概念,如 Kaizen(改善)和 Kaikaku(改革)。随着我的学习深入,我发现我在说这样的话,“我是这样做的!我都不知道这样做还有个名字!” -[Kaizen(改善)][4]是持续改进和学习的实践。小的量变积累随着时间的推移可以引起质变。我发现它和卡罗尔.德韦克的[成长型思维][5]的想法很相似。人们不是生来就是专家。在某方面拥有经验需要花费时间,练习,以及常常还有失败。承认增量的改善对确保我们不会放弃是很有必要的。 +[Kaizen(改善)][4]是持续改进和学习的实践。小的量变积累随着时间的推移可以引起质变。我发现它和卡罗尔·德韦克的[成长型思维][5]的想法很相似。人们不是生来就是专家。在某方面拥有经验需要花费时间、练习,以及常常还有失败。承认增量的改善对确保我们不会放弃是很有必要的。 -另一方面,[Kaikaku(改革)][6]的概念是指,长时间的小的改变有时不能起作用,你需要做一些完全的或破坏性的改变。在没有找到下份工作前就辞职或移居新城市就足够有破坏性——是的,两者我都做过。但这些彻底的改变收获巨大。如果我没有辞职并休息一段时间,我也许不会接触到 DevOps。等我决定继续工作的时候,我一直听到 DevOps,我开始研究它。这引导我参加了我的第一个 DevOps 日,从那里我开始看到我的所有热情开始聚集。从那时起,我已经参加了五次 DevOps 日活动,并且定期撰写关于 DevOps 话题的文章。 +另一方面,[Kaikaku(改革)][6]的概念是指,长时间的小的改变有时不能起作用,你需要做一些完全的或破坏性的改变。在没有找到下份工作前就辞职或移居新城市就足够有破坏性 —— 是的,两者我都做过。但这些彻底的改变收获巨大。如果我没有辞职并休息一段时间,我也许不会接触到 DevOps。等我决定继续工作的时候,我一直听到 DevOps,我开始研究它。这引导我参加了我的第一个 DevOps 日,从那里我开始看到我的所有热情开始聚集。从那时起,我已经参加了五次 DevOps 日活动,并且定期撰写关于 DevOps 话题的文章。 ### 将三步工作法用到工作中 改变是困难的,学习新事物可以听起来很吓人。DevOps 的三步工作法提供了一个管理改变的框架。比如:信息流动是怎样的?是什么驱动着你做出改变?一旦你认为一个改变是必需的,你如何获得这个改变是否正确的反馈?你如何知道你在取得进展?反馈是必要的,并且应该包含积极和有建设性的要素。困难的地方在于保证建设性的要素不要重于积极要素。 -对我而言,第三步——持续实验和学习——是 DevOps 最重要的部分。有一个可以自由地实验和冒险的环境,人们可以获得意想不到的结果。有时这些结果是好的,有时不是太好——但这没事。创建一个可以接受失败结果的环境可以鼓励人们冒险。我们都应该力争定期的持续实验和学习。 +对我而言,第三步 —— 持续实验和学习 —— 是 DevOps 最重要的部分。有一个可以自由地实验和冒险的环境,人们可以获得意想不到的结果。有时这些结果是好的,有时不是太好 —— 但这没事。创建一个可以接受失败结果的环境可以鼓励人们冒险。我们都应该力争定期的持续实验和学习。 DevOps 的三步工作法提供了一个尝试,获得反馈,以及从错误中获取经验的方法。几年前,我的儿子告诉我,“我从来就没想做到最好,因为那样我就没法从我的错误中学到东西了。”我们都会犯错,从中获得经验帮助我们成长和改善。如果我们的文化不支持尝试和学习,我们就不会愿意去犯错。 @@ -60,7 +59,7 @@ via: https://opensource.com/article/18/11/how-non-engineer-got-devops 作者:[Dawn Parych][a] 选题:[lujun9972][b] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f8f96e530cba62b80c69e3cc3bda911d4b3036e7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 19:51:49 +0800 Subject: [PATCH 1084/1143] PUB:20181121 DevOps is for everyone.md @alim0x https://linux.cn/article-10386-1.html --- .../talk => published}/20181121 DevOps is for everyone.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20181121 DevOps is for everyone.md (98%) diff --git a/translated/talk/20181121 DevOps is for everyone.md b/published/20181121 DevOps is for everyone.md similarity index 98% rename from translated/talk/20181121 DevOps is for everyone.md rename to published/20181121 DevOps is for everyone.md index df9e41ffd1..c4c61486e6 100644 --- a/translated/talk/20181121 DevOps is for everyone.md +++ b/published/20181121 DevOps is for everyone.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (alim0x) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (DevOps is for everyone) [#]: via: (https://opensource.com/article/18/11/how-non-engineer-got-devops) [#]: author: (Dawn Parych https://opensource.com/users/dawnparzych) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10386-1.html) 所有人的 DevOps ====== From de8c02aee1d0e542dec1a81252051dcfc6f17b00 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 20:05:19 +0800 Subject: [PATCH 1085/1143] PRF:20181213 Relax by the fire at your Linux terminal.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zhs852 恭喜你完成了第一篇翻译! --- ... Relax by the fire at your Linux terminal.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/translated/tech/20181213 Relax by the fire at your Linux terminal.md b/translated/tech/20181213 Relax by the fire at your Linux terminal.md index b3532cbd83..75e856d74f 100644 --- a/translated/tech/20181213 Relax by the fire at your Linux terminal.md +++ b/translated/tech/20181213 Relax by the fire at your Linux terminal.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (zhs852) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Relax by the fire at your Linux terminal) @@ -9,7 +9,8 @@ 在 Linux 终端中观看火焰 ====== -何不在命令行中进行一次“烧烤”呢? + +> 何不在命令行中进行一次“烧烤”呢? ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-aafire.png?itok=pAttiVvG) @@ -19,15 +20,15 @@ 如果你住在北半球的非热带地区,可能冬季来临时你会被冻得满脸通红。住在这里的我,最喜欢的事情便是在火炉旁惬意地边喝茶边读书。 -不幸的是,我家刚好缺个放火炉的地方。不过,多亏了今天我要介绍的 **aafire** ,我仍然可以假装我坐在火炉旁。 +不幸的是,我家刚好缺个放火炉的地方。不过,多亏了今天我要介绍的 `aafire` ,我仍然可以假装我坐在火炉旁。 -在我所使用的系统里, **aafire** 被打包进了 **aalib** 。 **aalib** 是一个受人喜爱的库,它可以很方便地将图像转换成 ASCII 图并输出到终端(或其它任何地方)。 **aalib** 将多种多样的图像带入了 Linux 终端。你可以看看本系列的其它文章,了解一下其它小程序,以便配合使用并充分利用它们。在 Fedora 中,你可以通过以下命令来安装 **aalib** : +在我所使用的系统里, `aafire` 被打包进了 aalib 。 aalib 是一个受人喜爱的库,它可以很方便地将图像转换成 ASCII 图并输出到终端(或其它任何地方)。 aalib 将多种多样的图像带入了 Linux 终端。你可以看看本系列的其它文章,了解一下其它小程序,以便配合使用并充分利用它们。在 Fedora 中,你可以通过以下命令来安装 aalib : ``` $ sudo dnf install aalib ``` -接着,试着运行 **aafire** 命令。 **aalib** 默认会使用 GUI 模式,我们要进行一些操作来让它在终端中运行(毕竟这一系列文章都讲的是命令行)。十分幸运的是,仅需安装 [curses][1] 就能实现我们想要的效果。请执行: +接着,试着运行 `aafire` 命令。 `aalib` 默认会使用 GUI 模式,我们要进行一些操作来让它在终端中运行(毕竟这一系列文章都讲的是命令行)。十分幸运的是,仅需安装 [curses][1] 就能实现我们想要的效果。请执行: ``` $ aafire -driver curses @@ -35,11 +36,11 @@ $ aafire -driver curses ![](https://opensource.com/sites/default/files/uploads/linux-toy-aafire-animated.gif) -如果你觉得 **aa-lib** 挺有意思,可以在 [Sourceforge][2] 上找到它的源码(以 LGPLv2 许可证开源)。 +如果你觉得 aalib 挺有意思,可以在 [Sourceforge][2] 上找到它的源码(以 LGPLv2 许可证开源)。 欢迎将你觉得有意思的命令行小程序投稿到原作者处,只需在原文下留言即可。 -如果有兴趣,可以查看原作者的上一篇文章: [Patch into The Matrix at the Linux command line][3] 。 +如果有兴趣,可以查看原作者的上一篇文章: [在命令行中步入黑客帝国][3] 。 -------------------------------------------------------------------------------- @@ -48,7 +49,7 @@ via: https://opensource.com/article/18/12/linux-toy-aafire 作者:[Jason Baker][a] 选题:[lujun9972][b] 译者:[zhs852](https://github.com/zhs852) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9e621a8d9cf7c2487057aecb73dd469243d34edd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 20:06:45 +0800 Subject: [PATCH 1086/1143] PUB:20181213 Relax by the fire at your Linux terminal.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zhs852 本文首发地址:https://linux.cn/article-10387-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/zhs852 请注册领取LCCN :https://lctt.linux.cn/ --- .../20181213 Relax by the fire at your Linux terminal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181213 Relax by the fire at your Linux terminal.md (97%) diff --git a/translated/tech/20181213 Relax by the fire at your Linux terminal.md b/published/20181213 Relax by the fire at your Linux terminal.md similarity index 97% rename from translated/tech/20181213 Relax by the fire at your Linux terminal.md rename to published/20181213 Relax by the fire at your Linux terminal.md index 75e856d74f..5b286e36a8 100644 --- a/translated/tech/20181213 Relax by the fire at your Linux terminal.md +++ b/published/20181213 Relax by the fire at your Linux terminal.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (zhs852) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10387-1.html) [#]: subject: (Relax by the fire at your Linux terminal) [#]: via: (https://opensource.com/article/18/12/linux-toy-aafire) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) From 4280d68cfab4048790cc537c133ba9288255a2d4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 21:17:48 +0800 Subject: [PATCH 1087/1143] PRF:20180101 27 open solutions to everything in education.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lixinyuxx 这篇翻译不够细心 --- ...en solutions to everything in education.md | 89 ++++++++----------- 1 file changed, 35 insertions(+), 54 deletions(-) diff --git a/translated/tech/20180101 27 open solutions to everything in education.md b/translated/tech/20180101 27 open solutions to everything in education.md index 43f4717c1f..48a4f3fa3c 100644 --- a/translated/tech/20180101 27 open solutions to everything in education.md +++ b/translated/tech/20180101 27 open solutions to everything in education.md @@ -1,72 +1,52 @@ -27个解决教学问题的开放式方法 +27 个全方位的开放式教育解决方案 ====== + +> 阅读这些 2017 年 Opensource.com 发布的开放如何改进教育和学习的好文章。 + ![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo) -开放式理念 (从开源软件到开放硬件, 再到开放原则) 正在改变教育的范式。因此, 为了庆祝今年发生的一切, 我收集了2017年在 Opensource.com 上发表的27篇关于这个主题的最好的文章。我把它们分成明确的主题, 而不是按人气来分类。而且, 如果这27个故事不能满足你对教育公开信息的胃口, 那就看看我们的合作文章吧 “ [education is leveraging Raspberry Pi and Linux][30]” +开放式理念 (从开源软件到开放硬件,再到开放原则) 正在改变教育的范式。因此,为了庆祝今年发生的一切,我收集了 2017 年(译注:本文原发布于 2018 年初)在 Opensource.com 上发表的 27 篇关于这个主题的最好的文章。我把它们分成明确的主题,而不是按人气来分类。而且,如果这 27 个故事不能满足你对教育方面开源信息的胃口,那就看看我们的合作文章吧 “[教育如何借助 Linux 和树莓派][30]”。 ### 开放对每个人都有好处 -1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt 评价David Price 的书 'OPEN' ,该书探讨了 “开放” 不仅仅是技术转变的观点, 而是 “我们未来将如何工作、生活和学习”。 - -2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur 指出了如何利用开放式学习在工作群体中脱颖而出。 这个建议不仅仅是针对程序员的, 而是针对程序员的。设计师、作家、营销人员和其他创意专业人士也是开放式成功的关键。 - -3. [A graduate degree could springboard you into an open source job][3]: 引用的研究表明会 Linux 技能会带来更高的薪水, Joshua Pearce 说对开源的熟练和研究生学位是无与伦比的职业技能组合。 - -4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger 向我们展示了开放的做法是如何在宾夕法尼亚州的一个学区创造一种更具包容性、敏捷性和开放性的文化的。 Charlie 说, 这不仅仅是为了省钱;该区还受益于 “开放式领导原则, 促进师生创新, 帮助更好地吸引社区, 创造一个更有活力和包容性的学习社区”。 - -5. [15 ways to empower students with open source tools][5]: 我写开源是如何让学生自由探索、补拙和学习的, 不管他们是在学习基本的数字化素养, 还是通过有趣的项目来扩展这些技能。 - -6. [Developer opportunities to code for good][6]: 开源往往是对社会有益的项目的支柱。正如 Benetech Labs 副总裁 Ahn Bui 在这次采访中指出的那样: “建立开放数据标准是打破数据孤岛不可或缺的一步。这些开放标准将为互操作性提供基础, 进而转化为更多的组织共同建设, 往往更具成本效益。最终目标是以同样的成本甚至更低的成本为更多的人服务。” +1. [书评:《OPEN》探讨了开放性的广泛文化含义][1]:Scott Nesbitt 评价 David Price 的书 《OPEN》 ,该书探讨了 “开放” 不仅仅是技术转变的观点,而是 “我们未来将如何工作、生活和学习”。 +2. [通过开源技能快速开始您的职业生涯][2]: VM (Vicky) Brasseur 指出了如何借助学习开源在工作群体中脱颖而出。这个建议不仅仅是针对程序员的;设计师、作家、营销人员和其他创意专业人士也对开源的成功至关重要。 +3. [研究生学位可以让你跳槽到开源职位][3]:引用的研究表明会 Linux 技能会带来更高的薪水, Joshua Pearce 说对开源的熟练和研究生学位是无与伦比的职业技能组合。 +4. [彻底改变了宾夕法尼亚的学校文化的三种实践][4]:Charlie Reisinger 向我们展示了开放式实践是如何在宾夕法尼亚州的一个学区创造一种更具包容性、敏捷性和开放性的文化的。Charlie 说,这不仅仅是为了省钱;该区还受益于 “开放式领导原则,促进师生创新,帮助更好地吸引社区,创造一个更有活力和包容性的学习社区”。 +5. [使用开源工具促使学生进步的 15 种方法][5]:我写了开源是如何让学生自由探索、补拙和学习的,不管他们是在学习基本的数字化素养,还是通过有趣的项目来扩展这些技能。 +6. [开发人员有机会编写好的代码][6]:开源往往是对社会有益的项目的支柱。正如 Benetech Labs 副总裁 Ahn Bui 在这次采访中指出的那样:“建立开放数据标准是打破数据孤岛不可或缺的一步。这些开放标准将为互操作性提供基础,进而转化为更多的组织共同建设,往往更具成本效益。最终目标是以同样的成本甚至更低的成本为更多的人服务。” ### 用于再融合和再利用的开放式教育资源 -1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis,Wiki Ed 的, 项目总监,讨论开放教育资源 (OERs) ,如 Wiki Ed,如何提供高质量且经济实惠的开源学习资源作为课堂教学工具。 - -2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green,是 Creative Common 开放教育主任,分享高等教育中教育面貌是如何变化的, 以及 Creative Common 正在采取哪些措施来促进教育。 - -3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites,是 Open Up Resources 社区的福音传教士和首席营销官, 谈论非营利组织努力为 K-12 学校提供开放的, 标准一致的课程。 - -4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke , Hawaii 大学 Manoa 分校的教育技术专家,他说, 在大学课程中过渡到 ORE 将 “使教师能够控制他们教授的内容, 我们预计这将为他们节省学生的费用。” - -5. [How open courses are slashing the cost of higher education][11]: Saylor Academy 的教育主任 Devon Ritter 报告了 Saylor 是如何建立以公开许可内容为基础的大学学分课程, 目的是使更多的人能够负担得起和获得高等教育。 - -6. [Open educational resources movement gains speed][12]: Alexis Clifton,State University of New York 的 OER 服务的执行主任, 描述了纽约800万美元的投资如何刺激开放教育的增长, 并使大学更实惠。 - -7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik 在Duke University 探索 OSPRI (Open Source Pedagogy Research and Innovation,开源教育学的研究与创新), 在 Duke 和 Red Hat 的联合合作这是建立一个21世纪的, preK-12 学习生态系统, 是开放的设计。 - -8. [Perma.cc stops scholarly link rot][14]: Virginia Tech 的 Phillip Young 写关于 Perma.cc, “link rot”(链接失效) 的解决方案 很大可能在学术论文中的超链接随着时间的推移而消失或变化。 - -9. [Open education: How students save money by creating open textbooks][15]: OER 先驱 Robin DeRosa 谈到 “公开许可教科书引入的自由, 以及教育和学习应结合包容性生态系统, 以增强公益的总体理念”。 +1. [学术教员可以和维基百科一起教学吗?][7]:Wiki Ed 的项目总监 LiAnna Davis 讨论开放式教育资源open educational resources (OER) ,如 Wiki Ed,是如何提供高质量且经济实惠的开源学习资源作为课堂教学工具。 +2. [书本内外?开放教育资源的状态][8]:Cable Green 是 Creative Common 开放教育主管,分享了高等教育中教育面貌是如何变化的,以及 Creative Common 正在采取哪些措施来促进教育。 +3. [急需符合标准的课程的学校系统找到了希望][9]:Karen Vaites 是 Open Up Resources 社区布道师和首席营销官,谈论了非营利组织努力为 K-12 学校提供开放的、标准一致的课程。 +4. [夏威夷大学如何解决当今高等教育的问题][10]:夏威夷大学 Manoa 分校的教育技术专家 Billy Meinke 表示,在大学课程中过渡到 ORE 将 “使教师能够控制他们教授的内容,我们预计这将为他们节省学生的费用。” +5. [开放式课程如何削减高等教育成本][11]:塞勒学院的教育总监 Devon Ritter 报告了塞勒学院是如何建立以公开许可内容为基础的大学学分课程,目的是使更多的人能够负担得起和获得高等教育。 +6. [开放教育资源运动在提速][12]:Alexis Clifton 是纽约州立大学的 OER 服务的执行董事,描述了纽约 800 万美元的投资如何刺激开放教育的增长,并使大学更实惠。 +7. [开放项目合作,从小学到大学教室][13]:来自杜克大学的 Aria F. Chernik 探索 OSPRI (开源教育学的研究与创新), 这是杜克大学和红帽的合作,旨在建立一个 21 世纪的,开放设计的 preK-12 学习生态系统。 +8. [Perma.cc 将阻止学术链接腐烂][14]::弗吉尼亚理工大学的 Phillip Young 写的关于 Perma.cc 的文章,这种一种“链接腐烂”的解决方案,在学术论文中的超链接随着时间的推移而消失或变化的概览很高。 +9. [开放教育:学生如何通过创建开放教科书来节省资金][15]:OER 先驱 Robin DeRosa 谈到 “引入公开许可教科书的自由,以及教育和学习应结合包容性生态系统,以增强公益的总体理念”。 ### 课堂上的开源工具 -1. [How an open source board game is saving the planet][16]: Joshua Pearce 写的关于拯救地球的一个棋盘游戏, 使学生能够解决环境问题, 同时有乐趣, 并为制造商社区作出贡献。 - -2. [A new Android app for teaching kids how to read][17]: Michael Hall 谈到他的儿子 Phoenicia,他在儿子被诊断为自闭症后开发的儿童识字应用, 为了产生更好的编码价值, 以及为什么用户测试比你想象的更重要。 - -3. [8 open source Android apps for education][18]: Joshua Allen Holm 通过推荐 F-Droid 存储库中的8个开源应用来尝试, 这将挑战我们将智能手机用作学习工具。 - -4. [3 open source alternatives to MATLAB][19]: Jason Baker's 更新了他2016年的开源数学计算软件调查, 提出了 MATLAB 的替代方案, 这是数学、物理科学、工程和经济学中几乎无处不在的昂贵的专用解决方案。 - -5. [What does SVG have to do with teaching kids to code?][20] 退休工程师 Jay Nick 谈论他如何使用艺术作为一种创造性的方式, 向学生介绍编码。他在学校做志愿者, 使用可缩放矢量图形 (SVG,Scalable Vector Graphics) 教授一种结合数学和艺术原理的编码方法。 - -6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, 在 Texas Tech 拥有美术博士学位分享他在单一解决方案统治的世界中使用开源工具的经验。 Kyle 说有一种偏见, 反对在计算机科学以外的学科中使用开源:“很多人认为非技术专业的学生不能使用 Linux, 他们对在高级学位课程中使用 Linux 的人做出了很多假设。...嗯, 这是有可能的, 我就是证明。” - -7. [A list of open source tools for college][22]: Aaron Cocker 概述了他在攻读计算机科学本科学位时使用的开源工具 (包括演示、备份和编程软件)。 - -8. [5 great KDE apps to help you study][23]: Zsolt Szakács 提供五个 KDE 应用程序, 帮助任何想要学习新技能或培养现有技能的人。 +1. [开源棋盘游戏如何拯救地球][16]:Joshua Pearce 写的关于拯救地球的一个棋盘游戏,这是一款让学生在玩乐和为创客社区做出贡献的同时解决环境问题的棋盘游戏。 +2. [一个教孩子们如何阅读的新 Android 应用程序][17]:Michael Hall 谈到了他在儿子被诊断为自闭症后为他开发的儿童识字应用 Phoenicia,以及良好编码的价值,和为什么用户测试比你想象的更重要。 +3. [8 个用于教育的开源 Android 应用程序][18]:Joshua Allen Holm 推荐了 8 个来自 F-Droid 软件库的开源应用,使我们可以将智能手机用作学习工具。 +4. [MATLA B的 3 种开源替代方案][19]:Jason Baker 更新了他 2016 年的开源数学计算软件调查报告,提供了 MATLAB 的替代方案,这是数学、物理科学、工程和经济学中几乎无处不在的昂贵的专用解决方案。 +5. [SVG 与教孩子编码有什么关系?][20]:退休工程师 Jay Nick 谈论他如何使用艺术作为一种创新的方式,向学生介绍编码。他在学校做志愿者,使用 SVG 来教授一种结合数学和艺术原理的编码方法。 +6. [5 个破灭的神话:在高等教育中使用开源][21]: 拥有德克萨斯理工大学美术博士学位的 Kyle Conway 分享他在一个由专有解决方案统治的世界中使用开源工具的经验。 Kyle 说有一种偏见,反对在计算机科学以外的学科中使用开源:“很多人认为非技术专业的学生不能使用 Linux,他们对在高级学位课程中使用 Linux 的人做出了很多假设……嗯,这是有可能的,我就是证明。” +7. [大学开源工具列表][22]:Aaron Cocker 概述了他在攻读计算机科学本科学位时使用的开源工具 (包括演示、备份和编程软件)。 +8. [5 个可帮助您学习优秀 KDE 应用程序][23]:Zsolt Szakács 提供五个 KDE 应用程序,可以帮助任何想要学习新技能或培养现有技能的人。 ### 在教室编码 -1. [How to get the next generation coding early][24]: Bryson Payne 说我们需要教孩子们在高中前编码: 到了九年级, 80% 的女孩和60% 的男孩已经从 STEM 职业中自选。但他建议, 这不仅仅是就业和缩小 IT 技能差距的问题。“教一个年轻人编写代码可能是你能给他们的最改变生活的技能。而且这不仅仅是一个职业提升者。编码是关于解决问题, 它是关于创造力, 更重要的是, 它是关于授权。 +1. [如何尽早让下一代编码][24]:Bryson Payne 说我们需要在高中前教孩子们学会编码: 到了九年级,80% 的女孩和 60% 的男孩已经从 STEM 职业中自选。但他建议,这不仅仅是就业和缩小 IT 技能差距的问题。“教一个年轻人编写代码可能是你能给他们的最改变生活的技能。而且这不仅仅是一个职业提升者。编码是关于解决问题,它是关于创造力,更重要的是,它是提升能力”。 +2. [孩子们无法在没有计算机的情况下编码][25]:Patrick Masson 推出了 FLOSS 儿童桌面计划, 该计划教授服务不足学校的学生使用开源软件 (如 Linux、LibreOffice 和 GIMP) 重新利用较旧的计算机。该计划不仅为破旧或退役的硬件注入新的生命,还为学生提供了重要的技能,而且还为学生提供了可能转化为未来职业生涯的重要技能。 +3. [如今 Scratch 是否能像 80 年代的 LOGO 语言一样教孩子们编码?][26]:Anderson Silva 提出使用 [Scratch][27] 以激发孩子们对编程的兴趣,就像在 20 世纪 80 年代开始使用 LOGO 语言时一样。 +4. [通过这个拖放框架学习Android开发][28]:Eric Eslinger 介绍了 App Inventor,这是一个编程框架,用于构建 Android 应用程序使用可视块语言(类似 Scratch 或者 [Snap][29])。 -2. [Kids can't code without computers][25]: Patrick Masson 推出了 FLOSS 儿童桌面计划, 该计划教授服务不足学校的学生使用开源软件 (如 Linux、LibreOffice 和 GIMP) 重新设计较旧的计算机。该计划不仅为破旧或退役的硬件注入新的生命, 还为学生提供了重要的技能, 这些技能可能会利于转化为未来的职业。 - -3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva 提出 [Scratch][27] 的使用建议以激发孩子们对编程的兴趣, 就像 LOGO 在20世纪80年代开始使用它时一样。 - -4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger 描述应用发明者, 一个编程框架, 用于构建 Android 应用程序使用可视块语言 (类似 Scratch 或者[Snap][29]). - -在这一年里, 我们了解到, 教育领域的一切都有一个开放的解决方案, 我预计这一主题将在2018年及以后继续下去。在未来的一年里, 你是否希望 Opensource.com 涵盖开放式的教育主题?如果是, 请在评论中分享你的想法。 +在这一年里,我们了解到,教育领域的各个方面都有了开放的解决方案,我预计这一主题将在 2018 年及以后继续下去。在未来的一年里,你是否希望 Opensource.com 涵盖开放式的教育主题?如果是, 请在评论中分享你的想法。 -------------------------------------------------------------------------------- @@ -74,7 +54,7 @@ via: https://opensource.com/article/18/1/best-open-education 作者:[Don Watkins][a] 译者:[lixinyuxx](https://github.com/lixinyuxx) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -108,3 +88,4 @@ via: https://opensource.com/article/18/1/best-open-education [27]:https://scratch.mit.edu/ [28]:https://opensource.com/article/17/8/app-inventor-android-app-development [29]:http://snap.berkeley.edu/ +[30]:https://opensource.com/article/17/12/best-opensourcecom-linux-and-raspberry-pi-education From 4c9772b35641aec2b56d20cbbfbd874d98d70649 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 21:18:28 +0800 Subject: [PATCH 1088/1143] PUB:20180101 27 open solutions to everything in education.md @lixinyuxx https://linux.cn/article-10388-1.html --- .../20180101 27 open solutions to everything in education.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180101 27 open solutions to everything in education.md (100%) diff --git a/translated/tech/20180101 27 open solutions to everything in education.md b/published/20180101 27 open solutions to everything in education.md similarity index 100% rename from translated/tech/20180101 27 open solutions to everything in education.md rename to published/20180101 27 open solutions to everything in education.md From 99f483aaae7d60d5d54033ffea8ad0155422dfde Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 26 Dec 2018 22:27:33 +0800 Subject: [PATCH 1089/1143] =?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 --- ..., Groups and Other Linux Beasts- Part 2.md | 111 ------------------ ..., Groups and Other Linux Beasts- Part 2.md | 105 +++++++++++++++++ 2 files changed, 105 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md create mode 100644 translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md diff --git a/sources/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md b/sources/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md deleted file mode 100644 index b6d2552264..0000000000 --- a/sources/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md +++ /dev/null @@ -1,111 +0,0 @@ -Translating by MjSeven -Users, Groups and Other Linux Beasts: Part 2 -====== -![](https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2) -In this ongoing tour of Linux, we’ve looked at [how to manipulate folders/directories][1], and now we’re continuing our discussion of _permissions_ , _users_ and _groups_ , which are necessary to establish who can manipulate which files and directories. [Last time,][2] we showed how to create new users, and now we’re going to dive right back in: - -You can create new groups and then add users to them at will with the `groupadd` command. For example, using: -``` -sudo groupadd photos - -``` - -will create the _photos_ group. - -You’ll need to [create a directory][1] hanging off the root directory: -``` -sudo mkdir /photos - -``` - -If you run `ls -l /`, one of the lines will be: -``` -drwxr-xr-x 1 root root 0 jun 26 21:14 photos - -``` - -The first _root_ in the output is the user owner and the second _root_ is the group owner. - -To transfer the ownership of the _/photos_ directory to the _photos_ group, use -``` -chgrp photos /photos - -``` - -The `chgrp` command typically takes two parameters, the first parameter is the group that will take ownership of the file or directory and the second is the file or directory you want to give over to the the group. - -Next, run `ls -l /` and you'll see the line has changed to: -``` -drwxr-xr-x 1 root photos 0 jun 26 21:14 photos - -``` - -You have successfully transferred the ownership of your new directory over to the _photos_ group. - -Then, add your own user and the _guest_ user to the _photos_ group: -``` -sudo usermod -a -G photos -sudo usermod guest -a -G photos - -``` - -You may have to log out and log back in to see the changes, but, when you do, running `groups` will show _photos_ as one of the groups you belong to. - -A couple of things to point out about the `usermod` command shown above. First: Be careful not to use the `-g` option instead of `-G`. The `-g` option changes your primary group and could lock you out of your stuff if you use it by accident. `-G`, on the other hand, _adds_ you to the groups listed and doesn't mess with the primary group. If you want to add your user to more groups than one, list them one after another, separated by commas, no spaces, after `-G`: -``` -sudo usermod -a -G photos,pizza,spaceforce - -``` - -Second: Be careful not to forget the `-a` parameter. The `-a` parameter stands for _append_ and attaches the list of groups you pass to `-G` to the ones you already belong to. This means that, if you don't include `-a`, the list of groups you already belong to, will be overwritten, again locking you out from stuff you need. - -Neither of these are catastrophic problems, but it will mean you will have to add your user back manually to all the groups you belonged to, which can be a pain, especially if you have lost access to the _sudo_ and _wheel_ group. - -### Permits, Please! - -There is still one more thing to do before you can copy images to the _/photos_ directory. Notice how, when you did `ls -l /` above, permissions for that folder came back as _drwxr-xr-x_. - -If you read [the article I recommended at the beginning of this post][3], you'll know that the first _d_ indicates that the entry in the file system is a directory, and then you have three sets of three characters ( _rwx_ , _r-x_ , _r-x_ ) that indicate the permissions for the user owner ( _rwx_ ) of the directory, then the group owner ( _r-x_ ), and finally the rest of the users ( _r-x_ ). This means that the only person who has write permissions so far, that is, the only person who can copy or create files in the _/photos_ directory, is the _root_ user. - -But [that article I mentioned also tells you how to change the permissions for a directory or file][3]: -``` -sudo chmod g+w /photos - -``` - -Running `ls -l /` after that will give you _/photos_ permissions as _drwxrwxr-x_ which is what you want: group members can now write into the directory. - -Now you can try and copy an image or, indeed, any other file to the directory and it should go through without a problem: -``` -cp image.jpg /photos - -``` - -The _guest_ user will also be able to read and write from the directory. They will also be able to read and write to it, and even move or delete files created by other users within the shared directory. - -### Conclusion - -The permissions and privileges system in Linux has been honed over decades. inherited as it is from the old Unix systems of yore. As such, it works very well and is well thought out. Becoming familiar with it is essential for any Linux sysadmin. In fact, you can't do much admining at all unless you understand it. But, it's not that hard. - -Next time, we'll be dive into files and see the different ways of creating, manipulating, and destroying them in creative ways. Always fun, that last one. - -See you then! - -Learn more about Linux through the free ["Introduction to Linux" ][4]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 - -作者:[Paul Brown][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/bro66 -[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux -[2]:https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts -[3]:https://www.linux.com/learn/understanding-linux-file-permissions -[4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md b/translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md new file mode 100644 index 0000000000..c4f20dbf77 --- /dev/null +++ b/translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md @@ -0,0 +1,105 @@ +用户、组及其他 Linux 特性:第二部分 +====== + +![](https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2) + +在正在进行的 Linux 之旅中,我们了解了[如何操作文件夹或目录][1],现在我们继续讨论 _权限_,_用户_ 和 _组_,这对于确定谁可以操作哪些文件和目录是必要的。[上次][2],我们展示了如何创建新用户,现在我们将重新来一遍: + +你可以使用 `groupadd` 命令创建新组,然后随意添加用户。例如,使用: +``` +sudo groupadd photos +``` + +这将会创建 _photos_ 组。 + +你需要在根目录下[创建一个目录][1]: +``` +sudo mkdir /photos +``` + +如果你运行 `ls -l /`,结果中会有如下这一行: +``` +drwxr-xr-x 1 root root 0 jun 26 21:14 photos +``` + +输出中的第一个 _root_ 是所属的用户,第二个 _root_ 是所属的组。 + +要将 _/photos_ 目录的所有权转移到 _photos_ 组,使用: +``` +chgrp photos /photos +``` + +`chgrp` 命令通常采用两个参数,第一个参数是将要获得文件或目录所有权的组,第二个参数是希望交给组的文件或目录。 + +接着,运行 `ls -l /`,你会发现刚才那一行变了: +``` +drwxr-xr-x 1 root photos 0 jun 26 21:14 photos +``` + +你已成功将新目录的所有权转移到了 _photos_ 组。 + +然后,将你自己的用户和 _guest_ 用户添加到 _photos_ 组: +``` +sudo usermod <你的用户名> -a -G photos +sudo usermod guest -a -G photos +``` + +你可能必须注销并重新登录才能看到更改,但是当你这样做时,运行 `groups` 会将 _photos_ 显示为你所属的组之一。 + +(to 校正:这里的 primary group 翻译成什么更好点呢) +关于上面提到的 `usermod` 命令,需要指明几点。第一:注意要使用 `-G` 选项而不是 `-g` 选项。`-g` 选项更改你的主要组,如果你意外地使用它,它可能会锁定你的一些东西。另一方面,`-G` 将你 _添加(add)_ 到列出的组中,并没有干扰主要组。如果要将用户添加到多个组中,在 `-G` 之后逐个列出他们,用逗号分隔,不要有空格: +``` +sudo usermod -a -G photos,pizza,spaceforce +``` + +第二点:小心点不要忘记 `-a` 参数。`-a` 参数代表 _追加(append)_,将你传递给 `-G` 的组列表附加到你已经属于的组。这意味着,如果你不包含 `-a`,那么你之前所属的组列表将被覆盖,再次将你从你需要的东西中锁定。(to 校正:最后这句话什么意思呢) + +这些都不是灾难性问题,但这意味着你必须手动将用户添加回你所属的所有组,这可能是个麻烦,特别是如果你失去了对 _sudo_ 和 _wheel_ 组的访问权限。 + +### 权限 + +在将图像复制到 _/photos_ 目录之前,还要做一件事情。注意,当你执行上面的 `ls -l /` 时,该文件夹的权限将以 _drwxr-xr-x_ 形式返回。 + +如果你阅读[我在本文开头推荐的文章][3],你将知道第一个 _d_ 表示文件系统中的条目是一个目录,接着你有三组三个字符 (_rwx_, _r-x_, _r-x_),它们表示目录的所属用户 (_rwx_) 的权限,然后是所属组 (_r-x_)的权限,最后是其他用户 (_r-x_) 的权限。这意味着到目前为止唯一具有写权限的人,即能够在 _/photos_ 目录中复制或创建文件的唯一人员是 _root_ 用户。 + +但是[我提到的那篇文章也告诉你如何更改目录或文件的权限][3]: +``` +sudo chmod g+w /photos +``` + +运行 `ls -l /`,你会看到 _/photos_ 权限变为了 _drwxrwxr-x_。这就是你希望的:组成员现在可以对目录进行写操作了。 + +现在你可以尝试将图像或任何其他文件复制到目录中,它应该没有问题: +``` +cp image.jpg /photos +``` + +_guest_ 用户也可以从目录中读取和写入。他们也可以读取和写入,甚至移动或删除共享目录中其他用户创建的文件。(to 校正:这里 guest 可以从目录中读取和写入吗?guest 不应该是 r-x 权限吗?) + +### 总结 + +Linux 中的权限和特权系统已经磨练了几十年,它继承自昔日的旧 Unix 系统。就其本身而言,它工作的非常好,而且经过了深思熟虑。熟悉它对于任何 Linux 系统管理员都是必不可少的。事实上,除非你理解它,否则你根本就无法做很多事情。但是,这并不难。 + +下一次,我们将深入研究文件,并以一个创新的方式查看创建,操作和销毁文件的不同方法。最后一个总是很有趣。 + +回头见! + +通过 Linux 基金会和 edX 的免费[" Linux 简介"][4]课程了解有关 Linux 的更多信息。 + + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2 + +作者:[Paul Brown][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/bro66 +[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux +[2]:https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts +[3]:https://www.linux.com/learn/understanding-linux-file-permissions +[4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 2392354a6b5fba66ff7bdcbe0a60cb8d5006e069 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 26 Dec 2018 22:49:34 +0800 Subject: [PATCH 1090/1143] PRF: 20181016 Lab 5- File system, Spawn and Shell.md @qhwdw --- ...016 Lab 5- File system, Spawn and Shell.md | 198 ++++++++---------- 1 file changed, 89 insertions(+), 109 deletions(-) diff --git a/translated/tech/20181016 Lab 5- File system, Spawn and Shell.md b/translated/tech/20181016 Lab 5- File system, Spawn and Shell.md index 769b90bd20..dbd9a3b490 100644 --- a/translated/tech/20181016 Lab 5- File system, Spawn and Shell.md +++ b/translated/tech/20181016 Lab 5- File system, Spawn and Shell.md @@ -1,4 +1,4 @@ -实验 5:文件系统、Spawn 和 Shell +Caffeinated 6.828:实验 5:文件系统、Spawn 和 Shell ====== ### 简介 @@ -10,31 +10,31 @@ 使用 Git 去获取最新版的课程仓库,然后创建一个命名为 `lab5` 的本地分支,去跟踪远程的 `origin/lab5` 分支: ``` - athena% cd ~/6.828/lab - athena% add git - athena% git pull - Already up-to-date. - athena% git checkout -b lab5 origin/lab5 - Branch lab5 set up to track remote branch refs/remotes/origin/lab5. - Switched to a new branch "lab5" - athena% git merge lab4 - Merge made by recursive. - ..... - athena% +athena% cd ~/6.828/lab +athena% add git +athena% git pull +Already up-to-date. +athena% git checkout -b lab5 origin/lab5 +Branch lab5 set up to track remote branch refs/remotes/origin/lab5. +Switched to a new branch "lab5" +athena% git merge lab4 +Merge made by recursive. +..... +athena% ``` 在实验中这一部分的主要新组件是文件系统环境,它位于新的 `fs` 目录下。通过检查这个目录中的所有文件,我们来看一下新的文件都有什么。另外,在 `user` 和 `lib` 目录下还有一些文件系统相关的源文件。 -fs/fs.c 维护文件系统在磁盘上结构的代码 -fs/bc.c 构建在我们的用户级页故障处理功能之上的一个简单的块缓存 -fs/ide.c 极简的基于 PIO(非中断驱动的)IDE 驱动程序代码 -fs/serv.c 使用文件系统 IPC 与客户端环境交互的文件系统服务器 -lib/fd.c 实现一个常见的类 UNIX 的文件描述符接口的代码 -lib/file.c 磁盘上文件类型的驱动,实现为一个文件系统 IPC 客户端 -lib/console.c 控制台输入/输出文件类型的驱动 -lib/spawn.c spawn 库调用的框架代码 +- `fs/fs.c` 维护文件系统在磁盘上结构的代码 +- `fs/bc.c` 构建在我们的用户级页故障处理功能之上的一个简单的块缓存 +- `fs/ide.c` 极简的基于 PIO(非中断驱动的)IDE 驱动程序代码 +- `fs/serv.c` 使用文件系统 IPC 与客户端环境交互的文件系统服务器 +- `lib/fd.c` 实现一个常见的类 UNIX 的文件描述符接口的代码 +- `lib/file.c` 磁盘上文件类型的驱动,实现为一个文件系统 IPC 客户端 +- `lib/console.c` 控制台输入/输出文件类型的驱动 +- `lib/spawn.c` spawn 库调用的框架代码 -你应该再次去运行 `pingpong`、`primes`、和 `forktree`,测试实验 4 完成后合并到新的实验 5 中的代码能否正确运行。你还需要在 `kern/init.c` 中注释掉 `ENV_CREATE(fs_fs)` 行,因为 `fs/fs.c` 将尝试去做一些 I/O,而 JOS 到目前为止还不具备该功能。同样,在 `lib/exit.c` 中临时注释掉对 `close_all()` 的调用;这个函数将调用你在本实验后面部分去实现的子程序,如果现在去调用,它将导致 JOS 内核崩溃。如果你的实验 4 的代码没有任何 bug,将很完美地通过这个测试。在它们都能正常工作之前是不能继续后续实验的。在你开始做练习 1 时,不要忘记去取消这些行上的注释。 +你应该再次去运行 `pingpong`、`primes` 和 `forktree`,测试实验 4 完成后合并到新的实验 5 中的代码能否正确运行。你还需要在 `kern/init.c` 中注释掉 `ENV_CREATE(fs_fs)` 行,因为 `fs/fs.c` 将尝试去做一些 I/O,而 JOS 到目前为止还不具备该功能。同样,在 `lib/exit.c` 中临时注释掉对 `close_all()` 的调用;这个函数将调用你在本实验后面部分去实现的子程序,如果现在去调用,它将导致 JOS 内核崩溃。如果你的实验 4 的代码没有任何 bug,将很完美地通过这个测试。在它们都能正常工作之前是不能继续后续实验的。在你开始做练习 1 时,不要忘记去取消这些行上的注释。 如果它们不能正常工作,使用 `git diff lab4` 去重新评估所有的变更,确保你在实验 4(及以前)所写的代码在本实验中没有丢失。确保实验 4 仍然能正常工作。 @@ -44,11 +44,11 @@ lib/spawn.c spawn 库调用的框架代码 ### 文件系统的雏形 -你将要使用的文件系统比起大多数“真正的”文件系统(包括 xv6 UNIX 的文件系统)要简单的多,但它也是很强大的,足够去提供基本的特性:创建、读取、写入、和删除组织在层次目录结构中的文件。 +你将要使用的文件系统比起大多数“真正的”文件系统(包括 xv6 UNIX 的文件系统)要简单的多,但它也是很强大的,足够去提供基本的特性:创建、读取、写入和删除组织在层次目录结构中的文件。 到目前为止,我们开发的是一个单用户操作系统,它提供足够的保护并能去捕获 bug,但它还不能在多个不可信用户之间提供保护。因此,我们的文件系统还不支持 UNIX 的所有者或权限的概念。我们的文件系统目前也不支持硬链接、时间戳、或像大多数 UNIX 文件系统实现的那些特殊的设备文件。 -### 磁盘上文件系统结构 +### 磁盘上的文件系统结构 主流的 UNIX 文件系统将可用磁盘空间分为两种主要的区域类型:节点区域和数据区域。UNIX 文件系统在文件系统中为每个文件分配一个节点;一个文件的节点保存了这个文件重要的元数据,比如它的 `stat` 属性和指向数据块的指针。数据区域被分为更大的(一般是 8 KB 或更大)数据块,它在文件系统中存储文件数据和目录元数据。目录条目包含文件名字和指向到节点的指针;如果文件系统中的多个目录条目指向到那个文件的节点上,则称该文件是硬链接的。由于我们的文件系统不支持硬链接,所以我们不需要这种间接的级别,并且因此可以更方便简化:我们的文件系统将压根就不使用节点,而是简单地将文件的(或子目录的)所有元数据保存在描述那个文件的(唯一的)目录条目中。 @@ -71,6 +71,7 @@ UNIX xv6 文件系统使用 512 字节大小的块,与它底层磁盘的扇区 #### 文件元数据 ![File structure][2] + 元数据的布局是描述在我们的文件系统中的一个文件中,这个文件就是 `inc/fs.h` 中的 `struct File`。元数据包含文件的名字、大小、类型(普通文件还是目录)、指向构成这个文件的块的指针。正如前面所提到的,我们的文件系统中并没有节点,因此元数据是保存在磁盘上的一个目录条目中,而不是像大多数“真正的”文件系统那样保存在节点中。为简单起见,我们将使用 `File` 这一个结构去表示文件元数据,因为它要同时出现在磁盘上和内存中。 在 `struct File` 中的数组 `f_direct` 包含一个保存文件的前 10 个块(`NDIRECT`)的块编号的空间,我们称之为文件的直接块。对于最大 `10*4096 = 40KB` 的小文件,这意味着这个文件的所有块的块编号将全部直接保存在结构 `File` 中,但是,对于超过 40 KB 大小的文件,我们需要一个地方去保存文件剩余的块编号。所以我们分配一个额外的磁盘块,我们称之为文件的间接块,由它去保存最多 4096/4 = 1024 个额外的块编号。因此,我们的文件系统最多允许有 1034 个块,或者说不能超过 4MB 大小。为支持大文件,“真正的”文件系统一般都支持两个或三个间接块。 @@ -91,33 +92,28 @@ UNIX xv6 文件系统使用 512 字节大小的块,与它底层磁盘的扇区 只要我们依赖轮询、基于 “编程的 I/O”(PIO)的磁盘访问,并且不使用磁盘中断,那么在用户空间中实现磁盘访问还是很容易的。也可以去实现由中断驱动的设备驱动程序(比如像 L3 和 L4 内核就是这么做的),但这样做的话,内核必须接收设备中断并将它派发到相应的用户模式环境上,这样实现的难度会更大。 -x86 处理器在 EFLAGS 寄存器中使用 IOPL 位去确定保护模式中的代码是否允许执行特定的设备 I/O 指令,比如 `IN` 和 `OUT` 指令。由于我们需要的所有 IDE 磁盘寄存器都位于 x86 的 I/O 空间中而不是映射在内存中,所以,为了允许文件系统去访问这些寄存器,我们需要做的唯一的事情便是授予文件系统环境“I/O 权限”。实际上,在 EFLAGS 寄存器的 IOPL 位上规定,内核使用一个简单的“要么全都能访问、要么全都不能访问”的方法来控制用户模式中的代码能否访问 I/O 空间。在我们的案例中,我们希望文件系统环境能够去访问 I/O 空间,但我们又希望任何其它的环境完全不能访问 I/O 空间。 +x86 处理器在 EFLAGS 寄存器中使用 IOPL 位去确定保护模式中的代码是否允许执行特定的设备 I/O 指令,比如 `IN` 和 `OUT` 指令。由于我们需要的所有 IDE 磁盘寄存器都位于 x86 的 I/O 空间中而不是映射在内存中,所以,为了允许文件系统去访问这些寄存器,我们需要做的唯一的事情便是授予文件系统环境“I/O 权限”。实际上,在 EFLAGS 寄存器的 IOPL 位上规定,内核使用一个简单的“要么全都能访问、要么全都不能访问”的方法来控制用户模式中的代码能否访问 I/O 空间。在我们的案例中,我们希望文件系统环境能够去访问 I/O 空间,但我们又希望任何其它的环境完全不能访问 I/O 空间。 -```markdown -练习 1、`i386_init` 通过将类型 `ENV_TYPE_FS` 传递给你的环境创建函数 `env_create` 来识别文件系统。修改 `env.c` 中的 `env_create` ,以便于它只授予文件系统环境 I/O 的权限,而不授予任何其它环境 I/O 的权限。 +> **练习 1**、`i386_init` 通过将类型 `ENV_TYPE_FS` 传递给你的环境创建函数 `env_create` 来识别文件系统。修改 `env.c` 中的 `env_create` ,以便于它只授予文件系统环境 I/O 的权限,而不授予任何其它环境 I/O 的权限。 -确保你能启动这个文件系统环境,而不会产生一般保护故障。你应该要通过在 `make grade` 中的 "fs i/o" 测试。 -``` +> 确保你能启动这个文件系统环境,而不会产生一般保护故障。你应该要通过在 `make grade` 中的 "fs i/o" 测试。 -```markdown -问题 - - 1、当你从一个环境切换到另一个环境时,你是否需要做一些操作来确保 I/O 权限设置能被保存和正确地恢复?为什么? -``` +. +> **问题 1**、当你从一个环境切换到另一个环境时,你是否需要做一些操作来确保 I/O 权限设置能被保存和正确地恢复?为什么? 注意本实验中的 `GNUmakefile` 文件,它用于设置 QEMU 去使用文件 `obj/kern/kernel.img` 作为磁盘 0 的镜像(一般情况下表示 DOS 或 Windows 中的 “C 盘”),以及使用(新)文件 `obj/fs/fs.img` 作为磁盘 1 的镜像(”D 盘“)。在本实验中,我们的文件系统应该仅与磁盘 1 有交互;而磁盘 0 仅用于去引导内核。如果你想去恢复其中一个有某些错误的磁盘镜像,你可以通过输入如下的命令,去重置它们到最初的、”崭新的“版本: ``` - $ rm obj/kern/kernel.img obj/fs/fs.img - $ make +$ rm obj/kern/kernel.img obj/fs/fs.img +$ make ``` 或者: ``` - $ make clean - $ make +$ make clean +$ make ``` 小挑战!实现中断驱动的 IDE 磁盘访问,既可以使用也可以不使用 DMA 模式。由你来决定是否将设备驱动移植进内核中、还是与文件系统一样保留在用户空间中、甚至是将它移植到一个它自己的的单独的环境中(如果你真的想了解微内核的本质的话)。 @@ -132,45 +128,39 @@ x86 处理器在 EFLAGS 寄存器中使用 IOPL 位去确定保护模式中的 当然,将整个磁盘读入到内存中需要很长时间,因此,我们将它实现成”按需“分页的形式,那样我们只在磁盘映射区域中分配页,并且当在这个区域中产生页故障时,从磁盘读取相关的块去响应这个页故障。通过这种方式,我们能够假装将整个磁盘装进了内存中。 -```markdown -练习 2、在 `fs/bc.c` 中实现 `bc_pgfault` 和 `flush_block` 函数。`bc_pgfault` 函数是一个页故障服务程序,就像你在前一个实验中编写的写时复制 fork 一样,只不过它的任务是从磁盘中加载页去响应一个页故障。在你编写它时,记住: (1) `addr` 可能并不会做边界对齐,并且 (2) 在扇区中的 `ide_read` 操作并不是以块为单位的。 +> **练习 2**、在 `fs/bc.c` 中实现 `bc_pgfault` 和 `flush_block` 函数。`bc_pgfault` 函数是一个页故障服务程序,就像你在前一个实验中编写的写时复制 fork 一样,只不过它的任务是从磁盘中加载页去响应一个页故障。在你编写它时,记住: (1) `addr` 可能并不会做边界对齐,并且 (2) 在扇区中的 `ide_read` 操作并不是以块为单位的。 -(如果需要的话)函数 `flush_block` 应该会将一个块写入到磁盘上。如果在块缓存中没有块(也就是说,页没有映射)或者它不是一个脏块,那么 `flush_block` 将什么都不做。我们将使用虚拟内存硬件去跟踪,磁盘块自最后一次从磁盘读取或写入到磁盘之后是否被修改过。查看一个块是否需要写入时,我们只需要去查看 `uvpt` 条目中的 `PTE_D` 的 ”dirty“ 位即可。(`PTE_D` 位由处理器设置,用于表示那个页被写入;具体细节可以查看 x386 参考手册的 [第 5 章][3] 的 5.2.4.3 节)块被写入到磁盘上之后,`flush_block` 函数将使用 `sys_page_map` 去清除 `PTE_D` 位。 +>(如果需要的话)函数 `flush_block` 应该会将一个块写入到磁盘上。如果在块缓存中没有块(也就是说,页没有映射)或者它不是一个脏块,那么 `flush_block` 将什么都不做。我们将使用虚拟内存硬件去跟踪,磁盘块自最后一次从磁盘读取或写入到磁盘之后是否被修改过。查看一个块是否需要写入时,我们只需要去查看 `uvpt` 条目中的 `PTE_D` 的 ”dirty“ 位即可。(`PTE_D` 位由处理器设置,用于表示那个页被写入;具体细节可以查看 x386 参考手册的 [第 5 章][3] 的 5.2.4.3 节)块被写入到磁盘上之后,`flush_block` 函数将使用 `sys_page_map` 去清除 `PTE_D` 位。 -使用 `make grade` 去测试你的代码。你的代码应该能够通过 "check_bc"、"check_super"、和 "check_bitmap" 的测试。 -``` +> 使用 `make grade` 去测试你的代码。你的代码应该能够通过 "check_bc"、"check_super"、和 "check_bitmap" 的测试。 在 `fs/fs.c` 中的函数 `fs_init` 是块缓存使用的一个很好的示例。在初始化块缓存之后,它简单地在全局变量 `super` 中保存指针到磁盘映射区。在这之后,如果块在内存中,或我们的页故障服务程序按需将它们从磁盘上读入后,我们就能够简单地从 `super` 结构中读取块了。 -```markdown -小挑战!到现在为止,块缓存还没有清除策略。一旦某个块因为页故障被读入到缓存中之后,它将一直不会被清除,并且永远保留在内存中。给块缓存增加一个清除策略。在页表中使用 `PTE_A` 的 "accessed" 位来实现,任何环境访问一个页时,硬件就会设置这个位,你可以通过它来跟踪磁盘块的大致使用情况,而不需要修改访问磁盘映射区域的任何代码。使用脏块要小心。 -``` +. + +> **小挑战!**到现在为止,块缓存还没有清除策略。一旦某个块因为页故障被读入到缓存中之后,它将一直不会被清除,并且永远保留在内存中。给块缓存增加一个清除策略。在页表中使用 `PTE_A` 的 "accessed" 位来实现,任何环境访问一个页时,硬件就会设置这个位,你可以通过它来跟踪磁盘块的大致使用情况,而不需要修改访问磁盘映射区域的任何代码。使用脏块要小心。 ### 块位图 在 `fs_init` 设置了 `bitmap` 指针之后,我们可以认为 `bitmap` 是一个装满比特位的数组,磁盘上的每个块就是数组中的其中一个比特位。比如 `block_is_free`,它只是简单地在位图中检查给定的块是否被标记为空闲。 -```markdown -练习 3、使用 `free_block` 作为实现 `fs/fs.c` 中的 `alloc_block` 的一个模型,它将在位图中去查找一个空闲的磁盘块,并将它标记为已使用,然后返回块编号。当你分配一个块时,你应该立即使用 `flush_block` 将已改变的位图块刷新到磁盘上,以确保文件系统的一致性。 +> **练习 3**、使用 `free_block` 作为实现 `fs/fs.c` 中的 `alloc_block` 的一个模型,它将在位图中去查找一个空闲的磁盘块,并将它标记为已使用,然后返回块编号。当你分配一个块时,你应该立即使用 `flush_block` 将已改变的位图块刷新到磁盘上,以确保文件系统的一致性。 -使用 `make grade` 去测试你的代码。现在,你的代码应该要通过 "alloc_block" 的测试。 -``` +> 使用 `make grade` 去测试你的代码。现在,你的代码应该要通过 "alloc_block" 的测试。 ### 文件操作 在 `fs/fs.c` 中,我们提供一系列的函数去实现基本的功能,比如,你将需要去理解和管理结构 `File`、扫描和管理目录”文件“的条目、 以及从根目录开始遍历文件系统以解析一个绝对路径名。阅读 `fs/fs.c` 中的所有代码,并在你开始实验之前,确保你理解了每个函数的功能。 -```markdown -练习 4、实现 `file_block_walk` 和 `file_get_block`。`file_block_walk` 从一个文件中的块偏移量映射到 `struct File` 中那个块的指针上或间接块上,它非常类似于 `pgdir_walk` 在页表上所做的事。`file_get_block` 将更进一步,将去映射一个真实的磁盘块,如果需要的话,去分配一个新的磁盘块。 +> **练习 4**、实现 `file_block_walk` 和 `file_get_block`。`file_block_walk` 从一个文件中的块偏移量映射到 `struct File` 中那个块的指针上或间接块上,它非常类似于 `pgdir_walk` 在页表上所做的事。`file_get_block` 将更进一步,将去映射一个真实的磁盘块,如果需要的话,去分配一个新的磁盘块。 -使用 `make grade` 去测试你的代码。你的代码应该要通过 "file_open"、"file_get_block"、以及 "file_flush/file_truncated/file rewrite"、和 "testfile" 的测试。 -``` +> 使用 `make grade` 去测试你的代码。你的代码应该要通过 "file_open"、"file_get_block"、以及 "file_flush/file_truncated/file rewrite"、和 "testfile" 的测试。 `file_block_walk` 和 `file_get_block` 是文件系统中的”劳动模范“。比如,`file_read` 和 `file_write` 或多或少都在 `file_get_block` 上做必需的登记工作,然后在分散的块和连续的缓存之间复制字节。 -``` -小挑战!如果操作在中途实然被打断(比如,突然崩溃或重启),文件系统很可能会产生错误。实现软件更新或日志处理的方式让文件系统的”崩溃可靠性“更好,并且演示一下旧的文件系统可能会崩溃,而你的更新后的文件系统不会崩溃的情况。 -``` +. + +> **小挑战!**如果操作在中途实然被打断(比如,突然崩溃或重启),文件系统很可能会产生错误。实现软件更新或日志处理的方式让文件系统的”崩溃可靠性“更好,并且演示一下旧的文件系统可能会崩溃,而你的更新后的文件系统不会崩溃的情况。 ### 文件系统接口 @@ -207,19 +197,17 @@ x86 处理器在 EFLAGS 寄存器中使用 IOPL 位去确定保护模式中的 服务器也通过 IPC 来发送响应。我们为函数的返回代码使用 32 位的数字。对于大多数 RPC,这已经涵盖了它们全部的返回代码。`FSREQ_READ` 和 `FSREQ_STAT` 也返回数据,它们只是被简单地写入到客户端发送它的请求时的页上。在 IPC 的响应中并不需要去发送这个页,因为这个页是文件系统服务器和客户端从一开始就共享的页。另外,在它的响应中,`FSREQ_OPEN` 与客户端共享一个新的 "Fd page”。我们将快捷地返回到文件描述符页上。 -```markdown -练习 5、实现 `fs/serv.c` 中的 `serve_read`。 +> **练习 5**、实现 `fs/serv.c` 中的 `serve_read`。 -`serve_read` 的重任将由已经在 `fs/fs.c` 中实现的 `file_read` 来承担(它实际上不过是对 `file_get_block` 的一连串调用)。对于文件读取,`serve_read` 只能提供 RPC 接口。查看 `serve_set_size` 中的注释和代码,去大体上了解服务器函数的结构。 +> `serve_read` 的重任将由已经在 `fs/fs.c` 中实现的 `file_read` 来承担(它实际上不过是对 `file_get_block` 的一连串调用)。对于文件读取,`serve_read` 只能提供 RPC 接口。查看 `serve_set_size` 中的注释和代码,去大体上了解服务器函数的结构。 -使用 `make grade` 去测试你的代码。你的代码通过 "serve_open/file_stat/file_close" 和 "file_read" 的测试后,你得分应该是 70(总分为 150)。 -``` +> 使用 `make grade` 去测试你的代码。你的代码通过 "serve_open/file_stat/file_close" 和 "file_read" 的测试后,你得分应该是 70(总分为 150)。 -```markdown -练习 6、实现 `fs/serv.c` 中的 `serve_write` 和 `lib/file.c` 中的 `devfile_write`。 +. -使用 `make grade` 去测试你的代码。你的代码通过 "file_write"、"file_read after file_write"、"open"、和 "large file" 的测试后,得分应该是 90(总分为150)。 -``` +> **练习 6**、实现 `fs/serv.c` 中的 `serve_write` 和 `lib/file.c` 中的 `devfile_write`。 + +> 使用 `make grade` 去测试你的代码。你的代码通过 "file_write"、"file_read after file_write"、"open"、和 "large file" 的测试后,得分应该是 90(总分为150)。 ### 进程增殖 @@ -227,21 +215,19 @@ x86 处理器在 EFLAGS 寄存器中使用 IOPL 位去确定保护模式中的 我们实现的是 `spawn`,而不是一个类 UNIX 的 `exec`,因为 `spawn` 是很容易从用户空间中、以”外内核式“ 实现的,它无需来自内核的特别帮助。为了在用户空间中实现 `exec`,想一想你应该做什么?确保你理解了它为什么很难。 -```markdown -练习 7、`spawn` 依赖新的系统调用 `sys_env_set_trapframe` 去初始化新创建的环境的状态。实现 `kern/syscall.c` 中的 `sys_env_set_trapframe`。(不要忘记在 `syscall()` 中派发新系统调用) +> **练习 7**、`spawn` 依赖新的系统调用 `sys_env_set_trapframe` 去初始化新创建的环境的状态。实现 `kern/syscall.c` 中的 `sys_env_set_trapframe`。(不要忘记在 `syscall()` 中派发新系统调用) -运行来自 `kern/init.c` 中的 `user/spawnhello` 程序来测试你的代码`kern/init.c` ,它将尝试从文件系统中增殖 `/hello`。 +> 运行来自 `kern/init.c` 中的 `user/spawnhello` 程序来测试你的代码`kern/init.c` ,它将尝试从文件系统中增殖 `/hello`。 -使用 `make grade` 去测试你的代码。 -``` +> 使用 `make grade` 去测试你的代码。 -```markdown -小挑战!实现 Unix 式的 `exec`。 -``` +. -```markdown -小挑战!实现 `mmap` 式的文件内存映射,并如果可能的话,修改 `spawn` 从 ELF 中直接映射页。 -``` +> **小挑战!**实现 Unix 式的 `exec`。 + +. + +> **小挑战!**实现 `mmap` 式的文件内存映射,并如果可能的话,修改 `spawn` 从 ELF 中直接映射页。 ### 跨 fork 和 spawn 共享库状态 @@ -255,11 +241,9 @@ UNIX 文件描述符是一个通称的概念,它还包括管道、控制台 I/ 我们在 `inc/lib.h` 中定义了一个新的 `PTE_SHARE` 位,在 Intel 和 AMD 的手册中,这个位是被标记为”软件可使用的“的三个 PTE 位之一。我们将创建一个约定,如果一个页表条目中这个位被设置,那么在 `fork` 和 `spawn` 中应该直接从父环境中复制 PTE 到子环境中。注意它与标记为写时复制的差别:正如在第一段中所描述的,我们希望确保能共享页更新。 -```markdown -练习 8、修改 `lib/fork.c` 中的 `duppage`,以遵循最新约定。如果页表条目设置了 `PTE_SHARE` 位,仅直接复制映射。(你应该去使用 `PTE_SYSCALL`,而不是 `0xfff`,去从页表条目中掩掉有关的位。`0xfff` 仅选出可访问的位和脏位。) +> **练习 8**、修改 `lib/fork.c` 中的 `duppage`,以遵循最新约定。如果页表条目设置了 `PTE_SHARE` 位,仅直接复制映射。(你应该去使用 `PTE_SYSCALL`,而不是 `0xfff`,去从页表条目中掩掉有关的位。`0xfff` 仅选出可访问的位和脏位。) -同样的,在 `lib/spawn.c` 中实现 `copy_shared_pages`。它应该循环遍历当前进程中所有的页表条目(就像 `fork` 那样),复制任何设置了 `PTE_SHARE` 位的页映射到子进程中。 -``` +> 同样的,在 `lib/spawn.c` 中实现 `copy_shared_pages`。它应该循环遍历当前进程中所有的页表条目(就像 `fork` 那样),复制任何设置了 `PTE_SHARE` 位的页映射到子进程中。 使用 `make run-testpteshare` 去检查你的代码行为是否正确。正确的情况下,你应该会看到像 "`fork handles PTE_SHARE right`" 和 "`spawn handles PTE_SHARE right`” 这样的输出行。 @@ -269,9 +253,7 @@ UNIX 文件描述符是一个通称的概念,它还包括管道、控制台 I/ 为了能让 shell 工作,我们需要一些方式去输入。QEMU 可以显示输出,我们将它的输出写入到 CGA 显示器上和串行端口上,但到目前为止,我们仅能够在内核监视器中接收输入。在 QEMU 中,我们从图形化窗口中的输入作为从键盘到 JOS 的输入,虽然键入到控制台的输入作为出现在串行端口上的字符的方式显现。在 `kern/console.c` 中已经包含了由我们自实验 1 以来的内核监视器所使用的键盘和串行端口的驱动程序,但现在你需要去把这些增加到系统中。 -```markdown -练习 9、在你的 `kern/trap.c` 中,调用 `kbd_intr` 去处理捕获 `IRQ_OFFSET+IRQ_KBD` 和 `serial_intr`,用它们去处理捕获 `IRQ_OFFSET+IRQ_SERIAL`。 -``` +> **练习 9**、在你的 `kern/trap.c` 中,调用 `kbd_intr` 去处理捕获 `IRQ_OFFSET+IRQ_KBD` 和 `serial_intr`,用它们去处理捕获 `IRQ_OFFSET+IRQ_SERIAL`。 在 `lib/console.c` 中,我们为你实现了文件的控制台输入/输出。`kbd_intr` 和 `serial_intr` 将使用从最新读取到的输入来填充缓冲区,而控制台文件类型去排空缓冲区(默认情况下,控制台文件类型为 stdin/stdout,除非用户重定向它们)。 @@ -282,40 +264,38 @@ UNIX 文件描述符是一个通称的概念,它还包括管道、控制台 I/ 运行 `make run-icode` 或 `make run-icode-nox` 将运行你的内核并启动 `user/icode`。`icode` 又运行 `init`,它将设置控制台作为文件描述符 0 和 1(即:标准输入 stdin 和标准输出 stdout),然后增殖出环境 `sh`,就是 shell。之后你应该能够运行如下的命令了: ``` - echo hello world | cat - cat lorem |cat - cat lorem |num - cat lorem |num |num |num |num |num - lsfd +echo hello world | cat +cat lorem |cat +cat lorem |num +cat lorem |num |num |num |num |num +lsfd ``` 注意用户库常规程序 `cprintf` 将直接输出到控制台,而不会使用文件描述符代码。这对调试非常有用,但是对管道连接其它程序却很不利。为将输出打印到特定的文件描述符(比如 1,它是标准输出 stdout),需要使用 `fprintf(1, "...", ...)`。`printf("...", ...)` 是将输出打印到文件描述符 1(标准输出 stdout) 的快捷方式。查看 `user/lsfd.c` 了解更多示例。 -```markdown -练习 10、 -这个 shell 不支持 I/O 重定向。如果能够运行 `run sh **练习 10**、这个 shell 不支持 I/O 重定向。如果能够运行 `run sh 通过在你的 shell 中输入 `sh 运行 `make run-testshell` 去测试你的 shell。`testshell` 只是简单地给 shell ”喂“上面的命令(也可以在 `fs/testshell.sh` 中找到),然后检查它的输出是否与 `fs/testshell.key` 一样。 -```markdown -小挑战!给你的 shell 添加更多的特性。最好包括以下的特性(其中一些可能会要求修改文件系统): +. - * 后台命令 (`ls &`) - * 一行中运行多个命令 (`ls; echo hi`) - * 命令组 (`(ls; echo hi) | cat > out`) - * 扩展环境变量 (`echo $hello`) - * 引号 (`echo "a | b"`) - * 命令行历史和/或编辑功能 - * tab 命令补全 - * 为命令行查找目录、cd 和路径 - * 文件创建 - * 用快捷键 `ctl-c` 去杀死一个运行中的环境 -可做的事情还有很多,并不仅限于以上列表。 -``` +> **小挑战!**给你的 shell 添加更多的特性。最好包括以下的特性(其中一些可能会要求修改文件系统): + +> * 后台命令 (`ls &`) +> * 一行中运行多个命令 (`ls; echo hi`) +> * 命令组 (`(ls; echo hi) | cat > out`) +> * 扩展环境变量 (`echo $hello`) +> * 引号 (`echo "a | b"`) +> * 命令行历史和/或编辑功能 +> * tab 命令补全 +> * 为命令行查找目录、cd 和路径 +> * 文件创建 +> * 用快捷键 `ctl-c` 去杀死一个运行中的环境 + +> 可做的事情还有很多,并不仅限于以上列表。 到目前为止,你的代码应该要通过所有的测试。和以前一样,你可以使用 `make grade` 去评级你的提交,并且使用 `make handin` 上交你的实验。 @@ -328,7 +308,7 @@ via: https://pdos.csail.mit.edu/6.828/2018/labs/lab5/ 作者:[csail.mit][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 63768a764cd0d5eb024dc1ee19b7afca8d04c1ea Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 27 Dec 2018 08:26:19 +0800 Subject: [PATCH 1091/1143] Translating --- ...1206 Take a break at the Linux command line with Nyan Cat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md b/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md index 7f642b5496..05dd160dc8 100644 --- a/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md +++ b/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zhs852) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (Take a break at the Linux command line with Nyan Cat) From ffe8fa5825d196cc6343c8e1520d10972df81031 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Dec 2018 08:50:32 +0800 Subject: [PATCH 1092/1143] translated --- .../20181214 How To Install Rust Programming Language In Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20181214 How To Install Rust Programming Language In Linux.md (100%) diff --git a/sources/tech/20181214 How To Install Rust Programming Language In Linux.md b/translated/tech/20181214 How To Install Rust Programming Language In Linux.md similarity index 100% rename from sources/tech/20181214 How To Install Rust Programming Language In Linux.md rename to translated/tech/20181214 How To Install Rust Programming Language In Linux.md From 9271abd1645d98012a323fdf1841d7920739c3be Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Dec 2018 08:53:41 +0800 Subject: [PATCH 1093/1143] translated --- ...tall Rust Programming Language In Linux.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/translated/tech/20181214 How To Install Rust Programming Language In Linux.md b/translated/tech/20181214 How To Install Rust Programming Language In Linux.md index c39e037d6d..a2fc9f1382 100644 --- a/translated/tech/20181214 How To Install Rust Programming Language In Linux.md +++ b/translated/tech/20181214 How To Install Rust Programming Language In Linux.md @@ -7,22 +7,22 @@ [#]: via: (https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/) [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) -How To Install Rust Programming Language In Linux +如何在 Linux 中安装 Rust 编程语言 ====== -Rust is often called rust-lang. +Rust 通常被称为 rust-lang。 -Rust is a general-purpose, multi-paradigm, modern, cross-platform, and open source systems programming language sponsored by Mozilla Research. +Rust 是一个由 Mozilla Research 赞助的通用、多范式、现代、跨平台和开源系统编程语言。 -It was designed to be achieve a goals such as safety, speed, and concurrency. +它旨在实现安全性、速度和并发性等目标。 -Rust is syntactically similar to C++,[14] but its designers intend it to provide better memory safety while still maintaining performance. +Rust 在语法上与 C++ 相似,但它的设计者希望它在保持性能的同时提供更好的内存安全性。 -Rust is currently used in many organization such as Firefox, Chef, Dropbox, Oracle, GNOME, etc,. +Rust 目前在许多组织中使用,例如 Firefox、Chef、Dropbox、Oracle、GNOME 等。 -### How to Install Runs Language in Linux? +### 如何在 Linux 中安装 Rust 语言? -There are many ways we can install Rust but below is the officially recommended way to install it. +我们可以通过多种方式安装 Rust,但以下是官方推荐的安装方式。 ``` $ curl https://sh.rustup.rs -sSf | sh @@ -85,22 +85,22 @@ environment variable. Next time you log in this will be done automatically. To configure your current shell run source $HOME/.cargo/env ``` -Run the following command to configure your current shell. +运行以下命令配置当前 shell。 ``` $ source $HOME/.cargo/env ``` -Run the following command to verify the installed Rust version. +运行以下命令验证已安装的 Rust 版本。 ``` $ rustc --version rustc 1.31.0 (abe02cefd 2018-12-04) ``` -### How To Test Rust programming language? +### 如何测试 Rust 编程语言? -Once you installed Rust follow the below steps to check whether Rust programe language is working fine or not. +安装 Rust 后,请按照以下步骤检查 Rust 语言是否正常工作。 ``` $ mkdir ~/projects @@ -109,7 +109,7 @@ $ mkdir hello_world $ cd hello_world ``` -Create a file and add the below code and save the file. Make sure, Rust files always end in a .rs extension. +创建一个文件并添加以下代码并保存。确保 Rust 文件始终以 .rs 扩展名结尾。 ``` $ vi 2g.rs @@ -119,13 +119,13 @@ fn main() { } ``` -Run the following command to compile the rust code. +运行以下命令编译 rust 代码。 ``` $ rustc 2g.rs ``` -The above command will create a executable Rust program file in the same directory. +上面的命令将在同一目录中创建一个可执行的 Rust 程序。 ``` $ ls -lh @@ -134,16 +134,16 @@ total 3.9M -rw-r--r-- 1 daygeek daygeek 86 Dec 14 11:09 2g.rs ``` -Run the Rust executable file to get the output. +运行 Rust 可执行文件得到输出。 ``` $ ./2g Hello, It's 2DayGeek.com - Best Linux Practical Blog! ``` -Yup! that’s working fine. +好了!正常工作了。 -To update Rust to latest version. +将 Rust 更新到最新版本。 ``` $ rustup update @@ -153,13 +153,13 @@ info: checking for self-updates stable-x86_64-unknown-linux-gnu unchanged - rustc 1.31.0 (abe02cefd 2018-12-04) ``` -Run the following command to remove the Rust package from your system. +运行以下命令从系统中删除 Rust 包。 ``` $ rustup self uninstall ``` -Once you uninstalled the Rust package, remove the Rust project directory. +卸载 Rust 包后,删除 Rust 项目目录。 ``` $ rm -fr ~/projects @@ -170,10 +170,10 @@ via: https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/ 作者:[Prakash Subramanian][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/) 荣誉推出 [a]: https://www.2daygeek.com/author/prakash/ -[b]: https://github.com/lujun9972 +[b]: https://github.com/lujun9972 \ No newline at end of file From 637e80f3f8638fe1154dd1f19c941c3953325e24 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 27 Dec 2018 08:56:27 +0800 Subject: [PATCH 1094/1143] translating --- .../tech/20181222 Watch YouTube videos at the Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181222 Watch YouTube videos at the Linux terminal.md b/sources/tech/20181222 Watch YouTube videos at the Linux terminal.md index d2ba12dbeb..e4db6bc039 100644 --- a/sources/tech/20181222 Watch YouTube videos at the Linux terminal.md +++ b/sources/tech/20181222 Watch YouTube videos at the Linux terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e51e499efeca086c62c2b4d3d5f3601a69c92632 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 27 Dec 2018 09:42:30 +0800 Subject: [PATCH 1095/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20[Review]=20Polo?= =?UTF-8?q?=20File=20Manager=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...226 -Review- Polo File Manager in Linux.md | 139 ++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 sources/talk/20181226 -Review- Polo File Manager in Linux.md diff --git a/sources/talk/20181226 -Review- Polo File Manager in Linux.md b/sources/talk/20181226 -Review- Polo File Manager in Linux.md new file mode 100644 index 0000000000..cf763850cf --- /dev/null +++ b/sources/talk/20181226 -Review- Polo File Manager in Linux.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ([Review] Polo File Manager in Linux) +[#]: via: (https://itsfoss.com/polo-file-manager/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +[Review] Polo File Manager in Linux +====== + +We are all familiar with file managers. It’s that piece of software that allows you to access your directories, files in a GUI. + +Most of us use the default file manager included with our desktop of choice. The creator of [Polo][1] hopes to get you to use his file manager by adding extra features but hides the good ones behind a paywall. + +![][2]Polo file manager + +### What is Polo file manager? + +According to its [website][1], Polo is an “advanced file manager for Linux written in [Vala][3])”. Further down the page, Polo is referred to as a “modern, light-weight file manager for Linux with support for multiple panes and tabs; support for archives, and much more.” + +It is from the same developer (Tony George) that has given us some of the most popular applications for desktop Linux. [Timeshift backup][4] tool, [Conky Manager][5], [Aptik backup tool][6]s for applications etc. Polo is the latest offering from Tony. + +Note that Polo is still in the beta stage of development which means the first stable version of the software is not out yet. + +### Features of Polo file manager + +![Polo File Manager in Ubuntu Linux][7]Polo File Manager in Ubuntu Linux + +It’s true that Polo has a bunch of neat features that most file managers don’t have. However, the really neat features are only available if you donate more than $10 to the project or sign up for the creator’s Patreon. I will be separating the free features from the features that require the “donation plugin”. + +![Cloud storage support in Polo file manager][8]Support cloud storage + +#### Free Features + + * Multiple Panes – Single-pane, dual-pane (vertical or horizontal split) and quad-pane layouts. + * Multiple Views – List view, Icon view, Tiled view, and Media view + * Device Manager – Devices popup displays the list of connected devices with options to mount and unmount + * Archive Support – Support for browsing archives as normal folders. Supports creation of archives in multiple formats with advanced compression settings. + * Checksum & Hashing – Generate and compare MD5, SHA1, SHA2-256 ad SHA2-512 checksums + * Built-in [Fish shell][9] + * Support for [cloud storage][10], such as Dropbox, Google Drive, Amazon Drive, Amazon S3, Backblaze B2, Hubi, Microsoft OneDrive, OpenStack Swift, and Yandex Disk + * Compare files + * Analyses disk usage + * KVM support + * Connect to FTP, SFTP, SSH and Samba servers + + + +![Dual pane view of Polo file manager][11]Polo in dual pane view + +#### Donation/Paywall Features + + * Write ISO to USB Device + * Image optimization and adjustment tools + * Optimize PNG + * Reduce JPEG Quality + * Remove Color + * Reduce Color + * Boost Color + * Set as Wallpaper + * Rotate + * Resize + * Convert to PNG, JPEG, TIFF, BMP, ICO and more + * PDF tools + * Split + * Merge + * Add and Remove Password + * Reduce File Size + * Uncompress + * Remove Colors + * Rotate + * Optimize + * Video Download via [youtube-dl][12] + + + +### Installing Polo + +Let’s see how to install Polo file manager on various Linux distributions. + +#### 1\. Ubuntu based distributions + +For all Ubuntu based systems (Ubuntu, Linux Mint, Elementary OS, etc), you can install Polo via the [official PPA][13]. Not sure what a PPA is? [Read about PPA here][14]. + +`sudo apt-add-repository -y ppa:teejee2008/ppa` +`sudo apt-get update` +`sudo apt-get install polo-file-manager` + +#### 2\. Arch based distributions + +For all Arch-based systems (Arch, Manjaro, ArchLabs, etc), you can install Polo from the [Arch User Repository][15]. + +#### 3\. Other Distros + +For all other distros, you can download and use the [.RUN installer][16] to setup Polo. + +### Thoughts on Polo + +I’ve installed tons of different distros and never had a problem with the default file manager. (I’ve probably used Thunar and Caja the most.) The free version of Polo doesn’t contain any features that would make me switch. As for the paid features, I already use a number of applications that accomplish the same things. + +One final note: the paid version of Polo is supposed to help fund development of the project. However, [according to GitHub][17], the last commit on Polo was three months ago. That’s quite a big interval of inactivity for a software that is still in the beta stages of development. + +Have you ever used [Polo][1]? If not, what is your favorite Linux file manager? Let us know in the comments below. + +If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][18]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/polo-file-manager/ + +作者:[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://teejee2008.github.io/polo/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/polo.jpg?fit=800%2C500&ssl=1 +[3]: https://en.wikipedia.org/wiki/Vala_(programming_language +[4]: https://itsfoss.com/backup-restore-linux-timeshift/ +[5]: https://itsfoss.com/conky-gui-ubuntu-1304/ +[6]: https://github.com/teejee2008/aptik +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/polo-file-manager-in-ubuntu.jpeg?resize=800%2C450&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/polo-coud-options.jpg?fit=800%2C795&ssl=1 +[9]: https://fishshell.com/ +[10]: https://itsfoss.com/cloud-services-linux/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/polo-dual-pane.jpg?fit=800%2C520&ssl=1 +[12]: https://itsfoss.com/download-youtube-linux/ +[13]: https://launchpad.net/~teejee2008/+archive/ubuntu/ppa +[14]: https://itsfoss.com/ppa-guide/ +[15]: https://aur.archlinux.org/packages/polo +[16]: https://github.com/teejee2008/polo/releases +[17]: https://github.com/teejee2008/polo +[18]: http://reddit.com/r/linuxusersgroup From 714c33c15748ded422ff8f49371f35fff978d65e Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 27 Dec 2018 09:43:12 +0800 Subject: [PATCH 1096/1143] add done: 20181226 -Review- Polo File Manager in Linux.md --- .../20181226 -Review- Polo File Manager in Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{talk => tech}/20181226 -Review- Polo File Manager in Linux.md (100%) diff --git a/sources/talk/20181226 -Review- Polo File Manager in Linux.md b/sources/tech/20181226 -Review- Polo File Manager in Linux.md similarity index 100% rename from sources/talk/20181226 -Review- Polo File Manager in Linux.md rename to sources/tech/20181226 -Review- Polo File Manager in Linux.md From 479a781f1e4aeee3d73a390f2a0db95fc7df0e27 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 27 Dec 2018 09:50:03 +0800 Subject: [PATCH 1097/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Turn=20GNOME=20?= =?UTF-8?q?to=20Heaven=20With=20These=2023=20GNOME=20Extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o Heaven With These 23 GNOME Extensions.md | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 sources/tech/20181224 Turn GNOME to Heaven With These 23 GNOME Extensions.md diff --git a/sources/tech/20181224 Turn GNOME to Heaven With These 23 GNOME Extensions.md b/sources/tech/20181224 Turn GNOME to Heaven With These 23 GNOME Extensions.md new file mode 100644 index 0000000000..e49778eab7 --- /dev/null +++ b/sources/tech/20181224 Turn GNOME to Heaven With These 23 GNOME Extensions.md @@ -0,0 +1,288 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Turn GNOME to Heaven With These 23 GNOME Extensions) +[#]: via: (https://fosspost.org/tutorials/turn-gnome-to-heaven-with-these-23-gnome-extensions) +[#]: author: (M.Hanny Sabbagh https://fosspost.org/author/mhsabbagh) + +Turn GNOME to Heaven With These 23 GNOME Extensions +====== + +GNOME Shell is one of the most used desktop interfaces on the Linux desktop. It’s part of the GNOME project and is considered to be the next generation of the old classic GNOME 2.x interface. GNOME Shell was first released in 2011 carrying a lot of features, including GNOME Shell extensions feature. + +GNOME Extensions are simply extra functionality that you can add to your interface, they can be panel extensions, performance extensions, quick access extensions, productivity extensions or for any other type of usage. They are all free and open source of course; you can install them with a single click **from your web browser** actually. + +### How To Install GNOME Extensions? + +You main way to install GNOME extensions will be via the extensions.gnome.org website. It’s an official platform belonging to GNOME where developers publish their extensions easily so that users can install them in a single click. + +In order to for this to work, you’ll need two things: + + 1. Browser Add-on: You’ll need to install a browser add-on that allows the website to communicate with your local GNOME desktop. You install it from [here for Firefox][1], or [here for Chrome][2] or [here for Opera][3]. + + 2. Native Connector: You still need another part to allow your system to accept installing files locally from your web browser. To install this component, you must install the `chrome-gnome-shell` package. Do not be deceived! Although the package name is containing “chrome”, it also works on Firefox too. To install it on Debian/Ubuntu/Mint run the following command in terminal: + +``` +sudo apt install chrome-gnome-shell +``` + +For Fedora: + +``` +sudo dnf install chrome-gnome-shell +``` + +For Arch: + +``` +sudo pacman -S chrome-gnome-shell +``` + +After you have installed the two components above, you can easily install extensions from the GNOME extensions website. + +### How to Configure GNOME Extensions Settings? + +Many of these extensions do have a settings window that you can access to adjust the preferences of that extension. You must make sure that you have seen its options at least once so that you know what you can possibly do using that extension. + +To do this, you can head to the [installed extensions page on the GNOME website][4], and you’ll see a small options button near every extension that offers one: + +![Screenshot 2018 12 24 20 50 55 41][5] + +Clicking it will display a window for you, from which you can see the possible settings: + +![Screenshot 2018 12 24 20 51 29 43][6] + +Read our article below for our list of recommended extension! + +### General Extensions + +#### 1\. User Themes + +![Screenshot from 2018 12 23 12 30 20 45][7] + +This is the first must-install extension on the GNOME Shell interface, it simply allows you to change the desktop theme to another one using the tweak tool. After installation run gnome-tweak-tool, and you’ll be able to change your desktop theme. + +Installation link: + +#### 2\. Dash to Panel + +![Screenshot from 2018 12 24 21 16 11 47][8] + +Converts the GNOME top bar into a taskbar with many added features, such as favorite icons, moving the clock to right, adding currently opened windows to the panel and many other features. (Make sure not to install this one with some other extensions below which do provide the same functionality). + +Installation link: + +#### 3\. Desktop Icons + +![gnome shell screenshot SSP3UZ 49][9] + +Restores desktop icons back again to GNOME. Still in continues development. + +Installation link: + +#### 4\. Dash to Dock + +![Screenshot from 2018 12 24 21 50 07 51][10] + +If you are a fan of the Unity interface, then this extension may help you. It simply adds a dock to the left/right side of the screen, which is very similar to Unity. You can customize that dock however you like. + +Installation link: + +### Productivity Extensions + +#### 5\. Todo.txt + +![screenshot_570_5X5YkZb][11] + +For users who like to maintain productivity, you can use this extension to add a simple To-Do list functionality to your desktop, it will use the [syntax][12] from todotxt.com, you can add unlimited to-dos, mark them as complete or remove them, change their position beside modifying or taking a backup of the todo.txt file manually. + +Installation link: + +#### 6\. Screenshot Tool + +![Screenshot from 2018 12 24 21 04 14 54][13] + +Easily take a screenshot of your desktop or a specific area, with the possibility of also auto-uploading it to imgur.com and auto-saving the link into the clipboard! Very useful extension. + +Installation link: + +#### 7\. OpenWeather + +![screenshot_750][14] + +If you would like to know the weather forecast everyday then this extension will be the right one for you, this extension will simply add an applet to the top panel allowing you to fetch the weather data from openweathermap.org or forecast.io, it supports all the countries and cities around the world. It also shows the wind and humidity. + +Installation link: + +#### 8 & 9\. Search Providers Extensions + +![Screenshot from 2018 12 24 21 29 41 57][15] + +In GNOME, you can add what’s known as “search providers” to the shell, meaning that when you type something in the search box, you’ll be able to automatically search these websites (search providers) using the same text you entered, and see the results directly from your shell! + +YouTube Search Provider: + +Wikipedia Search Provider: + +### Workflow Extensions + +#### 10\. No Title Bar + +![Screenshot 20181224210737 59][16] + +This extension simply removes the title bar from all the maximized windows, and moves it into the top GNOME Panel. In this way, you’ll be able to save a complete horizontal line on your screen, more space for your work! + +Installation Link: + +#### 11\. Applications Menu + +![Screenshot 2018 12 23 13 58 07 61][17] + +This extension simply adds a classic menu to the “activities” menu on the corner. By using it, you will be able to browse the installed applications and categories without the need to use the dash or the search feature, which saves you time. (Check the “No hot corner” extension below to get a better usage). + +Installation link: + +#### 12\. Places Status Indicator + +![screenshot_8_1][18] + +This indicator will put itself near the left corner of the activities button, it allows you to access your home folder and sub-folders easily using a menu, you can also browse the available devices and networks using it. + +Installation link: + +#### 13\. Window List + +![Screenshot from 2016-08-12 08-05-48][19] + +Officially supported by GNOME team, this extension adds a bottom panel to the desktop which allows you to navigate between the open windows easily, it also include a workspace indicator to switch between them. + +Installation link: + +#### 14\. Frippery Panel Favorites + +![screenshot_4][20] + +This extensions adds your favorite applications and programs to the panel near the activities button, allowing you to access to it more quickly with just 1 click, you can add or remove applications from it just by modifying your applications in your favorites (the same applications in the left panel when you click the activities button will appear here). + +Installation link: + +#### 15\. TopIcons + +![Screenshot 20181224211009 66][21] + +Those extensions restore the system tray back into the top GNOME panel. Very needed in cases of where applications are very much dependent on the tray icon. + +For GNOME 3.28, installation link: + +For GNOME 3.30, installation link: + +#### 16\. Clipboard Indicator + +![Screenshot 20181224214626 68][22] + +A clipboard manager is simply an applications that manages all the copy & paste operations you do on your system and saves them into a history, so that you can access them later whenever you want. + +This extension does exactly this, plus many other cool features that you can check. + +Installation link: + +### Other Extensions + +#### 17\. Frippery Move Clock + +![screenshot_2][23] + +If you are from those people who like alignment a lot, and dividing the panels into 2 parts only, then you may like this extension, what it simply does is moving the clock from the middle of the GNOME Shell panel to the right near the other applets on the panel, which makes it more organized. + +Installation link: + +#### 18\. No Topleft Hot Corner + +If you don’t like opening the dash whenever you move the mouse to the left corner, you can disable it easily using this extension. You can for sure click the activities button if you want to open the dash view (or via the Super key on the keyboard), but the hot corner will be disabled only. + +Installation link: + +#### 19\. No Annoyance + +Simply removes the “window is ready” notification each time a new window a opened. + +Installation link: + +#### 20\. EasyScreenCast + +![Screenshot 20181224214219 71][24] + +If you would like to quickly take a screencast for your desktop, then this extension may help you. By simply just choosing the type of recording you want, you’ll be able to take screencasts any time. You can also configure advanced options for the extension, such as the pipeline and many other things. + +Installation link: + +#### 21\. Removable drive Menu + +![Screenshot 20181224214131 73][25] + +Adds an icon to the top bar which shows you a list of your currently removable drives. + +Installation link: + +#### 22\. BottomPanel + +![Screenshot 20181224214419 75][26] + +As its title says.. It simply moves the top GNOME bar into the bottom of the screen. + +Installation link: + +#### 23\. Unite + +If you would like one extension only to do most of the above tasks, then Unite extension can help you. It adds panel favorites, removes title bar, moves the clock, allows you to change the location of the panel.. And many other features. All using this extension alone! + +Installation link: + +### Conclusion + +This was our list for some great GNOME Shell extensions to try out. Of course, you don’t (and shouldn’t!) install all of these, but just what you need for your own usage. As you can see, you can convert GNOME into any form you would like, but be careful for RAM usage (because if you use more extensions, the shell will consume very much resources). + +What other GNOME Shell extensions do you use? What do you think of this list? + + +-------------------------------------------------------------------------------- + +via: https://fosspost.org/tutorials/turn-gnome-to-heaven-with-these-23-gnome-extensions + +作者:[M.Hanny Sabbagh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fosspost.org/author/mhsabbagh +[b]: https://github.com/lujun9972 +[1]: https://addons.mozilla.org/en/firefox/addon/gnome-shell-integration/ +[2]: https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep +[3]: https://addons.opera.com/en/extensions/details/gnome-shell-integration/ +[4]: https://extensions.gnome.org/local/ +[5]: https://i1.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot_2018-12-24_20-50-55.png?resize=850%2C359&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 42) +[6]: https://i1.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot_2018-12-24_20-51-29.png?resize=850%2C462&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 44) +[7]: https://i2.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-from-2018-12-23-12-30-20.png?resize=850%2C478&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 46) +[8]: https://i0.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-from-2018-12-24-21-16-11.png?resize=850%2C478&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 48) +[9]: https://i2.wp.com/fosspost.org/wp-content/uploads/2018/12/gnome-shell-screenshot-SSP3UZ.png?resize=850%2C492&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 50) +[10]: https://i1.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-from-2018-12-24-21-50-07.png?resize=850%2C478&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 52) +[11]: https://i0.wp.com/fosspost.org/wp-content/uploads/2016/08/screenshot_570_5X5YkZb.png?resize=478%2C474&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 53) +[12]: https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format +[13]: https://i1.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-from-2018-12-24-21-04-14.png?resize=715%2C245&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 55) +[14]: https://i2.wp.com/fosspost.org/wp-content/uploads/2016/08/screenshot_750.jpg?resize=648%2C276&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 56) +[15]: https://i2.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-from-2018-12-24-21-29-41.png?resize=850%2C478&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 58) +[16]: https://i0.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-20181224210737-380x95.png?resize=380%2C95&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 60) +[17]: https://i0.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot_2018-12-23_13-58-07.png?resize=524%2C443&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 62) +[18]: https://i0.wp.com/fosspost.org/wp-content/uploads/2016/08/screenshot_8_1.png?resize=247%2C620&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 63) +[19]: https://i1.wp.com/fosspost.org/wp-content/uploads/2016/08/Screenshot-from-2016-08-12-08-05-48.png?resize=850%2C478&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 64) +[20]: https://i0.wp.com/fosspost.org/wp-content/uploads/2016/08/screenshot_4.png?resize=414%2C39&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 65) +[21]: https://i0.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-20181224211009-631x133.png?resize=631%2C133&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 67) +[22]: https://i1.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-20181224214626-520x443.png?resize=520%2C443&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 69) +[23]: https://i0.wp.com/fosspost.org/wp-content/uploads/2016/08/screenshot_2.png?resize=388%2C26&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 70) +[24]: https://i2.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-20181224214219-327x328.png?resize=327%2C328&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 72) +[25]: https://i1.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-20181224214131-366x199.png?resize=366%2C199&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 74) +[26]: https://i2.wp.com/fosspost.org/wp-content/uploads/2018/12/Screenshot-20181224214419-830x143.png?resize=830%2C143&ssl=1 (Turn GNOME to Heaven With These 23 GNOME Extensions 76) From f5a62473820ac95e0d06db7b72650717346a9670 Mon Sep 17 00:00:00 2001 From: darksun Date: Thu, 27 Dec 2018 09:54:47 +0800 Subject: [PATCH 1098/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20An=20Introducti?= =?UTF-8?q?on=20to=20Go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20181224 An Introduction to Go.md | 278 ++++++++++++++++++ 1 file changed, 278 insertions(+) create mode 100644 sources/tech/20181224 An Introduction to Go.md diff --git a/sources/tech/20181224 An Introduction to Go.md b/sources/tech/20181224 An Introduction to Go.md new file mode 100644 index 0000000000..b35bc9922e --- /dev/null +++ b/sources/tech/20181224 An Introduction to Go.md @@ -0,0 +1,278 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An Introduction to Go) +[#]: via: (https://blog.jak-linux.org/2018/12/24/introduction-to-go/) +[#]: author: (Julian Andres Klode https://blog.jak-linux.org/) + +An Introduction to Go +====== + +(What follows is an excerpt from my master’s thesis, almost all of section 2.1, quickly introducing Go to people familiar with CS) + +Go is an imperative programming language for concurrent programming created at and mainly developed by Google, initially mostly by Robert Griesemer, Rob Pike, and Ken Thompson. Design of the language started in 2007, and an initial version was released in 2009; with the first stable version, 1.0 released in 2012 . + +Go has a C-like syntax (without a preprocessor), garbage collection, and, like its predecessors devloped at Bell Labs – Newsqueak (Rob Pike), Alef (Phil Winterbottom), and Inferno (Pike, Ritchie, et al.) – provides built-in support for concurrency using so-called goroutines and channels, a form of co-routines, based on the idea of Hoare’s ‘Communicating Sequential Processes’ . + +Go programs are organised in packages. A package is essentially a directory containing Go files. All files in a package share the same namespace, and there are two visibilities for symbols in a package: Symbols starting with an upper case character are visible to other packages, others are private to the package: + +``` +func PublicFunction() { + fmt.Println("Hello world") +} + +func privateFunction() { + fmt.Println("Hello package") +} +``` + +### Types + +Go has a fairly simple type system: There is no subtyping (but there are conversions), no generics, no polymorphic functions, and there are only a few basic categories of types: + + 1. base types: `int`, `int64`, `int8`, `uint`, `float32`, `float64`, etc. + + 2. `struct` + + 3. `interface` \- a set of methods + + 4. `map[K, V]` \- a map from a key type to a value type + + 5. `[number]Type` \- an array of some element type + + 6. `[]Type` \- a slice (pointer to array with length and capability) of some type + + 7. `chan Type` \- a thread-safe queue + + 8. pointer `*T` to some other type + + 9. functions + + 10. named type - aliases for other types that may have associated methods: + +``` +type T struct { foo int } +type T *T +type T OtherNamedType +``` + +Named types are mostly distinct from their underlying types, so you cannot assign them to each other, but some operators like `+` do work on objects of named types with an underlying numerical type (so you could add two `T` in the example above). + + +Maps, slices, and channels are reference-like types - they essentially are structs containing pointers. Other types are passed by value (copied), including arrays (which have a fixed length and are copied). + +#### Conversions + +Conversions are the similar to casts in C and other languages. They are written like this: + +``` +TypeName(value) +``` + +#### Constants + +Go has “untyped” literals and constants. + +``` +1 // untyped integer literal +const foo = 1 // untyped integer constant +const foo int = 1 // int constant +``` + +Untyped values are classified into the following categories: `UntypedBool`, `UntypedInt`, `UntypedRune`, `UntypedFloat`, `UntypedComplex`, `UntypedString`, and `UntypedNil` (Go calls them basic kinds, other basic kinds are available for the concrete types like `uint8`). An untyped value can be assigned to a named type derived from a base type; for example: + +``` +type someType int + +const untyped = 2 // UntypedInt +const bar someType = untyped // OK: untyped can be assigned to someType +const typed int = 2 // int +const bar2 someType = typed // error: int cannot be assigned to someType +``` + +### Interfaces and ‘objects’ + +As mentioned before, interfaces are a set of methods. Go is not an object-oriented language per se, but it has some support for associating methods with named types: When declaring a function, a receiver can be provided - a receiver is an additional function argument that is passed before the function and involved in the function lookup, like this: + +``` +type SomeType struct { ... } + +func (s *SomeType) MyMethod() { +} + +func main() { + var s SomeType + s.MyMethod() +} +``` + +An object implements an interface if it implements all methods; for example, the following interface `MyMethoder` is implemented by `*SomeType` (note the pointer), and values of `*SomeType` can thus be used as values of `MyMethoder`. The most basic interface is `interface{}`, that is an interface with an empty method set - any object satisfies that interface. + +``` +type MyMethoder interface { + MyMethod() +} +``` + +There are some restrictions on valid receiver types; for example, while a named type could be a pointer (for example, `type MyIntPointer *int`), such a type is not a valid receiver type. + +### Control flow + +Go provides three primary statements for control flow: `if`, `switch`, and `for`. The statements are fairly similar to their equivalent in other C-like languages, with some exceptions: + + * There are no parentheses around conditions, so it is `if a == b {}`, not `if (a == b) {}`. The braces are mandatory. + + * All of them can have initialisers, like this + +`if result, err := someFunction(); err == nil { // use result }` + + * The `switch` statement can use arbitrary expressions in cases + + * The `switch` statement can switch over nothing (equals switching over true) + + * Cases do not fall through by default (no `break` needed), use `fallthrough` at the end of a block to fall through. + + * The `for` loop can loop over ranges: `for key, val := range map { do something }` + + + + +### Goroutines + +The keyword `go` spawns a new goroutine, a concurrently executed function. It can be used with any function call, even a function literal: + +``` +func main() { + ... + go func() { + ... + }() + + go some_function(some_argument) +} +``` + +### Channels + +Goroutines are often combined with channels to provide an extended form of Communicating Sequential Processes . A channel is a concurrent-safe queue, and can be buffered or unbuffered: + +``` +var unbuffered = make(chan int) // sending blocks until value has been read +var buffered = make(chan int, 5) // may have up to 5 unread values queued +``` + +The `<-` operator is used to communicate with a single channel. + +``` +valueReadFromChannel := <- channel +otherChannel <- valueToSend +``` + +The `select` statement allows communication with multiple channels: + +``` +select { + case incoming := <- inboundChannel: + // A new message for me + case outgoingChannel <- outgoing: + // Could send a message, yay! +} +``` + +### The `defer` statement + +Go provides a `defer` statement that allows a function call to be scheduled for execution when the function exits. It can be used for resource clean-up, for example: + +``` +func myFunc(someFile io.ReadCloser) { + defer someFile.close() + /bin /boot /dev /etc /home /lib /lib64 /lost+found /media /mnt /opt /proc /root /run /sbin /srv /sys /tmp /usr /var Do stuff with file */ +} +``` + +It is of course possible to use function literals as the function to call, and any variables can be used as usual when writing the call. + +### Error handling + +Go does not provide exceptions or structured error handling. Instead, it handles errors by returning them in a second or later return value: + +``` +func Read(p []byte) (n int, err error) + +// Built-in type: +type error interface { + Error() string +} +``` + +Errors have to be checked in the code, or can be assigned to `_`: + +``` +n0, _ := Read(Buffer) // ignore error +n, err := Read(buffer) +if err != nil { + return err +} +``` + +There are two functions to quickly unwind and recover the call stack, though: `panic()` and `recover()`. When `panic()` is called, the call stack is unwound, and any deferred functions are run as usual. When a deferred function invokes `recover()`, the unwinding stops, and the value given to `panic()` is returned. If we are unwinding normally and not due to a panic, `recover()` simply returns `nil`. In the example below, a function is deferred and any `error` value that is given to `panic()` will be recovered and stored in an error return value. Libraries sometimes use that approach to make highly recursive code like parsers more readable, while still maintaining the usual error return value for public functions. + +``` +func Function() (err error) { + defer func() { + s := recover() + switch s := s.(type) { // type switch + case error: + err = s // s has type error now + default: + panic(s) + } + } +} +``` + +### Arrays and slices + +As mentioned before, an array is a value type and a slice is a pointer into an array, created either by slicing an existing array or by using `make()` to create a slice, which will create an anonymous array to hold the elements. + +``` +slice1 := make([]int, 2, 5) // 5 elements allocated, 2 initialized to 0 +slice2 := array[:] // sliced entire array +slice3 := array[1:] // slice of array without first element +``` + +There are some more possible combinations for the slicing operator than mentioned above, but this should give a good first impression. + +A slice can be used as a dynamically growing array, using the `append()` function. + +``` +slice = append(slice, value1, value2) +slice = append(slice, arrayOrSlice...) +``` + +Slices are also used internally to represent variable parameters in variable length functions. + +### Maps + +Maps are simple key-value stores and support indexing and assigning. They are not thread-safe. + +``` +someValue := someMap[someKey] +someValue, ok := someMap[someKey] // ok is false if key not in someMap +someMap[someKey] = someValue +``` +-------------------------------------------------------------------------------- + +via: https://blog.jak-linux.org/2018/12/24/introduction-to-go/ + +作者:[Julian Andres Klode][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.jak-linux.org/ +[b]: https://github.com/lujun9972 From ff5a22c7171a889298e7d6c9d8d944fd07d633e6 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 27 Dec 2018 11:06:21 +0800 Subject: [PATCH 1099/1143] Translated --- ...at the Linux command line with Nyan Cat.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md b/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md index 05dd160dc8..81e74a8a13 100644 --- a/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md +++ b/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md @@ -7,38 +7,39 @@ [#]: author: (Jason Baker https://opensource.com/users/jason-baker) [#]: url: ( ) -Take a break at the Linux command line with Nyan Cat +在 Linux 命令行中观看 Nyan Cat 来稍适休息 ====== -Rainbows, Pop-Tarts, and cats in space: What more could you want at your terminal? +> 你甚至可以在终端里欣赏彩虹猫。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-nyancat.png?itok=eg1aEmBw) -We're now on day six of the Linux command-line toys advent calendar, where we explore some of the fun, entertaining, and in some cases, utterly useless toys available for your Linux terminal. All are available under an open source license. +今天是《Linux 命令行小玩具介绍》的第六天。在本系列文章中,我们将会探索一些娱乐用途(甚至有时完全没用)的 Linux 命令行小玩具。所有我们介绍的小玩具都是开源的。 -Will they all be unique? Yes. Will they all be unique to you? I don't know, but, chances are you'll find at least one new toy to play with by the time our advent calendar is done. +也许你会问,他们都很独特吗?是的。不过,他们对你是否独特,我就不知道了。但是,我们相信你应该能在这系列文章结束之前找到至少一个好玩的玩具。 -Today's selection is a continuation on the [theme][1] we started yesterday: cats and rainbows. Wait, there's more cat-related rainbow fun to be had at the Linux command line? You bet there is. +从[昨天的选题][1]继续:我们谈到了猫和彩虹。不过,在 Linux 命令行下有更有趣的彩虹和猫结合的程序吗?答案是肯定的。 -So let's make a throwback all the way to 2011's [Nyan Cat][2] with a command-line toy call, not surprisingly, **nyancat**. Did you miss the cultural phenomenon that was Nyan Cat? Watch the embed below, I'll wait. +我们不妨看看之前可以在命令行中使用 Nyan Cat 的方式吧。意料之中,2011 年发布的 [Nyan Cat][2] 可以用 **nyancat** 呈现在终端中。你想念这只曾火遍网络的 Nyan Cat 吗?看看下面这个视频记录吧,我会等你看完的。 -Now, let's recreate that amazing experience in your terminal. **Nyancat** is packaged for many distributions (Arch, Debian, Gentoo, Ubuntu, etc.) but not for mine (Fedora), but compiling from source was simple. In fact, I grabbed the source, built it, and launched it in one line: +现在,让我们在终端中重新感受这个令人惊奇的体验吧。**Nyancat** 包正在很多地方被分发(比如 Arch、Debian、Gentoo、Ubuntu 等等…),不过我的系统(Fedora)没有,但是我们仍然可以很轻松地从源码编译它。事实上,我们只需要一行命令就能做完所有工作: ``` git clone https://github.com/klange/nyancat.git && cd nyancat && make && cd src && ./nyancat ``` -This launched straight into a **nyancat** experience complete with a counter of how long I had been enjoying the **nyancat** magic for. +这直接为我带来了一个 Nyan Cat 体验,甚至还有个计时器来显示我享受 “Nyan Cat 魔法”的时间。 ![](https://opensource.com/sites/default/files/uploads/linux-toy-nyancat-animated.gif) -You can find the source for **nyancat** [on GitHub][3] under an [NCSA open source license][4]. +你可以在 [GitHub][3] 上找到 **nyancat** 的源码,它正以 [NCSA 许可证][4] 开源。 -The command-line version of Nyan Cat used to be [accessible by a public Telnet server][5] (or, for even more pun, with [netcat][6]) so that you didn't even have to install it, but sadly was shut down due to bandwidth limitations. Nevertheless, the [gallery][5] from the old Telnet server running Nyan Cat on a variety of old devices is well-worth checking out, and maybe you'd like to do the community a favor by launching your own public mirror and letting the author know so that they may share it with the public yet again? +命令行版本的 Nyan Cat 可在[这个公共 Telnet 服务器上访问][5](或者 [netcat][6] 也行),所以理论上来说你不必安装它。不过不幸的是,由于带宽限制,该服务器目前已经被关闭了。尽管如此,在各种老设备上连接老 Telnet 服务器上运行 Nyan Cat 的[照片][5]还是值得一看的,说不准你还会萌生搭建一个能让大家连接的公共服务器的想法呢(如果你真的搭建了,请务必告知作者,万一他们可能会向公众分享呢?)。 -Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. +你想让我介绍一下你最喜爱的命令行玩具吗?请在原文下留言,作者会考虑介绍的。 -Check out yesterday's toy, [Bring some color to your Linux terminal with lolcat][1], and check back tomorrow for another! +瞧瞧我们昨天介绍的小玩意:[用 lolcat 为你的 Linux 终端增添些许色彩][1]。明天再来看我们的下一篇文章吧! -------------------------------------------------------------------------------- @@ -46,7 +47,7 @@ via: https://opensource.com/article/18/12/linux-toy-nyancat 作者:[Jason Baker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zhs852](https://github.com/zhs852) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ea890f4ca5529cc3ac3708b738fcb504f1f3ec22 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Thu, 27 Dec 2018 11:22:12 +0800 Subject: [PATCH 1100/1143] Move file to translated --- ...181206 Take a break at the Linux command line with Nyan Cat.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20181206 Take a break at the Linux command line with Nyan Cat.md (100%) diff --git a/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md b/translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md similarity index 100% rename from sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md rename to translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md From 66cd09bb26ddefd662d3964e330f6a56651d6ebd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 27 Dec 2018 12:55:34 +0800 Subject: [PATCH 1101/1143] PUB:20181016 Lab 5- File system, Spawn and Shell.md @qhwdw https://linux.cn/article-10389-1.html --- .../20181016 Lab 5- File system, Spawn and Shell.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181016 Lab 5- File system, Spawn and Shell.md (100%) diff --git a/translated/tech/20181016 Lab 5- File system, Spawn and Shell.md b/published/20181016 Lab 5- File system, Spawn and Shell.md similarity index 100% rename from translated/tech/20181016 Lab 5- File system, Spawn and Shell.md rename to published/20181016 Lab 5- File system, Spawn and Shell.md From 7937523908695caa8f093623ea80fb05c6bd98b5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 27 Dec 2018 19:20:08 +0800 Subject: [PATCH 1102/1143] PRF:20181217 Take a swim at your Linux terminal with asciiquarium.md @amwps290 --- ...t your Linux terminal with asciiquarium.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md b/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md index 04ba82841c..70e4a17eb7 100644 --- a/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md +++ b/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md @@ -1,34 +1,35 @@ [#]: collector: "lujun9972" -[#]: translator: " amwps290" -[#]: reviewer: " " +[#]: translator: "amwps290" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Take a swim at your Linux terminal with asciiquarium" [#]: via: "https://opensource.com/article/18/12/linux-toy-asciiquarium" [#]: author: "Jason Baker https://opensource.com/users/jason-baker" -# 使用 asciiquarium 在你的终端里探索海洋的秘密 +在你的终端里探索海洋的秘密 +======= + +> “亲爱的,当您的命令行变得更湿润的时候会更好。这多亏了 ASCII。” -亲爱的,当您的命令行变得更湿润的时候会更好。这多亏了 ASCII。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-asciiquarium.png?itok=ZhJ9P2Ft) -现在,我们即将数完长达 24 天的 Linux 命令行玩具倒数日历。离今天只剩一周了!如果这是您第一次访问本系列文章,那么您可能会问自己什么是命令行玩具。我们一边走,一边说,但一般来说,这可能是一个游戏,或者可以帮助你在终端玩得开心的任何简单的娱乐活动。 +现在,我们即将数完长达 24 天的 Linux 命令行玩具日历。离今天只剩一周了!如果这是您第一次访问本系列文章,那么您可能会问自己什么是命令行玩具。我们一边走,一边说,但一般来说,这可能是一个游戏,或者可以帮助你在终端玩得开心的任何简单的娱乐活动。 你们其中的一些人可能已经在以前的系列文章中看到了各种各样的命令行玩具。但是,我们希望每个人都能够获得一个新玩具。 -今天的玩具有一点鱼的味道。先和 **asciiquarium** 打个招呼,一个在你终端里海底冒险的玩具。我是在我的 Fedora 仓库里发现 asciiquarium 的,因此安装它非常容易: +今天的玩具有一点鱼的味道。先和 `asciiquarium` 打个招呼,一个在你终端里海底冒险的玩具。我是在我的 Fedora 仓库里发现 `asciiquarium` 的,因此安装它非常容易: ``` $ sudo dnf install asciiquarium ``` -如果您正在运行不同的发行版,那么它也可能已经为您打包。 只需在您的终端中运行 **asciiquarium** 即可感受到蛤蜊的快乐。 该项目也在终端之外进行了“翻译”,所有水族伙伴的屏保都是为非 Linux 操作系统制作的,甚至还有一个 Android 动态壁纸版本。 +如果您正在运行不同的发行版,那么它也可能已经为您打包。 只需在您的终端中运行 `asciiquarium` 即可感受到蛤蜊的快乐。 该项目也在终端之外进行了“翻译”,所有水族伙伴的屏保都是为几个非 Linux 操作系统制作的,甚至还有一个 Android 动态壁纸版本。 -访问 **asciiquarium** [主页][1]了解更多信息或下载 Perl 源代码。 该项目是 GPL 第 2 版许可证下的开源项目。 如果你想更多地了解开源,开放数据和开放科学如何在实际的海洋中发挥作用,请花点时间去了解[海洋健康指数][2]。 +访问 asciiquarium [主页][1]了解更多信息或下载 Perl 源代码。 该项目是 GPL 第 2 版许可证下的开源项目。 如果你想更多地了解开源,开放数据和开放科学如何在实际的海洋中发挥作用,请花点时间去了解[海洋健康指数][2]。 ![](https://opensource.com/sites/default/files/uploads/linux-toy-asciiquarium-animated.gif) - 你觉得我应该介绍一下你最喜欢的命令行玩具吗?时间不多了,但我还是想听听你的建议。请在下面的评论中告诉我,我会查阅的。让我知道你对今天的娱乐有什么看法。 一定要看看昨天的玩具,[安排一次与 Emacs 精神病医生的访问][3],明天再来看另一个玩具! @@ -40,7 +41,7 @@ via: https://opensource.com/article/18/12/linux-toy-asciiquarium 作者:[Jason Baker][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 a28d4e3550a084c4d1a8c29b006302854462900c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 27 Dec 2018 19:21:24 +0800 Subject: [PATCH 1103/1143] PUB:20181217 Take a swim at your Linux terminal with asciiquarium.md @amwps290 https://linux.cn/article-10390-1.html --- ...17 Take a swim at your Linux terminal with asciiquarium.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181217 Take a swim at your Linux terminal with asciiquarium.md (97%) diff --git a/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md b/published/20181217 Take a swim at your Linux terminal with asciiquarium.md similarity index 97% rename from translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md rename to published/20181217 Take a swim at your Linux terminal with asciiquarium.md index 70e4a17eb7..279bc84b54 100644 --- a/translated/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md +++ b/published/20181217 Take a swim at your Linux terminal with asciiquarium.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "amwps290" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-10390-1.html" [#]: subject: "Take a swim at your Linux terminal with asciiquarium" [#]: via: "https://opensource.com/article/18/12/linux-toy-asciiquarium" [#]: author: "Jason Baker https://opensource.com/users/jason-baker" From 3ba36ccdcd007d4f0d8d028beeb0e6c9ae28f12f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 27 Dec 2018 19:47:01 +0800 Subject: [PATCH 1104/1143] PRF:20180508 Person with diabetes finds open source and builds her own medical device.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Valoniakim 翻译的很棒 --- ...ource and builds her own medical device.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md b/translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md index 1a965cdf72..c874777c07 100644 --- a/translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md +++ b/translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md @@ -1,21 +1,22 @@ 糖尿病患者们是怎样使用开源造出自己的医疗设备的 ====== +> Red Hat 的 2018 女性开源社区奖获得者 Dana Lewis 的故事。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/health_heartbeat.png?itok=P-GXea-p) -Dana Lewis 被评选为开源社区 2018 年度最佳女性!下面是开源怎样改善了她的健康的故事。 +Dana Lewis 被评选为[开源社区 2018 年度最佳女性][1]!下面是开源怎样改善了她的健康的故事。 -Dana 患有1型糖尿病,但当时市面上流通的药品和医疗设备都对她无效。 -她用来管理血糖的动态血糖监测报警器的声音太小了,根本叫不醒熟睡的她,产品这样的设计无法保证她每天睡眠时间的生命安全。 +Dana 患有 I 型糖尿病,但当时市面上流通的药品和医疗设备都对她无效。她用来管理血糖的动态血糖监测(CGM)报警器的声音太小了,根本叫不醒熟睡的她,产品这样的设计无法保证她每天睡眠时间的生命安全。 “我和生产厂家见了一面商议提出意见,厂家的回复是‘我们产品的音量已经足够大了,很少有人叫不醒’,我被告知‘这不是普遍问题,我们正在改进,请期待我们的新产品。’听到这些时我真的很挫败,但我从没想象过我能做出什么改变,毕竟那是通过了 FDA 标准的医疗设备,不是我们能随意改变的。” -面临着这些阻碍,Dana 想着如果她能把自己的数据从设备里导出,就可以设置手机闹铃来叫醒自己。在2013年末,她看到的一条推特解决了她的疑问。那条推特的作者是一位糖尿病患儿的家长,他把动态血糖监测仪进行了逆向工程,这样就可以导出孩子的血糖数据进行远程监控了。 +面临着这些阻碍,Dana 想着如果她能把自己的数据从设备里导出,就可以设置手机闹铃来叫醒自己。在 2013 年末,她看到的一条推特解决了她的疑问。那条推特的作者是一位糖尿病患儿的家长,他把动态血糖监测仪进行了逆向工程,这样就可以导出孩子的血糖数据进行远程监控了。 她意识到如果对方愿意把过程分享给她,她也可以用那些代码做一个自己的响亮的血糖监测仪了。 “我并不知道向别人要源代码是件稀松平常的事,那是我第一次接触开源。” -那个系统演化成一个响亮闹钟的代码,她也可以把代码在网页上分享给别人。和她的丈夫 Scott Leibrand 一起,她反复向闹铃添加属性,最终合成了一个算法,这个算法不仅能监测实时血糖水平,还能主动预测未来血糖波动。 +那个系统演化成一个响亮闹钟的代码,她也可以把代码在网页上分享给别人。和她的丈夫 Scott Leibrand 一起,她逐步向闹铃添加属性,最终形成了一个算法,这个算法不仅能监测实时血糖水平,还能主动预测未来血糖波动。 随着 Dana 与开源糖尿病患者社区的接触越来越深,她认识了 Ben West,他花了很多年才研究出与 Dana 使用的胰岛素泵沟通数据的方法,与血糖监测仪不同,胰岛素泵不是简单的报告血糖,它是个单独的设备,要按人体需要持续推注胰岛素,比血糖监测仪要复杂得多。 @@ -27,15 +28,15 @@ Dana 患有1型糖尿病,但当时市面上流通的药品和医疗设备都 “正因为我们使用的是开源软件,在做出这个系统之后我们就把成果开源化了,这样可以造福更多的人。”开源人工胰腺系统 (OpenAPS) 由此诞生。 -OpenAPS 社区已经拥有超过600名用户,大家都提供了各种各样的自制“闭路”系统代码。OpenAPS 贡献者们以 #WeAreNotWaiting 话题团结一致,以表达患者群体不该干等着医疗保健工厂制造出真正有效便捷产品的理念。 +OpenAPS 社区已经拥有超过 600 名用户,大家都提供了各种各样的自制“闭路”系统代码。OpenAPS 贡献者们聚集到了 #WeAreNotWaiting 话题之下,以表达患者群体不该干等着医疗保健工厂制造出真正有效便捷产品的理念。 “你可以选择等待未来的商业解决方案,这无可厚非,选择等待是你的自由。等待可以是一种选择,但不能是无法改变的现状。对我来说,开源在医疗保健方面做出的这个举动让等待变成了一种选择。你可以选择不自行解决,你可以选择等待商业解决方案,但如果你不想等了,你无需再等。现在你有很多选择,开源社区的人们已经解决了很多问题。” -OpenAPS 社区由糖尿病患者,患者家属,还有想要合理利用这项技术的人们。在社区的帮助下,Dana 学会了很多种贡献开源项目的方式。她发现许多从 Facebook 或 [Gitter][2] 上过来的非技术贡献者也对 OpenAPS 做出了很大贡献。 +OpenAPS 社区由糖尿病患者、患者家属,还有想要合理利用这项技术的人们。在社区的帮助下,Dana 学会了很多种贡献开源项目的方式。她发现许多从 Facebook 或 [Gitter][2] 上过来的非技术贡献者也对 OpenAPS 做出了很大贡献。 “贡献有很多方式,我们要认识到各种方式的贡献都是平等的。它们一般涉及不同的兴趣领域和技能组合,只有把这些综合起来,才能做成社区的项目。” -她亲身经历过,所以知道自己的贡献不被社区的其他成员认可是怎样难过的感受。对于人们习惯把女性的贡献打折的这一现象,她也不回避。在她的 [2014 年博客][3] 和 [反思][4] 文章中她初次写道在入围开源年度最佳人物时所遭受到的区别待遇,这些待遇让她意识到身为女性的不同。 +她亲身经历过,所以知道自己的贡献不被社区的其他成员认可是怎样难过的感受。对于人们习惯把女性的贡献打折的这一现象,她也不回避。在她的 [2014 年博客][3] 和 [反思][4] 文章中她初次写到在入围开源年度最佳人物时所遭受到的区别待遇,这些待遇让她意识到身为女性的不同。 在她最初的博客中,她写道了自己和丈夫 Scott 同为开源社区成员,遭受到的区别待遇。他们都注意到,Dana 总是被提出一些细枝末节的要求,但 Scott 就不会。而 Scott 总被问道一些技术性问题,即使他向他们推荐 Dana,人们也更倾向于问身为男性的 Scott。大家都或多或少经历过这些行为,Dana 的博文在社区里引起了广泛的讨论。 @@ -45,13 +46,13 @@ OpenAPS 社区由糖尿病患者,患者家属,还有想要合理利用这项 “我想如果我就放弃努力了,可能开源世界里糖尿病患者们的现状会有很大不同。我知道别人不幸的遭遇,他们在开源社区中感受不到认同感和自身价值,最终离开了开源。我希望我们可以继续这种讨论,大家都能意识到如果我们不故意打击贡献者,我们可以变得更加温暖,成员们也能感受到认同感,大家的付出也能得到相应的认可。 -OpenAPS 社区的交流和分享给我们提供了一个很好的例子,它说明非技术性的贡献者对于整个社区的成功都是至关重要的。Dana 在现实社会中的关系和交流经历对她为开源社区做出的宣传有着很大的贡献。她为社区在 [DIYPS blog][5] 上写了很多篇文章,她还在 [TEDx Talk][6] 做过一场演讲, 在 [开源大会 (OSCON)][7] 上也演讲过很多次,诸如此类的还有很多。 +OpenAPS 社区的交流和分享给我们提供了一个很好的例子,它说明非技术性的贡献者对于整个社区的成功都是至关重要的。Dana 在现实社会中的关系和交流经历对她为开源社区做出的宣传有着很大的贡献。她为社区在 [DIYPS 博客][5] 上写了很多篇文章,她还在 [TEDx Talk][6] 做过一场演讲, 在 [开源大会 (OSCON)][7] 上也演讲过很多次,诸如此类的还有很多。 “不是每个项目都像 OpenAPS 一样,对患者有那么大的影响,甚至成为患者中间的主流项目。糖尿病社区在项目的沟通中真的做了很多贡献,引来了很多糖尿病患者,也让需要帮助的人们知道了我们的存在。” Dana 现在的目标是帮助其他疾病的患者社区创建项目。她尤其想要把社区成员们学到的工具和技术和其他的患者社区分享,特别是那些想要把项目进一步提升,进行深入研究,或者想和公司合作的社区。 -“听说很多参与项目的患者都听过这样的话,‘你应该申请个专利;你应该拿它开个公司;你应该成立个非营利组织。’但这些都是大事,它们太耗时间了,不仅占据你的工作时间,甚至强行改变你的专业领域。我这样的人并不想做那样的事,我们更倾向于把精力放在壮大其他项目上,以此帮助更多的人。” +“我听说很多参与项目的患者都听过这样的话,‘你应该申请个专利;你应该拿它开个公司;你应该成立个非营利组织。’但这些都是大事,它们太耗时间了,不仅占据你的工作时间,甚至强行改变你的专业领域。我这样的人并不想做那样的事,我们更倾向于把精力放在壮大其他项目上,以此帮助更多的人。” 在此之后,她开始寻找其他不那么占用时间的任务,比如给小孩们写一本书。Dana 在 2017 年进行了这项挑战,她写了本书给侄子侄女,讲解他们婶婶的糖尿病设备是怎样工作的。在她侄女问她“胳膊上的东西是什么”(那是她的血糖监测仪)时,她意识到她不知道怎么和一个小孩子解释糖尿病患者是什么,所以写了[《卡罗琳的机器人亲戚》][8]这本书。 @@ -70,7 +71,7 @@ via: https://opensource.com/article/18/5/dana-lewis-women-open-source-community- 作者:[Taylor Greene][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[Valoniakim](https://github.com/Valoniakim) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fb2b0935bbfbb0860f151766c63662185f7ee1ea Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 27 Dec 2018 19:47:25 +0800 Subject: [PATCH 1105/1143] PUB:20180508 Person with diabetes finds open source and builds her own medical device.md @Valoniakim https://linux.cn/article-10391-1.html --- ...iabetes finds open source and builds her own medical device.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180508 Person with diabetes finds open source and builds her own medical device.md (100%) diff --git a/translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md b/published/20180508 Person with diabetes finds open source and builds her own medical device.md similarity index 100% rename from translated/talk/20180508 Person with diabetes finds open source and builds her own medical device.md rename to published/20180508 Person with diabetes finds open source and builds her own medical device.md From 2502300609c5e1e44ad9134b318cc4bd27e073ef Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 28 Dec 2018 09:03:24 +0800 Subject: [PATCH 1106/1143] translated --- ...sten to the radio at the Linux terminal.md | 60 ------------------- ...sten to the radio at the Linux terminal.md | 60 +++++++++++++++++++ 2 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 sources/tech/20181221 Listen to the radio at the Linux terminal.md create mode 100644 translated/tech/20181221 Listen to the radio at the Linux terminal.md diff --git a/sources/tech/20181221 Listen to the radio at the Linux terminal.md b/sources/tech/20181221 Listen to the radio at the Linux terminal.md deleted file mode 100644 index 1d4b241ccb..0000000000 --- a/sources/tech/20181221 Listen to the radio at the Linux terminal.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Listen to the radio at the Linux terminal) -[#]: via: (https://opensource.com/article/18/12/linux-toy-mplayer) -[#]: author: (Jason Baker https://opensource.com/users/jason-baker) - -Listen to the radio at the Linux terminal -====== -MPlayer is an extremely versatile open source media player that can be surprisingly useful at the Linux command line. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-mplayer.png?itok=6iTm3Xi7) - -You've found your way to our 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. It could be a game or any simple diversion that helps you have fun at the terminal. - -Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. - -There are many ways to listen to music at the command line; if you've got media stored locally, **cmus** is a great option, but there are [plenty of others][1] as well. - -Lots of times when I'm at the terminal, though, I'd really rather just zone out and not pay close attention to picking each song, and let someone else do the work. While I've got plenty of playlists that work for just such a purpose, after a while, even though go stale, and I'll switch over to an internet radio station. - -Today's toy, MPlayer, is a versatile multimedia player that will support just about any media format you throw at it. If MPlayer is not already installed, you can probably find it packaged for your distribution. On Fedora, I found it in [RPM Fusion][2] (be aware that this is not an "official" repository for Fedora, so exercise caution): - -``` -$ sudo dnf install mplayer -``` - -MPlayer has a slew of command-line options to set depending on your situation. I wanted to listen to the local college radio station here in Raleigh ([88.1 WKNC,][3] they're pretty good!), and so after grabbing the streaming URL from their website, all that took to get my radio up and running, no GUI or web player needed, was: - -``` -$ mplayer -nocache -afm ffmpeg http://wknc.sma.ncsu.edu:8000/wknchd1.mp3 -``` - -MPlayer is open source under the GPLv3, and you can find out more about the project and download source code from the project's [website][4]. - -As I mentioned in yesterday's article, I'm trying to use a screenshot of each toy as the lead image for each article, but as we moved into the world of audio, I had to fudge it a little. So today's image was created from a public domain icon of a radio tower using **img2txt** , which is provided by the **libcaca** package. - -Do you have a favorite command-line toy that you we should have included? Our calendar is basically set for the remainder of the series, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. - -Be sure to check out yesterday's toy, [Let you Linux terminal speak its mind][5], and come back tomorrow for another! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/linux-toy-mplayer - -作者:[Jason Baker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/life/16/8/3-command-line-music-players-linux -[2]: https://rpmfusion.org/ -[3]: https://wknc.org/index.php -[4]: http://www.mplayerhq.hu/ -[5]: https://opensource.com/article/18/12/linux-toy-espeak diff --git a/translated/tech/20181221 Listen to the radio at the Linux terminal.md b/translated/tech/20181221 Listen to the radio at the Linux terminal.md new file mode 100644 index 0000000000..9cf4534200 --- /dev/null +++ b/translated/tech/20181221 Listen to the radio at the Linux terminal.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Listen to the radio at the Linux terminal) +[#]: via: (https://opensource.com/article/18/12/linux-toy-mplayer) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +在 Linux 终端收听广播 +====== +MPlayer 是一个多功能的开源媒体播放器,它在 Linux 命令行中非常有用。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-mplayer.png?itok=6iTm3Xi7) + +你已经看到我们为期 24 天的 Linux 命令行玩具日历。如果这是你第一次访问该系列,你可能会问自己什么是命令行玩具。它可能是一个游戏或任何简单的消遣,可以帮助你在终端玩得开心。 + +你们中的一些人之前已经看过我们日历中的各种玩具,但我们希望每个人至少见到一件新事物。 + +在命令行中有很多方法可以听音乐。如果你有本地存储的媒体,**cmus** 是一个很好的选择,但还有[很多其他选择][1]。 + +不过,很多时候,当我在终端的时候,我会走神并且不会注意挑选每首歌,并让其他的来做。虽然为了这个我有很多播放列表,但过了一段时间,即使过时,我也会切换到互联网电台。 + +今天的玩具,MPlayer,是一个多功能的多媒体播放器,几乎可以支持任何你给它的媒体格式。如果尚未安装 MPlayer,你可能会发现它已在你的发行版中打包。在 Fedora 中,我在 [RPM Fusion][2] 中找到了它(请注意,这不是 Fedora 的“官方”仓库,因此请谨慎操作): + +``` +$ sudo dnf install mplayer +``` + +MPlayer 有一系列命令行选项可根据你的具体情况进行设置。我想听 Raleigh 当地的大学广播电台([88.1 WKN][3],这个很棒!),在它们的网站得到流媒体网址之后,像这样就可以让收音机运行了,不需要 GUI 或 Web 播放器: + +``` +$ mplayer -nocache -afm ffmpeg http://wknc.sma.ncsu.edu:8000/wknchd1.mp3 +``` + +MPlayer 是 GPLv3 许可证下的开源软件,你可以从项目的[网站][4]中找到更多关于项目的信息并下载源代码。 + +正如我在昨天的文章中提到的,我试图使用每个玩具的截图作为每篇文章的主图,但是当进入音频世界时,我不得不稍微改改。所以今天的图像是由 **libcaca** 包中的 **img2txt** 绘制的来自公共域的无线电塔图标。 + +你有特别喜欢的命令行小玩具需要我介绍的吗?我们的日历基本上是为这个系列剩余的玩具设置的,但我们仍然很想在新的一年里推出一些很酷的命令行玩具。评论告诉我,我会查看的。如果还有空位置,我会考虑介绍它的。并让我知道你对今天的玩具有何看法。 + +一定要看看昨天的玩具,[让你的 Linux 终端说出来][5],明天记得回来! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-mplayer + +作者:[Jason Baker][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/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/life/16/8/3-command-line-music-players-linux +[2]: https://rpmfusion.org/ +[3]: https://wknc.org/index.php +[4]: http://www.mplayerhq.hu/ +[5]: https://opensource.com/article/18/12/linux-toy-espeak \ No newline at end of file From 690fb205677ee6a6caf4cd309b7ec4bfc94ce595 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 28 Dec 2018 09:09:55 +0800 Subject: [PATCH 1107/1143] translating --- ...1217 4 cool new projects to try in COPR for December 2018.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md b/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md index 9dc8b3390f..0564320363 100644 --- a/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md +++ b/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5272b3fc584b12d41606f169e05e9f243888475c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 28 Dec 2018 23:48:04 +0800 Subject: [PATCH 1108/1143] PRF:20181214 How To Install Rust Programming Language In Linux.md @geekpi --- ...tall Rust Programming Language In Linux.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/translated/tech/20181214 How To Install Rust Programming Language In Linux.md b/translated/tech/20181214 How To Install Rust Programming Language In Linux.md index a2fc9f1382..83346585bf 100644 --- a/translated/tech/20181214 How To Install Rust Programming Language In Linux.md +++ b/translated/tech/20181214 How To Install Rust Programming Language In Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Install Rust Programming Language In Linux) @@ -10,9 +10,7 @@ 如何在 Linux 中安装 Rust 编程语言 ====== -Rust 通常被称为 rust-lang。 - -Rust 是一个由 Mozilla Research 赞助的通用、多范式、现代、跨平台和开源系统编程语言。 +Rust 通常被称为 rust-lang。Rust 是一个由 Mozilla Research 赞助的通用的、多范式、现代的、跨平台和开源系统编程语言。 它旨在实现安全性、速度和并发性等目标。 @@ -30,28 +28,28 @@ info: downloading installer Welcome to Rust! -This will download and install the official compiler for the Rust programming +This will download and install the official compiler for the Rust programming language, and its package manager, Cargo. -It will add the cargo, rustc, rustup and other commands to Cargo's bin +It will add the cargo, rustc, rustup and other commands to Cargo's bin directory, located at: - /home/daygeek/.cargo/bin + /home/daygeek/.cargo/bin This path will then be added to your PATH environment variable by modifying the profile files located at: - /home/daygeek/.profile - /home/daygeek/.bash_profile + /home/daygeek/.profile + /home/daygeek/.bash_profile You can uninstall at any time with rustup self uninstall and these changes will be reverted. Current installation options: - default host triple: x86_64-unknown-linux-gnu - default toolchain: stable - modify PATH variable: yes + default host triple: x86_64-unknown-linux-gnu + default toolchain: stable + modify PATH variable: yes 1) Proceed with installation (default) 2) Customize installation @@ -61,25 +59,25 @@ Current installation options: info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' info: latest update on 2018-12-06, rust version 1.31.0 (abe02cefd 2018-12-04) info: downloading component 'rustc' - 77.7 MiB / 77.7 MiB (100 %) 1.2 MiB/s ETA: 0 s + 77.7 MiB / 77.7 MiB (100 %) 1.2 MiB/s ETA: 0 s info: downloading component 'rust-std' - 54.2 MiB / 54.2 MiB (100 %) 1.2 MiB/s ETA: 0 s + 54.2 MiB / 54.2 MiB (100 %) 1.2 MiB/s ETA: 0 s info: downloading component 'cargo' - 4.7 MiB / 4.7 MiB (100 %) 1.2 MiB/s ETA: 0 s + 4.7 MiB / 4.7 MiB (100 %) 1.2 MiB/s ETA: 0 s info: downloading component 'rust-docs' - 8.5 MiB / 8.5 MiB (100 %) 1.2 MiB/s ETA: 0 s + 8.5 MiB / 8.5 MiB (100 %) 1.2 MiB/s ETA: 0 s info: installing component 'rustc' info: installing component 'rust-std' info: installing component 'cargo' info: installing component 'rust-docs' info: default toolchain set to 'stable' - stable installed - rustc 1.31.0 (abe02cefd 2018-12-04) + stable installed - rustc 1.31.0 (abe02cefd 2018-12-04) Rust is installed now. Great! -To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH +To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH environment variable. Next time you log in this will be done automatically. To configure your current shell run source $HOME/.cargo/env @@ -150,7 +148,7 @@ $ rustup update info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' info: checking for self-updates - stable-x86_64-unknown-linux-gnu unchanged - rustc 1.31.0 (abe02cefd 2018-12-04) + stable-x86_64-unknown-linux-gnu unchanged - rustc 1.31.0 (abe02cefd 2018-12-04) ``` 运行以下命令从系统中删除 Rust 包。 @@ -164,6 +162,7 @@ $ rustup self uninstall ``` $ rm -fr ~/projects ``` + -------------------------------------------------------------------------------- via: https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/ @@ -171,9 +170,9 @@ via: https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/ 作者:[Prakash Subramanian][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/prakash/ -[b]: https://github.com/lujun9972 \ No newline at end of file +[b]: https://github.com/lujun9972 From 2106ca916726019d2f9361cfe8bea927140cff21 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 28 Dec 2018 23:48:39 +0800 Subject: [PATCH 1109/1143] PUB:20181214 How To Install Rust Programming Language In Linux.md @geekpi https://linux.cn/article-10392-1.html --- ...81214 How To Install Rust Programming Language In Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181214 How To Install Rust Programming Language In Linux.md (98%) diff --git a/translated/tech/20181214 How To Install Rust Programming Language In Linux.md b/published/20181214 How To Install Rust Programming Language In Linux.md similarity index 98% rename from translated/tech/20181214 How To Install Rust Programming Language In Linux.md rename to published/20181214 How To Install Rust Programming Language In Linux.md index 83346585bf..b8ba0c1d38 100644 --- a/translated/tech/20181214 How To Install Rust Programming Language In Linux.md +++ b/published/20181214 How To Install Rust Programming Language In Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10392-1.html) [#]: subject: (How To Install Rust Programming Language In Linux) [#]: via: (https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/) [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) From e1c9b5701cdfd175ede6c2bec58aab712901ea32 Mon Sep 17 00:00:00 2001 From: lctt-bot Date: Fri, 28 Dec 2018 17:00:20 +0000 Subject: [PATCH 1110/1143] Revert "Update 20171007 The Most Important Database You-ve Never Heard of.md" This reverts commit 1069f1583177821b6e265713744368a0a485a556. --- ...0171007 The Most Important Database You-ve Never Heard of.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/sources/talk/20171007 The Most Important Database You-ve Never Heard of.md b/sources/talk/20171007 The Most Important Database You-ve Never Heard of.md index cebfa1a959..f429aba373 100644 --- a/sources/talk/20171007 The Most Important Database You-ve Never Heard of.md +++ b/sources/talk/20171007 The Most Important Database You-ve Never Heard of.md @@ -1,5 +1,3 @@ -zs19940317翻译中 - The Most Important Database You've Never Heard of ====== In 1962, JFK challenged Americans to send a man to the moon by the end of the decade, inspiring a heroic engineering effort that culminated in Neil Armstrong’s first steps on the lunar surface. Many of the fruits of this engineering effort were highly visible and sexy—there were new spacecraft, new spacesuits, and moon buggies. But the Apollo Program was so staggeringly complex that new technologies had to be invented even to do the mundane things. One of these technologies was IBM’s Information Management System (IMS). From 20abb626839e944e7ee3fa68c0fc1c701113ced3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 29 Dec 2018 09:15:31 +0800 Subject: [PATCH 1111/1143] translated --- sources/tech/20181222 A Tale of HTTP-2.md | 75 -------------------- translated/tech/20181222 A Tale of HTTP-2.md | 75 ++++++++++++++++++++ 2 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 sources/tech/20181222 A Tale of HTTP-2.md create mode 100644 translated/tech/20181222 A Tale of HTTP-2.md diff --git a/sources/tech/20181222 A Tale of HTTP-2.md b/sources/tech/20181222 A Tale of HTTP-2.md deleted file mode 100644 index 897fd83fc5..0000000000 --- a/sources/tech/20181222 A Tale of HTTP-2.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A Tale of HTTP/2) -[#]: via: (https://veronneau.org/a-tale-of-http2.html) -[#]: author: (Louis-Philippe Véronneau https://veronneau.org/) - -A Tale of HTTP/2 -====== - -Around a month ago, someone mentioned the existence of [HTTP/2][1] in an IRC channel I lurk in. For some reason, I had never heard of it and some of the features of this new protocol (like mutiplexing requests without having to open multiple TCP connections) seemed cool. - -To be honest, I had just finished re-writing the Puppet code that manages our backup procedures and enabling HTTP/2 seemed like a productive way to procrastinate before moving on to an another large project. How hard could this be? - -Turns out it took me around 25 hours of work... Sit back and put on comfortable slippers, for this is a tale of HTTP/2! - -[![The Yule Log][2]][3] - -### Cursed Be the HTTP/1.1 - -When I first looked up how to enable HTTP/2 on Apache it seemed a pretty simple task. The documentation mentioned loading the `http2` module and making sure to prioritise the new protocol via a configuration file like this one: - -``` -Protocols h2 h2c http/1.1 - -H2Push on -H2PushPriority core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated after -H2PushPriority text/css before -H2PushPriority image/jpeg after 32 -H2PushPriority image/png after 32 -H2PushPriority application/javascript interleaved -``` - -This would of course have been too easy. Even if everything in Apache was set up properly, websites kept being served as HTTP/1.1. I was obviously doing something right though, since my websites were now sending a new HTTP header: `Upgrade: h2, h2c`. - -After wasting a good deal of time debugging TLS ciphers (HTTP/2 is [incompatible with TLS 1.1][4]), I finally found out the problem was that we weren't using the right multi-processing module for Apache. - -Turns out Apache won't let you serve HTTP/2 while using `mpm_prefork` (the default MPM), as it is not supported by `mod_http2`. Even though there are two other MPM you can use with Apache, only `mpm_prefork` supports `mod_php`. Suddenly, adding support for HTTP/2 meant switching all our webapps built in PHP to PHP-FPM... - -### Down the Rabbit Hole - -![A clip from Alice in Wonderlands][5] - -For the longest time, a close friend has been trying to convince me of the virtues of [PHP-FPM][6]. As great as it looked on paper, I never really did anything about it. It seemed so ... complicated. Regular ol' `mod_php` did the trick just fine and other things required my attention. - -This whole HTTP/2 thing turned out to be the perfect excuse for me to dive into it after all. Once I understood how FPM pools worked, it was actually pretty easy to set up. Since I had to rewrite the Puppet profiles we're using to deploy websites, also I took that opportunity to harden a bunch of things left and right. - -PHP-FPM let's you run websites under different Unix users for added separation. On top of that, I decided it was time for PHP code on our servers to be ran in read-only mode and had to tweak a bunch of things for our Wordpress, Nextcloud, KanBoard and Drupal instances to stop complaining about it. - -After too much time passed automating tasks in Puppet, I finally was able to turn off `mod_php` and `mpm_prefork` everywhere and to enable `mpm_event` and `mod_http2`. The speed bonus offered by PHP-FPM and HTTP/2 is nice, but more than anything I'm happy this whole ordeal forced me to harden the way our Apache servers deal with PHP. - -![Victory!][7] - --------------------------------------------------------------------------------- - -via: https://veronneau.org/a-tale-of-http2.html - -作者:[Louis-Philippe Véronneau][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://veronneau.org/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/HTTP/2 -[2]: https://veronneau.org/media/blog/2018-12-22/yule_log.jpg (The Yule Log) -[3]: https://commons.wikimedia.org/wiki/File:The_Yule_Log.jpg -[4]: https://http2.github.io/http2-spec/#TLSUsage -[5]: https://veronneau.org/media/blog/2018-12-22/mod_php.gif (A clip from Alice in Wonderlands) -[6]: https://wiki.apache.org/httpd/PHP-FPM -[7]: https://veronneau.org/media/blog/2018-12-22/victory.png (Victory!) diff --git a/translated/tech/20181222 A Tale of HTTP-2.md b/translated/tech/20181222 A Tale of HTTP-2.md new file mode 100644 index 0000000000..9fcaddfad9 --- /dev/null +++ b/translated/tech/20181222 A Tale of HTTP-2.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A Tale of HTTP/2) +[#]: via: (https://veronneau.org/a-tale-of-http2.html) +[#]: author: (Louis-Philippe Véronneau https://veronneau.org/) + +一个 HTTP/2 的故事 +====== + +大约一个月前,有人在我所在的 IRC 频道中提到了 [HTTP/2][1]。由于某种原因,我从未听说过它,而且新协议的一些功能(比如无需打开多个 TCP 连接就能复用请求)似乎很酷。 + +说实话,我刚刚重写了管理我们备份程序的 Puppet 代码,启用 HTTP/2 似乎是一种转向另一个大型项目之前有效的拖延方式。这有多难? + +结果我花了大约 25 个小时来完成。坐下来穿上舒适的拖鞋,因为这是一个 HTTP/2 的故事! + +[![The Yule Log][2]][3] + +### 被诅咒的 HTTP/1.1 + +当我第一次看到如何在 Apache 上启用 HTTP/2 时,这似乎是一项非常简单的任务。文档提到加载 `http2` 模块并通过如下配置文件确保新协议优先: + +``` +Protocols h2 h2c http/1.1 + +H2Push on +H2PushPriority core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated after +H2PushPriority text/css before +H2PushPriority image/jpeg after 32 +H2PushPriority image/png after 32 +H2PushPriority application/javascript interleaved +``` + +这当然很容易。即使 Apache 中的所有内容都已正确设置,网站仍然可以使用 HTTP/1.1。不过,显然我做得没错,因为我的网站现在发送了一个新的 HTTP 头:`Upgrade: h2, h2c`。 + +在浪费了大量时间调试 TLS 密钥(HTTP/2 [与 TLS 1.1 不兼容][4])之后,我终于发现问题是没有使用正确的 Apache 多进程处理模块。 + +事实证明,在使用 `mpm_prefork`(默认 MPM)时,Apache 不会使用 HTTP/2,因为 `mod_http2` 不支持它。尽管 Apache 还有两个其他的 MPM,但只有 `mpm_prefork` 支持 `mod_php`。突然之间,添加对 HTTP/2 的支持意味着我们将要把所有的 PHP 网站切换到 PHP-FPM。 + +### 掉进兔子洞 + +![A clip from Alice in Wonderlands][5] + +在很长一段时间里,一位好友一直试图让我相信 [PHP-FPM][6] 的优点。虽然纸上看起来很好, 但我从来没有真正试过。它看起来很复杂。常规的 `mod_php` 做得很好,还有其他事情需要我注意。 + +事实上,这次的 HTTP/2 事件是让我钻研它的一个契机。在我理解了 FPM 池的工作原理后,它实际上很容易设置。由于我不得不重写我们用于部署网站的 Puppet 配置文件,我也借此机会巩固了一堆东西。 + +PHP-FPM 允许你在不同的 Unix 用户下运行网站来增加隔离性。最重要的是,我决定是时候让我们服务器上的 PHP 代码以只读模式运行,并且不得不为我们的 Wordpress、Nextcloud、KanBoard 和 Drupal 实例调整一些东西来减少报错。 + +过了很长时间通过 Puppet 的自动任务后,我终于能够在任何地方关闭 `mod_php` 和 `mpm_prefork` 并启用 `mpm_event` 和 `mod_http2`。PHP-FPM 和 HTTP/2 带来的速度提升不错,但更让我感到高兴的是这次磨练增强了我们的 Apache 处理 PHP 的能力。 + +![Victory!][7] + +-------------------------------------------------------------------------------- + +via: https://veronneau.org/a-tale-of-http2.html + +作者:[Louis-Philippe Véronneau][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://veronneau.org/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/HTTP/2 +[2]: https://veronneau.org/media/blog/2018-12-22/yule_log.jpg (The Yule Log) +[3]: https://commons.wikimedia.org/wiki/File:The_Yule_Log.jpg +[4]: https://http2.github.io/http2-spec/#TLSUsage +[5]: https://veronneau.org/media/blog/2018-12-22/mod_php.gif (A clip from Alice in Wonderlands) +[6]: https://wiki.apache.org/httpd/PHP-FPM +[7]: https://veronneau.org/media/blog/2018-12-22/victory.png (Victory!) \ No newline at end of file From dae9dd71ed6a29d87ce13b6562dbc4cfcd436cbc Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 29 Dec 2018 09:35:14 +0800 Subject: [PATCH 1112/1143] translating --- sources/tech/20181217 Working with tarballs on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181217 Working with tarballs on Linux.md b/sources/tech/20181217 Working with tarballs on Linux.md index 29d7b6002f..2c95f1038f 100644 --- a/sources/tech/20181217 Working with tarballs on Linux.md +++ b/sources/tech/20181217 Working with tarballs on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3f166ef001f9f6f533a77d659caec64dce028985 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Sat, 29 Dec 2018 18:00:19 +0800 Subject: [PATCH 1113/1143] Translating --- ...81222 Top 11 best Image Viewer for Ubuntu and other Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md b/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md index 5aea9702e7..071ffa9ab3 100644 --- a/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md +++ b/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zhs852) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3912dc35b59ba84b87e687765d3e64427911385b Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sat, 29 Dec 2018 20:42:27 +0800 Subject: [PATCH 1114/1143] Translating by MjSeven --- sources/tech/20171227 YAML- probably not so great after all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171227 YAML- probably not so great after all.md b/sources/tech/20171227 YAML- probably not so great after all.md index ed853ca697..adeab60bd2 100644 --- a/sources/tech/20171227 YAML- probably not so great after all.md +++ b/sources/tech/20171227 YAML- probably not so great after all.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From aae8930b83a20ad2a99e270c8777dce34a414a04 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 29 Dec 2018 21:17:50 +0800 Subject: [PATCH 1115/1143] PRF:20181221 Listen to the radio at the Linux terminal.md @geekpi --- ...21 Listen to the radio at the Linux terminal.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/translated/tech/20181221 Listen to the radio at the Linux terminal.md b/translated/tech/20181221 Listen to the radio at the Linux terminal.md index 9cf4534200..ffc4e4357e 100644 --- a/translated/tech/20181221 Listen to the radio at the Linux terminal.md +++ b/translated/tech/20181221 Listen to the radio at the Linux terminal.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Listen to the radio at the Linux terminal) @@ -9,14 +9,16 @@ 在 Linux 终端收听广播 ====== -MPlayer 是一个多功能的开源媒体播放器,它在 Linux 命令行中非常有用。 + +> MPlayer 是一个多功能的开源媒体播放器,它在 Linux 命令行中非常有用。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-mplayer.png?itok=6iTm3Xi7) 你已经看到我们为期 24 天的 Linux 命令行玩具日历。如果这是你第一次访问该系列,你可能会问自己什么是命令行玩具。它可能是一个游戏或任何简单的消遣,可以帮助你在终端玩得开心。 -你们中的一些人之前已经看过我们日历中的各种玩具,但我们希望每个人至少见到一件新事物。 +你们中的一些人之前已经看过我们日历中的各种玩具,但我们希望每个人至少见到一件新玩具。 -在命令行中有很多方法可以听音乐。如果你有本地存储的媒体,**cmus** 是一个很好的选择,但还有[很多其他选择][1]。 +在命令行中有很多方法可以听音乐。如果你有本地存储的媒体,`cmus` 是一个很好的选择,但还有[很多其他选择][1]。 不过,很多时候,当我在终端的时候,我会走神并且不会注意挑选每首歌,并让其他的来做。虽然为了这个我有很多播放列表,但过了一段时间,即使过时,我也会切换到互联网电台。 @@ -47,7 +49,7 @@ via: https://opensource.com/article/18/12/linux-toy-mplayer 作者:[Jason Baker][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/) 荣誉推出 @@ -57,4 +59,4 @@ via: https://opensource.com/article/18/12/linux-toy-mplayer [2]: https://rpmfusion.org/ [3]: https://wknc.org/index.php [4]: http://www.mplayerhq.hu/ -[5]: https://opensource.com/article/18/12/linux-toy-espeak \ No newline at end of file +[5]: https://opensource.com/article/18/12/linux-toy-espeak From 93ccb28cc01eda7fe88bc9cc5c806d9cdd113dd9 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Sat, 29 Dec 2018 21:18:28 +0800 Subject: [PATCH 1116/1143] Translated --- ...Image Viewer for Ubuntu and other Linux.md | 274 ++++++++---------- 1 file changed, 128 insertions(+), 146 deletions(-) diff --git a/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md b/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md index 071ffa9ab3..3125ef4db3 100644 --- a/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md +++ b/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md @@ -7,303 +7,285 @@ [#]: via: (https://itsfoss.com/image-viewers-linux/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Top 11 best Image Viewer for Ubuntu and other Linux +Linux 下最棒的 11 个图片查看器 ====== -It is probably a good idea to stick with the default system image viewer unless you want a specific feature (that’s missing) or if you crave for better user experience. +如果不是因为系统自带的图片查看器没有你想要的功能,或者你想要更棒的体验,你大概不会想切换到其它图片查看器吧。 -However, if you like to experiment, you may try out different image viewers. You could end up loving the new user experience of viewing the images or get hooked on to the extra features offered. +不过,如果你喜欢折腾,你可能就会想用不同的图片查看器了吧。我猜最终你会被新图片查看器的全新用户体验或特色功能所吸引的。 -In this article, we have mentioned every kind of image viewers ranging from the simplest to the most advanced tool available for Ubuntu or any other Linux distro. +在本篇文章中,无论是简单的还是复杂的、无论是为 Ubuntu 准备的还是其它 Linux 发行版准备的,我们都有提到。 -### Best Image Viewers for Linux +### Linux 下最棒的图片查看器 -![Best image viewers for Ubuntu and other Linux distributions][1] +![Ubuntu 或其它 Linux 发行版适用的最棒的图片查看器][1] -**Note:** You should be able to find these image viewers listed in your software center or AppCenter. If you don’t find it there, we’ve mentioned the instructions for manual installation as well. +**注意:** 在准备安装一个图片查看器时,请前往您系统中预先安装的软件商店中查找。如果您没有任何软件商店或无法在软件商店中找到它,请手动执行我们给出的命令。 #### 1. Nomacs -![nomacs image viewer][2] +![Nomacs 图片查看器][2] -**What’s good about it?** +**它有什么特点?** - * Simple & Fast UI - * Image adjustment tools (color & size) - * Geolocation of the image - * Metadata information panel - * LAN Synchronization - * Fullscreen mode + * 轻快 + * 内建图像调整工具(可以调整色彩和大小) + * 拍摄位置信息 + * 元数据调节器 + * 局域网同步 + * 全屏模式 +Nomacs 是一款自由软件。虽然没有什么出众的功能,但是它的兼容性还不错,可以支持许多常见格式。 +它的界面超级简单,但是提供了简单的图片编辑功能(可以调整色彩、亮度、大小)。除此之外,它还支持全屏模式、元数据调整等功能。 -A free and open source image viewer that does not come baked with any fancy features. However, Nomacs does support most of the common image file formats if you want to use it. +**我该如何安装它?** -The user interface is very simple but it does offer some essential features for image adjustment (color, brightness, resize, crop, & cut). In addition to that, it also supports fullscreen mode, histogram, and a lot of different panels that you can toggle for metadata, edit history, and more such information. - -**How do I install it?** - -You can find it listed in the software center/AppCenter for easy installation. If you want to install it via terminal, you can take a look at their [GitHub page][3] or type in the command below: +简单起见,你可以在各种软件中心中安装它。如果你想通过终端安装它,请参见它的 [GitHub 界面][3] 。或者,在使用 APT 包管理的系统中使用如下命令安装: ``` sudo apt install nomacs ``` -#### 2. Eye Of Gnome -![eye of gnome][4] +#### 2. Gnome 之眼 +![Gnome 之眼][4] -**What’s good about it?** +**它有什么特点?** - * A dead simple image viewer - * Slideshow style (if that’s what you like) - * An image viewer tailored for GNOME desktop environment + * 极其简单的图像查看器 + * 幻灯片视图 + * 为 GNOME 量身打造的图片查看器 +这是一款经典的图片查看器,它在数年前作为 GNOME 项目的一部分被开发出来。不过需要注意的是,对它的维护目前已经不是很活跃了。不过它仍能在最新版 Ubuntu LTS 和部分 Linux 发行版中正常工作。 +如果你需要一个简单、有幻灯片视图并可以在侧栏看到元数据的图像查看器,Gnome 之眼是最佳选择。 -This is a classic image viewer developed as a part of The GNOME Project a lot of years ago. Do note that this isn’t actively maintained anymore. But, it still works on Ubuntu’s latest LTS release and several other Linux distros. +**我该如何安装它?** -If you want a dead simple image viewer where you browse through the images in a slideshow-type UI and get the meta info in the sidebar, Eye of GNOME should be your choice. One of the best for GNOME desktop environment! - -**How do I install it?** - -To manually install it on Ubuntu (or Ubuntu-based Linux distros) type in the following command: +若要在 Ubuntu 及基于 Ubuntu 的 Linux 发行版上安装它,仅需一条命令: ``` sudo apt install eog ``` -For other distros and source, you should follow the [GitHub page.][5] +如果你想在其它发行版中安装它,请参见 [项目的 GitHub 页面][5] 。 -#### 3. Eye Of MATE Image Viewer +#### 3. EOM -![eye of mate image viewer][6] +![EOM 图像查看器][6] -**What’s good about it?** +**它有什么特点?** - * A simple image viewer - * Plugins supported - * An image viewer tailored for MATE desktop environment + * 简洁 + * 可扩展 + * 为 MATE 量身打造的图片查看器 +另一个基本功能齐全,支持幻灯片视图和图像旋转的查看器。 +虽然它没什么特色功能,但它支持大部分的图像格式,并且还能处理大体积的图像。 -Yet another simple image viewer with the basic functionalities of slideshow view and rotating images. +**我该如何安装它?** -Even if doesn’t support any image manipulation feature, it does support numerous image file formats and can handle big image files. - -**How do I install it?** - -For Ubuntu/Ubuntu-based distros, type in the following command: +若要在 Ubuntu 及基于 Ubuntu 的 Linux 发行版上安装它,仅需一条命令: ``` sudo apt install eom ``` -If you need help for other distros and the source, follow their [GitHub page][7]. +如果你想在其它发行版中安装它,请参见 [项目的 GitHub 页面][7] 。 #### 4. Geeqie -![geeqie image viewer][8] +![Geeqie 图像查看器][8] -**What’s good about it?** +**它有什么特点?** - * A flexible image manager that supports plugins (you’ll find other image viewers supported as well) - * Information about the color profile + * 可扩展 + * 色彩信息显示 +Geeqie 是一个令用户印象深刻的图片管理/查看器。他支持将其它查看器作为扩展使用,不过它并不提供任何对图像操作的工具。 +如果你希望获取图像的颜色信息、元数据,或是查看/管理一堆图片,它将会是一个不错的选择。 -Geeqie is an impressive image manager and viewer. It supports other image viewers as plugins but does not offer any image manipulation tools. +**我该如何安装它?** -If you need to know the color profile, image info, and manage/view a collection of images. It should be a good choice for that. - -**How do I install it?** - -Type in the terminal: +在终端输入: ``` sudo apt install geeqie ``` -For the source, you can refer the [GitHub page][9]. +若想查看它的源代码,请前往 [它的 GitHub 主页][9]。 -#### 5. gThumb Image Viewer +#### 5. gThumb -![gthumb image viewer][10] +![gThumb 图片查看器][10] -**What’s good about it?** +**它有什么特点?** - * An all-in-one image viewer with the ability to manage, edit and view the images - * Reset EXIF orientation - * Convert image formats - * Find duplicate images + * 多种功能(查看、编辑和管理) + * 可清除 EXIF 信息 + * 图像格式转换 + * 查找重复的图像 +gThumb 会让你眼前一亮,因为它有很多功能。它的查看/管理界面和编辑工具(裁剪、颜色编辑等等)将会给你留下很深的印象。 +你甚至可以为图像添加评论或清除它的 EXIF 信息。它使得你可以方便地编辑或转码图像。 -gThumb is an amazing image viewer with a lot of features. You get an impressive user interface to view/manage your images along with the basic image manipulation tools (crop, resize, color, and so on.) +**我该如何安装它?** -You can also add comments to an image or reset the EXIF orientation info. It also gives you the ability to find duplicate images and convert image formats. - -**How do I install it?** - -You can enter this command in the terminal: +你可以在终端中输入这条命令: ``` sudo apt install gthumb ``` -If that doesn’t work, head to the [GitHub page][11] for more info. +输了没用?请参阅 [项目 GitHub 主页][11] 来获取帮助。 #### 6. Gwenview -![gwenview image viewer][12] +![Gwenview 图像查看器][12] -**What’s good about it?** +**它有什么特点?** - * A basic image viewer with common image manipulation tools to rotate and resize - * Feature extension using KIPI plugins + * 简单,有基础图像编辑功能(旋转、调整大小) + * 可使用 KIPI 插件扩展 +Gwenview 又是一个基本的图像查看器,它为 KDE 量身定做。不过这并不影响你在其它桌面环境中使用它。 +如果你使用 Konqueror 浏览器,你可以将 Gwenview 作为它的内嵌图片浏览器。你也可以为图片添加评论。此外,它还支持 [KIPI][13] 插件。 -Gwenview is just another basic image viewer tailored for KDE desktop environment. However, you can install it on other desktop environments as well. +**我该如何安装它?** -If you utilize the Konqueror web browser, you can use it as an embedded image viewer. Here, you can add comments/description to the image as well. In addition, it supports [KIPI][13] plugins. - -**How do I install it?** - -Type the following in the terminal to install it: +你可以在终端中输入这条命令: ``` sudo apt install gwenview ``` -For the source, check out their [GitHub page][14]. +若想查看它的源代码,请前往 [它的 GitHub 主页][14]。 #### 7. Mirage -![mirage image viewer][15] +![Mirage 图像查看器][15] -**What’s good about it?** +**它有什么特点?** - * Customizable interface even it is a basic UI - * Basic image manipulation tools - * Command-line access + * 可定制的 UI + * 基本图像编辑工具 + * 可在命令行使用 +如果你想要一个可在命令行中访问、支持全屏和幻灯片视图、带有基础编辑工具以及可定制 UI 的查看器,Mirage 是个不二之选。 +它是一个非常快速且兼容性优良的查看器。它支持包括 png、jpg、svg、xpm、gif、bmp 和 tifff 在内的多种图像格式。 -If you want a decent image viewer along with the ability to access it via command line, a fullscreen mode, slideshow mode, basic editing tools to resize/crop/rotate/flip, and a configurable interface – Mirage would be the simplest option. +**我该如何安装它?** -It is a very fast and capable image viewer that supports a lot of image formats that include png, jpg, svg, xpm, gif, bmp, and tifff. - -**How do I install it?** - -You need to type in the following: +你需要执行: ``` sudo apt install mirage ``` -For the source code and other installation instructions, refer the [GitHub page][16]. +访问 [项目 GitHub 页面][16] 来获取更多信息。 #### 8. KPhotoAlbum -![][17] +![KPhotoAlbum][17] -**What’s good about it?** +**它有什么特点?** - * Perfect image manager to tag and manage the pictures - * Demo databases - * Image compression - * Merge/Remove images to/from Stack + * 为图像添加标签 + * 数据库支持 + * 图片比较 + * 合并/移除一堆图像 +确切地说,KPhotoAlbum 其实不仅仅是一款图像查看器,它还能为图像添加标签并管理图像。 +你可以用它来比较图片以及使用标签搜索你的图片。你还可以使用幻灯片视图来观看图片。 -KPhotoAlbum is not exactly a dedicated image viewer but a photo manager to tag and manage the pictures you’ve got. +**我该如何安装它?** -You can opt for slideshows to view the image along with the ability to compress images and search them using the labels/tags. - -**How do I install it?** - -You can install it via the terminal by typing in: +在终端中输入: ``` sudo apt kphotoalbum ``` -In either case, you can check for the [official instructions on their website][18] to get it installed on your Linux distro. +跟从 [官网上的指引][18] 来在其它 Linux 发行版中安装它。 #### 9. Shotwell -![shotwell][19] +![Shotwell][19] -**What’s good about it?** +**它有什么特点?** - * Red-eye correction tool - * Upload photos to Facebook, Flickr, etc. - * Supports RAW file formats as well + * 红眼消除工具 + * 将照片上传到 Facebook 或 Flickr 等社交网络中 + * 支持原始格式(RAW)的图片 +Shotwell 是一个多功能照片管理器。在此,你能查看或管理你的照片。虽然它没带有许多图像编辑工具,但是你还是可以裁剪和调整亮度的。 +**我该如何安装它?** -Shotwell is a feature-rich photo manager. You can view and manage your photos. Although you do not get all the basic image manipulation tools baked in it – you can easily crop and enhance your photos in a single click (auto brightness/contrast adjustments). - -**How do I install it?** - -Go to the terminal and enter the following (Ubuntu/Ubuntu-based distros): +在终端中执行以下命令 (Ubuntu 及其衍生版本): +``` sudo apt install shotwell +``` -For more information, check out their [GitHub page][20]. +若想获取更多信息,请 [前往它的 GitHub 界面][20]。 #### 10. Ristretto -![ristretto][21] +![Ristretto][21] -**What’s good about it?** +**它有什么特点?** - * A dead simple image viewer - * Fullscreen mode & Slideshow + * 极其简单 + * 全屏模式 + * 幻灯片视图 +简易的图像查看器。它能查看、全屏查看、缩放查看或以幻灯片视图查看图片。 +它是为 Xfce 定制的,但你仍然可以在其它任何地方安装它。 -A very straightforward image viewer where you just get the ability to zoom, view in fullscreen mode and view the images as a slideshow. +**我该如何安装它?** -It is tailored for Xfce desktop environment – but you can install it anywhere. - -**How do I install it?** - -Even though it’s built for Xfce desktop environment, you can install it on any Ubuntu/Ubuntu-based distro by typing the following command in the terminal: +即使它是为 Xfce 桌面环境构建的,你仍能在其它地方安装它。对 Ubuntu 及其衍生发行版,请执行: ``` sudo apt install ristretto ``` + #### 11. digiKam -![digikam image viewer][22] +![digiKam 图像查看器][22] -**What’s good about it?** +**它有什么特点?** - * An all-in-one image viewer with advanced photo management features (editing/managing/viewing) - * Batch Queue Manager - * [Light Table][23] + * 带有高级图像管理功能(查看/管理/编辑)的多合一查看器 + * 可以进行批处理 + * 带有 [Light Table 功能][23] +digiKam 是一个带有多种图像编辑功能的高级照片管理器。你可以使用 SQLite 或 MySQL 来配置它的数据库。 +为了提升你的看图体验,你可以在预览图片时加载低画质的图片。这样一来,即使你有一大堆图片,它也丝滑般流畅。不仅如此,你还可以通过 Google、Facebook、Imgur 等来导入/导出图片。如果你希望使用一个超多功能的查看器,请务必试试这个 digiKam。 -digiKam is an advanced photo manager with some additional image manipulation tools. You get the ability to configure the database using SQLite or MySQL. +**我该如何安装它?** -To enhance your experience of viewing images, it lets you choose the reduced version of images while you preview them. So, that becomes super fast even if you have a lot of images. You get several import/export options via Google, Facebook, Imgur, and so on. If you want a feature-rich image viewer, this is the one you should have installed. - -**How do I install it?** - -Type in the following command: +执行这条命令: ``` sudo apt install digikam ``` -For more information, visit their [GitHub page][24]. +访问 [项目 GitHub 页面][24] 来获取更多信息。 -### Wrapping Up +### 尾声 -So, no matter whether you want a different user experience or a rich set of features and powerful tools to manage your photos – there’s something everyone. +总的来说,无论你想要不同的用户体验、丰富的功能还是强大的管理工具,上面总有适合你的工具。 -Which image viewer do you prefer to use? Is it the system’s default viewer? +你更喜欢哪个图像查看器呢?它是系统自带的吗? -Let us know in the comments below. +欢迎前往原文的评论区留下你的答案。 -------------------------------------------------------------------------------- @@ -311,7 +293,7 @@ via: https://itsfoss.com/image-viewers-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zhs852](https://github.com/zhs852) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dd2c61e1207d9093f8ae727d62853a601766b40d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 29 Dec 2018 21:18:33 +0800 Subject: [PATCH 1117/1143] PUB:20181221 Listen to the radio at the Linux terminal.md @geekpi https://linux.cn/article-10393-1.html --- .../20181221 Listen to the radio at the Linux terminal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181221 Listen to the radio at the Linux terminal.md (98%) diff --git a/translated/tech/20181221 Listen to the radio at the Linux terminal.md b/published/20181221 Listen to the radio at the Linux terminal.md similarity index 98% rename from translated/tech/20181221 Listen to the radio at the Linux terminal.md rename to published/20181221 Listen to the radio at the Linux terminal.md index ffc4e4357e..431f579460 100644 --- a/translated/tech/20181221 Listen to the radio at the Linux terminal.md +++ b/published/20181221 Listen to the radio at the Linux terminal.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10393-1.html) [#]: subject: (Listen to the radio at the Linux terminal) [#]: via: (https://opensource.com/article/18/12/linux-toy-mplayer) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) From 3c3cc81a676652e65506accabe95e998a8486db5 Mon Sep 17 00:00:00 2001 From: Hansong Zhang Date: Sat, 29 Dec 2018 21:19:25 +0800 Subject: [PATCH 1118/1143] Move file to translated --- ...0181222 Top 11 best Image Viewer for Ubuntu and other Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md (100%) diff --git a/sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md b/translated/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md similarity index 100% rename from sources/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md rename to translated/tech/20181222 Top 11 best Image Viewer for Ubuntu and other Linux.md From 2cb2643f4fcda8e0d73cf3f14f584066789995b1 Mon Sep 17 00:00:00 2001 From: yuqi Date: Sat, 29 Dec 2018 22:14:30 +0800 Subject: [PATCH 1119/1143] translated and proofread by yuqi --- .../tech/20171111 A CEOs Guide to Emacs.md | 116 ++++++++++-------- 1 file changed, 63 insertions(+), 53 deletions(-) diff --git a/translated/tech/20171111 A CEOs Guide to Emacs.md b/translated/tech/20171111 A CEOs Guide to Emacs.md index d7a5f8ad0d..9e7f9290d4 100644 --- a/translated/tech/20171111 A CEOs Guide to Emacs.md +++ b/translated/tech/20171111 A CEOs Guide to Emacs.md @@ -1,73 +1,73 @@ -一位 CEO 的 Emacs 指南 +一位 CEO 的 Emacs 指南(备选:CEO 的 Emacs 秘籍) =========== -几年前,不,是几十年前,我就在用 Emacs。不论是码代码、编写文档,还是管理邮件和日程,我都用这个编辑器或者是说操作系统,而且我还乐此不疲。许多年过去了,我也转向了其他更新、更好的工具。结果,我已经忘了如何在不用鼠标的情况下来浏览文件。大约三个月前,我意识到我在应用程序和计算机之间切换上耗费了大量的时间,于是就决定再试一次 Emacs。这是个很正确的决定,原因有以下几个。其中包括了 `.emacs` 和 Dropbox 的技巧,可以让你建立一个良好的、可移植的环境。 +几年前,不,是几十年前,我就在用 Emacs。不论是码代码、编写文档,还是管理邮件和日程,我都用这个编辑器,或者是说操作系统,而且我还乐此不疲。许多年过去了,我也转向了其他更新、更好的工具。结果,就连最基本的文件浏览,我都已经忘了在不用鼠标的情况下该怎么操作。大约三个月前,我意识到我在应用程序和计算机之间切换上耗费了大量的时间,于是我决定再次使用 Emacs。这是个很正确的决定,原因有以下几个。其中包括用 `.emacs` 和 Dropbox 来搭建一个良好的、可移植的环境的一些技巧。 -对于那些还没用过 Emacs 的人来说,你可能会讨厌它,但也可能喜欢上它。它有点像一个房子大小的鲁布·戈德堡机械Rube Goldberg machine,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键短语是“乍一看”。一旦你了解了 Emacs,你就会意识到它其实是一种可以作为发动机的热核烤面包机……好吧,你可以用来对文字做什么都可以。当考虑到你的计算生活在很大程度上与文本有关时,这是一个相当大胆的声明,真的很大胆。 +对于那些还没用过 Emacs 的人来说,Emacs 会让你爱恨交加。它有点像一个房子大小的鲁布·戈德堡机械Rube Goldberg machine,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键词是“乍一看”。一旦你了解了 Emacs,你就会意识到它其实是一台可以当发动机用的的热核烤面包机……好吧,只是文本处理的所有事情。当考虑到你计算机的使用周期在很大程度上都是与文本有关时,这是一个相当大胆的声明。大胆,但却是真的。 -也许对我来说更重要的是,它是我曾经使用过的一个应用程序,并让我觉得我真正的拥有它,而不是把我塑造成一个匿名的“用户”,就好像位于 [Soma][30](LCTT 译注:旧金山的一个街区)或雷蒙德(LCTT 译注:微软总部所在地)附近某个高档办公室的产品营销部门把钱作为明确的目标一样。现代生产力和创作应用程序(如 Pages 或 IDE)就像碳纤维赛车,它们装备得很好,也很齐全。而 Emacs 就像一盒经典的 [Campagnolo][31] (LCTT 译注:世界上最好的三个公路自行车套件系统品牌之一)零件和一个漂亮的自行车牵引式钢框架,但缺少曲柄臂和刹车杆,你必须在网上某个小众文化中找到它们。第一点是它是更快更完整的。第二点就是它会给你带来无尽的快乐或烦恼,这取决于你自己,而且会一直持续到你生命的最后一天。我是那种在找到一堆老古董或用 `Emacs Lisp` 配置编辑器时同样感到高兴的人,具体情况因人而异。 +也许对我来说更重要的是,Emacs 是我曾经使用过的一个应用,并让我觉得我真正的拥有它,而不是把我塑造成一个匿名的“用户”,就好像位于 [Soma][30](LCTT 译注:旧金山的一个街区)或雷蒙德(LCTT 译注:微软总部所在地)附近某个高档办公室的产品营销部门把钱作为明确的目标一样。现代生产力和创作应用程序(如 Pages 或 IDE)就像碳纤维赛车,它们装备得很好,也很齐全。而 Emacs 就像一盒经典的 [Campagnolo][31] (LCTT 译注:世界上最好的三个公路自行车套件系统品牌之一)零件和一个漂亮的自行车牵引式钢框架,但缺少曲柄臂和刹车杆,你必须在网上某个小众文化中找到它们。前者更快而且很完整,后者是无尽的快乐或烦恼的源泉,当然这取决于你自己,而且这种快乐或烦恼会伴随到你死。我就是那种在找到一堆老古董或用 `Emacs Lisp` 配置编辑器时会感到高兴的人,具体情况因人而异。 ![1933 steel bicycle](https://www.fugue.co/hubfs/Imported_Blog_Media/bicycle-1.jpg) *一辆我还在骑的1933年产的钢制自行车。你可以看看框架管差别: [https://www.youtube.com/watch?v=khJQgRLKMU0][6]* -这可能给人一种 Emacs 已经过气或过时的印象。但它不是,它是强大和永恒的,只要你耐心地去理解它的一些规则。它的规则很另类,也很奇怪,但其中的逻辑却引人注目,且很有魅力。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这里。 +这可能给人一种 Emacs 已经过气或过时的印象。然而并不是,Emacs 是强大和永恒的,只要你耐心地去理解它的一些规则。Emacs 的规则很另类,也很奇怪,但其中的逻辑却引人注目,且魅力十足。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这里。 -如果通过编辑 Lisp 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 Ludwig 和 Emacs Lisp),但是 Fugue 公司的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs,40% 用 IDE 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32]Pointy-Haired Bosses(PHB[^1] )(以及,其它好奇的人)的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。 +使用 Lisp 代码来构建个人工作环境,并将这个恰到好处的环境移植到任何计算机,如果这种想法打动了你,那么你将会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么 Emacs 可能不适合你。我已经不再写代码了(除了 Ludwig 和 Emacs Lisp),但是 Fugue 公司的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs,40% 用 IDE 和 30% 的用 vim。但这篇文章是写给 CEO 和其他[精英][32]Pointy-Haired Bosses(PHB[^1] )(以及对 Emacs 感兴趣的人)的,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚,从而让你有个良好的体验,而不是花上几个小时去 Google。 ### 恒久优势 使用 Emacs 带来的长期优势是让生活更轻松。与最后的收获相比,最开始的付出完全值得。想想这些: -#### 无需上下文切换 +#### 简单高效 -Org 模式本身就值得花时间,但如果你像我一样,你通常要处理十几份左右的文件 —— 从博客帖子到会议需要做什么的清单,再到员工评估。在现代计算世界中,这通常意味着要使用多个应用程序,所有这些应用程序都有不同的用户界面、保存方式、排序和搜索方式。结果就是你需要不断转换思维环境,记住细节。我讨厌上下文切换,因为它是一种强加到我身上的方式,原因是破坏了界面模型[^2] ,并且我讨厌记住本该是计算机要为我记住的东西。在单个环境下,Emacs 对 PHB 甚至比对于程序员更有用,因为程序员更多时候只需要专注于一个程序。转换思维环境的成本比通常看起来的要高。操作系统和应用程序厂商已经构建了各种界面,以分散我们对这一现实的注意力。如果你是技术人员,通过快捷键(`M-:`)来访问功能强大的[语言解释器][33]会方便的多[^3] 。 +Org 模式本身就值得花时间,但如果你像我一样,你通常要处理十几份左右的文件 —— 从博客帖子到会议事务清单,再到员工评估。在现代计算世界中,这通常意味着要使用多个应用程序,所有这些程序都有不同的用户界面、保存方式、排序和搜索方式。结果就是你需要不断转换思维环境,记住各种细节。我讨厌在程序间切换,这是在强人所难,因为这是个不完整界面模型[^2] ,并且我讨厌记住本该由计算机记住的东西。在单个环境下,Emacs 对 PHB 甚至比对于程序员更高效,因为程序员更多时候只需要专注于一个程序。转换思维环境的成本比表面上的要更高。操作系统和应用程序厂商已经构建了各种界面,以分散我们对这一现实的注意力。如果你是技术人员,通过快捷键(`M-:`)来访问功能强大的[语言解释器][33]会方便的多[^3] 。 -许多应用程序可以全天全屏地用于编辑文本。Emacs 是惟一的,因为它既是编辑器也是 Emacs Lisp 解释器。从本质上说,你工作时只要用电脑上的一两个键就能完成。如果你对编程略知一二,就能发现这意味着你可以在 Emacs 中做 _任何事情_。一旦你在内存中有了这些命令,你的电脑就可以在你工作时几乎实时地为你提供高效的运转。你不会想用 Emacs Lisp 来重建 Excel,只要用简单的一两行代码就能实现 Excel 中大多数的功能。如果我需要处理数字,我更有可能转到 scratch 缓冲区,编写一些代码,而不是打开电子表格。即便是我有一封多行的邮件要写,我通常也会先在 Emacs 中写完,然后再复制粘贴到邮件客户端中。当你可以流畅的书写时,为什么要去切换呢?你可以先从一两个简单的算术开始,随着时间的推移,你可以很容易的在 Emacs 中添加你所需要处理的计算。这在应用程序中可能是独一无二的,同时还提供了让为其他的人创造的丰富特性。还记得艾萨克·阿西莫夫书中那些神奇的终端吗? Emacs 是我所遇到的最接近它们的东西[^4] 。我决定不再用什么应用程序来做这个或那个。相反,我只是工作。拥有一个伟大的工具并致力于此,这才是真正的动力和效率。 +许多应用程序可以全天全屏地用于编辑文本。但Emacs 是唯一的,因为它既是编辑器也是 Emacs Lisp 解释器。从本质上来说,你工作时只要用电脑上的一两个键就能完成。如果你略懂编程的话,就会发现这代表着你可以在 Emacs 中做 _任何事情_。一旦你在内存中存储了这些指令,你的电脑就可以在工作时几乎实时地为你提供高效的运转。你不会想用 Emacs Lisp 来重建 Excel,因为只要用简单的一两行代码就能实现 Excel 中大多数的功能。比如说我要处理数字,我更有可能转到 scratch 缓冲区,编写一些代码,而不是打开电子表格。即便是要写一封比较大的邮件时,我通常也会先在 Emacs 中写完,然后再复制粘贴到邮件客户端中。当你可以流畅的书写时,为什么要去切换呢?你可以先从一两个简单的算术开始,随着时间的推移,你可以很容易的在 Emacs 中添加你所需要处理的计算。这在应用程序中可能是独一无二的,同时还提供了让为其他的人创造的丰富特性。还记得艾萨克·阿西莫夫书中那些神奇的终端吗? Emacs 是我所遇到的最接近它们的东西[^4] 。我决定不再用什么应用程序来做这个或那个。相反,我只是工作。拥有一个伟大的工具并致力于此,这才是真正的动力和效率。 -#### 在安静中创造事情 +#### 静中造物 -拥有我所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?发挥了 Lisp 键盘的全部威力了吗?我用 Emacs 来完成所有的创作性工作,处理音乐和图片除外。 +拥有所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?发挥了 Lisp 键盘的全部威力了吗?我用 Emacs 来完成所有的创作性工作,音乐和图片除外。 -我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等放在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序致力于提供帮助和易用性。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比起 office 应用程序,我更讨厌其在线版。 +我办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,我通常也会打开一个终端。我将日历、邮件等放在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面会隐藏起来,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,越是先进的 UI 应用程序,消除干扰越是不可能,因为这些应用程序致力于提供帮助和易用性。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像出书一样,处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比起 office 客户端版,我更讨厌它的在线版。 ![](https://www.fugue.co/hubfs/Imported_Blog_Media/desktop-1.jpg) *我的桌面布局, Emacs 在左边* -但是交流呢?创造和交流之间的差别很大。当我为两者留出不同的时间段时,我的效率会更高。我们 Fugue 公司使用 Slack,痛并快乐着。我把它和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我很高兴地能够忽略所有的聊天。只要一个 Slackstorm 或一封风投或董事会董事的电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。 +但是沟通呢?创造和沟通之间的差别很大。当我将这两件事在不同时间段处理时,我的效率会更高。我们 Fugue 公司使用 Slack,痛并快乐着。我把 Slack 和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我就能够忽略所有的聊天信息了。虽然只要一个 Slackstorm 或一封风投或董事会董事的电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。 #### 包罗万象,永久长青 -第三个原因是,我发现 Emacs 比其它的环境更有优势的是你可以很容易的用它来处理事务。我的意思是,你所需要的只是通过 Dropbox 类似的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何你已经精心打造了适合你的目的的套件的环境中工作了。我在 OS X、Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理 Pages、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。 +第三个原因是,我发现 Emacs 比其它的环境更有优势的是,你可以很容易地用它来处理事务。我的意思是,你所需要的只是通过类似于 Dropbox 的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何你已经精心打造了适合你的目的的套件的环境中工作了。我在 OS X、Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理 Pages、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。 -限制在计算机上永久存储的因素是文件格式。假设人类已经解决了存储问题[^6] ,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最长青的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于 Office 应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。 +限制在计算机上永久存储的因素是文件格式。假设人类已经解决了存储问题[^6] ,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是保存时间最久的格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于 Office 应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。 -如果你准备尝试 Emacs,请继续阅读!下面的部分不会取代完整的教程,但是在完成阅读时,就可以操作了。 +如果你准备尝试 Emacs,请继续读下去!下面的部分不是完整的教程,但是在读完后,就可以动手操作了。 -### 学会驾驭 Emacs —— 一个专业的配置 +### 驾驭之道 —— 专业定制 所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像穿越到过去。这有点像你只开过车,却要你去学骑自行车[^7] 。 -#### 该选哪个 Emacs +#### 类型抉择 我用的是来自 GNU 的 OS X 和 Windows 的通用版本的 Emacs。你可以在 [http://emacsformacos.com/][35] 获取 OS X 版本,在 [http://www.gnu.org/software/emacs/][37] 获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(涉及到 Lisp 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[^8] ! -#### 首先,学会导航 +#### 驾驭之始 在本文中,我将使用 Emacs 的按键和组合键约定。`C` 表示 `Control` 键,`M` 表示 `meta`(通常是 `Alt` 或 `Option` 键),以及用于组合键的连字符。因此,`C-h t` 表示同时按下 `Control` 和 `h` 键,然后释放,再按下 `t`。这个组合快捷键会指向一个教程,这是你首先要做的一件事。 -不要使用方向键或鼠标。它们可以工作,但是你应该给自己一周的时间来使用 Emacs 教程中的原生的导航命令。一旦你这些命令变为了肌肉记忆,你可能就会乐在其中,无论到哪里,你都会非常想念它们。这个 Emacs 教程在介绍它们方面做得很好,但是我将进行总结,所以您不需要阅读全部内容。最无聊的是,不用方向键,用 `C-b` 向前移动,用 `C-f` 向后移动,上一行用 `C-p`,下一行用 `C-n`。你可能会想:“我用方向键就很好,为什么还要这样做?” 有几个原因。首先,你不需要从主键盘区将你的手移开。第二,使用 `Alt`(或用 Emacs 的说法 `Meta`)键来向前或向后在单词间移动。显而易见这样更方便。第三,如果想重复某个命令,可以在命令前面加上一个数字。在编辑文档时,我经常使用这种方法,通过估计向后移动多少个单词或向上或向下移动多少行,然后按下 `C-9 C-p` 或 `M-5 M-b` 之类的快捷键。其它真正重要的导航命令基于开头用 `a` 和结尾用 `e`。在行中使用 `C-a|e`,在句中使用 `M-a|e`。为了让句中的命令正常工作,需要在句号后增加两个空格,这同时提供了一个有用的特性,并消除了脑中一个过时的[观点][38]。如果需要将文档导出到单个空间[发布环境][39],可以编写一个宏来执行此操作。 +不要使用方向键或鼠标。它们可以工作,但是你应该给自己一周的时间来使用 Emacs 教程中的原生的导航命令。一旦你这些命令变为了肌肉记忆,你可能就会乐在其中,无论到哪里,你都会非常想念它们。这个 Emacs 教程在介绍它们方面做得很好,但是我将进行总结,所以你不需要阅读全部内容。最无聊的是,不用方向键,用 `C-b` 向前移动,用 `C-f` 向后移动,上一行用 `C-p`,下一行用 `C-n`。你可能会想:“我用方向键就很好,为什么还要这样做?” 有几个原因。首先,你不需要从主键盘区将你的手移开。第二,使用 `Alt`(或用 Emacs 的说法 `Meta`)键来向前或向后在单词间移动。显而易见这样更方便。第三,如果想重复某个命令,可以在命令前面加上一个数字。在编辑文档时,我经常使用这种方法,通过估计向后移动多少个单词或向上或向下移动多少行,然后按下 `C-9 C-p` 或 `M-5 M-b` 之类的快捷键。其它真正重要的导航命令基于开头用 `a` 和结尾用 `e`。在行中使用 `C-a|e`,在句中使用 `M-a|e`。为了让句中的命令正常工作,需要在句号后增加两个空格,这同时提供了一个有用的特性,并消除了脑中一个过时的[观点][38]。如果需要将文档导出到单个空间[发布环境][39],可以编写一个宏来执行此操作。 Emacs 所附带的教程很值得去看。对于真正缺乏耐心的人,我将介绍一些重要的命令,但那个教程非常有用。记住:用 `C-h t` 进入教程。 -#### 学会复制和粘贴 +#### 驾驭之复制粘贴 -你可以把 Emacs 设为 CUA 模式,这将会以熟悉的方式工作来操作复制粘贴,但是原生的 Emacs 方法更好,而且你一旦学会了它,就很容易。你可以使用 `Shift` 和导航命令来标记区域(如同选择)。所以 `C-F` 是选中光标前的一个字符,等等。亦可以用 `M-w` 来复制,用 `C-w` 剪切,然后用 `C-y` 粘贴。这些实际上叫做删除killing召回yanking,但它非常类似于剪切和粘贴。在删除中有些小技巧,但是现在,你只需要关注剪切、复制和粘贴。如果你开始尝试了,那么 `C-x u` 是撤销。 +你可以把 Emacs 设为 CUA 模式,这将会以熟悉的方式工作来操作复制粘贴,但是原生的 Emacs 方法更好,而且你一旦学会了它,就很容易。你可以使用 `Shift` 和导航命令来标记区域(如同选择)。所以 `C-F` 是选中光标前的一个字符,等等。亦可以用 `M-w` 来复制,用 `C-w` 剪切,然后用 `C-y` 粘贴。这些实际上叫做删除killing召回yanking,但它非常类似于剪切和粘贴。在删除中还有一些小技巧,但是现在,你只需要关注剪切、复制和粘贴。如果你开始尝试了,那么 `C-x u` 是撤销。 -#### 下一步,学会用 Ido 模式 +#### 驾驭之 Ido 模式 -相信我,Ido 会让文件的工作变得很简单。通常,你在 Emacs 中处理文件不需要使用一个单独的访达或文件资源管理器的窗口。相反的,你可以用编辑器的命令来创建、打开和保存文件。如果没有 Ido 的话,这将有点麻烦,所以我建议你在学习其他之前安装好它。 Ido 是 Emacs 的 22 版时开始出现的,但是需要对你的 `.emacs` 文件做一些调整,来确保它一直开启着。这是个配置环境的好理由。 +相信我,Ido 会让文件的工作变得很简单。通常,你在 Emacs 中处理文件不需要使用一个单独的访达或文件资源管理器的窗口。相反,你可以用编辑器的命令来创建、打开和保存文件。如果没有 Ido 的话,这将有点麻烦,所以我建议你在学习其他之前安装好它。 Ido 是 Emacs 的 22 版时开始出现的,但是需要对你的 `.emacs` 文件做一些调整,来确保它一直开启着。这是个配置环境的好理由。 Emacs 中的大多数功能都表现在模式上。要安装指定的模式,需要做两件事。嗯,一开始你需要做一些额外的事情,但这些只需要做一次,然后再做这两件事。那么,这件额外的事情是你需要一个单独的位置来放置所有 Emacs Lisp 文件,并且你需要告诉 Emacs 这个位置在哪。我建议你在 Dropbox 上创建一个单独的目录,那是你 Emacs 主目录。在这里,你需要创建一个 `.emacs` 文件和 `.emacs.d` 目录。在 `.emacs.d` 目录下,创建一个 `lisp` 的目录。就像这样: @@ -81,7 +81,7 @@ home -lisp ``` -你可以将那些比如模式的 `.el` 文件放到 `home/.emacs.d/lisp` 目录下,然后在你的 `.emacs` 文件中添加以下代码来指明该路径: +你可以将 `.el` 文件,比如说模式文件,放到 `home/.emacs.d/lisp` 目录下,然后在你的 `.emacs` 文件中添加以下代码来指明该路径: ``` (add-to-list 'load-path "~/.emacs.d/lisp/") @@ -89,11 +89,11 @@ home Ido 模式是 Emacs 自带的,所以你不需要在你的 `lisp` 目录中放这个 `.el` 文件,但你仍然需要添加上面代码,因为下面的介绍会使用到它. -#### 符号链接是你的好伙伴 +#### 驾驭之符号链接 等等,这里写的 `.emacs` 和 `.emacs.d` 都是存放在你的主目录下,但我们把它们放到了 Dropbox 的某些愚蠢的文件夹!对,这就让你的环境在任何地方都很容易使用。把所有东西都保存在 Dropbox 上,并做符号链接到 `~` 下的 `.emacs` 、`.emacs.d` 和你的主要存放文档的目录。在 OS X 上,使用 `ln -s` 命令非常简单,但在 Windows 上却很麻烦。幸运的是,Emacs 提供了一种简单的方法来替代 Windows 上的符号链接,Windows 的 `HOME` 环境变量。转到 Windows 的环境变量(Windows 10,你可以按 Windows 键然后输入 “环境变量” 来搜索,这是 Windows 10 最好的地方了),在你的帐户下创建一个指向你在 Dropbox 中 Emacs 的文件夹的 `HOME` 环境变量。如果你想方便地浏览 Dropbox 之外的本地文件,你可能想在你的实际主目录下建立一个到 Dropbox 下 Emacs 主目录的符号链接。 -至此,你已经完成了在任意机器上指向你的 Emacs 配置和文件所需的技巧。如果你买了一台新电脑,或者用别人的电脑一小时或一天,你就可以得到你的整个工作环境。第一次做这个似乎有点困难,但是一旦你知道你在做什么,就(最多)只需要 10 分钟。 +至此,你已经完成了在任意机器上指向你的 Emacs 配置和文件所需的技巧。如果你买了一台新电脑,或者用别人的电脑一小时或一天,你就可以得到你的整个工作环境。第一次操作起来似乎有点难,但是一旦你知道你在做什么,就(最多)只需要 10 分钟。 但我们现在是在配置 Ido …… @@ -121,9 +121,9 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] 其中 `[RET]` 是我使用 `Ido` 模式的自动补全而按下的回车键。所以,这只需要按 12 个键,如果你习惯了的话, 这将比打开访达或文件资源管理器再用鼠标点要节省 _很_ 多时间。 Ido 模式很有用,而这只是操作 Emacs 的一种实用模式而已。下面让我们去探索一些其它对完成工作很有帮助的模式吧。 -#### 字体及风格 +#### 驾驭之字体风格 -我推荐在 Emacs 中使用漂亮的字体族。它们可以使用不同的括号、0 和其他字符进行自定义。你可以在字体文件本身中构建额外的行间距。我推荐 1.5 倍的行间距,并在代码和数据中使用不等宽字体。写作中我用 `Serif` 字体,它有一种紧凑但时髦的感觉。你可以在 [http://input.fontbureau.com/][40] 上找到它们,在那里你可以根据自己的喜好进行定制。你可以使用 Emacs 中的菜单手动设置字体,但这会将代码保存到你的 `.emacs` 文件中,如果您使用多个设备,您可能需要一些不同的设置。我将我的 `.emacs` 设置为根据使用的机器的名称来相应配置屏幕。代码如下: +我推荐在 Emacs 中使用漂亮的字体族。它们可以使用不同的括号、0 和其他字符进行自定义。你可以在字体文件本身中构建额外的行间距。我推荐 1.5 倍的行间距,并在代码和数据中使用不等宽字体。写作中我用 `Serif` 字体,它有一种紧凑但时髦的感觉。你可以在 [http://input.fontbureau.com/][40] 上找到它们,在那里你可以根据自己的喜好进行定制。你可以使用 Emacs 中的菜单手动设置字体,但这会将代码保存到你的 `.emacs` 文件中,如果你使用多个设备,你可能需要一些不同的设置。我将我的 `.emacs` 设置为根据使用的机器的名称来相应配置屏幕。代码如下: ``` ;; set up fonts for different OSes. OSX toggles to full screen. @@ -140,9 +140,9 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] (set-face-attribute 'default nil :font myfont :height 104))) ``` -您应该将你的 Emacs 中的 `system-name` 的值替换成你通过 `(system-name)` 得到的值。注意,在 Sampo (我的 MacBook)上,我还将 Emacs 设置为全屏。我也想在 Windows 实现这个,但是 Windows 和 Emacs 并不真正喜欢对方,当我尝试这个时,它总是不稳定。相反,我只能在启动后手动全屏。 +你应该将 Emacs 中的 `system-name` 的值替换成你通过 `(system-name)` 得到的值。注意,在 Sampo (我的 MacBook)上,我还将 Emacs 设置为全屏。我也想在 Windows 实现这个功能,但是 Windows 和 Emacs 好像互相嫌弃对方,当我尝试配置时,它总是不稳定。相反,我只能在启动后手动全屏。 -我还建议去掉 Emacs 中的上世纪 90 年代出现的难看工具栏,当时最酷的事情是在应用程序中使用工具栏。我还去掉了一些其它的“电镀层”,这样我就有了一个简单、高效的界面。把这些加到你的 `.emacs` 的文件中来去掉工具栏和滚动条,但要保留菜单(在 OS X 上,它将被隐藏,除非你将鼠标到屏幕顶部): +我还建议去掉 Emacs 中的上世纪 90 年代出现的难看工具栏,当时比较流行在应用程序中使用工具栏。我还去掉了一些其它的“电镀层”,这样我就有了一个简单、高效的界面。把这些加到你的 `.emacs` 的文件中来去掉工具栏和滚动条,但要保留菜单(在 OS X 上,它将被隐藏,除非你将鼠标到屏幕顶部): ``` (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) @@ -150,11 +150,11 @@ C-x C-f ~/o[RET]/bl[RET].or[RET] (if (fboundp 'menu-bar-mode) (menu-bar-mode 1)) ``` -#### Org 模式 +#### 驾驭之 Org 模式 -我基本上是在 Org 模式下处理工作的。它是我创作文档、记笔记、列任务清单以及 90% 其他工作的首选环境。Org 模式最初是由一个在会议中使用笔记本电脑的家伙构想出来的,它是笔记和待办事项列表的组合工具。我反对在会议中使用笔记本电脑,自己也不使用,所以我的用法与他的有些不同。对我来说,Org 模式主要是一种处理结构中内容的方式。在 Org 模式中有标题和副标题等,它们的作用就像一个大纲。Org 模式允许你展开或隐藏大纲树,还可以重新排列该树。这非常很符合我的想法,而且我发现用这种方式使用它是一种乐趣。 +我基本上是在 Org 模式下处理工作的。它是我创作文档、记笔记、列任务清单以及 90% 其他工作的首选环境。Org 模式是笔记和待办事项列表的组合工具,最初是由一个在会议中使用笔记本电脑的人构想出来的。我反对在会议中使用笔记本电脑,自己也不使用,所以我的用法与他的有些不同。对我来说,Org 模式主要是一种处理结构中内容的方式。在 Org 模式中有标题和副标题等,它们的作用就像一个大纲。Org 模式允许你展开或隐藏大纲树,还可以重新排列该树。这正合我意,并且我发现用这种方式使用它是一种乐趣。 -Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常好,LaTeX/PDF 输出也很好。Org 模式能够根据所有文档中的待办事项生成议程,并能很好地将它们与日期/时间联系起来。我不把它用在任何形式的外部任务上,这些任务都是在一个共享的日历上处理的,但是在创建事物和跟踪我未来需要创建的东西时,它是无价的。安装它,你只要将 `org-mode.el` 放到你的 `lisp` 目录下,并且如果你想要它基于文档的结构进行缩进并在打开时全部展开的话,在你的 `.emacs` 文件中添加如下代码: +Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常好,LaTeX/PDF 输出也很好。Org 模式能够根据所有文档中的待办事项生成议程,并能很好地将它们与日期/时间联系起来。我不把它用在任何形式的外部任务上,这些任务都是在一个共享的日历上处理的,但是在创建事物和跟踪我未来需要创建的东西时,它是无价的。安装它,你只要将 `org-mode.el` 放到你的 `lisp` 目录下。如果你想要它基于文档的结构进行缩进并在打开时全部展开的话,在你的 `.emacs` 文件中添加如下代码: ``` ;; set up org mode @@ -169,9 +169,9 @@ Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常 ##### 用 Org 模式进行发布 -我关心的是文档的外观和格式化。我刚开始工作时是个设计师,而且我认为信息可以,也应该表现得清晰和美丽。Org 模式对将 LaTeX 生成 PDF 支持的很好,LaTeX 虽然也有学习曲线,但是做简单的事情非常简单。 +我关心的是文档的外观及格式。我刚开始工作时是个设计师,而且我认为信息可以,也应该表现得清晰和美丽。Org 模式对将 LaTeX 生成 PDF 支持的很好,LaTeX 虽然也有学习曲线,但是很容易处理一些简单的事务。 -如果你想使用字体和样式,而不是典型的 LaTeX 字体和样式,你需要做些事。首先,你要用到 XeLaTeX,这样就可以使用普通的系统字体,而不是 LaTeX 的特殊字体。接下来,您需要将以下代码添加到 `.emacs` 中: +如果你想使用字体和样式,而不是典型的 LaTeX 字体和样式,你需要做些事。首先,你要用到 XeLaTeX,这样就可以使用普通的系统字体,而不是 LaTeX 的特殊字体。接下来,你需要将以下代码添加到 `.emacs` 中: ``` (setq org-latex-pdf-process @@ -179,7 +179,7 @@ Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常 "xelatex -interaction nonstopmode %f")) ``` -我把这个放在 `.emacs` 中 Org 模式配置部分的末尾来保持整洁。这让你在从 Org 模式发布时可以使用更多格式化选项。例如,我经常使用: +我把这个放在 `.emacs` 中 Org 模式配置部分的末尾,使文档变得更整洁。这让你在从 Org 模式发布时可以使用更多格式化选项。例如,我经常使用: ``` #+LaTeX_HEADER: \usepackage{fontspec} @@ -191,13 +191,12 @@ Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常 #+TITLE: Document Title Here ``` -这些都可以在你的 `.org` 文件中找到。我们的公司规定的正文字体是 `Maison Neue`,但你也可以在这写上任何适当的东西。我强烈反对使用 `Maison Neue`。它是一种糟糕的字体,任何人都不应该使用它。 +这些都可以在 `.org` 文件中找到。我们的公司规定的正文字体是 `Maison Neue`,但你也可以在这写上任何适当的东西。我很是抵制 `Maison Neue`,因为这是一种糟糕的字体,任何人都不应该使用它。 这个文件是一个使用该配置输出为 PDF 的实例。这就是开箱即用的 LaTeX 一样。在我看来这还不错,但是字体很平淡,而且有点奇怪。此外,如果你使用标准格式,人们会觉得他们正在阅读的东西是、或者假装是一篇学术论文。别怪我没提醒你。 -#### Ace Jump 模式 - -这是个辅助而不是主要功能,但是或许你想使用。它的工作原理有点像之前的 Jef Raskin 的 Leap 功能[^9] 。 按下 `C-c C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。您只需键入所需位置的字母,光标就会跳转到该位置。我自己经常用这个作为导航键或搜索。将 `.el` 文件下到你的 `lisp` 目录下,并在 `.emacs` 文件添加如下代码: +#### 驾驭之 Ace Jump 模式 +这只是一个辅助模式,而不是一个主模式,但是你也需要它。其工作原理有点像之前提到的 Jef Raskin 的 Leap 功能[^9] 。 按下 `C-c C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。你只需键入所需位置的字母,光标就会跳转到该位置。我常将它作为导航键或是用来检索。将 `.el` 文件下到你的 `lisp` 目录下,并在 `.emacs` 文件添加如下代码: ``` ;; set up ace-jump-mode @@ -206,20 +205,29 @@ Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常 (define-key global-map (kbd "C-c C-SPC" ) 'ace-jump-mode) ``` -### 更多 +### 待续 -这篇文章已经够详细了,你能在其中的到你所想要的。我很想了解除了编程之外(或用于编程)你对 Emacs 的使用情况,以及这是否有用。在我使用 Emacs 的过程中,可能存在一些自作聪明的老板式想法,如果你能指出它们,我将感激不尽。之后,我可能会写一些更新来介绍其它特性或模式。我很确定我将会向你展示如何在 Emacs 和 Ludwig 模式下使用 Fugue,因为我会将它发展成比代码高亮更有用的东西。请把你的想法发到 [@fugueHQ][41] 上。 +本文已经够详细了,你能在其中得到你所想要的。我很想知道除编程之外(或用于编程)Emacs 的使用情况,及其是否高效。在我使用 Emacs 的过程中,可能存在一些自作聪明的老板式想法,如果你能指出来,我将不胜感激。之后,我可能会写一些更新来介绍其它特性或模式。我很确定我将会向你展示如何在 Emacs 和 Ludwig 模式下使用 Fugue,因为我会将它发展成比代码高亮更有用的东西。更多想法,请在 Twitter 上 [@fugueHQ][41] 。 +### 脚注 -[^1]: If you are now a PHB of some sort, but were never technical, Emacs likely isn’t for you. There may be a handful of folks for whom Emacs will form a path into the more technical aspects of computing, but this is probably a small population. It’s helpful to know how to use a Unix or Windows terminal, to have edited a dotfile or two, and to have written some code at some point in your life for Emacs to make much sense. -[^2]: http://archive.wired.com/wired/archive/2.08/tufte.html -[^3]: I mainly use this to perform calculations while writing. For example, I was writing an offer letter to a new employee and wanted to calculate how many options to include in the offer. Since I have a variable defined in my `.emacs` for outstanding-shares, I can simply type `M-: (* .001 outstanding-shares)`and get a tenth of a point without opening a calculator or spreadsheet. I keep  _lots_ of numbers in variables like this so I can avoid context switching. -[^4]: The missing piece of this is the web. There is an Emacs web browser called eww that will allow you to browse in Emacs. I actually use this, as it is both a great ad-blocker and removes most of the poor choices in readability from the web designer's hands. It's a bit like Reading Mode in Safari. Unfortunately, most websites have lots of annoying cruft and navigation that translates poorly into text. -[^5]: Usability is often confused with learnability. Learnability is how difficult it is to learn a tool. Usability is how useful the tool is. Often, these are at odds, such as with the mouse and menus. Menus are highly learnable, but have poor usability, so there have been keyboard shortcuts from the earliest days. Raskin was right on many points where he was ignored about GUIs in general. Now, OSes are putting things like decent search onto a keyboard shortcut. On OS X and Windows, my default method of navigation is search. Ubuntu's search is badly broken, as is the rest of its GUI. -[^6]: AWS S3 has effectively solved file storage for as long as we have the Internet. Trillions of objects are stored in S3 and they've never lost one of them. Most every service out there that offers cloud storage is built on S3 or imitates it. No one has the scale of S3, so I keep important stuff there, via Dropbox. -[^7]: By now, you might be thinking "what is it with this guy and bicycles?" ... I love them on every level. They are the most mechanically efficient form of transportation ever invented. They can be objects of real beauty. And, with some care, they can last a lifetime. I had Rivendell Bicycle Works build a frame for me back in 2001 and it still makes me happy every time I look at it. Bicycles and UNIX are the two best inventions I've interacted with. Well, they and Emacs. -[^8]: This is not a tutorial for Emacs. It comes with one and it's excellent. I do walk through some of the things that I find most important to getting a useful Emacs setup, but this is not a replacement in any way. -[^9]: Jef Raskin designed the Canon Cat computer in the 1980s after falling out with Steve Jobs on the Macintosh project, which he originally led. The Cat had a document-centric interface (as all computers should) and used the keyboard in innovative ways that you can now imitate with Emacs. If I could have a modern, powerful Cat with a giant high-res screen and Unix underneath, I'd trade my Mac for it right away. [][27][https://youtu.be/o_TlE_U_X3c?t=19s][28] +[^1]: 如果你是位精英,但从没涉及过技术方面,那么 Emacs 并不适合你。对于少数的人来说,Emacs 可能会为他们开辟一条通往计算机技术方面的道路,但这只是极少数。如果你知道怎么使用 Unix 或 Windows 的终端,或者曾编辑过 dotfile,或者说你曾写过一点代码的话,这对使用 Emacs 有很大的帮助。 + +[^2]: 参考链接: http://archive.wired.com/wired/archive/2.08/tufte.html + +[^3]: 我主要是在写作时使用这个模式来进行一些运算。比如说,当我在给一个新雇员写一封入职信时,我想要算这封入职信中有多少个选项。由于我在我的 `.emacs` 为 outstanding-shares 定义了一个变量,所以我只要按下 `M-:` 然后输入 `(* .001 outstanding-shares)` 就能再无需打开计算器或电子表格的情况下得到精度为 0.001 的结果。我使用了 _大量_ 的变量来避免程序间切换。 + +[^4]: 缺少的部分是 web。有个名为 eww 的 Emacs 网页浏览器能够让你在 Emacs 中浏览网页。我用的就是这个,因为它既能拦截广告(译者注:实质上是无法显示,/laugh),同时也在可读性方面为 web 开发者消除了大多数差劲的选项。这个其实有点类似于 Safari 的阅读模式。不幸的是,大部分网站都有很多令人讨厌的繁琐的东西以及难以转换为文本的导航, + +[^5]: 易用性和易学性这两者经常容易被搞混。易学性是指学习使用工具的难易程度。而易用性是指工具高效的程度。通常来说,这是要差别的,就想鼠标和菜单栏的差别一样。菜单栏很容易学会,但是却不怎么高效,以致于早期会存在一些键盘的快捷键。除了在 GUI 方面上,Raskin 在很多方面上的观点都很正确。如今,操作系统正在将一些合适的搜索映射到键盘的快捷键上。比如说在 OS X 和 Windows 上,我默认的导航方式就是搜索。Ubuntu 的搜索做的很差劲,如同它的 GUI 一样差劲。 + +[^6]: 在有网的情况下, [AWSAmazon Web Services S3][42] 是解决文件存储问题的有效方案。数万亿个对象存在 S3 中,但是从来没有遗失过。大部分提供云存储的服务都是在 S3 上或是模拟 S3 构建的。没人能够拥有 S3 一样的规模,所以我将重要的文件通过 Dropbox 存储在上面。 + +[^7]: 目前,你可能会想:“这个人和自行车有什么关系?”……我在各个层面上都喜欢自行车。自行车是迄今为止发明的最具机械效率的交通工具。自行车可以是真正美丽的事物。而且,只要注意点的话,自行车可以用一辈子。早在 2001 年,我曾向 Rivendell Bicycle Works 订购了一辆自行车,现在我每次看到那辆自行车依然很高兴,自行车和 Unix 是我接触过的最好的两个发明。对了,还有 Emacs。 + +[^8]: 这个网站有一个很棒的 Emacs 教程,但不是这个。当我浏览这个页面时,我确实得到了一些对获取高效的 Emacs 配置很重要的知识,但无论怎么说,这都不是个替代品。 + +[^9]: 20世纪80年代,Jef Raskin 与 Steve Jobs 在 Macintosh 项目上闹翻后, Jef Raskin 又设计了 [Canon Cat 计算机][43]。这台 Cat 是以文档为中心的界面(所有的计算机都应如此),并以一种全新的方式使用键盘,你现在可以用 Emacs 来模仿这种键盘。如果现在有一台现代的,功能强大的 Cat 并配有一个高分辨的显示器和 Unix 系统的话,我立马会用 Mac 来换。[][27][https://youtu.be/o_TlE_U_X3c?t=19s][28] -------------------------------------------------------------------------------- @@ -227,7 +235,7 @@ via: https://blog.fugue.co/2015-11-11-guide-to-emacs.html 作者:[Josh Stella][a] 译者:[oneforalone](https://github.com/oneforalone) -校对:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy), [oneforalone](https://github.com/oneforalone) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -273,3 +281,5 @@ via: https://blog.fugue.co/2015-11-11-guide-to-emacs.html [39]:http://practicaltypography.com/one-space-between-sentences.html [40]:http://input.fontbureau.com/ [41]:https://twitter.com/fugueHQ +[42]:https://baike.baidu.com/item/amazon%20s3/10809744?fr=aladdin +[43]:https://en.wikipedia.org/wiki/Canon_Cat From 35948ed908998ae2ab8c1a9a4be2505e299f93b2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 29 Dec 2018 22:47:30 +0800 Subject: [PATCH 1120/1143] PRF:20181212 How to Build a Netboot Server, Part 2.md @qhwdw --- ...2 How to Build a Netboot Server, Part 2.md | 178 +++++++++--------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/translated/tech/20181212 How to Build a Netboot Server, Part 2.md b/translated/tech/20181212 How to Build a Netboot Server, Part 2.md index 8887d84ba1..af3487c169 100644 --- a/translated/tech/20181212 How to Build a Netboot Server, Part 2.md +++ b/translated/tech/20181212 How to Build a Netboot Server, Part 2.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: () -[#]: publisher: () -[#]: url: () +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) [#]: subject: (How to Build a Netboot Server, Part 2) [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) -如何构建一台网络引导服务器(第二部分) +如何构建一台网络引导服务器(二) ====== ![](https://fedoramagazine.org/wp-content/uploads/2018/12/netboot2-816x345.jpg) -在 [如何构建一台网络引导服务器(第一部分)][1] 的文章中,我们展示了如何创建一个网络引导镜像,在那个镜像中使用了一个名为 “liveuser” 帐户,它的 home 目录位于内存中,重启后 home 中的内容将全部消失。然而很多用户都希望机器重启后保存他们的文件和设置。因此,在本系列的第二部分,我们将向你展示如何在第一部分的基础上,重新配置网络引导镜像,使它能够使用 [活动目录][2] 中的用户帐户进行登陆,然后能够从一个 NFS 服务器上自动挂载他们的 home 目录。 +在 [如何构建一台网络引导服务器(一)][1] 的文章中,我们展示了如何创建一个网络引导镜像,在那个镜像中使用了一个名为 `liveuser` 帐户,它的家目录位于内存中,重启后家目录中的内容将全部消失。然而很多用户都希望机器重启后保存他们的文件和设置。因此,在本系列的第二部分,我们将向你展示如何在第一部分的基础上,重新配置网络引导镜像,以便 [活动目录][2] 中的用户帐户可以进行登录,然后从一个 NFS 服务器上自动挂载他们的家目录。 本系列的第三部分,我们将向你展示网络引导客户端如何与中心化配置的 iPXE 引导菜单进行交互。 @@ -22,7 +22,7 @@ ### 删除 Liveuser 帐户 -删除本系列文章第一部分中创建的 “liveuser” 帐户: +删除本系列文章第一部分中创建的 `liveuser` 帐户: ``` $ sudo -i @@ -33,7 +33,7 @@ $ sudo -i ### 配置 NTP、KRB5 和 SSSD -接下来,我们需要将 NTP、KRB5、和 SSSD 的配置文件复制进客户端使用的镜像中,以便于它们能够使用同一个帐户: +接下来,我们需要将 NTP、KRB5 和 SSSD 的配置文件复制进客户端使用的镜像中,以便于它们能够使用同一个帐户: ``` # MY_HOSTNAME=$(> /fc28/etc/$i; done ``` -### 连接活动目录 +### 加入活动目录 -接下来,你将执行一个 chroot 将客户端镜像连接到活动目录。从删除预置在网络引导镜像中相同的计算机帐户开始: +接下来,你将执行一个 `chroot` 将客户端镜像加入到活动目录。从删除预置在网络引导镜像中同名的计算机帐户开始: ``` # MY_USERNAME=jsmith @@ -73,20 +73,20 @@ $ sudo -i # adcli delete-computer "${MY_CLIENT_HOSTNAME%%.*}" -U "$MY_USERNAME" ``` -在网络引导镜像中如果有 krb5.keytab 文件,也删除它: +在网络引导镜像中如果有 `krb5.keytab` 文件,也删除它: ``` # rm -f /fc28/etc/krb5.keytab ``` -在网络引导镜像中执行一个 chroot 操作: +`chroot` 到网络引导镜像中: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done # chroot /fc28 /usr/bin/bash --login ``` -执行一个 join 操作: +执行一个加入操作: ``` # MY_USERNAME=jsmith @@ -97,7 +97,7 @@ $ sudo -i # adcli join $MY_DOMAIN --login-user="$MY_USERNAME" --computer-name="${MY_HOSTNAME%%.*}" --host-fqdn="$MY_HOSTNAME" --user-principal="host/$MY_HOSTNAME@$MY_REALM" --domain-ou="$MY_OU" ``` -现在登出 chroot,并清除命令历史: +现在登出 chroot,并清除 root 用户的命令历史: ``` # logout @@ -105,9 +105,9 @@ $ sudo -i # > /fc28/root/.bash_history ``` -### 安装和配置 PAM Mount +### 安装和配置 PAM 挂载 -我们希望客户端登入后自动挂载它的 home 目录。为实现这个目的,我们将要使用 “pam_mount” 模块。安装和配置 pam_mount: +我们希望客户端登入后自动挂载用户家目录。为实现这个目的,我们将要使用 `pam_mount` 模块。安装和配置 `pam_mount`: ``` # dnf install -y --installroot=/fc28 pam_mount @@ -123,7 +123,7 @@ $ sudo -i END ``` -重新配置 PAM 去使用 pam_mount: +重新配置 PAM 去使用 `pam_mount`: ``` # dnf install -y patch @@ -131,23 +131,23 @@ END # echo 'initgroups: files' >> /fc28/etc/authselect/custom/sssd/nsswitch.conf # patch /fc28/etc/authselect/custom/sssd/system-auth << END @@ -12 +12,2 @@ --auth sufficient pam_sss.so forward_pass -+auth requisite pam_mount.so {include if "with-pammount"} -+auth sufficient pam_sss.so {if "with-pammount":use_first_pass|forward_pass} +-auth sufficient pam_sss.so forward_pass ++auth requisite pam_mount.so {include if "with-pammount"} ++auth sufficient pam_sss.so {if "with-pammount":use_first_pass|forward_pass} @@ -35,2 +36,3 @@ - session required pam_unix.so -+session optional pam_mount.so {include if "with-pammount"} - session optional pam_sss.so + session required pam_unix.so ++session optional pam_mount.so {include if "with-pammount"} + session optional pam_sss.so END # patch /fc28/etc/authselect/custom/sssd/password-auth << END @@ -9 +9,2 @@ --auth sufficient pam_sss.so forward_pass -+auth requisite pam_mount.so {include if "with-pammount"} -+auth sufficient pam_sss.so {if "with-pammount":use_first_pass|forward_pass} +-auth sufficient pam_sss.so forward_pass ++auth requisite pam_mount.so {include if "with-pammount"} ++auth sufficient pam_sss.so {if "with-pammount":use_first_pass|forward_pass} @@ -32,2 +33,3 @@ - session required pam_unix.so -+session optional pam_mount.so {include if "with-pammount"} - session optional pam_sss.so + session required pam_unix.so ++session optional pam_mount.so {include if "with-pammount"} + session optional pam_sss.so END # chroot /fc28 authselect select custom/sssd with-pammount --force ``` @@ -159,17 +159,17 @@ END # echo "$MY_IP $MY_HOSTNAME ${MY_HOSTNAME%%.*}" >> /fc28/etc/hosts ``` -可选,允许所有用户去使用 sudo: +可选,允许所有用户可以使用 `sudo`: ``` # echo '%users ALL=(ALL) NOPASSWD: ALL' > /fc28/etc/sudoers.d/users ``` -### 转换 NFS Root 到一个 iSCSI 背后的存储 +### 转换 NFS 根目录到一个 iSCSI 后备存储器 -在一个 nfsroot 连接建立之后,目前版本的 nfs-utils 可能很难为 home 目录维护一个从客户端到 NFS 服务器的二次连接。当尝试去访问 home 目录时,客户端将被挂住。因此,为了网络引导镜像可共享使用,我们将使用一个不同的协议(iSCSI)来解决这个问题。 +在一个 nfsroot 连接建立之后,目前版本的 nfs-utils 可能很难为家目录建立一个从客户端到 NFS 服务器的第二个连接。当尝试去访问家目录时,客户端将被挂起。因此,为了共享网络引导镜像,我们将使用一个不同的协议(iSCSI)来规避这个问题。 -首先 chroot 到镜像中,去重新配置它的 initramfs,让它从一个 iSCSI root 中去引导: +首先 `chroot` 到镜像中,重新配置它的 `initramfs`,让它从一个 iSCSI 根目录中去引导: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done @@ -186,16 +186,16 @@ END # > /fc28/root/.bash_history ``` -在测试时,qedi 驱动会破坏 iscsi,因此我们将它禁用。 +在测试时,qedi 驱动会破坏 iSCSI,因此我们将它禁用。 -接着,创建一个 fc28.img 的 [稀疏文件][4]。这个稀疏文件代表 iSCSI 目标的背后存储: +接着,创建一个 `fc28.img` [稀疏文件][4]。这个稀疏文件代表 iSCSI 目标的后备存储器: ``` # FC28_SIZE=$(du -ms /fc28 | cut -f 1) # dd if=/dev/zero of=/fc28.img bs=1MiB count=0 seek=$(($FC28_SIZE*2)) ``` -(如果你有一个可使用的稀疏文件、一个单独的分区或磁盘驱动器,就可以代替它了,不用再去创建这个稀疏文件了。) +(如果你有一个可使用的独立分区或磁盘驱动器,也可以用它,而不用再去创建这个稀疏文件了。) 接着,使用一个文件系统去格式化镜像、挂载它、然后将网络引导镜像复制进去: @@ -207,31 +207,31 @@ END # umount $TEMP_MNT ``` -在使用 SquashFS 测试时,客户端偶尔会出现小状况。似乎是因为 SquashFS 在多处理器客户端上没法执行一个随机 I/O。(更多内容见 [squashfs 读取卡顿的奇怪案例][5])。如果你希望使用一个压缩文件系统来提升吞吐性能,[ZFS][6] 或许是个很好的选择。 +在使用 SquashFS 测试时,客户端偶尔会出现小状况。似乎是因为 SquashFS 在多处理器客户端上没法执行随机 I/O。(更多内容见 [squashfs 读取卡顿的奇怪案例][5])。如果你希望使用文件系统压缩来提升吞吐性能,[ZFS][6] 或许是个很好的选择。 如果你对 iSCSI 服务器的吞吐性能要求非常高(比如,成百上千的客户端要连接它),可能需要使用带 [负载均衡][7] 的 [Ceph][8] 集群了。更多相关内容,请查看 [使用 HAProxy 和 Keepalived 负载均衡的 Ceph 对象网关][9]。 ### 安装和配置 iSCSI -为了给我们的客户端提供网络引导镜像,安装 scsi-target-utils 包: +为了给我们的客户端提供网络引导镜像,安装 `scsi-target-utils` 包: ``` # dnf install -y scsi-target-utils ``` -配置 iSCSI 守护程序去提供 fc28.img 文件: +配置 iSCSI 守护程序去提供 `fc28.img` 文件: ``` # MY_REVERSE_HOSTNAME=$(echo $MY_HOSTNAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_HOSTNAME}) # cat << END > /etc/tgt/conf.d/fc28.conf - backing-store /fc28.img - readonly 1 + backing-store /fc28.img + readonly 1 END ``` -通过 /usr/lib/dracut/modules.d/40network/net-lib.sh 来指示预期的 iqn。 +开头的 `iqn.` 是 `/usr/lib/dracut/modules.d/40network/net-lib.sh` 所需要的。 添加一个防火墙例外,并启用和启动这个服务: @@ -242,7 +242,7 @@ END # systemctl start tgtd.service ``` -你现在应该能够使用 tatadm 命令看到这个共享后的镜像: +你现在应该能够使用 `tatadm` 命令看到这个镜像共享了: ``` # tgtadm --mode target --op show @@ -252,42 +252,42 @@ END ``` Target 1: iqn.edu.example.server-01:fc28 - System information: - Driver: iscsi - State: ready - I_T nexus information: - LUN information: - LUN: 0 - Type: controller - SCSI ID: IET 00010000 - SCSI SN: beaf10 - Size: 0 MB, Block size: 1 - Online: Yes - Removable media: No - Prevent removal: No - Readonly: No - SWP: No - Thin-provisioning: No - Backing store type: null - Backing store path: None - Backing store flags: -  LUN: 1 - Type: disk - SCSI ID: IET 00010001 - SCSI SN: beaf11 - Size: 10488 MB, Block size: 512 - Online: Yes - Removable media: No - Prevent removal: No - Readonly: Yes - SWP: No - Thin-provisioning: No - Backing store type: rdwr - Backing store path: /fc28.img - Backing store flags: - Account information: - ACL information: - ALL + System information: + Driver: iscsi + State: ready + I_T nexus information: + LUN information: + LUN: 0 + Type: controller + SCSI ID: IET 00010000 + SCSI SN: beaf10 + Size: 0 MB, Block size: 1 + Online: Yes + Removable media: No + Prevent removal: No + Readonly: No + SWP: No + Thin-provisioning: No + Backing store type: null + Backing store path: None + Backing store flags: + LUN: 1 + Type: disk + SCSI ID: IET 00010001 + SCSI SN: beaf11 + Size: 10488 MB, Block size: 512 + Online: Yes + Removable media: No + Prevent removal: No + Readonly: Yes + SWP: No + Thin-provisioning: No + Backing store type: rdwr + Backing store path: /fc28.img + Backing store flags: + Account information: + ACL information: + ALL ``` 现在,我们可以去删除本系列文章的第一部分中创建的 NFS 共享了: @@ -300,11 +300,11 @@ Target 1: iqn.edu.example.server-01:fc28 # sed -i '/^\/fc28 /d' /etc/fstab ``` -你也可以删除 /fc28 文件系统,但为了以后进一步更新,你可能需要保留它。 +你也可以删除 `/fc28` 文件系统,但为了以后进一步更新,你可能需要保留它。 ### 更新 ESP 去使用 iSCSI 内核 -更新 ESP 去包含启用了 iSCSI 的 initramfs: +更新 ESP 去包含启用了 iSCSI 的 `initramfs`: ``` $ rm -vf $HOME/esp/linux/*.fc28.* @@ -313,7 +313,7 @@ $ cp $(find /fc28/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $MY_KRNL) $ cp $(find /fc28/boot -name 'init*' | grep -m 1 $MY_KRNL) $HOME/esp/linux/initramfs-$MY_KRNL.img ``` -更新 boot.cfg 文件去传递新的 root 和 netroot 参数: +更新 `boot.cfg` 文件去传递新的 `root` 和 `netroot` 参数: ``` $ MY_NAME=server-01.example.edu @@ -322,7 +322,7 @@ $ MY_ADDR=$(host -t A $MY_NAME | awk '{print $4}') $ sed -i "s! root=[^ ]*! root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc28-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc28!" $HOME/esp/linux/boot.cfg ``` -现在,你只需要从 $HOME/esp/linux 目录中复制更新后的文件到所有客户端系统的 ESP 中。你应该会看到类似下面屏幕截图的结果: +现在,你只需要从 `$HOME/esp/linux` 目录中复制更新后的文件到所有客户端系统的 ESP 中。你应该会看到类似下面屏幕截图的结果: ![][10] @@ -334,7 +334,7 @@ $ sed -i "s! root=[^ ]*! root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_E # cp -a /fc28 /fc29 ``` -Chroot 进入到镜像的新副本: +`chroot` 进入到镜像的新副本: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc29/$i; done @@ -401,7 +401,7 @@ END # tgt-admin --update ALL ``` -添加新内核并 initramfs 到 ESP: +添加新内核和 `initramfs` 到 ESP: ``` $ MY_KRNL=$(ls -c /fc29/lib/modules | head -n 1) @@ -409,7 +409,7 @@ $ cp $(find /fc29/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $MY_KRNL) $ cp $(find /fc29/boot -name 'init*' | grep -m 1 $MY_KRNL) $HOME/esp/linux/initramfs-$MY_KRNL.img ``` -更新 ESP 的 boot.cfg: +更新 ESP 的 `boot.cfg`: ``` $ MY_DNS1=192.0.2.91 @@ -426,7 +426,7 @@ boot || exit END ``` -最后,从我的 $HOME/esp/linux 目录中复制文件到所有客户端系统的 ESP 中去使用它吧! +最后,从我的 `$HOME/esp/linux` 目录中复制文件到所有客户端系统的 ESP 中去使用它吧! -------------------------------------------------------------------------------- @@ -435,13 +435,13 @@ via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者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/glb/ [b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ +[1]: https://linux.cn/article-10379-1.html [2]: https://en.wikipedia.org/wiki/Active_Directory [3]: https://fedoramagazine.org/secure-nfs-home-directories-kerberos [4]: https://en.wikipedia.org/wiki/Sparse_file From 3bfca1be933cb7c42d2759ef5fbc234b9c00eed7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 29 Dec 2018 22:48:06 +0800 Subject: [PATCH 1121/1143] PUB:20181212 How to Build a Netboot Server, Part 2.md @qhwdw https://linux.cn/article-10396-1.html --- .../20181212 How to Build a Netboot Server, Part 2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181212 How to Build a Netboot Server, Part 2.md (99%) diff --git a/translated/tech/20181212 How to Build a Netboot Server, Part 2.md b/published/20181212 How to Build a Netboot Server, Part 2.md similarity index 99% rename from translated/tech/20181212 How to Build a Netboot Server, Part 2.md rename to published/20181212 How to Build a Netboot Server, Part 2.md index af3487c169..ea136a4317 100644 --- a/translated/tech/20181212 How to Build a Netboot Server, Part 2.md +++ b/published/20181212 How to Build a Netboot Server, Part 2.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10396-1.html) [#]: subject: (How to Build a Netboot Server, Part 2) [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) From c9dfca3c759dd96b0941943dac7e9f65ac366a72 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 30 Dec 2018 10:39:19 +0800 Subject: [PATCH 1122/1143] PRF:20180128 Getting Linux Jobs.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Ryze-Borgia 翻译的不错,不过有些细节可以再认真些。 --- .../talk/20180128 Getting Linux Jobs.md | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/translated/talk/20180128 Getting Linux Jobs.md b/translated/talk/20180128 Getting Linux Jobs.md index 1f7b5791af..9bfaf0e1e5 100644 --- a/translated/talk/20180128 Getting Linux Jobs.md +++ b/translated/talk/20180128 Getting Linux Jobs.md @@ -1,80 +1,81 @@ Linux 求职建议 ====== -通过对招聘网站数据的仔细研究,我们发现,即使是非常有经验的 Linux 程序员,也很难在面试中表现的很出色。 +通过对招聘网站数据的仔细研究,我们发现,即使是非常有经验的 Linux 程序员,也会在面试中陷入困境。 -这就导致了很多优秀并且有经验的人找不到合适的工作,所以我们可能需要一些手段来提高自己的竞争力。 +这就导致了很多优秀并且有经验的人无缘无故地找不到合适的工作,因为如今的就业市场需要我们有一些手段来提高自己的竞争力。 -我有两个同事和一个表哥,他们都有 RedHat 认证,管理过比较大的服务器机房,也都收到过老员工的推荐。 +我有两个同事和一个表哥,他们都有 RedHat 认证,管理过比较大的服务器机房,也都收到过前雇主的认真推荐。 -可是,在他们应聘的时候,所有的这些证书、本身的能力、工作经验好像都没有起到任何作用,他们面对的是一些 -从术语列表中临时挑选的一些技术词汇片段所组成的问题。 +可是,在他们应聘的时候,所有的这些证书、本身的能力、工作经验好像都没有起到任何作用,他们所面对的招聘广告是某人从技术词汇中临时挑选的一些“技能片段”所组成的。 -现如今,礼貌变得过时了,**不回应**变成了公司招人时最好的沟通方式。 +现如今,礼貌变得过时了,**不回应**变成了发布招聘广告的公司的新沟通方式。 这同样也意味着大多公司的招聘或者人事可能会**错过**非常优秀的应聘者。 我之所以敢说的如此肯定,是因为现在招聘广告大多数看上去都非常的滑稽。 -Walter ,[Reallylinux.com][3] 另一位特约撰稿人,发表过一篇关于 [招聘广告疯掉了][4] 的文章。 +[Reallylinux.com][3] 另一位特约撰稿人 Walter ,发表过一篇关于 [招聘广告疯掉了][4] 的文章。 -他说的没错,可是我认为 Linux 工作应聘者可以通过注意招聘广告的**三个关键词**避免落入陷阱。 +他说的也许是对的,可是我认为 Linux 工作应聘者可以通过注意招聘广告的**三个关键点**避免落入陷阱。 -首先,很少会有 Linux 领域的招聘广告只对 Linux 有要求 。 +**首先**,很少会有 Linux 系统管理员的招聘广告只针对 Linux 有要求。 -一定要注意 Linux 相关工作的工作场合,公司很有可能会要求你在服务器上跑 Linux ,另外,通过 “Linux” 搜索得到的结果有很多实际上是会涉及到 NX (数字化产品开发系统)的。 +一定要注意很少有 Linux 系统管理员的职位是实际在服务器上跑 Linux的,反而,很多在搜索 “Linux 管理员” 得到的职位实际上是指大量的 *NX 操作系统的。 -举个例子,现在有一则关于 **Linux 管理员招聘** 的招聘广告: -参与建立系统集成,尤其是 BSD 应用的系统安装... +举个例子,有一则关于 **Linux 管理员** 的招聘广告: + +> 该职位需要为建立系统集成提供支持,尤其是 BSD 应用的系统安装... 或者有一些其他的要求: -有 Windows 系统管理经验的 -最为讽刺的是,如果你在应聘面试的时候表现出精通 Linux 的话,你可能不会被聘用。 +> 有 Windows 系统管理经验的。 -另外,如果你直接把 Linux 写在你的特长或者专业上,他们可能都不会仔细看你的简历,因为他们根本区分不了 UNIX, BSD, Linux。 +最为讽刺的是,如果你在应聘面试的时候表现出专注于 Linux 的话,你可能不会被聘用。 -最终的结果就是,如果你只在简历上写了 Linux ,你可能会被直接掉,但是如果你改成 UNIX/Linux 的话,可能会走得更远。 +另外,如果你直接把 Linux 写在你的特长或者专业上,他们可能都不会仔细看你的简历,因为他们根本区分不了 UNIX、BSD、Linux。 -我有两个同事最后修改了他们的简历,然后获得了更好的面试机会,但是依旧没有被聘用,因为大多数招聘广告其实已经内定人员了,这些招聘信息被放出来仅仅是为了表现出他们有招聘的想法。 +最终的结果就是,如果你太老实,只在简历上写了 Linux,你可能会被直接过掉,但是如果你把 Linux 改成 UNIX/Linux 的话,可能会走得更远。 -第二点,公司里真正需要了解系统管理的只有特聘的科技主管,其他人包括人事或管理层根本不关心这个。 +我有两个同事最后修改了他们的简历,然后获得了更好的面试机会,虽然依旧没有被聘用,因为大多数招聘广告其实已经内定人员了,这些招聘信息被放出来仅仅是为了表现出他们有招聘的想法。 -我记得有一次开会的时候,听见一个执行副总裁把服务器管理人员说成“一毛钱一打的人”,这种想法是多么的奇怪啊。 +**第二点**,公司里唯一在乎系统管理员职位的只有技术主管,其他人包括人事或管理层根本不关心这个。 -讽刺的是,等到邮件系统出故障,交换机连接时不时会断开,或者核心商业文件从企业内网中消失的时候,这些总裁又是最先打电话给系统管理员的。 +我记得有一次开会旁听的时候,听见一个执行副总裁把服务器管理人员说成“一毛钱一打的人”,这种想法是多么的奇怪啊。 -或许如果他们不整天说些空话,或者不往邮件里塞满妻子的照片和旅行途中的照片的话,服务器可能就不会崩溃。 +讽刺的是,等到邮件系统出故障,电话交换机连接时不时会断开,或者核心商业文件从企业内网中消失的时候,这些总裁又是最先打电话给系统管理员的。 -在找工作的时候一定要关注招聘 Linux 运维或者服务器管理人员的广告,因为这种一般都是在公司技术层有迫切的需求的时候才会有的。你也不需要和人事或者公司高层聊什么,搞清楚谁要招聘然后打电话给他们。 +或许如果他们不整天在电话留言中说那么多空话,或者不往邮件里塞满妻子的照片和旅行途中的照片的话,服务器可能就不会崩溃。 -你需要直接联系他们因为有些技术问题人事是解决不了的,即使你只有 60 秒的时间可以和他们交流,你也必须抓住这个机会和真正有需求并且懂技术的人沟通。 +请注意,招聘 Linux 运维或者服务器管理员的广告被放出来是因为公司**技术层**认为有迫切的需求。你也不需要和人事或者公司高层聊什么,搞清楚谁是招聘的技术经理然后打电话给他们。 -那如果人事不让你进怎么办呢? +你需要直接联系他们因为“有些技术问题”是人事回答不了的,即使你只有 60 秒的时间可以和他们交流,你也必须抓住这个机会和真正有需求并且懂技术的人沟通。 -记得问人事一些技术性问题,比如说他们的 Linux 群组是如何建立的,能不能独立运行虚拟机。这些技术性的问题会让人事变得不耐烦,最后让你有机会问出“我能不能直接联系你们团队的技术人员”。 +那如果人事的漂亮 MM 不让你直接联系技术怎么办呢? -如果对方的回答是“应该可以”或者“稍后回复你”,那么他们可能已经在两周前就已经计划好了找一个人来填补这个空缺,比如说人事部员工的未婚夫。他们只是不希望看起来太像裙带主义,而是带有一点利己主义的不确定主义。 +开始记得问人事一些技术性问题,比如说他们的 Linux 集群是如何建立的,它们运行在独立的虚拟机上吗?这些技术性的问题会让人事变得不耐烦,最后让你有机会问出“我能不能直接联系你们团队的技术人员”。 -所以一定要记得花点时间弄清楚到底谁是发布招聘广告的直接技术负责人然后和他们聊一聊,这可能会让你少一番胡扯并且让你更有可能应聘成功。 +如果对方的回答是“应该可以”或者“稍后回复你”,那么他们可能已经在两周前就已经计划好了找一个人来填补这个空缺,比如说人事部员工的未婚夫。**他们只是不希望看起来太像裙带主义,而是带有一点利己主义的不确定主义。** -第三点,现在的广告很少有完全真实的内容了。 +所以一定要记得花点时间弄清楚到底谁是发布招聘广告的直接**技术**负责人,然后和他们聊一聊,这可能会让你少一番胡扯并且让你更有可能应聘成功。 -我以前见过一个招聘具有高级专家所不具备的专门知识的初级系统管理员的广告,计划是列出公司的发展计划蓝图,然后找到应聘者。 +**第三点**,现在的招聘广告很少有完全真实的内容了。 + +我以前见过一个招聘具有高级别专家也不会有的专门知识的初级系统管理员的广告,他们的计划是列出公司的发展计划蓝图,然后找到应聘者。 在这种情况下,你应聘 Linux 管理员职位应该提供几个关键性信息,例如工作经验和相关证书。 -诀窍在于,在你的简历中给出与他们的招聘信息相匹配的关键词,这样他们就基本找不到你存在的问题。 +诀窍在于,用这些关键词尽量装点你的简历,以匹配他们的招聘信息,这样他们几乎不可能发现你缺失了哪个关键词。 这并不一定会让你成功找到一份工作,但它可以让你获得一次面试机会,这也算是一个巨大的进步。 -通过理解和应用以上三点,或许可以让那些寻求 Linux 管理员工作的人能够比那些在地狱中只有一线希望的人有一个好的开始。 +通过理解和应用以上三点,或许可以让那些寻求 Linux 管理员工作的人能够比那些只有一线地狱机会的人领先一步。 即使这些建议不能让你马上得到面试机会,你也可以利用这些经验和意识去参加贸易展或公司主办的技术会议等活动。 -我强烈建议你们也经常参加这种活动,尤其是当它们时间比较接近的时候,可以给你一个扩展人脉的机会。 +我强烈建议你们也经常参加这种活动,尤其是当它们比较近的话,可以给你一个扩展人脉的机会。 -请记住,如今的“求职网日”已经失去了原来的意义了,现在只是可以用来获取“哪些公司实际上在招聘、哪些公司只是为了给股东带来增长的表象而在工作方面撒谎”的小道消息。 +请记住,如今的职业人脉已经失去了原来的意义了,现在只是可以用来获取“哪些公司实际上在招聘、哪些公司只是为了给股东带来增长的表象而在职位方面撒谎”的小道消息。 -------------------------------------------------------------------------------- @@ -83,7 +84,7 @@ via: http://reallylinux.com/docs/gettinglinuxjobs.shtml 作者:[Andrea W.Codingly][a] 译者:[Ryze-Borgia](https://github.com/Ryze-Borgia) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3a7cb9df70db0aff71d014f9101c05593116e309 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 30 Dec 2018 10:39:44 +0800 Subject: [PATCH 1123/1143] PUB:20180128 Getting Linux Jobs.md @Ryze-Borgia https://linux.cn/article-10397-1.html --- {translated/talk => published}/20180128 Getting Linux Jobs.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180128 Getting Linux Jobs.md (100%) diff --git a/translated/talk/20180128 Getting Linux Jobs.md b/published/20180128 Getting Linux Jobs.md similarity index 100% rename from translated/talk/20180128 Getting Linux Jobs.md rename to published/20180128 Getting Linux Jobs.md From a56d94e73f20c3181657965046c8523dcc061f99 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 30 Dec 2018 11:15:04 +0800 Subject: [PATCH 1124/1143] PRF:20181206 Take a break at the Linux command line with Nyan Cat.md @zhs852 --- ...at the Linux command line with Nyan Cat.md | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md b/translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md index 81e74a8a13..abb0559790 100644 --- a/translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md +++ b/translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md @@ -1,41 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (zhs852) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (Take a break at the Linux command line with Nyan Cat) [#]: via: (https://opensource.com/article/18/12/linux-toy-nyancat) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) [#]: url: ( ) -在 Linux 命令行中观看 Nyan Cat 来稍适休息 +在 Linux 命令行中观看彩虹猫来稍事休息 ====== + > 你甚至可以在终端里欣赏彩虹猫。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-nyancat.png?itok=eg1aEmBw) 今天是《Linux 命令行小玩具介绍》的第六天。在本系列文章中,我们将会探索一些娱乐用途(甚至有时完全没用)的 Linux 命令行小玩具。所有我们介绍的小玩具都是开源的。 -也许你会问,他们都很独特吗?是的。不过,他们对你是否独特,我就不知道了。但是,我们相信你应该能在这系列文章结束之前找到至少一个好玩的玩具。 +也许你会问,它们都很独特吗?是的。不过,它们对你是否独特,我就不知道了。但是,我们相信你应该能在这系列文章结束之前找到至少一个好玩的玩具。 从[昨天的选题][1]继续:我们谈到了猫和彩虹。不过,在 Linux 命令行下有更有趣的彩虹和猫结合的程序吗?答案是肯定的。 -我们不妨看看之前可以在命令行中使用 Nyan Cat 的方式吧。意料之中,2011 年发布的 [Nyan Cat][2] 可以用 **nyancat** 呈现在终端中。你想念这只曾火遍网络的 Nyan Cat 吗?看看下面这个视频记录吧,我会等你看完的。 +我们不妨看看之前可以在命令行中使用彩虹猫的方式吧。意料之中,2011 年发布的 [彩虹猫][2] 可以用 `nyancat` 呈现在终端中。你想念这只曾火遍网络的彩虹猫吗?看看下面这个视频记录吧,我会等你看完的。 - +- -现在,让我们在终端中重新感受这个令人惊奇的体验吧。**Nyancat** 包正在很多地方被分发(比如 Arch、Debian、Gentoo、Ubuntu 等等…),不过我的系统(Fedora)没有,但是我们仍然可以很轻松地从源码编译它。事实上,我们只需要一行命令就能做完所有工作: +现在,让我们在终端中重新感受这个令人惊奇的体验吧。`nyancat` 包正在很多发行版上(比如 Arch、Debian、Gentoo、Ubuntu 等等……)都有,不过我的系统(Fedora)没有,但是我们仍然可以很轻松地从源码编译它。 + +根据读者的一个很好的提醒,对于我来说,这应该在该系列中提及:要警惕从不受信任的来源安装应用程序,或者编译和运行你在网上找到的任何代码,就像你在这样的文章中找到这个一样。如果您不确定,请采取适当的预防措施,特别是如果您在生产机器上。 + +从这里克隆源代码: ``` -git clone https://github.com/klange/nyancat.git && cd nyancat && make && cd src && ./nyancat +git clone https://github.com/klange/nyancat.git ``` -这直接为我带来了一个 Nyan Cat 体验,甚至还有个计时器来显示我享受 “Nyan Cat 魔法”的时间。 +然后使用 `make` 编译,并用 `./nyancat` 来运行。 + +这直接为我带来了彩虹猫体验,甚至还有个计时器来显示我享受 “彩虹猫魔法”的时间。 ![](https://opensource.com/sites/default/files/uploads/linux-toy-nyancat-animated.gif) -你可以在 [GitHub][3] 上找到 **nyancat** 的源码,它正以 [NCSA 许可证][4] 开源。 +你可以在 [GitHub][3] 上找到 `nyancat` 的源码,它正以 [NCSA 许可证][4] 开源。 -命令行版本的 Nyan Cat 可在[这个公共 Telnet 服务器上访问][5](或者 [netcat][6] 也行),所以理论上来说你不必安装它。不过不幸的是,由于带宽限制,该服务器目前已经被关闭了。尽管如此,在各种老设备上连接老 Telnet 服务器上运行 Nyan Cat 的[照片][5]还是值得一看的,说不准你还会萌生搭建一个能让大家连接的公共服务器的想法呢(如果你真的搭建了,请务必告知作者,万一他们可能会向公众分享呢?)。 +命令行版本的彩虹猫可在[这个公共 Telnet 服务器上访问][5](或者用另外一个猫 [netcat][6] 也行),所以理论上来说你不必安装它。不过不幸的是,由于带宽限制,该服务器目前已经被关闭了。尽管如此,在各种老设备上连接老 Telnet 服务器上运行彩虹猫的[照片][5]还是值得一看的,说不准你还会萌生搭建一个能让大家连接的公共服务器的想法呢(如果你真的搭建了,请务必告知作者,万一他们可能会向公众分享呢?)。 你想让我介绍一下你最喜爱的命令行玩具吗?请在原文下留言,作者会考虑介绍的。 @@ -48,7 +55,7 @@ via: https://opensource.com/article/18/12/linux-toy-nyancat 作者:[Jason Baker][a] 选题:[lujun9972][b] 译者:[zhs852](https://github.com/zhs852) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c03a6f617a341f1f20caac85e1b7dd18aa7c410d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 30 Dec 2018 11:15:55 +0800 Subject: [PATCH 1125/1143] PUB:20181206 Take a break at the Linux command line with Nyan Cat.md @zhs852 https://linux.cn/article-10398-1.html --- ...06 Take a break at the Linux command line with Nyan Cat.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181206 Take a break at the Linux command line with Nyan Cat.md (98%) diff --git a/translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md b/published/20181206 Take a break at the Linux command line with Nyan Cat.md similarity index 98% rename from translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md rename to published/20181206 Take a break at the Linux command line with Nyan Cat.md index abb0559790..78674925a6 100644 --- a/translated/tech/20181206 Take a break at the Linux command line with Nyan Cat.md +++ b/published/20181206 Take a break at the Linux command line with Nyan Cat.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (zhs852) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (Take a break at the Linux command line with Nyan Cat) [#]: via: (https://opensource.com/article/18/12/linux-toy-nyancat) [#]: author: (Jason Baker https://opensource.com/users/jason-baker) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10398-1.html) 在 Linux 命令行中观看彩虹猫来稍事休息 ====== From fffdab2919ac6a970220af95710d80a61021c465 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 30 Dec 2018 19:33:54 +0800 Subject: [PATCH 1126/1143] PRF:20180716 Users, Groups and Other Linux Beasts- Part 2.md @MjSeven --- ..., Groups and Other Linux Beasts- Part 2.md | 51 +++++++++++-------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md b/translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md index c4f20dbf77..b71802c145 100644 --- a/translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md +++ b/translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md @@ -1,30 +1,35 @@ -用户、组及其他 Linux 特性:第二部分 +用户、组及其它 Linux 特性(二) ====== +> 我们继续创建和管理用户和组的 Linux 教程之旅。 -![](https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts-part-2) +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/ducks-94911_1920.jpg?itok=7_ZPiph7) -在正在进行的 Linux 之旅中,我们了解了[如何操作文件夹或目录][1],现在我们继续讨论 _权限_,_用户_ 和 _组_,这对于确定谁可以操作哪些文件和目录是必要的。[上次][2],我们展示了如何创建新用户,现在我们将重新来一遍: +在正在进行的 Linux 之旅中,我们了解了[如何操作文件夹或目录][1],现在我们继续讨论 _权限_、_用户_ 和 _组_,这对于确定谁可以操作哪些文件和目录是必要的。[上次][2],我们展示了如何创建新用户,现在我们将重新起航: 你可以使用 `groupadd` 命令创建新组,然后随意添加用户。例如,使用: + ``` sudo groupadd photos ``` -这将会创建 _photos_ 组。 +这将会创建 `photos` 组。 你需要在根目录下[创建一个目录][1]: + ``` sudo mkdir /photos ``` 如果你运行 `ls -l /`,结果中会有如下这一行: + ``` drwxr-xr-x 1 root root 0 jun 26 21:14 photos ``` -输出中的第一个 _root_ 是所属的用户,第二个 _root_ 是所属的组。 +输出中的第一个 `root` 是所属的用户,第二个 `root` 是所属的组。 + +要将 `/photos` 目录的所有权转移到 `photos` 组,使用: -要将 _/photos_ 目录的所有权转移到 _photos_ 组,使用: ``` chgrp photos /photos ``` @@ -32,49 +37,53 @@ chgrp photos /photos `chgrp` 命令通常采用两个参数,第一个参数是将要获得文件或目录所有权的组,第二个参数是希望交给组的文件或目录。 接着,运行 `ls -l /`,你会发现刚才那一行变了: + ``` drwxr-xr-x 1 root photos 0 jun 26 21:14 photos ``` -你已成功将新目录的所有权转移到了 _photos_ 组。 +你已成功将新目录的所有权转移到了 `photos` 组。 + +然后,将你自己的用户和 `guest` 用户添加到 `photos` 组: -然后,将你自己的用户和 _guest_ 用户添加到 _photos_ 组: ``` sudo usermod <你的用户名> -a -G photos sudo usermod guest -a -G photos ``` -你可能必须注销并重新登录才能看到更改,但是当你这样做时,运行 `groups` 会将 _photos_ 显示为你所属的组之一。 +你可能必须注销并重新登录才能看到更改,但是当你这样做时,运行 `groups` 会将 `photos` 显示为你所属的组之一。 + +关于上面提到的 `usermod` 命令,需要指明几点。第一:注意要使用 `-G` 选项而不是 `-g` 选项。`-g` 选项更改你的主要组,如果你意外地使用它,它可能会锁定你的一些东西。另一方面,`-G` 将你添加到列出的组中,并没有干扰主要组。如果要将用户添加到多个组中,在 `-G` 之后逐个列出它们,用逗号分隔,不要有空格: -(to 校正:这里的 primary group 翻译成什么更好点呢) -关于上面提到的 `usermod` 命令,需要指明几点。第一:注意要使用 `-G` 选项而不是 `-g` 选项。`-g` 选项更改你的主要组,如果你意外地使用它,它可能会锁定你的一些东西。另一方面,`-G` 将你 _添加(add)_ 到列出的组中,并没有干扰主要组。如果要将用户添加到多个组中,在 `-G` 之后逐个列出他们,用逗号分隔,不要有空格: ``` sudo usermod -a -G photos,pizza,spaceforce ``` -第二点:小心点不要忘记 `-a` 参数。`-a` 参数代表 _追加(append)_,将你传递给 `-G` 的组列表附加到你已经属于的组。这意味着,如果你不包含 `-a`,那么你之前所属的组列表将被覆盖,再次将你从你需要的东西中锁定。(to 校正:最后这句话什么意思呢) +第二点:小心点不要忘记 `-a` 参数。`-a` 参数代表追加,将你传递给 `-G` 的组列表附加到你已经属于的组。这意味着,如果你不包含 `-a`,那么你之前所属的组列表将被覆盖,再次将你拒之门外。 -这些都不是灾难性问题,但这意味着你必须手动将用户添加回你所属的所有组,这可能是个麻烦,特别是如果你失去了对 _sudo_ 和 _wheel_ 组的访问权限。 +这些都不是灾难性问题,但这意味着你必须手动将用户添加回你所属的所有组,这可能是个麻烦,特别是如果你失去了对 `sudo` 和 `wheel` 组的访问权限。 ### 权限 -在将图像复制到 _/photos_ 目录之前,还要做一件事情。注意,当你执行上面的 `ls -l /` 时,该文件夹的权限将以 _drwxr-xr-x_ 形式返回。 +在将图像复制到 `/photos` 目录之前,还要做一件事情。注意,当你执行上面的 `ls -l /` 时,该文件夹的权限将以 `drwxr-xr-x` 形式返回。 -如果你阅读[我在本文开头推荐的文章][3],你将知道第一个 _d_ 表示文件系统中的条目是一个目录,接着你有三组三个字符 (_rwx_, _r-x_, _r-x_),它们表示目录的所属用户 (_rwx_) 的权限,然后是所属组 (_r-x_)的权限,最后是其他用户 (_r-x_) 的权限。这意味着到目前为止唯一具有写权限的人,即能够在 _/photos_ 目录中复制或创建文件的唯一人员是 _root_ 用户。 +如果你阅读[我在本文开头推荐的文章][3],你将知道第一个 `d` 表示文件系统中的条目是一个目录,接着你有三组三个字符(`rwx`、`r-x`、`r-x`),它们表示目录的所属用户(`rwx`)的权限,然后是所属组(`r-x`)的权限,最后是其他用户(`r-x`)的权限。这意味着到目前为止唯一具有写权限的人,即能够在 `/photos` 目录中复制或创建文件的唯一人员是 `root` 用户。 但是[我提到的那篇文章也告诉你如何更改目录或文件的权限][3]: + ``` sudo chmod g+w /photos ``` -运行 `ls -l /`,你会看到 _/photos_ 权限变为了 _drwxrwxr-x_。这就是你希望的:组成员现在可以对目录进行写操作了。 +运行 `ls -l /`,你会看到 `/photos` 权限变为了 `drwxrwxr-x`。这就是你希望的:组成员现在可以对目录进行写操作了。 现在你可以尝试将图像或任何其他文件复制到目录中,它应该没有问题: + ``` cp image.jpg /photos ``` -_guest_ 用户也可以从目录中读取和写入。他们也可以读取和写入,甚至移动或删除共享目录中其他用户创建的文件。(to 校正:这里 guest 可以从目录中读取和写入吗?guest 不应该是 r-x 权限吗?) +`guest` 用户也可以从目录中读取和写入。他们也可以读取和写入,甚至移动或删除共享目录中其他用户创建的文件。 ### 总结 @@ -84,7 +93,7 @@ Linux 中的权限和特权系统已经磨练了几十年,它继承自昔日 回头见! -通过 Linux 基金会和 edX 的免费[" Linux 简介"][4]课程了解有关 Linux 的更多信息。 +通过 Linux 基金会和 edX 的免费[“Linux 简介”][4]课程了解有关 Linux 的更多信息。 -------------------------------------------------------------------------------- @@ -94,12 +103,12 @@ via: https://www.linux.com/blog/learn/intro-to-linux/2018/7/users-groups-and-oth 作者:[Paul Brown][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[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/) 荣誉推出 [a]:https://www.linux.com/users/bro66 -[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux -[2]:https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts +[1]:https://linux.cn/article-10066-1.html +[2]:https://linux.cn/article-10370-1.html [3]:https://www.linux.com/learn/understanding-linux-file-permissions [4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 682e52dc1fc4cdec5629af8790af60e8104ce8fa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 30 Dec 2018 19:34:14 +0800 Subject: [PATCH 1127/1143] PUB:20180716 Users, Groups and Other Linux Beasts- Part 2.md @MjSeven https://linux.cn/article-10399-1.html --- .../20180716 Users, Groups and Other Linux Beasts- Part 2.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180716 Users, Groups and Other Linux Beasts- Part 2.md (100%) diff --git a/translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md b/published/20180716 Users, Groups and Other Linux Beasts- Part 2.md similarity index 100% rename from translated/tech/20180716 Users, Groups and Other Linux Beasts- Part 2.md rename to published/20180716 Users, Groups and Other Linux Beasts- Part 2.md From 7d70f5891f949b2c76a4f4841fac43c6a66d46f4 Mon Sep 17 00:00:00 2001 From: WangYue <815420852@qq.com> Date: Sun, 30 Dec 2018 20:27:38 +0800 Subject: [PATCH 1128/1143] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=2020180625=208=20reasons=20to=20use=20the=20Xfce=20Linux=20des?= =?UTF-8?q?ktop=20environment.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 申请翻译 20180625 8 reasons to use the Xfce Linux desktop environment.md --- ...80625 8 reasons to use the Xfce Linux desktop environment.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20180625 8 reasons to use the Xfce Linux desktop environment.md b/sources/talk/20180625 8 reasons to use the Xfce Linux desktop environment.md index 254f725a36..974faa1f75 100644 --- a/sources/talk/20180625 8 reasons to use the Xfce Linux desktop environment.md +++ b/sources/talk/20180625 8 reasons to use the Xfce Linux desktop environment.md @@ -1,3 +1,5 @@ +translating by WangYueScream +=========================== 8 reasons to use the Xfce Linux desktop environment ====== From 6cd035ec1a0028c16ffd633ac0ccae06438f8b6b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 31 Dec 2018 00:17:33 +0800 Subject: [PATCH 1129/1143] PRF:20180130 Graphics and music tools for game development.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @robsean 翻译的不够认真,希望下回再接再厉。 --- ...cs and music tools for game development.md | 98 ++++++++++--------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/translated/tech/20180130 Graphics and music tools for game development.md b/translated/tech/20180130 Graphics and music tools for game development.md index 1cdb157bc4..7e77e30d67 100644 --- a/translated/tech/20180130 Graphics and music tools for game development.md +++ b/translated/tech/20180130 Graphics and music tools for game development.md @@ -1,133 +1,135 @@ 用于游戏开发的图形和音乐工具 ====== +> 要在三天内打造一个可玩的游戏,你需要一些快速而稳定的好工具。 ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Life_opengame.png?itok=JPxruL3k) -在十月初,我们的俱乐部,来自马歇尔大学的 [Geeks and Gadgets][1] , 参加就职 [Open Jam][2], 一个游戏 jam ,庆祝最好的开源工具。游戏 jams 是参与者为娱乐像团队协作的来开发计算机游戏的事件。Jams 倾向于非常简短--仅三天时间长--并非常让人精疲力尽。Opensource.com 在八月下旬 [宣布][3] Open Jam ,更多 [three dozen games][4] 进入到竞赛中。 +在十月初,我们的俱乐部马歇尔大学的 [Geeks and Gadgets][1] 参加了首次 [Open Jam][2],这是一个庆祝最佳开源工具的游戏 Jam。游戏 Jam 是一种活动,参与者以团队协作的方式来开发有趣的计算机游戏。Jam 一般都很短,仅有三天,并且非常累。Opensource.com 在八月下旬[发布了][3] Open Jam 活动,足有 [45 支游戏][4] 进入到了竞赛中。 -我们的俱乐部希望在我们的工程中创建和使用开放源码软件,所以 Open Jam 自然是我们想要参与的 jam 。我们的提交的文件是一个实验性的名称为 [Mark My Words][5] 的游戏。我们使用多种自由和开放源码 (FOSS) 工具来开发它;在这篇文章中,我们将讨论一些我们使用和意识到有潜在的障碍物的工具。 +我们的俱乐部希望在我们的项目中创建和使用开放源码软件,所以 Open Jam 自然是我们想要参与的 Jam 了。我们提交的游戏是一个实验性的游戏,名为 [Mark My Words][5]。我们使用了多种自由和开放源码 (FOSS) 工具来开发它;在这篇文章中,我们将讨论一些我们使用的工具和我们注意到可能有潜在阻碍的地方。 ### 音频工具 #### MilkyTracker -[MilkyTracker][6] 是最好的可用于构成旧样式电子游戏音乐的软件包中的一个。它是一个 [music tracker][7] 的一个示例,一个强大的带有特殊的基于网格的图形编辑器的 MOD 和 XM 文件创建器。在我们的游戏中,我们使用它来构成大多数的音乐片段。这个程序最好的特点是,它比我们其它的大多数工具消耗更少的硬盘空间和 RAM 。虽然如此,MilkyTracker 仍然非常强大。 +[MilkyTracker][6] 是一个可用于编曲老式视频游戏中的音乐的软件包。它是一种[音乐声道器][7]music tracker,是一个强大的 MOD 和 XM 文件创建器,带有基于特征网格的模式编辑器。在我们的游戏中,我们使用它来编曲大多数的音乐片段。这个程序最好的地方是,它比我们其它的大多数工具消耗更少的硬盘空间和内存。虽然如此,MilkyTracker 仍然非常强大。 ![](https://opensource.com/sites/default/files/u128651/mtracker.png) -用户界面需要一会来习惯,这里有对一些想试用MilkyTracker的音乐家的一些提示: +其用户界面需要一会来习惯,这里有对一些想试用 MilkyTracker 的音乐家的一些提示: - * 转到 Config > Misc. ,设置 edit 模式控制样式为 "MilkyTracker." 这将给你几乎所有的现代键盘快捷方式 - * 撤销 Ctrl+Z - * 重做 Ctrl+Y - * 切换 pattern-edit 模式 空格键 - * 删除先前的注释 退格键 - * 插入一行 Insert键 - * 默认情况下,一个注释将持续作用,直到它在这频道上被替换。你可以明确地结束一个注释,通过使用一个反引号 (`) 键插入一个 KeyOff 注释 - * 在你开始谱写乐曲前,你将不得不创建或查找示例。我们建议在网站上查找 [Creative Commons][8] 协议的示例,例如 [Freesound][9] 或 [ccMixter][10] + * 转到 “Config > Misc.” ,设置编辑模式的控制风格为 “MilkyTracker”,这将给你提供几乎全部现代键盘快捷方式。 + * 用 `Ctrl+Z` 撤销 + * 用 `Ctrl+Y` 重做 + * 用空格键切换模式编辑方式 + * 用退格键删除先前的音符 + * 用插入键来插入一行 + * 默认情况下,一个音符将持续作用,直到它在该频道上被替换。你可以明确地结束一个音符,通过使用一个反引号(`)键来插入一个 KeyOff 音符 + * 在你开始谱写乐曲前,你需要创建或查找采样。我们建议在诸如 [Freesound][9] 或 [ccMixter][10] 这样的网站上查找采用 [Creative Commons][8] 协议的采样, - - -另外,保持 [MilkyTracker 文档页面][11] 在手边。它含有数不清的教程和手册的链接。一个好的开始点是在该项目 wiki 上的 [MilkyTracker 指南][12] 。 +另外,把 [MilkyTracker 文档页面][11] 放在手边。它含有数不清的教程和手册的链接。一个好的起点是在该项目 wiki 上的 [MilkyTracker 指南][12]。 #### LMMS -我们中的两个音乐家使用多用途和现代音乐创建工具 [LMMS][13] 。它带来一个绝妙的示例和效果库,加一个灵活的多种多样的插件来生成独特的声音。 The learning curve for LMMS 的学习曲线令人吃惊的低,在某种程度上是因为友好的节拍/低音线编辑器。 +我们的两个音乐家使用多用途的现代音乐创建工具 [LMMS][13]。它带有一个绝妙的采样和效果库,以及多种多样的灵活的插件来生成独特的声音。LMMS 的学习曲线令人吃惊的低,在某种程度上是因为其好用的节拍/低音线编辑器。 ![](https://opensource.com/sites/default/files/u128651/lmms_plugins.png) -我们对音乐家有一个建议,尝试 LMMS:使用插件。 对于 [chiptune][14]-样式音乐,我们推荐 [sfxr][15] ,[BitInvader][16] ,和 [FreeBoy][17] 。对于其它样式, [ZynAddSubFX][18] 是一个好的选择。它带来一个宽波段的可以被你任意更改的人工合成工具。 +我们对于想试试 LMMS 的音乐家有一个建议:使用插件。对于 [chiptune][14]式音乐,我们推荐 [sfxr][15]、[BitInvader][16] 和 [FreeBoy][17]。对于其它风格,[ZynAddSubFX][18] 是一个好的选择。它配备了各种合成仪器,可以根据您的需要进行更改。 ### 图形工具 #### Tiled -在开放源码游戏开发中,[Tiled][19] 是一个流行的组件地图类(tilemap)编辑器。我们使用它为来为我们在游戏场景中组合连续的,复古的背景。 +在开放源码游戏开发中,[Tiled][19] 是一个流行的贴片地图编辑器。我们使用它为来为我们在游戏场景中组合连续的、复古式的背景。 ![](https://opensource.com/sites/default/files/u128651/tiled.png) -Tiled 可以导出地图为 XM L,JSON ,或平坦的图像。它是稳定的和跨平台的。 +Tiled 可以导出地图为 XML、JSON 或普通的图片。它是稳定的、跨平台的。 -Tiled 的特征一,在 jam 期间,我们不能使用, 允许你定义和随意的放置游戏对象,例如硬币和永久能力提升道具到地图上。你需要做的全部是加载对象的图像为一个平铺显示集,然后使用插入平铺显示放置它们。 +Tiled 的功能之一允许你在地图上定义和放置随意的游戏对象,例如硬币和提升道具,但在 jam 期间我们没有使用它。你需要做的全部是以贴片集的方式加载对象的图像,然后使用“插入平铺”来放置它们。 -一般来说,对于一些需要一个地图编辑器的工程,Tiled 是我们建议软件的一个主要的部分。 +一般来说,对于需要一个地图编辑器的项目,Tiled 是我们所推荐的软件中一个不可或缺的部分。 #### Piskel -[Piskel][20] 是一个像素艺术编辑器,它的源文件代码是在 [Apache 协议, 版本 2.0][21] 协议下。在 jam 期间,我们对我们的大多数的图像资源使用 Piskel ,我们当然也将在未来的工程中使用它。 +[Piskel][20] 是一个像素艺术编辑器,它的源文件代码以 [Apache 2.0 协议][21] 发布。在这次 Jam 期间,们的大多数的图像资源都使用 Piskel 来处理,我们当然也将在未来的工程中使用它。 -Piskel 的特征二,在 jam 的 onion skin和Spritesheet导出期间极大地帮助我们。 +在这个 Jam 期间,Piskel 极大地帮助我们的两个功能是洋葱皮Onion skin精灵序列图spritesheet导出。 -##### Onion skin +##### 洋葱皮 -onion skin 特征将使 Piskel 显示你编辑的动画的前一帧和后一帧的一个幽灵似的覆盖物,像这样: +洋葱皮功能将使 Piskel 以虚影显示你编辑的动画的前一帧和后一帧的,像这样: ![](https://opensource.com/sites/default/files/u128651/onionshow.gif) -Onion skin 是便于使用的,因为它适合作为一个绘制指南和在动画进程期间帮助你维护在你的角色上连续的图形和声音。为启用它,只需要在屏幕的右上方预览窗体的下面单击 onion-shaped 图标。 +洋葱皮是很方便的,因为它适合作为一个绘制指引和帮助你在整个动画进程中保持角色的一致形状和体积。 要启用它,只需单击屏幕右上角预览窗口下方的洋葱形图标即可。 ![](https://opensource.com/sites/default/files/u128651/onionenable.png) -##### Spritesheet 导出 +##### 精灵序列图导出 -Piskel 的能力是导出动画为一个 spritesheet ,也是非常有用的。一个 spritesheet 是一个单个光栅图象,它包含一个动画的所有的帧。例如,这是一个我们从 Piskel 导出的 spritesheet : +Piskel 将动画导出为精灵序列图的能力也非常有用。精灵序列图是一个包含动画所有帧的光栅图像。例如,这是我们从 Piskel 导出的精灵序列图: ![](https://opensource.com/sites/default/files/u128651/sprite-artist.png) -spritesheet 包含两幅帧。一幅帧是图像的上半部分,另一帧是图像的下半部分。Spritesheets 通过启用一个完整的动画来从单个文件加载,大大地简化一个游戏的代码。这是上面的 spritesheet 的一个动画版本: +该精灵序列图包含两帧。一帧位于图像的上半部分,另一帧位于图像的下半部分。精灵序列图通过从单个文件加载整个动画,大大简化了游戏的代码。这是上面精灵序列图的动画版本: ![](https://opensource.com/sites/default/files/u128651/sprite-artist-anim.gif) ##### Unpiskel.py -在 jam 期间,我们很多次想批量转换 Piskel 文件到 PNG 文件。尽管 Piskel 文件格式基于 JSON ,我们写一个小的 GPLv3 协议的称为 [unpiskel.py][22] 的 Python 脚本来做转换。 +在 Jam 期间,我们很多次想批量转换 Piskel 文件到 PNG 文件。由于 Piskel 文件格式基于 JSON,我们写一个基于 GPLv3 协议的名为 [unpiskel.py][22] 的 Python 小脚本来做转换。 + +它像这样被调用的: -它像这样被引用: ``` python unpiskel.py input.piskel ``` -这个脚本将从一个 Piskel 文件(这里 `input.piskel`)中提取 PNG 数据帧和层,并存储它们在它们拥有的文件中。这些文件采用模式 `NAME_XX_YY.png` ,在这里 `NAME` 是 Piskel 文件的缩减名称,`XX` 是帧的编号,`YY` 是层的编号。 +这个脚本将从一个 Piskel 文件(这里是 `input.piskel`)中提取 PNG 数据帧和图层,并将它们各自存储。这些文件采用模式 `NAME_XX_YY.png` 命名,在这里 `NAME` 是 Piskel 文件的缩减名称,`XX` 是帧的编号,`YY` 是层的编号。 + +因为脚本可以从一个 shell 中调用,它可以用在整个文件列表中。 -因为脚本可以从一个 shell 中引用,它可以被使用在文件的整个列表中。 ``` for f in *.piskel; do python unpiskel.py "$f"; done ``` -### Python, Pygame, 和 cx_Freeze +### Python、Pygame 和 cx_Freeze #### Python 和 Pygame -我们使用 [Python][23] 语言来自制作我们的游戏。它是一个脚本语言,通常被用于文本处理和桌面应用程序开发。它也可以用于游戏开发,例如工程,像 [Angry Drunken Dwarves][24] 和 [Ren'Py][25] 已经显示。这两个工程都使用一个称为 [Pygame][26] 的 Python 库来显示图形和产生声音,所以我们也决定在 Open Jam 中使用这个库。 +我们使用 [Python][23] 语言来制作我们的游戏。它是一个脚本语言,通常被用于文本处理和桌面应用程序开发。它也可以用于游戏开发,例如像 [Angry Drunken Dwarves][24] 和 [Ren'Py][25] 这样的项目所展示的。这两个项目都使用一个称为 [Pygame][26] 的 Python 库来显示图形和产生声音,所以我们也决定在 Open Jam 中使用这个库。 -Pygame 被证明是既稳定又富有特色,并且它对我们创建的街机游戏来说是优秀的。在低分辨率时,库的速度足够快的,但是在高分辨率时,它的仅 CPU 渲染开始变慢。这是因为 Pygame 不使用硬件加速渲染。然而,开发者可以充分利用 OpenGL 基础设施。 +Pygame 被证明是既稳定又富有特色,并且它对我们创建的街机式游戏来说是很棒的。在低分辨率时,库的速度足够快的,但是在高分辨率时,它只用 CPU 的渲染开始变慢。这是因为 Pygame 不使用硬件加速渲染。然而,开发者可以充分利用 OpenGL 基础设施的优势。 -如果你正在寻找一个好的 2D 游戏编程库,Pygame 是值得密切注意的一个。它的网站有 [一个好的教程][27] 来开始。务必看看它! +如果你正在寻找一个好的 2D 游戏编程库,Pygame 是值得密切注意的一个。它的网站有 [一个好的教程][27] 可以作为起步。务必看看它! #### cx_Freeze -准备发行我们的游戏是有趣的。我们知道,Windows 用户不喜欢有一个 Python 安装,并且要求他们来安装它可能很过分。除此之外,他们也可能不得不安装 Pygame ,在 Windows 上,这不是一个简单的工作。 +准备发行我们的游戏是有趣的。我们知道,Windows 用户不喜欢装一套 Python,并且要求他们来安装它可能很过分。除此之外,他们也可能必须安装 Pygame,在 Windows 上,这不是一个简单的工作。 -有一件事很清楚:我们不得不放置我们的游戏到一个更方便的结构中。很多其他的 Open Jam 参与者使用专有的游戏引擎 Unity ,它能够使它们的游戏在网页浏览器中来玩。这使得它们非常方便地来玩。便利性是一个我们的游戏恰巧一丝的都没有的东西。但是,感谢生机勃勃的 Python 生态系统,我们有选择。在 Windows 上现有的工具帮助 Python 程序员准备发行他们的游戏。我们考虑的两个是 [cx_Freeze][28] 和 [Pygame2exe][29] (它使用 [py2exe][30])。我们下决心在 cx_Freeze 上,因为它是跨平台的。 +很显然:我们必须放置我们的游戏到一个更方便的格式中。很多其他的 Open Jam 参与者使用专有的游戏引擎 Unity,它能够使他们的游戏在网页浏览器中来玩。这使得它们非常方便地来玩。便利性是一个我们的游戏中根本不存在的东西。但是,感谢生机勃勃的 Python 生态系统,我们有选择。已有的工具可以帮助 Python 程序员将他们的游戏做成 Windows 上的发布版本。我们考虑过的两个工具是 [cx_Freeze][28] 和 [Pygame2exe][29](它使用 [py2exe][30])。我们最终决定用 cx_Freeze,因为它是跨平台的。 + +在 cx_Freeze 中,你可以把一个单脚本游戏打包成发布版本,只要在 shell 中运行一个命令,像这样: -在 cx_Freeze 中,你可以为发行版打包一个单个脚本游戏,只要在shell运行一个命令,像这样: ``` cxfreeze main.py --target-dir dist ``` -`cxfreeze` 的这个调用将拿你的脚本(这里 `main.py`) 和在你系统上的 Python 解释器,并捆绑定它们到 `dist` 目录。一旦完成它,你需要做的是手动复制你的游戏的数据文件到 `dist` 目录。你将发现,`dist` 目录包含一个可以运行来开始你的游戏的可执行文件。 +`cxfreeze` 的这个调用将把你的脚本(这里是 `main.py`)和在你系统上的 Python 解释器捆绑到到 `dist` 目录。一旦完成,你需要做的是手动复制你的游戏的数据文件到 `dist` 目录。你将看到,`dist` 目录包含一个可以运行来开始你的游戏的可执行文件。 -这里有更复杂难解的方法来使用 cx_Freeze ,允许你自动地复制数据文件,但是我们发现简单的调用 `cxfreeze` 足够我们的需要。感谢这个工具,我们使我们的游戏稍微便利的运行。 +这里有使用 cx_Freeze 的更复杂的方法,允许你自动地复制数据文件,但是我们发现简单的调用 `cxfreeze` 足够满足我们的需要。感谢这个工具,我们使我们的游戏玩起来更便利一些。 -### 庆祝开放源码 +### 庆祝开源 -Open Jam 是重要的,因为它庆祝软件开发的开放源码模式。这是来分析开放源码工具的当前状态和我们在未来工作中需求的一个机会。,对于游戏开发者来设法推动它们的工具的使用范围,学习必需提高未来游戏开发者的益处,游戏 jams 或许是最好的时间。 +Open Jam 是庆祝开源模式的软件开发的重要活动。这是一个分析开源工具的当前状态和我们在未来工作中需求的一个机会。对于游戏开发者探求其工具的使用极限,学习未来游戏开发所必须改进的地方,游戏 Jam 或许是最好的时机。 -开放源码工具使人们能够探索他们的创造性,而不妥协他们的自由和前期的投资。尽管我们可能不能成为专业的游戏开发者,我们仍然能获取它的一段小的体验,使用我们简短的,实验性的称为 [Mark My Words][5] 的游戏。它是一个语言学方面地的有特定主题的游戏,它描述一个小说写作系统在它历史期间的演化。Open Jam 有一些令人愉快的提交,并且它们是值得校核。真的, [去看看][31] ! +开源工具使人们能够在不损害自由的情况下探索自己的创造力,而无需预先投入资金。虽然我们可能不会成为专业的游戏开发者,但我们仍然能够通过我们的简短的实验性游戏 [Mark My Words][5] 获得一点点体验。它是一个以语言学为主题的游戏,描绘了虚构的书写系统在其历史中的演变。还有很多其他不错的作品提交给了 Open Jam,它们都值得一试。 真的,[去看看][31]! -在结束前,我们想要感谢所有的 [参加俱乐部的成员][32],使这次经历真正的有价值。我们也想要感谢 [Michael Clayton][33],[Jared Sprague][34] 和 [Opensource.com][35] 主办 open Jam。它是一次欢乐。 +在本文结束前,我们想要感谢所有的 [参加俱乐部的成员][32],使得这次经历真正的有价值。我们也想要感谢 [Michael Clayton][33]、[Jared Sprague][34] 和 [Opensource.com][35] 主办 Open Jam。简直酷毙了。 -现在,我们对读者有一些问题。你是一个 FOSS 游戏开发者吗?你选择的工具是什么?务必在下面留下一个评论! +现在,我们对读者提出了一些问题。你是一个 FOSS 游戏开发者吗?你选择的工具是什么?务必在下面留下一个评论! -------------------------------------------------------------------------------- @@ -135,7 +137,7 @@ via: https://opensource.com/article/18/1/graphics-music-tools-game-dev 作者:[Charlie Murphy][a] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a4675e566aaec6f516f808efe995ff489fd2d898 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 31 Dec 2018 00:18:02 +0800 Subject: [PATCH 1130/1143] PUB:20180130 Graphics and music tools for game development.md @robsean https://linux.cn/article-10400-1.html --- .../20180130 Graphics and music tools for game development.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180130 Graphics and music tools for game development.md (100%) diff --git a/translated/tech/20180130 Graphics and music tools for game development.md b/published/20180130 Graphics and music tools for game development.md similarity index 100% rename from translated/tech/20180130 Graphics and music tools for game development.md rename to published/20180130 Graphics and music tools for game development.md From 102c89d8621e0d376c3fb053b53f3c6d5c0f5410 Mon Sep 17 00:00:00 2001 From: Ryze-Borgia <42087725+Ryze-Borgia@users.noreply.github.com> Date: Mon, 31 Dec 2018 18:14:56 +0800 Subject: [PATCH 1131/1143] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20180914 A day in the life of a log message.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180914 A day in the life of a log message.md b/sources/tech/20180914 A day in the life of a log message.md index 8d60ec9fe6..cc6ebd0f5b 100644 --- a/sources/tech/20180914 A day in the life of a log message.md +++ b/sources/tech/20180914 A day in the life of a log message.md @@ -1,3 +1,4 @@ +Ryze-Borgia is translating A day in the life of a log message ====== From 83acec62165c1605823c6abcc48b47e7bfddeed0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 31 Dec 2018 20:24:23 +0800 Subject: [PATCH 1132/1143] PRF:20171111 A CEOs Guide to Emacs.md @oneforalone --- .../tech/20171111 A CEOs Guide to Emacs.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/translated/tech/20171111 A CEOs Guide to Emacs.md b/translated/tech/20171111 A CEOs Guide to Emacs.md index 9e7f9290d4..670b8e78f9 100644 --- a/translated/tech/20171111 A CEOs Guide to Emacs.md +++ b/translated/tech/20171111 A CEOs Guide to Emacs.md @@ -1,15 +1,15 @@ -一位 CEO 的 Emacs 指南(备选:CEO 的 Emacs 秘籍) +一位 CEO 的 Emacs 秘籍 =========== 几年前,不,是几十年前,我就在用 Emacs。不论是码代码、编写文档,还是管理邮件和日程,我都用这个编辑器,或者是说操作系统,而且我还乐此不疲。许多年过去了,我也转向了其他更新、更好的工具。结果,就连最基本的文件浏览,我都已经忘了在不用鼠标的情况下该怎么操作。大约三个月前,我意识到我在应用程序和计算机之间切换上耗费了大量的时间,于是我决定再次使用 Emacs。这是个很正确的决定,原因有以下几个。其中包括用 `.emacs` 和 Dropbox 来搭建一个良好的、可移植的环境的一些技巧。 -对于那些还没用过 Emacs 的人来说,Emacs 会让你爱恨交加。它有点像一个房子大小的鲁布·戈德堡机械Rube Goldberg machine,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键词是“乍一看”。一旦你了解了 Emacs,你就会意识到它其实是一台可以当发动机用的的热核烤面包机……好吧,只是文本处理的所有事情。当考虑到你计算机的使用周期在很大程度上都是与文本有关时,这是一个相当大胆的声明。大胆,但却是真的。 +对于那些还没用过 Emacs 的人来说,Emacs 会让你爱恨交加。它有点像一个房子大小的鲁布·戈德堡机械Rube Goldberg machine,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键词是“乍一看”。一旦你了解了 Emacs,你就会意识到它其实是一台可以当发动机用的的热核烤面包机……好吧,只是指文本处理的所有事情。当考虑到你计算机的使用周期在很大程度上都是与文本有关时,这是一个相当大胆的声明。大胆,但却是真的。 也许对我来说更重要的是,Emacs 是我曾经使用过的一个应用,并让我觉得我真正的拥有它,而不是把我塑造成一个匿名的“用户”,就好像位于 [Soma][30](LCTT 译注:旧金山的一个街区)或雷蒙德(LCTT 译注:微软总部所在地)附近某个高档办公室的产品营销部门把钱作为明确的目标一样。现代生产力和创作应用程序(如 Pages 或 IDE)就像碳纤维赛车,它们装备得很好,也很齐全。而 Emacs 就像一盒经典的 [Campagnolo][31] (LCTT 译注:世界上最好的三个公路自行车套件系统品牌之一)零件和一个漂亮的自行车牵引式钢框架,但缺少曲柄臂和刹车杆,你必须在网上某个小众文化中找到它们。前者更快而且很完整,后者是无尽的快乐或烦恼的源泉,当然这取决于你自己,而且这种快乐或烦恼会伴随到你死。我就是那种在找到一堆老古董或用 `Emacs Lisp` 配置编辑器时会感到高兴的人,具体情况因人而异。 ![1933 steel bicycle](https://www.fugue.co/hubfs/Imported_Blog_Media/bicycle-1.jpg) -*一辆我还在骑的1933年产的钢制自行车。你可以看看框架管差别: [https://www.youtube.com/watch?v=khJQgRLKMU0][6]* +*一辆我还在骑的 1933 年产的钢制自行车。你可以看看框架管差别: [https://www.youtube.com/watch?v=khJQgRLKMU0][6]* 这可能给人一种 Emacs 已经过气或过时的印象。然而并不是,Emacs 是强大和永恒的,只要你耐心地去理解它的一些规则。Emacs 的规则很另类,也很奇怪,但其中的逻辑却引人注目,且魅力十足。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这里。 @@ -29,7 +29,7 @@ Org 模式本身就值得花时间,但如果你像我一样,你通常要处 拥有所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?发挥了 Lisp 键盘的全部威力了吗?我用 Emacs 来完成所有的创作性工作,音乐和图片除外。 -我办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,我通常也会打开一个终端。我将日历、邮件等放在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面会隐藏起来,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,越是先进的 UI 应用程序,消除干扰越是不可能,因为这些应用程序致力于提供帮助和易用性。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像出书一样,处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比起 office 客户端版,我更讨厌它的在线版。 +我办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,我通常也会打开一个终端。我将日历、邮件等放在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面会隐藏起来,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,越是先进的 UI 应用程序,消除干扰越是不可能,因为这些应用程序致力于提供帮助和易用性。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像出书一样,处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比起 office 桌面版,我更讨厌它的在线版。 ![](https://www.fugue.co/hubfs/Imported_Blog_Media/desktop-1.jpg) @@ -37,7 +37,7 @@ Org 模式本身就值得花时间,但如果你像我一样,你通常要处 但是沟通呢?创造和沟通之间的差别很大。当我将这两件事在不同时间段处理时,我的效率会更高。我们 Fugue 公司使用 Slack,痛并快乐着。我把 Slack 和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我就能够忽略所有的聊天信息了。虽然只要一个 Slackstorm 或一封风投或董事会董事的电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。 -#### 包罗万象,永久长青 +#### 普适恒久 第三个原因是,我发现 Emacs 比其它的环境更有优势的是,你可以很容易地用它来处理事务。我的意思是,你所需要的只是通过类似于 Dropbox 的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何你已经精心打造了适合你的目的的套件的环境中工作了。我在 OS X、Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理 Pages、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。 @@ -196,6 +196,7 @@ Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常 这个文件是一个使用该配置输出为 PDF 的实例。这就是开箱即用的 LaTeX 一样。在我看来这还不错,但是字体很平淡,而且有点奇怪。此外,如果你使用标准格式,人们会觉得他们正在阅读的东西是、或者假装是一篇学术论文。别怪我没提醒你。 #### 驾驭之 Ace Jump 模式 + 这只是一个辅助模式,而不是一个主模式,但是你也需要它。其工作原理有点像之前提到的 Jef Raskin 的 Leap 功能[^9] 。 按下 `C-c C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。你只需键入所需位置的字母,光标就会跳转到该位置。我常将它作为导航键或是用来检索。将 `.el` 文件下到你的 `lisp` 目录下,并在 `.emacs` 文件添加如下代码: ``` @@ -217,17 +218,17 @@ Org 模式也有很多让生活愉快的小功能。例如,脚注处理非常 [^3]: 我主要是在写作时使用这个模式来进行一些运算。比如说,当我在给一个新雇员写一封入职信时,我想要算这封入职信中有多少个选项。由于我在我的 `.emacs` 为 outstanding-shares 定义了一个变量,所以我只要按下 `M-:` 然后输入 `(* .001 outstanding-shares)` 就能再无需打开计算器或电子表格的情况下得到精度为 0.001 的结果。我使用了 _大量_ 的变量来避免程序间切换。 -[^4]: 缺少的部分是 web。有个名为 eww 的 Emacs 网页浏览器能够让你在 Emacs 中浏览网页。我用的就是这个,因为它既能拦截广告(译者注:实质上是无法显示,/laugh),同时也在可读性方面为 web 开发者消除了大多数差劲的选项。这个其实有点类似于 Safari 的阅读模式。不幸的是,大部分网站都有很多令人讨厌的繁琐的东西以及难以转换为文本的导航, +[^4]: 缺少的部分是 web。有个名为 eww 的 Emacs 网页浏览器能够让你在 Emacs 中浏览网页。我用的就是这个,因为它既能拦截广告(LCTT 译注:实质上是无法显示,/laugh),同时也在可读性方面为 web 开发者消除了大多数差劲的选项。这个其实有点类似于 Safari 的阅读模式。不幸的是,大部分网站都有很多令人讨厌的繁琐的东西以及难以转换为文本的导航, [^5]: 易用性和易学性这两者经常容易被搞混。易学性是指学习使用工具的难易程度。而易用性是指工具高效的程度。通常来说,这是要差别的,就想鼠标和菜单栏的差别一样。菜单栏很容易学会,但是却不怎么高效,以致于早期会存在一些键盘的快捷键。除了在 GUI 方面上,Raskin 在很多方面上的观点都很正确。如今,操作系统正在将一些合适的搜索映射到键盘的快捷键上。比如说在 OS X 和 Windows 上,我默认的导航方式就是搜索。Ubuntu 的搜索做的很差劲,如同它的 GUI 一样差劲。 -[^6]: 在有网的情况下, [AWSAmazon Web Services S3][42] 是解决文件存储问题的有效方案。数万亿个对象存在 S3 中,但是从来没有遗失过。大部分提供云存储的服务都是在 S3 上或是模拟 S3 构建的。没人能够拥有 S3 一样的规模,所以我将重要的文件通过 Dropbox 存储在上面。 +[^6]: 在有网的情况下,[AWS S3][42] 是解决文件存储问题的有效方案。数万亿个对象存在 S3 中,但是从来没有遗失过。大部分提供云存储的服务都是在 S3 上或是模拟 S3 构建的。没人能够拥有 S3 一样的规模,所以我将重要的文件通过 Dropbox 存储在上面。 [^7]: 目前,你可能会想:“这个人和自行车有什么关系?”……我在各个层面上都喜欢自行车。自行车是迄今为止发明的最具机械效率的交通工具。自行车可以是真正美丽的事物。而且,只要注意点的话,自行车可以用一辈子。早在 2001 年,我曾向 Rivendell Bicycle Works 订购了一辆自行车,现在我每次看到那辆自行车依然很高兴,自行车和 Unix 是我接触过的最好的两个发明。对了,还有 Emacs。 [^8]: 这个网站有一个很棒的 Emacs 教程,但不是这个。当我浏览这个页面时,我确实得到了一些对获取高效的 Emacs 配置很重要的知识,但无论怎么说,这都不是个替代品。 -[^9]: 20世纪80年代,Jef Raskin 与 Steve Jobs 在 Macintosh 项目上闹翻后, Jef Raskin 又设计了 [Canon Cat 计算机][43]。这台 Cat 是以文档为中心的界面(所有的计算机都应如此),并以一种全新的方式使用键盘,你现在可以用 Emacs 来模仿这种键盘。如果现在有一台现代的,功能强大的 Cat 并配有一个高分辨的显示器和 Unix 系统的话,我立马会用 Mac 来换。[][27][https://youtu.be/o_TlE_U_X3c?t=19s][28] +[^9]: 20 世纪 80 年代,Jef Raskin 与 Steve Jobs 在 Macintosh 项目上闹翻后, Jef Raskin 又设计了 [Canon Cat 计算机][43]。这台 Cat 计算机是以文档为中心的界面(所有的计算机都应如此),并以一种全新的方式使用键盘,你现在可以用 Emacs 来模仿这种键盘。如果现在有一台现代的,功能强大的 Cat 计算机并配有一个高分辨的显示器和 Unix 系统的话,我立马会用 Mac 来换。[https://youtu.be/o_TlE_U_X3c?t=19s][28] -------------------------------------------------------------------------------- From 62a05a3f208ef5636666244f15a980de1f696904 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 31 Dec 2018 20:24:58 +0800 Subject: [PATCH 1133/1143] PUB:20171111 A CEOs Guide to Emacs.md @oneforalone https://linux.cn/article-10401-1.html --- {translated/tech => published}/20171111 A CEOs Guide to Emacs.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171111 A CEOs Guide to Emacs.md (100%) diff --git a/translated/tech/20171111 A CEOs Guide to Emacs.md b/published/20171111 A CEOs Guide to Emacs.md similarity index 100% rename from translated/tech/20171111 A CEOs Guide to Emacs.md rename to published/20171111 A CEOs Guide to Emacs.md From 0b639c43c115981dd788d64466ed1d9ae272a6eb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 31 Dec 2018 20:26:13 +0800 Subject: [PATCH 1134/1143] PRF:20171111 A CEOs Guide to Emacs.md --- published/20171111 A CEOs Guide to Emacs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20171111 A CEOs Guide to Emacs.md b/published/20171111 A CEOs Guide to Emacs.md index 670b8e78f9..4a92e5710b 100644 --- a/published/20171111 A CEOs Guide to Emacs.md +++ b/published/20171111 A CEOs Guide to Emacs.md @@ -1,9 +1,9 @@ -一位 CEO 的 Emacs 秘籍 +CEO 的 Emacs 秘籍 =========== 几年前,不,是几十年前,我就在用 Emacs。不论是码代码、编写文档,还是管理邮件和日程,我都用这个编辑器,或者是说操作系统,而且我还乐此不疲。许多年过去了,我也转向了其他更新、更好的工具。结果,就连最基本的文件浏览,我都已经忘了在不用鼠标的情况下该怎么操作。大约三个月前,我意识到我在应用程序和计算机之间切换上耗费了大量的时间,于是我决定再次使用 Emacs。这是个很正确的决定,原因有以下几个。其中包括用 `.emacs` 和 Dropbox 来搭建一个良好的、可移植的环境的一些技巧。 -对于那些还没用过 Emacs 的人来说,Emacs 会让你爱恨交加。它有点像一个房子大小的鲁布·戈德堡机械Rube Goldberg machine,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键词是“乍一看”。一旦你了解了 Emacs,你就会意识到它其实是一台可以当发动机用的的热核烤面包机……好吧,只是指文本处理的所有事情。当考虑到你计算机的使用周期在很大程度上都是与文本有关时,这是一个相当大胆的声明。大胆,但却是真的。 +对于那些还没用过 Emacs 的人来说,Emacs 会让你爱恨交加。它有点像一个房子大小的鲁布·戈德堡机械Rube Goldberg machine,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键词是“乍一看”。一旦你了解了 Emacs,你就会意识到它其实是一台可以当发动机用的热核烤面包机……好吧,只是指文本处理的所有事情。当考虑到你计算机的使用周期在很大程度上都是与文本有关时,这是一个相当大胆的声明。大胆,但却是真的。 也许对我来说更重要的是,Emacs 是我曾经使用过的一个应用,并让我觉得我真正的拥有它,而不是把我塑造成一个匿名的“用户”,就好像位于 [Soma][30](LCTT 译注:旧金山的一个街区)或雷蒙德(LCTT 译注:微软总部所在地)附近某个高档办公室的产品营销部门把钱作为明确的目标一样。现代生产力和创作应用程序(如 Pages 或 IDE)就像碳纤维赛车,它们装备得很好,也很齐全。而 Emacs 就像一盒经典的 [Campagnolo][31] (LCTT 译注:世界上最好的三个公路自行车套件系统品牌之一)零件和一个漂亮的自行车牵引式钢框架,但缺少曲柄臂和刹车杆,你必须在网上某个小众文化中找到它们。前者更快而且很完整,后者是无尽的快乐或烦恼的源泉,当然这取决于你自己,而且这种快乐或烦恼会伴随到你死。我就是那种在找到一堆老古董或用 `Emacs Lisp` 配置编辑器时会感到高兴的人,具体情况因人而异。 From 2497bfcf68cf2d4037698e73be997813876bdc9a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 31 Dec 2018 23:41:24 +0800 Subject: [PATCH 1135/1143] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201812?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 一年又过去了…… --- ...st Sources For Linux - -BSD - Unix Documentation On the Web.md | 0 published/{ => 201812}/20171012 7 Best eBook Readers for Linux.md | 0 .../20171108 Continuous infrastructure- The other CI.md | 0 published/{ => 201812}/20171111 A CEOs Guide to Emacs.md | 0 ...171129 TLDR pages Simplified Alternative To Linux Man Pages.md | 0 ...1223 Celebrate Christmas In Linux Way With These Wallpapers.md | 0 ...personal Email setup - Notmuch, mbsync, postfix and dovecot.md | 0 .../20180101 27 open solutions to everything in education.md | 0 ...0104 How Creative Commons benefits artists and big business.md | 0 published/{ => 201812}/20180128 Getting Linux Jobs.md | 0 .../20180130 Graphics and music tools for game development.md | 0 ...r your first HTML code lets help Batman write a love letter.md | 0 ...ring project requirements using the Open Decision Framework.md | 0 .../{ => 201812}/20180221 12 useful zypper command examples.md | 0 .../20180226 -Getting to Done- on the Linux command line.md | 0 published/{ => 201812}/20180228 Emacs -2- Introducing org-mode.md | 0 published/{ => 201812}/20180302 Emacs -3- More on org-mode.md | 0 .../20180328 What NASA Has Been Doing About Open Science.md | 0 ...Emacs -4- Automated emails to org-mode and org-mode syncing.md | 0 ...0180404 Emacs -5- Documents and Presentations with org-mode.md | 0 .../20180412 A new approach to security instrumentation.md | 0 .../20180419 Migrating to Linux- Network and System Settings.md | 0 .../20180420 How To Remove Password From A PDF File in Linux.md | 0 ...0422 Command Line Tricks For Data Scientists - kade killary.md | 0 ...04 How a university network assistant used Linux in the 90s.md | 0 ...iabetes finds open source and builds her own medical device.md | 0 published/{ => 201812}/20180518 How to Manage Fonts in Linux.md | 0 .../{ => 201812}/20180523 How to dual-boot Linux and Windows.md | 0 ...25 How to Set Different Wallpaper for Each Monitor in Linux.md | 0 published/{ => 201812}/20180623 The IBM 029 Card Punch.md | 0 .../{ => 201812}/20180707 Version Control Before Git with CVS.md | 0 .../20180709 5 Firefox extensions to protect your privacy.md | 0 .../20180710 Users, Groups, and Other Linux Beasts.md | 0 .../20180716 Users, Groups and Other Linux Beasts- Part 2.md | 0 .../20180717 11 Uses for a Raspberry Pi Around the Office.md | 0 ...0180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md | 0 .../{ => 201812}/20180806 Systemd Timers- Three Use Cases.md | 0 ...180814 HTTP request routing and validation with gorilla-mux.md | 0 ...17 Mixing software development roles produces great results.md | 0 .../20180826 How to Install and Use FreeDOS on VirtualBox.md | 0 ...uction to Quantum Computing with Open Source Cirq Framework.md | 0 .../20180831 Publishing Markdown to HTML with MDwiki.md | 0 .../{ => 201812}/20180904 Why schools of the future are open.md | 0 .../20180911 Know Your Storage- Block, File - Object.md | 0 .../20180912 How to turn on an LED with Fedora IoT.md | 0 published/{ => 201812}/20181004 Archiving web sites.md | 0 published/{ => 201812}/20181004 Lab 3- User Environments.md | 0 published/{ => 201812}/20181016 Lab 4- Preemptive Multitasking.md | 0 .../{ => 201812}/20181016 Lab 5- File system, Spawn and Shell.md | 0 ...prove login security with challenge-response authentication.md | 0 .../20181025 How to write your favorite R functions in Python.md | 0 ...recting traffic- Demystifying internet-scale load balancing.md | 0 .../20181102 Create a containerized machine learning model.md | 0 .../20181105 5 Easy Tips for Linux Web Browser Security.md | 0 .../20181106 How to partition and format a drive on Linux.md | 0 .../{ => 201812}/20181107 Automate a web browser with Selenium.md | 0 .../20181107 Top 30 OpenStack Interview Questions and Answers.md | 0 ...20181112 A Free Guide for Setting Your Open Source Strategy.md | 0 ...20181112 A Free, Secure And Cross-platform Password Manager.md | 0 published/{ => 201812}/20181112 The Source History of Cat.md | 0 ...ion to Udev- The Linux subsystem for managing device events.md | 0 ... 3 best practices for continuous integration and deployment.md | 0 .../20181119 7 command-line tools for writers - Opensource.com.md | 0 .../20181119 9 obscure Python libraries for data science.md | 0 ...to give thanks to open source and free software maintainers.md | 0 .../20181121 Coupled commands with control operators in Bash.md | 0 published/{ => 201812}/20181121 DevOps is for everyone.md | 0 .../20181121 How to swap Ctrl and Caps Lock keys in Linux.md | 0 .../20181123 How to Build a Netboot Server, Part 1.md | 0 .../20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md | 0 ...to use the sudo command to deploy superuser powers on Linux.md | 0 ...1128 OpenSnitch - an Application Firewall for Linux -Review.md | 0 .../20181128 Standalone web applications with GNOME Web.md | 0 published/{ => 201812}/20181129 4 open source Markdown editors.md | 0 ...1130 SMPlayer in Linux- Features, Download and Installation.md | 0 ...atives To ‘top- Command line Utility You Might Want To Know.md | 0 .../20181201 Boxing yourself in on the Linux command line.md | 0 .../20181202 Drive a locomotive through your Linux terminal.md | 0 ...Four Easy Ways to Search Or Find Files And Folders in Linux.md | 0 published/{ => 201812}/20181204 3 implications of serverless.md | 0 .../{ => 201812}/20181204 Have a cow at the Linux command line.md | 0 .../20181205 Bash Variables- Environmental and Otherwise.md | 0 ...0181205 Bring some color to your Linux terminal with lolcat.md | 0 ...ily Convert Audio File Formats with SoundConverter in Linux.md | 0 ...0181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md | 0 ...181206 Take a break at the Linux command line with Nyan Cat.md | 0 .../{ => 201812}/20181208 Play Tetris at your Linux terminal.md | 0 ...o Check Laptop Battery Status And Level From Linux Terminal.md | 0 published/{ => 201812}/20181210 How to get started in AI.md | 0 ...ow to Install Putty on Ubuntu and Other Linux Distributions.md | 0 published/{ => 201812}/20181212 Aliases- DIY Shell Commands.md | 0 .../20181212 How to Build a Netboot Server, Part 2.md | 0 .../20181212 Patch into The Matrix at the Linux command line.md | 0 .../20181213 Relax by the fire at your Linux terminal.md | 0 .../20181214 How To Install Rust Programming Language In Linux.md | 0 ...181217 Take a swim at your Linux terminal with asciiquarium.md | 0 .../20181221 Listen to the radio at the Linux terminal.md | 0 97 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201812}/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md (100%) rename published/{ => 201812}/20171012 7 Best eBook Readers for Linux.md (100%) rename published/{ => 201812}/20171108 Continuous infrastructure- The other CI.md (100%) rename published/{ => 201812}/20171111 A CEOs Guide to Emacs.md (100%) rename published/{ => 201812}/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md (100%) rename published/{ => 201812}/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md (100%) rename published/{ => 201812}/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md (100%) rename published/{ => 201812}/20180101 27 open solutions to everything in education.md (100%) rename published/{ => 201812}/20180104 How Creative Commons benefits artists and big business.md (100%) rename published/{ => 201812}/20180128 Getting Linux Jobs.md (100%) rename published/{ => 201812}/20180130 Graphics and music tools for game development.md (100%) rename published/{ => 201812}/20180131 For your first HTML code lets help Batman write a love letter.md (100%) rename published/{ => 201812}/20180208 Gathering project requirements using the Open Decision Framework.md (100%) rename published/{ => 201812}/20180221 12 useful zypper command examples.md (100%) rename published/{ => 201812}/20180226 -Getting to Done- on the Linux command line.md (100%) rename published/{ => 201812}/20180228 Emacs -2- Introducing org-mode.md (100%) rename published/{ => 201812}/20180302 Emacs -3- More on org-mode.md (100%) rename published/{ => 201812}/20180328 What NASA Has Been Doing About Open Science.md (100%) rename published/{ => 201812}/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md (100%) rename published/{ => 201812}/20180404 Emacs -5- Documents and Presentations with org-mode.md (100%) rename published/{ => 201812}/20180412 A new approach to security instrumentation.md (100%) rename published/{ => 201812}/20180419 Migrating to Linux- Network and System Settings.md (100%) rename published/{ => 201812}/20180420 How To Remove Password From A PDF File in Linux.md (100%) rename published/{ => 201812}/20180422 Command Line Tricks For Data Scientists - kade killary.md (100%) rename published/{ => 201812}/20180504 How a university network assistant used Linux in the 90s.md (100%) rename published/{ => 201812}/20180508 Person with diabetes finds open source and builds her own medical device.md (100%) rename published/{ => 201812}/20180518 How to Manage Fonts in Linux.md (100%) rename published/{ => 201812}/20180523 How to dual-boot Linux and Windows.md (100%) rename published/{ => 201812}/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md (100%) rename published/{ => 201812}/20180623 The IBM 029 Card Punch.md (100%) rename published/{ => 201812}/20180707 Version Control Before Git with CVS.md (100%) rename published/{ => 201812}/20180709 5 Firefox extensions to protect your privacy.md (100%) rename published/{ => 201812}/20180710 Users, Groups, and Other Linux Beasts.md (100%) rename published/{ => 201812}/20180716 Users, Groups and Other Linux Beasts- Part 2.md (100%) rename published/{ => 201812}/20180717 11 Uses for a Raspberry Pi Around the Office.md (100%) rename published/{ => 201812}/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md (100%) rename published/{ => 201812}/20180806 Systemd Timers- Three Use Cases.md (100%) rename published/{ => 201812}/20180814 HTTP request routing and validation with gorilla-mux.md (100%) rename published/{ => 201812}/20180817 Mixing software development roles produces great results.md (100%) rename published/{ => 201812}/20180826 How to Install and Use FreeDOS on VirtualBox.md (100%) rename published/{ => 201812}/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md (100%) rename published/{ => 201812}/20180831 Publishing Markdown to HTML with MDwiki.md (100%) rename published/{ => 201812}/20180904 Why schools of the future are open.md (100%) rename published/{ => 201812}/20180911 Know Your Storage- Block, File - Object.md (100%) rename published/{ => 201812}/20180912 How to turn on an LED with Fedora IoT.md (100%) rename published/{ => 201812}/20181004 Archiving web sites.md (100%) rename published/{ => 201812}/20181004 Lab 3- User Environments.md (100%) rename published/{ => 201812}/20181016 Lab 4- Preemptive Multitasking.md (100%) rename published/{ => 201812}/20181016 Lab 5- File system, Spawn and Shell.md (100%) rename published/{ => 201812}/20181022 Improve login security with challenge-response authentication.md (100%) rename published/{ => 201812}/20181025 How to write your favorite R functions in Python.md (100%) rename published/{ => 201812}/20181026 Directing traffic- Demystifying internet-scale load balancing.md (100%) rename published/{ => 201812}/20181102 Create a containerized machine learning model.md (100%) rename published/{ => 201812}/20181105 5 Easy Tips for Linux Web Browser Security.md (100%) rename published/{ => 201812}/20181106 How to partition and format a drive on Linux.md (100%) rename published/{ => 201812}/20181107 Automate a web browser with Selenium.md (100%) rename published/{ => 201812}/20181107 Top 30 OpenStack Interview Questions and Answers.md (100%) rename published/{ => 201812}/20181112 A Free Guide for Setting Your Open Source Strategy.md (100%) rename published/{ => 201812}/20181112 A Free, Secure And Cross-platform Password Manager.md (100%) rename published/{ => 201812}/20181112 The Source History of Cat.md (100%) rename published/{ => 201812}/20181113 An introduction to Udev- The Linux subsystem for managing device events.md (100%) rename published/{ => 201812}/20181115 3 best practices for continuous integration and deployment.md (100%) rename published/{ => 201812}/20181119 7 command-line tools for writers - Opensource.com.md (100%) rename published/{ => 201812}/20181119 9 obscure Python libraries for data science.md (100%) rename published/{ => 201812}/20181121 10 ways to give thanks to open source and free software maintainers.md (100%) rename published/{ => 201812}/20181121 Coupled commands with control operators in Bash.md (100%) rename published/{ => 201812}/20181121 DevOps is for everyone.md (100%) rename published/{ => 201812}/20181121 How to swap Ctrl and Caps Lock keys in Linux.md (100%) rename published/{ => 201812}/20181123 How to Build a Netboot Server, Part 1.md (100%) rename published/{ => 201812}/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md (100%) rename published/{ => 201812}/20181126 How to use the sudo command to deploy superuser powers on Linux.md (100%) rename published/{ => 201812}/20181128 OpenSnitch - an Application Firewall for Linux -Review.md (100%) rename published/{ => 201812}/20181128 Standalone web applications with GNOME Web.md (100%) rename published/{ => 201812}/20181129 4 open source Markdown editors.md (100%) rename published/{ => 201812}/20181130 SMPlayer in Linux- Features, Download and Installation.md (100%) rename published/{ => 201812}/20181130 Some Alternatives To ‘top- Command line Utility You Might Want To Know.md (100%) rename published/{ => 201812}/20181201 Boxing yourself in on the Linux command line.md (100%) rename published/{ => 201812}/20181202 Drive a locomotive through your Linux terminal.md (100%) rename published/{ => 201812}/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md (100%) rename published/{ => 201812}/20181204 3 implications of serverless.md (100%) rename published/{ => 201812}/20181204 Have a cow at the Linux command line.md (100%) rename published/{ => 201812}/20181205 Bash Variables- Environmental and Otherwise.md (100%) rename published/{ => 201812}/20181205 Bring some color to your Linux terminal with lolcat.md (100%) rename published/{ => 201812}/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md (100%) rename published/{ => 201812}/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md (100%) rename published/{ => 201812}/20181206 Take a break at the Linux command line with Nyan Cat.md (100%) rename published/{ => 201812}/20181208 Play Tetris at your Linux terminal.md (100%) rename published/{ => 201812}/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md (100%) rename published/{ => 201812}/20181210 How to get started in AI.md (100%) rename published/{ => 201812}/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md (100%) rename published/{ => 201812}/20181212 Aliases- DIY Shell Commands.md (100%) rename published/{ => 201812}/20181212 How to Build a Netboot Server, Part 2.md (100%) rename published/{ => 201812}/20181212 Patch into The Matrix at the Linux command line.md (100%) rename published/{ => 201812}/20181213 Relax by the fire at your Linux terminal.md (100%) rename published/{ => 201812}/20181214 How To Install Rust Programming Language In Linux.md (100%) rename published/{ => 201812}/20181217 Take a swim at your Linux terminal with asciiquarium.md (100%) rename published/{ => 201812}/20181221 Listen to the radio at the Linux terminal.md (100%) diff --git a/published/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md b/published/201812/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md similarity index 100% rename from published/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md rename to published/201812/20111221 30 Best Sources For Linux - -BSD - Unix Documentation On the Web.md diff --git a/published/20171012 7 Best eBook Readers for Linux.md b/published/201812/20171012 7 Best eBook Readers for Linux.md similarity index 100% rename from published/20171012 7 Best eBook Readers for Linux.md rename to published/201812/20171012 7 Best eBook Readers for Linux.md diff --git a/published/20171108 Continuous infrastructure- The other CI.md b/published/201812/20171108 Continuous infrastructure- The other CI.md similarity index 100% rename from published/20171108 Continuous infrastructure- The other CI.md rename to published/201812/20171108 Continuous infrastructure- The other CI.md diff --git a/published/20171111 A CEOs Guide to Emacs.md b/published/201812/20171111 A CEOs Guide to Emacs.md similarity index 100% rename from published/20171111 A CEOs Guide to Emacs.md rename to published/201812/20171111 A CEOs Guide to Emacs.md diff --git a/published/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/published/201812/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md similarity index 100% rename from published/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md rename to published/201812/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md diff --git a/published/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/published/201812/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md similarity index 100% rename from published/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md rename to published/201812/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md diff --git a/published/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/published/201812/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md similarity index 100% rename from published/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md rename to published/201812/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md diff --git a/published/20180101 27 open solutions to everything in education.md b/published/201812/20180101 27 open solutions to everything in education.md similarity index 100% rename from published/20180101 27 open solutions to everything in education.md rename to published/201812/20180101 27 open solutions to everything in education.md diff --git a/published/20180104 How Creative Commons benefits artists and big business.md b/published/201812/20180104 How Creative Commons benefits artists and big business.md similarity index 100% rename from published/20180104 How Creative Commons benefits artists and big business.md rename to published/201812/20180104 How Creative Commons benefits artists and big business.md diff --git a/published/20180128 Getting Linux Jobs.md b/published/201812/20180128 Getting Linux Jobs.md similarity index 100% rename from published/20180128 Getting Linux Jobs.md rename to published/201812/20180128 Getting Linux Jobs.md diff --git a/published/20180130 Graphics and music tools for game development.md b/published/201812/20180130 Graphics and music tools for game development.md similarity index 100% rename from published/20180130 Graphics and music tools for game development.md rename to published/201812/20180130 Graphics and music tools for game development.md diff --git a/published/20180131 For your first HTML code lets help Batman write a love letter.md b/published/201812/20180131 For your first HTML code lets help Batman write a love letter.md similarity index 100% rename from published/20180131 For your first HTML code lets help Batman write a love letter.md rename to published/201812/20180131 For your first HTML code lets help Batman write a love letter.md diff --git a/published/20180208 Gathering project requirements using the Open Decision Framework.md b/published/201812/20180208 Gathering project requirements using the Open Decision Framework.md similarity index 100% rename from published/20180208 Gathering project requirements using the Open Decision Framework.md rename to published/201812/20180208 Gathering project requirements using the Open Decision Framework.md diff --git a/published/20180221 12 useful zypper command examples.md b/published/201812/20180221 12 useful zypper command examples.md similarity index 100% rename from published/20180221 12 useful zypper command examples.md rename to published/201812/20180221 12 useful zypper command examples.md diff --git a/published/20180226 -Getting to Done- on the Linux command line.md b/published/201812/20180226 -Getting to Done- on the Linux command line.md similarity index 100% rename from published/20180226 -Getting to Done- on the Linux command line.md rename to published/201812/20180226 -Getting to Done- on the Linux command line.md diff --git a/published/20180228 Emacs -2- Introducing org-mode.md b/published/201812/20180228 Emacs -2- Introducing org-mode.md similarity index 100% rename from published/20180228 Emacs -2- Introducing org-mode.md rename to published/201812/20180228 Emacs -2- Introducing org-mode.md diff --git a/published/20180302 Emacs -3- More on org-mode.md b/published/201812/20180302 Emacs -3- More on org-mode.md similarity index 100% rename from published/20180302 Emacs -3- More on org-mode.md rename to published/201812/20180302 Emacs -3- More on org-mode.md diff --git a/published/20180328 What NASA Has Been Doing About Open Science.md b/published/201812/20180328 What NASA Has Been Doing About Open Science.md similarity index 100% rename from published/20180328 What NASA Has Been Doing About Open Science.md rename to published/201812/20180328 What NASA Has Been Doing About Open Science.md diff --git a/published/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md b/published/201812/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md similarity index 100% rename from published/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md rename to published/201812/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md diff --git a/published/20180404 Emacs -5- Documents and Presentations with org-mode.md b/published/201812/20180404 Emacs -5- Documents and Presentations with org-mode.md similarity index 100% rename from published/20180404 Emacs -5- Documents and Presentations with org-mode.md rename to published/201812/20180404 Emacs -5- Documents and Presentations with org-mode.md diff --git a/published/20180412 A new approach to security instrumentation.md b/published/201812/20180412 A new approach to security instrumentation.md similarity index 100% rename from published/20180412 A new approach to security instrumentation.md rename to published/201812/20180412 A new approach to security instrumentation.md diff --git a/published/20180419 Migrating to Linux- Network and System Settings.md b/published/201812/20180419 Migrating to Linux- Network and System Settings.md similarity index 100% rename from published/20180419 Migrating to Linux- Network and System Settings.md rename to published/201812/20180419 Migrating to Linux- Network and System Settings.md diff --git a/published/20180420 How To Remove Password From A PDF File in Linux.md b/published/201812/20180420 How To Remove Password From A PDF File in Linux.md similarity index 100% rename from published/20180420 How To Remove Password From A PDF File in Linux.md rename to published/201812/20180420 How To Remove Password From A PDF File in Linux.md diff --git a/published/20180422 Command Line Tricks For Data Scientists - kade killary.md b/published/201812/20180422 Command Line Tricks For Data Scientists - kade killary.md similarity index 100% rename from published/20180422 Command Line Tricks For Data Scientists - kade killary.md rename to published/201812/20180422 Command Line Tricks For Data Scientists - kade killary.md diff --git a/published/20180504 How a university network assistant used Linux in the 90s.md b/published/201812/20180504 How a university network assistant used Linux in the 90s.md similarity index 100% rename from published/20180504 How a university network assistant used Linux in the 90s.md rename to published/201812/20180504 How a university network assistant used Linux in the 90s.md diff --git a/published/20180508 Person with diabetes finds open source and builds her own medical device.md b/published/201812/20180508 Person with diabetes finds open source and builds her own medical device.md similarity index 100% rename from published/20180508 Person with diabetes finds open source and builds her own medical device.md rename to published/201812/20180508 Person with diabetes finds open source and builds her own medical device.md diff --git a/published/20180518 How to Manage Fonts in Linux.md b/published/201812/20180518 How to Manage Fonts in Linux.md similarity index 100% rename from published/20180518 How to Manage Fonts in Linux.md rename to published/201812/20180518 How to Manage Fonts in Linux.md diff --git a/published/20180523 How to dual-boot Linux and Windows.md b/published/201812/20180523 How to dual-boot Linux and Windows.md similarity index 100% rename from published/20180523 How to dual-boot Linux and Windows.md rename to published/201812/20180523 How to dual-boot Linux and Windows.md diff --git a/published/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md b/published/201812/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md similarity index 100% rename from published/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md rename to published/201812/20180525 How to Set Different Wallpaper for Each Monitor in Linux.md diff --git a/published/20180623 The IBM 029 Card Punch.md b/published/201812/20180623 The IBM 029 Card Punch.md similarity index 100% rename from published/20180623 The IBM 029 Card Punch.md rename to published/201812/20180623 The IBM 029 Card Punch.md diff --git a/published/20180707 Version Control Before Git with CVS.md b/published/201812/20180707 Version Control Before Git with CVS.md similarity index 100% rename from published/20180707 Version Control Before Git with CVS.md rename to published/201812/20180707 Version Control Before Git with CVS.md diff --git a/published/20180709 5 Firefox extensions to protect your privacy.md b/published/201812/20180709 5 Firefox extensions to protect your privacy.md similarity index 100% rename from published/20180709 5 Firefox extensions to protect your privacy.md rename to published/201812/20180709 5 Firefox extensions to protect your privacy.md diff --git a/published/20180710 Users, Groups, and Other Linux Beasts.md b/published/201812/20180710 Users, Groups, and Other Linux Beasts.md similarity index 100% rename from published/20180710 Users, Groups, and Other Linux Beasts.md rename to published/201812/20180710 Users, Groups, and Other Linux Beasts.md diff --git a/published/20180716 Users, Groups and Other Linux Beasts- Part 2.md b/published/201812/20180716 Users, Groups and Other Linux Beasts- Part 2.md similarity index 100% rename from published/20180716 Users, Groups and Other Linux Beasts- Part 2.md rename to published/201812/20180716 Users, Groups and Other Linux Beasts- Part 2.md diff --git a/published/20180717 11 Uses for a Raspberry Pi Around the Office.md b/published/201812/20180717 11 Uses for a Raspberry Pi Around the Office.md similarity index 100% rename from published/20180717 11 Uses for a Raspberry Pi Around the Office.md rename to published/201812/20180717 11 Uses for a Raspberry Pi Around the Office.md diff --git a/published/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md b/published/201812/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md similarity index 100% rename from published/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md rename to published/201812/20180806 GPaste Is A Great Clipboard Manager For Gnome Shell.md diff --git a/published/20180806 Systemd Timers- Three Use Cases.md b/published/201812/20180806 Systemd Timers- Three Use Cases.md similarity index 100% rename from published/20180806 Systemd Timers- Three Use Cases.md rename to published/201812/20180806 Systemd Timers- Three Use Cases.md diff --git a/published/20180814 HTTP request routing and validation with gorilla-mux.md b/published/201812/20180814 HTTP request routing and validation with gorilla-mux.md similarity index 100% rename from published/20180814 HTTP request routing and validation with gorilla-mux.md rename to published/201812/20180814 HTTP request routing and validation with gorilla-mux.md diff --git a/published/20180817 Mixing software development roles produces great results.md b/published/201812/20180817 Mixing software development roles produces great results.md similarity index 100% rename from published/20180817 Mixing software development roles produces great results.md rename to published/201812/20180817 Mixing software development roles produces great results.md diff --git a/published/20180826 How to Install and Use FreeDOS on VirtualBox.md b/published/201812/20180826 How to Install and Use FreeDOS on VirtualBox.md similarity index 100% rename from published/20180826 How to Install and Use FreeDOS on VirtualBox.md rename to published/201812/20180826 How to Install and Use FreeDOS on VirtualBox.md diff --git a/published/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/published/201812/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md similarity index 100% rename from published/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md rename to published/201812/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md diff --git a/published/20180831 Publishing Markdown to HTML with MDwiki.md b/published/201812/20180831 Publishing Markdown to HTML with MDwiki.md similarity index 100% rename from published/20180831 Publishing Markdown to HTML with MDwiki.md rename to published/201812/20180831 Publishing Markdown to HTML with MDwiki.md diff --git a/published/20180904 Why schools of the future are open.md b/published/201812/20180904 Why schools of the future are open.md similarity index 100% rename from published/20180904 Why schools of the future are open.md rename to published/201812/20180904 Why schools of the future are open.md diff --git a/published/20180911 Know Your Storage- Block, File - Object.md b/published/201812/20180911 Know Your Storage- Block, File - Object.md similarity index 100% rename from published/20180911 Know Your Storage- Block, File - Object.md rename to published/201812/20180911 Know Your Storage- Block, File - Object.md diff --git a/published/20180912 How to turn on an LED with Fedora IoT.md b/published/201812/20180912 How to turn on an LED with Fedora IoT.md similarity index 100% rename from published/20180912 How to turn on an LED with Fedora IoT.md rename to published/201812/20180912 How to turn on an LED with Fedora IoT.md diff --git a/published/20181004 Archiving web sites.md b/published/201812/20181004 Archiving web sites.md similarity index 100% rename from published/20181004 Archiving web sites.md rename to published/201812/20181004 Archiving web sites.md diff --git a/published/20181004 Lab 3- User Environments.md b/published/201812/20181004 Lab 3- User Environments.md similarity index 100% rename from published/20181004 Lab 3- User Environments.md rename to published/201812/20181004 Lab 3- User Environments.md diff --git a/published/20181016 Lab 4- Preemptive Multitasking.md b/published/201812/20181016 Lab 4- Preemptive Multitasking.md similarity index 100% rename from published/20181016 Lab 4- Preemptive Multitasking.md rename to published/201812/20181016 Lab 4- Preemptive Multitasking.md diff --git a/published/20181016 Lab 5- File system, Spawn and Shell.md b/published/201812/20181016 Lab 5- File system, Spawn and Shell.md similarity index 100% rename from published/20181016 Lab 5- File system, Spawn and Shell.md rename to published/201812/20181016 Lab 5- File system, Spawn and Shell.md diff --git a/published/20181022 Improve login security with challenge-response authentication.md b/published/201812/20181022 Improve login security with challenge-response authentication.md similarity index 100% rename from published/20181022 Improve login security with challenge-response authentication.md rename to published/201812/20181022 Improve login security with challenge-response authentication.md diff --git a/published/20181025 How to write your favorite R functions in Python.md b/published/201812/20181025 How to write your favorite R functions in Python.md similarity index 100% rename from published/20181025 How to write your favorite R functions in Python.md rename to published/201812/20181025 How to write your favorite R functions in Python.md diff --git a/published/20181026 Directing traffic- Demystifying internet-scale load balancing.md b/published/201812/20181026 Directing traffic- Demystifying internet-scale load balancing.md similarity index 100% rename from published/20181026 Directing traffic- Demystifying internet-scale load balancing.md rename to published/201812/20181026 Directing traffic- Demystifying internet-scale load balancing.md diff --git a/published/20181102 Create a containerized machine learning model.md b/published/201812/20181102 Create a containerized machine learning model.md similarity index 100% rename from published/20181102 Create a containerized machine learning model.md rename to published/201812/20181102 Create a containerized machine learning model.md diff --git a/published/20181105 5 Easy Tips for Linux Web Browser Security.md b/published/201812/20181105 5 Easy Tips for Linux Web Browser Security.md similarity index 100% rename from published/20181105 5 Easy Tips for Linux Web Browser Security.md rename to published/201812/20181105 5 Easy Tips for Linux Web Browser Security.md diff --git a/published/20181106 How to partition and format a drive on Linux.md b/published/201812/20181106 How to partition and format a drive on Linux.md similarity index 100% rename from published/20181106 How to partition and format a drive on Linux.md rename to published/201812/20181106 How to partition and format a drive on Linux.md diff --git a/published/20181107 Automate a web browser with Selenium.md b/published/201812/20181107 Automate a web browser with Selenium.md similarity index 100% rename from published/20181107 Automate a web browser with Selenium.md rename to published/201812/20181107 Automate a web browser with Selenium.md diff --git a/published/20181107 Top 30 OpenStack Interview Questions and Answers.md b/published/201812/20181107 Top 30 OpenStack Interview Questions and Answers.md similarity index 100% rename from published/20181107 Top 30 OpenStack Interview Questions and Answers.md rename to published/201812/20181107 Top 30 OpenStack Interview Questions and Answers.md diff --git a/published/20181112 A Free Guide for Setting Your Open Source Strategy.md b/published/201812/20181112 A Free Guide for Setting Your Open Source Strategy.md similarity index 100% rename from published/20181112 A Free Guide for Setting Your Open Source Strategy.md rename to published/201812/20181112 A Free Guide for Setting Your Open Source Strategy.md diff --git a/published/20181112 A Free, Secure And Cross-platform Password Manager.md b/published/201812/20181112 A Free, Secure And Cross-platform Password Manager.md similarity index 100% rename from published/20181112 A Free, Secure And Cross-platform Password Manager.md rename to published/201812/20181112 A Free, Secure And Cross-platform Password Manager.md diff --git a/published/20181112 The Source History of Cat.md b/published/201812/20181112 The Source History of Cat.md similarity index 100% rename from published/20181112 The Source History of Cat.md rename to published/201812/20181112 The Source History of Cat.md diff --git a/published/20181113 An introduction to Udev- The Linux subsystem for managing device events.md b/published/201812/20181113 An introduction to Udev- The Linux subsystem for managing device events.md similarity index 100% rename from published/20181113 An introduction to Udev- The Linux subsystem for managing device events.md rename to published/201812/20181113 An introduction to Udev- The Linux subsystem for managing device events.md diff --git a/published/20181115 3 best practices for continuous integration and deployment.md b/published/201812/20181115 3 best practices for continuous integration and deployment.md similarity index 100% rename from published/20181115 3 best practices for continuous integration and deployment.md rename to published/201812/20181115 3 best practices for continuous integration and deployment.md diff --git a/published/20181119 7 command-line tools for writers - Opensource.com.md b/published/201812/20181119 7 command-line tools for writers - Opensource.com.md similarity index 100% rename from published/20181119 7 command-line tools for writers - Opensource.com.md rename to published/201812/20181119 7 command-line tools for writers - Opensource.com.md diff --git a/published/20181119 9 obscure Python libraries for data science.md b/published/201812/20181119 9 obscure Python libraries for data science.md similarity index 100% rename from published/20181119 9 obscure Python libraries for data science.md rename to published/201812/20181119 9 obscure Python libraries for data science.md diff --git a/published/20181121 10 ways to give thanks to open source and free software maintainers.md b/published/201812/20181121 10 ways to give thanks to open source and free software maintainers.md similarity index 100% rename from published/20181121 10 ways to give thanks to open source and free software maintainers.md rename to published/201812/20181121 10 ways to give thanks to open source and free software maintainers.md diff --git a/published/20181121 Coupled commands with control operators in Bash.md b/published/201812/20181121 Coupled commands with control operators in Bash.md similarity index 100% rename from published/20181121 Coupled commands with control operators in Bash.md rename to published/201812/20181121 Coupled commands with control operators in Bash.md diff --git a/published/20181121 DevOps is for everyone.md b/published/201812/20181121 DevOps is for everyone.md similarity index 100% rename from published/20181121 DevOps is for everyone.md rename to published/201812/20181121 DevOps is for everyone.md diff --git a/published/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/published/201812/20181121 How to swap Ctrl and Caps Lock keys in Linux.md similarity index 100% rename from published/20181121 How to swap Ctrl and Caps Lock keys in Linux.md rename to published/201812/20181121 How to swap Ctrl and Caps Lock keys in Linux.md diff --git a/published/20181123 How to Build a Netboot Server, Part 1.md b/published/201812/20181123 How to Build a Netboot Server, Part 1.md similarity index 100% rename from published/20181123 How to Build a Netboot Server, Part 1.md rename to published/201812/20181123 How to Build a Netboot Server, Part 1.md diff --git a/published/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md b/published/201812/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md similarity index 100% rename from published/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md rename to published/201812/20181124 How To Configure IP Address In Ubuntu 18.04 LTS.md diff --git a/published/20181126 How to use the sudo command to deploy superuser powers on Linux.md b/published/201812/20181126 How to use the sudo command to deploy superuser powers on Linux.md similarity index 100% rename from published/20181126 How to use the sudo command to deploy superuser powers on Linux.md rename to published/201812/20181126 How to use the sudo command to deploy superuser powers on Linux.md diff --git a/published/20181128 OpenSnitch - an Application Firewall for Linux -Review.md b/published/201812/20181128 OpenSnitch - an Application Firewall for Linux -Review.md similarity index 100% rename from published/20181128 OpenSnitch - an Application Firewall for Linux -Review.md rename to published/201812/20181128 OpenSnitch - an Application Firewall for Linux -Review.md diff --git a/published/20181128 Standalone web applications with GNOME Web.md b/published/201812/20181128 Standalone web applications with GNOME Web.md similarity index 100% rename from published/20181128 Standalone web applications with GNOME Web.md rename to published/201812/20181128 Standalone web applications with GNOME Web.md diff --git a/published/20181129 4 open source Markdown editors.md b/published/201812/20181129 4 open source Markdown editors.md similarity index 100% rename from published/20181129 4 open source Markdown editors.md rename to published/201812/20181129 4 open source Markdown editors.md diff --git a/published/20181130 SMPlayer in Linux- Features, Download and Installation.md b/published/201812/20181130 SMPlayer in Linux- Features, Download and Installation.md similarity index 100% rename from published/20181130 SMPlayer in Linux- Features, Download and Installation.md rename to published/201812/20181130 SMPlayer in Linux- Features, Download and Installation.md diff --git a/published/20181130 Some Alternatives To ‘top- Command line Utility You Might Want To Know.md b/published/201812/20181130 Some Alternatives To ‘top- Command line Utility You Might Want To Know.md similarity index 100% rename from published/20181130 Some Alternatives To ‘top- Command line Utility You Might Want To Know.md rename to published/201812/20181130 Some Alternatives To ‘top- Command line Utility You Might Want To Know.md diff --git a/published/20181201 Boxing yourself in on the Linux command line.md b/published/201812/20181201 Boxing yourself in on the Linux command line.md similarity index 100% rename from published/20181201 Boxing yourself in on the Linux command line.md rename to published/201812/20181201 Boxing yourself in on the Linux command line.md diff --git a/published/20181202 Drive a locomotive through your Linux terminal.md b/published/201812/20181202 Drive a locomotive through your Linux terminal.md similarity index 100% rename from published/20181202 Drive a locomotive through your Linux terminal.md rename to published/201812/20181202 Drive a locomotive through your Linux terminal.md diff --git a/published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/published/201812/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md similarity index 100% rename from published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md rename to published/201812/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md diff --git a/published/20181204 3 implications of serverless.md b/published/201812/20181204 3 implications of serverless.md similarity index 100% rename from published/20181204 3 implications of serverless.md rename to published/201812/20181204 3 implications of serverless.md diff --git a/published/20181204 Have a cow at the Linux command line.md b/published/201812/20181204 Have a cow at the Linux command line.md similarity index 100% rename from published/20181204 Have a cow at the Linux command line.md rename to published/201812/20181204 Have a cow at the Linux command line.md diff --git a/published/20181205 Bash Variables- Environmental and Otherwise.md b/published/201812/20181205 Bash Variables- Environmental and Otherwise.md similarity index 100% rename from published/20181205 Bash Variables- Environmental and Otherwise.md rename to published/201812/20181205 Bash Variables- Environmental and Otherwise.md diff --git a/published/20181205 Bring some color to your Linux terminal with lolcat.md b/published/201812/20181205 Bring some color to your Linux terminal with lolcat.md similarity index 100% rename from published/20181205 Bring some color to your Linux terminal with lolcat.md rename to published/201812/20181205 Bring some color to your Linux terminal with lolcat.md diff --git a/published/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/published/201812/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md similarity index 100% rename from published/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md rename to published/201812/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md diff --git a/published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/published/201812/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md similarity index 100% rename from published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md rename to published/201812/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md diff --git a/published/20181206 Take a break at the Linux command line with Nyan Cat.md b/published/201812/20181206 Take a break at the Linux command line with Nyan Cat.md similarity index 100% rename from published/20181206 Take a break at the Linux command line with Nyan Cat.md rename to published/201812/20181206 Take a break at the Linux command line with Nyan Cat.md diff --git a/published/20181208 Play Tetris at your Linux terminal.md b/published/201812/20181208 Play Tetris at your Linux terminal.md similarity index 100% rename from published/20181208 Play Tetris at your Linux terminal.md rename to published/201812/20181208 Play Tetris at your Linux terminal.md diff --git a/published/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/published/201812/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md similarity index 100% rename from published/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md rename to published/201812/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md diff --git a/published/20181210 How to get started in AI.md b/published/201812/20181210 How to get started in AI.md similarity index 100% rename from published/20181210 How to get started in AI.md rename to published/201812/20181210 How to get started in AI.md diff --git a/published/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/published/201812/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md similarity index 100% rename from published/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md rename to published/201812/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md diff --git a/published/20181212 Aliases- DIY Shell Commands.md b/published/201812/20181212 Aliases- DIY Shell Commands.md similarity index 100% rename from published/20181212 Aliases- DIY Shell Commands.md rename to published/201812/20181212 Aliases- DIY Shell Commands.md diff --git a/published/20181212 How to Build a Netboot Server, Part 2.md b/published/201812/20181212 How to Build a Netboot Server, Part 2.md similarity index 100% rename from published/20181212 How to Build a Netboot Server, Part 2.md rename to published/201812/20181212 How to Build a Netboot Server, Part 2.md diff --git a/published/20181212 Patch into The Matrix at the Linux command line.md b/published/201812/20181212 Patch into The Matrix at the Linux command line.md similarity index 100% rename from published/20181212 Patch into The Matrix at the Linux command line.md rename to published/201812/20181212 Patch into The Matrix at the Linux command line.md diff --git a/published/20181213 Relax by the fire at your Linux terminal.md b/published/201812/20181213 Relax by the fire at your Linux terminal.md similarity index 100% rename from published/20181213 Relax by the fire at your Linux terminal.md rename to published/201812/20181213 Relax by the fire at your Linux terminal.md diff --git a/published/20181214 How To Install Rust Programming Language In Linux.md b/published/201812/20181214 How To Install Rust Programming Language In Linux.md similarity index 100% rename from published/20181214 How To Install Rust Programming Language In Linux.md rename to published/201812/20181214 How To Install Rust Programming Language In Linux.md diff --git a/published/20181217 Take a swim at your Linux terminal with asciiquarium.md b/published/201812/20181217 Take a swim at your Linux terminal with asciiquarium.md similarity index 100% rename from published/20181217 Take a swim at your Linux terminal with asciiquarium.md rename to published/201812/20181217 Take a swim at your Linux terminal with asciiquarium.md diff --git a/published/20181221 Listen to the radio at the Linux terminal.md b/published/201812/20181221 Listen to the radio at the Linux terminal.md similarity index 100% rename from published/20181221 Listen to the radio at the Linux terminal.md rename to published/201812/20181221 Listen to the radio at the Linux terminal.md From 06e26dd6367dbe7674f7a5405c74794d48e03f01 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 1 Jan 2019 00:36:00 +0800 Subject: [PATCH 1136/1143] PRF:20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md @qhwdw --- ...ving Your Master Key to Offline Storage.md | 105 ++++++++---------- 1 file changed, 46 insertions(+), 59 deletions(-) diff --git a/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md b/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md index 8ca36884d9..666c661806 100644 --- a/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md +++ b/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md @@ -1,129 +1,117 @@ 用 PGP 保护代码完整性(四):将主密钥移到离线存储中 ====== +> 如果开发者的 PGP 密钥被偷了,危害非常大。了解一下如何更安全。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/industry-1920.jpg?itok=gI3QraS8) + 在本系列教程中,我们为使用 PGP 提供了一个实用指南。你可以从下面的链接中查看前面的文章: -[第一部分:基本概念和工具][1] +- [第一部分:基本概念和工具][1] +- [第二部分:生成你的主密钥][2] +- [第三部分:生成 PGP 子密钥][3] -[第二部分:生成你的主密钥][2] +这是本系列教程的第四部分,我们继续本教程,我们将谈一谈如何及为什么要将主密钥从你的家目录移到离线存储中。现在开始我们的教程。 -[第三部分:生成 PGP 子密钥][3] - -这是本系列教程的第四部分,我们继续本教程,我们将谈一谈如何及为什么要将主密钥从你的 Home 目录移到离线存储中。现在开始我们的教程。 - -### 清单 +#### 清单 * 准备一个加密的可移除的存储(必要) - * 备份你的 GnuPG 目录(必要) + * 从你的家目录中删除主密钥(推荐) + * 从你的家目录中删除吊销证书(推荐) - * 从你的 Home 目录中删除主密钥(推荐) +#### 考虑事项 - * 从你的 Home 目录中删除吊销证书(推荐) +为什么要从你的家目录中删除你的主 [C] 密钥 ?这样做的主要原因是防止你的主密钥失窃或意外泄露。对于心怀不轨的人来说,私钥对他们具有很大的诱惑力 —— 我们知道有几个恶意软件成功地实现了扫描用户的家目录并将发现的私钥内容上传。 +对于开发者来说,私钥失窃是非常危险的事情 —— 在自由软件的世界中,这无疑是身份证明失窃。从你的家目录中删除私钥将帮你防范这类事件的发生。 - - -#### Considerations - -为什么要从你的 Home 目录中删除你的主密钥 [C] ?这样做的主要原因是防止你的主密钥失窃或意外泄露。对于心怀不轨的人来说,私钥对他们具有很大的诱惑力 —— 我们知道有几个恶意软件成功地实现了扫描用户的 Home 目录并将发现的任何私钥内容上传。 - -对于任何开发者来说,私钥失窃是非常危险的事情 —— 在自由软件的世界中,这无疑是身份证明失窃。从你的 Home 目录中删除私钥将帮你防范这类事件的发生。 - -##### 备份你的 GnuPG 目录 +#### 备份你的 GnuPG 目录 **!!!绝对不要跳过这一步!!!** 备份你的 PGP 密钥将让你在需要的时候很容易地恢复它们,这很重要!(这与我们做的使用 paperkey 的灾难级备份是不一样的)。 -##### 准备可移除的加密存储 +#### 准备可移除的加密存储 我们从取得一个(最好是两个)小型的 USB “拇指“ 驱动器(可加密 U 盘)开始,我们将用它来做备份。你首先需要去加密它们: 加密密码可以使用与主密钥相同的密码。 -##### 备份你的 GnuPG 目录 +#### 备份你的 GnuPG 目录 -加密过程结束之后,重新插入 USB 驱动器并确保它能够正常挂载。你可以通过运行 `mount` 命令去找到设备挂载点的完全路径。(在 Linux 下,外置介质一般挂载在 /media/disk 下,Mac 一般在它的 /Volumes 下) +加密过程结束之后,重新插入 USB 驱动器并确保它能够正常挂载。你可以通过运行 `mount` 命令去找到设备挂载点的完全路径。(在 Linux 下,外置介质一般挂载在 `/media/disk` 下,Mac 一般在它的 `/Volumes` 下) 你知道了挂载点的全路径后,将你的整个 GnuPG 的目录复制进去: + ``` $ cp -rp ~/.gnupg [/media/disk/name]/gnupg-backup - ``` (注意:如果出现任何套接字不支持的错误,没有关系,直接忽略它们。) 现在,用如下的命令去测试一下,确保它们能够正常地工作: + ``` $ gpg --homedir=[/media/disk/name]/gnupg-backup --list-key [fpr] - ``` 如果没有出现任何错误,说明一切正常。弹出这个 USB 驱动器并给它粘上一个明确的标签,以便于你下次需要它时能够很快找到它。接着,将它放到一个安全的 —— 但不要太远 —— 的地方,因为从现在起,你需要偶尔使用它来做一些像编辑身份信息、添加或吊销子证书、或签署其它人的密钥这样的事情。 -##### 删除主密钥 +#### 删除主密钥 -我们 Home 目录中的文件并没有像我们所想像的那样受到保护。它们可能会通过许多不同的方式被泄露或失窃: +我们家目录中的文件并没有像我们所想像的那样受到保护。它们可能会通过许多不同的方式被泄露或失窃: * 通过快速复制来配置一个新工作站时的偶尔事故 - * 通过系统管理员的疏忽或恶意操作 - * 通过安全性欠佳的备份 - * 通过桌面应用中的恶意软件(浏览器、pdf 查看器等等) - * 通过跨境胁迫 +使用一个很好的密码来保护你的密钥是降低上述风险的一个很好方法,但是密码能够通过键盘记录器、背后窥视、或其它方式被发现。基于以上原因,我们建议去配置一个从你的家目录上可移除的主密钥,将它保存在一个离线存储中。 - - -使用一个很好的密码来保护你的密钥是降低上述风险的一个很好方法,但是密码能够通过键盘记录器、背后窥视、或其它方式被发现。基于以上原因,我们建议去配置一个从你的 Home 目录上可移除的主密钥,将它保存在一个离线存储中。 - -###### 删除主密钥 +##### 删除你的主密钥 **请查看前面的节,确保你有完整的你的 GnuPG 目录的一个备份。如果你没有一个可用的备份,下面所做的操作将会使你的主密钥失效!!!** 首先,识别你的主密钥的 keygrip: + ``` $ gpg --with-keygrip --list-key [fpr] - ``` 它的输出应该像下面这样: -``` -pub rsa4096 2017-12-06 [C] [expires: 2019-12-06] - 111122223333444455556666AAAABBBBCCCCDDDD - Keygrip = AAAA999988887777666655554444333322221111 -uid [ultimate] Alice Engineer -uid [ultimate] Alice Engineer -sub rsa2048 2017-12-06 [E] - Keygrip = BBBB999988887777666655554444333322221111 -sub rsa2048 2017-12-06 [S] - Keygrip = CCCC999988887777666655554444333322221111 ``` +pub rsa4096 2017-12-06 [C] [expires: 2019-12-06] + 111122223333444455556666AAAABBBBCCCCDDDD + Keygrip = AAAA999988887777666655554444333322221111 +uid [ultimate] Alice Engineer +uid [ultimate] Alice Engineer +sub rsa2048 2017-12-06 [E] + Keygrip = BBBB999988887777666655554444333322221111 +sub rsa2048 2017-12-06 [S] + Keygrip = CCCC999988887777666655554444333322221111 +``` + +找到 `pub` 行下方的 `Keygrip` 条目(就在主密钥指纹的下方)。它与你的家目录下 `.gnupg` 目录下的一个文件是一致的: -找到 pub 行下方的 keygrip 条目(就在主密钥指纹的下方)。它与你的 Home 目录下 `.gnupg` 目录下的一个文件是一致的: ``` $ cd ~/.gnupg/private-keys-v1.d $ ls AAAA999988887777666655554444333322221111.key BBBB999988887777666655554444333322221111.key CCCC999988887777666655554444333322221111.key - ``` 现在你做的全部操作就是简单地删除与主密钥 keygrip 一致的 `.key` 文件: + ``` $ cd ~/.gnupg/private-keys-v1.d $ rm AAAA999988887777666655554444333322221111.key - ``` -现在,如果运行 --list-secret-keys 命令将出现问题,它将显示主密钥丢失(# 表示不可用): +现在,如果运行 `--list-secret-keys` 命令将出现问题,它将显示主密钥丢失(`#` 表示不可用): + ``` $ gpg --list-secret-keys sec# rsa4096 2017-12-06 [C] [expires: 2019-12-06] @@ -132,23 +120,22 @@ uid [ultimate] Alice Engineer uid [ultimate] Alice Engineer ssb rsa2048 2017-12-06 [E] ssb rsa2048 2017-12-06 [S] - ``` -##### 删除吊销证书 +#### 删除吊销证书 你应该去删除的另一个文件是吊销证书(**删除之前,确保你的备份中有它**),它是使用你的主密钥自动创建的。吊销证书允许一些人去永久标记你的证书为吊销状态,这意味着它无论在任何用途中将不再被使用或信任。一般是使用它来吊销由于某些原因不再受控的一个密钥 —— 比如,你丢失了密钥密码。 -与使用主密钥一样,如果一个吊销证书泄露到恶意者手中,他们能够使用它去破坏你的开发者数字身份,因此,最好是从你的 Home 目录中删除它。 +与使用主密钥一样,如果一个吊销证书泄露到恶意者手中,他们能够使用它去破坏你的开发者数字身份,因此,最好是从你的家目录中删除它。 + ``` cd ~/.gnupg/openpgp-revocs.d rm [fpr].rev - ``` 在下一篇文章中,你将学习如何保护你的子密钥。敬请期待。 -从来自 Linux 基金会和 edX 的免费课程 [“Linux 入门" ][4] 中学习更多 Linux 知识。 +从来自 Linux 基金会和 edX 的免费课程 [“Linux 入门”][4] 中学习更多 Linux 知识。 -------------------------------------------------------------------------------- @@ -156,12 +143,12 @@ via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-p 作者:[Konstantin Ryabitsev][a] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://www.linux.com/users/mricon -[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools -[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key -[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys +[1]:https://linux.cn/article-9524-1.html +[2]:https://linux.cn/article-9529-1.html +[3]:https://linux.cn/article-9607-1.html [4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From f50536e8c2cdbd176b2b174492336cf847f0253a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 1 Jan 2019 00:39:36 +0800 Subject: [PATCH 1137/1143] PUB:20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md @qhwdw https://linux.cn/article-10402-1.html --- ...ith PGP - Part 4- Moving Your Master Key to Offline Storage.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md (100%) diff --git a/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md b/published/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md similarity index 100% rename from translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md rename to published/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md From c6f8cc7dfa8279228375489c549ea83d999179d3 Mon Sep 17 00:00:00 2001 From: darksun Date: Tue, 1 Jan 2019 14:10:04 +0800 Subject: [PATCH 1138/1143] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Two=20Years=20W?= =?UTF-8?q?ith=20Emacs=20as=20a=20CEO=20(and=20now=20CTO)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Years With Emacs as a CEO (and now CTO).md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/talk/20180809 Two Years With Emacs as a CEO (and now CTO).md diff --git a/sources/talk/20180809 Two Years With Emacs as a CEO (and now CTO).md b/sources/talk/20180809 Two Years With Emacs as a CEO (and now CTO).md new file mode 100644 index 0000000000..3e1f5d1eb2 --- /dev/null +++ b/sources/talk/20180809 Two Years With Emacs as a CEO (and now CTO).md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Two Years With Emacs as a CEO (and now CTO)) +[#]: via: (https://www.fugue.co/blog/2018-08-09-two-years-with-emacs-as-a-cto.html) +[#]: author: (Josh Stella https://www.fugue.co/blog/author/josh-stella) + +Two Years With Emacs as a CEO (and now CTO) +====== + +Two years ago, I wrote [a blog post][1] that got some notice, which surprised me. It was a piece about going back to Emacs as my primary content creation tool, first as a CEO, and now as a CTO. A brief recap is that I spent most of my career as a programmer and a software architect, and preferred Emacs as my code editor for much of that time. Reconsidering Emacs was an experiment that I was excited about, but wasn't sure how it would work out. On the Internet, the post was met with roughly equal parts disdain and appreciation, but tens of thousands of people read it, so it seems that I touched on something interesting. Some of the more challenging and funny posts on [Reddit][2] and [HackerNews][3] predicted that I'd have hands shaped like claws or that I'd have lost my eyesight because I use white backgrounds. I'm pleased to report that no dire consequences resulted, and in fact my wrists are thanking me for the decision. Some folks worried that using Emacs would be a cognitive drain on a CEO. Having taken Fugue from an idea in my backyard to a powerful product with great and enthusiastic customers, I find Emacs to be a solace from things that are actually difficult. I still use white backgrounds. + +Recently, the post was rediscovered and posted to [HackerNews][4]. I got a number of requests to follow up with a post on how things have gone since, so this is that report. In this post, I will also focus on why Emacs and functional programming are highly relevant now; and how Emacs works with our product, Fugue, that uses functional programming to automate cloud computing. I received a lot of feedback that the level of detail and color commentary were useful, so this post is also fairly verbose and I do spend some effort on explaining my thinking. I've recently moved from the CEO to CTO role here at Fugue, but the content of this post reflects the work I have been doing as CEO. I expect to do more work in code with Emacs going forward, so I have some yak shaving ahead. As always, YMMV, caveat emptor, etc. + +### It worked out better than I suspected it would + +My time is filled with nearly constant communication outside of and within the company. Communication is how things get done in the world, and the enemy of reflection and real contemplation of difficult or complex problems. The rarest commodity for me as a startup CEO is time to focus without distraction. Emacs is particularly good for this, once you've invested the time to learn a handful of commands. Other applications call out to be noticed, but a well configured Emacs gets out of the way both visually and mentally. It doesn't change unless you want it to, and there is no cleaner interface than a blank screen and beautiful typography. In my world of constant interruption, this simplicity allows me to focus solely on what I am thinking rather than the computer. The best programs provide access to the computer without demanding attention. + +A few folks pointed out that the original post was as much a criticism of modern computer interfaces as a recommendation of Emacs. I agree and disagree. Modern interfaces, and particularly their application-centric approach (vs. content-centric), are not user focused or task oriented. Emacs avoids this fallacy, which is part of why I like it so much, but it brings other merits to the table as well. Emacs is a portal into the power of the computer itself, and that is a rabbit hole worth descending. Its idioms are paths to discovering and creating your own, and that for me is the definition of creativity. One of the sad things about modern computing is that it is largely made up of black boxes with shiny interfaces that provide momentary gratification rather than real satisfaction. This makes us into consumers rather than creators/makers of technology. I don't care who you are or what your background is; you can understand your computer, and you can make things with it. It's fun, satisfying, and not as hard as you think to get started! + +We often underappreciate the effects of our environments on our psychology. Emacs imparts a feeling of calm and freedom, rather than of urgency, annoyance, or excitement - the latter of which are enemies of thought and contemplation. I like things that last, get out of the way, and provide insight when I do take the time to pay attention to them. Emacs meets all these criteria for me. I use Emacs every day for content creation, and I'm very pleased with how little I think about it. Emacs does have a learning curve, but it's no steeper than a bicycle, and has a similar payoff in that once you are through it, you don't have to think about it anymore, and it imparts a feeling of freedom that other tools don't. It's an elegant tool, from a more civilized age. I'm happy that we seem to be entering another civilized age in computing, and so Emacs is gaining in popularity. + +### I gave up on using Org-mode for schedules and to-do lists + +I spent some words in the original post on using Org-mode for schedules. I gave up on using Org-mode for to dos and the like, as I have to coordinate many meetings and calls every day with dozens of people, and I cannot ask the rest of the world to adapt to my choice of tools, nor do I have the time to transcribe or automate moving things to Org. We are primarily a Mac shop, use Google Calendar etc., and the native Mac OS/iOS tools do a good job for collaboration. I also use a plain old pen for note-taking during meetings, as I find laptop/keyboard use in meetings to be rude and limiting to my ability to listen and think. Therefore I've largely abandoned the idea that Emacs/org can help me with my schedule or organizing my life. Org-mode is great for lots of other things too though, and is my go-to for writing documents, including this one. In other words, I use it largely in ways the author didn't intend, and it's great at them. I hope someone says the same of our work at Fugue someday. + +### Emacs use has spread at Fugue + +I started the original post with an admonition that you may love Emacs, but will probably hate it. I was therefore a little concerned when the documentation team at Fugue picked it as their standard tool, as I thought perhaps they were influenced by my appreciation for it. A couple years later, I'm pretty sure that it was a good call for them. The leader of the team at the time was a very bright programmer, but the two writers we hired to make the Fugue documentation had less technical backgrounds. I figured that if it was a case of a manager imposing the wrong tool, I'd hear about it and it would resolve itself, as Fugue has an anti-authoritarian culture where people are unafraid to call bullshit on anything or anyone, including me. The original manager left Fugue last year, but the docs team now has a slick, integrated CI/CD toolchain for [docs.fugue.co][5], and they've become enthusiastic Emacs users. There is a learning curve for Emacs, but it's not that tall even if it is steep, and climbing it has real benefits in productivity and general happiness. It was also a reminder that liberal arts focused people are every bit as smart and capable with technology as programmers, and perhaps less prone to technology religions and tribalism. + +### My wrists are thanking me + +I've been spending 12 hours a day or so at a computer since the mid-eighties, and it has taken a toll on my wrists (as well as my back, for which I unreservedly recommend the Tag Capisco chair). The combination of Emacs and an ergonomic keyboard has made the RSI wrist issues go away to the point that I haven't thought about it in over a year. Prior to that, I was having daily pain, particularly in my right wrist, and if you've had this issue, you know it can be very distracting and worrying. A few folks asked about keyboards and mice, so if you're interested I'm currently using a [keyboard.io][6] though I've mainly used a Truly Ergonomic keyboard over the last couple years. I'm a few weeks into using the keyboard.io, and I absolutely love it. The shaped key caps are amazing for knowing where you are without looking, and the thumb keys seem obvious in retrospect, particularly for Emacs, where Control and Meta are your constant companions. No more using the pinkie for highly repetitive tasks! + +The amount of mousing I do is much lower than when using Office and IDEs, and that has helped a lot, but I do still need a mouse. I've been using the rather dated looking but highly functional and ergonomic Clearly Superior trackball, which lives up to its name. + +Specific tools aside, the main point is that a great keyboard combined with mouse avoidance has proved very effective at reducing wear and tear on my body. Emacs is central to this because I don't have to mouse around menus to get things done, and the navigation keys are right under my fingers. I'm pretty convinced now that hand movement away from the standard typing position causes a lot of tendon stress for me. YMMV, I'm not a doctor, etc. + +### I haven't done much to my config... + +Some predicted that I'd spend a lot of time yak shaving my configuration. I wondered if they were right, so I paid attention. Not only have I left my config largely alone, paying attention to the issue has made me realize just how much the other tools I use demand my attention and time. Emacs is easily the lowest maintenance piece of software I use. Mac OS and Windows are constantly demanding that I update them, but that's far less intrusive than Adobe Suite and Office's update intrusions in my world. I do occasionally update my Emacs, but it still works the same way, so it's largely a near zero cost operation for me, and one I can choose to do when I please. + +I'm sorry to disappoint, as a number of folks wanted to know what I've done to keep up with a renewed Emacs community and its output, but I've only added a few things to my config over the last two years. I consider this a success, as Emacs is a tool, not a hobby for me. That said, I'd love to hear about new things if you want to share. + +### ...Except for controlling the cloud + +We have a lot of Emacs fans at Fugue, so we've had a [Ludwig-mode][7] for a while now. Ludwig is our declarative, functional DSL for automating cloud infrastructure and services. Recently, Alex Schoof took some flight and evening hours to build fugue-mode, which acts as an Emacs console over the Fugue CLI. If you aren't familiar with Fugue, we make a cloud automation and governance tool that leverages functional programming to give users a great experience of interacting with cloud APIs. Well, it does a lot more than that, but it does that too. Fugue-mode is cool for a number of reasons. It allows me to have a buffer that is constantly reporting on the status of my cloud infrastructure, and since I often modify that infrastructure, I can quickly see the effects of my coding. Fugue organizes cloud workloads into processes, and Fugue-mode is a lot like top for cloud workloads. It also allows me to perform operations like creating new infrastructure or deleting stuff that isn't needed anymore, without much typing. Fugue-mode is a prototype, but it's pretty handy and I now use it regularly. + +![fugue-mode-edited.gif][8] + +### Modes and monitors + +I have added a few modes and integrations, but not really for work/CEO functions. I've been hacking around in Haskell and Scheme on the weekends for fun, so I've added haskell-mode and geiser. Emacs is great for languages that have a REPL, as you can divide up your screen into different "windows" that are running different modes, including REPLs or shells. Geiser is great for Scheme, and if you've not done so, working through SICP is a joy and possibly a revelation in an age that has lots of examples of cargo cult programming. Install MIT Scheme and geiser and you've got something that feels a bit like the Symbolics environments of lore. + +This brings up another topic I didn't cover in the 2015 post: screen management. I like to use a single portrait mode monitor for writing, and I have this configuration at my home and at my primary office. For programming or mixed use, I like the new ultra-wide monitors that we provide to all Fuguers. For these, I prefer to divide my screen into three columns, with the center having my main editing buffer, the left side having a shell and a fugue-mode buffer divided horizontally, and the right having either a documentation buffer or another editing buffer or two. This is easily done by first using 'Ctl-x 3' twice, then 'Ctl-x =' to make the windows equal in width. This will give you three equal columns that you can further subdivide as you like with 'Ctl-x 2' for horizontal divisions. Here's a screenshot of what this looks like. + +![Emacs Screen Shot][9] + +### This will be my last CEO/Emacs post... + +The first reason for this is that I'm now the CTO of Fugue, but also because there are so many topics I'm looking forward to blogging about and now I should have time to do so. I'm planning on doing some deeper dive posts on topics like functional programming, type safety for infrastructure-as-code, and as we roll out some awesome new Fugue capabilities, some posts on what is achievable on the cloud using Fugue. + +-------------------------------------------------------------------------------- + +via: https://www.fugue.co/blog/2018-08-09-two-years-with-emacs-as-a-cto.html + +作者:[Josh Stella][a] +选题:[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.fugue.co/blog/author/josh-stella +[b]: https://github.com/lujun9972 +[1]: https://blog.fugue.co/2015-11-11-guide-to-emacs.html +[2]: https://www.reddit.com/r/emacs/comments/7efpkt/a_ceos_guide_to_emacs/ +[3]: https://news.ycombinator.com/item?id=10642088 +[4]: https://news.ycombinator.com/item?id=15753150 +[5]: https://docs.fugue.co/ +[6]: https://shop.keyboard.io/ +[7]: https://github.com/fugue/ludwig-mode +[8]: https://www.fugue.co/hubfs/Imported_Blog_Media/fugue-mode-edited-1.gif +[9]: https://www.fugue.co/hs-fs/hubfs/Emacs%20Screen%20Shot.png?width=929&name=Emacs%20Screen%20Shot.png From 9adb867080e2dfc35d11bc0a136c697b05c3ade5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 1 Jan 2019 16:57:47 +0800 Subject: [PATCH 1139/1143] PRF:20181222 A Tale of HTTP-2.md @geekpi --- translated/tech/20181222 A Tale of HTTP-2.md | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20181222 A Tale of HTTP-2.md b/translated/tech/20181222 A Tale of HTTP-2.md index 9fcaddfad9..1c872981f1 100644 --- a/translated/tech/20181222 A Tale of HTTP-2.md +++ b/translated/tech/20181222 A Tale of HTTP-2.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A Tale of HTTP/2) @@ -14,7 +14,7 @@ 说实话,我刚刚重写了管理我们备份程序的 Puppet 代码,启用 HTTP/2 似乎是一种转向另一个大型项目之前有效的拖延方式。这有多难? -结果我花了大约 25 个小时来完成。坐下来穿上舒适的拖鞋,因为这是一个 HTTP/2 的故事! +结果我花了大约 25 个小时来完成。坐下来穿上舒适的拖鞋,听听这个 HTTP/2 的故事! [![The Yule Log][2]][3] @@ -25,15 +25,15 @@ ``` Protocols h2 h2c http/1.1 -H2Push on -H2PushPriority core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated after -H2PushPriority text/css before -H2PushPriority image/jpeg after 32 -H2PushPriority image/png after 32 -H2PushPriority application/javascript interleaved +H2Push on +H2PushPriority * after +H2PushPriority text/css before +H2PushPriority image/jpeg after 32 +H2PushPriority image/png after 32 +H2PushPriority application/javascript interleaved ``` -这当然很容易。即使 Apache 中的所有内容都已正确设置,网站仍然可以使用 HTTP/1.1。不过,显然我做得没错,因为我的网站现在发送了一个新的 HTTP 头:`Upgrade: h2, h2c`。 +这当然很容易。即使 Apache 中的所有内容都已正确设置,网站仍然使用的是 HTTP/1.1。不过,显然我做得没错,因为我的网站现在发送了一个新的 HTTP 头:`Upgrade: h2, h2c`。 在浪费了大量时间调试 TLS 密钥(HTTP/2 [与 TLS 1.1 不兼容][4])之后,我终于发现问题是没有使用正确的 Apache 多进程处理模块。 @@ -43,13 +43,13 @@ H2PushPriority application/javascript interleaved ![A clip from Alice in Wonderlands][5] -在很长一段时间里,一位好友一直试图让我相信 [PHP-FPM][6] 的优点。虽然纸上看起来很好, 但我从来没有真正试过。它看起来很复杂。常规的 `mod_php` 做得很好,还有其他事情需要我注意。 +在很长一段时间里,一位好友一直试图让我相信 [PHP-FPM][6] 的优点。虽然表面上看起来很好,但我从来没有真正试过。它看起来很复杂。常规的 `mod_php` 做得很好,还有其他事情需要我注意。 事实上,这次的 HTTP/2 事件是让我钻研它的一个契机。在我理解了 FPM 池的工作原理后,它实际上很容易设置。由于我不得不重写我们用于部署网站的 Puppet 配置文件,我也借此机会巩固了一堆东西。 PHP-FPM 允许你在不同的 Unix 用户下运行网站来增加隔离性。最重要的是,我决定是时候让我们服务器上的 PHP 代码以只读模式运行,并且不得不为我们的 Wordpress、Nextcloud、KanBoard 和 Drupal 实例调整一些东西来减少报错。 -过了很长时间通过 Puppet 的自动任务后,我终于能够在任何地方关闭 `mod_php` 和 `mpm_prefork` 并启用 `mpm_event` 和 `mod_http2`。PHP-FPM 和 HTTP/2 带来的速度提升不错,但更让我感到高兴的是这次磨练增强了我们的 Apache 处理 PHP 的能力。 +过了很长时间通过 Puppet 的自动任务后,我终于能够全部关闭 `mod_php` 和 `mpm_prefork` 并启用 `mpm_event` 和 `mod_http2`。PHP-FPM 和 HTTP/2 带来的速度提升不错,但更让我感到高兴的是这次磨练增强了我们的 Apache 处理 PHP 的能力。 ![Victory!][7] @@ -60,7 +60,7 @@ via: https://veronneau.org/a-tale-of-http2.html 作者:[Louis-Philippe Véronneau][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/) 荣誉推出 @@ -72,4 +72,4 @@ via: https://veronneau.org/a-tale-of-http2.html [4]: https://http2.github.io/http2-spec/#TLSUsage [5]: https://veronneau.org/media/blog/2018-12-22/mod_php.gif (A clip from Alice in Wonderlands) [6]: https://wiki.apache.org/httpd/PHP-FPM -[7]: https://veronneau.org/media/blog/2018-12-22/victory.png (Victory!) \ No newline at end of file +[7]: https://veronneau.org/media/blog/2018-12-22/victory.png (Victory!) From d45457e8d38c634c8a096c37813c40f61235c887 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 1 Jan 2019 17:03:49 +0800 Subject: [PATCH 1140/1143] PUB:20181222 A Tale of HTTP-2.md @geekpi https://linux.cn/article-10404-1.html --- {translated/tech => published}/20181222 A Tale of HTTP-2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181222 A Tale of HTTP-2.md (98%) diff --git a/translated/tech/20181222 A Tale of HTTP-2.md b/published/20181222 A Tale of HTTP-2.md similarity index 98% rename from translated/tech/20181222 A Tale of HTTP-2.md rename to published/20181222 A Tale of HTTP-2.md index 1c872981f1..1374a98481 100644 --- a/translated/tech/20181222 A Tale of HTTP-2.md +++ b/published/20181222 A Tale of HTTP-2.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10404-1.html) [#]: subject: (A Tale of HTTP/2) [#]: via: (https://veronneau.org/a-tale-of-http2.html) [#]: author: (Louis-Philippe Véronneau https://veronneau.org/) From 582d5ade684ca3009e84f70ce0a601e3c3c8b904 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 1 Jan 2019 17:18:10 +0800 Subject: [PATCH 1141/1143] PRF:20181221 How to Build a Netboot Server, Part 3.md @qhwdw --- ...1 How to Build a Netboot Server, Part 3.md | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/translated/tech/20181221 How to Build a Netboot Server, Part 3.md b/translated/tech/20181221 How to Build a Netboot Server, Part 3.md index e174248f62..f36338fd7b 100644 --- a/translated/tech/20181221 How to Build a Netboot Server, Part 3.md +++ b/translated/tech/20181221 How to Build a Netboot Server, Part 3.md @@ -1,22 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: () -[#]: publisher: () -[#]: url: () +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) [#]: subject: (How to Build a Netboot Server, Part 3) [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-3/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) -如何构建一台网络引导服务器(第三部分) +如何构建一台网络引导服务器(三) ====== ![](https://fedoramagazine.org/wp-content/uploads/2018/12/netboot3-816x345.jpg) -在 [如何构建一台网络引导服务器(第一部分)][1] 的文章中,我们提供了一个极简的 [iPXE][2] 引导脚本来引导你的网络引导镜像。许多用户除了使用网络引导镜像外,可能在机器本地也有一个操作系统。但是使用常见的工作站的 BIOS 去切换引导加载器是很笨拙的。在本系列文件的第三部分,我们将向你展示如何设置一个更复杂的 iPXE 配置。它将允许终端用户以更容易的方式去选择引导哪个操作系统。它也可以配置为让系统管理员从一台中央服务器来统一管理引导菜单。 +在 [如何构建一台网络引导服务器(一)][1] 中,我们提供了一个极简的 [iPXE][2] 引导脚本来引导你的网络引导镜像。许多用户除了使用网络引导镜像外,可能在机器本地也有一个操作系统。但是使用常见的工作站的 BIOS 去切换引导加载器是很笨拙的。在本系列文件的第三部分,我们将向你展示如何设置一个更复杂的 iPXE 配置。它将允许终端用户以更容易的方式去选择引导哪个操作系统。它也可以配置为让系统管理员从一台中央服务器来统一管理引导菜单。 ### 一个交互式 iPXE 引导菜单 -下面这些命令重定义了网络引导镜像的 boot.cfg 来作为一个交互式的 iPXE 引导菜单,并使用了一个 5 秒倒计时的定时器: +下面这些命令重定义了网络引导镜像的 `boot.cfg` 来作为一个交互式的 iPXE 引导菜单,并使用了一个 5 秒倒计时的定时器: ``` $ MY_FVER=29 @@ -61,22 +61,20 @@ END 上述菜单有五个节: - * **menu** 定义了显示在屏幕上的实际菜单内容。 - * **failed** 提示用户发生了错误,并将用户带到 shell 以错误错误。 - * **shell** 提供了交互式命令提示符。你可以在引导菜单出现时按下 **Esc** 键进入,或者是 - “boot” 命令失败时也会进入到命令提示符。 - * **lcl** 包含一个提供给 iPXE 退出的简单命令,以及返还控制权给 BIOS。在 iPXE 之后,无论你希望缺省引导的设备(即:工作站的本地硬件)是什么,都必须在你的工作站的 BIOS 中正确地作为下一个引导设备列出来。 - * **f29** 包含前面文章提到同一个网络引导代码,但使用最终的退出代码来替换掉 goto failed。 + * `menu` 定义了显示在屏幕上的实际菜单内容。 + * `failed` 提示用户发生了错误,并将用户带到 shell 以错误错误。 + * `shell` 提供了交互式命令提示符。你可以在引导菜单出现时按下 `Esc` 键进入,或者是 + `boot` 命令失败时也会进入到命令提示符。 + * `lcl` 包含一个提供给 iPXE 退出的简单命令,以及返还控制权给 BIOS。在 iPXE 之后,无论你希望缺省引导的设备(即:工作站的本地硬件)是什么,都必须在你的工作站的 BIOS 中正确地作为下一个引导设备列出来。 + * `f29` 包含前面文章提到同一个网络引导代码,但使用最终的退出代码来替换掉 `goto failed`。 - - -从你的 `$HOME/esp/linux` 目录中复制更新后的 boot.cfg 到所有客户端系统的 ESP 中。如果一切顺利,你应该会看到类似下面图片的结果: +从你的 `$HOME/esp/linux` 目录中复制更新后的 `boot.cfg` 到所有客户端系统的 ESP 中。如果一切顺利,你应该会看到类似下面图片的结果: ![][3] ### 一个服务器托管的引导菜单 -你可以添加到网络引导服务器的另一个特性是,能够从一台中央位置去管理所有客户端的引导菜单。这个特性尤其适用于批量安装(升级)一个新版本的操作系统。在你将新内核和新的 initramfs 复制到所有客户端的 ESP 之后,这个特性可以让你执行一种 [原子事务][4] 去切换所有客户端到新操作系统。 +你可以添加到网络引导服务器的另一个特性是,能够从一台中央位置去管理所有客户端的引导菜单。这个特性尤其适用于批量安装(升级)一个新版本的操作系统。在你将新内核和新的 `initramfs` 复制到所有客户端的 ESP 之后,这个特性可以让你执行一种 [原子事务][4] 去切换所有客户端到新操作系统。 安装 Mojolicious: @@ -116,9 +114,9 @@ END END ``` -这是一个非常简单的 Mojolicious 应用程序,它监听 80 端口,并且只回复到 /menu 的请求。如果你想快速了解 Mojolicious 能做什么,运行 `man Mojolicious::Guides::Growing` 去查看手册。按 **Q** 键退出手册。 +这是一个非常简单的 Mojolicious 应用程序,它监听 80 端口,并且只回应对 `/menu` 的请求。如果你想快速了解 Mojolicious 能做什么,运行 `man Mojolicious::Guides::Growing` 去查看手册。按 `Q` 键退出手册。 -将 boot.cfg 移到我们的网络引导应用程序中作为一个名为 menu.html.ep 的模板: +将 `boot.cfg` 移到我们的网络引导应用程序中作为一个名为 `menu.html.ep` 的模板: ``` # mkdir /opt/bootmenu/templates @@ -157,7 +155,7 @@ END # systemctl start bootmenu.service ``` -用 wget 测试它: +用 `wget` 测试它: ``` $ sudo dnf install -y wget @@ -199,9 +197,9 @@ initrd --name initrd.img ${prefix}/initramfs-4.19.4-300.fc29.x86_64.img boot || goto failed ``` -现在,引导菜单服务器已经正常工作了,重新构建 ipxe.efi 引导加载器,使用一个 init 脚本指向它。 +现在,引导菜单服务器已经正常工作了,重新构建 `ipxe.efi` 引导加载器,使用一个初始化脚本指向它。 -第一步,先更新我们在本系列文章的第一部分中创建的 init.ipxe 脚本: +第一步,先更新我们在本系列文章的第一部分中创建的 `init.ipxe` 脚本: ``` $ MY_BOOTMENU_SERVER=server-01.example.edu @@ -236,7 +234,7 @@ $ sudo systemctl restart bootmenu.service ### 做一步的改变 -如果引导菜单服务器工作正常,在你的客户端系统上的 boot.cfg 文件将更长。 +如果引导菜单服务器工作正常,在你的客户端系统上的 `boot.cfg` 文件将更长。 比如,重新添加 Fedora 28 镜像到引导菜单中: @@ -271,13 +269,13 @@ via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-3/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者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/glb/ [b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/how-to-build-a-netboot-server-part-1/ +[1]: https://linux.cn/article-10379-1.html [2]: https://ipxe.org/ [3]: https://fedoramagazine.org/wp-content/uploads/2018/11/netboot-menu-1024x641.png [4]: https://en.wikipedia.org/wiki/Atomicity_(database_systems) From 92bdc0971aa6288b71f4dcbf698fd141bfed7e93 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 1 Jan 2019 17:22:14 +0800 Subject: [PATCH 1142/1143] PUB:20181221 How to Build a Netboot Server, Part 3.md @qhwdw https://linux.cn/article-10405-1.html --- .../20181221 How to Build a Netboot Server, Part 3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181221 How to Build a Netboot Server, Part 3.md (99%) diff --git a/translated/tech/20181221 How to Build a Netboot Server, Part 3.md b/published/20181221 How to Build a Netboot Server, Part 3.md similarity index 99% rename from translated/tech/20181221 How to Build a Netboot Server, Part 3.md rename to published/20181221 How to Build a Netboot Server, Part 3.md index f36338fd7b..72a8d2f7f8 100644 --- a/translated/tech/20181221 How to Build a Netboot Server, Part 3.md +++ b/published/20181221 How to Build a Netboot Server, Part 3.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10405-1.html) [#]: subject: (How to Build a Netboot Server, Part 3) [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-3/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) From 36eebe27941005288895e4661ddf65c29c13e469 Mon Sep 17 00:00:00 2001 From: zgj Date: Tue, 1 Jan 2019 18:17:03 +0800 Subject: [PATCH 1143/1143] =?UTF-8?q?zgj1024=20=E8=AE=A4=E9=A2=86=20201807?= =?UTF-8?q?31=20How=20to=20be=20the=20lazy=20sysadmin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zgj1024 认领文章 --- sources/talk/20180731 How to be the lazy sysadmin.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20180731 How to be the lazy sysadmin.md b/sources/talk/20180731 How to be the lazy sysadmin.md index 25024a20bd..52491e397c 100644 --- a/sources/talk/20180731 How to be the lazy sysadmin.md +++ b/sources/talk/20180731 How to be the lazy sysadmin.md @@ -1,3 +1,4 @@ +zgj1024 is translating How to be the lazy sysadmin ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cat-yawn-vm.png?itok=0c_zy6aQ)