From 13b7fc841a5a6fdb39245fe1d483c99bc14c7b08 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 00:44:58 +0800 Subject: [PATCH 01/69] PRF:20180419 Migrating to Linux- Network and System Settings.md @ScarboroughCoral --- ...g to Linux- Network and System Settings.md | 102 ++++++++---------- 1 file changed, 44 insertions(+), 58 deletions(-) diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md index 480aa05239..b9fe12b66e 100644 --- a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md +++ b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md @@ -1,106 +1,92 @@ -# 迁移到 Linux 工作环境: 网络和系统设置 +迁移到 Linux:网络和系统设置 +====== + +> 这个系列我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux;这篇中我们涉及到 Linux 桌面系统上的一些常见设置。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO) -在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到Linux。如果你错过了以前的文章,可以从这访问: +在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux。如果你错过了以前的文章,可以从这访问: -[Part 1 - 基本介绍][1] +- [第1部分 - 入门介绍][1] +- [第2部分 - 磁盘、文件和文件系统][2] +- [第3部分 - 图形操作环境][3] +- [第4部分 - 命令行][4] +- [第5部分 - 使用 sudo][5] +- [第5部分 - 安装软件][6] -[Part 2 - 磁盘、文件和文件系统][2] +Linux 提供了一系列网络和系统设置。在你的桌面计算机上,Linux 允许您调整系统上的任何内容。大多数这些设置都出现在 `/etc` 目录下的纯文本文件中。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。 -[Part 3 - 图形界面环境][3] +大多数设置都能够在“设置”程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。 -[Part 4 - 命令行][4] +### 连接互联网 -[Part 5 - 使用 sudo 命令][5] +在 Linux 中连接到互联网通常非常简单。如果您通过以太网电缆连接,Linux 通常会在插入电缆时或启动时(如果电缆已连接)获得 IP 地址并自动连接。 -[Part 6 - 软件安装][6] +如果您使用无线网络,则在大多数发行版中都有一个菜单,可以在指示器面板中或在“设置”中(取决于您的发行版),您可以在其中选择无线网络的 SSID。如果网络受密码保护,它通常会提示您输入密码。然后连接,这个过程相当顺利。 -Linux 提供了一系列网络和系统设置。在桌面上,Linux允许您调整系统上的任何内容。大多数这些设置都在/ etc目录下的纯文本文件中公开。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。 - - - -大多数设置都能够在设置程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。 - - - -### 连接因特网 - -在Linux中连接到Internet通常非常简单。如果您通过以太网电缆连接,Linux通常会在插入电缆时或启动时获得IP地址并自动连接(如果电缆已连接)。 - -如果您使用无线,则在大多数发行版中都有一个菜单,可以在指示器面板中或在设置中(取决于您的发行版),您可以在其中选择无线网络的SSID。如果网络受密码保护,它通常会提示您输入密码。 然后连接,这个过程相当顺利。 - -在图形界面您可以通过进入设置来调整网络设置。通常称为系统设置或者是设置。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。 +在图形界面您可以通过进入设置来调整网络设置。通常称为“系统设置”或者是“设置”。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。 ![Network Settings][8] -图1: Gnome 桌面网络设置指示器图标. - -[经许可使用][9] +*图1: Gnome 桌面网络设置指示器图标。* ### 网络接口名称 -在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 - 或以太网和无线。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。 +在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 —— 或“以太网”和“无线网络”。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0 和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。 ### 通过命令行进行网络管理 如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。 -请注意,用于在图形桌面中管理网络的最常用服务是网络管理器,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。 +请注意,用于在图形桌面中管理网络的最常用服务是“网络管理器Network Manager”,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。 -更改图形环境中的设置很可能与网络管理器交互,您还可以使用名为nmtui的工具从命令行更改网络管理器设置。nmtui工具提供了您在图形环境中找到的所有设置,但是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图2)。 +在图形环境中的更改设置与在网络管理器中很类似,您还可以使用名为 `nmtui` 的工具从命令行更改网络管理器设置。`nmtui` 工具提供了您在图形环境中找到的所有设置,但是是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图 2)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ) -图 2:nmtui 界面 +*图 2:nmtui 界面* -[经许可使用][9] - -在命令行上,有一个名为 ifconfig 的旧工具来管理网络,还有一个名为 ip 的新工具。在某些发行版中,ifconfig 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,ifconfig 仍可以使用。 +在命令行上,有一个名为 `ifconfig` 的旧工具来管理网络,还有一个名为 `ip` 的新工具。在某些发行版中,`ifconfig` 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,`ifconfig` 仍可以使用。 以下是一些允许您显示和更改网络设置的命令: ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ) -[经许可使用][9] - ### 进程和系统信息 -在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能.。 +在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能。 -在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可以使用的图形工具。大多数所共有的工具是 System Monitor 和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。 +在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可用的图形工具。大多数所共有的工具是“系统监视器”和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA) -图 3:NetHogs 截图 - -[经许可使用][9] +*图 3:NetHogs 截图* 在这些工具中,你也可以查看系统全局网络流量(图 4)。 ![System Monitor][11] -图4: Gnome System Monitor 的截图 - -[经许可使用][9] +*图 4:Gnome System Monitor 的截图* ### 管理进程和系统使用 -您还可以从命令行使用相当多的工具。使用 ps 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 ps 命令不会使用可以使用命令 info ps 或者 man ps。 +您还可以从命令行使用相当多的工具。使用 `ps` 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 `ps` 命令不会使用,可以使用命令 `info ps` 或者 `man ps` 获取帮助。 -大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或CPU时间的进程。这种情况下有两个非常简单的命令,分别是 top 和 htop 命令(图 5)。 +大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或 CPU 时间的进程。这种情况下有两个非常简单的命令,分别是 `top` 和 `htop` 命令(图 5)。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl) -top 和 htop 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。 +*图 5:top 截屏* -使用两个命令时 (top and htop),你可以输入 ”?“ 来获取使用帮助,输入 ”q“ 来退出程序。使用 top 命令你可以按”k“键然后输入进程 ID 来杀死某个进程。 +`top` 和 `htop` 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。 -使用 htop 命令时你可以使用 ↑↓ 键来将列表中的一条记录进行高亮显示,按下 F9 键会杀死进程(需要回车确认)。 +使用这两个命令时(`top` 和 `htop`),你可以输入 `?` 来获取使用帮助,输入 `q` 来退出程序。使用 `top` 命令你可以按 `k` 键然后输入进程 ID 来杀死某个进程。 + +使用 `htop` 命令时你可以使用 `↑` `↓` 键来将列表中的一条记录进行高亮显示,按下 `F9` 键会杀死进程(需要回车确认)。 本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。 -想学习更多 Linux 内容可访问免费的 ["Linux 简介" ][12]课程,此课程来自 Linux 基金会和 edx. +想学习更多 Linux 内容可访问免费的 [Linux 简介][12]课程,此课程来自 Linux 基金会和 edx。 ------ @@ -109,20 +95,20 @@ via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system- 作者:[John Bonesio][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[ScarboroughCoral](https://github.com/ScarboroughCoral) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.linux.com/users/johnbonesio -[1]: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction -[2]: https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems -[3]: https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments -[4]: https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line -[5]: https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo -[6]: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software +[1]: https://linux.cn/article-9212-1.html +[2]: https://linux.cn/article-9213-1.html +[3]: https://linux.cn/article-9293-1.html +[4]: https://linux.cn/article-9565-1.html +[5]: https://linux.cn/article-9819-1.html +[6]: https://linux.cn/article-9823-1.html [7]: https://www.linux.com/files/images/figure-1png-2 -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings" +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings" [9]: https://www.linux.com/licenses/category/used-permission [10]: https://www.linux.com/files/images/figure-4png-1 -[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor" +[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor" [12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 5bae0d23ac4dfdf272d8cb162c8b1ddc0389daad Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 00:45:38 +0800 Subject: [PATCH 02/69] PUB:20180419 Migrating to Linux- Network and System Settings.md @ScarboroughCoral https://linux.cn/article-10363-1.html --- .../20180419 Migrating to Linux- Network and System Settings.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180419 Migrating to Linux- Network and System Settings.md (100%) diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/published/20180419 Migrating to Linux- Network and System Settings.md similarity index 100% rename from translated/tech/20180419 Migrating to Linux- Network and System Settings.md rename to published/20180419 Migrating to Linux- Network and System Settings.md From 2132fc3343ac37a09ecbbb1deaac05790124f4d8 Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 19 Dec 2018 11:16:42 +0800 Subject: [PATCH 03/69] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...23 Celebrate Christmas In Linux Way With These Wallpapers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md index e59286ddbc..94c08d72ae 100644 --- a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (jlztan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers) From 1704626c5ecb804fae391bf0dc8aa6c46dc7f9f4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 15:45:26 +0800 Subject: [PATCH 04/69] PRF:20180911 Know Your Storage- Block, File - Object.md @qhwdw --- ...Know Your Storage- Block, File - Object.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/translated/tech/20180911 Know Your Storage- Block, File - Object.md b/translated/tech/20180911 Know Your Storage- Block, File - Object.md index 3dc77ad8e3..01f4cb4b15 100644 --- a/translated/tech/20180911 Know Your Storage- Block, File - Object.md +++ b/translated/tech/20180911 Know Your Storage- Block, File - Object.md @@ -1,43 +1,44 @@ 认识存储:块、文件和对象 ====== +> 今天产生的大量数据带来了新的存储挑战。在本文中了解各种存储类型以及它们的使用方式。 ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/block2_1920.jpg?itok=s1y6RLhT) -现在,对于那些创建或消费数据的公司来说,处理生成的数量巨大的数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。 +现在,对于那些创建或消费数据的公司来说,处理数量巨大的生成数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。 - Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“ +Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“ -任何挑战都意味着机遇。Azure 存储、介质和边缘总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。” +任何挑战都意味着机遇。Azure 存储、介质和边缘计算总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。” ### 现代软件定义存储的三种类型 -这里有三个不同类型的存储解决方案 — 块、文件、和对象 — 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。 +这里有三个不同类型的存储解决方案 —— 块、文件、和对象 —— 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。 -块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置”。 +块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 的软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置。” -块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,它创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。 +块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,其创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。 -St. Jean 说“块存储将单个的存储卷(像一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。“ +St. Jean 说“块存储将单个的存储卷(如一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。” -每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 — 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。 +每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 —— 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。 -块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器、或集群中呈现出的机器访问。 +块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器访问,或呈现给集群中的机器访问。 ### 基于文件的存储 -基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直接或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。 St. Jean 说,”使用文件存储时,数据在服务器侧的排列格式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。 +基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直连或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。St. Jean 说,”使用文件存储时,数据在服务器侧的存储方式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。 -最终成为了一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是限制访问处于这些文件和文件夹之下的数据块。 +其结果就是一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是被限制访问处于这些文件和文件夹之下的数据块。 -Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录、和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“ +Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“ ### 对象存储 -对象存储是最新的数据存储形式,它为非结构化数据提供一个库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 — 数据和元数据 — 构成了一个对象。 +对象存储是最新的数据存储形式,它为非结构化数据提供一个仓库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 —— 数据和元数据 —— 构成了一个对象。 对象存储的一个好处是每个数据块都关联了一个唯一标识符。访问数据需要唯一标识符,并且不需要应用程序或用户知道数据的真实存储位置。对象数据是通过 API 来访问的。 -St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被安排在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 — 这使得它们在存储规模巨大时访问速度很快。” +St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被组织在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 —— 这使得它们在存储规模巨大时访问速度很快。” 对象存储可以扩展到很多 PB 字节大小,以适应巨大的数据集,因此它是图像、音频、视频、日志、备份、和分析服务所使用的数据存储的最佳选择。 @@ -52,7 +53,7 @@ via: https://www.linux.com/blog/2018/9/know-your-storage-block-file-object 作者:[Swapnil Bhartiya][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[qhwdw](https://github.com/qhwdw) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 87d11f5ea0d30a91101f01eac2fd6a79208a2f16 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 15:46:05 +0800 Subject: [PATCH 05/69] PUB:20180911 Know Your Storage- Block, File - Object.md @qhwdw https://linux.cn/article-10364-1.html --- .../20180911 Know Your Storage- Block, File - Object.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180911 Know Your Storage- Block, File - Object.md (100%) diff --git a/translated/tech/20180911 Know Your Storage- Block, File - Object.md b/published/20180911 Know Your Storage- Block, File - Object.md similarity index 100% rename from translated/tech/20180911 Know Your Storage- Block, File - Object.md rename to published/20180911 Know Your Storage- Block, File - Object.md From 3bdd047664f41dbda43491fc6efafb06ddea3914 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 17:52:06 +0800 Subject: [PATCH 06/69] PRF:20181130 SMPlayer in Linux- Features, Download and Installation.md @geekpi --- ...ux- Features, Download and Installation.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md index be826fc446..1e0147ac10 100644 --- a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md +++ b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md @@ -1,29 +1,30 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (SMPlayer in Linux: Features, Download and Installation) [#]: via: (https://itsfoss.com/smplayer/) [#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/) [#]: url: ( ) -Linux 中的 SMPlayer:功能,下载和安装 +SMPlayer:增强版的媒体播放器 ====== 当你要播放视频时,你会在[全新安装的 Ubuntu][1],或其他许多发行版中,会注意到一个消息: ![][2] -默认媒体播放器没有适合的编解码器 -这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。了解一下 [SMPlayer][4]。 +*默认媒体播放器没有适合的编解码器* + +这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。让我们了解一下 [SMPlayer][4]。 ### 认识 SMPlayer:适用于 Linux 的更好的媒体播放器 -SMPlayer 是一款免费的开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。 +SMPlayer 是一款自由开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。 ![SMPlayer default interface][7] -SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。 +SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动系统,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。 你也可以在 SMPlayer 上播放 YouTube。我知道每次复制粘贴视频 URL 并在外部播放器上播放是不切实际的。但是当你观看相对较长的视频时,SMPlayer 特别有用。SMPlayer 以相当好的质量播放 YouTube 视频,我觉得比在浏览器中播放得更好。通过在 SMPlayer 上播放较长的视频,你可以远离视频中间弹出的插播广告。 @@ -51,7 +52,7 @@ SMPlayer 应该可在所有主要 Linux 发行版的软件中心获取。你可 sudo apt install smplayer ``` -或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包 +或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包。 ### 总结 @@ -66,7 +67,7 @@ via: https://itsfoss.com/smplayer/ 作者:[Aquil Roshan;Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -83,4 +84,4 @@ via: https://itsfoss.com/smplayer/ [9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-icon-packs.jpg?fit=800%2C450&ssl=1 [10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-theme.jpg?fit=800%2C450&ssl=1 [11]: https://software.opensuse.org/download.html?project=home%3Asmplayerdev&package=smplayer -[12]: https://itsfoss.com/essential-linux-applications/ \ No newline at end of file +[12]: https://itsfoss.com/essential-linux-applications/ From 228a0a7fbc5fe30c4c28571541ca6d741875b5f5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 19 Dec 2018 17:53:02 +0800 Subject: [PATCH 07/69] PUB:20181130 SMPlayer in Linux- Features, Download and Installation.md @geekpi https://linux.cn/article-10365-1.html --- ... SMPlayer in Linux- Features, Download and Installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181130 SMPlayer in Linux- Features, Download and Installation.md (98%) diff --git a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/published/20181130 SMPlayer in Linux- Features, Download and Installation.md similarity index 98% rename from translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md rename to published/20181130 SMPlayer in Linux- Features, Download and Installation.md index 1e0147ac10..5165fed0f7 100644 --- a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md +++ b/published/20181130 SMPlayer in Linux- Features, Download and Installation.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (SMPlayer in Linux: Features, Download and Installation) [#]: via: (https://itsfoss.com/smplayer/) [#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10365-1.html) SMPlayer:增强版的媒体播放器 ====== From 45de03a32dcf7afd5789fe4142114aac0757cf93 Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 19 Dec 2018 18:13:24 +0800 Subject: [PATCH 08/69] Delete 20171223 Celebrate Christmas In Linux Way With These Wallpapers.md --- ...tmas In Linux Way With These Wallpapers.md | 201 ------------------ 1 file changed, 201 deletions(-) delete mode 100644 sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md diff --git a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md deleted file mode 100644 index 94c08d72ae..0000000000 --- a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (jlztan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers) -[#]: via: (https://itsfoss.com/christmas-linux-wallpaper/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: url: ( ) - -Celebrate Christmas In Linux Way With These Wallpapers -====== - -It’s the holiday season and many of you might be celebrating Christmas already. From the team of It’s FOSS, I would like to wish you a Merry Christmas and a happy new year. - -To continue the festive mood, I’ll show you some really awesome [Linux wallpapers][1] on Christmas theme. But before we see that, how about a Christmas Tree in Linux terminal. - -### Display Christmas Tree in Linux Terminal - - - -If you want to display an animated Christmas tree in the terminal, you can use the command below: - -``` -curl https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh | bash -``` - -If you don’t want to get it from the internet all the time, you can get the shell script from its GitHub repository, change the permission and run it like a normal shell script. - -[ChristBASHTree][2] - -### Display Christmas Tree in Linux terminal using Perl - -[![Christmas Tree in Linux terminal by NixCraft][3]][4] - -This trick was originally shared by [NixCraft][5]. You’ll need to install a Perl module for this. - -To be honest, I don’t like using Perl modules because uninstalling them is a real pain. So **use this Perl module knowing that you’ll have to manually remove it**. - -``` -perl -MCPAN -e 'install Acme::POE::Tree' -``` - -You can read the original article [here][5] to know more about it. - -## Download Linux Christmas Wallpapers - -All these Linux Christmas wallpapers are created by Mark Riedesel and you can find plenty of other artwork on [his website][6]. - -He has been making such wallpapers almost every year since 2002. Quite understandably some of the earliest wallpapers don’t have modern aspect ratio. I have put them up in reverse chronological order. - -One tiny note. The images displayed here are highly compressed so download the wallpapers from the provided link only. - -![Christmas Linux Wallpaper][7] - -[Download This Wallpaper][8] - -[![Christmas Linux Wallpapers][9]][10] - -[Download This Wallpaper][11] - -[![Christmas Linux Wallpapers][12]][13] - -[Download This Wallpaper][14] - -[![Christmas Linux Wallpapers][15]][16] - -[Download This Wallpaper][17] - -[![Christmas Linux Wallpapers][18]][19] - -[Download This Wallpaper][20] - -[![Christmas Linux Wallpapers][21]][22] - -[Download This Wallpaper][23] - -[![Christmas Linux Wallpapers][24]][25] - -[Download This Wallpaper][26] - -[![Christmas Linux Wallpapers][27]][28] - -[Download This Wallpaper][29] - -[![Christmas Linux Wallpapers][30]][31] - -[Download This Wallpaper][32] - -[![Christmas Linux Wallpapers][33]][34] - -[Download This Wallpaper][35] - -[![Christmas Linux Wallpapers][36]][37] - -[Download This Wallpaper][38] - -[![Christmas Linux Wallpapers][39]][40] - -[Download This Wallpaper][41] - -[![Christmas Linux Wallpapers][42]][43] - -[Download This Wallpaper][44] - -[![Christmas Linux Wallpapers][45]][46] - -[Download This Wallpaper][47] - -[![Christmas Linux Wallpapers][48]][49] - -[Download This Wallpaper][50] - -### Bonus: Linux Christmas carols - -Here is a bonus for you. Christmas carols Linuxified for Linux lovers like us. - -In [an article on Computer World][51], [Sandra Henry-Stocker][52] shared such Christmas carols. An excerpt: - -To the tune of: [Chestnuts Roasting on an Open Fire][53] - -> Running merrily on open source -> With users happy as can be -> We’re using Linux and getting lots done -> And happy everything is free - -To the tune of: [The Twelve Days of Christmas][54] - -> On my first day with Linux, my admin gave to me a password and a login ID -> On my second day with Linux my admin gave to me two new commands and a password and a login ID - -You can read full carols [here][51]. - -Merry Linux to you!! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/christmas-linux-wallpaper/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/beautiful-linux-wallpapers/ -[2]: https://github.com/sergiolepore/ChristBASHTree -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/perl-tree.gif?resize=600%2C622&ssl=1 -[4]: https://itsfoss.com/christmas-linux-wallpaper/perl-tree/ -[5]: https://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/ -[6]: http://www.klowner.com/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmas-linux-wallpaper-featured.jpeg?resize=800%2C450&ssl=1 -[8]: http://klowner.com/wallery/christmas_tux_2017/download/ChristmasTux2017_3840x2160.png -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2016_3840x2160_result.jpg?resize=800%2C450&ssl=1 -[10]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2016_3840x2160_result/ -[11]: http://www.klowner.com/wallpaper/christmas_tux_2016/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2015_2560x1920_result.jpg?resize=800%2C600&ssl=1 -[13]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2015_2560x1920_result/ -[14]: http://www.klowner.com/wallpaper/christmas_tux_2015/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2014_2560x1440_result.jpg?resize=800%2C450&ssl=1 -[16]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2014_2560x1440_result/ -[17]: http://www.klowner.com/wallpaper/christmas_tux_2014/ -[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2013_result.jpg?resize=800%2C450&ssl=1 -[19]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2013_result/ -[20]: http://www.klowner.com/wallpaper/christmas_tux_2013/ -[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2012_2560x1440_result.jpg?resize=800%2C450&ssl=1 -[22]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2012_2560x1440_result/ -[23]: http://www.klowner.com/wallpaper/christmas_tux_2012/ -[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2011_2560x1440_result.jpg?resize=800%2C450&ssl=1 -[25]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2011_2560x1440_result/ -[26]: http://www.klowner.com/wallpaper/christmas_tux_2011/ -[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2010_5120x2880_result.jpg?resize=800%2C450&ssl=1 -[28]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2010_5120x2880_result/ -[29]: http://www.klowner.com/wallpaper/christmas_tux_2010/ -[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2009_1600x1200_result.jpg?resize=800%2C600&ssl=1 -[31]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2009_1600x1200_result/ -[32]: http://www.klowner.com/wallpaper/christmas_tux_2009/ -[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2008_2560x1600_result.jpg?resize=800%2C500&ssl=1 -[34]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2008_2560x1600_result/ -[35]: http://www.klowner.com/wallpaper/christmas_tux_2008/ -[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2007_2560x1600_result.jpg?resize=800%2C500&ssl=1 -[37]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2007_2560x1600_result/ -[38]: http://www.klowner.com/wallpaper/christmas_tux_2007/ -[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2006_1024x768_result.jpg?resize=800%2C600&ssl=1 -[40]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2006_1024x768_result/ -[41]: http://www.klowner.com/wallpaper/christmas_tux_2006/ -[42]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2005_1600x1200_result.jpg?resize=800%2C600&ssl=1 -[43]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2005_1600x1200_result/ -[44]: http://www.klowner.com/wallpaper/christmas_tux_2005/ -[45]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2004_1600x1200_result.jpg?resize=800%2C600&ssl=1 -[46]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2004_1600x1200_result/ -[47]: http://www.klowner.com/wallpaper/christmas_tux_2004/ -[48]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2002_1600x1200_result.jpg?resize=800%2C600&ssl=1 -[49]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2002_1600x1200_result/ -[50]: http://www.klowner.com/wallpaper/christmas_tux_2002/ -[51]: http://www.computerworld.com/article/3151076/linux/merry-linux-to-you.html -[52]: https://twitter.com/bugfarm -[53]: https://www.youtube.com/watch?v=dhzxQCTCI3E -[54]: https://www.youtube.com/watch?v=oyEyMjdD2uk From c1e7fb3466c15af52f7f7f805fff1a91045a2239 Mon Sep 17 00:00:00 2001 From: jlztan Date: Wed, 19 Dec 2018 18:16:59 +0800 Subject: [PATCH 09/69] Create 20171223 Celebrate Christmas In Linux Way With These Wallpapers.md --- ...tmas In Linux Way With These Wallpapers.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md diff --git a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md new file mode 100644 index 0000000000..1132a52058 --- /dev/null +++ b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -0,0 +1,190 @@ +使用这些壁纸以 Linux 的方式庆祝圣诞节 +====== + +当前正是假日季节,很多人可能已经在庆祝圣诞节了。我代表 It's FOSS 团队祝你圣诞快乐,新年快乐。 + +为了延续节日氛围,我将向你展示一些非常棒的圣诞主题 [Linux壁纸][1]。在呈现这些壁纸之前,先来看一棵 Linux 终端下的圣诞树。 + +### 在 Linux 终端下显示圣诞树 + +圣诞树的效果如 [这个页面](https://giphy.com/embed/xUNda6KphvbpYxL3tm) 所示。 + +使用以下命令在终端中显示一棵动画圣诞树: + +``` +curl https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh | bash +``` + +要是不想一直从互联网上获取这棵圣诞树,也可以从它的 [GitHub 仓库][2] 中获取对应的 shell 脚本,更改权限之后按照运行普通 shell 脚本的方式运行它。 + +### 使用 Perl 在 Linux 终端下显示圣诞树 + +[![Christmas Tree in Linux terminal by NixCraft][3]][4] + +这个技巧最初由 [NixCraft][5] 分享,你需要为此安装 Perl 模块。 + +说实话,我不喜欢使用 Perl 模块,因为卸载它们真的很痛苦。所以使用这个 Perl 模块时需谨记,你必须手动移除它。 + +``` +perl -MCPAN -e 'install Acme::POE::Tree' +``` + +你可以阅读 [原文][5] 来了解更多信息。 + +## 下载 Linux 圣诞主题壁纸 + +所有这些 Linux 圣诞主题壁纸都是由 Mark Riedesel 制作的,你可以在 [他的网站][6] 上找到很多其他艺术品。 + +自 2002 年以来,他几乎每年都在制作这样的壁纸。可以理解的是,最早的一些壁纸不具有现代的宽高比。我把它们按时间倒序排列。 + +注意一个小地方,这里显示的图片都是高度压缩的,因此你要通过图片下方提供的链接进行下载。 + +![Christmas Linux Wallpaper][7] + +[下载此壁纸][8] + +[![Christmas Linux Wallpapers][9]][10] + +[下载此壁纸][11] + +[![Christmas Linux Wallpapers][12]][13] + +[下载此壁纸][14] + +[![Christmas Linux Wallpapers][15]][16] + +[下载此壁纸][17] + +[![Christmas Linux Wallpapers][18]][19] + +[下载此壁纸][20] + +[![Christmas Linux Wallpapers][21]][22] + +[下载此壁纸][23] + +[![Christmas Linux Wallpapers][24]][25] + +[下载此壁纸][26] + +[![Christmas Linux Wallpapers][27]][28] + +[下载此壁纸][29] + +[![Christmas Linux Wallpapers][30]][31] + +[下载此壁纸][32] + +[![Christmas Linux Wallpapers][33]][34] + +[下载此壁纸][35] + +[![Christmas Linux Wallpapers][36]][37] + +[下载此壁纸][38] + +[![Christmas Linux Wallpapers][39]][40] + +[下载此壁纸][41] + +[![Christmas Linux Wallpapers][42]][43] + +[下载此壁纸][44] + +[![Christmas Linux Wallpapers][45]][46] + +[下载此壁纸][47] + +[![Christmas Linux Wallpapers][48]][49] + +[下载此壁纸][50] + +### 福利:Linux 圣诞颂歌 + +这是给你的一份福利,给像我们一样的 Linux 爱好者的关于 Linux 的圣诞颂歌。 + +在 [计算机世界的一篇文章][51] 中,[Sandra Henry-Stocker][52] 分享了这些圣诞颂歌。摘录片段如下: + +这一段用的 [Chestnuts Roasting on an Open Fire][53] 的曲调: + +> Running merrily on open source +> With users happy as can be +> We’re using Linux and getting lots done +> And happy everything is free + +这一段用的 [The Twelve Days of Christmas][54] 的曲调: + +> On my first day with Linux, my admin gave to me a password and a login ID +> On my second day with Linux my admin gave to me two new commands and a password and a login ID + +在 [这里][51] 阅读完整的颂歌。 + +祝你享受 Linux! + +------ + +via: https://itsfoss.com/christmas-linux-wallpaper/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[jlztan](https://github.com/jlztan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/beautiful-linux-wallpapers/ +[2]: https://github.com/sergiolepore/ChristBASHTree +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/perl-tree.gif?resize=600%2C622&ssl=1 +[4]: https://itsfoss.com/christmas-linux-wallpaper/perl-tree/ +[5]: https://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/ +[6]: http://www.klowner.com/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmas-linux-wallpaper-featured.jpeg?resize=800%2C450&ssl=1 +[8]: http://klowner.com/wallery/christmas_tux_2017/download/ChristmasTux2017_3840x2160.png +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2016_3840x2160_result.jpg?resize=800%2C450&ssl=1 +[10]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2016_3840x2160_result/ +[11]: http://www.klowner.com/wallpaper/christmas_tux_2016/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2015_2560x1920_result.jpg?resize=800%2C600&ssl=1 +[13]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2015_2560x1920_result/ +[14]: http://www.klowner.com/wallpaper/christmas_tux_2015/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2014_2560x1440_result.jpg?resize=800%2C450&ssl=1 +[16]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2014_2560x1440_result/ +[17]: http://www.klowner.com/wallpaper/christmas_tux_2014/ +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2013_result.jpg?resize=800%2C450&ssl=1 +[19]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2013_result/ +[20]: http://www.klowner.com/wallpaper/christmas_tux_2013/ +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2012_2560x1440_result.jpg?resize=800%2C450&ssl=1 +[22]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2012_2560x1440_result/ +[23]: http://www.klowner.com/wallpaper/christmas_tux_2012/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2011_2560x1440_result.jpg?resize=800%2C450&ssl=1 +[25]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2011_2560x1440_result/ +[26]: http://www.klowner.com/wallpaper/christmas_tux_2011/ +[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2010_5120x2880_result.jpg?resize=800%2C450&ssl=1 +[28]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2010_5120x2880_result/ +[29]: http://www.klowner.com/wallpaper/christmas_tux_2010/ +[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2009_1600x1200_result.jpg?resize=800%2C600&ssl=1 +[31]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2009_1600x1200_result/ +[32]: http://www.klowner.com/wallpaper/christmas_tux_2009/ +[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2008_2560x1600_result.jpg?resize=800%2C500&ssl=1 +[34]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2008_2560x1600_result/ +[35]: http://www.klowner.com/wallpaper/christmas_tux_2008/ +[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2007_2560x1600_result.jpg?resize=800%2C500&ssl=1 +[37]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2007_2560x1600_result/ +[38]: http://www.klowner.com/wallpaper/christmas_tux_2007/ +[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2006_1024x768_result.jpg?resize=800%2C600&ssl=1 +[40]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2006_1024x768_result/ +[41]: http://www.klowner.com/wallpaper/christmas_tux_2006/ +[42]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2005_1600x1200_result.jpg?resize=800%2C600&ssl=1 +[43]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2005_1600x1200_result/ +[44]: http://www.klowner.com/wallpaper/christmas_tux_2005/ +[45]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2004_1600x1200_result.jpg?resize=800%2C600&ssl=1 +[46]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2004_1600x1200_result/ +[47]: http://www.klowner.com/wallpaper/christmas_tux_2004/ +[48]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2002_1600x1200_result.jpg?resize=800%2C600&ssl=1 +[49]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2002_1600x1200_result/ +[50]: http://www.klowner.com/wallpaper/christmas_tux_2002/ +[51]: http://www.computerworld.com/article/3151076/linux/merry-linux-to-you.html +[52]: https://twitter.com/bugfarm +[53]: https://www.youtube.com/watch?v=dhzxQCTCI3E +[54]: https://www.youtube.com/watch?v=oyEyMjdD2uk From 1cafa689f8fb0e38699d9171075c2abf378b7fe3 Mon Sep 17 00:00:00 2001 From: wwhio Date: Thu, 20 Dec 2018 00:56:59 +0800 Subject: [PATCH 10/69] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=AF=95?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E6=B1=82=E6=A0=A1=E5=AF=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20180623 The IBM 029 Card Punch.md | 72 ------------------- .../talk/20180623 The IBM 029 Card Punch.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 72 deletions(-) delete mode 100644 sources/talk/20180623 The IBM 029 Card Punch.md create mode 100644 translated/talk/20180623 The IBM 029 Card Punch.md diff --git a/sources/talk/20180623 The IBM 029 Card Punch.md b/sources/talk/20180623 The IBM 029 Card Punch.md deleted file mode 100644 index 6b36845c2d..0000000000 --- a/sources/talk/20180623 The IBM 029 Card Punch.md +++ /dev/null @@ -1,72 +0,0 @@ -Translating by wwhio - - -The IBM 029 Card Punch -====== -Lines of code longer than 80 characters drive me crazy. I appreciate that this is pedantic. I’ve seen people on the internet make good arguments for why the 80-character limit ought to be respected even on our modern Retina-display screens, but those arguments hardly justify the visceral hatred I feel for even that one protruding 81st character. - -There was once a golden era in which it was basically impossible to go over the 80-character limit. The 80-character limit was a physical reality, because there was no 81st column for an 81st character to fit in. Any programmers attempting to name a function something horrendously long and awful would discover, in a moment of delicious, slow-dawning horror, that there literally isn’t room for their whole declaration. - -This golden era was the era of punch card programming. By the 1960s, IBM’s punch cards had set the standard and the standard was that punch cards had 80 columns. The 80-column standard survived into the teletype and dumb terminal era and from there embedded itself into the nooks and crannies of our operating systems. Today, when you launch your terminal emulator and open a new window, odds are it will be 80 characters wide, even though we now have plenty of screen real estate and tend to favor longer identifiers over inscrutable nonsense like `iswcntrl()`. - -If questions on Quora are any indication, many people have trouble imagining what it must have been like to program computers using punch cards. I will admit that for a long time I also didn’t understand how punch card programming could have worked, because it struck me as awfully labor-intensive to punch all those holes. This was a misunderstanding; programmers never punched holes in cards the same way a train conductor does. They had card punch machines (also known as key punches), which allowed them to punch holes in cards using a typewriter-style keyboard. And card punches were hardly new technology—they were around as early as the 1890s. - -One of the most widely used card punch machines was the IBM 029. It is perhaps the best remembered card punch today. - -![][1] - -The IBM 029 was released in 1964 as part of IBM’s System/360 rollout. System/360 was a family of computing systems and peripherals that would go on to dominate the mainframe computing market in the late 1960s. Like many of the other System/360 machines, the 029 was big. This was an era when the distinction between computing machinery and furniture was blurry—the 029 was not something you put on a table but an entire table in itself. The 029 improved upon its predecessor, the 026, by supporting new characters like parentheses and by generally being quieter. It had cool electric blue highlights and was flat and angular whereas the 026 had a 1940s rounded, industrial look. Another of its big selling points was that it could automatically left-pad numeric fields with zeros, demonstrating that JavaScript programmers were not the first programmers too lazy to do their own left-padding. - -But wait, you might say—IBM released a brand-new card punch in 1964? What about that photograph of the Unix gods at Bell Labs using teletype machines in, like, 1970? Weren’t card punching machines passé by the mid- to late-1960s? Well, it might surprise you to know that the 029 was available in IBM’s catalog until as late as 1984. In fact, most programmers programmed using punch cards until well into the 1970s. This doesn’t make much sense given that there were people using teletype machines during World War II. Indeed, the teletype is almost of the same vintage as the card punch. The limiting factor, it turns out, was not the availability of teletypes but the availability of computing time. What kept people from using teletypes was that teletypes assumed an interactive, “online” model of communication with the computer. Before Unix and the invention of timesharing operating systems, your interactive session with a computer would have stopped everyone else from using it, a delay potentially costing thousands of dollars. So programmers instead wrote their programs offline using card punch machines and then fed them into mainframe computers later as batch jobs. Punch cards had the added benefit of being a cheap data store in an era where cheap, reliable data storage was hard to come by. Your programs lived in stacks of cards on your shelves rather than in files on your hard drive. - -So what was it actually like using an IBM 029 card punch? That’s hard to explain without first taking a look at the cards themselves. A typical punch card had 12 rows and 80 columns. The bottom nine rows were the digit rows, numbered one through nine. These rows had the appropriate digit printed in each column. The top three rows, called the “zone” rows, consisted of two blank rows and usually a zero row. Row 12 was at the very top of the card, followed by row 11, then rows zero through nine. This somewhat confusing ordering meant that the top edge of the card was called the 12 edge while the bottom was called the nine edge. A corner of each card was usually clipped to make it easier to keep a stack of cards all turned around the right way. - -![][2] - -When they were first invented, punch cards were meant to be punched with circular holes, but IBM eventually realized that they could fit more columns on a card if the holes were narrow rectangles. Different combinations of holes in a column represented different characters. For human convenience, card punches like the 029 would print each column’s character at the top of the card at the same time as punching the necessary holes. Digits were represented by one punched hole in the appropriate digit row. Alphabetical and symbolic characters were represented by a hole in a zone row and then a combination of one or two holes in the digit rows. The letter A, for example, was represented by a hole in the 12 zone row and another hole in the one row. This was an encoding of sorts, sometimes called the Hollerith code, after the original inventor of the punch card machine. The encoding allowed for only a relatively small character set; lowercase letters, for example, were not represented. Some clever engineer today might wonder why punch cards didn’t just use a binary encoding—after all, with 12 rows, you could encode over 4000 characters. The Hollerith code was used instead because it ensured that no more than three holes ever appeared in a single column. This preserved the structural integrity of the card. A binary encoding would have entailed so many holes that the card would have fallen apart. - -Cards came in different flavors. By the 1960s, 80 columns was the standard, but those 80 columns could be used to represent different things. The basic punch card was unlabeled, but cards meant for COBOL programming, for example, divided the 80 columns into fields. On a COBOL card, the last eight columns were reserved for an identification number, which could be used to automatically sort a stack of cards if it were dropped (apparently a perennial hazard). Another column, column seven, could be used to indicate that the statement on this card was a continuation of a statement on a previous card. This meant that if you were truly desperate you could circumvent the 80-character limit, though whether a two-card statement counts as one long line or just two is unclear. FORTRAN cards were similar but had different fields. Universities often watermarked the punch cards handed out by their computing centers, while other kinds of designs were introduced for special occasions like the [1976 bicentennial][3]. - -Ultimately the cards had to be read and understood by a computer. IBM sold a System/360 peripheral called the IBM 2540 which could read up to 1000 cards per minute. The IBM 2540 ran electrical brushes across the surface of each card which made contact with a plate behind the cards wherever there was a hole. Once read, the System/360 family of computers represented the characters on each punch card using an 8-bit encoding called EBCDIC, which stood for Extended Binary Coded Decimal Interchange Code. EBCDIC was a proper binary encoding, but it still traced its roots back to the punch card via an earlier encoding called BCDIC, a 6-bit encoding which used the low four bits to represent a punch card’s digit rows and the high two bits to represent the zone rows. Punch card programmers would typically hand their cards to the actual computer operators, who would feed the cards into the IBM 2540 and then hand the printed results back to the programmer. The programmer usually didn’t see the computer at all. - -What the programmer did see a lot of was the card punch. The 029 was not a computer, but that doesn’t mean that it wasn’t a complicated machine. The best way to understand what it was like using the 029 is to watch [this instructional video][4] made by the computing center at the University of Michigan in 1967. I’m going to do my best to summarize it here, but if you don’t watch the video you will miss out on all the wonderful clacking and whooshing. - -The 029 was built around a U-shaped track that the punch cards traveled along. On the right-hand side, at the top of the U, was the card hopper, which you would typically load with a fresh stack of cards before using the machine. The IBM 029 worked primarily with 80-column cards, but the card hopper could accommodate smaller cards if needed. Your punch cards would start in the card hopper, travel along the line of the U, and then end up in the stacker, at the top of the U on the left-hand side. The cards would accumulate there in the order that you punched them. - -To turn the machine on, you flipped a switch under the desk at about the height of your knees. You then pressed the “FEED” key twice to get cards loaded into the machine. The business part of the card track, the bottom of the U, was made up of three separate stations: On the right was a kind of waiting area, in the middle was the punching station, and on the left was the reading station. Pressing the “FEED” key twice loaded one card into the punching station and one card into the waiting area behind it. A column number indicator right above the punching station told you which column you were currently punching. With every keystroke, the machine would punch the requisite holes, print the appropriate character at the top of the card, and then advance the card through the punching station by one column. If you punched all 80 columns, the card would automatically be released to the reading station and a new card would be loaded into the punching station. If you wanted this to happen before you reached the 80th column, you could press the “REL” key (for “release”). - -The printed characters made it easy to spot a mistake. But fixing a mistake, as the University of Michigan video warns, is not as easy as whiting out the printed character at the top of the card and writing in a new one. The holes are all that the computer will read. Nor is it as easy as backspacing one space and typing in a new character. The holes have already been punched in the column, after all, and cannot be unpunched. Punching more holes will only produce an invalid combination not associated with any character. The IBM 029 did have a backspace button that moved the punched card backward one column, but the button was placed on the face of the machine instead of on the keyboard. This was probably done to discourage its use, since backspacing was so seldom what the user actually wanted to do. - -Instead, the only way to correct a mistake was scrap the incorrect card and punch a new one. This is where the reading station came in handy. Say you made a mistake in the 68th column of a card. To fix your mistake, you could carefully repunch the first 67 columns of a new card and then punch the correct character in the 68th column. Alternatively, you could release the incorrect card to the reading station, load a new card into the punching station, and hold down the “DUP” key (for duplicate) until the column number indicator reads 68. You could then correct your mistake by punching the correct character. The reading station and the “DUP” key together allowed IBM 029 operators to easily copy the contents of one card to the next. There were all sorts of reasons to do this, but correcting mistakes was the most common. - -The “DUP” key allowed the 029’s operator to invoke the duplicate functionality manually. But the 029 could also duplicate automatically where necessary. This was particularly useful when punched cards were used to record data rather than programs. For example, you might be using each card to record information about a single undergraduate university student. On each card, you might have a field that contains the name of that student’s residence hall. Perhaps you find yourself entering data for all the students in one residence hall at one time. In that case, you’d want the 029 to automatically copy over the previous card’s residence hall field every time you reached the first column of the field. - -Automated behavior like this could be programmed into the 029 by using the program drum. The drum sat upright in the middle of the U above the punching station. You programmed the 029 by punching holes in a card and wrapping that card around the program drum. The punched card allowed you to specify the automatic behavior you expected from the machine at each column of the card currently in the punching station. You could specify that a column should automatically be copied from the previous card, which is how an 029 operator might more quickly enter student records. You could also specify, say, that a particular field should contain numeric or alphabetic characters, or that a given field should be left blank and skipped altogether. The program drum made it much easier to punch schematized cards where certain column ranges had special meanings. There is another [“advanced” instructional video][5] produced by the University of Michigan that covers the program drum that is worth watching, provided, of course, that you have already mastered the basics. - -Watching either of the University of Michigan videos today, what’s surprising is how easy the card punch is to operate. Correcting mistakes is tedious, but otherwise the machine seems to be less of an obstacle than I would have expected. Moving from one card to the next is so seamless that I can imagine COBOL or FORTRAN programmers forgetting that they are creating separate cards rather than one long continuous text file. On the other hand, it’s interesting to consider how card punches, even though they were only an input tool, probably limited how early programming languages evolved. Structured programming would eventually come along and encourage people to think of entire blocks of code as one unit, but I can see how punch card programming’s emphasis on each line made structured programming hard to conceive of. It’s no wonder that punch card programmers were not the ones that decided to enclose blocks with single curly braces entirely on their own lines. How wasteful that would have seemed! - -So even though nobody programs using punch cards anymore, every programmer ought to [try it][6] at least once—if only to understand why COBOL and FORTRAN look the way they do, or how 80 characters somehow became everybody’s favorite character limit. - -If you enjoyed this post, more like it come out every two weeks! Follow [@TwoBitHistory][7] on Twitter or subscribe to the [RSS feed][8] to make sure you know when a new post is out. - --------------------------------------------------------------------------------- - -via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html - -作者:[Two-Bit History][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://twobithistory.org -[b]: https://github.com/lujun9972 -[1]: https://twobithistory.org/images/ibm029_front.jpg -[2]: https://twobithistory.org/images/card.png -[3]: http://www.jkmscott.net/data/Punched%20card%20013.jpg -[4]: https://www.youtube.com/watch?v=kaQmAybWn-w -[5]: https://www.youtube.com/watch?v=SWD1PwNxpoU -[6]: http://www.masswerk.at/keypunch/ -[7]: https://twitter.com/TwoBitHistory -[8]: https://twobithistory.org/feed.xml diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md new file mode 100644 index 0000000000..a1283e70b2 --- /dev/null +++ b/translated/talk/20180623 The IBM 029 Card Punch.md @@ -0,0 +1,71 @@ +IBM 029 型打孔机 +====== +我知道这很学院派,可一行超过 80 个字符的代码还是让我抓狂。我也在网上见过不少人认为即在现代视网膜屏幕下也应当采用行长度为 80 个字符的标准,可他们都不理解我对破坏这一标准的怒火,就算 1 个字符也不行。 + +在这一标准的黄金时期,一行代码的长度几乎不会超过 80 个字符的限制。在那时,这一限制是物理的,没有第 81 列用于存放第 81 个字符。每一个试图把函数名起的又长又臭的程序员都会在短暂的愉悦后迎来更多的麻烦,而这仅仅时因为没有足够的空间放下整个函数的声明。 + +这一黄金时期也是打孔卡编程时期。在 20 世纪 60 年代, IBM 打孔卡的特性,也就是打孔卡的长度为 80 个字符成为了打孔卡的标准。这一标准在后来的电传打字机和哑终端时期得以延续,并逐渐成为操作系统中隐藏的细节。时至今日,即使我们用上了更大、更好的屏幕,偏向于使用更长的标识符而不是类似 `iswcntrl()` 这样令人难以猜测的函数名,可当你打开新的终端模拟器窗口时,默认的宽度依然是 80 个字符。 + +从 Quora 上的很多问题中可以发现,很多人并不能想象如何使用打孔卡给计算机编程。我承认,在很长的一段时间里我也不能理解卡编程成是如何工作的,因为这让我想到有很多劳工不停的给这些打孔卡打孔。当然,这是一个误解,程序员不需要亲自给打孔卡打孔,就像是火车调度员不用亲自扳道岔。程序员们有打孔机(也被称为键控打孔机key punches),这让他们可以使用打字机式的键盘给打孔卡打孔。这样的设备在 19 世纪 90 年代时就已经不是什么新技术了。 + +那时,最为广泛使用的打孔机之一便是 IBM 029 型打孔机。就算在今天,它也许是最棒的打孔机。 + +![][1] + +IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。 System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样, 029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比, 029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在数字区numeric fields左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做左填充left-padding的程序员。 +(译者注:这项功能需要额外的 4 张 [标准模块系统卡SMS card](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如数字区长度为 6 时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch)) + +等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年, IBM 的产品目录中才出现 029 型打孔机的身影。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了他的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用“在线”的传输方式"online" mode of communication。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为批任务batch job执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让他成为那时最流行的数据存储方式了。那时的程序是书架上一落的打孔卡而不是硬盘里的一堆文件。 + +那么实际使用 IBM 029 型打孔机是个什么样子呢?这很难向没有实际看过打孔卡的人解释。一张打孔卡通常有12行80列。打孔卡下面是从 1 到 9 的数字行digit rows,打孔卡上的每一列都有这些行所对应的数字。最上面的三行是空间行"zone" rows,通常由两行空白行和一行 0 行组成。第 12 行是打孔卡最顶层的行,接下来是 11 行,随后是从数字 0 到 9 所在的行。这个有点让人感到困惑的顺序的原因是打孔卡的上边缘被称为12 边12 edge、下边缘被称为 9 边9 edge。那时,为了让打孔卡便于整理,常常会剪去打孔卡的一个角。 + +![][2] +(译者注:可参考[EBCDIC 编码](https://zh.wikipedia.org/wiki/EBCDIC)) + +在打孔卡发明之初,孔洞的形状是圆形的,但是 IBM 最终意识到如果使用窄长方形作为孔洞,一张卡就可以放下更多的列了。每一列中孔洞的不同组合就可以表达不同的字符。像 029 型这样的拥有人性化设计的打孔机除了完成本质的打孔任务外,还会在打孔卡最上方打印出每一列所对应的字符。输入是数字就在对应的数字行上打孔。输入的是字母或符号就用一个在空间列的孔和一或俩个在数字列的孔的组合表示,例如字母 A 就用一个在第 12 空间行的空和一个数字 1 所在行的孔表示。这是一种顺序编码,在第一台打孔机被发明后,也叫 Hollerith 编码。这种编码只能表示相对较小的一套字符集,小写字母就没有包含在这套字符集中,但它的优势在于保留了打孔卡的结构强度。如果直接使用二进制编码,打孔卡可能会因为孔洞过于密集而断裂。 + +打孔卡也有不同。在 20 世纪 60 年代,80 列虽然是标准,但表达的方式不一定相同。基础打孔卡是无标注的,但用于 COBOL 编程的打孔卡会把最后的 8 列保留,供标识数保存使用。这一标识数可以在打孔卡被打乱 (例如一叠打孔卡掉在地上了) 后用于自动排序。此外,第 7 列被用于表示本张打孔卡上的是否是上一张打孔卡一起构成一条语句。也就是说当你真的对 80 字符的限制感到绝望的时候,还可以用两张卡甚至更多的卡拼接成一条长语句。用于 FORTRAN 编程的打孔卡和 COBOL 打孔卡类似,但是定义的列不同。大学里使用的打孔卡通常会由其计算机中心加上水印,其他的设计则会在如 [1976 年美国独立 200 周年][3] 的特殊场合才会加入。 + +最终,这些打孔卡都要被计算机读取和计算。 IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕, System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是扩展的二进制十数交换码Extended Binary Coded Decimal Interchange Code,简写为 EBCDIC 编码。它的源自于早期打孔卡所使用的 BCDIDC 编码,这一 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写玩程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。 + +程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学University of Michigan在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。 + +029 型打孔机的结构围绕着一个打孔卡穿过机器的 U 形轨道开始。使用打孔机时,右手边也就是 U 形轨道的右侧顶部是进卡卡槽hopper,使用前通常在里面放入一叠未使用的打孔卡。虽然 029 型打孔机主要使用 80 列打孔卡,但在需要的情况下也可以使用更小号的打孔卡。在打孔机的使用过程中,打孔卡离开轨道右上端的进卡卡槽,顺着 U 形轨道移动并最终进入左上端的出卡卡槽stacker。这一流程可以保证出卡卡槽中的打孔卡按打孔时的先后顺序排列。 + +029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入FEED” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放REL (for release)” 键完成上面的操作。 + +在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原unpunched,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。 + +实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “重复DUP (for duplicate)” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。 + +“重复”按键允许 029 型打孔机的操作员手动调用重复的函数。但是 029 型打孔机还可以设置为自动重复。当用于记录数据而不是编程时,这项功能十分有效。举个例子,当用打孔卡来记录大学生的信息时,每张卡片上都需要输入学生的宿舍楼的名字,如果发现所输入信息的学生都在同一栋楼,就可以使用 029 型打孔机的自动重复功能来完成宿舍楼名称的填写。 + +像这样的自动化操作可以通过打孔卡给 029 型打孔机编程控制。安装打孔卡的圆柱形装置drum就在 U 形轨道中间部分的右上角。通过使用 029 型在打孔卡上写下程序,然后把打孔卡的装入圆柱形装置,再将其安装到打孔机内后,就完成了一次给 029 型打孔机的编程任务。用户可以通过这种方式对打孔卡的每一列都按需要定义不同的自动化操作。029 型打孔机允许指定某些列重复上一张打孔卡相同位置的字符,这就是它能更快的输入学生信息的理由。它还允许指定某些列只能输入数字或者字母,指定特定的列为空或者到某一列时就直接跳过一整张打孔卡。这样的可编程特性使它在输入拥有固定格式的数据时效率很高。密歇根大学制作的[进阶教学视频][5]包括了给 029 型打孔机编程的过程,如果你已经掌握了它的基础操作,就快去看看吧。 + +这会儿,无论你是否看了密歇根大学制作的视频,都会感叹打孔机的操作之简便。虽然修正错误的过程很乏味,但除此之外,操作一台打孔机并不像想象的那样复杂。我甚至可以想象打孔卡之间的无缝切换让 COBOL 和 FORTRAN 程序员忘记了他们的程序是打在不同的打孔卡上而不是写在一个连续的文本文件内。另一方面,思考一下打孔机是如何影响编程语言的发展也是很有趣的,虽然它仅仅是一台输入设备。结构化编程最终会出现并鼓励程序员把整个代码块视为一个整体,但可以想象打孔卡程序员们强调每一行的作用且难以认同结构化编程的场景。同时你能够理解他们为什么不把代码块闭合所使用的括号放在单独的一行,只是因为这样会浪费打孔卡。 + +现在,虽然没有人再使用打孔卡编程了,每个程序员都该试试[这个][6],哪怕一次也好。或许你因此能够更好的理解 COBOL 和 FORTRAN 的历史,或许你就能体会到为什么每个人把 80 个字符作为长度限制的标注。 + +喜欢吗?这里每两周都会发表一篇这样的文章。请在推特上关注我们 [@TwoBitHistory][7] 或者订阅我们的 [RSS][8],这样你就能在第一时间收到新文章的通知。 + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[wwhio](https://github.com/wwhio) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://twobithistory.org/images/ibm029_front.jpg +[2]: https://twobithistory.org/images/card.png +[3]: http://www.jkmscott.net/data/Punched%20card%20013.jpg +[4]: https://www.youtube.com/watch?v=kaQmAybWn-w +[5]: https://www.youtube.com/watch?v=SWD1PwNxpoU +[6]: http://www.masswerk.at/keypunch/ +[7]: https://twitter.com/TwoBitHistory +[8]: https://twobithistory.org/feed.xml From 6abe0371b0c84efcec18609eb2656a360cf58121 Mon Sep 17 00:00:00 2001 From: wwhio Date: Thu, 20 Dec 2018 00:58:33 +0800 Subject: [PATCH 11/69] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E7=94=B3=E8=AF=B7=E6=A0=A1=E5=AF=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/talk/20180623 The IBM 029 Card Punch.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md index a1283e70b2..f905ee1481 100644 --- a/translated/talk/20180623 The IBM 029 Card Punch.md +++ b/translated/talk/20180623 The IBM 029 Card Punch.md @@ -28,13 +28,13 @@ IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件 最终,这些打孔卡都要被计算机读取和计算。 IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕, System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是扩展的二进制十数交换码Extended Binary Coded Decimal Interchange Code,简写为 EBCDIC 编码。它的源自于早期打孔卡所使用的 BCDIDC 编码,这一 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写玩程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。 -程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学University of Michigan在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。 +程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学University of Michigan在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。 029 型打孔机的结构围绕着一个打孔卡穿过机器的 U 形轨道开始。使用打孔机时,右手边也就是 U 形轨道的右侧顶部是进卡卡槽hopper,使用前通常在里面放入一叠未使用的打孔卡。虽然 029 型打孔机主要使用 80 列打孔卡,但在需要的情况下也可以使用更小号的打孔卡。在打孔机的使用过程中,打孔卡离开轨道右上端的进卡卡槽,顺着 U 形轨道移动并最终进入左上端的出卡卡槽stacker。这一流程可以保证出卡卡槽中的打孔卡按打孔时的先后顺序排列。 -029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入FEED” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放REL (for release)” 键完成上面的操作。 +029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入FEED” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放REL (for release)” 键完成上面的操作。 -在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原unpunched,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。 +在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原unpunched,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。 实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “重复DUP (for duplicate)” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。 From 9a7e0dce391e93e9566f04297cdaef29ceff1ff8 Mon Sep 17 00:00:00 2001 From: wwhio Date: Thu, 20 Dec 2018 00:59:32 +0800 Subject: [PATCH 12/69] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E7=94=B3=E8=AF=B7=E6=A0=A1=E5=AF=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/talk/20180623 The IBM 029 Card Punch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md index f905ee1481..e13a10593c 100644 --- a/translated/talk/20180623 The IBM 029 Card Punch.md +++ b/translated/talk/20180623 The IBM 029 Card Punch.md @@ -13,7 +13,7 @@ IBM 029 型打孔机 ![][1] IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。 System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样, 029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比, 029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在数字区numeric fields左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做左填充left-padding的程序员。 -(译者注:这项功能需要额外的 4 张 [标准模块系统卡SMS card](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如数字区长度为 6 时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch)) +(译者注:这项功能需要额外的 4 张 [标准模块系统卡SMS card](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如设置数字区域长度为 6 列时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch)) 等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年, IBM 的产品目录中才出现 029 型打孔机的身影。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了他的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用“在线”的传输方式"online" mode of communication。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为批任务batch job执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让他成为那时最流行的数据存储方式了。那时的程序是书架上一落的打孔卡而不是硬盘里的一堆文件。 From d12dfbfd5465731b90ad51d3c8ed9b8e98cffe65 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 Dec 2018 08:52:51 +0800 Subject: [PATCH 13/69] translated --- ...to The Matrix at the Linux command line.md | 54 ------------------- ...to The Matrix at the Linux command line.md | 54 +++++++++++++++++++ 2 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 sources/tech/20181212 Patch into The Matrix at the Linux command line.md create mode 100644 translated/tech/20181212 Patch into The Matrix at the Linux command line.md diff --git a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md b/sources/tech/20181212 Patch into The Matrix at the Linux command line.md deleted file mode 100644 index 108fb7c97d..0000000000 --- a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md +++ /dev/null @@ -1,54 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Patch into The Matrix at the Linux command line) -[#]: via: (https://opensource.com/article/18/12/linux-toy-cmatrix) -[#]: author: (Jason Baker https://opensource.com/users/jason-baker) - -Patch into The Matrix at the Linux command line -====== -Recreate the classic look and feel of everyone's favorite 1990s sci-fi movie code scroller with cmatrix. -![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr) - -You've found your way to today's entry from the Linux command-line toys advent calendar. If this is your first visit to the series, you might be wondering what a command-line toy even is? It's anything that's an entertaining diversion at the terminal, be it a game, a fun utility, or a simple distraction. - -Some of these are classics, and some are completely new (at least to me), but I hope all of you find something you enjoy in this series. - -As we come to the close of another year, it's a good time for looking back, and looking forward. What will 2019 hold for you? What does it mean to be 2019? - -I'm reminded that 2019 will mark the twentieth anniversary of one of my favorite science fiction movies from my teenage years, that at the time had me thinking a lot about what the future would hold: [The Matrix][1]. For a computer nerd kid like me, it was the ultimate story of a computer programmer rising up and becoming an action hero in a virtual universe by tapping into the power of his mind. - -At the time, there was no movie that seemed more futuristic to me; both in the story itself, and in the mesmerizing special effects. Realizing that it was filmed over twenty years ago doesn't change that in my mind. - -Bringing it back to our command-line toy for today, let's recreate the downward flowing code of the Matrix at our terminal with **cmatrix**. **cmatrix** was an easy install for me, packaged for Fedora, so installing it took simply: - -``` -$ dnf install cmatrix -``` - -Then, just type **cmatrix **at your terminal to run. -![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif) -You can find the source code for **** **cmatrix** [on GitHub][2] under a GPL license. - -Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. - -Check out yesterday's toy, [Winterize your Bash prompt in Linux][3], and check back tomorrow for another! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/12/linux-toy-cmatrix - -作者:[Jason Baker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jason-baker -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/The_Matrix -[2]: https://github.com/abishekvashok/cmatrix -[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md new file mode 100644 index 0000000000..1793ec25ad --- /dev/null +++ b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Patch into The Matrix at the Linux command line) +[#]: via: (https://opensource.com/article/18/12/linux-toy-cmatrix) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +在命令行中步入黑客帝国 +====== +使用 cmatrix 重建每个人最喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。 +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr) + +你发现了今天的命令行玩具日历。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。 + +其中一些是经典,有些是全新的(至少对我而言),但我希望你们所有人都能在这个系列中找到你喜欢的东西。 + +在我们在接近下一年的时候,现在是回顾和期待的好时机。2019 年会为你带来什么?2019 年意味着什么? + +我想起 2019 年将是我青少年时期最喜欢的科幻电影之一[黑客帝国][1]的二十周年纪念日,它当时让我思考了未来将会发生什么。对于像我这样的痴迷计算机小孩来说,这是一个电脑程序员通过利用自己思维的力量崛起并成为虚拟宇宙中的动作英雄的终极故事。 + +当时,没有一部电影对我来说似乎更具未来感。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。 + +今天将它带回我们的命令行玩具,让我们在终端用 **cmatrix** 重建黑客帝国中那向下滚动的代码流。 **cmatrix** 对我来说很容易安装,它在 Fedora 中被打包了,所以安装它只需: + +``` +$ dnf install cmatrix +``` + +接着,只需在你的终端输入 **cmatrix** 即可运行。 +![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif) +你可以在 [GitHub][2] 上找到使用 GPL 许可的 **cmatrix** 的源代码。 + +你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。评论留言让我知道,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 + +了解一下昨天的玩具,[在 Linux 中让 Bash 提示符变得像冬天][2],还有记得明天再来! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-cmatrix + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/The_Matrix +[2]: https://github.com/abishekvashok/cmatrix +[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt \ No newline at end of file From d32cebf5e13418d3503d69ab39076dad932ea782 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 20 Dec 2018 08:59:40 +0800 Subject: [PATCH 14/69] translating --- sources/tech/20181208 Play Tetris at your Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181208 Play Tetris at your Linux terminal.md b/sources/tech/20181208 Play Tetris at your Linux terminal.md index d3a94bcaf6..db1fe62c24 100644 --- a/sources/tech/20181208 Play Tetris at your Linux terminal.md +++ b/sources/tech/20181208 Play Tetris at your Linux terminal.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c2550effc87eb921631245f2c7209043d7d4d8ad Mon Sep 17 00:00:00 2001 From: zjon Date: Thu, 20 Dec 2018 11:09:22 +0800 Subject: [PATCH 15/69] Update 20171012 7 Best eBook Readers for Linux.md zjon is translating 20171012 7 Best eBook Readers for Linux --- sources/tech/20171012 7 Best eBook Readers for Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20171012 7 Best eBook Readers for Linux.md b/sources/tech/20171012 7 Best eBook Readers for Linux.md index 5198f1bdc0..9f69c6decb 100644 --- a/sources/tech/20171012 7 Best eBook Readers for Linux.md +++ b/sources/tech/20171012 7 Best eBook Readers for Linux.md @@ -1,3 +1,4 @@ +zjon is translating 7 Best eBook Readers for Linux ====== **Brief:** In this article, we are covering some of the best ebook readers for Linux. These apps give a better reading experience and some will even help in managing your ebooks. From 83278751d60a03c62e3dfe31a6d5bb8507078479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com> Date: Thu, 20 Dec 2018 20:26:31 +0800 Subject: [PATCH 16/69] Create 20180912 How to turn on an LED with Fedora IoT.md --- ...2 How to turn on an LED with Fedora IoT.md | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 translated/tech/20180912 How to turn on an LED with Fedora IoT.md diff --git a/translated/tech/20180912 How to turn on an LED with Fedora IoT.md b/translated/tech/20180912 How to turn on an LED with Fedora IoT.md new file mode 100644 index 0000000000..59bbc1280b --- /dev/null +++ b/translated/tech/20180912 How to turn on an LED with Fedora IoT.md @@ -0,0 +1,201 @@ +# 如何使用 Fedora IoT 开启 LED 灯 + +![](https://fedoramagazine.org/wp-content/uploads/2018/08/LED-IoT-816x345.jpg) + +你喜欢 Fedora、容器和树莓派吗?这三者结合操控 LED 会怎么样?本文介绍的是 Fedora IoT,将展示如何在树莓派上安装预览镜像。还将学习如何与 GPIO 交互以开启 LED。 + +### 什么是 Fedora IoT? + +Fedora IoT 是当前 Fedora 项目的目标之一,计划成为一个完整的 Fedora 版本。Fedora IoT 将是一个在ARM(目前仅限 aarch64)例如树莓派,以及 x86_64 架构设备上运行的系统。 + +![][1] + +Fedora IoT 基于 OSTree 开发, 就像[Fedora Silverblue][2] 和以往的 [Atomic Host][3]. + +### 下载和安装 Fedora IoT + +官方 Fedora IoT 镜像将和 Fedora 29 一起发布。但是在此期间你可以下载 [Fedora 28-based 镜像][4] 来进行这个实验。 + +你有两种方法来安装这个系统:使用 dd 命令闪存SD卡,或者使用 fedora-arm-installer 工具。Fedora 的 Wiki 里面提供了更多关于[设置物理设备][5] 的信息来开发 IoT。另外,你可能需要调整第三个分区的大小。 + +把 SD 卡插入到设备并运行,需要创建一个用户来完成安装。这个步骤需要串行连接或带键盘的 HDMI 显示器来与设备进行交互。 + +当系统安装完成后,下一步就是要设置网络连接。使用你刚才创建的用户登录系统,可以使用下列方式之一完成网络连接设置: + +- 如果你需要手动配置你的网络,可能需要执行类似如下命令,需要保证设置正确的网络地址: + +``` + $ nmcli connection add con-name cable ipv4.addresses \ + 192.168.0.10/24 ipv4.gateway 192.168.0.1 \ + connection.autoconnect true ipv4.dns "8.8.8.8,1.1.1.1" \ + type ethernet ifname eth0 ipv4.method manual + +``` + +- 如果你网络上运行着 DHCP 服务,可能需要类似如下命令: + +``` + $ nmcli con add type ethernet con-name cable ifname eth0 +``` + + + +### **Fedora 中的 GPIO 接口** + +许多关于 Linux 上 GPIO 的教程都关注传统的 GPIO sysfis 接口。这个接口已经不推荐使用了,并且上游 Linux 内核社区由于安全和其他问题的缘故打算完全删除它。 + +Fedora 已经不将这个传统的接口编译到内核了,因此在系统上没有 /sys/class/gpio 这个文件。此教程使用一个上游内核提供的一个新的字符设备 /dev/gpiochipN 。这是目前和 GPIO 交互的方式。 + +为了和这个新设备进行交互,你需要使用一个库和一系列命令行界面工具。公共命令行工具比如说 echo 和 cat 在此设备上无法正常工作。 + +你可以通过安装 libgpiod-utils 包来安装命令行界面工具。python3-libgpiod 包提供了相应的 Python 库。 + +### **使用 Podman 来创建一个容器** + +[Podman][6] 是一个容器运行环境,其命令行界面类似于Docker。Podman的一大优势是它不会在后台运行任何守护进程。这对于资源有限的设备尤其有用。Podman 还允许您使用 systemd 单元文件启动容器化服务。此外,它还有许多其他功能。 + +我们使用如下两步来创建一个容器: + +``` +1. 创建包含所需包的分层镜像。 +2. 使用分层镜像创建一个新容器。 +``` + + + +首先创建一个 Dockerfile 文件,内容如下。这些内容告诉 podman 基于可使用的最新 Fedora 镜像来构建我们的分层镜像。然后就是更新系统和安装一些软件包: + +``` +FROM fedora:latest +RUN dnf -y update +RUN dnf -y install libgpiod-utils python3-libgpiod + +``` + +这样你就完成了镜像的生成前的配置工作,这个镜像基于最新的 Fedora,而且包含了和 GPIO 交互的软件包。 + +现在你就可以运行下方命令来构建你的基本镜像了: + +``` +$ sudo podman build --tag fedora:gpiobase -f ./Dockerfile + +``` + +你已经成功创建了你的自定义镜像。这样以后你就可以不用每次都重新搭建环境了,而是基于你创建的镜像来完成工作。 + +### 使用 Podman 完成工作 + +为了确认当前的镜像,可以运行下方命令: + +``` +$ sudo podman images +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/fedora gpiobase 67a2b2b93b4b 10 minutes ago 488MB +docker.io/library/fedora latest c18042d7fac6 2 days ago 300MB + +``` + +现在,启动容器并进行一些实际的实验。 容器通常是隔离的,无法访问主机系统,包括GPIO接口。 因此需要在启动容器时将其挂载在容器内。 可以使用以下命令中的 -device 选项来解决: + +``` +$ sudo podman run -it --name gpioexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash + +``` + +运行之后就进入了正在运行的容器中。 在继续之前,这里有一些容器命令。 输入 exit 或者按下 **Ctrl+D** 来退出容器。 + +显示所有存在的容器可以运行如下命令: + +``` +$ sudo podman container ls -a +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +64e661d5d4e8 localhost/fedora:gpiobase /bin/bash 37 seconds ago Exited (0) Less than a second ago gpioexperiment + +``` + +使用如下命令创建一个新的容器: + +``` +$ sudo podman run -it --name newexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash + +``` + +如果想删除容器可以使用如下命令: + +``` +$ sudo podman rm newexperiment + +``` + +### **开启 LED 灯** + +现在可以使用已创建的容器。 如果容器已经退出,请使用以下命令再次启动它: + +``` +$ sudo podman start -ia gpioexperiment + +``` + +如前所述,可以使用 Fedora 中 libgpiod-utils 包提供的 CLI 工具。 要列出可用的 GPIO 芯片可以使用如下命令: + +``` +$ gpiodetect +gpiochip0 [pinctrl-bcm2835] (54 lines) + +``` + +要获取特定芯片的公开列表,请运行: + +``` +$ gpioinfo gpiochip0 + +``` + +请注意,物理引脚数与前一个命令打印的行数之间没有相关性。 重要的是 BCM 编号,如 [pinout.xyz][7] 所示。 建议不要使用没有相应 BCM 编号的线路。 + +现在,将 LED 连接到物理引脚40,也就是 BCM 21。请记住:LED的短腿(负极,称为阴极)必须连接到带有330欧姆电阻的树莓派的 GND 引脚, 并且长腿(阳极)到物理引脚40。 + +运行以下命令打开LED。,按下 **Ctrl + C ** 关闭: + +``` +$ gpioset --mode=wait gpiochip0 21=1 + +``` + +要点亮一段时间,请添加 -b(在后台运行)和 -s NUM(多少秒)参数,如下所示。 例如,要点亮 LED 5秒钟,运行如下命令: + +``` +$ gpioset -b -s 5 --mode=time gpiochip0 21=1 + +``` + +另一个有用的命令是 gpioget。 它可以获得引脚的状态(高或低),可用于检测按钮和开关。 + +![Closeup of LED connection with GPIO][8] + +### **总结** + +你也可以使用 Python 操控 LED - [这里有一些例子][9]。 也可以在容器内使用 i2c 设备。 此外,Podman 与此 Fedora 版本并不严格相关。 你可以在任何现有的 Fedora Edition 上安装它,或者在 Fedora 中使用两个基于 OSTree 的新系统进行尝试:[Fedora Silverblue][2] 和 [Fedora CoreOS][10]。 + +------ + +via: https://fedoramagazine.org/turnon-led-fedora-iot/ + +作者:[Alessio Ciregia][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[ScarboroughCoral](https://github.com/ScarboroughCoral) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: http://alciregi.id.fedoraproject.org/ +[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/oled-1024x768.png +[2]: https://teamsilverblue.org/ +[3]: https://www.projectatomic.io/ +[4]: https://kojipkgs.fedoraproject.org/compose/iot/latest-Fedora-IoT-28/compose/IoT/ +[5]: https://fedoraproject.org/wiki/InternetOfThings/GettingStarted#Setting_up_a_Physical_Device +[6]: https://github.com/containers/libpod +[7]: https://pinout.xyz/ +[8]: https://fedoramagazine.org/wp-content/uploads/2018/08/breadboard-1024x768.png +[9]: https://github.com/brgl/libgpiod/tree/master/bindings/python/examples +[10]: https://coreos.fedoraproject.org/ From 3c68a0d9d6b73f7ebd64bc1bca2a51bdc59cdb06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com> Date: Thu, 20 Dec 2018 20:28:22 +0800 Subject: [PATCH 17/69] Delete 20180912 How to turn on an LED with Fedora IoT.md --- ...2 How to turn on an LED with Fedora IoT.md | 202 ------------------ 1 file changed, 202 deletions(-) delete mode 100644 sources/tech/20180912 How to turn on an LED with Fedora IoT.md diff --git a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md b/sources/tech/20180912 How to turn on an LED with Fedora IoT.md deleted file mode 100644 index 5f1843fc83..0000000000 --- a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md +++ /dev/null @@ -1,202 +0,0 @@ -Translating by ScarboroughCoral -How to turn on an LED with Fedora IoT -====== - -![](https://fedoramagazine.org/wp-content/uploads/2018/08/LED-IoT-816x345.jpg) - -Do you enjoy running Fedora, containers, and have a Raspberry Pi? What about using all three together to play with LEDs? This article introduces Fedora IoT and shows you how to install a preview image on a Raspberry Pi. You’ll also learn how to interact with GPIO in order to light up an LED. - -### What is Fedora IoT? - -Fedora IoT is one of the current Fedora Project objectives, with a plan to become a full Fedora Edition. The result will be a system that runs on ARM (aarch64 only at the moment) devices such as the Raspberry Pi, as well as on the x86_64 architecture. - -![][1] - -Fedora IoT is based on OSTree, like [Fedora Silverblue][2] and the former [Atomic Host][3]. - -### Download and install Fedora IoT - -The official Fedora IoT images are coming with the Fedora 29 release. However, in the meantime you can download a [Fedora 28-based image][4] for this experiment. - -You have two options to install the system: either flash the SD card using a dd command, or use a fedora-arm-installer tool. The Fedora Wiki offers more information about [setting up a physical device][5] for IoT. Also, remember that you might need to resize the third partition. - -Once you insert the SD card into the device, you’ll need to complete the installation by creating a user. This step requires either a serial connection, or a HDMI display with a keyboard to interact with the device. - -When the system is installed and ready, the next step is to configure a network connection. Log in to the system with the user you have just created choose one of the following options: - - * If you need to configure your network manually, run a command similar to the following. Remember to use the right addresses for your network: -``` - $ nmcli connection add con-name cable ipv4.addresses \ - 192.168.0.10/24 ipv4.gateway 192.168.0.1 \ - connection.autoconnect true ipv4.dns "8.8.8.8,1.1.1.1" \ - type ethernet ifname eth0 ipv4.method manual - -``` - - * If there’s a DHCP service on your network, run a command like this: - -``` - $ nmcli con add type ethernet con-name cable ifname eth0 -``` - - - - -### **The GPIO interface in Fedora** - -Many tutorials about GPIO on Linux focus on a legacy GPIO sysfis interface. This interface is deprecated, and the upstream Linux kernel community plan to remove it completely, due to security and other issues. - -The Fedora kernel is already compiled without this legacy interface, so there’s no /sys/class/gpio on the system. This tutorial uses a new character device /dev/gpiochipN provided by the upstream kernel. This is the current way of interacting with GPIO. - -To interact with this new device, you need to use a library and a set of command line interface tools. The common command line tools such as echo or cat won’t work with this device. - -You can install the CLI tools by installing the libgpiod-utils package. A corresponding Python library is provided by the python3-libgpiod package. - -### **Creating a container with Podman** - -[Podman][6] is a container runtime with a command line interface similar to Docker. The big advantage of Podman is it doesn’t run any daemon in the background. That’s especially useful for devices with limited resources. Podman also allows you to start containerized services with systemd unit files. Plus, it has many additional features. - -We’ll create a container in these two steps: - - 1. Create a layered image containing the required packages. - 2. Create a new container starting from our image. - - - -First, create a file Dockerfile with the content below. This tells podman to build an image based on the latest Fedora image available in the registry. Then it updates the system inside and installs some packages: - -``` -FROM fedora:latest -RUN  dnf -y update -RUN  dnf -y install libgpiod-utils python3-libgpiod - -``` - -You have created a build recipe of a container image based on the latest Fedora with updates, plus packages to interact with GPIO. - -Now, run the following command to build your base image: - -``` -$ sudo podman build --tag fedora:gpiobase -f ./Dockerfile - -``` - -You have just created your custom image with all the bits in place. You can play with this base container images as many times as you want without installing the packages every time you run it. - -### Working with Podman - -To verify the image is present, run the following command: - -``` -$ sudo podman images -REPOSITORY                 TAG        IMAGE ID       CREATED          SIZE -localhost/fedora           gpiobase   67a2b2b93b4b   10 minutes ago  488MB -docker.io/library/fedora   latest     c18042d7fac6   2 days ago     300MB - -``` - -Now, start the container and do some actual experiments. Containers are normally isolated and don’t have an access to the host system, including the GPIO interface. Therefore, you need to mount it inside while starting the container. To do this, use the –device option in the following command: - -``` -$ sudo podman run -it --name gpioexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash - -``` - -You are now inside the running container. Before you move on, here are some more container commands. For now, exit the container by typing exit or pressing **Ctrl+D**. - -To list the the existing containers, including those not currently running, such as the one you just created, run: - -``` -$ sudo podman container ls -a -CONTAINER ID   IMAGE             COMMAND     CREATED          STATUS                              PORTS   NAMES -64e661d5d4e8   localhost/fedora:gpiobase   /bin/bash 37 seconds ago Exited (0) Less than a second ago           gpioexperiment - -``` - -To create a new container, run this command: - -``` -$ sudo podman run -it --name newexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash - -``` - -Delete it with the following command: - -``` -$ sudo podman rm newexperiment - -``` - -### **Turn on an LED** - -Now you can use the container you already created. If you exited from the container, start it again with this command: - -``` -$ sudo podman start -ia gpioexperiment - -``` - -As already discussed, you can use the CLI tools provided by the libgpiod-utils package in Fedora. To list the available GPIO chips, run: - -``` -$ gpiodetect -gpiochip0 [pinctrl-bcm2835] (54 lines) - -``` - -To get the list of the lines exposed by a specific chip, run: - -``` -$ gpioinfo gpiochip0 - -``` - -Notice there’s no correlation between the number of physical pins and the number of lines printed by the previous command. What’s important is the BCM number, as shown on [pinout.xyz][7]. It is not advised to play with the lines that don’t have a corresponding BCM number. - -Now, connect an LED to the physical pin 40, that is BCM 21. Remember: the shorter leg of the LED (the negative leg, called the cathode) must be connected to a GND pin of the Raspberry Pi with a 330 ohm resistor, and the long leg (the anode) to the physical pin 40. - -To turn the LED on, run the following command. It will stay on until you press **Ctrl+C** : - -``` -$ gpioset --mode=wait gpiochip0 21=1 - -``` - -To light it up for a certain period of time, add the -b (run in the background) and -s NUM (how many seconds) parameters, as shown below. For example, to light the LED for 5 seconds, run: - -``` -$ gpioset -b -s 5 --mode=time gpiochip0 21=1 - -``` - -Another useful command is gpioget. It gets the status of a pin (high or low), and can be useful to detect buttons and switches. - -![Closeup of LED connection with GPIO][8] - -### **Conclusion** - -You can also play with LEDs using Python — [there are some examples here][9]. And you can also use the i2c devices inside the container as well. In addition, Podman is not strictly related to this Fedora edition. You can install it on any existing Fedora Edition, or try it on the two new OSTree-based systems in Fedora: [Fedora Silverblue][2] and [Fedora CoreOS][10]. - - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/turnon-led-fedora-iot/ - -作者:[Alessio Ciregia][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: http://alciregi.id.fedoraproject.org/ -[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/oled-1024x768.png -[2]: https://teamsilverblue.org/ -[3]: https://www.projectatomic.io/ -[4]: https://kojipkgs.fedoraproject.org/compose/iot/latest-Fedora-IoT-28/compose/IoT/ -[5]: https://fedoraproject.org/wiki/InternetOfThings/GettingStarted#Setting_up_a_Physical_Device -[6]: https://github.com/containers/libpod -[7]: https://pinout.xyz/ -[8]: https://fedoramagazine.org/wp-content/uploads/2018/08/breadboard-1024x768.png -[9]: https://github.com/brgl/libgpiod/tree/master/bindings/python/examples -[10]: https://coreos.fedoraproject.org/ From ccff8ae5e89141ad282f78a42bfe3c58950dc78f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Dec 2018 22:15:39 +0800 Subject: [PATCH 18/69] PRF:20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @geekpi --- ...roken Ubuntu OS Without Reinstalling It.md | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md index 2fbdc6f07e..858862096e 100644 --- a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md +++ b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It) [#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/) @@ -18,29 +18,20 @@ 首先,尝试使用 live cd 登录并**在外部驱动器中备份数据**。以防这个方法没用,你仍然可以获取数据并重新安装系统! -在登录页上,按下 **CTRL+ALT+F1** 切换到 **tty1**。你可以在[**此处**][1]了解有关在 TTY 之间切换的更多信息。 +在登录页上,按下 `CTRL+ALT+F1` 切换到 tty1。你可以在[此处][1]了解有关在 TTY 之间切换的更多信息。 现在,逐个输入以下命令来修复损坏的 Ubuntu Linux。 ``` $ sudo rm /var/lib/apt/lists/lock - $ sudo rm /var/lib/dpkg/lock - $ sudo rm /var/lib/dpkg/lock-frontend - $ sudo dpkg --configure -a - $ sudo apt clean - $ sudo apt update --fix-missing - $ sudo apt install -f - $ sudo dpkg --configure -a - $ sudo apt upgrade - $ sudo apt dist-upgrade ``` @@ -52,7 +43,7 @@ $ sudo reboot 你现在可以像往常一样登录到你的 Ubuntu 系统。 -我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的贴士对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。 +我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的技巧对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。 这是这些了。希望这篇文章有用。 @@ -69,10 +60,10 @@ via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling- 作者:[SK][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.ostechnix.com/author/sk/ [b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/ \ No newline at end of file +[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/ From b84383d0c6c5243606f103ae11a70a76f8efee3a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Dec 2018 22:16:47 +0800 Subject: [PATCH 19/69] PUB:20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @geekpi https://linux.cn/article-10367-1.html --- ...205 How To Fix Broken Ubuntu OS Without Reinstalling It.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md (97%) diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md similarity index 97% rename from translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md rename to published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md index 858862096e..4db620bf58 100644 --- a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md +++ b/published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md @@ -1,11 +1,11 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) +[#]: publisher: (wxy) [#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It) [#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/) [#]: author: (SK https://www.ostechnix.com/author/sk/) -[#]: url: ( ) +[#]: url: (https://linux.cn/article-10367-1.html) 如何不重装修复损坏的 Ubuntu 系统 ====== From 39ffd0e98559e69ca53f58784373ebe2f81d7a63 Mon Sep 17 00:00:00 2001 From: jlztan Date: Thu, 20 Dec 2018 22:20:41 +0800 Subject: [PATCH 20/69] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20PR=EF=BC=9A=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=A4=B4=E9=83=A8=E7=9A=84=E5=85=83=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...brate Christmas In Linux Way With These Wallpapers.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md index 1132a52058..3c282ce7d5 100644 --- a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md +++ b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md @@ -1,3 +1,12 @@ +[#]: collector: (lujun9972) +[#]: translator: (jlztan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers) +[#]: via: (https://itsfoss.com/christmas-linux-wallpaper/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: url: ( ) + 使用这些壁纸以 Linux 的方式庆祝圣诞节 ====== From a99040998a1f6e1b2b9cedf7687234f9915cfd4a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Dec 2018 22:26:02 +0800 Subject: [PATCH 21/69] PRF:20181212 Patch into The Matrix at the Linux command line.md @geekpi --- ...to The Matrix at the Linux command line.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md index 1793ec25ad..9660bf046d 100644 --- a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md +++ b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Patch into The Matrix at the Linux command line) @@ -9,10 +9,12 @@ 在命令行中步入黑客帝国 ====== -使用 cmatrix 重建每个人最喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。 + +> 使用 cmatrix 重建每个人都喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr) -你发现了今天的命令行玩具日历。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。 +这是今天的命令行玩具日历推荐项目。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。 其中一些是经典,有些是全新的(至少对我而言),但我希望你们所有人都能在这个系列中找到你喜欢的东西。 @@ -20,17 +22,19 @@ 我想起 2019 年将是我青少年时期最喜欢的科幻电影之一[黑客帝国][1]的二十周年纪念日,它当时让我思考了未来将会发生什么。对于像我这样的痴迷计算机小孩来说,这是一个电脑程序员通过利用自己思维的力量崛起并成为虚拟宇宙中的动作英雄的终极故事。 -当时,没有一部电影对我来说似乎更具未来感。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。 +当时,对我来说没有比这部电影更具未来感了。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。 -今天将它带回我们的命令行玩具,让我们在终端用 **cmatrix** 重建黑客帝国中那向下滚动的代码流。 **cmatrix** 对我来说很容易安装,它在 Fedora 中被打包了,所以安装它只需: +今天将它带回我们的命令行玩具,让我们在终端用 `cmatrix` 重建黑客帝国中那向下滚动的代码流。 `cmatrix` 很容易安装,它在 Fedora 中被打包了,所以安装它只需: ``` $ dnf install cmatrix ``` -接着,只需在你的终端输入 **cmatrix** 即可运行。 +接着,只需在你的终端输入 `cmatrix` 即可运行。 + ![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif) -你可以在 [GitHub][2] 上找到使用 GPL 许可的 **cmatrix** 的源代码。 + +你可以在 [GitHub][2] 上找到使用 GPL 许可的 `cmatrix` 的源代码。 你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。评论留言让我知道,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。 @@ -43,7 +47,7 @@ via: https://opensource.com/article/18/12/linux-toy-cmatrix 作者:[Jason Baker][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -51,4 +55,4 @@ via: https://opensource.com/article/18/12/linux-toy-cmatrix [b]: https://github.com/lujun9972 [1]: https://en.wikipedia.org/wiki/The_Matrix [2]: https://github.com/abishekvashok/cmatrix -[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt \ No newline at end of file +[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt From cf6fc9935c5903a66f7daaaf932052d77dc28479 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 20 Dec 2018 22:27:30 +0800 Subject: [PATCH 22/69] PUB:20181212 Patch into The Matrix at the Linux command line.md @geekpi https://linux.cn/article-10368-1.html --- .../20181212 Patch into The Matrix at the Linux command line.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181212 Patch into The Matrix at the Linux command line.md (100%) diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/published/20181212 Patch into The Matrix at the Linux command line.md similarity index 100% rename from translated/tech/20181212 Patch into The Matrix at the Linux command line.md rename to published/20181212 Patch into The Matrix at the Linux command line.md From aaecf1d4609269144f95e5fe79a5dfa825cd36a3 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Thu, 20 Dec 2018 22:50:29 +0800 Subject: [PATCH 23/69] Translating by qhwdw --- sources/tech/20181212 How to Build a Netboot Server, Part 2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md b/sources/tech/20181212 How to Build a Netboot Server, Part 2.md index 0301a34da5..1d1ce2f68f 100644 --- a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md +++ b/sources/tech/20181212 How to Build a Netboot Server, Part 2.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qhwdw) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5a97264a42ecefac7b2243aa65c0a80cba61fe13 Mon Sep 17 00:00:00 2001 From: wwhio Date: Thu, 20 Dec 2018 22:57:44 +0800 Subject: [PATCH 24/69] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E8=AE=A4=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20171119 The Ruby Story.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/talk/20171119 The Ruby Story.md b/sources/talk/20171119 The Ruby Story.md index 90d5f41790..4c6b46b7de 100644 --- a/sources/talk/20171119 The Ruby Story.md +++ b/sources/talk/20171119 The Ruby Story.md @@ -1,3 +1,5 @@ +Translating by wwhio + The Ruby Story ====== Ruby has always been one of my favorite languages, though I’ve sometimes found it hard to express why that is. The best I’ve been able to do is this musical analogy: Whereas Python feels to me like punk rock—it’s simple, predictable, but rigid—Ruby feels like jazz. Ruby gives programmers a radical freedom to express themselves, though that comes at the cost of added complexity and can lead to programmers writing programs that don’t make immediate sense to other people. From 4a06c0160382196631c5cb6762b5305f5e47ddf8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 21 Dec 2018 07:13:26 +0800 Subject: [PATCH 25/69] PRF:20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @lixinyuxx --- ... - Notmuch, mbsync, postfix and dovecot.md | 83 ++++++++++--------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md index 01e5c82f08..12f45713d4 100644 --- a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md +++ b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @@ -1,33 +1,34 @@ -我的个人电子邮件系统 - Notmuch, mbsync,postfix and dovecot +我的个人电子邮件系统设置:notmuch、mbsync、Postfix 和 dovecot ====== -我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。 + +我使用个人电子邮件系统已经相当长的时间了,但是一直没有记录过文档。最近我换了我的笔记本电脑(职业变更导致的变动),我在试图重新创建本地邮件系统时迷茫了。所以这篇文章是一个给自己看的文档,这样我就不用费劲就能再次搭建出来。 ### 服务器端 -我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说) +我运行自己的邮件服务器,并使用 Postfix 作为 SMTP 服务器,用 Dovecot 实现 IMAP。我不打算详细介绍如何配置这些设置,因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill?(用 Jonas 自己的话说): -> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info) +> \ Redpill 是一个概念:一种设置 Debian hosts 去跨组织协作的方式 +> +> \ 我发展了这个概念,并将其首次用于 Redpill 网中网:redpill.dk,其中涉及到了我自己的网络(jones.dk),我的主要客户的网络(homebase.dk),一个包括 Skolelinux Germany(free-owl.de)的在德国的网络,和 Vasudev 的网络(copyninja.info) -除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。 +除此之外, 我还有一个 dovecot sieve 过滤,根据邮件的来源,对邮件进行高级分类,将其放到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 `~/dovecot.sieve` 文件中。 -再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。 +再次,我不会详细介绍如何设置这些东西,因为这不是我这个帖子的目标。 ### 在我的笔记本电脑上 -在我的笔记本电脑上,我已经按照4个部分设置 - - 1. 邮件同步: 使用 mbsync 命令完成 - 2. 分类: 使用 notmuch 完成 - 3. 阅读: 使用 notmuch-emacs 完成 - 4. 邮件发送: 使用作为转接服务器和 SMTP 客户端运行的 postfix 完成。 - +在我的笔记本电脑上,我已经按照 4 个部分设置 + 1. 邮件同步:使用 `mbsync` 命令完成 + 2. 分类:使用 notmuch 完成 + 3. 阅读:使用 notmuch-emacs 完成 + 4. 邮件发送:使用作为中继服务器和 SMTP 客户端运行的 Postfix 完成。 ### 邮件同步 -邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户,最近切换到 mbsync,因为我觉得它比 OfflineIMAP 的配置更轻,更简单。命令是由包 isync 提供的。 +邮件同步是使用 `mbsync` 工具完成的, 我以前是 OfflineIMAP 的用户,最近切换到 `mbsync`,因为我觉得它比 OfflineIMAP 的配置更轻量、更简单。该命令是由 isync 包提供的。 -配置文件是 ~/.mbsyncrc. 下面是我的例子与一些个人设置。 +配置文件是 `~/.mbsyncrc`。下面是我的例子与一些个人设置。 ``` IMAPAccount copyninja @@ -79,17 +80,17 @@ SyncState * Sync All ``` -对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许你提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。 +对上述配置中的一些有趣部分进行一下说明。一个是 PassCmd,它允许你提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我使用 gpg 的对称加密,并在我的磁盘上存储密码。这当然是由 Unix ACL 保护安全的。 -实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。 +实际上,我想使用我的公钥来加密文件,但当脚本在后台或通过 systemd 运行时,解锁文件看起来很困难 (或者说几乎不可能)。如果你有更好的建议,我洗耳恭听:-)。 -下一个指令部分是模式。这使你可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders. +下一个指令部分是 Patterns。这使你可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助,可以排除所有的 “[Gmail]/ folders” 垃圾目录。 ### 邮件分类 -一旦邮件在你本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。 +一旦邮件到达你的本地设备,我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步的 Maildir,并在 Gnus 中阅读。这种设置相比于设置所有的服务器软件是有点大题小作,但 Gnus 无法很好地应付 Maildir 格式,这是最好的方法。这个设置也有一个缺点,那就是在你快速搜索邮件时,要搜索大量邮件。而这就是 notmuch 的用武之地。 -不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。 +notmuch 允许我轻松索引上千兆字节的邮件档案而找到我需要的东西。我已经创建了一个小脚本,它结合了执行 `mbsync` 和 `notmuch`。我使用 dovecot sieve 来基于实际上创建在服务器端的 Maildirs 标记邮件。下面是我的完整 shell 脚本,它执行同步分类和删除垃圾邮件的任务。 ``` #!/bin/sh @@ -129,27 +130,28 @@ for mdir in $MDIR; do done ``` -因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对,这些邮件逃脱垃圾邮件过滤器进到我的 inbox ,并被我亲自标记为垃圾邮件。 +因此,在运行 `mbsync` 之前,我搜索所有标记为“deleted”的邮件,并将其从系统中删除。接下来,我在我的帐户上查找标记为“Spam”的邮件,并将其移动到“Spam”文件夹。你没看错,这些邮件逃脱了垃圾邮件过滤器进入到我的收件箱,并被我亲自标记为垃圾邮件。 -运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。 +运行 `mbsync` 后,我基于它们的文件夹标记邮件(搜索字符串 `folder:`)。这让我可以很容易地得到一个邮件列表的内容,而不需要记住列表地址。 ### 阅读邮件 -现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer),它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。你可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。 +现在,我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格,所以我花了一些时间写了一个私有层,它将我所有的快捷键和分类集中在一个地方,而不会扰乱我的整个 `.spacemacs` 文件。你可以在 [notmuch-emacs-layer 仓库][1] 找到我的私有层的代码。 ### 发送邮件 -如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。 +能阅读邮件这还不够,我们也需要能够回复邮件。而这是最近是我感到迷茫的一个略显棘手的部分,以至于不得不写这篇文章,这样我就不会再忘记了。(当然也不必在网络上参考一些过时的帖子。) -我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。 +我的系统发送邮件使用 Postfix 作为 SMTP 客户端,使用我自己的 SMTP 服务器作为它的中继主机。中继的问题是,它不能是具有动态 IP 的主机。有两种方法可以允许具有动态 IP 的主机使用中继服务器, 一种是将邮件来源的 IP 地址放入 `my_network` 或第二个使用 SASL 身份验证。 + +我的首选方法是使用 SASL 身份验证。为此,我首先要为每台机器创建一个单独的账户,它将把邮件中继到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主账户,但 Jonas 给出了可行的按账户的想法) -我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法) ``` adduser _relay - ``` -这里替换 与你的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行 +这里替换 `` 为你的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 Postfix 作为中继服务器。因此,在 Postfix 配置中添加以下行: + ``` # SASL authentication smtp_sasl_auth_enable = yes @@ -159,28 +161,30 @@ relayhost = [smtp.copyninja.info]:submission smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd ``` -因此, 这里的 relayhost 是你的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任你的移动主机, 并同意为你转发邮件。 +因此, 这里的 `relayhost` 是用于将邮件转发到互联网的 Postfix 实例的服务器名称。`submission` 的部分 Postfix 将邮件转发到端口 587(安全端口)。`smtp_sasl_tls_security_options` 设置为不允许匿名连接。这是必须的,以便中继服务器信任你的移动主机,并同意为你转发邮件。 + +`/etc/postfix/sasl_passwd` 是你需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。 -/etc/postfix/sasl__asswd 是你需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。 ``` [smtp.example.com]:submission user:password - ``` - 用你的 SMTP 服务器名称替换 smtp.example.com ,你已输入的 relayhost 认证。 用你创建的用户及其密码替换 user with _relay 。 +用你已放入 `relayhost` 配置的 SMTP 服务器名称替换 `smtp.example.com`。用你创建的 `_relay` 用户及其密码替换 `user` 和 `passwd`。 + +若要保护 `sasl_passwd` 文件,并为 Postfix 创建它的哈希文件,使用以下命令。 -若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。 ``` chown root:root /etc/postfix/sasl_passwd chmod 0600 /etc/postfix/sasl_passwd postmap /etc/postfix/sasl_passwd ``` -最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是你的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从你的系统中取出。 +最后一条命令将创建 `/etc/postfix/sasl_passwd.db` 文件,它是你的文件的 `/etc/postfix/sasl_passwd` 的哈希文件,具有相同的所有者和权限。现在重新加载 Postfix,并使用 `mail` 命令检查邮件是否从你的系统中发出。 ### Bonus 的部分 -好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。 +好吧,因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器,以定期同步后台的邮件。就我而言,每 10 分钟一次。下面是 `mailsync.timer` 文件。 + ``` [Unit] Description=Check Mail Every 10 minutes @@ -197,7 +201,7 @@ Unit=mailsync.service WantedBy=default.target ``` -下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。 +下面是 mailsync.service 服务,这是 mailsync.timer 执行我们的脚本所需要的。 ``` [Unit] @@ -212,14 +216,15 @@ StandardOutput=syslog StandardError=syslog ``` -将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启它们 +将这些文件置于 `/etc/systemd/user` 目录下并运行以下代码去开启它们: + ``` systemctl enable --user mailsync.timer systemctl enable --user mailsync.service systemctl start --user mailsync.timer ``` -这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。 +这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew,他审阅了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置,当然还会有一个后续的帖子:-)。 -------------------------------------------------------------------------------- @@ -227,7 +232,7 @@ via: https://copyninja.info/blog/email_setup.html 作者:[copyninja][a] 译者:[lixinyuxx](https://github.com/lixinyuxx) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ed9ed4b2e62d59394b53735e5cceb8389d12f75a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 21 Dec 2018 07:13:56 +0800 Subject: [PATCH 26/69] PUB:20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md @lixingyuxx https://linux.cn/article-10369-1.html --- ...personal Email setup - Notmuch, mbsync, postfix and dovecot.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md (100%) diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/published/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md similarity index 100% rename from translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md rename to published/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md From dd9c5382b4018acb20130115ab004985b810733b Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 Dec 2018 08:52:33 +0800 Subject: [PATCH 27/69] translated --- ...es for a Raspberry Pi Around the Office.md | 142 ------------------ ...es for a Raspberry Pi Around the Office.md | 142 ++++++++++++++++++ 2 files changed, 142 insertions(+), 142 deletions(-) delete mode 100644 sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md create mode 100644 translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md diff --git a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md deleted file mode 100644 index 4eb59ba1a0..0000000000 --- a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (11 Uses for a Raspberry Pi Around the Office) -[#]: via: (https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/) -[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) - -11 Uses for a Raspberry Pi Around the Office -====== - -Look, I know what you’re thinking: a Raspberry Pi is really just for tinkering, prototyping and hobby use. It’s not actually meant for running a business on. - -And it’s definitely true that this computer’s relatively low processing power, corruptible SD card, lack of battery backup and the DIY nature of the support means it’s not going to be a viable replacement for a [professionally installed and configured business server][1] for your most mission-critical operations any time soon. - -But the board is affordable, incredibly frugal with power, small enough to fit just about anywhere and endlessly flexible – it’s actually a pretty great way to handle some basic tasks around the office. - -And, even better, there’s a whole world of people out there who have done these projects before and are happy to share how they did it. - -### DNS Server - -Every time you type a website address or click a link in your browser, it needs to convert the domain name into a numeric IP address before it can show you anything. - -Normally this means a request to a DNS server somewhere on the internet – but you can speed up your browsing by handling this locally. - -You can also assign your own subdomains for local access to machines around the office. - -[Here’s how to get this working.][2] - -### Toilet Occupied Sign - -Ever get queues at the loos? - -That’s annoying for those left waiting and the time spent dealing with it is a drain on your whole office’s productivity. - -I guess you could always hang those signs they have on airplanes all through your office. - -[Occu-pi][3] is a much simpler solution, using a magnetic switch and a Raspberry Pi to tell when the bolt is closed and update a Slack channel as to when it’s in use – meaning that the whole office can tell at a glance of their computer or mobile device whether there’s a cubicle free. - -### Honeypot Trap for Hackers - -It should scare most business owners just a little bit that their first clue that a hacker’s breached the network is when something goes badly wrong. - -That’s where it can help to have a honeypot: a computer that serves no purpose except to sit on your network with certain ports open to masquerade as a juicy target to hackers. - -Security researchers often deploy honeypots on the exterior of a network, to collect data on what attackers are doing. - -But for the average small business, these are more usefully deployed in the interior, to serve as kind of a tripwire. Because no ordinary user has any real reason to want to connect to the honeypot, any login attempts that occur are a very good indicator that mischief is afoot. - -This can provide early warning of outsider intrusion, and of trusted insiders up to no good. - -In larger, client/server networks, it might be more practical to run something like this as a virtual machine. But in small-office/home-office situations with a peer-to-peer network running on a wireless router, something like [HoneyPi][4] is a great little burglar alarm. - -### Print Server - -Network-attached printers are so much more convenient. - -But it can be expensive to replace all your printers- especially if you’re otherwise happy with them. - -It might make a lot more sense to [set up a Raspberry Pi as a print server][5]. - -### Network Attached Storage - -Turning simple hard drives into network attached storage was one of the earliest practical uses for a Raspberry Pi, and it’s still one of the best. - -[Here’s how to create a NAS with your Raspberry Pi.][6] - -### Ticketing Server - -Looking for a way to manage the support tickets for your help desk on a shoestring budget? - -There’s a totally open source ticketing program called osTicket that you can install on your Pi, and it’s even available as [a ready-to-go SD card image][7]. - -### Digital Signage - -Whether it’s for events, advertising, a menu, or something else entirely, a lot of businesses need a way to display digital signage – and the Pi’s affordability and frugal electricity needs make it a very attractive choice. - -[There are a wealth of options to choose from here.][8] - -### Directories and Kiosks - -[FullPageOS][9] is a Linux distribution based on Raspbian that boots straight into a full screen version of Chromium – ideal for shopping directoriers, library catalogues and so on. - -### Basic Intranet Web Server - -For hosting a public-facing website, you’re really much better off just getting a hosting account. A Raspberry Pi is not really built to serve any real volume of web traffic. - -But for small offices, it can host an internal business wiki or basic company intranet. It can also work as a sandbox environment for experimenting with code and server configurations. - -[Here’s how to get Apache, MySQL and PHP running on a Pi.][10] - -### Penetration Tester - -Kali Linux is an operating system built specifically to probe networks for security vulnerabilities. By installing it on a Pi, you’ve got a super portable penetration tester with more than 600 tools included. - -[You can find a torrent link for the Raspberry Pi image here.][11] - -Be absolutely scrupulous to only use this on your own network or networks you’ve got permission to perform a security audit on – using this to hack other networks is a serious crime. - -### VPN Server - -When you’re out on the road, relying on public wireless internet, you’ve not really any say in who else might be on the network, snooping on all your traffic. That’s why it can be reassuring to encrypt everything with a VPN connection. - -There are any number of commercial VPN services you can subscribe to – and you can install your own in the cloud – but by running one from your office, you can also access the local network from anywhere. - -For light use – say, the occasional bit of business travel – a Raspberry Pi is a great, power-efficient way to set up a VPN server. (It’s also worth checking first that your router doesn’t offer this functionality already – very many do.) - -[Here’s how to install OpenVPN on a Raspberry Pi.][12] - -### Wireless Coffee Machine - -Ahh, ambrosia: sweet nectar of the gods and the backbone of all productive enterprise. - -So why not [hack the office coffee machine into a smart coffee machine][13] for precision temperature control and wireless network connectivity? - --------------------------------------------------------------------------------- - -via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/ - -作者:[James Mawson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/ -[b]: https://github.com/lujun9972 -[1]: https://dxmtechsupport.com.au/server-configuration -[2]: https://www.1and1.com/digitalguide/server/configuration/how-to-make-your-raspberry-pi-into-a-dns-server/ -[3]: https://blog.usejournal.com/occu-pi-the-bathroom-of-the-future-ed69b84e21d5 -[4]: https://trustfoundry.net/honeypi-easy-honeypot-raspberry-pi/ -[5]: https://opensource.com/article/18/3/print-server-raspberry-pi -[6]: https://howtoraspberrypi.com/create-a-nas-with-your-raspberry-pi-and-samba/ -[7]: https://everyday-tech.com/a-raspberry-pi-ticketing-system-image-with-osticket/ -[8]: https://blog.capterra.com/7-free-and-open-source-digital-signage-software-options-for-your-next-event/ -[9]: https://github.com/guysoft/FullPageOS -[10]: https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server -[11]: https://www.offensive-security.com/kali-linux-arm-images/ -[12]: https://medium.freecodecamp.org/running-your-own-openvpn-server-on-a-raspberry-pi-8b78043ccdea -[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine diff --git a/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md new file mode 100644 index 0000000000..88e7fbd86a --- /dev/null +++ b/translated/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (11 Uses for a Raspberry Pi Around the Office) +[#]: via: (https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/) +[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/) + +树莓派在办公室的 11 种用法 +====== + +我知道你在想什么:树莓派只能用在修修补补、原型设计和个人爱好中。它实际不能用在业务中。 + +毫无疑问,这台电脑的处理能力相对较低、易损坏的 SD 卡、缺乏电池备份以及支持的 DIY 性质,这意味着它不会是一个能在任何时候执行最关键的操作的[专业的已安装和已配置的商业服务器][1]的可行替代,。 + +但是它电路板便宜、功耗很小、很小几乎适合任何地方、无限灵活 - 这实际上是处理办公室一些基本任务的好方法。 + +而且,更好的是,已经有一些人完成了这些项目并很乐意分享他们是如何做到的。 + +### DNS 服务器 + +每次在浏览器中输入网站地址或者点击链接时,都需要将域名转换为数字 IP 地址,然后才能显示内容。 + +通常这意味着向互联网上某处 DNS 服务器发出请求 - 但你可以通过本地处理来加快浏览速度。 + +你还可以分配自己的子域,以便本地访问办公室中的计算机。 + +[这里是如何让这它工作。][2] + +### 厕所占用标志 + +在厕所排过队吗? + +这对于那些等待的人来说很烦人,花在处理它上面的时间会耗费你在办公室的工作效率。 + +我想你希望在办公室里也悬挂飞机上有的标志。 + +[Occu-pi][3] 是一个更简单的解决方案,使用磁性开关和树莓派来判断螺栓何时关闭并在 Slack 频道中更新厕所在使用中 - 这意味着整个办公室的人都可以看一眼电脑或者移动设备知道是否有空闲的隔间。 + +### 针对黑客的蜜罐陷阱 + +黑客破坏了网络的第一个线索是一些事情变得糟糕,这应该会吓到大多数企业主。 + +这就是可以用到蜜罐的地方:一台没有任何服务的计算机位于你的网络,将特定端口打开伪装成黑客喜欢的目标。 + +安全研究人员经常在网络外部部署蜜罐,以收集攻击者正在做的事情的数据。 + +但对于普通的小型企业来说,这些作为一种绊脚石部署在内部更有用。因为普通用户没有真正的理由想要连接到蜜罐,所以任何发生的登录尝试都是正在进行捣乱的非常好的指示。 + +这可以提供对外部人员入侵的预警,并且可信赖的内部人员也没有任何好处。 + +在较大的客户端/服务器网络中,将它作为虚拟机运行可能更为实际。但是在无线路由器上运行的点对点的小型办公室/家庭办公网络中,[HoneyPi][4] 之类的东西是一个很小的防盗报警器。 + +### 打印服务器 + +网络连接的打印机更方便。 + +但更换所有打印机可能会很昂贵 - 特别是如果你对它们感到满意的话。 + +[将树莓派设置为打印服务器][5]可能会更有意义。 + +### 网络附加存储 (NAS) + +将硬盘变为 NAS 是树莓派最早的实际应用之一,并且它仍然是最好的之一。 + +[这是如何使用树莓派创建NAS。][6] + +### 工单服务器 + +想要在预算不足的情况下在服务台中支持工单? + +有一个名为 osTicket 的完全开源的工单程序,它可以安装在你的树莓派上,它甚至还有[随时可用的 SD 卡镜像][7]。 + +### 数字标牌 + +无论是用于活动、广告、菜单还是其他任何东西,许多企业都需要一种显示数字标牌的方式 - 而树莓派的廉价和省电使其成为一个非常有吸引力的选择。 + +[这有很多可供选择的选项。] [8] + +### 目录和信息亭 + +[FullPageOS][9] 是一个基于 Raspbian 的 Linux 发行版,它直接引导到 Chromium 的全屏版本 - 这非常适合导购、图书馆目录等。 + +### 基本的内联网 Web 服务器 + +对于托管一个面向公众的网站,你最好有一个托管帐户。树莓派不适合面对真正的网络流量。 + +但对于小型办公室,它可以托管内部业务维基或基本的公司内网。它还可以用作沙箱环境,用于试验代码和服务器配置。 + +[这里是如何在树莓派上运行 Apache、MySQL 和 PHP。][10] + +### 渗透测试器 + +Kali Linux 是专为探测网络安全漏洞而构建的操作系统。通过将其安装在树莓派上,你就拥有了一个超便携式穿透测试器,其中包含 600 多种工具。 + +[你可以在这里找到树莓派镜像的种子链接。][11] + +绝对小心只在你自己的网络或你有权对它安全审计的网络中使用它 - 使用此方法来破解其他网络是严重的犯罪行为。 + +### VPN 服务器 + +当你外出时,依靠的是公共无线互联网,你无法控制还有谁在网络中、谁在窥探你的所有流量。这就是为什么通过 VPN 连接加密所有内容可以让人放心。 + +你可以订阅任意数量的商业 VPN 服务,并且你可以在云中安装自己的服务,但是在办公室运行一个 VPN,这样你也可以从任何地方访问本地网络。 + +对于轻度使用 - 比如偶尔的商务旅行 - 树莓派是一种强大的,节约能源的设置 VPN 服务器的方式。(首先要检查一下你的路由器是不是不支持这个功能,许多路由器是支持的。) + +[这是如何在树莓派上安装 OpenVPN。][12] + +### 无线咖啡机 + +啊,美味:美味的饮料还是公司内工作效率的支柱。 + +那么, 为什么不[将办公室的咖啡机变成可以精确控制温度和无线连接的智能咖啡机呢?][13] + +-------------------------------------------------------------------------------- + +via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/ + +作者:[James Mawson][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/ +[b]: https://github.com/lujun9972 +[1]: https://dxmtechsupport.com.au/server-configuration +[2]: https://www.1and1.com/digitalguide/server/configuration/how-to-make-your-raspberry-pi-into-a-dns-server/ +[3]: https://blog.usejournal.com/occu-pi-the-bathroom-of-the-future-ed69b84e21d5 +[4]: https://trustfoundry.net/honeypi-easy-honeypot-raspberry-pi/ +[5]: https://opensource.com/article/18/3/print-server-raspberry-pi +[6]: https://howtoraspberrypi.com/create-a-nas-with-your-raspberry-pi-and-samba/ +[7]: https://everyday-tech.com/a-raspberry-pi-ticketing-system-image-with-osticket/ +[8]: https://blog.capterra.com/7-free-and-open-source-digital-signage-software-options-for-your-next-event/ +[9]: https://github.com/guysoft/FullPageOS +[10]: https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server +[11]: https://www.offensive-security.com/kali-linux-arm-images/ +[12]: https://medium.freecodecamp.org/running-your-own-openvpn-server-on-a-raspberry-pi-8b78043ccdea +[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine \ No newline at end of file From 5dd95c43b49d1b427c2b2341bc725b9351b8f252 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 21 Dec 2018 08:59:20 +0800 Subject: [PATCH 28/69] translating --- ...o Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md b/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md index 1b52121add..379bbfd20a 100644 --- a/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md +++ b/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 17ba37122e923c2297b5e54c287781f60733a5fc Mon Sep 17 00:00:00 2001 From: Auk7F7 <34982730+Auk7F7@users.noreply.github.com> Date: Fri, 21 Dec 2018 11:31:10 +0800 Subject: [PATCH 29/69] Update 20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md translating by Auk7F7 --- ...Audit - A Tool To Check Vulnerable Packages In Arch Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md b/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md index 7c626bb0b2..3f77bee3d1 100644 --- a/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md +++ b/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md @@ -7,6 +7,8 @@ [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) [#]: url: ( ) +translating by Auk7F7 + Arch-Audit : A Tool To Check Vulnerable Packages In Arch Linux ====== From 0113da44dbfd713cb49fe7bc2d14dd1050656f45 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 11:53:43 +0800 Subject: [PATCH 30/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Getting=20started?= =?UTF-8?q?=20with=20Prometheus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0181220 Getting started with Prometheus.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20181220 Getting started with Prometheus.md diff --git a/sources/tech/20181220 Getting started with Prometheus.md b/sources/tech/20181220 Getting started with Prometheus.md new file mode 100644 index 0000000000..79704addb7 --- /dev/null +++ b/sources/tech/20181220 Getting started with Prometheus.md @@ -0,0 +1,166 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Prometheus) +[#]: via: (https://opensource.com/article/18/12/introduction-prometheus) +[#]: author: (Michael Zamot https://opensource.com/users/mzamot) + +Getting started with Prometheus +====== +Learn to install and write queries for the Prometheus monitoring and alerting system. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_sysadmin_cloud.png?itok=sUciG0Cn) + +[Prometheus][1] is an open source monitoring and alerting system that directly scrapes metrics from agents running on the target hosts and stores the collected samples centrally on its server. Metrics can also be pushed using plugins like **collectd_exporter** —although this is not Promethius' default behavior, it may be useful in some environments where hosts are behind a firewall or prohibited from opening ports by security policy. + +Prometheus, a project of the [Cloud Native Computing Foundation][2], scales up using a federation model, which enables one Prometheus server to scrape another Prometheus server. This allows creation of a hierarchical topology, where a central system or higher-level Prometheus server can scrape aggregated data already collected from subordinate instances. + +Besides the Prometheus server, its most common components are its [Alertmanager][3] and its exporters. + +Alerting rules can be created within Prometheus and configured to send custom alerts to Alertmanager. Alertmanager then processes and handles these alerts, including sending notifications through different mechanisms like email or third-party services like [PagerDuty][4]. + +Prometheus' exporters can be libraries, processes, devices, or anything else that exposes the metrics that will be scraped by Prometheus. The metrics are available at the endpoint **/metrics** , which allows Prometheus to scrape them directly without needing an agent. The tutorial in this article uses **node_exporter** to expose the target hosts' hardware and operating system metrics. Exporters' outputs are plaintext and highly readable, which is one of Prometheus' strengths. + +In addition, you can configure [Grafana][5] to use Prometheus as a backend to provide data visualization and dashboarding functions. + +### Making sense of Prometheus' configuration file + +The number of seconds between when **/metrics** is scraped controls the granularity of the time-series database. This is defined in the configuration file as the **scrape_interval** parameter, which by default is set to 60 seconds. + +Targets are set for each scrape job in the **scrape_configs** section. Each job has its own name and a set of labels that can help filter, categorize, and make it easier to identify the target. One job can have many targets. + +### Installing Prometheus + +In this tutorial, for simplicity, we will install a Prometheus server and **node_exporter** with docker. Docker should already be installed and configured properly on your system. For a more in-depth, automated method, I recommend Steve Ovens' article [How to use Ansible to set up system monitoring with Prometheus][6]. + +Before starting, create the Prometheus configuration file **prometheus.yml** in your work directory as follows: + +``` +global: +  scrape_interval:      15s +  evaluation_interval: 15s + +scrape_configs: +  - job_name: 'prometheus' + +        static_configs: +        - targets: ['localhost:9090'] + +  - job_name: 'webservers' + +        static_configs: +        - targets: [':9100'] +``` + +Start Prometheus with Docker by running the following command: + +``` +$ sudo docker run -d -p 9090:9090 -v +/path/to/prometheus.yml:/etc/prometheus/prometheus.yml +prom/prometheus +``` + +By default, the Prometheus server will use port 9090. If this port is already in use, you can change it by adding the parameter **\--web.listen-address=" :"** at the end of the previous command. + +In the machine you want to monitor, download and run the **node_exporter** container by using the following command: + +``` +$ sudo docker run -d -v "/proc:/host/proc" -v "/sys:/host/sys" -v +"/:/rootfs" --net="host" prom/node-exporter --path.procfs +/host/proc --path.sysfs /host/sys --collector.filesystem.ignored- +mount-points "^/(sys|proc|dev|host|etc)($|/)" +``` + +For the purposes of this learning exercise, you can install **node_exporter** and Prometheus on the same machine. Please note that it's not wise to run **node_exporter** under Docker in production—this is for testing purposes only. + +To verify that **node_exporter** is running, open your browser and navigate to **http:// :9100/metrics**. All the metrics collected will be displayed; these are the same metrics Prometheus will scrape. + +![](https://opensource.com/sites/default/files/uploads/check-node_exporter.png) + +To verify the Prometheus server installation, open your browser and navigate to . + +You should see the Prometheus interface. Click on **Status** and then **Targets**. Under State, you should see your machines listed as **UP**. + +![](https://opensource.com/sites/default/files/uploads/targets-up.png) + +### Using Prometheus queries + +It's time to get familiar with [PromQL][7], Prometheus' query syntax, and its graphing web interface. Go to **** on your Prometheus server. You will see a query editor and two tabs: Graph and Console. + +Prometheus stores all data as time series, identifying each one with a metric name. For example, the metric **node_filesystem_avail_bytes** shows the available filesystem space. The metric's name can be used in the expression box to select all of the time series with this name and produce an instant vector. If desired, these time series can be filtered using selectors and labels—a set of key-value pairs—for example: + +``` +node_filesystem_avail_bytes{fstype="ext4"} +``` + +When filtering, you can match "exactly equal" ( **=** ), "not equal" ( **!=** ), "regex-match" ( **=~** ), and "do not regex-match" ( **!~** ). The following examples illustrate this: + +To filter **node_filesystem_avail_bytes** to show both ext4 and XFS filesystems: + +``` +node_filesystem_avail_bytes{fstype=~"ext4|xfs"} +``` + +To exclude a match: + +``` +node_filesystem_avail_bytes{fstype!="xfs"} +``` + +You can also get a range of samples back from the current time by using square brackets. You can use **s** to represent seconds, **m** for minutes, **h** for hours, **d** for days, **w** for weeks, and **y** for years. When using time ranges, the vector returned will be a range vector. + +For example, the following command produces the samples from five minutes to the present: + +``` +node_memory_MemAvailable_bytes[5m] +``` + +Prometheus also includes functions to allow advanced queries, such as this: + +``` +100 core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LICENSE published README.md scripts sources translated (1 - avg by(instance)(irate(node_cpu_seconds_total{job='webservers',mode='idle'}[5m]))) +``` + +Notice how the labels are used to filter the job and the mode. The metric **node_cpu_seconds_total** returns a counter, and the **irate()** function calculates the per-second rate of change based on the last two data points of the range interval (meaning the range can be smaller than five minutes). To calculate the overall CPU usage, you can use the idle mode of the **node_cpu_seconds_total** metric. The idle percent of a processor is the opposite of a busy processor, so the **irate** value is subtracted from 1. To make it a percentage, multiply it by 100. + +![](https://opensource.com/sites/default/files/uploads/cpu-usage.png) + +### Learn more + +Prometheus is a powerful, scalable, lightweight, and easy to use and deploy monitoring tool that is indispensable for every system administrator and developer. For these and other reasons, many companies are implementing Prometheus as part of their infrastructure. + +To learn more about Prometheus and its functions, I recommend the following resources: + ++ About [PromQL][8] ++ What [node_exporters collects][9] ++ [Prometheus functions][10] ++ [4 open source monitoring tools][11] ++ [Now available: The open source guide to DevOps monitoring tools][12] + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/introduction-prometheus + +作者:[Michael Zamot][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mzamot +[b]: https://github.com/lujun9972 +[1]: https://prometheus.io/ +[2]: https://www.cncf.io/ +[3]: https://prometheus.io/docs/alerting/alertmanager/ +[4]: https://en.wikipedia.org/wiki/PagerDuty +[5]: https://grafana.com/ +[6]: https://opensource.com/article/18/3/how-use-ansible-set-system-monitoring-prometheus +[7]: https://prometheus.io/docs/prometheus/latest/querying/basics/ +[8]: https://prometheus.io/docs/prometheus/latest/querying/basics/ +[9]: https://github.com/prometheus/node_exporter#collectors +[10]: https://prometheus.io/docs/prometheus/latest/querying/functions/ +[11]: https://opensource.com/article/18/8/open-source-monitoring-tools +[12]: https://opensource.com/article/18/8/now-available-open-source-guide-devops-monitoring-tools From a9b3773a74c7e41743ee2f62da56a500dab87614 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 11:55:44 +0800 Subject: [PATCH 31/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Termtosvg=20?= =?UTF-8?q?=E2=80=93=20Record=20Your=20Terminal=20Sessions=20As=20SVG=20An?= =?UTF-8?q?imations=20In=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nal Sessions As SVG Animations In Linux.md | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20181218 Termtosvg - Record Your Terminal Sessions As SVG Animations In Linux.md diff --git a/sources/tech/20181218 Termtosvg - Record Your Terminal Sessions As SVG Animations In Linux.md b/sources/tech/20181218 Termtosvg - Record Your Terminal Sessions As SVG Animations In Linux.md new file mode 100644 index 0000000000..f25406a66a --- /dev/null +++ b/sources/tech/20181218 Termtosvg - Record Your Terminal Sessions As SVG Animations In Linux.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Termtosvg – Record Your Terminal Sessions As SVG Animations In Linux) +[#]: via: (https://www.2daygeek.com/termtosvg-record-your-terminal-sessions-as-svg-animations-in-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Termtosvg – Record Your Terminal Sessions As SVG Animations In Linux +====== + +By default everyone prefer history command to review/recall the previously entered commands in terminal. + +But unfortunately, that shows only the commands that we ran and doesn’t shows the commands output which was performed previously. + +There are many utilities available in Linux to record the terminal session activity. + +This tool will help us to record the users terminal activity, also will help us to identify other useful information from the output. + +Also, we had written about few utilities in the past and today also we are going to discuss about the same kind of topic. + +If you would like to check other utilities to record your Linux terminal session activity then you can give a try to **[Script Command][1]** and **[Terminalizer Tool][2]**. + +But if you are looking for **[GIF Recorder][3]** then try **[Gifine][4]** , **[Kgif][5]** and **[Peek][6]** utilities. + +Script is one of the best utility to record your terminal session on headless server. + +Script is a Unix command line utility that records a terminal session (in other terms, It’s record everything displayed on your terminal). + +It stores the output in the current directory as a text file and the default file name is typescript. + +### What is Termtosvg + +Termtosvg is a Unix terminal recorder written in Python that renders your command line sessions as standalone SVG animations. + +### Termtosvg Features + + * Produce lightweight and clean looking animations embeddable on a project page. + * Custom color themes, terminal UI and animation controls via SVG templates. + * Compatible with asciinema recording format. + * It requires Python >= 3.5 + + + +### How to Install Termtosvg In Linux + +It was written in Python and pip installation is a recommended method to install Termtosvg on Linux. + +Make sure you should have installed python-pip package on your system. If no, use the following command to install it. + +For Debian/Ubuntu users, use **[Apt Command][7]** or **[Apt-Get Command][8]** to install pip package. + +``` +$ sudo apt install python-pip +``` + +For Archlinux users, use **[Pacman Command][9]** to install pip package. + +``` +$ sudo pacman -S python-pip +``` + +For Fedora users, use **[DNF Command][10]** to install pip package. + +``` +$ sudo dnf install python-pip +``` + +For CentOS/RHEL users, use **[YUM Command][11]** to install pip package. + +``` +$ sudo yum install python-pip +``` + +For openSUSE users, use **[Zypper Command][12]** to install pip package. + +``` +$ sudo zypper install python-pip +``` + +Finally run the following **[pip command][13]** to install Termtosvg tool in Linux. + +``` +$ sudo pip3 install termtosvg pyte python-xlib svgwrite +``` + +### How to Record Your Terminal Session Using Termtosvg + +Once you successfully installed Termtosvg. Just run the following command to start recording. + +``` +$ termtosvg +Recording started, enter "exit" command or Control-D to end +``` + +For testing purpose run few commands and see whether it’s working fine or not. + +``` +$ uname -a +Linux daygeek-Y700 4.19.8-2-MANJARO #1 SMP PREEMPT Sat Dec 8 14:45:36 UTC 2018 x86_64 GNU/Linux +$ hostname +daygeek-Y700 +$ cat /etc/*-release +Manjaro Linux +DISTRIB_ID=ManjaroLinux +DISTRIB_RELEASE=18.0 +DISTRIB_CODENAME=Illyria +DISTRIB_DESCRIPTION="Manjaro Linux" +Manjaro Linux +NAME="Manjaro Linux" +ID=manjaro +ID_LIKE=arch +PRETTY_NAME="Manjaro Linux" +ANSI_COLOR="1;32" +HOME_URL="https://www.manjaro.org/" +SUPPORT_URL="https://www.manjaro.org/" +BUG_REPORT_URL="https://bugs.manjaro.org/" +$ free -g +free: Multiple unit options doesn't make sense. +$ free -m +free: Multiple unit options doesn't make sense. +$ pip3 --version +pip 18.1 from /usr/lib/python3.7/site-packages/pip (python 3.7) +``` + +Once you have done, simple press `CTRL+D` or type `exit` to stop the recording. The result will be saved in `/tmp` folder with a unique name. + +``` +$ exit +exit +Recording ended, SVG animation is /tmp/termtosvg_5waorper.svg +``` + +We can open the SVG file output with help of any web browser. + +``` +$ firefox /tmp/termtosvg_5waorper.svg +``` + +![][15] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/termtosvg-record-your-terminal-sessions-as-svg-animations-in-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/script-command-record-save-your-terminal-session-activity-linux/ +[2]: https://www.2daygeek.com/terminalizer-a-tool-to-record-your-terminal-and-generate-animated-gif-images/ +[3]: https://www.2daygeek.com/category/gif-recorder/ +[4]: https://www.2daygeek.com/gifine-create-animated-gif-vedio-recorder-linux-mint-debian-ubuntu/ +[5]: https://www.2daygeek.com/kgif-create-animated-gif-file-active-window-screen-recorder-capture-arch-linux-mint-fedora-ubuntu-debian-opensuse-centos/ +[6]: https://www.2daygeek.com/peek-create-animated-gif-screen-recorder-capture-arch-linux-mint-fedora-ubuntu/ +[7]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[11]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[12]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ +[13]: https://www.2daygeek.com/install-pip-manage-python-packages-linux/ +[14]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[15]: https://www.2daygeek.com/wp-content/uploads/2018/12/Termtosvg-Record-Your-Terminal-Sessions-As-SVG-Animations-In-Linux-1.gif From 72cac1ddd191b5564b8b85c744755bdaabb6bc72 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 11:58:26 +0800 Subject: [PATCH 32/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Let=20your=20Linux?= =?UTF-8?q?=20terminal=20speak=20its=20mind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Let your Linux terminal speak its mind.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20181220 Let your Linux terminal speak its mind.md diff --git a/sources/tech/20181220 Let your Linux terminal speak its mind.md b/sources/tech/20181220 Let your Linux terminal speak its mind.md new file mode 100644 index 0000000000..7f237c0962 --- /dev/null +++ b/sources/tech/20181220 Let your Linux terminal speak its mind.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Let your Linux terminal speak its mind) +[#]: via: (https://opensource.com/article/18/12/linux-toy-espeak) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Let your Linux terminal speak its mind +====== +eSpeak is an open source text-to-speech synthesizer that can be invoked from the Linux command line. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cava.png?itok=4EWYL8uZ) + +Greetings from another day in our 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +We hope that even if you've seen some of these before, there will be something new for everybody in our series. + +Some of you may be too young to remember, but before there was Alexa, Siri, or the Google Assistant, computers still had voices. + +Many of us will never forget HAL 9000 from [2001: A Space Odessey][1] helpfully conversing with the crew (sorry, Dave). But between 1960s science fiction and today, there was a whole generation of speaking computers. Some of them great, most of them, not so great. + +One of my favorites is the open source project [eSpeak][2]. It's available in many forms, including a library version you can use to include speech technology in your own project, but it also coms as a command-line program that you can install and use easily. In my distribution, this was as simple as: + +``` +$ sudo dnf install espeak +``` + +Invoking eSpeak then can be invoked either interactively, or by piping text to it using the output of another program or a simple echo command. There are a number of [voice files][3] available for eSpeak, and if you're especially bored over the holidays, you could even create your own. + +A fork of eSpeak called eSpeak NG ("Next Generation") was created in 2015 from some developers who wanted to continue development of the otherwise lightly-updated eSpeak. eSpeak is made available as open source under a GPL version 3 license, and you can find out more about the project and download the source code [on SourceForge][2]. + +I'll also throw in a bonus toy today, [cava][4]. Because I've been eager to give each of these articles a unique screenshot as the lead image, and today's toy outputs sound rather than something visual, I needed to find something to fill the space. Short for "console-based audio visualizer for ALSA" (although it supports more than just ALSA now), cava is a nice MIT-licensed terminal audio visualization tool that's fun to watch. Below, is a visualization of eSpeak's output of the following: + +``` +$ echo "Rudolph, the red-nosed reindeer, had a very shiny nose." | espeak +``` + +![](https://opensource.com/sites/default/files/uploads/linux-toy-cava.gif) + +Do you have a favorite command-line toy that you we should have included? Our calendar is basically set for the remainder of the series, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Solve a puzzle at the Linux command line with nudoku][5], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-espeak + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/2001:_A_Space_Odyssey_(film) +[2]: http://espeak.sourceforge.net/ +[3]: http://espeak.sourceforge.net/voices.html +[4]: https://github.com/karlstav/cava +[5]: https://opensource.com/article/18/12/linux-toy-nudoku From c3e4b8640c490d562dadc579d7f0b6430156a967 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:04:58 +0800 Subject: [PATCH 33/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Head=20to=20the=20a?= =?UTF-8?q?rcade=20in=20your=20Linux=20terminal=20with=20this=20Pac-man=20?= =?UTF-8?q?clone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Linux terminal with this Pac-man clone.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/tech/20181215 Head to the arcade in your Linux terminal with this Pac-man clone.md diff --git a/sources/tech/20181215 Head to the arcade in your Linux terminal with this Pac-man clone.md b/sources/tech/20181215 Head to the arcade in your Linux terminal with this Pac-man clone.md new file mode 100644 index 0000000000..3bd36352a4 --- /dev/null +++ b/sources/tech/20181215 Head to the arcade in your Linux terminal with this Pac-man clone.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Head to the arcade in your Linux terminal with this Pac-man clone) +[#]: via: (https://opensource.com/article/18/12/linux-toy-myman) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Head to the arcade in your Linux terminal with this Pac-man clone +====== +Want to recreate the magic of your favorite arcade game? Today's command-line toy will transport you back in time. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-myman.png?itok=9j1DFgH0) + +Welcome back to another day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what command-line toys are all about. Basically, they're games and simple diversions that help you have fun at the terminal. + +Some are new, and some are old classics. We hope you enjoy. + +Today's toy, MyMan, is a fun clone of the classic arcade game [Pac-Man][1]. (You didn't think this was going to be about the [similarly-named][2] Linux package manager, did you?) If you're anything like me, you spent more than your fair share of quarters trying to hit a high score Pac-Man back in the day, and still give it a go whenever you get a chance. + +MyMan isn't the only Pac-Man clone for the Linux terminal, but it's the one I chose to include because 1) I like its visual style, which rings true to the original and 2) it's conveniently packaged for my Linux distribution so it was an easy install. But you should check out your other options as well. Here's [another one][3] that looks like it may be promising, but I haven't tried it. + +Since MyMan was packaged for Fedora, installation was as simple as: + +``` +$ dnf install myman +``` + +MyMan is made available under an MIT license and you can check out the source code on [SourceForge][4]. +![](https://opensource.com/sites/default/files/uploads/linux-toy-myman-animated.gif) +Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [The Linux terminal is no one-trick pony][5], and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-myman + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Pac-Man +[2]: https://wiki.archlinux.org/index.php/pacman +[3]: https://github.com/YoctoForBeaglebone/pacman4console +[4]: https://myman.sourceforge.io/ +[5]: https://opensource.com/article/18/12/linux-toy-ponysay From d2f845b4078949550748fcb3cfedfe4d8c7989f8 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:08:07 +0800 Subject: [PATCH 34/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20The=20Linux=20termi?= =?UTF-8?q?nal=20is=20no=20one-trick=20pony?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...The Linux terminal is no one-trick pony.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20181214 The Linux terminal is no one-trick pony.md diff --git a/sources/tech/20181214 The Linux terminal is no one-trick pony.md b/sources/tech/20181214 The Linux terminal is no one-trick pony.md new file mode 100644 index 0000000000..28964b249c --- /dev/null +++ b/sources/tech/20181214 The Linux terminal is no one-trick pony.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Linux terminal is no one-trick pony) +[#]: via: (https://opensource.com/article/18/12/linux-toy-ponysay) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +The Linux terminal is no one-trick pony +====== +Bring the magic of My Little Pony to your Linux command line. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-ponysay.png?itok=ehl6pTr_) + +Welcome to another day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Reader [Lori][1] made the suggestion of today's toy in a comment on my previous article on [cowsay][2]: + +"Hmmm, I've been playing with something called ponysay which seems to be a full-color variant on your cowsay." + +Intrigued, I had to check it out, and I was not disappointed with what I found. + +In a nutshell, **[ponysay][3]** is exactly that: a rewrite of **cowsay** that includes many full-color characters from [My Little Pony][4], that you can use to output phrases at the Linux command line. It's actually a really well-done project, that features over 400 characters and character combinations, and is incredibly well documented in a [78-page PDF][5] covering full usage. + +To install **ponysay** , you'll want to check out the project [README][6] to select the installation method that works best for your distribution and situation. Since ponysay didn't appear to be packaged for my distribution, Fedora, I opted to try out the Docker container image, but do what works best for you; installation from source may also work for you. + +I was curious to try out [**podman**][7] as a drop-in replacement for **docker** for a casual container users, and for me at least, it just worked! + +``` +$ podman run -ti --rm mpepping/ponysay 'Ponytastic' +``` + +The outputs are amazing, and I challenge you to try it out and let me know your favorite. Here was one of mine: + +![](https://opensource.com/sites/default/files/uploads/linux-toy-ponysay-output.png) + +It's developers chose to write the code in [Pony][8]! (Update: Sadly, I was wrong about this. It's written in Python, though GitHub believes it to be Pony because of the file extensions.) Ponysay is licensed under the GPL version 3, and you can pick up its source code [on GitHub][3]. + +Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [Relax by the fire at your Linux terminal][9], and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-ponysay + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/users/n8chz +[2]: https://opensource.com/article/18/12/linux-toy-cowsay +[3]: https://github.com/erkin/ponysay +[4]: https://en.wikipedia.org/wiki/My_Little_Pony +[5]: https://github.com/erkin/ponysay/blob/master/ponysay.pdf?raw=true +[6]: https://github.com/erkin/ponysay/blob/master/README.md +[7]: https://opensource.com/article/18/10/podman-more-secure-way-run-containers +[8]: https://opensource.com/article/18/5/pony +[9]: https://opensource.com/article/18/12/linux-toy-aafire From f58b4fd6bb05818338e59a0ed222dcab7d49a194 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:12:37 +0800 Subject: [PATCH 35/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Relax=20by=20the=20?= =?UTF-8?q?fire=20at=20your=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...elax by the fire at your Linux terminal.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sources/tech/20181213 Relax by the fire at your Linux terminal.md diff --git a/sources/tech/20181213 Relax by the fire at your Linux terminal.md b/sources/tech/20181213 Relax by the fire at your Linux terminal.md new file mode 100644 index 0000000000..f9a53fc4c4 --- /dev/null +++ b/sources/tech/20181213 Relax by the fire at your Linux terminal.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Relax by the fire at your Linux terminal) +[#]: via: (https://opensource.com/article/18/12/linux-toy-aafire) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Relax by the fire at your Linux terminal +====== +Chestnuts roasting on an open command prompt? Why not, with this fun Linux toy. + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-aafire.png?itok=pAttiVvG) + +Welcome back. Here we are, just past the halfway mark at day 13 of our 24 days of Linux command-line toys. If this is your first visit to the series, see the link to the previous article at the bottom of this one, and take a look back to learn what it's all about. In short, our command-line toys are anything that's a fun diversion at the terminal. + +Maybe some are familiar, and some aren't. Either way, we hope you have fun. + +If you're in the northern hemisphere outside of the tropics, perhaps winter is starting to rear its frigid face outside. At least it is where I live. And some I'd love nothing more than to curl up by the fire with a cup of tea and my favorite book (or a digital equivalent). + +The bad news is my house lacks a fireplace. The good news is that I can still pretend, thanks to the Linux terminal and today's command-line toy, **aafire**. + +On my system, I found **aafire** packed with **aalib** , a delightful library for converting visual images into the style of ASCII art and making it available at your terminal (or elsewhere). **aalib** enables all sorts of fun graphics at the Linux terminal, so we may revisit a toy or two that make use of it before the end of our series. On Fedora, this meant installation was as simple as: + +``` +$ sudo dnf install aalib +``` + +Then, it was simple to launch with the **aafire** command. By default, **aalib** attempted to draw to my GUI, so I had to manually override it to keep my fire in the terminal (this is a command-line series, after all). Fortunately, it comes with a [curses][1] driver, so this meant I just had to run the following to get my fire going: + +``` +$ aafire -driver curses +``` +![](https://opensource.com/sites/default/files/uploads/linux-toy-aafire-animated.gif) +You can find out more about the **aa-lib** library and download the source on [Sourceforge][2], under an LGPLv2 license. + +Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end. + +Check out yesterday's toy, [Patch into The Matrix at the Linux command line][3] , and check back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-aafire + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Curses_(programming_library) +[2]: http://aa-project.sourceforge.net/aalib/ +[3]: https://opensource.com/article/18/12/linux-toy-cmatrix From ffdf4eb68ae6fed5fd3ec6a83c4dae451d764ead Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:13:29 +0800 Subject: [PATCH 36/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Solve=20a=20puzzle?= =?UTF-8?q?=20at=20the=20Linux=20command=20line=20with=20nudoku?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e at the Linux command line with nudoku.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sources/tech/20181219 Solve a puzzle at the Linux command line with nudoku.md diff --git a/sources/tech/20181219 Solve a puzzle at the Linux command line with nudoku.md b/sources/tech/20181219 Solve a puzzle at the Linux command line with nudoku.md new file mode 100644 index 0000000000..7822a0cb98 --- /dev/null +++ b/sources/tech/20181219 Solve a puzzle at the Linux command line with nudoku.md @@ -0,0 +1,54 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Solve a puzzle at the Linux command line with nudoku) +[#]: via: (https://opensource.com/article/18/12/linux-toy-nudoku) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Solve a puzzle at the Linux command line with nudoku +====== +Sudokus are simple logic games that can be enjoyed just about anywhere, including in your Linux terminal. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-nudoku.png?itok=OS2o4Rot) + +Welcome back to another installment in our 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Every year for Christmas, my mother-in-law gives my wife a Sudoku calendar. It sits on our coffee table for the year to follow. Each day is a separate sheet (except for Saturday and Sunday, that are combined onto one page), with the idea being that you have a new puzzle every day while also having a functioning calendar. + +The problem, in practice, is that it's a great pad of puzzles but not a great calendar because it turns out some days are harder than others and we just don't get through them at the necessary rate of one a day. Then, we may have a week's worth that gets batched on a lazy Sunday. + +Since I've already given you a [calendar][1] as a part of this series, I figure it's only fair to give you a Sudoku puzzle as well, except our command-line versions are decoupled so there's no pressure to complete exactly one a day. + +I found **nudoku** in my default repositories on Fedora, so installing it was as simple as: + +``` +$ sudo dnf install nudoku +``` + +Once installed, just invoke **nudoku** by name to launch it, and it should be fairly self-explanatory from there. If you've never played Sudoku before, it's fairly simple: You need to make sure that each row, each column, and each of the nine 3x3 squares that make up the large square each have one of every digit, 1-9. + +You can find **nudoku** 's c source code [on GitHub][2] under a GPLv3 license. +![](https://opensource.com/sites/default/files/uploads/linux-toy-nudoku-animated.gif) +Do you have a favorite command-line toy that you we should have included? Our calendar is basically set for the remainder of the series, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Use your Linux terminal to celebrate a banner][3] [year][3], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-nudoku + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/article/18/12/linux-toy-cal +[2]: https://github.com/jubalh/nudoku +[3]: https://opensource.com/article/18/12/linux-toy-figlet From 10c05348c60c871ebdbf8ecd0f7148325613f0dc Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:16:37 +0800 Subject: [PATCH 37/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Use=20your=20Linux?= =?UTF-8?q?=20terminal=20to=20celebrate=20a=20banner=20year?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nux terminal to celebrate a banner year.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20181218 Use your Linux terminal to celebrate a banner year.md diff --git a/sources/tech/20181218 Use your Linux terminal to celebrate a banner year.md b/sources/tech/20181218 Use your Linux terminal to celebrate a banner year.md new file mode 100644 index 0000000000..da3f36b00f --- /dev/null +++ b/sources/tech/20181218 Use your Linux terminal to celebrate a banner year.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use your Linux terminal to celebrate a banner year) +[#]: via: (https://opensource.com/article/18/12/linux-toy-figlet) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Use your Linux terminal to celebrate a banner year +====== +Need make sure your command is heard? Pipe it to a banner and it won't be missed. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-figlet.png?itok=o4XmTL-b) + + +Hello again for another installment in our 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Today's toy if **figlet** , a utility for printing text in banner form across your Linux terminal. + +You'll likely find **figlet** packaged in your standard repositories. For me on Fedora, this meant installation was as simple as: + +``` +$ sudo dnf install figlet +``` + +After that, simply use the program's name to invoke it. You can either use it interactively, or, pipe some text to it, as below: + +``` +echo "Hello world" | figlet + _   _      _ _                            _     _ +| | | | ___| | | ___   __      _____  _ __| | __| | +| |_| |/ _ \ | |/ _ \  \ \ /\ / / _ \| '__| |/ _` | +|  _  |  __/ | | (_) |  \ V  V / (_) | |  | | (_| | +|_| |_|\___|_|_|\___/    \_/\_/ \___/|_|  |_|\__,_| +``` + +There are a number of different font options available for **figlet**. To see the options available to you, try the command **showfigfonts**. For me, this displayed over a dozen. I've copied out a few of my favorites below. + +``` +block : +                                            +_|        _|                      _|         +_|_|_|    _|    _|_|      _|_|_|  _|  _|     +_|    _|  _|  _|    _|  _|        _|_|       +_|    _|  _|  _|    _|  _|        _|  _|     +_|_|_|    _|    _|_|      _|_|_|  _|    _|   + + +bubble : +  _   _   _   _   _   _   + / \ / \ / \ / \ / \ / \ +( b | u | b | b | l | e ) + \_/ \_/ \_/ \_/ \_/ \_/ + + +lean : +                                      +    _/                               +   _/    _/_/      _/_/_/  _/_/_/     +  _/  _/_/_/_/  _/    _/  _/    _/   + _/  _/        _/    _/  _/    _/     +_/    _/_/_/    _/_/_/  _/    _/   + + +script : +                          +               o           + ,   __   ,_        _ _|_ +/ \_/    /  |  |  |/ \_|   + \/ \___/   |_/|_/|__/ |_/ +                 /|       +                 \|       +``` + +You can find out more about **figlet** on the project's [homepage][1]. The version I downloaded was made available as open source under an MIT license. + +You'll find that **figlet** isn't the only banner-printer available for the Linux terminal. Another option that you may choose to check out is [toilet][2], which comes with its own set of ASCII-art style printing options. + +Do you have a favorite command-line toy that you we should have included? Our calendar is basically set for the remainder of the series, but we'd still love to feature some cool command-line toys in the new year. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Take a swim at your Linux terminal with asciiquarium][3], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-figlet + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: http://www.figlet.org/ +[2]: http://caca.zoy.org/wiki/toilet +[3]: https://opensource.com/article/18/12/linux-toy-asciiquarium From 338b81eae6b865eda25a22f006d52263a63f369c Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:17:50 +0800 Subject: [PATCH 38/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Take=20a=20swim=20a?= =?UTF-8?q?t=20your=20Linux=20terminal=20with=20asciiquarium?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t your Linux terminal with asciiquarium.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md diff --git a/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md b/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md new file mode 100644 index 0000000000..d8253849ea --- /dev/null +++ b/sources/tech/20181217 Take a swim at your Linux terminal with asciiquarium.md @@ -0,0 +1,48 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Take a swim at your Linux terminal with asciiquarium) +[#]: via: (https://opensource.com/article/18/12/linux-toy-asciiquarium) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Take a swim at your Linux terminal with asciiquarium +====== +Darling it's better, when your command line is wetter, thanks to ASCII. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-asciiquarium.png?itok=ZhJ9P2Ft) + +We're now nearing the end of our 24-day-long Linux command-line toys advent calendar. Just one week left after today! If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Today's selection is a fishy one. Say hello to **asciiquarium** , an undersea adventure for your terminal. I found **asciiquarium** in my Fedora repositories, so installing it was as simple as: + +``` +$ sudo dnf install asciiquarium +``` + +If you're running a different distribution, chances are it's packaged for you too. Just run **asciiquarium** at your terminal to feel happy as a clam. The project has been translated outside of the terminal as well, with screensavers of all of the aquatic pals being made for several non-Linux operating systems, and even an Android live wallpaper version is floating around out there. + +Visit the **asciiquarium** [homepage][1] for more information or to download the Perl source code. The project is open source under a GPL version 2 license. And if you want to learn more about how open source, open data, and open science are making a difference in the actual oceans, take a moment to go learn about the [Ocean Health Index][2]. +![](https://opensource.com/sites/default/files/uploads/linux-toy-asciiquarium-animated.gif) +Do you have a favorite command-line toy that you think I ought to profile? We're running out of time, but I'd still love to hear your suggestions. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Schedule a visit with the Emacs psychiatrist][3], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-asciiquarium + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://robobunny.com/projects/asciiquarium/html/ +[2]: https://opensource.com/article/18/12/protecting-world-oceans +[3]: https://opensource.com/article/18/12/linux-toy-eliza From e766f5a3aa5578ff038e74d8010e6489efe83367 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:18:48 +0800 Subject: [PATCH 39/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Schedule=20a=20visi?= =?UTF-8?q?t=20with=20the=20Emacs=20psychiatrist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ule a visit with the Emacs psychiatrist.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md diff --git a/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md b/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md new file mode 100644 index 0000000000..6d72cda348 --- /dev/null +++ b/sources/tech/20181216 Schedule a visit with the Emacs psychiatrist.md @@ -0,0 +1,62 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Schedule a visit with the Emacs psychiatrist) +[#]: via: (https://opensource.com/article/18/12/linux-toy-eliza) +[#]: author: (Jason Baker https://opensource.com/users/jason-baker) + +Schedule a visit with the Emacs psychiatrist +====== +Eliza is a natural language processing chatbot hidden inside of one of Linux's most popular text editors. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-eliza.png?itok=3ioiBik_) + +Welcome to another day of the 24-day-long Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal. + +Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. + +Today's selection is a hidden gem inside of Emacs: Eliza, the Rogerian psychotherapist, a terminal toy ready to listen to everything you have to say. + +A brief aside: While this toy is amusing, your health is no laughing matter. Please take care of yourself this holiday season, physically and mentally, and if stress and anxiety from the holidays are having a negative impact on your wellbeing, please consider seeing a professional for guidance. It really can help. + +To launch [Eliza][1], first, you'll need to launch Emacs. There's a good chance Emacs is already installed on your system, but if it's not, it's almost certainly in your default repositories. + +Since I've been pretty fastidious about keeping this series in the terminal, launch Emacs with the **-nw** flag to keep in within your terminal emulator. + +``` +$ emacs -nw +``` + +Inside of Emacs, type M-x doctor to launch Eliza. For those of you like me from a Vim background who have no idea what this means, just hit escape, type x and then type doctor. Then, share all of your holiday frustrations. + +Eliza goes way back, all the way to the mid-1960s a the MIT Artificial Intelligence Lab. [Wikipedia][2] has a rather fascinating look at her history. + +Eliza isn't the only amusement inside of Emacs. Check out the [manual][3] for a whole list of fun toys. + + +![Linux toy: eliza animated][5] + +Do you have a favorite command-line toy that you think I ought to profile? We're running out of time, but I'd still love to hear your suggestions. Let me know in the comments below, and I'll check it out. And let me know what you thought of today's amusement. + +Be sure to check out yesterday's toy, [Head to the arcade in your Linux terminal with this Pac-man clone][6], and come back tomorrow for another! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/linux-toy-eliza + +作者:[Jason Baker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jason-baker +[b]: https://github.com/lujun9972 +[1]: https://www.emacswiki.org/emacs/EmacsDoctor +[2]: https://en.wikipedia.org/wiki/ELIZA +[3]: https://www.gnu.org/software/emacs/manual/html_node/emacs/Amusements.html +[4]: /file/417326 +[5]: https://opensource.com/sites/default/files/uploads/linux-toy-eliza-animated.gif (Linux toy: eliza animated) +[6]: https://opensource.com/article/18/12/linux-toy-myman From 359ed1745fb21edfd6753183db5196e6dd5ff079 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 12:58:39 +0800 Subject: [PATCH 40/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20open=20s?= =?UTF-8?q?ource=20your=20Python=20library?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... How to open source your Python library.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20181219 How to open source your Python library.md diff --git a/sources/tech/20181219 How to open source your Python library.md b/sources/tech/20181219 How to open source your Python library.md new file mode 100644 index 0000000000..cf59688484 --- /dev/null +++ b/sources/tech/20181219 How to open source your Python library.md @@ -0,0 +1,114 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to open source your Python library) +[#]: via: (https://opensource.com/article/18/12/tips-open-sourcing-python-libraries) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +How to open source your Python library +====== +This 12-step checklist will ensure a successful launch. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx) + +You wrote a Python library. I'm sure it's amazing! Wouldn't it be neat if it was easy for people to use it? Here is a checklist of things to think about and concrete steps to take when open sourcing your Python library. + +### 1\. Source + +Put the code up on [GitHub][1], where most open source projects happen and where it is easiest for people to submit pull requests. + +### 2\. License + +Choose an open source license. A good, permissive default is the [MIT License][2]. If you have specific requirements, Creative Common's [Choose a License][3] can guide you through the alternatives. Most importantly, there are three rules to keep in mind when choosing a license: + + * Don't create your own license. + * Don't create your own license. + * Don't create your own license. + + + +### 3\. README + +Put a file called README.rst, formatted with ReStructured Text, at the top of your tree. + +GitHub will render ReStructured Text just as well as Markdown, and ReST plays better with Python's documentation ecosystem. + +### 4\. Tests + +Write tests. This is not useful just for you: it is useful for people who want to make patches that avoid breaking related functionality. + +Tests help collaborators collaborate. + +Usually, it is best if they are runnable with [**pytest**][4]. There are other test runners—but very little reason to use them. + +### 5\. Style + +Enforce style with a linter: PyLint, Flake8, or Black with **\--check**. Unless you use Black, make sure to specify configuration options in a file checked into source control. + +### 6\. API documentation + +Use docstrings to document modules, functions, classes, and methods. + +There are a few styles you can use. I prefer the [Google-style docstrings][5], but [ReST docstrings][6] are an option. + +Both Google-style and ReST docstrings can be processed by Sphinx to integrate API documentation with prose documentation. + +### 7\. Prose documentation + +Use [Sphinx][7]. (Read [our article on it][8].) A tutorial is useful, but it is also important to specify what this thing is, what it is good for, what it is bad for, and any special considerations. + +### 8\. Building + +Use **tox** or **nox** to automatically run your tests and linter and build the documentation. These tools support a "dependency matrix." These matrices tend to explode fast, but try to test against a reasonable sample, such as Python versions, versions of dependencies, and possibly optional dependencies you install. + +### 9\. Packaging + +Use [setuptools][9]. Write a **setup.py** and a **setup.cfg**. If you support both Python 2 and 3, specify universal wheels in the **setup.cfg**. + +One thing **tox** or **nox** should do is build a wheel and run tests against the installed wheel. + +Avoid C extensions. If you absolutely need them for performance or binding reasons, put them in a separate package. Properly packaging C extensions deserves its own post. There are a lot of gotchas! + +### 10\. Continuous integration + +### 11\. Versions + +Use a public continuous integration runner. [TravisCI][10] and [CircleCI][11] offer free tiers for open source projects. Configure GitHub or other repo to require passing checks before merging pull requests, and you'll never have to worry about telling people to fix their tests or their style in code reviews. + +Use either [SemVer][12] or [CalVer][13]. There are many tools to help manage versions: [incremental][14], [bumpversion][15], and [setuptools_scm][16] are all packages on PyPI that help manage versions for you. + +### 12\. Release + +Release by running **tox** or **nox** and using **twine** to upload the artifacts to PyPI. You can do a "test upload" by running [DevPI][17]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/tips-open-sourcing-python-libraries + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://github.com/ +[2]: https://en.wikipedia.org/wiki/MIT_License +[3]: https://choosealicense.com/ +[4]: https://docs.pytest.org/en/latest/ +[5]: https://github.com/google/styleguide/blob/gh-pages/pyguide.md +[6]: https://www.python.org/dev/peps/pep-0287/ +[7]: http://www.sphinx-doc.org/en/master/ +[8]: https://opensource.com/article/18/11/building-custom-workflows-sphinx +[9]: https://pypi.org/project/setuptools/ +[10]: https://travis-ci.org/ +[11]: https://circleci.com/ +[12]: https://semver.org/ +[13]: https://calver.org/ +[14]: https://pypi.org/project/incremental/ +[15]: https://pypi.org/project/bumpversion/ +[16]: https://pypi.org/project/setuptools_scm/ +[17]: https://opensource.com/article/18/7/setting-devpi From e9e3ac094bea90525634b4f08b161462d1006769 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Fri, 21 Dec 2018 13:21:30 +0800 Subject: [PATCH 41/69] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20180604 4 Firefox extensions worth checking out.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180604 4 Firefox extensions worth checking out.md b/sources/tech/20180604 4 Firefox extensions worth checking out.md index 2091afe6fe..2e6a22274b 100644 --- a/sources/tech/20180604 4 Firefox extensions worth checking out.md +++ b/sources/tech/20180604 4 Firefox extensions worth checking out.md @@ -1,3 +1,4 @@ +translated by lixinyuxx 4 Firefox extensions worth checking out ====== From c4788d46b1fc35b33b06c2397da23534f0b3502a Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Fri, 21 Dec 2018 14:17:20 +0800 Subject: [PATCH 42/69] Update 20180419 5 guiding principles you should know before you design a microservice.md --- ...rinciples you should know before you design a microservice.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20180419 5 guiding principles you should know before you design a microservice.md b/sources/talk/20180419 5 guiding principles you should know before you design a microservice.md index a74dbd26af..fae228867e 100644 --- a/sources/talk/20180419 5 guiding principles you should know before you design a microservice.md +++ b/sources/talk/20180419 5 guiding principles you should know before you design a microservice.md @@ -1,3 +1,4 @@ +translated by lixinyuxx 5 guiding principles you should know before you design a microservice ====== From 31ee603fe7cf978b0ea2410df44ea905197c2518 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Fri, 21 Dec 2018 14:20:51 +0800 Subject: [PATCH 43/69] Update 20180625 The life cycle of a software bug.md --- sources/tech/20180625 The life cycle of a software bug.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180625 The life cycle of a software bug.md b/sources/tech/20180625 The life cycle of a software bug.md index cacceb7a15..0f45d7a355 100644 --- a/sources/tech/20180625 The life cycle of a software bug.md +++ b/sources/tech/20180625 The life cycle of a software bug.md @@ -1,3 +1,4 @@ +translated by lixinyuxx The life cycle of a software bug ====== From aa63af0092018b6e5e0c14a259c6985907039a05 Mon Sep 17 00:00:00 2001 From: lixinyuxx <524187166@qq.com> Date: Fri, 21 Dec 2018 14:24:38 +0800 Subject: [PATCH 44/69] Update 20180319 6 common questions about agile development practices for teams.md --- ...mmon questions about agile development practices for teams.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/talk/20180319 6 common questions about agile development practices for teams.md b/sources/talk/20180319 6 common questions about agile development practices for teams.md index 0de7cda81c..ef472374b4 100644 --- a/sources/talk/20180319 6 common questions about agile development practices for teams.md +++ b/sources/talk/20180319 6 common questions about agile development practices for teams.md @@ -1,3 +1,4 @@ +translated by lixinyuxx 6 common questions about agile development practices for teams ====== From ae65416d979ac55a7820ed6f6b5e8c27e68afb78 Mon Sep 17 00:00:00 2001 From: jlztan Date: Fri, 21 Dec 2018 16:04:26 +0800 Subject: [PATCH 45/69] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...at is PPA- Everything You Need to Know About PPA in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md b/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md index 194dc31ef3..d0132aebf8 100644 --- a/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md +++ b/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (jlztan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4219fe486ee2ab37f312740be93e7373ec5ee6bc Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:18:33 +0800 Subject: [PATCH 46/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Tips=20for=20using?= =?UTF-8?q?=20Flood=20Element=20for=20performance=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g Flood Element for performance testing.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20181214 Tips for using Flood Element for performance testing.md diff --git a/sources/tech/20181214 Tips for using Flood Element for performance testing.md b/sources/tech/20181214 Tips for using Flood Element for performance testing.md new file mode 100644 index 0000000000..90994b0724 --- /dev/null +++ b/sources/tech/20181214 Tips for using Flood Element for performance testing.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tips for using Flood Element for performance testing) +[#]: via: (https://opensource.com/article/18/12/tips-flood-element-testing) +[#]: author: (Nicole van der Hoeven https://opensource.com/users/nicolevanderhoeven) + +Tips for using Flood Element for performance testing +====== +Get started with this powerful, intuitive load testing tool. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_sysadmin_cloud.png?itok=sUciG0Cn) + +In case you missed it, there’s a new performance test tool on the block: [Flood Element][1]. It’s a scalable, browser-based tool that allows you to write scripts in JavaScript that interact with web pages like a real user would. + +Browser Level Users is a [newer approach to load testing][2] that overcomes many of the common challenges we hear about traditional methods of testing. It offers: + + * Scripting that is akin to common functional tools like Selenium and easier to learn + * More realistic results that are based on true browser performance rather than API response + * The ability to test against all components of your web app, including things like JavaScript that are rendered via the browser + + + +Given the above benefits, it’s a no-brainer to check out Flood Element for your web load testing, especially if you have struggled with existing tools like JMeter or HP LoadRunner. + +Pairing Element with [Flood][3] turns it into a pretty powerful load test tool. We have a [great guide here][4] that you can follow if you’d like to get started. I’ve been using and testing Element for several months now, and I’d like to share some tips I’ve learned along the way. + +### Initializing your script + +You can always start from scratch, but the quickest way to get started is to type `element init myfirstelementtest` from your terminal, filling in your preferred project name. + +You’ll then be asked to type the title of your test as well as the URL you’d like to script against. After a minute, you’ll see that a new directory has been created: + +![](https://opensource.com/sites/default/files/uploads/image_1_-_new_directory.png) + +Element will automatically create a file called **test.ts**. This file contains the skeleton of a script, along with some sample code to help you find a button and then click on it. But before you open it, let’s move on to… + +### Choosing the right text editor + +Scripting in Element is already pretty simple, but two things that help are syntax highlighting and code completion. Syntax highlighting will greatly improve the experience of learning a new test tool like Element, and code completion will make your scripting lightning-fast as you become more experienced. My text editor of choice is [Visual Studio Code][5], which has both of those features. It’s slick and clean, and it does the job. + +Syntax highlighting is when the text editor intelligently changes the font color of your code according to its role in the programming language you’re using. Here’s a screenshot of the **test.ts** file we generated earlier in VS Code to show you what I mean: + +![](https://opensource.com/sites/default/files/uploads/image_2_test.ts_.png) + +This makes it easier to make sense of the code at a glance: Comments are in green, values and labels are in orange, etc. + +Code completion is when you start to type something, and VS Code helpfully opens a context menu with suggestions for methods you can use. + +![][6] + +I love this because it means I don’t need to remember the exact name of the method. It also suggests names of variables you’ve already defined and highlights code that doesn’t make sense. This will help to make your tests more maintainable and readable for others, which is a great benefit as you look to scale your testing out in the future. + +![](https://opensource.com/sites/default/files/image-4-element-visible-copy.gif) + +### Taking screenshots + +One of the most powerful features of Element is its ability to take screenshots. I find it immensely useful when debugging because sometimes it’s just easier to see what’s going on visually. With protocol-based tools, debugging can be a much more involved and technical process. + +There are two ways to take screenshots in Element: + + 1. Add a setting to automatically take a screenshot when an error is encountered. You can do this by setting `screenshotOnFailure` to "true" in `TestSettings`: + + + +``` +export const settings: TestSettings = { +        device: Device.iPadLandscape, +        userAgent: 'flood-chrome-test', +        clearCache: true, +        disableCache: true, +        screenshotOnFailure: true, +} +``` + + 2. Explicitly take a screenshot at a particular point in the script. You can do this by adding + + + +``` +await browser.takeScreenshot() +``` + +to your code. + +### Viewing screenshots + +Once you’ve taken screenshots within your tests, you will probably want to view them and know that they will be stored for future safekeeping. Whether you are running your test locally on have uploaded it to Flood to run with increased concurrency, Flood Element has you covered. + +**Locally run tests** + +Screenshots will be saved as .jpg files in a timestamped folder corresponding to your run. It should look something like this: **…myfirstelementtest/tmp/element-results/test/2018-11-20T135700.595Z/flood/screenshots/**. The screenshots will be uniquely named so that new screenshots, even for the same step, don’t overwrite older ones. + +However, I rarely need to look up the screenshots in that folder because I prefer to see them in iTerm2 for MacOS. iTerm is an alternative to the terminal that works particularly well with Element. When you take a screenshot, iTerm actually shows it in-line: + +![](https://opensource.com/sites/default/files/uploads/image_5_iterm_inline.png) + +**Tests run in Flood** + +Running an Element script on Flood is ideal when you need larger concurrency. Rather than accessing your screenshot locally, Flood will centralize the images into your account, so the images remain even after the cloud load injectors are destroyed. You can get to the screenshot files by downloading Archived Results: + +![](https://opensource.com/sites/default/files/image_6_archived_results.png) + +You can also click on a step on the dashboard to see a filmstrip of your test: + +![](https://opensource.com/sites/default/files/uploads/image_7_filmstrip_view.png) + +### Using logs + +You may need to check out the logs for more technical debugging, especially when the screenshots don’t tell the whole story. Again, whether you are running your test locally or have uploaded it to Flood to run with increased concurrency, Flood Element has you covered. + +**Locally run tests** + +You can print to the console by typing, for example: `console.log('orderValues = ’ + orderValues)` + +This will print the value of the variable `orderValues` at that point in the script. You would see this in your terminal if you’re running Element locally. + +**Tests run in Flood** + +If you’re running the script on Flood, you can either download the log (in the same Archived Results zipped file mentioned earlier) or click on the Logs tab: + +![](https://opensource.com/sites/default/files/uploads/image_8_logs_tab.png) + +### Fun with flags + +Element comes with a few flags that give you more control over how the script is run locally. Here are a few of my favorites: + +**Headless flag** + +When in doubt, run Element in non-headless mode to see the script actually opening the web app on Chrome and interacting with the page. This is only possible locally, but there’s nothing like actually seeing for yourself what’s happening in real time instead of relying on screenshots and logs after the fact. To enable this mode, add the flag when running your test: + +``` +element run myfirstelementtest.ts --no-headless +``` + +**Watch flag** + +Element will automatically close the browser window when it encounters an error or finishes the iteration. Adding `--watch` will leave the browser window open and then monitor the script. As soon as the script is saved, it will automatically run it in the same window from the beginning. Simply add this flag like the above example: + +``` +--watch +``` + +**Dev tools flag** + +This opens a browser instance and runs the script with the Chrome Dev Tools open, allowing you to find locators for the next action you want to script. Simply add this flag as in the first example: + +``` +--dev-tools +``` + +For more flags, use `element run --help`. + +### Try Element + +You’ve just gotten a crash course on Flood Element and are ready to get started. [Download Element][1] to start writing functional test scripts and reusing them as load test scripts on Flood. If you don’t have a Flood account, you can easily sign up for a free trial [on the Flood website][7]. + +We’re proud to contribute to the open source community and can’t wait to have you try this new addition to the Flood line. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/tips-flood-element-testing + +作者:[Nicole van der Hoeven][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/nicolevanderhoeven +[b]: https://github.com/lujun9972 +[1]: https://element.flood.io/ +[2]: https://flood.io/blog/why-you-should-load-test-with-browsers/ +[3]: https://flood.io/ +[4]: https://help.flood.io/getting-started-with-load-testing/step-by-step-guide-flood-element +[5]: https://code.visualstudio.com/ +[6]: https://flood.io/wp-content/uploads/2018/11/vscode-codecompletion2.gif +[7]: https://flood.io/load-performance-testing-tool/free-load-testing-trial/ From cedb354f0f0a64212d1656705e6c1824d7e63683 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:19:41 +0800 Subject: [PATCH 47/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=208=20tips=20to=20hel?= =?UTF-8?q?p=20non-techies=20move=20to=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... tips to help non-techies move to Linux.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/talk/20181217 8 tips to help non-techies move to Linux.md diff --git a/sources/talk/20181217 8 tips to help non-techies move to Linux.md b/sources/talk/20181217 8 tips to help non-techies move to Linux.md new file mode 100644 index 0000000000..14a645e0a7 --- /dev/null +++ b/sources/talk/20181217 8 tips to help non-techies move to Linux.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 tips to help non-techies move to Linux) +[#]: via: (https://opensource.com/article/18/12/help-non-techies) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +8 tips to help non-techies move to Linux +====== +Help your friends dump their proprietary operating systems and make the move to open source. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_team_community_group.png?itok=Nc_lTsUK) + +Back in 2016, I took down the shingle for my technology coaching business. Permanently. Or so I thought. + +Over the last 10 months, a handful of friends and acquaintances have pulled me back into that realm. How? With their desire to dump That Other Operating System™ and move to Linux. + +This has been an interesting experience, in no small part because most of the people aren't at all technical. They know how to use a computer to do what they need to do. Beyond that, they're not interested in delving deeper. That said, they were (and are) attracted to Linux for a number of reasons—probably because I constantly prattle on about it. + +While bringing them to the Linux side of the computing world, I learned a few things about helping non-techies move to Linux. If someone asks you to help them make the jump to Linux, these eight tips can help you. + +### 1\. Be honest about Linux. + +Linux is great. It's not perfect, though. It can be perplexing and sometimes frustrating for new users. It's best to prepare the person you're helping with a short pep talk. + +What should you talk about? Briefly explain what Linux is and how it differs from other operating systems. Explain what you can and _can't_ do with it. Let them know some of the pain points they might encounter when using Linux daily. + +If you take a bit of time to [ease them into][1] Linux and open source, the switch won't be as jarring. + +### 2\. It's not about you. + +It's easy to fall into what I call the _power user fallacy_ : the idea that everyone uses technology the same way you do. That's rarely, if ever, the case. + +This isn't about you. It's not about your needs or how you use a computer. It's about the person you're helping's needs and intentions. Their needs, especially if they're not particularly technical, will be different from yours. + +It doesn't matter if Ubuntu or Elementary or Manjaro aren't your distros of choice. It doesn't matter if you turn your nose up at window managers like GNOME, KDE, or Pantheon in favor of i3 or Ratpoison. The person you're helping might think otherwise. + +Put your needs and prejudices aside and help them find the right Linux distribution for them. Find out what they use their computer for and tailor your recommendations for a distribution or three based on that. + +### 3\. Not everyone's a techie. + +And not everyone wants to be. Everyone I've helped move to Linux in the last 10 months has no interest in compiling kernels or code nor in editing and tweaking configuration files. Most of them will never crack open a terminal window. I don't expect them to be interested in doing any of that in the future, either. + +Guess what? There's nothing wrong with that. Maybe they won't _get the most out of_ Linux (whatever that means) by not embracing their inner geeks. Not everyone will want to take on challenges of, say, installing and configuring Slackware or Arch. They need something that will work out of the box. + +### 4\. Take stock of their hardware. + +In an ideal world, we'd all have tricked-out, high-powered laptops or desktops with everything maxed out. Sadly, that world doesn't exist. + +That probably includes the person you're helping move to Linux. They may have slightly (maybe more than slightly) older hardware that they're comfortable with and that works for them. Hardware that they might not be able to afford to upgrade or replace. + +Also, remember that not everyone needs a system for heavy-duty development or gaming or audio and video production. They just need a computer for browsing the web, editing photos, running personal productivity software, and the like. + +One person I recently helped adopt Linux had an Acer Aspire 1 laptop with 4GB of RAM and a 64GB SSD. That helped inform my recommendations, which revolved around a few lightweight Linux distributions. + +### 5\. Help them test-drive some distros. + +The [DistroWatch][2] database contains close to 900 Linux distributions. You should be able to find three to five Linux distributions to recommend. Make a short list of the distributions you think would be a good fit for them. Also, point them to reviews so they can get other perspectives on those distributions. + +When it comes time to take those Linux distributions for a spin, don't just hand someone a bunch of flash drives and walk away. You might be surprised to learn that most people have never run a live Linux distribution or installed an operating system. Any operating system. Beyond plugging the flash drives in, they probably won't know what to do. + +Instead, show them how to [create bootable flash drives][3] and set up their computer's BIOS to start from those drives. Then, let them spend some time running the distros off the flash drives. That will give them a rudimentary feel for the distros and their window managers' quirks. + +### 6\. Walk them through an installation. + +Running a live session with a flash drive tells someone only so much. They need to work with a Linux distribution for a couple or three weeks to really form an opinion of it and to understand its quirks and strengths. + +There's a myth that Linux is difficult to install. That might have been true back in the mid-1990s, but today most Linux distributions are easy to install. You follow a few graphical prompts and let the software do the rest. + +For someone who's never installed any operating system, installing Linux can be a bit daunting. They might not know what to choose when, say, they're asked which filesystem to use or whether or not to encrypt their hard disk. + +Guide them through at least one installation. While you should let them do most of the work, be there to answer questions. + +### 7\. Be prepared to do a couple of installs. + +As I mentioned a paragraph or two ago, using a Linux distribution for two weeks gives someone ample time to regularly interact with it and see if it can be their daily driver. It often works out. Sometimes, though, it doesn't. + +Remember the person with the Acer Aspire 1 laptop? She thought Xubuntu was the right distribution for her. After a few weeks of working with it, that wasn't the case. There wasn't a technical reason—Xubuntu ran smoothly on her laptop. It was just a matter of feel. Instead, she switched back to the first distro she test drove: [MX Linux][4]. She's been happily using MX ever since. + +### 8\. Teach them to fish. + +You can't always be there to be the guiding hand. Or to be the mechanic or plumber who can fix any problems the person encounters. You have a life, too. + +Once they've settled on a Linux distribution, explain that you'll offer a helping hand for two or three weeks. After that, they're on their own. Don't completely abandon them. Be around to help with big problems, but let them know they'll have to learn to do things for themselves. + +Introduce them to websites that can help them solve their problems. Point them to useful articles and books. Doing that will help make them more confident and competent users of Linux—and of computers and technology in general. + +### Final thoughts + +Helping someone move to Linux from another, more familiar operating system can be a challenge—a challenge for them and for you. If you take it slowly and follow the advice in this article, you can make the process smoother. + +Do you have other tips for helping a non-techie switch to Linux? Feel free to share them by leaving a comment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/help-non-techies + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/business/15/2/ato2014-lightning-talks-scott-nesbitt +[2]: https://distrowatch.com +[3]: https://opensource.com/article/18/7/getting-started-etcherio +[4]: https://opensource.com/article/18/2/mx-linux-17-distro-beginners From bb8278b5a0f8eb7b68e066c86a7d1a68467f51cc Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:21:18 +0800 Subject: [PATCH 48/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20The=20Rise=20and=20?= =?UTF-8?q?Demise=20of=20RSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20181218 The Rise and Demise of RSS.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/talk/20181218 The Rise and Demise of RSS.md diff --git a/sources/talk/20181218 The Rise and Demise of RSS.md b/sources/talk/20181218 The Rise and Demise of RSS.md new file mode 100644 index 0000000000..e260070c5c --- /dev/null +++ b/sources/talk/20181218 The Rise and Demise of RSS.md @@ -0,0 +1,146 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Rise and Demise of RSS) +[#]: via: (https://twobithistory.org/2018/12/18/rss.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +The Rise and Demise of RSS +====== + +This post was originally published on [September 16th, 2018][1]. What follows is a revision that includes additional information gleaned from interviews with Ramanathan Guha, Ian Davis, Dan Libby, and Kevin Werbach. + +About a decade ago, the average internet user might well have heard of RSS. Really Simple Syndication, or Rich Site Summary—what the acronym stands for depends on who you ask—is a standard that websites and podcasts can use to offer a feed of content to their users, one easily understood by lots of different computer programs. Today, though RSS continues to power many applications on the web, it has become, for most people, an obscure technology. + +The story of how this happened is really two stories. The first is a story about a broad vision for the web’s future that never quite came to fruition. The second is a story about how a collaborative effort to improve a popular standard devolved into one of the most contentious forks in the history of open-source software development. + +In the late 1990s, in the go-go years between Netscape’s IPO and the Dot-com crash, everyone could see that the web was going to be an even bigger deal than it already was, even if they didn’t know exactly how it was going to get there. One theory was that the web was about to be revolutionized by syndication. The web, originally built to enable a simple transaction between two parties—a client fetching a document from a single host server—would be broken open by new standards that could be used to repackage and redistribute entire websites through a variety of channels. Kevin Werbach, writing for Release 1.0, a newsletter influential among investors in the 1990s, predicted that syndication “would evolve into the core model for the Internet economy, allowing businesses and individuals to retain control over their online personae while enjoying the benefits of massive scale and scope.” + +He invited his readers to imagine a future in which fencing aficionados, rather than going directly to an “online sporting goods site” or “fencing equipment retailer,” could buy a new épée directly through e-commerce widgets embedded into their favorite website about fencing. Just like in the television world, where big networks syndicate their shows to smaller local stations, syndication on the web would allow businesses and publications to reach consumers through a multitude of intermediary sites. This would mean, as a corollary, that consumers would gain significant control over where and how they interacted with any given business or publication on the web. + +RSS was one of the standards that promised to deliver this syndicated future. To Werbach, RSS was “the leading example of a lightweight syndication protocol.” Another contemporaneous article called RSS the first protocol to realize the potential of XML. It was going to be a way for both users and content aggregators to create their own customized channels out of everything the web had to offer. And yet, two decades later, after the rise of social media and Google’s decision to shut down Google Reader, RSS appears to be [a slowly dying technology][2], now used chiefly by podcasters, programmers with tech blogs, and the occasional journalist. Though of course some people really do still rely on RSS readers, stubbornly adding an RSS feed to your blog, even in 2018, is a political statement. That little tangerine bubble has become a wistful symbol of defiance against a centralized web increasingly controlled by a handful of corporations, a web that hardly resembles the syndicated web of Werbach’s imagining. + +The future once looked so bright for RSS. What happened? Was its downfall inevitable, or was it precipitated by the bitter infighting that thwarted the development of a single RSS standard? + +### Muddied Water + +RSS was invented twice. This meant it never had an obvious owner, a state of affairs that spawned endless debate and acrimony. But it also suggests that RSS was an important idea whose time had come. + +In 1998, Netscape was struggling to envision a future for itself. Its flagship product, the Netscape Navigator web browser—once preferred by over 80 percent of web users—was quickly losing ground to Microsoft’s Internet Explorer. So Netscape decided to compete in a new arena. In May, a team was brought together to start work on what was known internally as “Project 60.” Two months later, Netscape announced “My Netscape,” a web portal that would fight it out with other portals like Yahoo, MSN, and Excite. + +The following year, in March, Netscape announced an addition to the My Netscape portal called the “My Netscape Network.” My Netscape users could now customize their My Netscape page so that it contained “channels” featuring the most recent headlines from sites around the web. As long as your favorite website published a special file in a format dictated by Netscape, you could add that website to your My Netscape page, typically by clicking an “Add Channel” button that participating websites were supposed to add to their interfaces. A little box containing a list of linked headlines would then appear. + +![A My Netscape Network Channel][3] A My Netscape Network channel for Mozilla.org, as it might look to users +about to add it to their My Netscape page. + +The special file that participating websites had to publish was an RSS file. In the My Netscape Network announcement, Netscape explained that RSS stood for “RDF Site Summary.” This was somewhat of a misnomer. RDF, or the Resource Description Framework, is basically a grammar for describing certain properties of arbitrary resources. (See [my article about the Semantic Web][4] if that sounds really exciting to you.) In 1999, a draft specification for RDF was being considered by the World Wide Web Consortium (W3C), the web’s main standards body. Though RSS was supposed to be based on RDF, the example RSS document Netscape actually released didn’t use any RDF tags at all. In a document that accompanied the Netscape RSS specification, Dan Libby, one of the specification’s authors, explained that “in this release of MNN, Netscape has intentionally limited the complexity of the RSS format.” The specification was given the 0.90 version number, the idea being that subsequent versions would bring RSS more in line with the W3C’s XML specification and the evolving draft of the RDF specification. + +RSS had been created by Libby and two other Netscape employees, Eckart Walther and Ramanathan Guha. According to an email to me from Guha, he and Walther cooked up RSS in the beginning with some input from Libby; after AOL bought Netscape in 1998, he and Walther left and it became Libby’s responsibility. Before Netscape, Guha had worked for Apple, where he came up with something called the Meta Content Framework. MCF was a format for representing metadata about anything from web pages to local files. Guha demonstrated its power by developing an application called [HotSauce][5] that visualized relationships between files as a network of nodes suspended in 3D space. Immediately after leaving Apple for Netscape, Guha worked with a Netscape consultant named Tim Bray, who in a post on his blog said that he and Guha eventually produced an XML-based version of MCF that in turn became the foundation for the W3C’s RDF draft. It’s no surprise, then, that Guha, Walther, and Libby were keen to build on Guha’s prior work and incorporate RDF into RSS. But Libby later wrote that the original vision for an RDF-based RSS was pared back because of time constraints and the perception that RDF was “‘too complex’ for the ‘average user.’” + +While Netscape was trying to win eyeballs in what became known as the “portal wars,” elsewhere on the web a new phenomenon known as “weblogging” was being pioneered. One of these pioneers was Dave Winer, CEO of a company called UserLand Software, which developed early content management systems that made blogging accessible to people without deep technical fluency. Winer ran his own blog, [Scripting News][6], which today is one of the oldest blogs on the internet. More than a year before Netscape announced My Netscape Network, on December 15, 1997, Winer published a post announcing that the blog would now be available in XML as well as HTML. + +Dave Winer’s XML format became known as the Scripting News format. It was supposedly similar to Microsoft’s Channel Definition Format (a “push technology” standard submitted to the W3C in March, 1997), but I haven’t been able to find a file in the original format to verify that claim. Like Netscape’s RSS, it structured the content of Winer’s blog so that it could be understood by other software applications. When Netscape released RSS 0.90, Winer and UserLand Software began to support both formats. But Winer believed that Netscape’s format was “woefully inadequate” and “missing the key thing web writers and readers need.” It could only represent a list of links, whereas the Scripting News format could represent a series of paragraphs, each containing one or more links. + +In June 1999, two months after Netscape’s My Netscape Network announcement, Winer introduced a new version of the Scripting News format, called ScriptingNews 2.0b1. Winer claimed that he decided to move ahead with his own format only after trying but failing to get anyone at Netscape to care about RSS 0.90’s deficiencies. The new version of the Scripting News format added several items to the `
` element that brought the Scripting News format to parity with RSS. But the two formats continued to differ in that the Scripting News format, which Winer nicknamed the “fat” syndication format, could include entire paragraphs and not just links. + +Netscape got around to releasing RSS 0.91 the very next month. The updated specification was a major about-face. RSS no longer stood for “RDF Site Summary”; it now stood for “Rich Site Summary.” All the RDF—and there was almost none anyway—was stripped out. Many of the Scripting News tags were incorporated. In the text of the new specification, Libby explained: + +> RDF references removed. RSS was originally conceived as a metadata format providing a summary of a website. Two things have become clear: the first is that providers want more of a syndication format than a metadata format. The structure of an RDF file is very precise and must conform to the RDF data model in order to be valid. This is not easily human-understandable and can make it difficult to create useful RDF files. The second is that few tools are available for RDF generation, validation and processing. For these reasons, we have decided to go with a standard XML approach. + +Winer was enormously pleased with RSS 0.91, calling it “even better than I thought it would be.” UserLand Software adopted it as a replacement for the existing ScriptingNews 2.0b1 format. For a while, it seemed that RSS finally had a single authoritative specification. + +### The Great Fork + +A year later, the RSS 0.91 specification had become woefully inadequate. There were all sorts of things people were trying to do with RSS that the specification did not address. There were other parts of the specification that seemed unnecessarily constraining—each RSS channel could only contain a maximum of 15 items, for example. + +By that point, RSS had been adopted by several more organizations. Other than Netscape, which seems to have lost interest after RSS 0.91, the big players were Dave Winer’s UserLand Software; O’Reilly Net, which ran an RSS aggregator called Meerkat; and Moreover.com, which also ran an RSS aggregator focused on news. Via mailing list, representatives from these organizations and others regularly discussed how to improve on RSS 0.91. But there were deep disagreements about what those improvements should look like. + +The mailing list in which most of the discussion occurred was called the Syndication mailing list. [An archive of the Syndication mailing list][7] is still available. It is an amazing historical resource. It provides a moment-by-moment account of how those deep disagreements eventually led to a political rupture of the RSS community. + +On one side of the coming rupture was Winer. Winer was impatient to evolve RSS, but he wanted to change it only in relatively conservative ways. In June, 2000, he published his own RSS 0.91 specification on the UserLand website, meant to be a starting point for further development of RSS. It made no significant changes to the 0.91 specification published by Netscape. Winer claimed in a blog post that accompanied his specification that it was only a “cleanup” documenting how RSS was actually being used in the wild, which was needed because the Netscape specification was no longer being maintained. In the same post, he argued that RSS had succeeded so far because it was simple, and that by adding namespaces (a way to explicitly distinguish between different RSS vocabularies) or RDF back to the format—some had suggested this be done in the Syndication mailing list—it “would become vastly more complex, and IMHO, at the content provider level, would buy us almost nothing for the added complexity.” In a message to the Syndication mailing list sent around the same time, Winer suggested that these issues were important enough that they might lead him to create a fork: + +> I’m still pondering how to move RSS forward. I definitely want ICE-like stuff in RSS2, publish and subscribe is at the top of my list, but I am going to fight tooth and nail for simplicity. I love optional elements. I don’t want to go down the namespaces and schema road, or try to make it a dialect of RDF. I understand other people want to do this, and therefore I guess we’re going to get a fork. I have my own opinion about where the other fork will lead, but I’ll keep those to myself for the moment at least. + +Arrayed against Winer were several other people, including Rael Dornfest of O’Reilly, Ian Davis (responsible for a search startup called Calaba), and a precocious, 14-year-old Aaron Swartz. This is the same Aaron Swartz that would later co-found Reddit and become famous for his hacktivism. (In 2000, according to an email to me from Davis, his dad often accompanied him to technology meetups.) Dornfest, Davis, and Swartz all thought that RSS needed namespaces in order to accommodate the many different things everyone wanted to do with it. On another mailing list hosted by O’Reilly, Davis proposed a namespace-based module system, writing that such a system would “make RSS as extensible as we like rather than packing in new features that over-complicate the spec.” The “namespace camp” believed that RSS would soon be used for much more than the syndication of blog posts, so namespaces, rather than being a complication, were the only way to keep RSS from becoming unmanageable as it supported more and more use cases. + +At the root of this disagreement about namespaces was a deeper disagreement about what RSS was even for. Winer had invented his Scripting News format to syndicate the posts he wrote for his blog. Netscape had released RSS as “RDF Site Summary” because it was a way of recreating a site in miniature within the My Netscape online portal. Some people felt that Netscape’s original vision should be honored. Writing to the Syndication mailing list, Davis explained his view that RSS was “originally conceived as a way of building mini sitemaps,” and that now he and others wanted to expand RSS “to encompass more types of information than simple news headlines and to cater for the new uses of RSS that have emerged over the last 12 months.” This was a sensible point to make because the goal of the Netscape RSS project in the beginning was even loftier than Davis suggests: Guha told me that he wanted to create a technology that could support not just website channels but feeds about arbitrary entities such as, for example, Madonna. Further developing RSS so that it could do this would indeed be in keeping with that original motivation. But Davis’ argument also overstates the degree to which there was a unified vision at Netscape by the time the RSS specification was published. According to Libby, who I talked to via email, there was eventually contention between a “Let’s Build the Semantic Web” group and “Let’s Make This Simple for People to Author” group even within Netscape. + +For his part, Winer argued that Netscape’s original goals were irrelevant because his Scripting News format was in fact the first RSS and it had been meant for a very different purpose. Given that the people most involved in the development of RSS disagreed about who had created RSS and why, a fork seems to have been inevitable. + +The fork happened after Dornfest announced a proposed RSS 1.0 specification and formed the RSS-DEV Working Group—which would include Davis, Swartz, and several others but not Winer—to get it ready for publication. In the proposed specification, RSS once again stood for “RDF Site Summary,” because RDF had been added back in to represent metadata properties of certain RSS elements. The specification acknowledged Winer by name, giving him credit for popularizing RSS through his “evangelism.” But it also argued that RSS could not be improved in the way that Winer was advocating. Just adding more elements to RSS without providing for extensibility with a module system would “sacrifice scalability.” The specification went on to define a module system for RSS based on XML namespaces. + +Winer felt that it was “unfair” that the RSS-DEV Working Group had arrogated the “RSS 1.0” name for themselves. In another mailing list about decentralization, he wrote that he had “recently had a standard stolen by a big name,” presumably meaning O’Reilly, which had convened the RSS-DEV Working Group. Other members of the Syndication mailing list also felt that the RSS-DEV Working Group should not have used the name “RSS” without unanimous agreement from the community on how to move RSS forward. But the Working Group stuck with the name. Dan Brickley, another member of the RSS-DEV Working Group, defended this decision by arguing that “RSS 1.0 as proposed is solidly grounded in the original RSS vision, which itself had a long heritage going back to MCF (an RDF precursor) and related specs (CDF etc).” He essentially felt that the RSS 1.0 effort had a better claim to the RSS name than Winer did, since RDF had originally been a part of RSS. The RSS-DEV Working Group published a final version of their specification in December. That same month, Winer published his own improvement to RSS 0.91, which he called RSS 0.92, on UserLand’s website. RSS 0.92 made several small optional improvements to RSS, among which was the addition of the `` tag soon used by podcasters everywhere. RSS had officially forked. + +The fork might have been avoided if a better effort had been made to include Winer in the RSS-DEV Working Group. He obviously belonged there. He was a prominent contributor to the Syndication mailing list and responsible for much of RSS’ popularity, as the members of the Working Group themselves acknowledged. But, as Davis wrote in an email to me, Winer “wanted control and wanted RSS to be his legacy so was reluctant to work with us.” Tim O’Reilly, founder and CEO of O’Reilly, explained in a UserLand discussion group in September, 2000 that Winer basically refused to participate: + +> A group of people involved in RSS got together to start thinking about its future evolution. Dave was part of the group. When the consensus of the group turned in a direction he didn’t like, Dave stopped participating, and characterized it as a plot by O’Reilly to take over RSS from him, despite the fact that Rael Dornfest of O’Reilly was only one of about a dozen authors of the proposed RSS 1.0 spec, and that many of those who were part of its development had at least as long a history with RSS as Dave had. + +To this, Winer said: + +> I met with Dale [Dougherty] two weeks before the announcement, and he didn’t say anything about it being called RSS 1.0. I spoke on the phone with Rael the Friday before it was announced, again he didn’t say that they were calling it RSS 1.0. The first I found out about it was when it was publicly announced. +> +> Let me ask you a straight question. If it turns out that the plan to call the new spec “RSS 1.0” was done in private, without any heads-up or consultation, or for a chance for the Syndication list members to agree or disagree, not just me, what are you going to do? +> +> UserLand did a lot of work to create and popularize and support RSS. We walked away from that, and let your guys have the name. That’s the top level. If I want to do any further work in Web syndication, I have to use a different name. Why and how did that happen Tim? + +I have not been able to find a discussion in the Syndication mailing list about using the RSS 1.0 name prior to the announcement of the RSS 1.0 proposal. Winer, in a message to me, said that he was not trying to control RSS and just wanted to use it in his products. + +RSS would fork again in 2003, when several developers frustrated with the bickering in the RSS community sought to create an entirely new format. These developers created Atom, a format that did away with RDF but embraced XML namespaces. Atom would eventually be specified by [a proposed IETF standard][8]. After the introduction of Atom, there were three competing versions of RSS: Winer’s RSS 0.92 (updated to RSS 2.0 in 2002 and renamed “Really Simple Syndication”), the RSS-DEV Working Group’s RSS 1.0, and Atom. + +### Decline + +The proliferation of competing RSS specifications may have hampered RSS in other ways that I’ll discuss shortly. But it did not stop RSS from becoming enormously popular during the 2000s. By 2004, the New York Times had started offering its headlines in RSS and had written an article explaining to the layperson what RSS was and how to use it. Google Reader, the RSS aggregator ultimately used by millions, was launched in 2005. By 2013, RSS seemed popular enough that the New York Times, in its obituary for Aaron Swartz, called the technology “ubiquitous.” For a while, before a third of the planet had signed up for Facebook, RSS was simply how many people stayed abreast of news on the internet. + +The New York Times published Swartz’ obituary in January 2013. By that point, though, RSS had actually turned a corner and was well on its way to becoming an obscure technology. Google Reader was shut down in July 2013, ostensibly because user numbers had been falling “over the years.” This prompted several articles from various outlets declaring that RSS was dead. But people had been declaring that RSS was dead for years, even before Google Reader’s shuttering. Steve Gillmor, writing for TechCrunch in May 2009, advised that “it’s time to get completely off RSS and switch to Twitter” because “RSS just doesn’t cut it anymore.” He pointed out that Twitter was basically a better RSS feed, since it could show you what people thought about an article in addition to the article itself. It allowed you to follow people and not just channels. Gillmor told his readers that it was time to let RSS recede into the background. He ended his article with a verse from Bob Dylan’s “Forever Young.” + +Today, RSS is not dead. But neither is it anywhere near as popular as it once was. Lots of people have offered explanations for why RSS lost its broad appeal. Perhaps the most persuasive explanation is exactly the one offered by Gillmor in 2009. Social networks, just like RSS, provide a feed featuring all the latest news on the internet. Social networks took over from RSS because they were simply better feeds. They also provide more benefits to the companies that own them. Some people have accused Google, for example, of shutting down Google Reader in order to encourage people to use Google+. Google might have been able to monetize Google+ in a way that it could never have monetized Google Reader. Marco Arment, the creator of Instapaper, wrote on his blog in 2013: + +> Google Reader is just the latest casualty of the war that Facebook started, seemingly accidentally: the battle to own everything. While Google did technically “own” Reader and could make some use of the huge amount of news and attention data flowing through it, it conflicted with their far more important Google+ strategy: they need everyone reading and sharing everything through Google+ so they can compete with Facebook for ad-targeting data, ad dollars, growth, and relevance. + +So both users and technology companies realized that they got more out of using social networks than they did out of RSS. + +Another theory is that RSS was always too geeky for regular people. Even the New York Times, which seems to have been eager to adopt RSS and promote it to its audience, complained in 2006 that RSS is a “not particularly user friendly” acronym coined by “computer geeks.” Before the RSS icon was designed in 2004, websites like the New York Times linked to their RSS feeds using little orange boxes labeled “XML,” which can only have been intimidating. The label was perfectly accurate though, because back then clicking the link would take a hapless user to a page full of XML. [This great tweet][9] captures the essence of this explanation for RSS’ demise. Regular people never felt comfortable using RSS; it hadn’t really been designed as a consumer-facing technology and involved too many hurdles; people jumped ship as soon as something better came along. + +RSS might have been able to overcome some of these limitations if it had been further developed. Maybe RSS could have been extended somehow so that friends subscribed to the same channel could syndicate their thoughts about an article to each other. Maybe browser support could have been improved. But whereas a company like Facebook was able to “move fast and break things,” the RSS developer community was stuck trying to achieve consensus. When they failed to agree on a single standard, effort that could have gone into improving RSS was instead squandered on duplicating work that had already been done. Davis told me, for example, that Atom would not have been necessary if the members of the Syndication mailing list had been able to compromise and collaborate, and “all that cleanup work could have been put into RSS to strengthen it.” So if we are asking ourselves why RSS is no longer popular, a good first-order explanation is that social networks supplanted it. If we ask ourselves why social networks were able to supplant it, then the answer may be that the people trying to make RSS succeed faced a problem much harder than, say, building Facebook. As Dornfest wrote to the Syndication mailing list at one point, “currently it’s the politics far more than the serialization that’s far from simple.” + +So today we are left with centralized silos of information. Even so, the syndicated web that Werbach foresaw in 1999 has been realized, just not in the way he thought it would be. After all, The Onion is a publication that relies on syndication through Facebook and Twitter the same way that Seinfeld relied on syndication to rake in millions after the end of its original run. I asked Werbach what he thinks about this and he more or less agrees. He told me that RSS, on one level, was clearly a failure, because it isn’t now “a technology that is really the core of the whole blogging world or content world or world of assembling different elements of things into sites.” But, on another level, “the whole social media revolution is partly about the ability to aggregate different content and resources” in a manner reminiscent of RSS and his original vision for a syndicated web. To Werbach, “it’s the legacy of RSS, even if it’s not built on RSS.” + +Unfortunately, syndication on the modern web still only happens through one of a very small number of channels, meaning that none of us “retain control over our online personae” the way that Werbach imagined we would. One reason this happened is garden-variety corporate rapaciousness—RSS, an open format, didn’t give technology companies the control over data and eyeballs that they needed to sell ads, so they did not support it. But the more mundane reason is that centralized silos are just easier to design than common standards. Consensus is difficult to achieve and it takes time, but without consensus spurned developers will go off and create competing standards. The lesson here may be that if we want to see a better, more open web, we have to get better at not screwing each other over. + +If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][10] on Twitter or subscribe to the [RSS feed][11] to make sure you know when a new post is out. + +Previously on TwoBitHistory… + +> I've long wondered if the Unix commands on my Macbook are built from the same code that they were built from 20 or 30 years ago. The answer, it turns, out, is "kinda"! +> +> My latest post, on how the implementation of cat has changed over the years: +> +> — TwoBitHistory (@TwoBitHistory) [November 12, 2018][12] + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2018/12/18/rss.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://twobithistory.org/2018/09/16/the-rise-and-demise-of-rss.html +[2]: https://trends.google.com/trends/explore?date=all&geo=US&q=rss +[3]: https://twobithistory.org/images/mnn-channel.gif +[4]: https://twobithistory.org/2018/05/27/semantic-web.html +[5]: http://web.archive.org/web/19970703020212/http://mcf.research.apple.com:80/hs/screen_shot.html +[6]: http://scripting.com +[7]: https://groups.yahoo.com/neo/groups/syndication/info +[8]: https://tools.ietf.org/html/rfc4287 +[9]: https://twitter.com/mgsiegler/status/311992206716203008 +[10]: https://twitter.com/TwoBitHistory +[11]: https://twobithistory.org/feed.xml +[12]: https://twitter.com/TwoBitHistory/status/1062114484209311746?ref_src=twsrc%5Etfw From 84055453586a2a5118f5d790e14c1e852e4db091 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:31:08 +0800 Subject: [PATCH 49/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Working=20with=20ta?= =?UTF-8?q?rballs=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20181217 Working with tarballs on Linux.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20181217 Working with tarballs on Linux.md diff --git a/sources/tech/20181217 Working with tarballs on Linux.md b/sources/tech/20181217 Working with tarballs on Linux.md new file mode 100644 index 0000000000..29d7b6002f --- /dev/null +++ b/sources/tech/20181217 Working with tarballs on Linux.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Working with tarballs on Linux) +[#]: via: (https://www.networkworld.com/article/3328840/linux/working-with-tarballs-on-linux.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Working with tarballs on Linux +====== +![](https://images.idgesg.net/images/article/2018/12/tarball-100783148-large.jpg) + +The word “tarball” is often used to describe the type of file used to back up a select group of files and join them into a single file. The name comes from the **.tar** file extension and the **tar** command that is used to group together the files into a single file that is then sometimes compressed to make it smaller for its move to another system. + +Tarballs are often used to back up personal or system files in place to create an archive, especially prior to making changes that might have to be reversed. Linux sysadmins, for example, will often create a tarball containing a series of configuration files before making changes to an application just in case they have to reverse those changes. Extracting the files from a tarball that’s sitting in place will generally be faster than having to retrieve the files from backups. + +### How to create a tarball on Linux + +You can create a tarball and compress it in a single step if you use a command like this one: + +``` +$ tar -cvzf PDFs.tar.gz *.pdf +``` + +The result in this case is a compressed (gzipped) file that contains all of the PDF files that are in the current directory. The compression is optional, of course. A slightly simpler command would just put all of the PDF files into an uncompressed tarball: + +``` +$ tar -cvf PDFs.tar *.pdf +``` + +Note that it’s the **z** in that list of options that causes the file to be compressed or “zipped”. The **c** specifies that you are creating the file and the **v** (verbose) indicates that you want some feedback while the command is running. Omit the **v** if you don't want to see the files listed. + +Another common naming convention is to give zipped tarballs the extension **.tgz** instead of the double extension **.tar.gz** as shown in this command: + +``` +$ tar cvzf MyPDFs.tgz *.pdf +``` + +### How to extract files from a tarball + +To extract all of the files from a gzipped tarball, you would use a command like this: + +``` +$ tar -xvzf file.tar.gz +``` + +If you use the .tgz naming convention, that command would look like this: + +``` +$ tar -xvzf MyPDFs.tgz +``` + +To extract an individual file from a gzipped tarball, you do almost the same thing but add the file name: + +``` +$ tar -xvzf PDFs.tar.gz ShenTix.pdf +ShenTix.pdf +ls -l ShenTix.pdf +-rw-rw-r-- 1 shs shs 122057 Dec 14 14:43 ShenTix.pdf +``` + +You can even delete files from a tarball if the tarball is not compressed. For example, if we wanted to remove tile file that we extracted above from the PDFs.tar.gz file, we would do it like this: + +``` +$ gunzip PDFs.tar.gz +$ ls -l PDFs.tar +-rw-rw-r-- 1 shs shs 10700800 Dec 15 11:51 PDFs.tar +$ tar -vf PDFs.tar --delete ShenTix.pdf +$ ls -l PDFs.tar +-rw-rw-r-- 1 shs shs 10577920 Dec 15 11:45 PDFs.tar +``` + +Notice that we shaved a little space off the tar file while deleting the ShenTix.pdf file. We can then compress the file again if we want: + +``` +$ gzip -f PDFs.tar +ls -l PDFs.tar.gz +-rw-rw-r-- 1 shs shs 10134499 Dec 15 11:51 PDFs.tar.gzFlickr / James St. John +``` + +The versatility of the command line options makes working with tarballs easy and very convenient. + +Join the Network World communities on [Facebook][1] and [LinkedIn][2] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3328840/linux/working-with-tarballs-on-linux.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.facebook.com/NetworkWorld/ +[2]: https://www.linkedin.com/company/network-world From c39a24272d1dafb19525906c334f66a11b713cc9 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:34:50 +0800 Subject: [PATCH 50/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Insync:=20The=20Has?= =?UTF-8?q?sleless=20Way=20of=20Using=20Google=20Drive=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...less Way of Using Google Drive on Linux.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md diff --git a/sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md b/sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md new file mode 100644 index 0000000000..c10e7ae4ed --- /dev/null +++ b/sources/tech/20181218 Insync- The Hassleless Way of Using Google Drive on Linux.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Insync: The Hassleless Way of Using Google Drive on Linux) +[#]: via: (https://itsfoss.com/insync-linux-review/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Insync: The Hassleless Way of Using Google Drive on Linux +====== + +Using Google Drive on Linux is a pain and you probably already know that. There is no official desktop client of Google Drive for Linux. It’s been [more than six years since Google promised Google Drive on Linux][1] but it doesn’t seem to be happening. + +In the absence of the official Google Drive client on Linux, you have no option other than trying the alternatives. I have already discussed a number of [tools that allow you to use Google Drive on Linux][2]. One of those to[ols is][3] Insync, and in my opinion, this is your best bet for a native Google Drive experience on desktop Linux. + +Note that Insync is not an open source software. Heck, it is not even free to use. + +But it has so many features that it becomes an essential tool for those Linux users who rely heavily on Google Drive. + +I briefly discussed Insync in the old article about [Google Drive and Linux][2]. In this article, I’ll discuss Insync features in detail. + +### Insync brings native Google Drive experience to Linux desktop + +![Use insync to access Google Drive in Linux][4] + +The core competency of Insync is syncing your Google Drive, but the app is much more than that. It has features to help you maximize and control your productivity, your Google Drive and your files such as: + + * Cross-platform access (supports Linux, Windows and macOS) + * Easy multiple Google Drive accounts access + * Choose your syncing location. Sync files to your hard drive, external drives and NAS! + * Support for features like file matching, symlink and ignore list + + + +Let me show you some of the main features in action: + +#### Cross-platform in true sense + +Insync claims to run the same app across all operating systems i.e., Linux, Windows, and macOS. That means that you can access the same UI across different OSes, making it easy for you to manage your files across multiple machines. + +![The UI of Insync and the default location of the Insync folder.][5]The UI of Insync and the default location of the Insync folder. + +#### Multiple Google account management + +Insync interface allows you to manage multiple Google Drive accounts seamlessly. You can easily switch between several accounts just by clicking your Google account. + +![Switching between multiple Google accounts in Insync][6]Switching between multiple Google accounts + +#### Custom sync folders + +Customize the way you sync your files and folders. You can easily set your syncing destination anywhere on your machine including external drive and network drives. + +![Customize sync location in Insync][7]Customize sync location + +The selective syncing mode also allows you to easily select a number of files and folders you’d want to sync (or unsync) in your local machine. This includes selectively syncing files within folders. + +![Selective synchronization in Insync][8]Selective synchronization + +It has features like file matching and ‘ignore list’ to help you filter files you don’t want to sync or files that you already have on your machine. + +![File matching feature in Insync][9]Avoids duplication of files + +The ‘ignore list’ allows you to set rules to exclude certain type of files from synchronization. + +![Selective syncing based on rules in Insync][10]Selective syncing based on rules + +If you prefer to work out of the desktop, you have an “Add to Insync” feature that will allow you to add any local file to your Drive. + +![Sync files right from your desktop][11]Sync files right from your desktop + +Insync also supports symlinks for those with workflows that use symbolic links. To learn more about Insync and symlinks, you can refer to [this article.][12] + +#### Exclusive features for Linux + +Insync supports the most commonly used 64-bit Linux distributions like **Ubuntu, Debian and Fedora**. You can check out the full list of distribution support [here][13]. + +Insync also has [headless][14] support for those looking to sync through the command line interface. This is perfect if you use a distro that is not fully supported by the GUI app or if you are working with servers or if you simply prefer the CLI. + +![Insync CLI][15]Command Line Interface + +You can learn more about installing and running Insync headless [here][16]. + +### Insync pricing and special discount + +Insync is a premium tool and it comes with a [price tag][17]. You have 2 licenses to choose from: + + * **Prime** is priced at $29.99 per Google account. You’ll get access to: cross-platform syncing, multiple accounts access and **support**. + * **Teams** is priced at $49.99 per Google account. You’ll be able to access all the Prime features + Team Drives syncing + + + +It’s a one-time fee which means once you buy it, you don’t have to pay it again. In a world where everything is paid monthly, it’s refreshing to pay for software that is still one-time! + +Each Google account has a 15-day free trial that will allow you to test the full suite of features, including [Team Drives][18] syncing. + +If you think it’s a bit expensive for your budget, I have good news for you. As an It’s FOSS reader, you get Insync at 25% discount. + +Just use the code ITSFOSS25 at checkout time and you will get 25% immediate discount on any license. Isn’t it cool? + +If you are not certain yet, you can try Insync free for 15 days. And if you think it’s worth the money, purchase the license with **ITSFOSS25** coupon code. + +You can download Insync from their website. + +I have used Insync from the time when it was available for free and I have always liked it. They have added more features over the time and improved its UI and performance. Overall, it’s a nice-to-have application if you use Google Drive a lot and do not mind paying for the efforts of the developers. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/insync-linux-review/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://abevoelker.github.io/how-long-since-google-said-a-google-drive-linux-client-is-coming/ +[2]: https://itsfoss.com/use-google-drive-linux/ +[3]: https://www.insynchq.com +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/google-drive-linux-insync.jpeg?resize=800%2C450&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_interface.jpeg?fit=800%2C501&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_multiple_google_account.jpeg?ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_folder_settings.png?ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_selective_sync.png?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_file_matching.jpeg?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_ignore_list_1.png?ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/add-to-insync-shortcut.jpeg?ssl=1 +[12]: https://help.insynchq.com/key-features-and-syncing-explained/syncing-superpowers/using-symlinks-on-google-drive-with-insync +[13]: https://www.insynchq.com/downloads +[14]: https://en.wikipedia.org/wiki/Headless_software +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/insync_cli.jpeg?fit=800%2C478&ssl=1 +[16]: https://help.insynchq.com/installation-on-windows-linux-and-macos/advanced/linux-controlling-insync-via-command-line-cli +[17]: https://www.insynchq.com/pricing +[18]: https://gsuite.google.com/learning-center/products/drive/get-started-team-drive/#!/ From 8771b92c553f2585ebb69a727d5d87511d345322 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:41:30 +0800 Subject: [PATCH 51/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=206=20tips=20and=20tr?= =?UTF-8?q?icks=20for=20using=20KeePassX=20to=20secure=20your=20passwords?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...using KeePassX to secure your passwords.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md diff --git a/sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md b/sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md new file mode 100644 index 0000000000..ad688a7820 --- /dev/null +++ b/sources/tech/20181217 6 tips and tricks for using KeePassX to secure your passwords.md @@ -0,0 +1,78 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 tips and tricks for using KeePassX to secure your passwords) +[#]: via: (https://opensource.com/article/18/12/keepassx-security-best-practices) +[#]: author: (Michael McCune https://opensource.com/users/elmiko) + +6 tips and tricks for using KeePassX to secure your passwords +====== +Get more out of your password manager by following these best practices. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum) + +Our increasingly interconnected digital world makes security an essential and common discussion topic. We hear about [data breaches][1] with alarming regularity and are often on our own to make informed decisions about how to use technology securely. Although security is a deep and nuanced topic, there are some easy daily habits you can keep to reduce your attack surface. + +Securing passwords and account information is something that affects anyone today. Technologies like [OAuth][2] help make our lives simpler by reducing the number of accounts we need to create, but we are still left with a staggering number of places where we need new, unique information to keep our records secure. An easy way to deal with the increased mental load of organizing all this sensitive information is to use a password manager like [KeePassX][3]. + +In this article, I will explain the importance of keeping your password information secure and offer suggestions for getting the most out of KeePassX. For an introduction to KeePassX and its features, I highly recommend Ricardo Frydman's article "[Managing passwords in Linux with KeePassX][4]." + +### Why are unique passwords important? + +Using a different password for each account is the first step in ensuring that your accounts are not vulnerable to shared information leaks. Generating new credentials for every account is time-consuming, and it is extremely common for people to fall into the trap of using the same password on several accounts. The main problem with reusing passwords is that you increase the number of accounts an attacker could access if one of them experiences a credential breach. + +It may seem like a burden to create new credentials for each account, but the few minutes you spend creating and recording this information will pay for itself many times over in the event of a data breach. This is where password management tools like KeePassX are invaluable for providing convenience and reliability in securing your logins. + +### 3 tips for getting the most out of KeePassX + +I have been using KeePassX to manage my password information for many years, and it has become a primary resource in my digital toolbox. Overall, it's fairly simple to use, but there are a few best practices I've learned that I think are worth highlighting. + + 1. Add the direct login URL for each account entry. KeePassX has a very convenient shortcut to open the URL listed with an entry. (It's Control+Shift+U on Linux.) When creating a new account entry for a website, I spend some time to locate the site's direct login URL. Although most websites have a login widget in their navigation toolbars, they also usually have direct pages for login forms. By putting this URL into the URL field on the account entry setup form, I can use the shortcut to directly open the login page in my browser. + +![](https://opensource.com/sites/default/files/uploads/keepassx-tip1.png) + + 2. Use the Notes field to record extra security information. In addition to passwords, most websites will ask several questions to create additional authentication factors for an account. I use the Notes sections in my account entries to record these additional factors. + +![](https://opensource.com/sites/default/files/uploads/keepassx-tip2.png) + + 3. Turn on automatic database locking. In the **Application Settings** under the **Tools** menu, there is an option to lock the database after a period of inactivity. Enabling this option is a good common-sense measure, similar to enabling a password-protected screen lock, that will help ensure your password database is not left open and unprotected if someone else gains access to your computer. + +![](https://opensource.com/sites/default/files/uploads/keepassx_application-settings.png) + +### Food for thought + +Protecting your accounts with better password practices and daily habits is just the beginning. Once you start using a password manager, you need to consider issues like protecting the password database file and ensuring you don't forget or lose the master credentials. + +The cloud-native world of disconnected devices and edge computing makes having a central password store essential. The practices and methodologies you adopt will help minimize your risk while you explore and work in the digital world. + + 1. Be aware of retention policies when storing your database in the cloud. KeePassX's database has an open format used by several tools on multiple platforms. Sooner or later, you will want to transfer your database to another device. As you do this, consider the medium you will use to transfer the file. The best option is to use some sort of direct transfer between devices, but this is not always convenient. Always think about where the database file might be stored as it winds its way through the information superhighway; an email may get cached on a server, an object store may move old files to a trash folder. Learn about these interactions for the platforms you are using before deciding where and how you will share your database file. + + 2. Consider the source of truth for your database while you're making edits. After you share your database file between devices, you might need to create accounts for new services or change information for existing services while using a device. To ensure your information is always correct across all your devices, you need to make sure any edits you make on one device end up in all copies of the database file. There is no easy solution to this problem, but you might think about making all edits from a single device or storing the master copy in a location where all your devices can make edits. + + 3. Do you really need to know your passwords? This is more of a philosophical question that touches on the nature of memorable passwords, convenience, and secrecy. I hardly look at passwords as I create them for new accounts; in most cases, I don't even click the "Show Password" checkbox. There is an idea that you can be more secure by not knowing your passwords, as it would be impossible to compel you to provide them. This may seem like a worrisome idea at first, but consider that you can recover or reset passwords for most accounts through alternate verification methods. When you consider that you might want to change your passwords on a semi-regular basis, it almost makes more sense to treat them as ephemeral information that can be regenerated or replaced. + + + + +Here are a few more ideas to consider as you develop your best practices. + +I hope these tips and tricks have helped expand your knowledge of password management and KeePassX. You can find tools that support the KeePass database format on nearly every platform. If you are not currently using a password manager or have never tried KeePassX, I highly recommend doing so now! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/keepassx-security-best-practices + +作者:[Michael McCune][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/elmiko +[b]: https://github.com/lujun9972 +[1]: https://vigilante.pw/ +[2]: https://en.wikipedia.org/wiki/OAuth +[3]: https://www.keepassx.org/ +[4]: https://opensource.com/business/16/5/keepassx From 89340410b931c436b1e7565b2ad2eff5dcca1e34 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:42:35 +0800 Subject: [PATCH 52/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=204=20cool=20new=20pr?= =?UTF-8?q?ojects=20to=20try=20in=20COPR=20for=20December=202018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ojects to try in COPR for December 2018.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md diff --git a/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md b/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md new file mode 100644 index 0000000000..9dc8b3390f --- /dev/null +++ b/sources/tech/20181217 4 cool new projects to try in COPR for December 2018.md @@ -0,0 +1,93 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 cool new projects to try in COPR for December 2018) +[#]: via: (https://fedoramagazine.org/4-try-copr-december-2018/) +[#]: author: (Dominik Turecek https://fedoramagazine.org) + +4 cool new projects to try in COPR for December 2018 +====== +![](https://fedoramagazine.org/wp-content/uploads/2017/08/4-copr-945x400.jpg) + +COPR is a [collection][1] of personal repositories for software that isn’t carried in Fedora. Some software doesn’t conform to standards that allow easy packaging. Or it may not meet other Fedora standards, despite being free and open source. COPR can offer these projects outside the Fedora set of packages. Software in COPR isn’t supported by Fedora infrastructure or signed by the project. However, it can be a neat way to try new or experimental software. + +Here’s a set of new and interesting projects in COPR. + +### MindForger + +[MindForger][2] is a Markdown editor and a notebook. In addition to features you’d expect from a Markdown editor, MindForger lets you split a single file into multiple notes. It’s easy to organize the notes and move them around between files, as well as search through them. I’ve been using MindForger for some time for my study notes, so it’s nice that it’s available through COPR now.![][3] + +#### Installation instructions + +The repo currently provides MindForger for Fedora 29 and Rawhide. To install MindForger, use these commands: + +``` +sudo dnf copr enable deadmozay/mindforger +sudo dnf install mindforger +``` + +### Clingo + +[Clingo][4] is a program for solving logical problems using [answer set programming][5] (ASP) modeling language. With ASP, you can declaratively describe a problem as a logical program that Clingo then solves. As a result, Clingo produces solutions to the problem in the form of logical models, called answer sets. + +#### Installation instructions + +The repo currently provides Clingo for Fedora 28 and 29. To install Clingo, use these commands: + +``` +sudo dnf copr enable timn/clingo +sudo dnf install clingo +``` + +### SGVrecord + +[SGVrecord][6] is a simple tool for recording your screen. It allows you to either capture the whole screen or select just a part of it. Furthermore, it is possible to make the record with or without sound. Sgvrecord produces files in WebM format.![][7] + +#### Installation instructions + +The repo currently provides SGVrecord for Fedora 28, 29, and Rawhide. To install SGVrecord, use these commands: + +``` +sudo dnf copr enable youssefmsourani/sgvrecord +sudo dnf install sgvrecord +``` + +### Watchman + +[Watchman][8] is a service for monitoring and recording when changes are done to files. +You can specify directory trees for Watchman to monitor, as well as define actions +that are triggered when specified files are changed. + +#### Installation instructions + +The repo currently provides Watchman for Fedora 29 and Rawhide. To install Watchman, use these commands: + +``` +sudo dnf copr enable eklitzke/watchman +sudo dnf install watchman +``` + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/4-try-copr-december-2018/ + +作者:[Dominik Turecek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org +[b]: https://github.com/lujun9972 +[1]: https://copr.fedorainfracloud.org/ +[2]: https://www.mindforger.com/ +[3]: https://fedoramagazine.org/wp-content/uploads/2018/12/mindforger.png +[4]: https://potassco.org/clingo/ +[5]: https://en.wikipedia.org/wiki/Answer_set_programming +[6]: https://github.com/yucefsourani/sgvrecord +[7]: https://fedoramagazine.org/wp-content/uploads/2018/12/SGVrecord.png +[8]: https://facebook.github.io/watchman/ From e64177708c5b39b098722086a7ed82c46ff65493 Mon Sep 17 00:00:00 2001 From: Auk7F7 <34982730+Auk7F7@users.noreply.github.com> Date: Fri, 21 Dec 2018 16:43:15 +0800 Subject: [PATCH 53/69] Update 20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md --- ...udit - A Tool To Check Vulnerable Packages In Arch Linux.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md b/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md index 3f77bee3d1..d359a4f57c 100644 --- a/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md +++ b/sources/tech/20181128 Arch-Audit - A Tool To Check Vulnerable Packages In Arch Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( Auk7F7) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (Arch-Audit : A Tool To Check Vulnerable Packages In Arch Linux) @@ -7,7 +7,6 @@ [#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) [#]: url: ( ) -translating by Auk7F7 Arch-Audit : A Tool To Check Vulnerable Packages In Arch Linux ====== From 46bad7ca22b757d16f411b8ccbc03d19cc813977 Mon Sep 17 00:00:00 2001 From: HankChow <280630620@qq.com> Date: Fri, 21 Dec 2018 16:54:45 +0800 Subject: [PATCH 54/69] hankchow translating --- sources/tech/20181219 How to open source your Python library.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20181219 How to open source your Python library.md b/sources/tech/20181219 How to open source your Python library.md index cf59688484..e4d6adf3c6 100644 --- a/sources/tech/20181219 How to open source your Python library.md +++ b/sources/tech/20181219 How to open source your Python library.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1972e2fafdf7a438ceaf523eca15f98170203fb9 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 16:59:08 +0800 Subject: [PATCH 55/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Install?= =?UTF-8?q?=20Rust=20Programming=20Language=20In=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tall Rust Programming Language In Linux.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/tech/20181214 How To Install Rust Programming Language In Linux.md diff --git a/sources/tech/20181214 How To Install Rust Programming Language In Linux.md b/sources/tech/20181214 How To Install Rust Programming Language In Linux.md new file mode 100644 index 0000000000..074c41e9f9 --- /dev/null +++ b/sources/tech/20181214 How To Install Rust Programming Language In Linux.md @@ -0,0 +1,179 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How To Install Rust Programming Language In Linux) +[#]: via: (https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/) +[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/) + +How To Install Rust Programming Language In Linux +====== + +Rust is often called rust-lang. + +Rust is a general-purpose, multi-paradigm, modern, cross-platform, and open source systems programming language sponsored by Mozilla Research. + +It was designed to be achieve a goals such as safety, speed, and concurrency. + +Rust is syntactically similar to C++,[14] but its designers intend it to provide better memory safety while still maintaining performance. + +Rust is currently used in many organization such as Firefox, Chef, Dropbox, Oracle, GNOME, etc,. + +### How to Install Runs Language in Linux? + +There are many ways we can install Rust but below is the officially recommended way to install it. + +``` +$ curl https://sh.rustup.rs -sSf | sh +info: downloading installer + +Welcome to Rust! + +This will download and install the official compiler for the Rust programming +language, and its package manager, Cargo. + +It will add the cargo, rustc, rustup and other commands to Cargo's bin +directory, located at: + + /home/daygeek/.cargo/bin + +This path will then be added to your PATH environment variable by modifying the +profile files located at: + + /home/daygeek/.profile + /home/daygeek/.bash_profile + +You can uninstall at any time with rustup self uninstall and these changes will +be reverted. + +Current installation options: + + default host triple: x86_64-unknown-linux-gnu + default toolchain: stable + modify PATH variable: yes + +1) Proceed with installation (default) +2) Customize installation +3) Cancel installation +>1 + +info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' +info: latest update on 2018-12-06, rust version 1.31.0 (abe02cefd 2018-12-04) +info: downloading component 'rustc' + 77.7 MiB / 77.7 MiB (100 %) 1.2 MiB/s ETA: 0 s +info: downloading component 'rust-std' + 54.2 MiB / 54.2 MiB (100 %) 1.2 MiB/s ETA: 0 s +info: downloading component 'cargo' + 4.7 MiB / 4.7 MiB (100 %) 1.2 MiB/s ETA: 0 s +info: downloading component 'rust-docs' + 8.5 MiB / 8.5 MiB (100 %) 1.2 MiB/s ETA: 0 s +info: installing component 'rustc' +info: installing component 'rust-std' +info: installing component 'cargo' +info: installing component 'rust-docs' +info: default toolchain set to 'stable' + + stable installed - rustc 1.31.0 (abe02cefd 2018-12-04) + + +Rust is installed now. Great! + +To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH +environment variable. Next time you log in this will be done automatically. + +To configure your current shell run source $HOME/.cargo/env +``` + +Run the following command to configure your current shell. + +``` +$ source $HOME/.cargo/env +``` + +Run the following command to verify the installed Rust version. + +``` +$ rustc --version +rustc 1.31.0 (abe02cefd 2018-12-04) +``` + +### How To Test Rust programming language? + +Once you installed Rust follow the below steps to check whether Rust programe language is working fine or not. + +``` +$ mkdir ~/projects +$ cd ~/projects +$ mkdir hello_world +$ cd hello_world +``` + +Create a file and add the below code and save the file. Make sure, Rust files always end in a .rs extension. + +``` +$ vi 2g.rs + +fn main() { + println!("Hello, It's 2DayGeek.com - Best Linux Practical Blog!"); +} +``` + +Run the following command to compile the rust code. + +``` +$ rustc 2g.rs +``` + +The above command will create a executable Rust program file in the same directory. + +``` +$ ls -lh +total 3.9M +-rwxr-xr-x 1 daygeek daygeek 3.9M Dec 14 11:09 2g +-rw-r--r-- 1 daygeek daygeek 86 Dec 14 11:09 2g.rs +``` + +Run the Rust executable file to get the output. + +``` +$ ./2g +Hello, It's 2DayGeek.com - Best Linux Practical Blog! +``` + +Yup! that’s working fine. + +To update Rust to latest version. + +``` +$ rustup update +info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' +info: checking for self-updates + + stable-x86_64-unknown-linux-gnu unchanged - rustc 1.31.0 (abe02cefd 2018-12-04) +``` + +Run the following command to remove the Rust package from your system. + +``` +$ rustup self uninstall +``` + +Once you uninstalled the Rust package, remove the Rust project directory. + +``` +$ rm -fr ~/projects +``` +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/how-to-install-rust-programming-language-in-linux/ + +作者:[Prakash Subramanian][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/prakash/ +[b]: https://github.com/lujun9972 From eb5a7af2f0bf8a5f671483e84417c16e53a7553a Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 17:01:00 +0800 Subject: [PATCH 56/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20TLP=20=E2=80=93=20A?= =?UTF-8?q?n=20Advanced=20Power=20Management=20Tool=20That=20Improve=20Bat?= =?UTF-8?q?tery=20Life=20On=20Linux=20Laptop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...at Improve Battery Life On Linux Laptop.md | 745 ++++++++++++++++++ 1 file changed, 745 insertions(+) create mode 100644 sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md diff --git a/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md new file mode 100644 index 0000000000..e1e6a7f25e --- /dev/null +++ b/sources/tech/20181212 TLP - An Advanced Power Management Tool That Improve Battery Life On Linux Laptop.md @@ -0,0 +1,745 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop) +[#]: via: (https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +TLP – An Advanced Power Management Tool That Improve Battery Life On Linux Laptop +====== + +Laptop battery is highly optimized for Windows OS, that i had realized when i was using Windows OS in my laptop but it’s not same for Linux. + +Over the years Linux has improved a lot for battery optimization but still we need make some necessary things to improve laptop battery life in Linux. + +When i think about battery life, i got few options for that but i felt TLP is a better solutions for me so, i’m going with it. + +In this tutorial we are going to discuss about TLP in details to improve battery life. + +We had written three articles previously in our site about **[laptop battery saving utilities][1]** for Linux **[PowerTOP][2]** and **[Battery Charging State][3]**. + +### What is TLP? + +[TLP][4] is a free opensource advanced power management tool that improve your battery life without making any configuration change. + +Since it comes with a default configuration already optimized for battery life, so you may just install and forget it. + +Also, it is highly customizable to fulfill your specific requirements. TLP is a pure command line tool with automated background tasks. It does not contain a GUI. + +TLP runs on every laptop brand. Setting the battery charge thresholds is available for IBM/Lenovo ThinkPads only. + +All TLP settings are stored in `/etc/default/tlp`. The default configuration provides optimized power saving out of the box. + +The following TLP settings is available for customization and you need to make the necessary changes accordingly if you want it. + +### TLP Features + + * Kernel laptop mode and dirty buffer timeouts + * Processor frequency scaling including “turbo boost” / “turbo core” + * Limit max/min P-state to control power dissipation of the CPU + * HWP energy performance hints + * Power aware process scheduler for multi-core/hyper-threading + * Processor performance versus energy savings policy (x86_energy_perf_policy) + * Hard disk advanced power magement level (APM) and spin down timeout (per disk) + * AHCI link power management (ALPM) with device blacklist + * PCIe active state power management (PCIe ASPM) + * Runtime power management for PCI(e) bus devices + * Radeon graphics power management (KMS and DPM) + * Wifi power saving mode + * Power off optical drive in drive bay + * Audio power saving mode + * I/O scheduler (per disk) + * USB autosuspend with device blacklist/whitelist (input devices excluded automatically) + * Enable or disable integrated wifi, bluetooth or wwan devices upon system startup and shutdown + * Restore radio device state on system startup (from previous shutdown). + * Radio device wizard: switch radios upon network connect/disconnect and dock/undock + * Disable Wake On LAN + * Integrated WWAN and bluetooth state is restored after suspend/hibernate + * Untervolting of Intel processors – requires kernel with PHC-Patch + * Battery charge thresholds – ThinkPads only + * Recalibrate battery – ThinkPads only + + + +### How to Install TLP in Linux + +TLP package is available in most of the distributions official repository so, use the distributions **[Package Manager][5]** to install it. + +For **`Fedora`** system, use **[DNF Command][6]** to install TLP. + +``` +$ sudo dnf install tlp tlp-rdw +``` + +ThinkPads require an additional packages. + +``` +$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm +$ sudo dnf install http://repo.linrunner.de/fedora/tlp/repos/releases/tlp-release.fc$(rpm -E %fedora).noarch.rpm +$ sudo dnf install akmod-tp_smapi akmod-acpi_call kernel-devel +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo dnf install smartmontools +``` + +For **`Debian/Ubuntu`** systems, use **[APT-GET Command][7]** or **[APT Command][8]** to install TLP. + +``` +$ sudo apt install tlp tlp-rdw +``` + +ThinkPads require an additional packages. + +``` +$ sudo apt-get install tp-smapi-dkms acpi-call-dkms +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo apt-get install smartmontools +``` + +When the official package becomes outdated for Ubuntu based systems then use the following PPA repository which provides an up-to-date version. Run the following commands to install TLP using the PPA. + +``` +$ sudo apt-get install tlp tlp-rdw +``` + +For **`Arch Linux`** based systems, use **[Pacman Command][9]** to install TLP. + +``` +$ sudo pacman -S tlp tlp-rdw +``` + +ThinkPads require an additional packages. + +``` +$ pacman -S tp_smapi acpi_call +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo pacman -S smartmontools +``` + +Enable TLP & TLP-Sleep service on boot for Arch Linux based systems. + +``` +$ sudo systemctl enable tlp.service +$ sudo systemctl enable tlp-sleep.service +``` + +You should also mask the following services to avoid conflicts and assure proper operation of TLP’s radio device switching options for Arch Linux based systems. + +``` +$ sudo systemctl mask systemd-rfkill.service +$ sudo systemctl mask systemd-rfkill.socket +``` + +For **`RHEL/CentOS`** systems, use **[YUM Command][10]** to install TLP. + +``` +$ sudo yum install tlp tlp-rdw +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo yum install smartmontools +``` + +For **`openSUSE Leap`** system, use **[Zypper Command][11]** to install TLP. + +``` +$ sudo zypper install TLP +``` + +Install smartmontool to display S.M.A.R.T. data in tlp-stat. + +``` +$ sudo zypper install smartmontools +``` + +After successfully TLP installed, use the following command to start the service. + +``` +$ systemctl start tlp.service +``` + +To show battery information. + +``` +$ sudo tlp-stat -b +or +$ sudo tlp-stat --battery + +--- TLP 1.1 -------------------------------------------- + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 48850 [mWh] +/sys/class/power_supply/BAT0/energy_now = 48850 [mWh] +/sys/class/power_supply/BAT0/power_now = 0 [mW] +/sys/class/power_supply/BAT0/status = Full + +Charge = 100.0 [%] +Capacity = 81.4 [%] +``` + +To show disk information. + +``` +$ sudo tlp-stat -d +or +$ sudo tlp-stat --disk + +--- TLP 1.1 -------------------------------------------- + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25775 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on +``` + +To show PCI device information. + +``` +$ sudo tlp-stat -e +or +$ sudo tlp-stat --pcie + +--- TLP 1.1 -------------------------------------------- + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) +/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) +/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) +/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) +/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) +/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) +/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) +/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) +/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) +/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) +/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) +/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) +``` + +To show graphics card information. + +``` +$ sudo tlp-stat -g +or +$ sudo tlp-stat --graphics + +--- TLP 1.1 -------------------------------------------- + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) +``` + +To show Processor information. + +``` +$ sudo tlp-stat -p +or +$ sudo tlp-stat --processor + +--- TLP 1.1 -------------------------------------------- + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. +``` + +To show system data information. + +``` +$ sudo tlp-stat -s +or +$ sudo tlp-stat --system + +--- TLP 1.1 -------------------------------------------- + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 596 sec(s) ago +Mode = battery +Power source = battery +``` + +To show temperatures and fan speed information. + +``` +$ sudo tlp-stat -t +or +$ sudo tlp-stat --temp + +--- TLP 1.1 -------------------------------------------- + ++++ Temperatures +CPU temp = 36 [°C] +Fan speed = (not available) +``` + +To show USB device data information. + +``` +$ sudo tlp-stat -u +or +$ sudo tlp-stat --usb + +--- TLP 1.1 -------------------------------------------- + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) +Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) +Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) +``` + +To show warnings. + +``` +$ sudo tlp-stat -w +or +$ sudo tlp-stat --warn + +--- TLP 1.1 -------------------------------------------- + +No warnings detected. +``` + +Status report with configuration and all active settings. + +``` +$ sudo tlp-stat + +--- TLP 1.1 -------------------------------------------- + ++++ Configured Settings: /etc/default/tlp +TLP_ENABLE=1 +TLP_DEFAULT_MODE=AC +TLP_PERSISTENT_DEFAULT=0 +DISK_IDLE_SECS_ON_AC=0 +DISK_IDLE_SECS_ON_BAT=2 +MAX_LOST_WORK_SECS_ON_AC=15 +MAX_LOST_WORK_SECS_ON_BAT=60 +CPU_HWP_ON_AC=balance_performance +CPU_HWP_ON_BAT=balance_power +SCHED_POWERSAVE_ON_AC=0 +SCHED_POWERSAVE_ON_BAT=1 +NMI_WATCHDOG=0 +ENERGY_PERF_POLICY_ON_AC=performance +ENERGY_PERF_POLICY_ON_BAT=power +DISK_DEVICES="sda sdb" +DISK_APM_LEVEL_ON_AC="254 254" +DISK_APM_LEVEL_ON_BAT="128 128" +SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance" +SATA_LINKPWR_ON_BAT="med_power_with_dipm max_performance" +AHCI_RUNTIME_PM_TIMEOUT=15 +PCIE_ASPM_ON_AC=performance +PCIE_ASPM_ON_BAT=powersave +RADEON_POWER_PROFILE_ON_AC=default +RADEON_POWER_PROFILE_ON_BAT=low +RADEON_DPM_STATE_ON_AC=performance +RADEON_DPM_STATE_ON_BAT=battery +RADEON_DPM_PERF_LEVEL_ON_AC=auto +RADEON_DPM_PERF_LEVEL_ON_BAT=auto +WIFI_PWR_ON_AC=off +WIFI_PWR_ON_BAT=on +WOL_DISABLE=Y +SOUND_POWER_SAVE_ON_AC=0 +SOUND_POWER_SAVE_ON_BAT=1 +SOUND_POWER_SAVE_CONTROLLER=Y +BAY_POWEROFF_ON_AC=0 +BAY_POWEROFF_ON_BAT=0 +BAY_DEVICE="sr0" +RUNTIME_PM_ON_AC=on +RUNTIME_PM_ON_BAT=auto +RUNTIME_PM_DRIVER_BLACKLIST="amdgpu nouveau nvidia radeon pcieport" +USB_AUTOSUSPEND=0 +USB_BLACKLIST_BTUSB=0 +USB_BLACKLIST_PHONE=0 +USB_BLACKLIST_PRINTER=1 +USB_BLACKLIST_WWAN=1 +RESTORE_DEVICE_STATE_ON_STARTUP=0 + ++++ System Info +System = LENOVO Lenovo ideapad Y700-15ISK 80NV +BIOS = CDCN35WW +Release = "Manjaro Linux" +Kernel = 4.19.6-1-MANJARO #1 SMP PREEMPT Sat Dec 1 12:21:26 UTC 2018 x86_64 +/proc/cmdline = BOOT_IMAGE=/boot/vmlinuz-4.19-x86_64 root=UUID=69d9dd18-36be-4631-9ebb-78f05fe3217f rw quiet resume=UUID=a2092b92-af29-4760-8e68-7a201922573b +Init system = systemd +Boot mode = BIOS (CSM, Legacy) + ++++ TLP Status +State = enabled +Last run = 11:04:00 IST, 684 sec(s) ago +Mode = battery +Power source = battery + ++++ Processor +CPU model = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz + +/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu1/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu1/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu1/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu2/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu2/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu2/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu2/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu3/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu3/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu3/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu3/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu4/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu4/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu4/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu4/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu5/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu5/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu5/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu5/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu5/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu6/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu6/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu6/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu6/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu6/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/cpu7/cpufreq/scaling_driver = intel_pstate +/sys/devices/system/cpu/cpu7/cpufreq/scaling_governor = powersave +/sys/devices/system/cpu/cpu7/cpufreq/scaling_available_governors = performance powersave +/sys/devices/system/cpu/cpu7/cpufreq/scaling_min_freq = 800000 [kHz] +/sys/devices/system/cpu/cpu7/cpufreq/scaling_max_freq = 3500000 [kHz] +/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_preference = balance_power +/sys/devices/system/cpu/cpu7/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power + +/sys/devices/system/cpu/intel_pstate/min_perf_pct = 22 [%] +/sys/devices/system/cpu/intel_pstate/max_perf_pct = 100 [%] +/sys/devices/system/cpu/intel_pstate/no_turbo = 0 +/sys/devices/system/cpu/intel_pstate/turbo_pct = 33 [%] +/sys/devices/system/cpu/intel_pstate/num_pstates = 28 + +x86_energy_perf_policy: program not installed. + +/sys/module/workqueue/parameters/power_efficient = Y +/proc/sys/kernel/nmi_watchdog = 0 + ++++ Undervolting +PHC kernel not available. + ++++ Temperatures +CPU temp = 42 [°C] +Fan speed = (not available) + ++++ File System +/proc/sys/vm/laptop_mode = 2 +/proc/sys/vm/dirty_writeback_centisecs = 6000 +/proc/sys/vm/dirty_expire_centisecs = 6000 +/proc/sys/vm/dirty_ratio = 20 +/proc/sys/vm/dirty_background_ratio = 10 + ++++ Storage Devices +/dev/sda: + Model = WDC WD10SPCX-24HWST1 + Firmware = 02.01A02 + APM Level = 128 + Status = active/idle + Scheduler = mq-deadline + + Runtime PM: control = on, autosuspend_delay = (not available) + + SMART info: + 4 Start_Stop_Count = 18787 + 5 Reallocated_Sector_Ct = 0 + 9 Power_On_Hours = 606 [h] + 12 Power_Cycle_Count = 1792 + 193 Load_Cycle_Count = 25777 + 194 Temperature_Celsius = 31 [°C] + + ++++ AHCI Link Power Management (ALPM) +/sys/class/scsi_host/host0/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host1/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host2/link_power_management_policy = med_power_with_dipm +/sys/class/scsi_host/host3/link_power_management_policy = med_power_with_dipm + ++++ AHCI Host Controller Runtime Power Management +/sys/bus/pci/devices/0000:00:17.0/ata1/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata2/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata3/power/control = on +/sys/bus/pci/devices/0000:00:17.0/ata4/power/control = on + ++++ PCIe Active State Power Management +/sys/module/pcie_aspm/parameters/policy = powersave + ++++ Intel Graphics +/sys/module/i915/parameters/enable_dc = -1 (use per-chip default) +/sys/module/i915/parameters/enable_fbc = 1 (enabled) +/sys/module/i915/parameters/enable_psr = 0 (disabled) +/sys/module/i915/parameters/modeset = -1 (use per-chip default) + ++++ Wireless +bluetooth = on +wifi = on +wwan = none (no device) + +hci0(btusb) : bluetooth, not connected +wlp8s0(iwlwifi) : wifi, connected, power management = on + ++++ Audio +/sys/module/snd_hda_intel/parameters/power_save = 1 +/sys/module/snd_hda_intel/parameters/power_save_controller = Y + ++++ Runtime Power Management +Device blacklist = (not configured) +Driver blacklist = amdgpu nouveau nvidia radeon pcieport + +/sys/bus/pci/devices/0000:00:00.0/power/control = auto (0x060000, Host bridge, skl_uncore) +/sys/bus/pci/devices/0000:00:01.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:02.0/power/control = auto (0x030000, VGA compatible controller, i915) +/sys/bus/pci/devices/0000:00:14.0/power/control = auto (0x0c0330, USB controller, xhci_hcd) +/sys/bus/pci/devices/0000:00:16.0/power/control = auto (0x078000, Communication controller, mei_me) +/sys/bus/pci/devices/0000:00:17.0/power/control = auto (0x010601, SATA controller, ahci) +/sys/bus/pci/devices/0000:00:1c.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1c.2/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1c.3/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1d.0/power/control = auto (0x060400, PCI bridge, pcieport) +/sys/bus/pci/devices/0000:00:1f.0/power/control = auto (0x060100, ISA bridge, no driver) +/sys/bus/pci/devices/0000:00:1f.2/power/control = auto (0x058000, Memory controller, no driver) +/sys/bus/pci/devices/0000:00:1f.3/power/control = auto (0x040300, Audio device, snd_hda_intel) +/sys/bus/pci/devices/0000:00:1f.4/power/control = auto (0x0c0500, SMBus, i801_smbus) +/sys/bus/pci/devices/0000:01:00.0/power/control = auto (0x030200, 3D controller, nouveau) +/sys/bus/pci/devices/0000:07:00.0/power/control = auto (0x080501, SD Host controller, sdhci-pci) +/sys/bus/pci/devices/0000:08:00.0/power/control = auto (0x028000, Network controller, iwlwifi) +/sys/bus/pci/devices/0000:09:00.0/power/control = auto (0x020000, Ethernet controller, r8168) +/sys/bus/pci/devices/0000:0a:00.0/power/control = auto (0x010802, Non-Volatile memory controller, nvme) + ++++ USB +Autosuspend = disabled +Device whitelist = (not configured) +Device blacklist = (not configured) +Bluetooth blacklist = disabled +Phone blacklist = disabled +WWAN blacklist = enabled + +Bus 002 Device 001 ID 1d6b:0003 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 3.0 root hub (hub) +Bus 001 Device 003 ID 174f:14e8 control = auto, autosuspend_delay_ms = 2000 -- Syntek (uvcvideo) +Bus 001 Device 002 ID 17ef:6053 control = on, autosuspend_delay_ms = 2000 -- Lenovo (usbhid) +Bus 001 Device 004 ID 8087:0a2b control = auto, autosuspend_delay_ms = 2000 -- Intel Corp. (btusb) +Bus 001 Device 001 ID 1d6b:0002 control = auto, autosuspend_delay_ms = 0 -- Linux Foundation 2.0 root hub (hub) + ++++ Battery Status +/sys/class/power_supply/BAT0/manufacturer = SMP +/sys/class/power_supply/BAT0/model_name = L14M4P23 +/sys/class/power_supply/BAT0/cycle_count = (not supported) +/sys/class/power_supply/BAT0/energy_full_design = 60000 [mWh] +/sys/class/power_supply/BAT0/energy_full = 51690 [mWh] +/sys/class/power_supply/BAT0/energy_now = 50140 [mWh] +/sys/class/power_supply/BAT0/power_now = 12185 [mW] +/sys/class/power_supply/BAT0/status = Discharging + +Charge = 97.0 [%] +Capacity = 86.2 [%] +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/tlp-increase-optimize-linux-laptop-battery-life/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/ +[2]: https://www.2daygeek.com/powertop-monitors-laptop-battery-usage-linux/ +[3]: https://www.2daygeek.com/monitor-laptop-battery-charging-state-linux/ +[4]: https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-management.html +[5]: https://www.2daygeek.com/category/package-management/ +[6]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/ +[7]: https://www.2daygeek.com/apt-get-apt-cache-command-examples-manage-packages-debian-ubuntu-systems/ +[8]: https://www.2daygeek.com/apt-command-examples-manage-packages-debian-ubuntu-systems/ +[9]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/ +[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[11]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/ From ac3e44e5b9e5ef0cae6e8020e47d0cf2eaccbba9 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 17:18:46 +0800 Subject: [PATCH 57/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=204=20Unique=20Termin?= =?UTF-8?q?al=20Emulators=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4 4 Unique Terminal Emulators for Linux.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/tech/20181204 4 Unique Terminal Emulators for Linux.md diff --git a/sources/tech/20181204 4 Unique Terminal Emulators for Linux.md b/sources/tech/20181204 4 Unique Terminal Emulators for Linux.md new file mode 100644 index 0000000000..04110b670e --- /dev/null +++ b/sources/tech/20181204 4 Unique Terminal Emulators for Linux.md @@ -0,0 +1,169 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 Unique Terminal Emulators for Linux) +[#]: via: (https://www.linux.com/blog/learn/2018/12/4-unique-terminals-linux) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) + +4 Unique Terminal Emulators for Linux +====== +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_main.jpg?itok=e6av-5VO) +Let’s face it, if you’re a Linux administrator, you’re going to work with the command line. To do that, you’ll be using a terminal emulator. Most likely, your distribution of choice came pre-installed with a default terminal emulator that gets the job done. But this is Linux, so you have a wealth of choices to pick from, and that ideology holds true for terminal emulators as well. In fact, if you open up your distribution’s GUI package manager (or search from the command line), you’ll find a trove of possible options. Of those, many are pretty straightforward tools; however, some are truly unique. + +In this article, I’ll highlight four such terminal emulators, that will not only get the job done, but do so while making the job a bit more interesting or fun. So, let’s take a look at these terminals. + +### Tilda + +[Tilda][1] is designed for Gtk and is a member of the cool drop-down family of terminals. That means the terminal is always running in the background, ready to drop down from the top of your monitor (such as Guake and Yakuake). What makes Tilda rise above many of the others is the number of configuration options available for the terminal (Figure 1). +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_1.jpg?itok=bra6qb6X) + +Tilda can be installed from the standard repositories. On a Ubuntu- (or Debian-) based distribution, the installation is as simple as: + +``` +sudo apt-get install tilda -y +``` + +Once installed, open Tilda from your desktop menu, which will also open the configuration window. Configure the app to suit your taste and then close the configuration window. You can then open and close Tilda by hitting the F1 hotkey. One caveat to using Tilda is that, after the first run, you won’t find any indication as to how to reach the configuration wizard. No worries. If you run the command tilda -C it will open the configuration window, while still retaining the options you’ve previously set. + +Available options include: + + * Terminal size and location + + * Font and color configurations + + * Auto Hide + + * Title + + * Custom commands + + * URL Handling + + * Transparency + + * Animation + + * Scrolling + + * And more + + + + +What I like about these types of terminals is that they easily get out of the way when you don’t need them and are just a button click away when you do. For those that hop in and out of the terminal, a tool like Tilda is ideal. + +### Aterm + +Aterm holds a special place in my heart, as it was one of the first terminals I used that made me realize how flexible Linux was. This was back when AfterStep was my window manager of choice (which dates me a bit) and I was new to the command line. What Aterm offered was a terminal emulator that was highly customizable, while helping me learn the ins and outs of using the terminal (how to add options and switches to a command). “How?” you ask. Because Aterm never had a GUI for customization. To run Aterm with any special options, it had to run as a command. For example, say you want to open Aterm with transparency enabled, green text, white highlights, and no scroll bar. To do this, issue the command: + +``` +aterm -tr -fg green -bg white +xb +``` + +The end result (with the top command running for illustration) would look like that shown in Figure 2. + +![Aterm][3] + +Figure 2: Aterm with a few custom options. + +[Used with permission][4] + +Of course, you must first install Aterm. Fortunately, the application is still found in the standard repositories, so installing on the likes of Ubuntu is as simple as: + +``` +sudo apt-get install aterm -y +``` + +If you want to always open Aterm with those options, your best bet is to create an alias in your ~/.bashrc file like so: + +``` +alias=”aterm -tr -fg green -bg white +sb” +``` + +Save that file and, when you issue the command aterm, it will always open with those options. For more about creating aliases, check out [this tutorial][5]. + +### Eterm + +Eterm is the second terminal that really showed me how much fun the Linux command line could be. Eterm is the default terminal emulator for the Enlightenment desktop. When I eventually migrated from AfterStep to Enlightenment (back in the early 2000s), I was afraid I’d lose out on all those cool aesthetic options. That turned out to not be the case. In fact, Eterm offered plenty of unique options, while making the task easier with a terminal toolbar. With Eterm, you can easily select from a large number of background images (should you want one - Figure 3) by selecting from the Background > Pixmap menu entry. + +![Eterm][7] + +Figure 3: Selecting from one of the many background images for Eterm. + +[Used with permission][4] + +There are a number of other options to configure (such as font size, map alerts, toggle scrollbar, brightness, contrast, and gamma of background images, and more). The one thing you want to make sure is, after you’ve configured Eterm to suit your tastes, to click Eterm > Save User Settings (otherwise, all settings will be lost when you close the app). + +Eterm can be installed from the standard repositories, with a command such as: + +``` +sudo apt-get install eterm +``` + +### Extraterm + +[Extraterm][8] should probably win a few awards for coolest feature set of any terminal window project available today. The most unique feature of Extraterm is the ability to wrap commands in color-coded frames (blue for successful commands and red for failed commands - Figure 4). + +![Extraterm][10] + +Figure 4: Extraterm showing two failed command frames. + +[Used with permission][4] + +When you run a command, Extraterm will wrap the command in an isolated frame. If the command succeeds, the frame will be outlined in blue. Should the command fail, the frame will be outlined in red. + +Extraterm cannot be installed via the standard repositories. In fact, the only way to run Extraterm on Linux (at the moment) is to [download the precompiled binary][11] from the project’s GitHub page, extract the file, change into the newly created directory, and issue the command ./extraterm. + +Once the app is running, to enable frames you must first enable bash integration. To do that, open Extraterm and then right-click anywhere in the window to reveal the popup menu. Scroll until you see the entry for Inject Bash shell Integration (Figure 5). Select that entry and you can then begin using the frames option. + +![Extraterm][13] + +Figure 5: Injecting Bash integration for Extraterm. + +[Used with permission][4] + +If you run a command, and don’t see a frame appear, you probably have to create a new frame for the command (as Extraterm only ships with a few default frames). To do that, click on the Extraterm menu button (three horizontal lines in the top right corner of the window), select Settings, and then click the Frames tab. In this window, scroll down and click the New Rule button. You can then add a command you want to work with the frames option (Figure 6). + +![frames][15] + +Figure 6: Adding a new rule for frames. + +[Used with permission][4] + +If, after this, you still don’t see frames appearing, download the extraterm-commands file from the [Download page][11], extract the file, change into the newly created directory, and issue the command sh setup_extraterm_bash.sh. That should enable frames for Extraterm. +There’s plenty more options available for Extraterm. I’m convinced, once you start playing around with this new take on the terminal window, you won’t want to go back to the standard terminal. Hopefully the developer will make this app available to the standard repositories soon (as it could easily become one of the most popular terminal windows in use). + +### And Many More + +As you probably expected, there are quite a lot of terminals available for Linux. These four represent (at least for me) four unique takes on the task, each of which do a great job of helping you run the commands every Linux admin needs to run. If you aren’t satisfied with one of these, give your package manager a look to see what’s available. You are sure to find something that works perfectly for you. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/2018/12/4-unique-terminals-linux + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/jlwallen +[b]: https://github.com/lujun9972 +[1]: http://tilda.sourceforge.net/tildadoc.php +[2]: https://www.linux.com/files/images/terminals2jpg +[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_2.jpg?itok=gBkRLwDI (Aterm) +[4]: https://www.linux.com/licenses/category/used-permission +[5]: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands +[6]: https://www.linux.com/files/images/terminals3jpg +[7]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_3.jpg?itok=RVPTJAtK (Eterm) +[8]: http://extraterm.org +[9]: https://www.linux.com/files/images/terminals4jpg +[10]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_4.jpg?itok=2n01qdwO (Extraterm) +[11]: https://github.com/sedwards2009/extraterm/releases +[12]: https://www.linux.com/files/images/terminals5jpg +[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_5.jpg?itok=FdaE1Mpf (Extraterm) +[14]: https://www.linux.com/files/images/terminals6jpg +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/terminals_6.jpg?itok=lQ1Zv5wq (frames) From fbc982cce4ebcc088161997d1b87e313020e4104 Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 17:26:20 +0800 Subject: [PATCH 58/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20resolutions=20f?= =?UTF-8?q?or=20open=20source=20project=20maintainers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ons for open source project maintainers.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/talk/20181212 5 resolutions for open source project maintainers.md diff --git a/sources/talk/20181212 5 resolutions for open source project maintainers.md b/sources/talk/20181212 5 resolutions for open source project maintainers.md new file mode 100644 index 0000000000..122cc3f2d2 --- /dev/null +++ b/sources/talk/20181212 5 resolutions for open source project maintainers.md @@ -0,0 +1,64 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 resolutions for open source project maintainers) +[#]: via: (https://opensource.com/article/18/12/resolutions-open-source-project-maintainers) +[#]: author: (Ben Cotton https://opensource.com/users/bcotton) + +5 resolutions for open source project maintainers +====== +No matter how you say it, good communication is essential to strong open source communities. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spark_sparkler_fire_new_year_idea.png?itok=rnyMpVP8) + +I'm generally not big on New Year's resolutions. I have no problem with self-improvement, of course, but I tend to anchor around other parts of the calendar. Even so, there's something about taking down this year's free calendar and replacing it with next year's that inspires some introspection. + +In 2017, I resolved to not share articles on social media until I'd read them. I've kept to that pretty well, and I'd like to think it has made me a better citizen of the internet. For 2019, I'm thinking about resolutions to make me a better open source software maintainer. + +Here are some resolutions I'll try to stick to on the projects where I'm a maintainer or co-maintainer. + +### 1\. Include a code of conduct + +Jono Bacon included "not enforcing the code of conduct" in his article "[7 mistakes you're probably making][1]." Of course, to enforce a code of conduct, you must first have a code of conduct. I plan on defaulting to the [Contributor Covenant][2], but you can use whatever you like. As with licenses, it's probably best to use one that's already written instead of writing your own. But the important thing is to find something that defines how you want your community to behave, whatever that looks like. Once it's written down and enforced, people can decide for themselves if it looks like the kind of community they want to be a part of. + +### 2\. Make the license clear and specific + +You know what really stinks? Unclear licenses. "This software is licensed under the GPL" with no further text doesn't tell me much. Which version of the [GPL][3]? Do I get to pick? For non-code portions of a project, "licensed under a Creative Commons license" is even worse. I love the [Creative Commons licenses][4], but there are several different licenses with significantly different rights and obligations. So, I will make it very clear which variant and version of a license applies to my projects. I will include the full text of the license in the repo and a concise note in the other files. + +Sort of related to this is using an [OSI][5]-approved license. It's tempting to come up with a new license that says exactly what you want it to say, but good luck if you ever need to enforce it. Will it hold up? Will the people using your project understand it? + +### 3\. Triage bug reports and questions quickly + +Few things in technology scale as poorly as open source maintainers. Even on small projects, it can be hard to find the time to answer every question and fix every bug. But that doesn't mean I can't at least acknowledge the person. It doesn't have to be a multi-paragraph reply. Even just labeling the GitHub issue shows that I saw it. Maybe I'll get to it right away. Maybe I'll get to it a year later. But it's important for the community to see that, yes, there is still someone here. + +### 4\. Don't push features or bug fixes without accompanying documentation + +For as much as my open source contributions over the years have revolved around documentation, my projects don't reflect the importance I put on it. There aren't many commits I can push that don't require some form of documentation. New features should obviously be documented at (or before!) the time they're committed. But even bug fixes should get an entry in the release notes. If nothing else, a push is a good opportunity to also make a commit to improving the docs. + +### 5\. Make it clear when I'm abandoning a project + +I'm really bad at saying "no" to things. I told the editors I'd write one or two articles for [Opensource.com][6] and here I am almost 60 articles later. Oops. But at some point, the things that once held my interests no longer do. Maybe the project is unnecessary because its functionality got absorbed into a larger project. Maybe I'm just tired of it. But it's unfair to the community (and potentially dangerous, as the recent [event-stream malware injection][7] showed) to leave a project in limbo. Maintainers have the right to walk away whenever and for whatever reason, but it should be clear that they have. + +Whether you're an open source maintainer or contributor, if you know other resolutions project maintainers should make, please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/resolutions-open-source-project-maintainers + +作者:[Ben Cotton][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/article/17/8/mistakes-open-source-avoid +[2]: https://www.contributor-covenant.org/ +[3]: https://opensource.org/licenses/gpl-license +[4]: https://creativecommons.org/share-your-work/licensing-types-examples/ +[5]: https://opensource.org/ +[6]: http://Opensource.com +[7]: https://arstechnica.com/information-technology/2018/11/hacker-backdoors-widely-used-open-source-software-to-steal-bitcoin/ From 1853cb8d91423c81742a97afb339f6d154255f3e Mon Sep 17 00:00:00 2001 From: darksun Date: Fri, 21 Dec 2018 17:29:48 +0800 Subject: [PATCH 59/69] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Podman=20and=20user?= =?UTF-8?q?=20namespaces:=20A=20marriage=20made=20in=20heaven?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r namespaces- A marriage made in heaven.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20181213 Podman and user namespaces- A marriage made in heaven.md diff --git a/sources/tech/20181213 Podman and user namespaces- A marriage made in heaven.md b/sources/tech/20181213 Podman and user namespaces- A marriage made in heaven.md new file mode 100644 index 0000000000..adc14c6111 --- /dev/null +++ b/sources/tech/20181213 Podman and user namespaces- A marriage made in heaven.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Podman and user namespaces: A marriage made in heaven) +[#]: via: (https://opensource.com/article/18/12/podman-and-user-namespaces) +[#]: author: (Daniel J Walsh https://opensource.com/users/rhatdan) + +Podman and user namespaces: A marriage made in heaven +====== +Learn how to use Podman to run containers in separate user namespaces. +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/architecture_structure_planning_design_.png?itok=KL7dIDct) + +[Podman][1], part of the [libpod][2] library, enables users to manage pods, containers, and container images. In my last article, I wrote about [Podman as a more secure way to run containers][3]. Here, I'll explain how to use Podman to run containers in separate user namespaces. + +I have always thought of [user namespace][4], primarily developed by Red Hat's Eric Biederman, as a great feature for separating containers. User namespace allows you to specify a user identifier (UID) and group identifier (GID) mapping to run your containers. This means you can run as UID 0 inside the container and UID 100000 outside the container. If your container processes escape the container, the kernel will treat them as UID 100000. Not only that, but any file object owned by a UID that isn't mapped into the user namespace will be treated as owned by "nobody" (65534, kernel.overflowuid), and the container process will not be allowed access unless the object is accessible by "other" (world readable/writable). + +If you have a file owned by "real" root with permissions [660][5], and the container processes in the user namespace attempt to read it, they will be prevented from accessing it and will see the file as owned by nobody. + +### An example + +Here's how that might work. First, I create a file in my system owned by root. + +``` +$ sudo bash -c "echo Test > /tmp/test" +$ sudo chmod 600 /tmp/test +$ sudo ls -l /tmp/test +-rw-------. 1 root root 5 Dec 17 16:40 /tmp/test +``` + +Next, I volume-mount the file into a container running with a user namespace map 0:100000:5000. + +``` +$ sudo podman run -ti -v /tmp/test:/tmp/test:Z --uidmap 0:100000:5000 fedora sh +# id +uid=0(root) gid=0(root) groups=0(root) +# ls -l /tmp/test +-rw-rw----. 1 nobody nobody 8 Nov 30 12:40 /tmp/test +# cat /tmp/test +cat: /tmp/test: Permission denied +``` + +The **\--uidmap** setting above tells Podman to map a range of 5000 UIDs inside the container, starting with UID 100000 outside the container (so the range is 100000-104999) to a range starting at UID 0 inside the container (so the range is 0-4999). Inside the container, if my process is running as UID 1, it is 100001 on the host + +Since the real UID=0 is not mapped into the container, any file owned by root will be treated as owned by nobody. Even if the process inside the container has **CAP_DAC_OVERRIDE** , it can't override this protection. **DAC_OVERRIDE** enables root processes to read/write any file on the system, even if the process was not owned by root or world readable or writable. + +User namespace capabilities are not the same as capabilities on the host. They are namespaced capabilities. This means my container root has capabilities only within the container—really only across the range of UIDs that were mapped into the user namespace. If a container process escaped the container, it wouldn't have any capabilities over UIDs not mapped into the user namespace, including UID=0. Even if the processes could somehow enter another container, they would not have those capabilities if the container uses a different range of UIDs. + +Note that SELinux and other technologies also limit what would happen if a container process broke out of the container. + +### Using `podman top` to show user namespaces + +We have added features to **podman top** to allow you to examine the usernames of processes running inside a container and identify their real UIDs on the host. + +Let's start by running a sleep container using our UID mapping. + +``` +$ sudo podman run --uidmap 0:100000:5000 -d fedora sleep 1000 +``` + +Now run **podman top** : + +``` +$ sudo podman top --latest user huser +USER   HUSER +root   100000 + +$ ps -ef | grep sleep +100000   21821 21809  0 08:04 ?         00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 1000 +``` + +Notice **podman top** reports that the user process is running as root inside the container but as UID 100000 on the host (HUSER). Also the **ps** command confirms that the sleep process is running as UID 100000. + +Now let's run a second container, but this time we will choose a separate UID map starting at 200000. + +``` +$ sudo podman run --uidmap 0:200000:5000 -d fedora sleep 1000 +$ sudo podman top --latest user huser +USER   HUSER +root   200000 + +$ ps -ef | grep sleep +100000   21821 21809  0 08:04 ?         00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 1000 +200000   23644 23632  1 08:08 ?         00:00:00 /usr/bin/coreutils --coreutils-prog-shebang=sleep /usr/bin/sleep 1000 +``` + +Notice that **podman top** reports the second container is running as root inside the container but as UID=200000 on the host. + +Also look at the **ps** command—it shows both sleep processes running: one as 100000 and the other as 200000. + +This means running the containers inside separate user namespaces gives you traditional UID separation between processes, which has been the standard security tool of Linux/Unix from the beginning. + +### Problems with user namespaces + +For several years, I've advocated user namespace as the security tool everyone wants but hardly anyone has used. The reason is there hasn't been any filesystem support or a shifting file system. + +In containers, you want to share the **base** image between lots of containers. The examples above use the Fedora base image in each example. Most of the files in the Fedora image are owned by real UID=0. If I run a container on this image with the user namespace 0:100000:5000, by default it sees all of these files as owned by nobody, so we need to shift all of these UIDs to match the user namespace. For years, I've wanted a mount option to tell the kernel to remap these file UIDs to match the user namespace. Upstream kernel storage developers continue to investigate and make progress on this feature, but it is a difficult problem. + + +Podman can use different user namespaces on the same image because of automatic [chowning][6] built into [containers/storage][7] by a team led by Nalin Dahyabhai. Podman uses containers/storage, and the first time Podman uses a container image in a new user namespace, container/storage "chowns" (i.e., changes ownership for) all files in the image to the UIDs mapped in the user namespace and creates a new image. Think of this as the **fedora:0:100000:5000** image. + +When Podman runs another container on the image with the same UID mappings, it uses the "pre-chowned" image. When I run the second container on 0:200000:5000, containers/storage creates a second image, let's call it **fedora:0:200000:5000**. + +Note if you are doing a **podman build** or **podman commit** and push the newly created image to a container registry, Podman will use container/storage to reverse the shift and push the image with all files chowned back to real UID=0. + +This can cause a real slowdown in creating containers in new UID mappings since the **chown** can be slow depending on the number of files in the image. Also, on a normal [OverlayFS][8], every file in the image gets copied up. The normal Fedora image can take up to 30 seconds to finish the chown and start the container. + +Luckily, the Red Hat kernel storage team, primarily Vivek Goyal and Miklos Szeredi, added a new feature to OverlayFS in kernel 4.19. The feature is called **metadata only copy-up**. If you mount an overlay filesystem with **metacopy=on** as a mount option, it will not copy up the contents of the lower layers when you change file attributes; the kernel creates new inodes that include the attributes with references pointing at the lower-level data. It will still copy up the contents if the content changes. This functionality is available in the Red Hat Enterprise Linux 8 Beta, if you want to try it out. + +This means container chowning can happen in a couple of seconds, and you won't double the storage space for each container. + +This makes running containers with tools like Podman in separate user namespaces viable, greatly increasing the security of the system. + +### Going forward + +I want to add a new flag, like **\--userns=auto** , to Podman that will tell it to automatically pick a unique user namespace for each container you run. This is similar to the way SELinux works with separate multi-category security (MCS) labels. If you set the environment variable **PODMAN_USERNS=auto** , you won't even need to set the flag. + +Podman is finally allowing users to run containers in separate user namespaces. Tools like [Buildah][9] and [CRI-O][10] will also be able to take advantage of user namespaces. For CRI-O, however, Kubernetes needs to understand which user namespace will run the container engine, and the upstream is working on that. + +In my next article, I will explain how to run Podman as non-root in a user namespace. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/12/podman-and-user-namespaces + +作者:[Daniel J Walsh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rhatdan +[b]: https://github.com/lujun9972 +[1]: https://podman.io/ +[2]: https://github.com/containers/libpod +[3]: https://opensource.com/article/18/10/podman-more-secure-way-run-containers +[4]: http://man7.org/linux/man-pages/man7/user_namespaces.7.html +[5]: https://chmodcommand.com/chmod-660/ +[6]: https://en.wikipedia.org/wiki/Chown +[7]: https://github.com/containers/storage +[8]: https://en.wikipedia.org/wiki/OverlayFS +[9]: https://buildah.io/ +[10]: http://cri-o.io/ From 1a70f8d07deb2cac814ad349136a3c13f5c912c8 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Fri, 21 Dec 2018 20:44:38 +0800 Subject: [PATCH 60/69] Translated by qhwdw --- ...2 How to Build a Netboot Server, Part 2.md | 127 +++++++++--------- 1 file changed, 63 insertions(+), 64 deletions(-) rename {sources => translated}/tech/20181212 How to Build a Netboot Server, Part 2.md (63%) diff --git a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md b/translated/tech/20181212 How to Build a Netboot Server, Part 2.md similarity index 63% rename from sources/tech/20181212 How to Build a Netboot Server, Part 2.md rename to translated/tech/20181212 How to Build a Netboot Server, Part 2.md index 1d1ce2f68f..8887d84ba1 100644 --- a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md +++ b/translated/tech/20181212 How to Build a Netboot Server, Part 2.md @@ -1,28 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (qhwdw) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: () +[#]: publisher: () +[#]: url: () [#]: subject: (How to Build a Netboot Server, Part 2) [#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) -How to Build a Netboot Server, Part 2 +如何构建一台网络引导服务器(第二部分) ====== ![](https://fedoramagazine.org/wp-content/uploads/2018/12/netboot2-816x345.jpg) -The article [How to Build a Netboot Server, Part 1][1] showed you how to create a netboot image with a “liveuser” account whose home directory lives in volatile memory. Most users probably want to preserve files and settings across reboots, though. So this second part of the netboot series shows how to reconfigure the netboot image from part one so that [Active Directory][2] user accounts can log in and their home directories can be automatically mounted from a NFS server. +在 [如何构建一台网络引导服务器(第一部分)][1] 的文章中,我们展示了如何创建一个网络引导镜像,在那个镜像中使用了一个名为 “liveuser” 帐户,它的 home 目录位于内存中,重启后 home 中的内容将全部消失。然而很多用户都希望机器重启后保存他们的文件和设置。因此,在本系列的第二部分,我们将向你展示如何在第一部分的基础上,重新配置网络引导镜像,使它能够使用 [活动目录][2] 中的用户帐户进行登陆,然后能够从一个 NFS 服务器上自动挂载他们的 home 目录。 -Part 3 of this series will show how to make an interactive and centrally-configurable iPXE boot menu for the netboot clients. +本系列的第三部分,我们将向你展示网络引导客户端如何与中心化配置的 iPXE 引导菜单进行交互。 -### Setup NFS4 Home Directories with KRB5 Authentication +### 设置使用 KRB5 认证的 NFS4 Home 目录 -Follow the directions from the previous post “[Share NFS Home Directories Securely with Kerberos][3],” then return here. +按以前的文章 “[使用 Kerberos 强化共享的 NFS Home 目录安全性][3]” 的指导来做这个设置。 -### Remove the Liveuser Account +### 删除 Liveuser 帐户 -Remove the “liveuser” account created in part one of this series: +删除本系列文章第一部分中创建的 “liveuser” 帐户: ``` $ sudo -i @@ -31,9 +31,9 @@ $ sudo -i # for i in passwd shadow group gshadow; do sed -i '/^liveuser:/d' /fc28/etc/$i; done ``` -### Configure NTP, KRB5 and SSSD +### 配置 NTP、KRB5 和 SSSD -Next, we will need to duplicate the NTP, KRB5, and SSSD configuration that we set up on the server in the client image so that the same accounts will be available: +接下来,我们需要将 NTP、KRB5、和 SSSD 的配置文件复制进客户端使用的镜像中,以便于它们能够使用同一个帐户: ``` # MY_HOSTNAME=$(> /fc28/etc/$i; done ``` -### Join Active Directory +### 连接活动目录 -Next, you’ll perform a chroot to join the client image to Active Directory. Begin by deleting any pre-existing computer account with the same name your netboot image will use: +接下来,你将执行一个 chroot 将客户端镜像连接到活动目录。从删除预置在网络引导镜像中相同的计算机帐户开始: ``` # MY_USERNAME=jsmith @@ -73,20 +73,20 @@ Next, you’ll perform a chroot to join the client image to Active Directory. Be # adcli delete-computer "${MY_CLIENT_HOSTNAME%%.*}" -U "$MY_USERNAME" ``` -Also delete the krb5.keytab file from the netboot image if it exists: +在网络引导镜像中如果有 krb5.keytab 文件,也删除它: ``` # rm -f /fc28/etc/krb5.keytab ``` -Perform a chroot into the netboot image: +在网络引导镜像中执行一个 chroot 操作: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done # chroot /fc28 /usr/bin/bash --login ``` -Perform the join: +执行一个 join 操作: ``` # MY_USERNAME=jsmith @@ -97,7 +97,7 @@ Perform the join: # adcli join $MY_DOMAIN --login-user="$MY_USERNAME" --computer-name="${MY_HOSTNAME%%.*}" --host-fqdn="$MY_HOSTNAME" --user-principal="host/$MY_HOSTNAME@$MY_REALM" --domain-ou="$MY_OU" ``` -Now log out of the chroot and clear the root user’s command history: +现在登出 chroot,并清除命令历史: ``` # logout @@ -105,9 +105,9 @@ Now log out of the chroot and clear the root user’s command history: # > /fc28/root/.bash_history ``` -### Install and Configure PAM Mount +### 安装和配置 PAM Mount -We want our clients to automatically mount the user’s home directory when they log in. To accomplish this, we’ll use the “pam_mount” module. Install and configure pam_mount: +我们希望客户端登入后自动挂载它的 home 目录。为实现这个目的,我们将要使用 “pam_mount” 模块。安装和配置 pam_mount: ``` # dnf install -y --installroot=/fc28 pam_mount @@ -123,7 +123,7 @@ We want our clients to automatically mount the user’s home directory when they END ``` -Reconfigure PAM to use pam_mount: +重新配置 PAM 去使用 pam_mount: ``` # dnf install -y patch @@ -152,24 +152,24 @@ END # chroot /fc28 authselect select custom/sssd with-pammount --force ``` -Also ensure the NFS server’s hostname is always resolvable from the client: +另外,要确保从客户端上总是可解析 NFS 服务器的主机名: ``` # MY_IP=$(host -t A $MY_HOSTNAME | awk '{print $4}') # echo "$MY_IP $MY_HOSTNAME ${MY_HOSTNAME%%.*}" >> /fc28/etc/hosts ``` -Optionally, allow all users to run sudo: +可选,允许所有用户去使用 sudo: ``` # echo '%users ALL=(ALL) NOPASSWD: ALL' > /fc28/etc/sudoers.d/users ``` -### Convert the NFS Root to an iSCSI Backing-Store +### 转换 NFS Root 到一个 iSCSI 背后的存储 -Current versions of nfs-utils may have difficulty establishing a second connection from the client back to the NFS server for home directories when an nfsroot connection is already established. The client hangs when attempting to access the home directory. So, we will work around the problem by using a different protocol (iSCSI) for sharing our netboot image. +在一个 nfsroot 连接建立之后,目前版本的 nfs-utils 可能很难为 home 目录维护一个从客户端到 NFS 服务器的二次连接。当尝试去访问 home 目录时,客户端将被挂住。因此,为了网络引导镜像可共享使用,我们将使用一个不同的协议(iSCSI)来解决这个问题。 -First chroot into the image to reconfigure its initramfs for booting from an iSCSI root: +首先 chroot 到镜像中,去重新配置它的 initramfs,让它从一个 iSCSI root 中去引导: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done @@ -186,18 +186,18 @@ First chroot into the image to reconfigure its initramfs for booting from an iSC # > /fc28/root/.bash_history ``` -The qedi driver broke iscsi during testing, so it’s been disabled here. +在测试时,qedi 驱动会破坏 iscsi,因此我们将它禁用。 -Next, create a fc28.img [sparse file][4]. This file serves as the iSCSI target’s backing store: +接着,创建一个 fc28.img 的 [稀疏文件][4]。这个稀疏文件代表 iSCSI 目标的背后存储: ``` # FC28_SIZE=$(du -ms /fc28 | cut -f 1) # dd if=/dev/zero of=/fc28.img bs=1MiB count=0 seek=$(($FC28_SIZE*2)) ``` -(If you have one available, a separate partition or disk drive can be used instead of creating a file.) +(如果你有一个可使用的稀疏文件、一个单独的分区或磁盘驱动器,就可以代替它了,不用再去创建这个稀疏文件了。) -Next, format the image with a filesystem, mount it, and copy the netboot image into it: +接着,使用一个文件系统去格式化镜像、挂载它、然后将网络引导镜像复制进去: ``` # mkfs -t xfs -L NETROOT /fc28.img @@ -207,19 +207,19 @@ Next, format the image with a filesystem, mount it, and copy the netboot image i # umount $TEMP_MNT ``` -During testing using SquashFS, the client would occasionally stutter. It seems that SquashFS does not perform well when doing random I/O from a multiprocessor client. (See also [The curious case of stalled squashfs reads][5].) If you want to improve throughput performance with filesystem compression, [ZFS][6] is probably a better option. +在使用 SquashFS 测试时,客户端偶尔会出现小状况。似乎是因为 SquashFS 在多处理器客户端上没法执行一个随机 I/O。(更多内容见 [squashfs 读取卡顿的奇怪案例][5])。如果你希望使用一个压缩文件系统来提升吞吐性能,[ZFS][6] 或许是个很好的选择。 -If you need extremely high throughput from the iSCSI server (say, for hundreds of clients), it might be possible to [load balance][7] a [Ceph][8] cluster. For more information, see [Load Balancing Ceph Object Gateway Servers with HAProxy and Keepalived][9]. +如果你对 iSCSI 服务器的吞吐性能要求非常高(比如,成百上千的客户端要连接它),可能需要使用带 [负载均衡][7] 的 [Ceph][8] 集群了。更多相关内容,请查看 [使用 HAProxy 和 Keepalived 负载均衡的 Ceph 对象网关][9]。 -### Install and Configure iSCSI +### 安装和配置 iSCSI -Install the scsi-target-utils package which will provide the iSCSI daemon for serving our image out to our clients: +为了给我们的客户端提供网络引导镜像,安装 scsi-target-utils 包: ``` # dnf install -y scsi-target-utils ``` -Configure the iSCSI daemon to serve the fc28.img file: +配置 iSCSI 守护程序去提供 fc28.img 文件: ``` # MY_REVERSE_HOSTNAME=$(echo $MY_HOSTNAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_HOSTNAME}) @@ -231,9 +231,9 @@ Configure the iSCSI daemon to serve the fc28.img file: END ``` -The leading iqn. is expected by /usr/lib/dracut/modules.d/40network/net-lib.sh. +通过 /usr/lib/dracut/modules.d/40network/net-lib.sh 来指示预期的 iqn。 -Add an exception to the firewall and enable and start the service: +添加一个防火墙例外,并启用和启动这个服务: ``` # firewall-cmd --add-service=iscsi-target @@ -242,13 +242,13 @@ Add an exception to the firewall and enable and start the service: # systemctl start tgtd.service ``` -You should now be able to see the image being shared with the tgtadm command: +你现在应该能够使用 tatadm 命令看到这个共享后的镜像: ``` # tgtadm --mode target --op show ``` -The above command should output something similar to the following: +上述命令的输出应该类似如下的内容: ``` Target 1: iqn.edu.example.server-01:fc28 @@ -290,7 +290,7 @@ Target 1: iqn.edu.example.server-01:fc28 ALL ``` -We can now remove the NFS share that we created in part one of this series: +现在,我们可以去删除本系列文章的第一部分中创建的 NFS 共享了: ``` # rm -f /etc/exports.d/fc28.exports @@ -300,11 +300,11 @@ We can now remove the NFS share that we created in part one of this series: # sed -i '/^\/fc28 /d' /etc/fstab ``` -You can also delete the /fc28 filesystem, but you may want to keep it for performing future updates. +你也可以删除 /fc28 文件系统,但为了以后进一步更新,你可能需要保留它。 -### Update the ESP to use the iSCSI Kernel +### 更新 ESP 去使用 iSCSI 内核 -Ipdate the ESP to contain the iSCSI-enabled initramfs: +更新 ESP 去包含启用了 iSCSI 的 initramfs: ``` $ rm -vf $HOME/esp/linux/*.fc28.* @@ -313,7 +313,7 @@ $ cp $(find /fc28/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $MY_KRNL) $ cp $(find /fc28/boot -name 'init*' | grep -m 1 $MY_KRNL) $HOME/esp/linux/initramfs-$MY_KRNL.img ``` -Update the boot.cfg file to pass the new root and netroot parameters: +更新 boot.cfg 文件去传递新的 root 和 netroot 参数: ``` $ MY_NAME=server-01.example.edu @@ -322,52 +322,52 @@ $ MY_ADDR=$(host -t A $MY_NAME | awk '{print $4}') $ sed -i "s! root=[^ ]*! root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc28-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc28!" $HOME/esp/linux/boot.cfg ``` -Now you just need to copy the updated files from your $HOME/esp/linux directory out to the ESPs of all your client systems. You should see results similar to what is shown in the below screenshot: +现在,你只需要从 $HOME/esp/linux 目录中复制更新后的文件到所有客户端系统的 ESP 中。你应该会看到类似下面屏幕截图的结果: ![][10] -### Upgrading the Image +### 更新镜像 -First, make a copy of the current image: +首先,复制出一个当前镜像的副本: ``` # cp -a /fc28 /fc29 ``` -Chroot into the new copy of the image: +Chroot 进入到镜像的新副本: ``` # for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc29/$i; done # chroot /fc29 /usr/bin/bash --login ``` -Allow updating the kernel: +允许更新内核: ``` # sed -i 's/^exclude=kernel-\*$/#exclude=kernel-*/' /etc/dnf/dnf.conf ``` -Perform the upgrade: +执行升级: ``` # dnf distro-sync -y --releasever=29 ``` -Prevent the kernel from being updated: +阻止更新过的内核被再次更新: ``` # sed -i 's/^#exclude=kernel-\*$/exclude=kernel-*/' /etc/dnf/dnf.conf ``` -The above command is optional, but saves you from having to copy a new kernel out to the clients if you add or update a few packages in the image at some future time. +上述命令是可选的,但是在以后,如果在镜像中添加和更新了几个包,在你的客户端之外保存有一个最新内核的副本,会在关键时刻对你非常有帮助。 -Clean up dnf’s package cache: +清理 dnf 的包缓存: ``` # dnf clean all ``` -Exit the chroot and clear root’s command history: +退出 chroot 并清理 root 的命令历史: ``` # logout @@ -375,7 +375,7 @@ Exit the chroot and clear root’s command history: # > /fc29/root/.bash_history ``` -Create the iSCSI image: +创建 iSCSI 镜像: ``` # FC29_SIZE=$(du -ms /fc29 | cut -f 1) @@ -387,7 +387,7 @@ Create the iSCSI image: # umount $TEMP_MNT ``` -Define a new iSCSI target that points to our new image and export it: +定义一个新的 iSCSI 目标,指向到新的镜像并导出它: ``` # MY_HOSTNAME=$( Date: Fri, 21 Dec 2018 22:32:27 +0800 Subject: [PATCH 61/69] Translating by qhwdw --- ...th PGP - Part 4- Moving Your Master Key to Offline Storage.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md b/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md index df00e7e05e..30c1bba4d5 100644 --- a/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md +++ b/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md @@ -1,3 +1,4 @@ +Translating by qhwdw Protecting Code Integrity with PGP — Part 4: Moving Your Master Key to Offline Storage ====== From 9ff115581de2af14e4a2ecf7db3fefa052eaedeb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 00:20:55 +0800 Subject: [PATCH 62/69] PRF:20180710 Users, Groups, and Other Linux Beasts.md @MjSeven --- ...0 Users, Groups, and Other Linux Beasts.md | 59 ++++++++++++------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md b/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md index 477d317d9f..65cbacecb2 100644 --- a/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md +++ b/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md @@ -1,51 +1,58 @@ -用户,组和其他 Linux 用户 +用户、组及其它 Linux 特性 ====== +> Linux 和其他类 Unix 操作系统依赖于用户组,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。 + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/flamingo-2458782_1920.jpg?itok=_gkzGGx5) -到这个阶段,[在看到如何操作目录或文件夹之后][1],但在让自己一头扎进文件之前,我们必须重新审视 _权限_, _users_ 和 _group_。幸运的是,[有一个网站上已经有了一个优秀而全面的教程,包括了权限][2],所以你应该去立刻阅读它。简而言之,你使用权限来确定谁可以对文件和目录执行操作,以及他们可以对每个文件和目录执行什么操作 -- 从中读取,写入,擦除等等。 +到这个阶段,[在看到如何操作目录或文件夹之后][1],但在让自己一头扎进文件之前,我们必须重新审视 _权限_、_用户_ 和 _组_。幸运的是,[有一个网站上已经有了一个优秀而全面的教程,讲到了权限][2],所以你应该去立刻阅读它。简而言之,你使用权限来确定谁可以对文件和目录执行操作,以及他们可以对每个文件和目录执行什么操作 —— 从中读取、写入、移动、擦除等等。 -要尝试本教程涵盖的所有内容,你需要在系统上创建新用户。让我们实践起来,为每一个需要借用你电脑的人创建一个用户,我们称之为 _guest 账户_。 +要尝试本教程涵盖的所有内容,你需要在系统上创建新用户。让我们实践起来,为每一个需要借用你电脑的人创建一个用户,我们称之为 `guest` 账户。 -**警告:** _例如,如果你错误地删除了自己的用户和目录,那么创建,特别是删除用户以及主目录会严重损坏系统。你可能不想在你日常的工作机中练习,那么请在另一台机器或者虚拟机上练习。无论你是否想要安全地练习,经常备份你的东西总是一个好主意。检查备份是否正常工作,为你自己以后避免很多咬牙切齿的事情。_ +**警告:** 例如,如果你错误地删除了自己的用户和目录,那么创建用户,特别是删除用户以及主目录会严重损坏系统。你可能不想在你日常的工作机中练习,那么请在另一台机器或者虚拟机上练习。无论你是否想要安全地练习,经常备份你的东西总是一个好主意。检查备份是否正常工作,为你自己以后避免很多咬牙切齿的事情。 ### 一个新用户 你可以使用 `useradd` 命令来创建一个新用户。使用超级用户或 root 权限运行 `useradd`,即使用 `sudo` 或 `su`,这具体取决于你的系统,你可以: + ``` sudo useradd -m guest ``` 然后输入你的密码。或者也可以这样: + ``` su -c "useradd -m guest" ``` 然后输入 root 或超级用户的密码。 -(_为了简洁起见,我们将从现在开始假设你使用 `sudo` 获得超级用户或 root 权限。_) +( _为了简洁起见,我们将从现在开始假设你使用 `sudo` 获得超级用户或 root 权限。_ ) -通过使用 `-m` 参数,`useradd` 将为新用户创建一个主目录。你可以通过列出 _/home/guest_ 来查看其内容。 +通过使用 `-m` 参数,`useradd` 将为新用户创建一个主目录。你可以通过列出 `/home/guest` 来查看其内容。 然后你可以使用以下命令来为新用户设置密码: + ``` sudo passwd guest ``` -或者你也可以使用 `adduser`,这是一个交互式的命令,它会询问你一些问题,包括你要为用户分配的 shell(是的,不止一个),你希望其主目录在哪里,你希望他们属于哪些组(有关这点稍后会讲到)等等。在运行 `adduser` 结束时,你可以设置密码。注意,默认情况下,在许多发行版中都没有安装 `adduser`,但安装了 `useradd`。 +或者你也可以使用 `adduser`,这是一个交互式的命令,它会询问你一些问题,包括你要为用户分配的 shell(是的,shell 有不止一种),你希望其主目录在哪里,你希望他们属于哪些组(有关这点稍后会讲到)等等。在运行 `adduser` 结束时,你可以设置密码。注意,默认情况下,在许多发行版中都没有安装 `adduser`,但安装了 `useradd`。 顺便说一下,你可以使用 `userdel` 来移除一个用户: + ``` sudo userdel -r guest ``` -使用 `-r` 选项,`userdel` 不仅删除了 _guest_ 用户,还删除了他们的主目录和邮件中的条目(如果有的话)。 +使用 `-r` 选项,`userdel` 不仅删除了 `guest` 用户,还删除了他们的主目录和邮件中的条目(如果有的话)。 -### home 中的内容 +### 主目录中的内容 -谈到用户的主目录,它依赖于你所使用的发行版。你可能已经注意到,当你使用 `-m` 选项时,`useradd` 使用子目录填充用户的目录,包括音乐,文档和诸如此类的内容以及各种各样的隐藏文件。要查看 guest 主目录中的所有内容,运行 `sudo ls -la /home/guest`。 +谈到用户的主目录,它依赖于你所使用的发行版。你可能已经注意到,当你使用 `-m` 选项时,`useradd` 使用子目录填充用户的目录,包括音乐、文档和诸如此类的内容以及各种各样的隐藏文件。要查看 `guest` 主目录中的所有内容,运行 `sudo ls -la /home/guest`。 + +进入新用户目录的内容通常是由 `/etc/skel` 架构目录确定的。有时它可能是一个不同的目录。要检查正在使用的目录,运行: -进入新用户目录的内容通常是由 _/etc/skel_ 架构目录确定的。有时它可能是一个不同的目录。要检查正在使用的目录,运行: ``` useradd -D GROUP=100 @@ -57,31 +64,36 @@ SKEL=/etc/skel CREATE_MAIL_SPOOL=no ``` -这给你一些额外的有趣信息,但你现在感兴趣的是 `SKEL=/etc/skel` 这一行,在这种情况下,按照惯例,它指向 _/etc/skel/_。 +这会给你一些额外的有趣信息,但你现在感兴趣的是 `SKEL=/etc/skel` 这一行,在这种情况下,按照惯例,它指向 `/etc/skel/`。 + +由于 Linux 中的所有东西都是可定制的,因此你可以更改那些放入新创建的用户目录的内容。试试这样做:在 `/etc/skel/` 中创建一个新目录: -由于 Linux 中的所有东西都是可定制的,因此你可以更改那些放入新创建的用户目录的内容。试试这样做:在 _/etc/skel/_ 中创建一个新目录: ``` sudo mkdir /etc/skel/Documents ``` 然后创建一个包含欢迎消息的文件,并将其复制过来: + ``` sudo cp welcome.txt /etc/skel/Documents ``` -现在删除 guest 账户: +现在删除 `guest` 账户: + ``` sudo userdel -r guest ``` 再次创建: + ``` sudo useradd -m guest ``` -嘿 presto!(to 校正:这个 presto 是什么?)你的 _Documents/_ 目录和 _welcome.txt_ 文件神奇地出现在了 guest 的主目录中。 +嘿!你的 `Documents/` 目录和 `welcome.txt` 文件神奇地出现在了 `guest` 的主目录中。 + +你还可以在创建用户时通过编辑 `/etc/default/useradd` 来修改其他内容。我的看起来像这样: -你还可以在创建用户时通过编辑 _/etc/default/useradd_ 来修改其他内容。我的看起来像这样: ``` GROUP=users HOME=/home @@ -96,11 +108,12 @@ CREATE_MAIL_SPOOL=no ### 群组心态 -Linux 和其他类 Unix 操作系统依赖于 _groups_,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。在你的系统上可能有一组允许使用打印机的用户,他们属于 _lp_(即 "_line printer_")组。传统上 _wheel_ 组的成员是唯一可以通过使用 _su_ 成为超级用户或 root 的成员。_network_ 用户组可以启动或关闭网络。还有许多诸如此类的。 +Linux 和其他类 Unix 操作系统依赖于用户组,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。在你的系统上可能有一组允许使用打印机的用户,他们属于 `lp`(即 “_line printer_”)组。传统上 `wheel` 组的成员是唯一可以通过使用 `su` 成为超级用户或 root 的成员。`network` 用户组可以启动或关闭网络。还有许多诸如此类的。 不同的发行版有不同的组,具有相同或相似名称的组具有不同的权限,这也取决于你使用的发行版。因此,如果你在前一段中读到的内容与你系统中的内容不匹配,不要感到惊讶。 -不管怎样g,要查看系统中有哪些组,你可以使用: +不管怎样,要查看系统中有哪些组,你可以使用: + ``` getent group ``` @@ -108,18 +121,20 @@ getent group `getent` 命令列出了某些系统数据库的内容。 要查找当前用户所属的组,尝试: + ``` groups ``` -当你使用 `useradd` 创建新用户时,除非你另行指定,否则用户讲只属于一个组:他们自己。一个 _guest_ 用户属于 _guest_ 组。组使用户有权管理自己的东西,仅此而已。 +当你使用 `useradd` 创建新用户时,除非你另行指定,否则用户将只属于一个组:他们自己。`guest` 用户属于 `guest` 组。组使用户有权管理自己的东西,仅此而已。 你可以使用 `groupadd` 命令创建新组,然后添加用户: + ``` sudo groupadd photos ``` -例如,这将创建 _photos_ 组。下一次,我们将使用它来构建一个共享目录,该组的所有成员都可以读取和写入,我们将更多地了解权限和特权。敬请关注! +例如,这将创建 `photos` 组。下一次,我们将使用它来构建一个共享目录,该组的所有成员都可以读取和写入,我们将更多地了解权限和特权。敬请关注! -------------------------------------------------------------------------------- @@ -129,11 +144,11 @@ via: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-li 作者:[Paul Brown][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://www.linux.com/users/bro66 -[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux +[1]:https://linux.cn/article-10066-1.html [2]:https://www.linux.com/learn/understanding-linux-file-permissions [3]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From d6be9d773c9e6e45dda19970cd90a6e7030eabd2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 00:21:31 +0800 Subject: [PATCH 63/69] PUB:20180710 Users, Groups, and Other Linux Beasts.md @MjSeven https://linux.cn/article-10370-1.html --- .../20180710 Users, Groups, and Other Linux Beasts.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20180710 Users, Groups, and Other Linux Beasts.md (100%) diff --git a/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md b/published/20180710 Users, Groups, and Other Linux Beasts.md similarity index 100% rename from translated/tech/20180710 Users, Groups, and Other Linux Beasts.md rename to published/20180710 Users, Groups, and Other Linux Beasts.md From f6cc86ebfa1572029a17ca13162337f3b79f3d5b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 09:51:55 +0800 Subject: [PATCH 64/69] PRF:20181115 3 best practices for continuous integration and deployment.md @ChiZelin --- ...r continuous integration and deployment.md | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/translated/tech/20181115 3 best practices for continuous integration and deployment.md b/translated/tech/20181115 3 best practices for continuous integration and deployment.md index 0706d70544..dcb4bd7c26 100644 --- a/translated/tech/20181115 3 best practices for continuous integration and deployment.md +++ b/translated/tech/20181115 3 best practices for continuous integration and deployment.md @@ -1,31 +1,33 @@ -持续集成与部署的3个最佳实践 +持续集成与部署的 3 个最佳实践 ====== -了解自动化,使用 Git 存储库以及参数化 Jenkins 管道。 + +> 了解自动化,使用 Git 存储库以及参数化 Jenkins 管道。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M) 本文涵盖了三个关键主题:自动化 CI/CD 配置、使用 Git 存储库处理常见的 CI/CD 工件、参数化 Jenkins 管道。 ### 术语 -首先,我们定义一些术语。**CI/CD** 是允许团队快速自动化测试、打包、部署其应用程序的实践。它通常通过利用名为 **[Jenkins][1]** 的服务器来实现,该服务器充当 CI/CD 协调器。Jenkins 侦听特定输入(通常是代码签入后的 Git hook),并在触发时启动管道。 +首先,我们定义一些术语。**CI/CD** 是允许团队快速自动化测试、打包、部署其应用程序的实践。它通常通过利用名为 [Jenkins][1] 的服务器来实现,该服务器充当 CI/CD 协调器。Jenkins 侦听特定输入(通常是代码签入后的 Git 挂钩),并在触发时启动一个管道。 -**pipeline** 由开发和/或运营团队编写的代码组成,这些代码指导 Jenkins 在 CI/CD 过程中采取哪些操作。这个流水线通常类似于“构建我的代码,然后测试我的代码,如果这些测试通过,则把我的应用程序部署到下一个最高环境(通常是开发、测试或生产环境)”。组织通常具有更复杂的流水线,并入了诸如工件存储库和代码分析器之类的工具,但是这提供了一个高级示例。 +管道pipeline 由开发和/或运营团队编写的代码组成,这些代码指导 Jenkins 在 CI/CD 过程中采取哪些操作。这个流水线通常类似于“构建我的代码,然后测试我的代码,如果这些测试通过,则把我的应用程序部署到下一个最高环境(通常是开发、测试或生产环境)”。组织通常具有更复杂的管道,并入了诸如工件存储库和代码分析器之类的工具,这里提供了一个高级示例。 现在我们了解了关键术语,让我们深入研究一些最佳实践。 -### 1\. 自动化是关键 +### 1、自动化是关键 要在 PaaS 上运行 CI/CD,需要在集群上配置适当的基础设施。在这个例子中,我将使用 [OpenShift][2]。 -"Hello, World" 的实现很容易实现。简单地运行 **oc new-app jenkins- ** 和 voilà, 你已经准备好运行 Jenkins 服务器了。然而,在企业中的使用要复杂得多。除了 Jenkins 服务器之外,管理员通常还需要部署代码分析工具(如 SonarQube)和构件库(如 Nexus)。然后,它们必须创建管道来执行 CI/CD 和 Jenkins 从服务器,以减少主服务器的负载。这些实体中的大多数都由 OpenShift 资源支持,需要创建这些资源来部署所需的 CI/CD 基础设施。 +“Hello, World” 的实现很容易实现。简单地运行 `oc new-app jenkins-`,然后,你就有了一个已经就绪的运行中的 Jenkins 服务器了。然而,在企业中的使用要复杂得多。除了 Jenkins 服务器之外,管理员通常还需要部署代码分析工具(如 SonarQube)和工件库(如 Nexus)。然后,它们必须创建管道来执行 CI/CD 和 Jenkins 从服务器,以减少主服务器的负载。这些实体中的大多数都由 OpenShift 资源支持,需要创建这些资源来部署所需的 CI/CD 基础设施。 -最后,部署 CI/CD 组件所需要的手动步骤可能是需要被重复的,并且你可能不想成为执行那些重复步骤的人。为了确保结果能够像以前一样快速、无错误和准确地产生,应该在创建基础设施的方式中结合自动化方法。这可以是一个 Ansible 剧本、一个 Bash 脚本,或者任何您希望自动化 CI/CD 基础设施部署的其他方式。我已经使用 [Ansible][3] 和 [OpenShift-Applier][4] 角色来自动化我的实现。您可能会发现这些工具很有价值,或者您可能会发现其他一些对您和组织更有效的工具。无论哪种方式,您都将发现自动化显著地减少了重新创建 CI/CD 组件所需的工作量。 +最后,部署 CI/CD 组件所需要的手动步骤可能是需要重复进行的,而且你可能不想成为执行那些重复步骤的人。为了确保结果能够像以前一样快速、无错误和准确地产生,应该在创建基础设施的方式中结合自动化方法。这可以是一个 Ansible 剧本、一个 Bash 脚本,或者任何您希望自动化 CI/CD 基础设施部署的其它方式。我已经使用 [Ansible][3] 和 [OpenShift-Applier][4] 角色来自动化我的实现。您可能会发现这些工具很有价值,或者您可能会发现其他一些对您和组织更有效的工具。无论哪种方式,您都将发现自动化显著地减少了重新创建 CI/CD 组件所需的工作量。 -#### 配置Jenkins主服务器 +#### 配置 Jenkins 主服务器 -除了一般的“自动化”之外,我想单独介绍一下 Jenkins 主服务器,并讨论管理员如何利用 OpenShift 来自动化配置 Jenkins。来自 [Red Hat Container Catalog][5] 的 Jenkins 映像已经安装了 [OpenShift-Sync plugin][6]。在 [视频][7] 中,我们将讨论如何使用这个插件来创建 Jenkins 管道和从设备。 +除了一般的“自动化”之外,我想单独介绍一下 Jenkins 主服务器,并讨论管理员如何利用 OpenShift 来自动化配置 Jenkins。来自 [Red Hat Container Catalog][5] 的 Jenkins 镜像已经安装了 [OpenShift-Sync plugin][6]。在 [该视频][7] 中,我们将讨论如何使用这个插件来创建 Jenkins 管道和从设备。 -要创建 Jenkins 流水线,请创建一个类似于下面的 OpenShift BuildConfig: +要创建 Jenkins 管道,请创建一个类似于下面的 OpenShift BuildConfig: ``` apiVersion: v1 @@ -43,7 +45,7 @@ spec:       type: JenkinsPipeline ``` -OpenShift-Sync 插件将注意到已经创建了带有 **jenkinsPipelineStrategy** 策略的 BuildConfig,并将其转换为 Jenkins 管道,从 Git 源指定的 Jenkins 文件中提取。也可以使用内联 Jenkinsfile,而不是从 Git 存储库中提取。有关更多信息,请参阅[文档][8]。 +OpenShift-Sync 插件将注意到已经创建了带有 `jenkinsPipelineStrategy` 策略的 BuildConfig,并将其转换为 Jenkins 管道,从 Git 源指定的 Jenkinsfile 中提取。也可以使用内联 Jenkinsfile,而不是从 Git 存储库中提取。有关更多信息,请参阅[文档][8]。 要创建 Jenkins 从站,请创建一个 OpenShift ImageStream,它从以下定义开始: @@ -55,12 +57,12 @@ metadata:     slave-label: jenkins-slave     labels:       role: jenkins-slave -… +... ``` -注意在这个 ImageStream 中定义的元数据。OpenShift-Sync 插件将把带有标签 **role: jenkins-slave** 的任何ImageStream 转换为 Jenkins 从站。Jenkins 从站将以 **slave-label** 注释中的值命名。 +注意在这个 ImageStream 中定义的元数据。OpenShift-Sync 插件将把带有标签 `role: jenkins-slave` 的任何 ImageStream 转换为 Jenkins 从站。Jenkins 从站将以 `slave-label` 注释中的值命名。 -ImageStreams 对于简单的 Jenkins 从属配置工作得很好,但是一些团队会发现有必要配置一些细节详情,比如资源限制、准备就绪和活动性探测,以及实例帽。这就是 ConfigMap 发挥作用的地方: +ImageStreams 对于简单的 Jenkins 从属配置工作得很好,但是一些团队会发现有必要配置一些细节详情,比如资源限制、准备就绪和活动性探测,以及实例上限。这就是 ConfigMap 发挥作用的地方: ``` apiVersion: v1 @@ -74,21 +76,21 @@ data:     ``` -注意,仍然需要角色:jenkins-slave 标签来将 ConfigMap 转换为 Jenkins slave。Kubernetes pod 模板由一长段 XML 组成,它将根据组织的喜好配置每个细节。要查看此 XML,以及有关将 ImageStreams 和 ConfigMaps 转换为 Jenkins 从属的更多信息,请参阅[文档][9]。 +注意,仍然需要角色:`jenkins-slave` 标签来将 ConfigMap 转换为 Jenkins 从站。Kubernetes pod 模板由一长段 XML 组成,它将根据组织的喜好配置每个细节。要查看此 XML,以及有关将 ImageStreams 和 ConfigMaps 转换为 Jenkins 从站的更多信息,请参阅[文档][9]。 请注意上面所示的三个示例,其中没有一个操作需要管理员对 Jenkins 控制台进行手动更改。通过使用 OpenShift 资源,可以简单的自动化方式配置 Jenkins。 -### 2\. 分享就是关心 +### 2、分享就是关爱 -第二个最佳实践是维护一个公共 CI/CD 工件的 Git 存储库。主要思想是防止团队重新发明轮子。假设您的团队需要执行到 OpenShift 环境的蓝色/绿色部署,作为管道 CD 阶段的一部分。负责编写流水线的团队成员可能不是 OpenShift 专家,也不可能具有从头开始编写此功能的能力。幸运的是,有人已经编写了一个将此功能合并到一个公共 CI/CD 存储库中的函数,因此您的团队可以使用该函数而不是花时间编写一个函数。 +第二个最佳实践是维护一个公共 CI/CD 工件的 Git 存储库。主要思想是防止团队重新发明轮子。假设您的团队需要执行到 OpenShift 环境的蓝/绿部署,作为管道 CD 阶段的一部分。负责编写管道的团队成员可能不是 OpenShift 专家,也不可能具有从头开始编写此功能的能力。幸运的是,有人已经编写了一个将此功能合并到一个公共 CI/CD 存储库中的函数,因此您的团队可以使用该函数而不是花时间编写一个函数。 -为了更进一步,您的组织可能决定维护整个管道。您可能会发现团队正在编写具有相似功能的流水线。对于那些团队来说,使用来自公共存储库的参数化管道要比从头开始编写自己的管道更有效。 +为了更进一步,您的组织可能决定维护整个管道。您可能会发现团队正在编写具有相似功能的管道。对于那些团队来说,使用来自公共存储库的参数化管道要比从头开始编写自己的管道更有效。 -### 3\. 少即是多 +### 3、少即是多 正如我在前一节中提到的,第三个也是最后一个最佳实践是参数化您的 CI/CD 管道。参数化将防止过多的管道,使您的 CI/CD 系统更容易维护。假设我有多个区域可以部署应用程序。如果没有参数化,我需要为每个区域设置单独的管道。 -要参数化作为 OpenShift 构建配置编写的管道,请将 **env** 节添加到配置: +要参数化一个作为 OpenShift 构建配置编写的管道,请将 `env` 节添加到配置: ``` ... @@ -103,9 +105,9 @@ spec:     type: JenkinsPipeline ``` -使用此配置,我可以传递 **REGION** 参数管道以将我的应用程序部署到指定区域。 +使用此配置,我可以传递 `REGION` 参数给管道以将我的应用程序部署到指定区域。 -这有一个[视频][7]提供了一个更实质性的情况,其中参数化是必须的。一些组织决定把他们的 CI/CD 管道分割成单独的 CI 和 CD 管道,通常是因为在部署之前有一些审批过程。假设我有四个映像和三个不同的环境要部署。如果没有参数化,我需要12个 CD 管道来允许所有部署可能性。这会很快失去控制。为了使 CD 流水线的维护更容易,组织会发现将映像和环境参数化以便允许一个流水线执行多个流水线的工作会更好。 +这有一个[视频][7]提供了一个更实质性的情况,其中参数化是必须的。一些组织决定把他们的 CI/CD 管道分割成单独的 CI 和 CD 管道,通常是因为在部署之前有一些审批过程。假设我有四个镜像和三个不同的环境要部署。如果没有参数化,我需要 12 个 CD 管道来允许所有部署可能性。这会很快失去控制。为了使 CD 流水线的维护更容易,组织会发现将镜像和环境参数化以便允许一个流水线执行多个流水线的工作会更好。 ### 总结 @@ -120,7 +122,7 @@ via: https://opensource.com/article/18/11/best-practices-cicd 作者:[Austin Dewey][a] 选题:[lujun9972][b] 译者:[ChiZelin](https://github.com/ChiZelin) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ce87014d8bf3389133f112890f0dc615e0f62f5b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 09:52:33 +0800 Subject: [PATCH 65/69] PUB:20181115 3 best practices for continuous integration and deployment.md @ChiZelin https://linux.cn/article-10371-1.html --- ... 3 best practices for continuous integration and deployment.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20181115 3 best practices for continuous integration and deployment.md (100%) diff --git a/translated/tech/20181115 3 best practices for continuous integration and deployment.md b/published/20181115 3 best practices for continuous integration and deployment.md similarity index 100% rename from translated/tech/20181115 3 best practices for continuous integration and deployment.md rename to published/20181115 3 best practices for continuous integration and deployment.md From 7f591fb8429bfc305297884650d1ce453ecb3dba Mon Sep 17 00:00:00 2001 From: qhwdw Date: Sat, 22 Dec 2018 11:58:14 +0800 Subject: [PATCH 66/69] Translated by qhwdw --- ...ving Your Master Key to Offline Storage.md | 168 ------------------ ...ving Your Master Key to Offline Storage.md | 167 +++++++++++++++++ 2 files changed, 167 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md create mode 100644 translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md diff --git a/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md b/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md deleted file mode 100644 index 30c1bba4d5..0000000000 --- a/sources/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md +++ /dev/null @@ -1,168 +0,0 @@ -Translating by qhwdw -Protecting Code Integrity with PGP — Part 4: Moving Your Master Key to Offline Storage -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/industry-1920.jpg?itok=gI3QraS8) -In this tutorial series, we're providing practical guidelines for using PGP. You can catch up on previous articles here: - -[Part 1: Basic Concepts and Tools][1] - -[Part 2: Generating Your Master Key][2] - -[Part 3: Generating PGP Subkeys][3] - -Here in part 4, we continue the series with a look at how and why to move your master key from your home directory to offline storage. Let's get started. - -### Checklist - - * Prepare encrypted detachable storage (ESSENTIAL) - - * Back up your GnuPG directory (ESSENTIAL) - - * Remove the master key from your home directory (NICE) - - * Remove the revocation certificate from your home directory (NICE) - - - - -#### Considerations - -Why would you want to remove your master [C] key from your home directory? This is generally done to prevent your master key from being stolen or accidentally leaked. Private keys are tasty targets for malicious actors -- we know this from several successful malware attacks that scanned users' home directories and uploaded any private key content found there. - -It would be very damaging for any developer to have their PGP keys stolen -- in the Free Software world, this is often tantamount to identity theft. Removing private keys from your home directory helps protect you from such events. - -##### Back up your GnuPG directory - -**!!!Do not skip this step!!!** - -It is important to have a readily available backup of your PGP keys should you need to recover them (this is different from the disaster-level preparedness we did with paperkey). - -##### Prepare detachable encrypted storage - -Start by getting a small USB "thumb" drive (preferably two!) that you will use for backup purposes. You will first need to encrypt them: - -For the encryption passphrase, you can use the same one as on your master key. - -##### Back up your GnuPG directory - -Once the encryption process is over, re-insert the USB drive and make sure it gets properly mounted. Find out the full mount point of the device, for example by running the mount command (under Linux, external media usually gets mounted under /media/disk, under Mac it's /Volumes). - -Once you know the full mount path, copy your entire GnuPG directory there: -``` -$ cp -rp ~/.gnupg [/media/disk/name]/gnupg-backup - -``` - -(Note: If you get any Operation not supported on socket errors, those are benign and you can ignore them.) - -You should now test to make sure everything still works: -``` -$ gpg --homedir=[/media/disk/name]/gnupg-backup --list-key [fpr] - -``` - -If you don't get any errors, then you should be good to go. Unmount the USB drive and distinctly label it, so you don't blow it away next time you need to use a random USB drive. Then, put in a safe place -- but not too far away, because you'll need to use it every now and again for things like editing identities, adding or revoking subkeys, or signing other people's keys. - -##### Remove the master key - -The files in our home directory are not as well protected as we like to think. They can be leaked or stolen via many different means: - - * By accident when making quick homedir copies to set up a new workstation - - * By systems administrator negligence or malice - - * Via poorly secured backups - - * Via malware in desktop apps (browsers, pdf viewers, etc) - - * Via coercion when crossing international borders - - - - -Protecting your key with a good passphrase greatly helps reduce the risk of any of the above, but passphrases can be discovered via keyloggers, shoulder-surfing, or any number of other means. For this reason, the recommended setup is to remove your master key from your home directory and store it on offline storage. - -###### Removing your master key - -Please see the previous section and make sure you have backed up your GnuPG directory in its entirety. What we are about to do will render your key useless if you do not have a usable backup! - -First, identify the keygrip of your master key: -``` -$ gpg --with-keygrip --list-key [fpr] - -``` - -The output will be something like this: -``` -pub rsa4096 2017-12-06 [C] [expires: 2019-12-06] - 111122223333444455556666AAAABBBBCCCCDDDD - Keygrip = AAAA999988887777666655554444333322221111 -uid [ultimate] Alice Engineer -uid [ultimate] Alice Engineer -sub rsa2048 2017-12-06 [E] - Keygrip = BBBB999988887777666655554444333322221111 -sub rsa2048 2017-12-06 [S] - Keygrip = CCCC999988887777666655554444333322221111 - -``` - -Find the keygrip entry that is beneath the pub line (right under the master key fingerprint). This will correspond directly to a file in your home .gnupg directory: -``` -$ cd ~/.gnupg/private-keys-v1.d -$ ls -AAAA999988887777666655554444333322221111.key -BBBB999988887777666655554444333322221111.key -CCCC999988887777666655554444333322221111.key - -``` - -All you have to do is simply remove the .key file that corresponds to the master keygrip: -``` -$ cd ~/.gnupg/private-keys-v1.d -$ rm AAAA999988887777666655554444333322221111.key - -``` - -Now, if you issue the --list-secret-keys command, it will show that the master key is missing (the # indicates it is not available): -``` -$ gpg --list-secret-keys -sec# rsa4096 2017-12-06 [C] [expires: 2019-12-06] - 111122223333444455556666AAAABBBBCCCCDDDD -uid [ultimate] Alice Engineer -uid [ultimate] Alice Engineer -ssb rsa2048 2017-12-06 [E] -ssb rsa2048 2017-12-06 [S] - -``` - -##### Remove the revocation certificate - -Another file you should remove (but keep in backups) is the revocation certificate that was automatically created with your master key. A revocation certificate allows someone to permanently mark your key as revoked, meaning it can no longer be used or trusted for any purpose. You would normally use it to revoke a key that, for some reason, you can no longer control -- for example, if you had lost the key passphrase. - -Just as with the master key, if a revocation certificate leaks into malicious hands, it can be used to destroy your developer digital identity, so it's better to remove it from your home directory. -``` -cd ~/.gnupg/openpgp-revocs.d -rm [fpr].rev - -``` - -Next time, you'll learn how to secure your subkeys as well. Stay tuned. - -Learn more about Linux through the free ["Introduction to Linux" ][4]course from The Linux Foundation and edX. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage - -作者:[Konstantin Ryabitsev][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/mricon -[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools -[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key -[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys -[4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md b/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md new file mode 100644 index 0000000000..8ca36884d9 --- /dev/null +++ b/translated/tech/20180307 Protecting Code Integrity with PGP - Part 4- Moving Your Master Key to Offline Storage.md @@ -0,0 +1,167 @@ +用 PGP 保护代码完整性(四):将主密钥移到离线存储中 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/industry-1920.jpg?itok=gI3QraS8) +在本系列教程中,我们为使用 PGP 提供了一个实用指南。你可以从下面的链接中查看前面的文章: + +[第一部分:基本概念和工具][1] + +[第二部分:生成你的主密钥][2] + +[第三部分:生成 PGP 子密钥][3] + +这是本系列教程的第四部分,我们继续本教程,我们将谈一谈如何及为什么要将主密钥从你的 Home 目录移到离线存储中。现在开始我们的教程。 + +### 清单 + + * 准备一个加密的可移除的存储(必要) + + * 备份你的 GnuPG 目录(必要) + + * 从你的 Home 目录中删除主密钥(推荐) + + * 从你的 Home 目录中删除吊销证书(推荐) + + + + +#### Considerations + +为什么要从你的 Home 目录中删除你的主密钥 [C] ?这样做的主要原因是防止你的主密钥失窃或意外泄露。对于心怀不轨的人来说,私钥对他们具有很大的诱惑力 —— 我们知道有几个恶意软件成功地实现了扫描用户的 Home 目录并将发现的任何私钥内容上传。 + +对于任何开发者来说,私钥失窃是非常危险的事情 —— 在自由软件的世界中,这无疑是身份证明失窃。从你的 Home 目录中删除私钥将帮你防范这类事件的发生。 + +##### 备份你的 GnuPG 目录 + +**!!!绝对不要跳过这一步!!!** + +备份你的 PGP 密钥将让你在需要的时候很容易地恢复它们,这很重要!(这与我们做的使用 paperkey 的灾难级备份是不一样的)。 + +##### 准备可移除的加密存储 + +我们从取得一个(最好是两个)小型的 USB “拇指“ 驱动器(可加密 U 盘)开始,我们将用它来做备份。你首先需要去加密它们: + +加密密码可以使用与主密钥相同的密码。 + +##### 备份你的 GnuPG 目录 + +加密过程结束之后,重新插入 USB 驱动器并确保它能够正常挂载。你可以通过运行 `mount` 命令去找到设备挂载点的完全路径。(在 Linux 下,外置介质一般挂载在 /media/disk 下,Mac 一般在它的 /Volumes 下) + +你知道了挂载点的全路径后,将你的整个 GnuPG 的目录复制进去: +``` +$ cp -rp ~/.gnupg [/media/disk/name]/gnupg-backup + +``` + +(注意:如果出现任何套接字不支持的错误,没有关系,直接忽略它们。) + +现在,用如下的命令去测试一下,确保它们能够正常地工作: +``` +$ gpg --homedir=[/media/disk/name]/gnupg-backup --list-key [fpr] + +``` + +如果没有出现任何错误,说明一切正常。弹出这个 USB 驱动器并给它粘上一个明确的标签,以便于你下次需要它时能够很快找到它。接着,将它放到一个安全的 —— 但不要太远 —— 的地方,因为从现在起,你需要偶尔使用它来做一些像编辑身份信息、添加或吊销子证书、或签署其它人的密钥这样的事情。 + +##### 删除主密钥 + +我们 Home 目录中的文件并没有像我们所想像的那样受到保护。它们可能会通过许多不同的方式被泄露或失窃: + + * 通过快速复制来配置一个新工作站时的偶尔事故 + + * 通过系统管理员的疏忽或恶意操作 + + * 通过安全性欠佳的备份 + + * 通过桌面应用中的恶意软件(浏览器、pdf 查看器等等) + + * 通过跨境胁迫 + + + + +使用一个很好的密码来保护你的密钥是降低上述风险的一个很好方法,但是密码能够通过键盘记录器、背后窥视、或其它方式被发现。基于以上原因,我们建议去配置一个从你的 Home 目录上可移除的主密钥,将它保存在一个离线存储中。 + +###### 删除主密钥 + +**请查看前面的节,确保你有完整的你的 GnuPG 目录的一个备份。如果你没有一个可用的备份,下面所做的操作将会使你的主密钥失效!!!** + +首先,识别你的主密钥的 keygrip: +``` +$ gpg --with-keygrip --list-key [fpr] + +``` + +它的输出应该像下面这样: +``` +pub rsa4096 2017-12-06 [C] [expires: 2019-12-06] + 111122223333444455556666AAAABBBBCCCCDDDD + Keygrip = AAAA999988887777666655554444333322221111 +uid [ultimate] Alice Engineer +uid [ultimate] Alice Engineer +sub rsa2048 2017-12-06 [E] + Keygrip = BBBB999988887777666655554444333322221111 +sub rsa2048 2017-12-06 [S] + Keygrip = CCCC999988887777666655554444333322221111 + +``` + +找到 pub 行下方的 keygrip 条目(就在主密钥指纹的下方)。它与你的 Home 目录下 `.gnupg` 目录下的一个文件是一致的: +``` +$ cd ~/.gnupg/private-keys-v1.d +$ ls +AAAA999988887777666655554444333322221111.key +BBBB999988887777666655554444333322221111.key +CCCC999988887777666655554444333322221111.key + +``` + +现在你做的全部操作就是简单地删除与主密钥 keygrip 一致的 `.key` 文件: +``` +$ cd ~/.gnupg/private-keys-v1.d +$ rm AAAA999988887777666655554444333322221111.key + +``` + +现在,如果运行 --list-secret-keys 命令将出现问题,它将显示主密钥丢失(# 表示不可用): +``` +$ gpg --list-secret-keys +sec# rsa4096 2017-12-06 [C] [expires: 2019-12-06] + 111122223333444455556666AAAABBBBCCCCDDDD +uid [ultimate] Alice Engineer +uid [ultimate] Alice Engineer +ssb rsa2048 2017-12-06 [E] +ssb rsa2048 2017-12-06 [S] + +``` + +##### 删除吊销证书 + +你应该去删除的另一个文件是吊销证书(**删除之前,确保你的备份中有它**),它是使用你的主密钥自动创建的。吊销证书允许一些人去永久标记你的证书为吊销状态,这意味着它无论在任何用途中将不再被使用或信任。一般是使用它来吊销由于某些原因不再受控的一个密钥 —— 比如,你丢失了密钥密码。 + +与使用主密钥一样,如果一个吊销证书泄露到恶意者手中,他们能够使用它去破坏你的开发者数字身份,因此,最好是从你的 Home 目录中删除它。 +``` +cd ~/.gnupg/openpgp-revocs.d +rm [fpr].rev + +``` + +在下一篇文章中,你将学习如何保护你的子密钥。敬请期待。 + +从来自 Linux 基金会和 edX 的免费课程 [“Linux 入门" ][4] 中学习更多 Linux 知识。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/learn/pgp/2018/3/protecting-code-integrity-pgp-part-4-moving-your-master-key-offline-storage + +作者:[Konstantin Ryabitsev][a] +译者:[qhwdw](https://github.com/qhwdw) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/mricon +[1]:https://www.linux.com/blog/learn/2018/2/protecting-code-integrity-pgp-part-1-basic-pgp-concepts-and-tools +[2]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-2-generating-and-protecting-your-master-pgp-key +[3]:https://www.linux.com/blog/learn/pgp/2018/2/protecting-code-integrity-pgp-part-3-generating-pgp-subkeys +[4]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 22fce8a05011eb6382039c69021e153b7a91f081 Mon Sep 17 00:00:00 2001 From: qhwdw Date: Sat, 22 Dec 2018 12:03:45 +0800 Subject: [PATCH 67/69] Translating by qhwdw --- ...ity with PGP - Part 5- Moving Subkeys to a Hardware Device.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md b/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md index ac862ff64e..8463598b4c 100644 --- a/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md +++ b/sources/tech/20180314 Protecting Code Integrity with PGP - Part 5- Moving Subkeys to a Hardware Device.md @@ -1,3 +1,4 @@ +Translating by qhwdw Protecting Code Integrity with PGP — Part 5: Moving Subkeys to a Hardware Device ====== From 69ca64dc5dbde7f012857a84669c3d5b33f5adaa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 18:16:25 +0800 Subject: [PATCH 68/69] PRF:20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @geekpi --- ...on Ubuntu and Other Linux Distributions.md | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md index 886d5ce5e8..f365ce1f32 100644 --- a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md +++ b/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions) @@ -10,11 +10,11 @@ 如何在 Ubuntu 和其他 Linux 发行版上安装 Putty ====== -如果我没错,[Putty][1] 可能是 Windows 最受欢迎的 SSH 客户端。 +如果我没弄错,[Putty][1] 可能是 Windows 最受欢迎的 SSH 客户端。 -I在 IT 公司中,开发环境通常在远程 Linux 系统上,而开发人员则使用 Windows 作为本地系统。Putty 用于从 Windows 机器连接到远程 Linux 系统。 +在 IT 公司中,开发环境通常在远程 Linux 系统上,而开发人员则使用 Windows 作为本地系统。Putty 用于从 Windows 机器连接到远程 Linux 系统。 -Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源软件。 +Putty 不是限定于 Windows 的。你也可以在 Linux 和 macOS 上使用此开源软件。 但是等等!当你已经拥有“真正的” Linux 终端时,为什么要在 Linux 上使用单独的 SSH 客户端?这有几个想在 Linux 上使用 Putty 的原因。 @@ -22,8 +22,6 @@ Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源 * 你发现很难手动编辑 SSH 配置文件以保存各种 SSH 会话。你更喜欢 Putty 图形化保存 SSH 连接的方式。 * 你想通过连接到原始套接字和串口进行调试。 - - 无论是什么原因,如果你想在 Ubuntu 或任何其他 Linux 上使用 Putty,你当然可以这样做。让我告诉你如何做到。 ### 在 Ubuntu Linux 上安装 Putty @@ -38,7 +36,7 @@ Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源 sudo add-apt-repository universe ``` -启用 universe 存储库后,应使用以下命令更新 Ubuntu: +启用 universe 仓库后,应使用以下命令更新 Ubuntu: ``` sudo apt update @@ -56,13 +54,13 @@ sudo apt install putty ![Putty in Linux][3] -当你输入远程系统的[主机名][4]或 IP 地址并连接到它时,Putty 将使用你主目录中已保存的 SSH 密钥。 +当你输入远程系统的[主机名][4]或 IP 地址并连接到它时,Putty 将使用你已保存在主目录中的 SSH 密钥。 ![Using Putty in Ubuntu Linux][5] ### 在其他 Linux 发行版上安装 Putty -[Putty 可用于 Debian][6],所以你只需要使用 apt-get 或 aptitude 来安装它。 +[Putty 可用于 Debian][6],所以你只需要使用 `apt-get` 或 `aptitude` 来安装它。 ``` sudo apt-get install putty @@ -82,7 +80,7 @@ sudo pacman -S putty 请记住,Putty 是一款开源软件。如果你真的想要,你也可以通过源代码安装它。你可以从下面的链接获取 Putty 的源代码。 -[下载 Putty 源代码][8] +- [下载 Putty 源代码][8] 我一直喜欢原生 Linux 终端而不是像 Putty 这样的 SSH 客户端。我觉得 GNOME 终端或 [Terminator][7] 更有家的感觉。但是,在 Linux 中使用默认终端或 Putty 是个人选择。 @@ -95,7 +93,7 @@ via: https://itsfoss.com/putty-linux/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -108,4 +106,4 @@ via: https://itsfoss.com/putty-linux/ [5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1 [6]: https://packages.debian.org/jessie/putty [7]: https://launchpad.net/terminator -[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html \ No newline at end of file +[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html From 372c6927d49946ebc6d969176688f45a56815c16 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 22 Dec 2018 18:18:58 +0800 Subject: [PATCH 69/69] PUB:20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @geekpi https://linux.cn/article-10373-1.html --- ...o Install Putty on Ubuntu and Other Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md (98%) diff --git a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/published/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md similarity index 98% rename from translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md rename to published/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md index f365ce1f32..980eb43558 100644 --- a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md +++ b/published/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-10373-1.html) [#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/putty-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)