@@ -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 0415/2058] 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 0416/2058] 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 0417/2058] 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 0418/2058] 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 0419/2058] =?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 0420/2058] 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 0421/2058] 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 0422/2058] [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 0423/2058] =?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 0424/2058] =?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 0425/2058] [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 0426/2058] 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 0427/2058] 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 0428/2058] =?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 0429/2058] 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 0430/2058] 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 0431/2058] =?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 0432/2058] 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 0433/2058] 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 0434/2058] 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 0435/2058] 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 0436/2058] 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 0437/2058] 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 0438/2058] 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 0439/2058] 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 0440/2058] =?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 0441/2058] 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 0442/2058] 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 0443/2058] 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 0444/2058] 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 0445/2058] 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 0446/2058] 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 0447/2058] 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 0448/2058] 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 0449/2058] 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 0450/2058] 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 0451/2058] 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 0452/2058] 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 0453/2058] 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 0454/2058] 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 0455/2058] =?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 0456/2058] =?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 0457/2058] =?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 0458/2058] =?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 0459/2058] =?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 0460/2058] 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 0461/2058] 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 0462/2058] 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 0463/2058] 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 0464/2058] 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 0465/2058] =?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 0466/2058] 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 0467/2058] 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 0468/2058] 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 0469/2058] 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 0470/2058] 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 0471/2058] [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 0472/2058] 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 0473/2058] 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 0474/2058] 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 0475/2058] 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 0476/2058] 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 0477/2058] 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 0478/2058] 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 0479/2058] 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 0480/2058] 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 0481/2058] 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 0482/2058] =?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 0483/2058] =?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 0484/2058] =?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 0485/2058] =?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 0486/2058] =?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 0487/2058] =?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 0488/2058] =?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 0489/2058] 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 0490/2058] 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 0491/2058] 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 0492/2058] 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 0493/2058] 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 0494/2058] 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 0495/2058] 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 0496/2058] 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 0497/2058] 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 0498/2058] 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 0499/2058] 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 0500/2058] 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 0501/2058] 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 0502/2058] 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 0503/2058] =?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 0504/2058] =?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 0505/2058] 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 0506/2058] 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 0507/2058] 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 0508/2058] 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 0509/2058] 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 0510/2058] 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 0511/2058] 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 0512/2058] 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 0513/2058] 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 0514/2058] 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 0515/2058] 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 0516/2058] 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 0517/2058] 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 0518/2058] =?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 0519/2058] =?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 0520/2058] 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 0521/2058] 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 0522/2058] 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 0523/2058] 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 0524/2058] 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 0525/2058] =?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 0526/2058] =?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 0527/2058] =?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 0528/2058] 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 0529/2058] 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 0530/2058] 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 0531/2058] 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 0532/2058] 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 0533/2058] 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 0534/2058] 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: `