From d80d1270d2b7a8b8b638c6c8b7d4a7eec19adcd9 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Mon, 27 Mar 2017 17:27:38 +0800 Subject: [PATCH 001/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95=20?= =?UTF-8?q?@martin2011qi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 谢谢 --- ...ore climate data with open source tools.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20170111 Explore climate data with open source tools.md b/translated/tech/20170111 Explore climate data with open source tools.md index 01022ce928..607e5e4d86 100644 --- a/translated/tech/20170111 Explore climate data with open source tools.md +++ b/translated/tech/20170111 Explore climate data with open source tools.md @@ -1,41 +1,41 @@ 使用开源工具探索气候数据的奥秘 ============================================================[up][1] ![Explore climate data with open source tools](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/bus-cloud.png?itok=bdROR1aE "Explore climate data with open source tools") -图片源自:  -[Flickr user: theaucitron][2] (CC BY-SA 2.0) +图片源自: [Flickr user: theaucitron][2] (CC BY-SA 2.0) -如果这些天地球天气变化的不明显,你几乎无法察觉其中变化的格局。每个月,事实和数据都在向我们诠释一点——全球变暖。 +如今你看地球上的任何地方,都可以看到天气变化的证据,每个月,事实和数据都在向我们诠释一点 —— 全球变暖。 -气候学家如是告诫我们——如今的不作为,对于我们的将来可能是致命的。五角大楼高层[最近警告][3]当选总统的川普。申明如果不对气候变化有所动作,可能会造成威胁国家安全的灾难。愈趋减少的的水供应和微薄的降雨量会导致作物歉收,这将迫使大量的移民逃往世界各地,到那些可以维持他们生计的地方去。 +气候学家如是告诫我们,如今的不作为,对于我们的将来可能是致命的。五角大楼的军事战略家[最近警告][3]当选总统的川普,申明如果不对气候变化有所动作,可能会造成威胁国家安全的灾难。愈趋减少的的水供应和微薄的降雨量会导致作物歉收,这将迫使大量的移民逃往世界各地,到那些可以维持他们生计的地方去。 遍览 NASA,美国国防部,以及其他机构针对气候的研究成果,我的心中有个疑惑。那就是是否有开源的工具,使对此感兴趣的人们能够自行去探索气候数据的奥秘,并总结出我们自己的结论。我在网上快速的检索了一下,然后找到了[Open Climate Workbench (开源气候工作台)][4],[Apache 软件基金会][5]旗下的一个工程。 -Open Climate Workbench (缩写 OCW) 开发用于对来自[Earth System Grid Federation (地球系统网格联盟,缩写 ESGF)][6],[Coordinated Regional Climate Downscaling Experiment (协调区域气候降尺度实验,缩写 CORDEX)][7],美国全球变化研究计划的 [National Climate Assessment (国家气候研究)][8],[North American Regional Climate Assessment Program (北美区域气候评估计划)][9],和 NASA,NOAA,以及其他组织或机构的数据进行气候模型评价。 +Open Climate Workbench (缩写 OCW) 开发软件,对来自 [地球系统网格联盟(缩写 ESGF)Earth System Grid Federation][6]、[协调区域气候降尺度实验(缩写 CORDEX)Coordinated Regional Climate Downscaling Experiment][7]、美国全球变化研究项目的[国家气候研究 National Climate Assessment][8]、[北美区域气候评估计划North American Regional Climate Assessment Program][9],以及 NASA、NOAA 和其他组织或机构的数据进行气候模型评价。 -你可下载 OCW 的 [tar ball (压缩包)][10] 并将它安装到满足以下[条件][11]的 Linux 电脑上。也可以将它安装到 Vagrant 或者 VirtualBox 虚拟机中,详见 OCW 的[虚拟机指南][12]。   +你可下载 OCW 的 [tar ball][10] 并将它安装到满足以下[条件][11]的 Linux 电脑上。也可以使用 Vagrant 或者 VirtualBox 将 OCW 安装到虚拟机中,详见 OCW 的[虚拟机指南][12]。   -个人觉得想要了解 OCW 是如何工作的,最便捷的方式就是到 Regional Climate Model Evaluation System (区域气候模式评价系统,缩写 RCMES)下载一个[虚拟机镜像][13]。 +个人觉得想要了解 OCW 是如何工作的,最便捷的方式就是到 区域气候模式评价系统Regional Climate Model Evaluation System (缩写 RCMES),下载一个[虚拟机镜像][13]。 从 RCMES 的网站上看,他们旨在通过为一系列广泛而全面的观测(例如,卫星观测,重新分析,现场观测)和建模资源(例如,[ESGF][16] 上的 [CMIP][14] 和 [CORDEX][15])提供标准化的访问,以及常规分析和可视化任务的工具(例如,OCW),来促进气候和地球系统模型的区域规模评估。 -你需要在宿主机上安装 VirtualBox 和 Vagrant。通过它们,你就能看到一个超赞的 OCW 作业示例。RCMES 为下载,导入,运行虚拟机提供了[详细的说明][17]。当你的虚拟机开始工作时,你可以用以下身份登陆。 +你需要在宿主机上安装 VirtualBox 和 Vagrant。通过它们,你就能看到一个超赞的 OCW 作业示例。RCMES 为下载、导入、运行虚拟机提供了[详细的说明][17]。当你的虚拟机开始工作时,你可以用以下身份登陆。 ** 用户名:vagrant,密码:vagrant。 ** ![Regional Climate Model Evaluation System Data Plot](https://opensource.com/sites/default/files/rcmes_data_plot.png "Regional Climate Model Evaluation System Data Plot") -RCMES 数据样图 +*RCMES 数据样图* -RCMES 网页上的[教程][18]能帮助你迅速上手该软件。他们的[社区][19]十分活跃,而且看上去需要更多的[开发者][20]。 你也可以订阅他们[邮件列表][21]。 +RCMES 网页上的[教程][18]能帮助你迅速上手该软件。他们的[社区][19]十分活跃,而且在寻找更多的[开发者][20]。 你也可以订阅他们[邮件列表][21]。 -工程的[源代码][22]部署在 GitHub 上,遵寻 Apache License, Version 2.0。 +该工程的[源代码][22]部署在 GitHub 上,遵寻 Apache License, Version 2.0。 -------------------------------------------------------------------------------- +作者简介: ![](https://opensource.com/sites/default/files/styles/profile_pictures/public/donw2-crop.jpg?itok=OqOYd3A8) -Don Watkins(唐 沃特金斯) - 教育家,教育技术专家,企业家,开源支持者。心理学硕士,教育学硕士,Linux 系统管理员,CCNA,通过使用 Virtual Box 和 VMware 完成虚拟化。twitter 关注 @Don_Watkins。 +Don Watkins(唐 沃特金斯) - 教育家,教育技术专家,企业家,开源支持者。教育心理学硕士,Linux 系统管理员,CCNA,使用 Virtual Box 实现虚拟化。twitter 关注 @Don_Watkins。 -------------------------------------------------------------------------------- From f44d753ef538953d7791c02fdf8cc2ad03aa97e5 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Mon, 27 Mar 2017 17:31:24 +0800 Subject: [PATCH 002/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 --- .../20170111 Explore climate data with open source tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20170111 Explore climate data with open source tools.md b/translated/tech/20170111 Explore climate data with open source tools.md index 607e5e4d86..04a6d60e7d 100644 --- a/translated/tech/20170111 Explore climate data with open source tools.md +++ b/translated/tech/20170111 Explore climate data with open source tools.md @@ -10,7 +10,7 @@ 遍览 NASA,美国国防部,以及其他机构针对气候的研究成果,我的心中有个疑惑。那就是是否有开源的工具,使对此感兴趣的人们能够自行去探索气候数据的奥秘,并总结出我们自己的结论。我在网上快速的检索了一下,然后找到了[Open Climate Workbench (开源气候工作台)][4],[Apache 软件基金会][5]旗下的一个工程。 -Open Climate Workbench (缩写 OCW) 开发软件,对来自 [地球系统网格联盟(缩写 ESGF)Earth System Grid Federation][6]、[协调区域气候降尺度实验(缩写 CORDEX)Coordinated Regional Climate Downscaling Experiment][7]、美国全球变化研究项目的[国家气候研究 National Climate Assessment][8]、[北美区域气候评估计划North American Regional Climate Assessment Program][9],以及 NASA、NOAA 和其他组织或机构的数据进行气候模型评价。 +Open Climate Workbench (缩写 OCW) 开发软件,对来自 [地球系统网格联盟Earth System Grid Federation][6](缩写 ESGF)、[协调区域气候降尺度实验Coordinated Regional Climate Downscaling Experiment][7](缩写 CORDEX)、美国全球变化研究项目的[国家气候研究 National Climate Assessment][8]、[北美区域气候评估计划North American Regional Climate Assessment Program][9],以及 NASA、NOAA 和其他组织或机构的数据进行气候模型评价。 你可下载 OCW 的 [tar ball][10] 并将它安装到满足以下[条件][11]的 Linux 电脑上。也可以使用 Vagrant 或者 VirtualBox 将 OCW 安装到虚拟机中,详见 OCW 的[虚拟机指南][12]。   @@ -20,7 +20,7 @@ Open Climate Workbench (缩写 OCW) 开发软件,对来自 [地球 你需要在宿主机上安装 VirtualBox 和 Vagrant。通过它们,你就能看到一个超赞的 OCW 作业示例。RCMES 为下载、导入、运行虚拟机提供了[详细的说明][17]。当你的虚拟机开始工作时,你可以用以下身份登陆。 -** 用户名:vagrant,密码:vagrant。 ** +**用户名:vagrant,密码:vagrant。** ![Regional Climate Model Evaluation System Data Plot](https://opensource.com/sites/default/files/rcmes_data_plot.png "Regional Climate Model Evaluation System Data Plot") From d1b157a4eaa1e8271bb568054b53f815c24719e7 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Mar 2017 08:12:36 +0800 Subject: [PATCH 003/241] PRF:20170124 Compile-time assertions in Go.md @geekpi --- .../20170124 Compile-time assertions in Go.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20170124 Compile-time assertions in Go.md b/translated/tech/20170124 Compile-time assertions in Go.md index ad987be541..2e195305a0 100644 --- a/translated/tech/20170124 Compile-time assertions in Go.md +++ b/translated/tech/20170124 Compile-time assertions in Go.md @@ -2,11 +2,11 @@ Go 语言编译期断言 ============================================================ -这篇文章是关于一个鲜为人知的方法让 Go 在编译期断言。你可能不会使用它,但是了解一下也很有趣。 +这篇文章是关于一个鲜为人知的让 Go 在编译期断言的方法。你可能不会使用它,但是了解一下也很有趣。 -作为一个热身,这里是一个在 Go 中相当知名的编译时断言:接口满意度检查。 +作为一个热身,来看一个在 Go 中熟知的编译期断言:接口满意度检查。 -在这段代码([playground][1])中,`var _ =` 行确保类型 `W` 是一个 `stringWriter`,由 [`io.WriteString`][2] 检查。 +在这段代码([playground][1])中,`var _ =` 行确保类型 `W` 是一个 `stringWriter`,其由 [`io.WriteString`][2] 检查。 ``` package main @@ -39,13 +39,13 @@ main.go:14: cannot use W literal (type W) as type stringWriter in assignment: 这是很有用的。对于大多数同时满足 `io.Writer` 和 `stringWriter` 的类型,如果你删除 `WriteString` 方法,一切都会像以前一样继续工作,但性能较差。 -你可以使用编译时断言保护你的代码,而不是试图使用[`testing.T.AllocsPerRun'][3]为性能回归编写一个脆弱的测试。 +你可以使用编译期断言保护你的代码,而不是试图使用[`testing.T.AllocsPerRun'][3]为性能回归编写一个脆弱的测试。 这是[一个实际的 io 包中的技术例子][4]。 * * * -好的,让我们隐晦一点! +好的,让我们低调一点! 接口满意检查是很棒的。但是如果你想检查一个简单的布尔表达式,如 `1 + 1 == 2` ? @@ -69,9 +69,9 @@ func main() { } ``` -`Hash` 可能是某种抽象的哈希结果。`init` 函数确保它将与[crypto/md5][6]一起工作。如果你改变 `Hash` 为(也就是)`[8]byte`,它会在进程启动时发生混乱。但是,这是一个运行时检查。如果我们想要早点发现怎么办? +`Hash` 可能是某种抽象的哈希结果。`init` 函数确保它将与 [crypto/md5][6] 一起工作。如果你改变 `Hash` 为(比如说)`[8]byte`,它会在进程启动时发生崩溃。但是,这是一个运行时检查。如果我们想要早点发现怎么办? -就是这样。(没有 playground 链接,因为这在 playground 上不起作用。) +如下。(没有 playground 链接,因为这在 playground 上不起作用。) ``` package main @@ -109,11 +109,11 @@ main.init.1: undefined: "main.hashIsTooSmall" `hashIsTooSmall` 是[一个没有函数体的声明][7]。编译器假定别人将提供一个实现,也许是一个汇编程序。 -当编译器可以证明 `len(Hash {}) Date: Tue, 28 Mar 2017 08:12:49 +0800 Subject: [PATCH 004/241] PUB:20170124 Compile-time assertions in Go.md @geekpi --- .../tech => published}/20170124 Compile-time assertions in Go.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20170124 Compile-time assertions in Go.md (100%) diff --git a/translated/tech/20170124 Compile-time assertions in Go.md b/published/20170124 Compile-time assertions in Go.md similarity index 100% rename from translated/tech/20170124 Compile-time assertions in Go.md rename to published/20170124 Compile-time assertions in Go.md From 22e9172145ec48b7d34674dfcced5bffc8bb2d50 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Mar 2017 09:06:10 +0800 Subject: [PATCH 005/241] =?UTF-8?q?PRF:20170111=20NMAP=20Common=20Scans=20?= =?UTF-8?q?=E2=80=93=20Part=20One.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wcnnbdk1 很细心!我发布时候根据情况作了补充说明。 --- .../20170111 NMAP Common Scans – Part One.md | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/translated/tech/20170111 NMAP Common Scans – Part One.md b/translated/tech/20170111 NMAP Common Scans – Part One.md index 0db1c11990..dd4f5fb030 100644 --- a/translated/tech/20170111 NMAP Common Scans – Part One.md +++ b/translated/tech/20170111 NMAP Common Scans – Part One.md @@ -1,48 +1,48 @@ -NMAP 常用扫描简介 - 第一部分 +NMAP 常用扫描简介(一) ======================== -我们之前在‘[NMAP 的安装][1]’一文中,列出了 10 种不同的 ZeNMAP 扫描模式(这里将 Profiles 翻译成了模式,不知是否合适)。大多数的模式使用了各种参数。大多数的参数代表了执行不同的扫描模式。这篇文章将介绍其中的四种通用的扫描类型。 +我们之前在 [NMAP 的安装][1]一文中,列出了 10 种不同的 ZeNMAP 扫描模式。大多数的模式使用了各种参数。各种参数代表了执行不同的扫描模式。这篇文章将介绍其中的四种通用的扫描类型。 -**四种通用扫描类型** +### 四种通用扫描类型 下面列出了最常使用的四种扫描类型: -1. PING 扫描 (-sP) -2. TCP SYN 扫描 (-sS) -3. TCP Connect() 扫描 (-sT) -4. UDP 扫描 (-sU) +1. PING 扫描 (`-sP`) +2. TCP SYN 扫描 (`-sS`) +3. TCP Connect() 扫描 (`-sT`) +4. UDP 扫描 (`-sU`) 当我们利用 NMAP 来执行扫描的时候,这四种扫描类型是我们需要熟练掌握的。更重要的是需要知道这些命令做了什么并且需要知道这些命令是怎么做的。本文将介绍 PING 扫描和 UDP 扫描。在之后的文中会介绍 TCP 扫描。 -**PING 扫描 (-sP)** +### PING 扫描 (-sP) 某些扫描会造成网络拥塞,然而 Ping 扫描在网络中最多只会产生两个包。当然这两个包不包括可能需要的 DNS 搜索和 ARP 请求。每个被扫描的 IP 最少只需要一个包来完成 Ping 扫描。 -通常 Ping 扫描是用来查看在指定的 IP 地址上是否有在线的主机存在。例如,当我拥有网络连接却联不上一台指定的网络服务器的时候,我就可以使用 PING 来判断这台服务器是否在线。PING 同样也可以用来验证我的当前设备与网络服务器之间的路由是否正常。 +通常 Ping 扫描是用来查看在指定的 IP 地址上是否有在线的主机存在。例如,当我拥有网络连接却连不上一台指定的网络服务器的时候,我就可以使用 PING 来判断这台服务器是否在线。PING 同样也可以用来验证我的当前设备与网络服务器之间的路由是否正常。 -**注意:** 当我们讨论 TCP/IP 的时候,相关信息在使用 TCP/IP 协议的英特网与局域网(LAN)中都是相当有用的。这些程序都能工作。同样在广域网(WAN)也能工作得相当好。 +**注意:** 当我们讨论 TCP/IP 的时候,相关信息在使用 TCP/IP 协议的互联网与局域网(LAN)中都是相当有用的。这些程序都能工作。同样在广域网(WAN)也能工作得相当好。 -当参数给出的是一个域名的时候,我们就需要域名解析服务来找到相对应的 IP 地址,这个时候将会生成一些额外的包。例如,当我们执行 ‘ping linuxforum.com’ 的时候,需要首先请求域名(linuxforum.com)的 IP 地址(98.124.199.63)。当我们执行 ‘ping 98.124.199.63’ 的时候 DNS 查询就不需要了。当 MAC 地址未知的时候,就需要发送 ARP 请求来获取指定 IP 地址的 MAC 地址了(这里的指定 IP 地址,未必是目的 IP)。 +当参数给出的是一个域名的时候,我们就需要域名解析服务来找到相对应的 IP 地址,这个时候将会生成一些额外的包。例如,当我们执行 `ping linuxforum.com` 的时候,需要首先请求域名(linuxforum.com)的 IP 地址(98.124.199.63)。当我们执行 `ping 98.124.199.63` 的时候 DNS 查询就不需要了。当 MAC 地址未知的时候,就需要发送 ARP 请求来获取指定 IP 地址的 MAC 地址了(LCTT 译注:这里的指定 IP 地址,未必是目的 IP)。 -Ping 命令会向指定的 IP 地址发送一个英特网信息控制协议(ICMP)包。这个包是需要响应的 ICMP Echo 请求。当服务器系统在线的状态下我们会得到一个响应包。当两个系统之间存在防火墙的时候,PING 请求包可能会被防火墙丢弃。一些服务器也会被配置成不响应 PING 请求来避免可能发生的死亡之 PING。(现在的操作系统似乎不太可能) +Ping 命令会向指定的 IP 地址发送一个英特网信息控制协议(ICMP)包。这个包是需要响应的 ICMP Echo 请求。当服务器系统在线的状态下我们会得到一个响应包。当两个系统之间存在防火墙的时候,PING 请求包可能会被防火墙丢弃。一些服务器也会被配置成不响应 PING 请求来避免可能发生的死亡之 PING。(LCTT 译注:现在的操作系统似乎不太可能) -**注意:** 死亡之 PING 是一种恶意构造的 PING 包当它被发送到系统的时候,会造成被打开的连接等待一个 rest 包。一旦有一堆这样的恶意请求被系统响应,由于所有的可用连接都已经被打开所以系统将会拒绝所有其它的连接。技术上来说这种状态下的系统就是不可达的。 +**注意:** 死亡之 PING 是一种恶意构造的 PING 包当它被发送到系统的时候,会造成被打开的连接等待一个 rest 包。一旦有一堆这样的恶意请求被系统响应,由于所有的可用连接都已经被打开,所以系统将会拒绝所有其它的连接。技术上来说这种状态下的系统就是不可达的。 当系统收到 ICMP Echo 请求后它将会返回一个 ICMP Echo 响应。当源系统收到 ICMP Echo 响应后我们就能知道目的系统是在线可达的。 -使用 NMAP 的时候你可以指定单个 IP 地址也可以指定 某个 IP 地址段。当被指定为 PING 扫描(-sP)的时候,PING 命令将会对每一个 IP 地址执行。 +使用 NMAP 的时候你可以指定单个 IP 地址也可以指定某个 IP 地址段。当被指定为 PING 扫描(`-sP`)的时候,会对每一个 IP 地址执行 PING 命令。 -在图 1 中你可以看到我执行‘nmap -sP 10.0.0.1-10’命令后的结果。An ARP is sent out, three for each IP Address given to the command. In this case thirty requests went out – two for each of the ten IP Addresses.(这两句话就没有读懂,不清楚具体指的是什么意思,从图2看的话第一句里的三指的是两个 ARP 包和一个 ICMP 包,按照下面一段话的描述的话就是每个 IP 地址会有三个 ARP 请求,但是自己试的时候 Centos6 它发了两个 ARP 请求没获取到 MAC 地址也就就结束了,这里不清楚究竟怎么理解) +在图 1 中你可以看到我执行 `nmap -sP 10.0.0.1-10` 命令后的结果。程序会试着联系 IP 地址 10.0.0.1 到 10.0.0.10 之间的每个系统。对每个 IP 地址都要发出三个 ARP 请求。在我们的例子中发出了三十个请求,这 10 个 IP 地址里面有两个有回应。(LCTT 译注:此处原文存疑。) - ![Figure 01.jpg](https://www.linuxforum.com/attachments/figure-01-jpg.105/) +![Figure 01](https://www.linuxforum.com/attachments/figure-01-jpg.105/) -**图 1** +*图 1* -图 2 中展示了利用 Wireshark 抓取的从网络上另一台计算机发出的请求-的确是在 Windows 系统下完成这次抓取的。第一行展示了发出的第一条请求,广播请求的是 10.0.0.2 IP 地址对应 MAC 地址。由于 NMAP 是在 10.0.0.1 这台机器上执行的,因此 10.0.0.1 被略过了。由于本机 IP 地址被略过,我们现在可以说总共只发出了 27 个 ARP 请求。第二行展示了 10.0.0.2 这台机器的 ARP 响应。第三行到第十行是其它八个 IP 地址的 ARP 请求。第十一行是由于没有收到请求系统(10.0.0.1)的反馈所以发送的另一个 ARP 响应。(自己试的话它发送一个请求收到一个响应就结束了,也没有搜到相关的重发响应是否存在的具体说明,不是十分清楚)第十二行是源系统向 10.0.0.2 响应的 ‘SYN’ 和 Sequence 0。(这行感觉更像是三次握手里的首包)第十三行和第十四行的两次 Restart(RST)和 Synchronize(SYN)响应是用来关闭第二行和第十一行所打开的连接的。(这个描述似乎有问题 ARP 请求怎么会需要 TCP 来关闭连接呢,感觉像是第十二行的响应)注意 Sequence ID 是 ‘1’ - 是源 Sequence ID + 1。(这个不理解,不是应该 ACK = seq + 1 的么)第十五行开始就是类似相同的内容。 +图 2 中展示了网络上另一台计算机利用 Wireshark 抓取的发出的请求——没错,是在 Windows 系统下完成这次抓取的。第一行展示了发出的第一条请求,广播请求的是 IP 地址 10.0.0.2 对应 MAC 地址。由于 NMAP 是在 10.0.0.1 这台机器上执行的,因此 10.0.0.1 被略过了。由于本机 IP 地址被略过,我们现在可以看到总共只发出了 27 个 ARP 请求。第二行展示了 10.0.0.2 这台机器的 ARP 响应。第三行到第十行是其它八个 IP 地址的 ARP 请求。第十一行是由于 10.0.0.2 没有收到请求系统(10.0.0.1)的反馈所以(重新)发送的另一个 ARP 响应。第十二行是源系统向 10.0.0.2 发起的 HTTP 连接的 ‘SYN’ 和 Sequence 0。第十三行和第十四行的两次 Restart(RST)和 Synchronize(SYN)响应是用来关闭(和重发)第十二行所打开的连接的。注意 Sequence ID 是 ‘1’ - 是源 Sequence ID + 1。第十五行开始就是类似相同的内容。(LCTT 译注:此处原文有误,根据情况已经修改。) - ![Figure 02.jpg](https://www.linuxforum.com/attachments/figure-02-jpg.106/) +![Figure 02.jpg](https://www.linuxforum.com/attachments/figure-02-jpg.106/) -**图 2** +*图 2* 回到图 1 中我们可以看到有两台主机在线。其中一台是本机(10.0.0.1)另一台是(10.0.0.2)。整个扫描花费了 14.40 秒。 @@ -50,31 +50,31 @@ PING 扫描是一种用来发现在线主机的快速扫描方式。扫描结果 一旦你获得了在线系统的列表,你就可以使用 UDP 扫描来查看哪些端口是可能开启了的。 -**UDP 扫描 (-sU)** +### UDP 扫描 (-sU) -现在你已经知道了有那些系统是在线的,你的扫描就可以聚焦在这些 IP 地址之上。在整个网络上执行大量的没有针对性的扫描活动可不是一个好主意。系统管理员可以使用程序来监控网络流量当有大量可以活动发生的时候就会触发警报。 +现在你已经知道了有那些系统是在线的,你的扫描就可以聚焦在这些 IP 地址之上。在整个网络上执行大量的没有针对性的扫描活动可不是一个好主意,系统管理员可以使用程序来监控网络流量当有大量异常活动发生的时候就会触发警报。 用户数据报协议(UDP)在发现在线系统的开放端口方面十分有用。由于 UDP 不是一个面向连接的协议,因此是不需要响应的。这种扫描方式可以向指定的端口发送一个 UDP 包。如果目标系统没有回应那么这个端口可能是关闭的也可能是被过滤了的。如果端口是开放状态的那么应该会有一个响应。在大多数的情况下目标系统会返回一个 ICMP 信息说端口不可达。ICMP 信息让 NMAP 知道端口是被关闭了。如果端口是开启的状态那么目标系统应该响应 ICMP 信息来告知 NMAP 端口可达。 -**注意: **只有最前面的1024个常用端口会被扫描。(这里将 1000 改成了1024,因为手册中写的是默认扫描 1 到 1024 端口)在后面的文章中我们会介绍如何进行深度扫描。 +**注意: **只有最前面的 1024 个常用端口会被扫描。(LCTT 译注:这里将 1000 改成了1024,因为手册中写的是默认扫描 1 到 1024 端口)在后面的文章中我们会介绍如何进行深度扫描。 -由于我知道 10.0.0.2 这个主机是在线的,因此我只会针对这个 IP 地址来执行扫描。扫描过程中总共收发了 3278 个包。‘sudo nmap -sU 10.0.0.2’这个命令的输出结果在图 3 中展现。 +由于我知道 10.0.0.2 这个主机是在线的,因此我只会针对这个 IP 地址来执行扫描。扫描过程中总共收发了 3278 个包。`sudo nmap -sU 10.0.0.2` 这个命令的输出结果在图 3 中展现。 - ![Figure 03.jpg](https://www.linuxforum.com/attachments/figure-03-jpg.107/) +![Figure 03.jpg](https://www.linuxforum.com/attachments/figure-03-jpg.107/) -**图 3** +*图 3* 在这副图中你可以看见端口 137(netbios-ns)被发现是开放的。在图 4 中展示了 Wireshark 抓包的结果。不能看到所有抓取的包,但是可以看到一长串的 UDP 包。 - ![Figure 4.jpg](https://www.linuxforum.com/attachments/figure-4-jpg.108/) +![Figure 4.jpg](https://www.linuxforum.com/attachments/figure-4-jpg.108/) -**图 4** +*图 4* 如果我把目标系统上的防火墙关闭之后会发生什么呢?我的结果有那么一点的不同。NMAP 命令的执行结果在图 5 中展示。 - ![Figure 05.png](https://www.linuxforum.com/attachments/figure-05-png.109/) +![Figure 05.png](https://www.linuxforum.com/attachments/figure-05-png.109/) -**图 5** +*图 5* **注意:** 当你执行 UDP 扫描的时候是需要 root 权限的。 @@ -86,7 +86,7 @@ via: https://www.linuxforum.com/threads/nmap-common-scans-part-one.3637/ 作者:[Jarret][a] 译者:[wcnnbdk1](https://github.com/wcnnbdk1) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0d8be76861aa2d4af0778eae50cd4569c0c42f6e Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Mar 2017 09:06:29 +0800 Subject: [PATCH 006/241] =?UTF-8?q?PUB:=2020170111=20NMAP=20Common=20Scans?= =?UTF-8?q?=20=E2=80=93=20Part=20One.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wcnnbdk1 --- .../tech => published}/20170111 NMAP Common Scans – Part One.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20170111 NMAP Common Scans – Part One.md (100%) diff --git a/translated/tech/20170111 NMAP Common Scans – Part One.md b/published/20170111 NMAP Common Scans – Part One.md similarity index 100% rename from translated/tech/20170111 NMAP Common Scans – Part One.md rename to published/20170111 NMAP Common Scans – Part One.md From eb7f94c80d478fe463caaf067024162c2412ab3e Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 Mar 2017 09:16:58 +0800 Subject: [PATCH 007/241] translating --- sources/tech/20170320 Why Go.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170320 Why Go.md b/sources/tech/20170320 Why Go.md index fbf4e2a4dd..7fae4fd657 100644 --- a/sources/tech/20170320 Why Go.md +++ b/sources/tech/20170320 Why Go.md @@ -1,3 +1,5 @@ +translating---geekpi + Why Go? ============================================================ From 0f748ba77528904e46598460db1b0059eb03fc69 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Tue, 28 Mar 2017 09:18:17 +0800 Subject: [PATCH 008/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对中 --- ...0170325 How to Install a DHCP Server in Ubuntu and Debian.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md b/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md index 86c6e73d03..ab42088b01 100644 --- a/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md +++ b/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md @@ -166,7 +166,7 @@ via: http://www.tecmint.com/install-dhcp-server-in-ubuntu-debian/ 作者:[Aaron Kili][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 22337068d817be6f4d8fe717903d6db2f63ab443 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Tue, 28 Mar 2017 09:36:09 +0800 Subject: [PATCH 009/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 谢谢@geekpi --- ...tall a DHCP Server in Ubuntu and Debian.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md b/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md index ab42088b01..6f3ec54853 100644 --- a/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md +++ b/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md @@ -1,39 +1,39 @@ 如何在 Ubuntu 以及 Debian 中安装 DHCP 服务器 ============================================================ -动态主机配置协议(DHCP)是一种用于使主机能够从服务器自动分配IP地址和相关的网络配置的网络协议。 +**动态主机配置协议(DHCP)** 是一种用于使主机能够从服务器自动分配 IP 地址和相关的网络配置的网络协议。 -DHCP 服务器分配给 DHCP 客户端的IP地址处于“租用”状态,租用时间通常取决于客户端计算机可能需要连接的时间或 DHCP 配置的时间。 +DHCP 服务器分配给 DHCP 客户端的 IP 地址处于“租用”状态,租用时间通常取决于客户端计算机要求连接的时间或 DHCP 配置的时间。 #### DHCP 如何工作? 以下是 DHCP 实际工作原理的简要说明: -* 一旦客户端(配置使用 DHCP)并连接到网络后,它会向 DHCP 服务器发送 DHCPDISCOVER 数据包。 -* 当 DHCP 服务器收到 DHCPDISCOVER 请求报文后会使用 DHCPOFFER 包进行回复。 -* 然后客户端获取到 DHCPOFFER 数据包,并向服务器发送一个 DHCPREQUEST 包,表示它已准备好接收 DHCPOFFER 包中提供的网络配置信息。 -* 最后,DHCP 服务器从客户端收到 DHCPREQUEST 报文后,发送 DHCPACK 报文,表示客户端现在允许使用分配给它的IP地址。 +*   一旦客户端(配置为使用 DHCP 的机器)连接到网络后,它会向 DHCP 服务器发送 **DHCPDISCOVER** 数据包。 +* 当 DHCP 服务器收到 **DHCPDISCOVER** 请求报文后会使用 **DHCPOFFER** 包进行回复。 +* 然后客户端获取到 **DHCPOFFER** 数据包,并向服务器发送一个 **DHCPREQUEST** 包,表示它已准备好接收 **DHCPOFFER** 包中提供的网络配置信息。 +* 最后,DHCP 服务器从客户端收到 **DHCPREQUEST** 报文后,发送 **DHCPACK** 报文,表示现在允许客户端使用分配给它的 IP 地址。 在本文中,我们将介绍如何在 Ubuntu/Debian Linux 中设置 DHCP 服务器,我们将使用[ sudo 命令][1]来运行所有命令,以获得 root 用户权限。 ### 测试环境设置 -这步我们会使用如下的测试环境。 +在这步中我们会使用如下的测试环境。 ``` DHCP Server - Ubuntu 16.04 DHCP Clients - CentOS 7 and Fedora 25 ``` -### 步骤1:在 Ubuntu 中安装 DHCP 服务器 +### 步骤 1:在 Ubuntu 中安装 DHCP 服务器 -1. 运行下面的命令来安装 DHCP 服务器包,也就是 dhcp3-server。 +1. 运行下面的命令来安装 DHCP 服务器包,也就是 **dhcp3-server**。 ``` $ sudo apt install isc-dhcp-server ``` -2. 安装完成后,编辑 /etc/default/isc-dhcp-server 使用 INTERFACES 选项定义 DHCPD 响应 DHCP 请求所使用的接口。 +2. 安装完成后,编辑 **/etc/default/isc-dhcp-server** 使用 INTERFACES 选项定义 DHCPD 响应 DHCP 请求所使用的接口。 比如,如果你想让 DHCPD 守护进程监听 `eth0`,按如下设置: @@ -49,8 +49,8 @@ INTERFACES="eth0" 并且 DHCP 配置中定义了两种不同的声明,它们是: -* parameters - 指定如何执行任务、是否执行任务,还有指定要发送给 DHCP 客户端的网络配置选项。 -* declarations - 定义网络拓扑、指定客户端、为客户端提供地址,或将一组参数应用于一组声明。 +* **parameters** - 指定如何执行任务、是否执行任务,还有指定要发送给 DHCP 客户端的网络配置选项。 +* **declarations** - 定义网络拓扑、指定客户端、为客户端提供地址,或将一组参数应用于一组声明。 4. 现在打开并修改主文件,定义 DHCP 服务器选项: @@ -68,7 +68,7 @@ max-lease-time 7200; authoritative; ``` -5. 现在定义一个子网,这里我们为 192.168.10.0/24 局域网设置 DHCP (使用适用你情况的参数): +5. 现在定义一个子网,这里我们为 **192.168.10.0/24** 局域网设置 DHCP (请使用适用你情况的参数): ``` subnet 192.168.10.0 netmask 255.255.255.0 { @@ -83,7 +83,7 @@ range 192.168.10.110 192.168.10.200; ### 步骤 3:在 DHCP 客户端上配置静态地址 -6. 要给特定的客户机分配一个固顶的(静态)的IP,你需要显式将这台机器的 MAC 地址以及静态分配的地址添加到下面这部分。 +6. 要给特定的客户机分配一个固顶的(静态)的 IP,你需要显式将这台机器的 MAC 地址以及静态分配的地址添加到下面这部分。 ``` host centos-node { @@ -149,9 +149,9 @@ $ sudo service networking restart ![Set DHCP Network in Fedora](http://www.tecmint.com/wp-content/uploads/2017/03/Set-DHCP-Network-in-Fedora.png) ][3] -在 Fedora 中设置 DHCP 网络 +*在 Fedora 中设置 DHCP 网络* -此时,如果所有设置完成了,你的客户端应该可以自动从 DHCP 服务器接收IP 地址了。 +此时,如果所有设置完成了,你的客户端应该可以自动从 DHCP 服务器接收 IP 地址了。 就是这样了!在本篇教程中,我们向你展示了如何在 Ubuntu/Debian 设置 DHCP 服务器。在反馈栏中分享你的想法。如果你正在使用基于 Fedora 的发行版,请阅读如何在 CentOS/RHEL 中设置 DHCP 服务器。 From 13e293d8beee61fd045c59637398d946c1f015a0 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Tue, 28 Mar 2017 09:41:31 +0800 Subject: [PATCH 010/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对中 --- .../20170321 How to deploy Kubernetes on the Raspberry Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20170321 How to deploy Kubernetes on the Raspberry Pi.md b/translated/tech/20170321 How to deploy Kubernetes on the Raspberry Pi.md index 537f482b13..b60f1e69d1 100644 --- a/translated/tech/20170321 How to deploy Kubernetes on the Raspberry Pi.md +++ b/translated/tech/20170321 How to deploy Kubernetes on the Raspberry Pi.md @@ -82,11 +82,11 @@ Lucas Käldström - 谢谢你发现我!我是一名来自芬兰的说瑞典语 ------------------ -via: 网址 +via: https://opensource.com/article/17/3/kubernetes-raspberry-pi 作者:[ Lucas Käldström][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fbd49e708d15d02cd41a865ed9240859d7e14b77 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 Mar 2017 10:28:36 +0800 Subject: [PATCH 011/241] translated --- sources/tech/20170320 Why Go.md | 64 ------------------------------ translated/tech/20170320 Why Go.md | 63 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 64 deletions(-) delete mode 100644 sources/tech/20170320 Why Go.md create mode 100644 translated/tech/20170320 Why Go.md diff --git a/sources/tech/20170320 Why Go.md b/sources/tech/20170320 Why Go.md deleted file mode 100644 index 7fae4fd657..0000000000 --- a/sources/tech/20170320 Why Go.md +++ /dev/null @@ -1,64 +0,0 @@ -translating---geekpi - -Why Go? -============================================================ - -A few weeks ago I was asked by a friend, “why should I care about Go”? They knew that I was passionate about Go, but wanted to know why I thought  _other people_  should care. This article contains three salient reasons why I think Go is an important programming language. - -# Safety - -As individuals, you and I may be perfectly capable of writing a program in C that neither leaks memory or reuses it unsafely. However, with more than [40 years][5] of experience, it is clear that collectively, programmers working in C are unable to reliably do so  _en masse_ . - -Despite static code analysis, valgrind, tsan, and `-Werror` being available for a decades, there is scant evidence those tools have achieved widespread acknowledgement, let alone widespread adoption. In aggregate, programmers have shown they simply cannot safely manage their own memory. It’s time to move away from C. - -Go does not rely on the programmer to manage memory directly, instead all memory allocation is managed by the language runtime, initialized before use, and bounds checked when necessary. It’s certainly not the first mainstream language that offered these safety guarantees, Java (1995) is probably a contender for that crown. The point being, the world has no appetite for unsafe programming languages, thus Go is memory safe by default. - -# Developer productivity - -The point at which developer time became more expensive than hardware time was crossed back in the late 1970s. Developer productivity is a sprawling topic but it boils down to this; how much time do you spend doing useful work vs waiting for the compiler or hopelessly lost in a foreign codebase. - -The joke goes that Go was developed while waiting for a [C++ program to compile][6]. Fast compilation is a key feature of Go and a key recruiting tool to attract new developers. While compilation speed remains a [constant battleground][7], it is fair to say that compilations which take minutes in other languages, take seconds in Go. - -More fundamental to the question of developer productivity, Go programmers realise that code is  _written to be read_  and so place the [act of reading code above the act of writing it][8]. Go goes so far as to enforce, via tooling and custom, that all code by formatted in a specific style. This removes the friction of learning a project specific language sub-dialect and helps spot mistakes because they just  _look incorrect._ - -Due to a focus on analysis and mechanical assistance, a growing set of tools that exist to spot common coding errors have been adopted by Go developers in a way that never struck a chord with C programmers—Go developers  _want_  tools to help them keep their code clean. - -# Concurrency - -For more than a decade, chip designers have been warning that the [free lunch is over][9]. Hardware parallelism, from the lowliest mobile phone to the most power hungry server, in the form of [more, slower, cpu cores][10], is only available  _if_  your language can utilise them. Therefore, concurrency needs to be built into the software we write to run on today’s hardware. - -Go takes a step beyond languages that expose the operating system’s multi-process or multi-threading parallelism models by offering a [lightweight concurrency model based on coroutines][11], or goroutines as they are known in Go. Goroutines allows the programmer to eschew convoluted callback styles while the language runtime makes sure that there will be just enough threads to keep your cores active. - -# The rule of three - -These were my three reasons for recommending Go to my friend; safety, productivity, and concurrency. Individually, there are languages that cover one, possibly two of these domains, but it is the combination of all three that makes Go an excellent choice for mainstream programmers today. - -### Related Posts: - -1. [Why Go and Rust are not competitors][1] -2. [Hear me speak about Go performance at OSCON][2] -3. [I’m speaking at GopherChina and GopherCon Singapore][3] -4. [Stress test your Go packages][4] - --------------------------------------------------------------------------------- - -via: https://dave.cheney.net/2017/03/20/why-go - -作者:[Dave Cheney][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://dave.cheney.net/ -[1]:https://dave.cheney.net/2015/07/02/why-go-and-rust-are-not-competitors -[2]:https://dave.cheney.net/2015/05/31/hear-me-speak-about-go-performance-at-oscon -[3]:https://dave.cheney.net/2017/02/09/im-speaking-at-gopherchina-and-gophercon-singapore -[4]:https://dave.cheney.net/2013/06/19/stress-test-your-go-packages -[5]:https://en.wikipedia.org/wiki/C_(programming_language) -[6]:https://commandcenter.blogspot.com.au/2012/06/less-is-exponentially-more.html -[7]:https://dave.cheney.net/2016/11/19/go-1-8-toolchain-improvements -[8]:https://twitter.com/rob_pike/status/791326139012620288 -[9]:http://www.gotw.ca/publications/concurrency-ddj.htm -[10]:https://www.technologyreview.com/s/601441/moores-law-is-dead-now-what/ -[11]:https://blog.golang.org/concurrency-is-not-parallelism diff --git a/translated/tech/20170320 Why Go.md b/translated/tech/20170320 Why Go.md new file mode 100644 index 0000000000..b890d1b5cb --- /dev/null +++ b/translated/tech/20170320 Why Go.md @@ -0,0 +1,63 @@ +为什么使用 Go 语言? +============================================================ + +几个星期前,我一个朋友问我:“为什么要关心 Go 语言”? 因为他们知道我热衷于 Go 语言,但他们想知道为什么我认为_其他人_也应该关心。本文包含三个我认为 Go 是重要的编程语言的原因。 + +# 安全 + +个人而言,你和我或许完全有能力在 C 中编写程序,既不会泄漏内存,也不会不安全地重复使用内存。然而,即使对有超过[ 40 年][5]的经验的人而言,用 C 的程序员也无法可靠地这样做。 + +尽管静态代码分析、valgrind、tsan 以及 “-Werror” 已经存在了几十年,很少有证据表明这些工具被广泛认可,更不用说广泛采用。总而言之,程序员已经表明他们根本无法自己安全地管理内存。现在是离开 C 的时候了。 + +Go 不依赖于程序员直接管理内存,所有内存分配都由语言运行时管理,使用前初始化,必要时检查边界。它肯定不是提供这些安全保障的第一个主流语言,Java(1995)可能是该冠军的竞争者。关键是,世界对不安全的编程语言没有胃口,所以默认情况下,Go 是内存安全的。 + +# 开发人员生产力 + +在 20 世纪 70 年代末,开发人员时间变得比硬件时间更昂贵这个问题被忽略了。开发人员的生产力是一个广泛的话题,但它归结为这一点:你花了多少时间做有用的工作还是等待编译器或者失望地迷失在外部代码库中。 + +有个笑话说 Go 是在等待[ C ++ 程序编译][6]时开发的。快速编译是 Go 的一个重要功能,也是吸引新开发人员的关键工具。虽然编译速度仍然是一个[永久的战场][7],但公平地说,在其他语言中需要几分钟的编译,在 Go 中只需要几秒钟。 + +Go 程序员意识到生产力更根本的问题是代码是为了_读而写的_,所以将[代码的阅读行为放在编写之上][8]。Go 通过工具和自定义强制所有代码通过格式化成特定的样式。这消除了学习项目特定语言子方言时的困难,并帮助发现错误,因为它们_看上去_不正确。 + +由于专注于分析和机器辅助,Go 开发人员开始采用越来越多的工具来发现常见的编码错误,这种工具从来没有在 C 语言中产生共鸣 - Go 开发人员_希望_工具帮助他们保留代码清洁。 + +# 并发 + +十多年来,芯片设计师一直在警告[免费午餐将会结束][9]。从最低端的手机到最耗电的服务器,硬件的并行性以[更多、更慢、堆 cpu 内核][10]的形式出现,只有_如果_你的语言可以利用它们才能实现。因此,并发需要在我们编写的软件中内置到今天的硬件上运行。 + +通过提供一种基于协程的[轻量级并发模型][11],或者是 Go 中已知的 goroutines,Go 超越了那些暴露操作系统的多进程或多线程并行模型的语言。goroutines 允许程序员避开复杂的回调,而语言运行时确保有足够的线程来保持你的内核的活跃。 + +# 总结 + +我给朋友推荐 Go 有三个原因:安全性、生产率和并发性。单独地,有些语言可以涵盖一个也有可能是两个方面,但是这三个方面的结合使得 Go 成为主流程序员的绝佳选择。 + + +###相关文章: + +1. [为什么 Go 和 Rust 不是竞争对手][1] +2. [听听我在 OSCON 上谈 Go 语言性能][2] +3. [我在 GopherChina 和 GopherCon Singapore 中的演讲][3] +4. [压力测试你 Go 包][4] + +-------------------------------------------------------------------------------- + +via: https://dave.cheney.net/2017/03/20/why-go + +作者:[Dave Cheney][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://dave.cheney.net/ +[1]:https://dave.cheney.net/2015/07/02/why-go-and-rust-are-not-competitors +[2]:https://dave.cheney.net/2015/05/31/hear-me-speak-about-go-performance-at-oscon +[3]:https://dave.cheney.net/2017/02/09/im-speaking-at-gopherchina-and-gophercon-singapore +[4]:https://dave.cheney.net/2013/06/19/stress-test-your-go-packages +[5]:https://en.wikipedia.org/wiki/C_(programming_language) +[6]:https://commandcenter.blogspot.com.au/2012/06/less-is-exponentially-more.html +[7]:https://dave.cheney.net/2016/11/19/go-1-8-toolchain-improvements +[8]:https://twitter.com/rob_pike/status/791326139012620288 +[9]:http://www.gotw.ca/publications/concurrency-ddj.htm +[10]:https://www.technologyreview.com/s/601441/moores-law-is-dead-now-what/ +[11]:https://blog.golang.org/concurrency-is-not-parallelism From ea9f52ba7d322841e93dfd4979b5f7bb3f9eb39f Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Tue, 28 Mar 2017 11:15:10 +0800 Subject: [PATCH 012/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 --- ...o deploy Kubernetes on the Raspberry Pi.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/translated/tech/20170321 How to deploy Kubernetes on the Raspberry Pi.md b/translated/tech/20170321 How to deploy Kubernetes on the Raspberry Pi.md index b60f1e69d1..c2f82cd8b9 100644 --- a/translated/tech/20170321 How to deploy Kubernetes on the Raspberry Pi.md +++ b/translated/tech/20170321 How to deploy Kubernetes on the Raspberry Pi.md @@ -7,40 +7,40 @@ ![How to deploy Kubernetes on the Raspberry Pi ](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/raspberrypi_cartoon.png?itok=sntNdheJ "How to deploy Kubernetes on the Raspberry Pi ") >图片提供: opensource.com -当我开始对[ARM][6]设备,特别是 Raspberry Pi 感兴趣时,我的第一个项目是一个 OpenVPN 服务器。 +当我开始对 [ARM][6]设备,特别是 Raspberry Pi 感兴趣时,我的第一个项目是一个 OpenVPN 服务器。 -通过将 Raspberry Pi 作为家庭网络的安全网关,我可以使用我的手机来控制我的桌面,并远程播放 Spotify,打开文档以及一些其他有趣的东西。我在第一个项目中使用了一个现有的教程,因为我害怕自己使用命令行。 +通过将 Raspberry Pi 作为家庭网络的安全网关,我可以使用我的手机来控制我的桌面,远程播放 Spotify,打开文档以及一些其他有趣的东西。我在第一个项目中使用了一个现有的教程,因为我害怕自己使用命令行。 -更多关于 Raspberry Pi 的: +更多关于 Raspberry Pi 的文章: * [最新的 Raspberry Pi][1] * [什么是 Raspberry Pi?][2] * [开始使用 Raspberry Pi][3] * [给我们发送你的 Raspberry Pi 项目和教程][4] -几个月后,这种恐惧消失了。我扩展了我的原始项目,并使用[ Samba 服务器][7]从文件服务器隔离了 OpenVPN 服务器。这是我第一个没有完全按照教程来的项目。不幸的是,在我的 Samba 项目结束后,我意识到我没有记录任何东西,所以我无法复制它。为了重新创建它,我不得不重新参考那些单独的教程,并将它们放在一起。 +几个月后,这种恐惧消失了。我扩展了我的原始项目,并使用[ Samba 服务器][7]从文件服务器隔离了 OpenVPN 服务器。这是我第一个没有完全按照教程来的项目。不幸的是,在我的 Samba 项目结束后,我意识到我没有记录任何东西,所以我无法复制它。为了重新创建它,我不得不重新参考我曾经用过的那些单独的教程,将项目拼回到一起。 我学到了关于开发人员工作流程的宝贵经验 - 跟踪你所有的更改。我在本地做了一个小的 git 仓库,并记录了我输入的所有命令。 ### 发现 Kubernetes -2015 年 5 月,我发现了 Linux 容器和 Kubernetes。我觉得 Kubernetes 很有魅力,我可以使用仍在技术上发展的概念 - 并且我实际上可以用它。平台本身及其所呈现的可能性令人兴奋。直到那时,我刚刚在一块 Raspberry Pi 上运行了一个程序。有了 Kubernetes,我可以做出比以前更高级的配置。 +2015 年 5 月,我发现了 Linux 容器和 Kubernetes。我觉得 Kubernetes 很有魅力,我可以使用仍在技术上发展的概念 - 并且我实际上可以用它。平台本身及其所呈现的可能性令人兴奋。在此之前,我才刚刚在一块 Raspberry Pi 上运行了一个程序。有了 Kubernetes,我可以做出比以前更高级的配置。 -那时候,Docker(还是 v1.6,如果我记得正确的话)在 ARM 上有一个 bug,这意味着在 Raspberry Pi 上运行 Kubernetes 实际上是不可能的。在早期的 0.x 版本中,Kubernetes 的变化很快。每次我在 AMD64 上找到一篇关于如何设置 Kubernetes 的指南时,它还是一个较旧的版本,并且与我当时使用的完全不兼容。 +那时候,Docker(v1.6 版本,如果我记得正确的话)在 ARM 上有一个 bug,这意味着在 Raspberry Pi 上运行 Kubernetes 实际上是不可能的。在早期的 0.x 版本中,Kubernetes 的变化很快。每次我在 AMD64 上找到一篇关于如何设置 Kubernetes 的指南时,它针对的还都是一个旧版本,与我当时使用的完全不兼容。 -我用自己的方法在 Raspberry Pi 上创建了一个 Kubernetes 节点,而在 Kubernetes v1.0.1 中,我使用 Docker v1.7.1 [让它工作了][8]。这是完全将 Kubernetes 部署到 ARM 的方法。 +不管怎样,我用自己的方法在 Raspberry Pi 上创建了一个 Kubernetes 节点,而在 Kubernetes v1.0.1 中,我使用 Docker v1.7.1 [让它工作了][8]。这是第一个将 Kubernetes 全功能部署到 ARM 的方法。 -在 Raspberry Pi 上运行 Kubernetes 的优势在于,由于 ARM 设备非常小巧,因此不会产生大量的功耗。如果程序以正确的方式构建,那么同样可以在 AMD64 上用同样的方法运行程序。有一块小型 IoT 板为教育创造了巨大的机会。用来做演示如在会议中也是非常有用的。使用 Raspberry Pi (通常)比在大型英特尔机器要容易得多。 +在 Raspberry Pi 上运行 Kubernetes 的优势在于,由于 ARM 设备非常小巧,因此不会产生大量的功耗。如果程序以正确的方式构建,那么同样可以在 AMD64 上用同样的方法运行程序。有一块小型 IoT 板为教育创造了巨大的机会。用它来做演示也很有用,比如你要出差参加一个会议。携带 Raspberry Pi (通常)比拖着大型英特尔机器要容易得多。 -现在符合[我建议][9]的 ARM(32位和64位)的支持已被合并到核心中。ARM 的二进制文件会自动与 Kubernetes 一起发布。虽然我们还没有为 ARM 提供自动化的 CI(持续集成)系统,它可以自动在 PR 合并之前确定在它可在 ARM 上工作,它仍然工作得不错。 +现在按照[我建议][9]的 ARM(32 位和 64 位)的支持已被合并到核心中。ARM 的二进制文件会自动与 Kubernetes 一起发布。虽然我们还没有为 ARM 提供自动化的 CI(持续集成)系统,在 PR 合并之前会自动确定它可在 ARM 上工作,它仍然工作得不错。 ### Raspberry Pi 上的分布式网络 -我在 [kubeadm][10] 发现了 Weave Net。[Weave Mesh][11]是一个有趣的分布式网络解决方案,因此我开始阅读更多关于它的内容。在 2016 年 12 月,我在 [Weaveworks][12] 收到了第一份合同工作。我是 Weave Net 中 ARM 支持团队的一员。 +我通过 [kubeadm][10] 发现了 Weave Net。[Weave Mesh][11]是一个有趣的分布式网络解决方案,因此我开始阅读更多关于它的内容。在 2016 年 12 月,我在 [Weaveworks][12] 收到了第一份合同工作。我是 Weave Net 中 ARM 支持团队的一员。 -我很高兴可以在 Raspberry Pi 上运行 Weave Net 的工业案例,比如那些需要更加移动化的工厂。目前,将 Weave Scope 或 Weave Cloud 部署到 Raspberry Pi 可能是不可能的(尽管可以考虑使用其他 ARM 设备),因为我猜这个软件需要更多的内存来运行。理想情况下,随着 Raspberry Pi 升级成了 2GB 内存,我想我可以在它上面运行 Weave Cloud 了。 +我很高兴可以在 Raspberry Pi 上运行 Weave Net 的工业案例,比如那些需要更加移动化的工厂。目前,将 Weave Scope 或 Weave Cloud 部署到 Raspberry Pi 可能不太现实(尽管可以考虑使用其他 ARM 设备),因为我猜这个软件需要更多的内存才能运行良好。理想情况下,随着 Raspberry Pi 升级到 2GB 内存,我想我可以在它上面运行 Weave Cloud 了。 -在 Weave Net 1.9 中,Weave Net 支持了 ARM。Kubeadm(通常是 Kubernetes)在多个平台上工作。你可以使用 Weave 将 Kubernetes 部署到 ARM,就像在任何 AMD64 设备上一样上安装 Docker、kubeadm、kubectl 和 kubelet。然后在控制面板下初始化主机: +在 Weave Net 1.9 中,Weave Net 支持了 ARM。Kubeadm(通常是 Kubernetes)在多个平台上工作。你可以使用 Weave 将 Kubernetes 部署到 ARM,就像在任何 AMD64 设备上一样安装 Docker、kubeadm、kubectl 和 kubelet。然后初始化控制面板组件运行的主机: ``` kubeadm init @@ -54,25 +54,25 @@ kubectl apply -f https://git.io/weave-kube 在此之前在 ARM 上,你只可以用 Flannel 安装一个 pod 网络,但是在 Weave Net 1.9 中已经改变了,它官方支持了 ARM。 -最后,记入你的节点: +最后,加入你的节点: ``` kubeadm join --token ``` -就是这样了!Kubernetes 已经部署到了 Raspberry Pi 上了。相比 Intel/AMD64,你不用做特别的比较;Weave Net 在 ARM 上也能工作。 +就是这样了!Kubernetes 已经部署到了 Raspberry Pi 上了。相比在 Intel/AMD64 上运行,你不用做什么特别的事情;Weave Net 在 ARM 上就能工作的很好。 ### Raspberry Pi 社区 -我希望 Raspberry Pi 社区成长起来,并他们的心态传播到世界其他地方。他们在英国和其他国家已经取得了成功,但在芬兰并不是很成功。我希望生态系统能够继续扩展,以让更多的人学习如何部署 Kubernetes 或 Weave 到 ARM 设备上。毕竟,这些是我学到的。通过在 Raspberry Pi 设备上自学,我更好地了解了 ARM 以及其上的软件部署。 +我希望 Raspberry Pi 社区成长起来,他们的思想传播到世界其他地方。他们在英国和其他国家已经取得了成功,但在芬兰并不是很成功。我希望生态系统能够继续扩展,以让更多的人学习如何部署 Kubernetes 或 Weave 到 ARM 设备上。毕竟,这些是我学到的。通过在 Raspberry Pi 设备上自学,我更好地了解了 ARM 及其上面部署的软件。 ### 最后的思考 -我通过加入用户社区、提出问题和不同程度的测试了解的关于 Raspberry Pi 和 Kubernetes 的一切,。 +我通过加入用户社区、提出问题和不同程度的测试,在线学习了关于 Raspberry Pi 和 Kubernetes 的一切。 -我是居住在芬兰的说瑞典语的高中生,到目前为止,我从来没有参加过编程或计算机课程。但我仍然能够加入开源社区,因为它对年龄或教育没有限制:你的工作是根据其优点来判断的。 +我是居住在芬兰的说瑞典语的高中生,到目前为止,我还从来没有参加过编程或计算机课程。但我仍然能够加入开源社区,因为它对年龄或教育没有限制:你的工作是根据其价值来评判的。 -对于任何那些第一次参与开源项目的人而言:深入进去,因为这是完全值得的。你做什么没有任何限制,你将永远不知道开源世界将为你提供哪些机会。这会很有趣,我保证! +对于那些第一次要在开源项目中做出贡献感到紧张的人,我想说:深入进去,因为这是完全值得的。你做什么没有任何限制,你将永远不知道开源世界将为你提供哪些机会。这会很有趣,我保证! -------------------------------------------------------------------------------- From 79956c07df4aaf9d28cd34a21fb9c75741410a7f Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Tue, 28 Mar 2017 14:41:42 +0800 Subject: [PATCH 013/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对中 --- ...ion to LaTeXila - a multi-language LaTeX editor for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md b/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md index f7e60bee98..3f684c3ec0 100644 --- a/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md +++ b/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md @@ -100,7 +100,7 @@ via: https://www.howtoforge.com/tutorial/introduction-to-latexila-latex-editor/ 作者:[Bill Toulas][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7849b02a5f248089f4b891c47f635f7a2b06124a Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Tue, 28 Mar 2017 15:20:14 +0800 Subject: [PATCH 014/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95=20?= =?UTF-8?q?@FSSlc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 翻译的很好 谢谢。 --- ...a multi-language LaTeX editor for Linux.md | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md b/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md index 3f684c3ec0..0b11f85d4b 100644 --- a/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md +++ b/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md @@ -1,19 +1,11 @@ -LaTeXila 简介 - Linux 下一个多语言 LaTeX 编辑器 +LaTeXila 简介 - Linux 上一个多语言 LaTeX 编辑器 ============================================================ -### 在本文中你将看到 - -1. [为何选择使用 LaTeX?][1] -2. [创建新文档并设定文档的基本结构][2] -3. [LaTeXila 简单易用,公式齐全][3] -4. [将 .tex 文件转换为 .rtf 文件][4] -5. [结论][5] - LaTeXila 是一个多语言 LaTeX 编辑器,专为那些偏爱 GTK+ 外观的 Linux 用户设计。这个软件简单,但有足够强大,可定制性良好,所以如果你对 LaTeX 感兴趣,那么你就应该尝试一下这个工具。在下面的快速指南中,我将展示如何使用 LaTeXila 并介绍其主要功能。但在开始之前你可能要问: ### 为何选择使用 LaTeX? -假如我想创建一个文本文档,为什么我不使用 LibreOffice 或者 Abiword 这些常规的工具呢?这个问题的答案是相比于常规的文本编辑器,LaTeX 编辑器一般来说都会提供更多功能强大的格式化工具,让你在写作期间专注于文档的内容。LaTeX 是一个文档准备系统,实际上这意味着它简化了大多数常见出版物的处理过程,这些出版物包括书籍或者科学报告,它们通常都包含很多数学公式,多语言排版元素,交叉引用及引文,参考文献等等需要处理的元素。尽管上面的那些元素也可以用 LibreOffice 来处理,但如果要保证最后处理过的文档是高质量的,相比于使用 LibreOffice,使用 LaTeXila 则要相对简单一些。 +假如我想创建一个文本文档,为什么我不使用 LibreOffice 或者 Abiword 这些常规的工具呢?这个问题的答案是相比于常规的文本编辑器,LaTeX 编辑器一般来说都会提供更多功能强大的格式化工具,让你在写作期间专注于文档的内容。LaTeX 是一个文档准备系统,目的是简化大多数常见出版物的处理过程,例如书籍或者科学报告,它们通常都包含很多数学公式,多语言排版元素,交叉引用及引文,参考文献等等需要处理的元素。尽管上面的那些元素也可以用 LibreOffice 来处理,使用 LaTeXila 要相对简单一些,同时处理得当的话最后得到的会是高质量的文档。 ### 在一个新文档上开始工作并设定文章结构 @@ -23,44 +15,44 @@ LaTeXila 是一个多语言 LaTeX 编辑器,专为那些偏爱 GTK+ 外观的 ![打开 LaTex 编辑器](https://www.howtoforge.com/images/introduction-to-latexila/pic_1.png) ][6] -在这里假设我将写一本书,所以我应该选择书籍模板,像下面的截图那样在相应的括号中添上标题和作者: +在这里假设我将写一本书,所以我选择一个书籍模板,像下面的截图那样在相应的括号中添上标题和作者: [ ![打开书籍模板](https://www.howtoforge.com/images/introduction-to-latexila/pic_2.png) ][7] -现在就让我来解释一些关于文章结构的事情。我知道这看起来就像编代码,如若你是一位作家而非程序员,那么像下面那样工作或许很是奇怪,但请先容我讲完,下面我将对此进行解释。 +现在就让我来解释一些关于文章结构的事情。我知道这看起来就像编代码,如果你是一位作家而非程序员,那么像下面那样工作或许很是奇怪,但请先容我讲完,我将对此进行解释。 -在第一行和第九行之间,我们已经写好了书写整个文档所需的所有基本要素。例如在第一行中,我们可以通过修改“[a4paper,11pt]”来定义纸张和字体的大小,在这个方括号中,我们可以添加更多的选项,选项之间以逗号来分隔。 +在第一行和第九行之间,我们已经写好了书写整个文档所需的所有基本要素。例如在第一行中,我们可以通过修改 “[a4paper,11pt]” 来定义纸张和字体的大小,在这个方括号中,我们可以添加更多的选项,选项之间以逗号来分隔。 -在第二行和第四行之间,我们可以看到一些条目,它们都以“\userpackage”打头,紧接着的是用方括号包裹的选项和用括号包裹的命令。这些命令都是一些增强宏包,LaTeXila 默认已经安装它们到我们的系统上了,并且在大多数模板中都将使用它们。需要特别注意的是字体编码,字符编码和字体的类型。 +在第二行和第四行之间,我们可以看到一些条目,它们都以 “\userpackage” 打头,紧接着的是用方括号包裹的选项和用括号包裹的命令。这些命令都是一些增强宏包,LaTeXila 默认已经安装它们到我们的系统上了,并且在大多数模板中都将使用它们。需要特别注意的是字体编码,字符编码和字体的类型。 -紧着让我们看看 "\maketitle" 这一行,这里我们可以添加一个单独的标题页,且默认情况下标题的内容将被放置在第一页的顶部。类似的,包含“\tableofcontents”的那行将会自动生成书籍的目录。 +紧接着让我们看看 "\maketitle" 这一行,这里我们可以添加一个单独的标题页,且默认情况下标题的内容将被放置在第一页的顶部。类似的,包含 “\tableofcontents” 的那行将会自动生成书籍的目录。 -最后,我们可以自己命名章节的名称,这可以通过在“\chapter”后的括号中添加章节名称来实现。第一个章节将会被自动地标记为第一章。你可以在接下来的行中添加内容,一直到下一个以 "\chapter" 开头的新行为止,这些都将是这个章节的内容。新的章节将会被自动地标记为第二章,以此类推。 +最后,我们可以自己命名章节的名称,这可以通过在 “\chapter” 后的括号中添加章节名称来实现。第一个章节将会被自动地标记为第一章。你可以在接下来的行中添加内容,一直到下一个以 "\chapter" 开头的新行为止,这些都将是这个章节的内容。新的章节将会被自动地标记为第二章,以此类推。 [ ![LaTex 的格式](https://www.howtoforge.com/images/introduction-to-latexila/pic_3.png) ][8] -章节之间还可以用命令“\section”来划分为更小的块,甚至还可以使用“\subsection”来划分为更小的部分。各个小节和章都将被“\tableofcontents”自动检测到,并将使用它们的标题和页码来填充目录的内容。看看下面的截图就可以看到章和小节是如何在你的书中被排版的。 +章节之间还可以用命令 “\section” 来划分为更小的块,甚至还可以使用 “\subsection” 来划分为更小的部分。各个小节和章都将被 “\tableofcontents” 自动检测到,并将使用它们的标题和页码来填充目录的内容。看看下面的截图就可以看到章和小节是如何在你的书中被排版的。 [ ![LaTex 预览](https://www.howtoforge.com/images/introduction-to-latexila/pic_4.png) ][9] -假如你想看看结构的大致布局,你可以将左边的工具栏更换到“结构”选项,并确保所有的内容用缩进隔开了。在工具栏中,你还可以可能控制位于各个小节中的任意数据表格和图片。 +假如你想浏览结构,你可以将左边的工具栏更换到“结构”Structure选项,并确保所有的结构与预期相符。在这里,你还可以控制各小节中的任意数据表格和图片。 [ ![LaTex 结构](https://www.howtoforge.com/images/introduction-to-latexila/pic_5.png) ][10] -讲到这里,有人或许想将表格和图片的位置也包含在目录中。要达到此目的,你需要将下面的两行添加到“\tableofcontents” 之后: +讲到这里,有人或许想将表格和图片的位置也包含在目录中。要达到此目的,你需要将下面的两行添加到 “\tableofcontents” 之后: \listoffigures \listoftables -最后标志着书籍结束的信号是“\end{document}”。所以你的布局应该总是以此为结尾。 +最后标志着书籍结束的信号是 “\end{document}”。你的布局应该总是以此为结尾。 ### LaTeXila 简单易用,公式齐全 @@ -72,7 +64,7 @@ LaTeX 是一个基于命令的文档生成系统,它与使用的编辑器没 LaTeXila 还集成有基于 gspell 的拼写检测系统,你可以在最上面的“工具”菜单中设定合适的语言。最上面的工具栏里几乎包含了你要用到的所有按钮。从左到右,你可以完成添加章节,交叉引用,调整字符的大小,格式化被选取的部分,添加无序列表和数学函数等等。这些都可以手动地输入,但通过点击相应按钮来完成或许更加方便。 -对于生成数学公式,结合侧边栏上的工具栏选项,你只需轻轻一点就可以添加相应的数学符号。点击位于左边的侧边栏中“符号”框,你就可以看到相关的符号分类,例如”关系运算符“,”希腊字母“,”算子“等等。下面的截图就是一些符号的示例: +对于生成数学公式,结合侧边栏上的工具栏选项,你只需轻轻一点就可以添加相应的数学符号。点击位于左边的侧边栏中“符号”Symbols框,你就可以看到相关的符号分类,例如“关系运算符”,“希腊字母”,“运算符”等等。下面的截图就是一些符号的示例: [ ![希腊字母和算子符号](https://www.howtoforge.com/images/introduction-to-latexila/pic_7.png) @@ -82,17 +74,17 @@ LaTeXila 还集成有基于 gspell 的拼写检测系统,你可以在最上面 ### 将 .tex 文件转换为 .rtf 文件 -默认情况下,LaTeXila 会将你的文档保存为标准的 `.tex` 文档,而我们可以使用 `.tex` 文档来生成一个”富文本“文档,这些富文本文档可以使用像 LibreOffice 那样的文本编辑器打开。要达到此目的,我们需要安装一个名为 `latex2rtf` 的工具,它在所有的 Linux 发行版本中都可以被获取到。像下面那样在文本所在的目录打开虚拟终端, 并输入 `latex2rtf 文件名称` : +默认情况下,LaTeXila 会将你的文档保存为标准的 `.tex` 文档,而我们可以使用 `.tex` 文档来生成一个“富文本”rich text format文档,这些富文本文档可以使用像 LibreOffice 那样的文本编辑器打开。要达到此目的,我们需要安装一个名为 `latex2rtf` 的工具,它在所有的 Linux 发行版本中都可以被获取到。在文本所在的目录打开虚拟终端, 并输入 `latex2rtf 文件名称`,如下所示 : [ ![由 LaTeX 文档生成 RTF 文档](https://www.howtoforge.com/images/introduction-to-latexila/pic_8.png) ][13] -当然 LLaTeXila 也提供了它自己的构建工具,这些工具可以在上面的工具栏或者最上面的面板(构建)中看到。但我向你推荐 latex2rtf 是以防在其他的操作系统上出现某些意想不到的问题。 +当然 LLaTeXila 也提供了它自己的构建工具,这些工具可以在上面的工具栏或者最上面的面板(构建)中看到。但我向你推荐 latex2rtf 是以防它们在其他的操作系统上出现某些意想不到的问题,比如在我的系统上就不能正常工作。 ### 结论 -假如上面的介绍激发了你探索 LaTeX 的兴趣,那就再好不过了。我写这篇文章的目的是向新手介绍一款简单易用且适合他们写作的工具。要是 LaTeXila 还带有实时预览的双屏模式的话,它就更加完美了。。。 +假如上面的介绍激发了你探索 LaTeX 的兴趣,那就再好不过了。我写这篇文章的目的是向新手介绍一款简单易用且适合他们写作的工具。要是 LaTeXila 还带有实时预览的双屏模式的话,它就更加完美了... -------------------------------------------------------------------------------- From 0e928ad2ff57addae97825b48414ed956305c006 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Mar 2017 17:08:51 +0800 Subject: [PATCH 015/241] PUB:20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md @FSSlc @jasminepeng --- ...a multi-language LaTeX editor for Linux.md | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) rename {translated/tech => published}/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md (68%) diff --git a/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md b/published/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md similarity index 68% rename from translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md rename to published/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md index 0b11f85d4b..4b8223d299 100644 --- a/translated/tech/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md +++ b/published/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md @@ -1,65 +1,67 @@ -LaTeXila 简介 - Linux 上一个多语言 LaTeX 编辑器 +LaTeXila 简介:Linux 上的一个多语言 LaTeX 编辑器 ============================================================ -LaTeXila 是一个多语言 LaTeX 编辑器,专为那些偏爱 GTK+ 外观的 Linux 用户设计。这个软件简单,但有足够强大,可定制性良好,所以如果你对 LaTeX 感兴趣,那么你就应该尝试一下这个工具。在下面的快速指南中,我将展示如何使用 LaTeXila 并介绍其主要功能。但在开始之前你可能要问: +LaTeXila 是一个多语言 LaTeX 编辑器,专为那些偏爱 GTK+ 外观的 Linux 用户设计。这个软件简单,但又足够强大,可定制性良好,所以如果你对 LaTeX 感兴趣,那么你就应该尝试一下这个工具。在下面的快速指南中,我将展示如何使用 LaTeXila 并介绍其主要功能。但在开始之前你可能要问: ### 为何选择使用 LaTeX? -假如我想创建一个文本文档,为什么我不使用 LibreOffice 或者 Abiword 这些常规的工具呢?这个问题的答案是相比于常规的文本编辑器,LaTeX 编辑器一般来说都会提供更多功能强大的格式化工具,让你在写作期间专注于文档的内容。LaTeX 是一个文档准备系统,目的是简化大多数常见出版物的处理过程,例如书籍或者科学报告,它们通常都包含很多数学公式,多语言排版元素,交叉引用及引文,参考文献等等需要处理的元素。尽管上面的那些元素也可以用 LibreOffice 来处理,使用 LaTeXila 要相对简单一些,同时处理得当的话最后得到的会是高质量的文档。 +假如我想创建一个文本文档,为什么我不使用 LibreOffice 或者 Abiword 这些常规的工具呢?原因是相比于常规的文本编辑器,LaTeX 编辑器一般来说都会提供更多功能强大的格式化工具,让你在写作期间专注于文档的内容。LaTeX 是一个文档准备系统,目的是简化大多数常见出版物的处理过程,例如书籍或者科学报告,它们通常都包含很多数学公式,多语言排版元素,交叉引用及引文,参考文献等等需要处理的元素。尽管上面的那些元素也可以用 LibreOffice 来处理,使用 LaTeXila 要相对简单一些,同时处理得当的话你最后得到的会是一份高质量的文档。 ### 在一个新文档上开始工作并设定文章结构 首先,我们需要在 LaTeXila 中创建一个新文件,这个可以通过点击位于左上角的 “新建文件” 图标来实现,接着它将打开一个对话框,让我们选择一个模板从而快速地开始写作。 [ - ![打开 LaTex 编辑器](https://www.howtoforge.com/images/introduction-to-latexila/pic_1.png) + ![打开 LaTex 编辑器](https://www.howtoforge.com/images/introduction-to-latexila/big/pic_1.png) ][6] 在这里假设我将写一本书,所以我选择一个书籍模板,像下面的截图那样在相应的括号中添上标题和作者: [ - ![打开书籍模板](https://www.howtoforge.com/images/introduction-to-latexila/pic_2.png) + ![打开书籍模板](https://www.howtoforge.com/images/introduction-to-latexila/big/pic_2.png) ][7] 现在就让我来解释一些关于文章结构的事情。我知道这看起来就像编代码,如果你是一位作家而非程序员,那么像下面那样工作或许很是奇怪,但请先容我讲完,我将对此进行解释。 -在第一行和第九行之间,我们已经写好了书写整个文档所需的所有基本要素。例如在第一行中,我们可以通过修改 “[a4paper,11pt]” 来定义纸张和字体的大小,在这个方括号中,我们可以添加更多的选项,选项之间以逗号来分隔。 +在第一行和第九行之间,我们已经写好了书写整个文档所需的所有基本要素。例如在第一行中,我们可以通过修改 `[a4paper,11pt]` 来定义纸张和字体的大小,在这个方括号中,我们可以添加更多的选项,选项之间以英文逗号来分隔。 -在第二行和第四行之间,我们可以看到一些条目,它们都以 “\userpackage” 打头,紧接着的是用方括号包裹的选项和用括号包裹的命令。这些命令都是一些增强宏包,LaTeXila 默认已经安装它们到我们的系统上了,并且在大多数模板中都将使用它们。需要特别注意的是字体编码,字符编码和字体的类型。 +在第二行和第四行之间,我们可以看到一些条目,它们都以 `\userpackage` 打头,紧接着的是用方括号包裹的选项和用括号包裹的命令。这些命令都是一些增强宏包,LaTeXila 默认已经安装它们到我们的系统上了,并且在大多数模板中都将使用它们。需要特别注意的是字体编码,字符编码和字体的类型。 -紧接着让我们看看 "\maketitle" 这一行,这里我们可以添加一个单独的标题页,且默认情况下标题的内容将被放置在第一页的顶部。类似的,包含 “\tableofcontents” 的那行将会自动生成书籍的目录。 +紧接着让我们看看 `\maketitle` 这一行,这里我们可以添加一个单独的标题页,且默认情况下标题的内容将被放置在第一页的顶部。类似的,包含 `\tableofcontents` 的那行将会自动生成书籍的目录。 -最后,我们可以自己命名章节的名称,这可以通过在 “\chapter” 后的括号中添加章节名称来实现。第一个章节将会被自动地标记为第一章。你可以在接下来的行中添加内容,一直到下一个以 "\chapter" 开头的新行为止,这些都将是这个章节的内容。新的章节将会被自动地标记为第二章,以此类推。 +最后,我们可以自己命名章节的名称,这可以通过在 `\chapter` 后的括号中添加章节名称来实现。第一个章节将会被自动地标记为第一章。你可以在接下来的行中添加内容,一直到下一个以 `\chapter` 开头的新行为止,这些都将是这个章节的内容。新的章节将会被自动地标记为第二章,以此类推。 [ - ![LaTex 的格式](https://www.howtoforge.com/images/introduction-to-latexila/pic_3.png) + ![LaTex 的格式](https://www.howtoforge.com/images/introduction-to-latexila/big/pic_3.png) ][8] -章节之间还可以用命令 “\section” 来划分为更小的块,甚至还可以使用 “\subsection” 来划分为更小的部分。各个小节和章都将被 “\tableofcontents” 自动检测到,并将使用它们的标题和页码来填充目录的内容。看看下面的截图就可以看到章和小节是如何在你的书中被排版的。 +章节之间还可以用命令 `\section` 来划分为更小的块,甚至还可以使用 `\subsection` 来划分为更小的部分。各个小节和章都将被 `\tableofcontents` 自动检测到,并将使用它们的标题和页码来填充目录的内容。看看下面的截图就可以看到章和小节是如何在你的书中被排版的。 [ - ![LaTex 预览](https://www.howtoforge.com/images/introduction-to-latexila/pic_4.png) + ![LaTex 预览](https://www.howtoforge.com/images/introduction-to-latexila/big/pic_4.png) ][9] 假如你想浏览结构,你可以将左边的工具栏更换到“结构”Structure选项,并确保所有的结构与预期相符。在这里,你还可以控制各小节中的任意数据表格和图片。 [ - ![LaTex 结构](https://www.howtoforge.com/images/introduction-to-latexila/pic_5.png) + ![LaTex 结构](https://www.howtoforge.com/images/introduction-to-latexila/big/pic_5.png) ][10] -讲到这里,有人或许想将表格和图片的位置也包含在目录中。要达到此目的,你需要将下面的两行添加到 “\tableofcontents” 之后: +讲到这里,有人或许想将表格和图片的位置也包含在目录中。要达到此目的,你需要将下面的两行添加到 `\tableofcontents` 之后: +``` \listoffigures \listoftables +``` -最后标志着书籍结束的信号是 “\end{document}”。你的布局应该总是以此为结尾。 +最后标志着书籍结束的信号是 `\end{document}`。你的布局应该总是以此为结尾。 ### LaTeXila 简单易用,公式齐全 LaTeX 是一个基于命令的文档生成系统,它与使用的编辑器没有多少关联。这里需要强调的是 LaTeXila 提供了一系列强大的工具,使得在你书写报告或书籍时能够节省一些时间和精力。例如对于 LaTex 命令,它提供了自动补全功能,这个功能将在你每次开始输入命令时被激活。 [ - ![LaTeX 中的数学公式](https://www.howtoforge.com/images/introduction-to-latexila/pic_6.png) + ![LaTeX 中的数学公式](https://www.howtoforge.com/images/introduction-to-latexila/big/pic_6.png) ][11] LaTeXila 还集成有基于 gspell 的拼写检测系统,你可以在最上面的“工具”菜单中设定合适的语言。最上面的工具栏里几乎包含了你要用到的所有按钮。从左到右,你可以完成添加章节,交叉引用,调整字符的大小,格式化被选取的部分,添加无序列表和数学函数等等。这些都可以手动地输入,但通过点击相应按钮来完成或许更加方便。 @@ -67,7 +69,7 @@ LaTeXila 还集成有基于 gspell 的拼写检测系统,你可以在最上面 对于生成数学公式,结合侧边栏上的工具栏选项,你只需轻轻一点就可以添加相应的数学符号。点击位于左边的侧边栏中“符号”Symbols框,你就可以看到相关的符号分类,例如“关系运算符”,“希腊字母”,“运算符”等等。下面的截图就是一些符号的示例: [ - ![希腊字母和算子符号](https://www.howtoforge.com/images/introduction-to-latexila/pic_7.png) + ![希腊字母和算子符号](https://www.howtoforge.com/images/introduction-to-latexila/big/pic_7.png) ][12] 这些符号的图形化列表使得公式和数学表达式的生成犹如在公园中散步那样舒适。 @@ -77,10 +79,10 @@ LaTeXila 还集成有基于 gspell 的拼写检测系统,你可以在最上面 默认情况下,LaTeXila 会将你的文档保存为标准的 `.tex` 文档,而我们可以使用 `.tex` 文档来生成一个“富文本”rich text format文档,这些富文本文档可以使用像 LibreOffice 那样的文本编辑器打开。要达到此目的,我们需要安装一个名为 `latex2rtf` 的工具,它在所有的 Linux 发行版本中都可以被获取到。在文本所在的目录打开虚拟终端, 并输入 `latex2rtf 文件名称`,如下所示 : [ - ![由 LaTeX 文档生成 RTF 文档](https://www.howtoforge.com/images/introduction-to-latexila/pic_8.png) + ![由 LaTeX 文档生成 RTF 文档](https://www.howtoforge.com/images/introduction-to-latexila/big/pic_8.png) ][13] -当然 LLaTeXila 也提供了它自己的构建工具,这些工具可以在上面的工具栏或者最上面的面板(构建)中看到。但我向你推荐 latex2rtf 是以防它们在其他的操作系统上出现某些意想不到的问题,比如在我的系统上就不能正常工作。 +当然 LaTeXila 也提供了它自己的构建工具,这些工具可以在上面的工具栏或者最上面的面板(构建)中看到。但我向你推荐 latex2rtf 是以防它们在其他的操作系统上出现某些意想不到的问题,比如在我的系统上就不能正常工作。 ### 结论 From 603de412fcc04790be9de1843c1f814cfc55b95f Mon Sep 17 00:00:00 2001 From: mec2cod Date: Tue, 28 Mar 2017 21:58:33 +0800 Subject: [PATCH 016/241] translating 20170125 An executives guide to containers.md --- sources/tech/20170125 An executives guide to containers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170125 An executives guide to containers.md b/sources/tech/20170125 An executives guide to containers.md index 6967275d56..7f189db4d7 100644 --- a/sources/tech/20170125 An executives guide to containers.md +++ b/sources/tech/20170125 An executives guide to containers.md @@ -1,3 +1,5 @@ +being translated by zhousiyu325 + An executive's guide to containers ============================================================ From dfd58fe2095025cb73f07c3de47ecf5478b39dbb Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Mar 2017 23:50:21 +0800 Subject: [PATCH 017/241] PRF:20170219 Windows wins the desktop, but Linux takes the world.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Meditator-hkx 翻译的很好! --- ... the desktop, but Linux takes the world.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/talk/20170219 Windows wins the desktop, but Linux takes the world.md b/translated/talk/20170219 Windows wins the desktop, but Linux takes the world.md index dff15aac07..8292eba7ec 100644 --- a/translated/talk/20170219 Windows wins the desktop, but Linux takes the world.md +++ b/translated/talk/20170219 Windows wins the desktop, but Linux takes the world.md @@ -1,34 +1,34 @@ -Windows赢了桌面,而Linux赢得整个世界 +Windows 赢了桌面,而 Linux 赢得整个世界 ============================================================ -拥有最高级的 Linux 桌面系统项目的城市正转回 Windows 阵营,但 Linux 的命运已经不再与 PC 休戚相关。 + +> 最坚决推行 Linux 桌面系统项目的城市正在转回 Windows 阵营,但 Linux 的命运已经不再与 PC 休戚相关。 ![munich2.jpg](http://zdnet3.cbsistatic.com/hub/i/r/2017/02/10/9befc3d2-7931-48df-8114-008d23f1941d/resize/770xauto/02ca33958e5288c81a85d3dac546f621/munich2.jpg) + > 慕尼黑的 Linux 项目只是开源软件故事中的一小部分 > 图片: Getty Images/iStockphoto -在实施从 Windows 系统迁移到 Linux 系统这一项目接近十年之久, 慕尼黑却突然走上了一条戏剧性的转弯。据说是到 2021 年,地方议会就会开始用 [Windows 10][4] 替换运行 LiMux (Ubuntu 的一种自定义版本)的 PC 机。 +在实施从 Windows 系统迁移到 Linux 系统这一项目接近十年之久后,慕尼黑却突然走上了一条戏剧性的转弯。据说是到 2021 年,该城市的地方议会就会开始用 [Windows 10][4] 替换运行 LiMux (Ubuntu 的一种自定义版本)的 PC 机。 若是回到 15 或者 20 年前,人们可能会争论什么时候 Linux 将会在桌面上取代 Windows。例如,当 Ubuntu 于 2004 年问世时,它是带着 [终结 Windows 的抱负][5] 而被设计为标准的桌面操作系统的。 剧透:这一切并没有发生。 -桌面上的 Linux 在今天占有约为 2% 的市场,很多人都认为它复杂晦涩。与此同时,Windows 则稳航无虞,在 PC 市场笑傲群雄,天下十之有九。但商业中总还有些许 Linux 桌面的身影,它仍被需要——尤其是对开发者和数据科学家而言。 +桌面上的 Linux 在今天占有约为 2% 的市场,很多人都认为它复杂晦涩。与此同时,Windows 则航行无虞,在 PC 市场笑傲群雄,天下十有其九。但在商业领域中总还有些许 Linux 桌面的身影,它仍被需要——尤其是对开发者和数据科学家而言。 但遗憾的是,它永远也不会成为历史的主流。 慕尼黑的 Linux 项目因其规模之大,引起了许多人的兴趣。几乎没有哪家大型组织会做出从 Windows 到 Linux 的迁移,一些个别的案例像 [法国宪兵队和都灵市][6] 曾有类似之举。然而,[慕尼黑作为模范][7]:在这一事件上的失败将会大大打击那些仍在 [试图用 Linux 将 Windows 取而代之的信徒们][8]。 +但现实就是如此,绝大多数公司乐于去使用主流的桌面操作系统,因为它具有完整一致、用户友好这种优势。 -但现实就是如此,绝大多数公司乐于去使用主流的桌面操作系统,因为它具有完整性、用户友好这种天然的优势。 - -工作人员所抱怨的问题中,有多少是归咎于 Limux 软件以及多少是操作系统无端被责备的,已经不可计数。但重要的是,无论慕尼黑最后何去何从,Linux 的命运都已经脱离了桌面——是的,Linux 在多年前就已经输掉了桌面战争。 +工作人员所抱怨的问题中,有多少是归咎于 LiMux 软件以及多少是操作系统无端被责备的,已经不可计数。但重要的是,无论慕尼黑最后何去何从,Linux 的命运都已经脱离了桌面 —— 是的,Linux 在多年前就已经输掉了桌面战争。 但这对 Linux 来说无伤大雅,因为它赢得了智能手机之战,并且在云端和物联网之战上也是捷报连连。 +你的口袋里,有七八成可能装的是一个 Linux 驱动的智能手机(Android 基于 Linux 内核)。你的身边,更是有成千上万 Linux 驱动的设备,虽然这些也许你甚至都没注意到。 -你的口袋里,七八成装的是一个 Linux 驱动的智能手机(Android 基于 Linux 内核)。你的身边,更是有成千上万 Linux 驱动的设备,虽然这些也许你甚至都没注意到。 - -[像 Raspberry Pi][9] 这样运行大量不同类型 Linux 的设备,正在创建一个充满热情和活力的开发者社区,并且提供给初创公司一种低成本的驱动新设备的方法。 +[像树莓派][9]这样运行大量不同类型 Linux 的设备,正在创建一个充满热情和活力的开发者社区,并且提供给初创公司一种低成本的驱动新设备的方法。 大部分公有云也是以这样或那样的形式在 Linux 上运行的;即便是微软,也已经敞开大门,拥抱开源软件。无论你站在哪一个软件平台的立场,不可否认地,开发者和用户拥有更多丰富的可选项是一件好事,对决策来说,抑或是对创新来说,都是如此。 @@ -36,15 +36,15 @@ Windows赢了桌面,而Linux赢得整个世界 虽然慕尼黑传奇的曲折变换与 Linux 在桌面上的冒险耐人寻味,但它们却并未给你呈现出一个完整的故事。 - _同意? 还是不同意? 在下面添加你的评论来加入讨论吧!_ +_同意? 还是不同意? 在下面添加你的评论来加入讨论吧!_ -------------------------------------------------------------------------------- via: http://www.zdnet.com/article/windows-wins-the-desktop-but-linux-takes-the-world/ -作者:[Steve Ranger ][a] +作者:[Steve Ranger][a] 译者:[Meditator-hkx](https://github.com/Meditator-hkx) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From abebea92d484f7204b4150b6c78d96876a63f5b7 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Mar 2017 23:50:37 +0800 Subject: [PATCH 018/241] PUB:20170117 Arch Linux on a Lenovo Yoga 900.md @Meditator-hkx --- .../20170117 Arch Linux on a Lenovo Yoga 900.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20170117 Arch Linux on a Lenovo Yoga 900.md (100%) diff --git a/translated/talk/20170117 Arch Linux on a Lenovo Yoga 900.md b/published/20170117 Arch Linux on a Lenovo Yoga 900.md similarity index 100% rename from translated/talk/20170117 Arch Linux on a Lenovo Yoga 900.md rename to published/20170117 Arch Linux on a Lenovo Yoga 900.md From 5b0f6705a2271414f69947f77cb07f3c8c92f7d5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 29 Mar 2017 08:56:25 +0800 Subject: [PATCH 019/241] translating --- ...communities in India support privacy and software freedom.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170128 How communities in India support privacy and software freedom.md b/sources/tech/20170128 How communities in India support privacy and software freedom.md index 28e7adf42e..b630669304 100644 --- a/sources/tech/20170128 How communities in India support privacy and software freedom.md +++ b/sources/tech/20170128 How communities in India support privacy and software freedom.md @@ -1,3 +1,5 @@ +translating---geekpi + How communities in India support privacy and software freedom ============================================================ From 651349117cf4900dfabb2a1544f673ea04d5a2e6 Mon Sep 17 00:00:00 2001 From: VicYu Date: Wed, 29 Mar 2017 09:00:00 +0800 Subject: [PATCH 020/241] Update 20170116 Using the AWS SDK for Gos Regions and Endpoints Metadata.md --- ... Using the AWS SDK for Gos Regions and Endpoints Metadata.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170116 Using the AWS SDK for Gos Regions and Endpoints Metadata.md b/sources/tech/20170116 Using the AWS SDK for Gos Regions and Endpoints Metadata.md index 2651b624dd..2656013941 100644 --- a/sources/tech/20170116 Using the AWS SDK for Gos Regions and Endpoints Metadata.md +++ b/sources/tech/20170116 Using the AWS SDK for Gos Regions and Endpoints Metadata.md @@ -1,3 +1,5 @@ +    Vic020 + Using the AWS SDK for Go’s Regions and Endpoints Metadata ============================================================ From b165ac49b899bd58372afe642e0fed3a05e42d15 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 29 Mar 2017 09:49:56 +0800 Subject: [PATCH 021/241] translated --- ...ia support privacy and software freedom.md | 38 +++++----- ...ia support privacy and software freedom.md | 74 +++++++++++++++++++ 2 files changed, 92 insertions(+), 20 deletions(-) create mode 100644 translated/tech/20170128 How communities in India support privacy and software freedom.md diff --git a/sources/tech/20170128 How communities in India support privacy and software freedom.md b/sources/tech/20170128 How communities in India support privacy and software freedom.md index b630669304..56cb37cb2a 100644 --- a/sources/tech/20170128 How communities in India support privacy and software freedom.md +++ b/sources/tech/20170128 How communities in India support privacy and software freedom.md @@ -1,50 +1,48 @@ -translating---geekpi - -How communities in India support privacy and software freedom +印度社区如何支持隐私和软件自由 ============================================================ ![How communities in India support privacy and software freedom](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/people_remote_teams_world.png?itok=wI-GW8zX "How communities in India support privacy and software freedom") -Image by : opensource.com +图片提供: opensource.com -The free and open source communities in India, particularly Mozilla and Wikimedia communities, are leading two unique global events for better privacy and in support of free software. +印度的自由和开源社区,特别是 Mozilla 和 Wikimedia 社区,它们正在引领两个独特的全球性活动,以提高隐私及支持自由软件。 -[January Privacy Month][3] is led by the Mozilla community in India to educate the masses about online privacy via both online and offline outreach events. And, [Freedom in Feb][4] is led by the [Centre for Internet and Society][5] to educate content producers like bloggers and photographers on how to donate their content under [open licenses][6]. +[1 月份的隐私月][3]是由印度 Mozilla 社区领导,通过在线和线下活动向群众教育网络隐私。而[ 2 月份的自由月][4]是由[互联网与社会中心][5]领导,教育内容创作者如博主和摄影师就如何在[开放许可证][6]下捐赠内容。 -### January Privacy Month +### 1 月隐私月 -Mozilla's January Privacy Month [began last year][7] to help celebrate the annual [Data Privacy Day][8]. In 2016, this campaign held several in-person and online events that reached [14,339,443 people across 10 countries][9]. "This was possible by sharing 1 privacy tip per day for 31 days throughout the month," says [Ankit Gadgil][10], one of the core organizers. "And this year, we have three focus areas. First of all, we have made this campaign more open and global. Mozilla communities from Brazil, Italy, and Czech Republic are actively participating this year. All essential documents is localized so that we can target more users. Secondly, We are educating participants of offline events about marketing Firefox and other Mozilla products so that the users can have hands-on experience of using these tools that help protect their privacy. The third thing is, we are encouraging everyone that participate an offline event to blog about their learning. For instance, there was a Maker Fest in in the Indian state of Gujarat recently where they used Mozilla products to teach about privacy." +从[去年开始][7]的 Mozilla “1 月隐私月”用来帮助庆祝年度[数据隐私日][8]。在 2016 年,该活动举办了几场涉及[全球 10 个国家 14,339,443 人][9]的线下和线上活动。其中一个核心组织者,[Ankit Gadgil][10]这样说到:“每天分享一个隐私提示,持续一个月 31 天是有可能的。今年,我们共有三个重点领域,首先是我们让这个运动更加开放和全球化。巴西、意大利、捷克共和国的 Mozilla 社区今年正在积极参与,所有的必要文件都是本地化的,所以我们可以针对更多的用户。其次,我们在线下活动中教导用户营销 Firefox 以及 Mozilla 的其他产品,以便用户可以亲身体验使用这些工具来帮助保护他们的隐私。第三点,我们鼓励大家参加线下活动并记录他们的学习,例如,最近在印度古吉拉特邦的一个节目中,他们使用 Mozilla 产品来教授隐私。” -This year, the campaign continues to engage people at in-person and online events. Follow #PrivacyAware to engage. +今年的活动继续有线下和线上活动。关注 #PrivacyAware 参加。 -### Security tips +### 安全提示 -Mozilla products like Firefox have a security settings—both [in built][11] and in the add-on library that are fully [accessible][12] to disabled people—that help protect user’s privacy and security, are all built collaboratively and are open source. +像 Firefox 这样的 Mozilla 产品具有安全性设置-同时还有[内建][11]还有附加的对残疾人完全[可用][12]的库-这有助于保护用户的隐私和安全性,这些都是协同构建的并且是开源的。 -[HTTPS Everywhere][13] can be used for [Chrome][14] and [Opera][15] to encrypt user communications so that external websites cannot see user's information. The project is built collaboratively by [The Tor Project][16] and the [Electronic Frontier Foundation][17]. +[Chrome][14] 和[ Opera][15] 中的 [HTTPS Everywhere][13] 可用于加密用户通信,使外部网站无法查看用户信息。该项目由 [Tor Project][16]以及[电子前沿基金会][17]合作建成。 -### Freedom in February +### 2 月自由月 -[Freedom in Feb][18] is an online campaign aimed at educating content creators about [free content][19] and show them how to contribute their work under free licenses.  +[2 月自由月][18]是一个网络活动,旨在教育内容创作者关于[自由内容][19],并向他们展示如何在自由许可证下作出贡献。 -**To participate:** +** 参加规则:** -* The works you will create or publish in February must be licensed under a [free license][1]. -* Content types include blog posts, other writings, and images. +* 你在二月份制作或出版的作品必须获得[自由许可证][1]许可。 +* 内容类型包括博客帖子、其他文字和图像。 -Creative works like multimedia, text-based content, art and design, etc. can be licensed under several [Creative Commons licenses][20] (CC), and other types of documents can be licensed under the [GNU Free Documentation Licenses][21] (GFDL). Good examples can be found on Wikipedia, where the content is licensed under both CC and GFDL licenses, allowing people to use, share, remix, and distribute derived work both commercially and non-commercially with attribution. Additionally, there are [free software licenses][22] that allow developers to share their software and software-related documentations. +多媒体,基于文本的内容,艺术和设计等创意作品可以通过多个[知识共享许可证][20](CC)进行许可,其他类型的文档可以根据[ GNU 免费文档许可][21](GFDL)许可。Wikipedia 上可以找到很好的例子,其内容根据 CC 和 GFDL 许可证获得许可,允许人们使用、分享、混合和分发衍生用于商业上和非商业性的作品。此外,还有允许开发人员共享他们的软件和软件相关文档的[自由软件许可证][22]。 -------------------------------------------------------------------------------- 作者简介: -Subhashish Panigrahi - Subhashish Panigrahi (@subhapa) is the Asia Community Catalyzer at Mozilla's Participation team, and is transitioning from his role as Programme Officer of the Centre for Internet and Society's Access To Knowledge program Earlier with Wikimedia Foundation's India Program, he is an India based educator, +Subhashish Panigrahi - Subhashish Panigrahi(@shhapa)是 Mozilla 参与团队的亚洲社区催化师,并从 Wikimedia 基金会印度计划的早期扮演了互联网及社会知识获取中心项目官的角色,另外他是一名印度教育者, -------------------------------------------------------------------------------- via: https://opensource.com/article/17/1/how-communities-india-support-privacy-software-freedom 作者:[Subhashish Panigrahi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20170128 How communities in India support privacy and software freedom.md b/translated/tech/20170128 How communities in India support privacy and software freedom.md new file mode 100644 index 0000000000..56cb37cb2a --- /dev/null +++ b/translated/tech/20170128 How communities in India support privacy and software freedom.md @@ -0,0 +1,74 @@ +印度社区如何支持隐私和软件自由 +============================================================ + + ![How communities in India support privacy and software freedom](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/people_remote_teams_world.png?itok=wI-GW8zX "How communities in India support privacy and software freedom") +图片提供: opensource.com + +印度的自由和开源社区,特别是 Mozilla 和 Wikimedia 社区,它们正在引领两个独特的全球性活动,以提高隐私及支持自由软件。 + +[1 月份的隐私月][3]是由印度 Mozilla 社区领导,通过在线和线下活动向群众教育网络隐私。而[ 2 月份的自由月][4]是由[互联网与社会中心][5]领导,教育内容创作者如博主和摄影师就如何在[开放许可证][6]下捐赠内容。 + +### 1 月隐私月 + +从[去年开始][7]的 Mozilla “1 月隐私月”用来帮助庆祝年度[数据隐私日][8]。在 2016 年,该活动举办了几场涉及[全球 10 个国家 14,339,443 人][9]的线下和线上活动。其中一个核心组织者,[Ankit Gadgil][10]这样说到:“每天分享一个隐私提示,持续一个月 31 天是有可能的。今年,我们共有三个重点领域,首先是我们让这个运动更加开放和全球化。巴西、意大利、捷克共和国的 Mozilla 社区今年正在积极参与,所有的必要文件都是本地化的,所以我们可以针对更多的用户。其次,我们在线下活动中教导用户营销 Firefox 以及 Mozilla 的其他产品,以便用户可以亲身体验使用这些工具来帮助保护他们的隐私。第三点,我们鼓励大家参加线下活动并记录他们的学习,例如,最近在印度古吉拉特邦的一个节目中,他们使用 Mozilla 产品来教授隐私。” + +今年的活动继续有线下和线上活动。关注 #PrivacyAware 参加。 + +### 安全提示 + +像 Firefox 这样的 Mozilla 产品具有安全性设置-同时还有[内建][11]还有附加的对残疾人完全[可用][12]的库-这有助于保护用户的隐私和安全性,这些都是协同构建的并且是开源的。 + +[Chrome][14] 和[ Opera][15] 中的 [HTTPS Everywhere][13] 可用于加密用户通信,使外部网站无法查看用户信息。该项目由 [Tor Project][16]以及[电子前沿基金会][17]合作建成。 + +### 2 月自由月 + +[2 月自由月][18]是一个网络活动,旨在教育内容创作者关于[自由内容][19],并向他们展示如何在自由许可证下作出贡献。 + +** 参加规则:** + +* 你在二月份制作或出版的作品必须获得[自由许可证][1]许可。 +* 内容类型包括博客帖子、其他文字和图像。 + +多媒体,基于文本的内容,艺术和设计等创意作品可以通过多个[知识共享许可证][20](CC)进行许可,其他类型的文档可以根据[ GNU 免费文档许可][21](GFDL)许可。Wikipedia 上可以找到很好的例子,其内容根据 CC 和 GFDL 许可证获得许可,允许人们使用、分享、混合和分发衍生用于商业上和非商业性的作品。此外,还有允许开发人员共享他们的软件和软件相关文档的[自由软件许可证][22]。 + +-------------------------------------------------------------------------------- + +作者简介: + +Subhashish Panigrahi - Subhashish Panigrahi(@shhapa)是 Mozilla 参与团队的亚洲社区催化师,并从 Wikimedia 基金会印度计划的早期扮演了互联网及社会知识获取中心项目官的角色,另外他是一名印度教育者, + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/how-communities-india-support-privacy-software-freedom + +作者:[Subhashish Panigrahi][a] +译者:[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/psubhashish +[1]:https://en.wikipedia.org/wiki/Free_license#Classification_and_licenses +[2]:https://opensource.com/article/17/1/how-communities-india-support-privacy-software-freedom?rate=WhGQOnXdk0m1Yq63nNe0wTVBP-75ALKLlrssFW2lCLk +[3]:https://wiki.mozilla.org/India/task_force/Policy_and_Advocacy/January_Privacy_Month_Campaign +[4]:http://www.freedominfeb.org/ +[5]:http://cis-india.org/ +[6]:https://opensource.com/education/16/8/3-copyright-tips-students-and-educators +[7]:https://reps.mozilla.org/e/privacy-month-campaign/ +[8]:https://en.wikipedia.org/wiki/Data_Privacy_Day +[9]:http://blog.mozillaindia.org/1611 +[10]:https://reps.mozilla.org/u/ankitgadgil +[11]:https://support.mozilla.org/en-US/products/firefox/protect-your-privacy +[12]:https://support.mozilla.org/en-US/kb/advanced-panel-settings-in-firefox +[13]:https://www.eff.org/files/https-everywhere-latest.xpi +[14]:https://chrome.google.com/webstore/detail/gcbommkclmclpchllfjekcdonpmejbdp +[15]:https://addons.opera.com/extensions/details/https-everywhere/ +[16]:https://www.torproject.org/ +[17]:https://eff.org/ +[18]:http://www.freedominfeb.org/ +[19]:https://en.wikipedia.org/wiki/Free_content +[20]:https://creativecommons.org/licenses/ +[21]:https://en.wikipedia.org/wiki/GNU_Free_Documentation_License +[22]:https://www.gnu.org/licenses/license-list.en.html#GPLCompatibleLicenses +[23]:https://opensource.com/user/21177/feed +[24]:https://opensource.com/users/psubhashish From 17875e75114ecb04c3ab194b9ed131728d6b6652 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 29 Mar 2017 09:52:40 +0800 Subject: [PATCH 022/241] remove file --- ...ia support privacy and software freedom.md | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 sources/tech/20170128 How communities in India support privacy and software freedom.md diff --git a/sources/tech/20170128 How communities in India support privacy and software freedom.md b/sources/tech/20170128 How communities in India support privacy and software freedom.md deleted file mode 100644 index 56cb37cb2a..0000000000 --- a/sources/tech/20170128 How communities in India support privacy and software freedom.md +++ /dev/null @@ -1,74 +0,0 @@ -印度社区如何支持隐私和软件自由 -============================================================ - - ![How communities in India support privacy and software freedom](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/people_remote_teams_world.png?itok=wI-GW8zX "How communities in India support privacy and software freedom") -图片提供: opensource.com - -印度的自由和开源社区,特别是 Mozilla 和 Wikimedia 社区,它们正在引领两个独特的全球性活动,以提高隐私及支持自由软件。 - -[1 月份的隐私月][3]是由印度 Mozilla 社区领导,通过在线和线下活动向群众教育网络隐私。而[ 2 月份的自由月][4]是由[互联网与社会中心][5]领导,教育内容创作者如博主和摄影师就如何在[开放许可证][6]下捐赠内容。 - -### 1 月隐私月 - -从[去年开始][7]的 Mozilla “1 月隐私月”用来帮助庆祝年度[数据隐私日][8]。在 2016 年,该活动举办了几场涉及[全球 10 个国家 14,339,443 人][9]的线下和线上活动。其中一个核心组织者,[Ankit Gadgil][10]这样说到:“每天分享一个隐私提示,持续一个月 31 天是有可能的。今年,我们共有三个重点领域,首先是我们让这个运动更加开放和全球化。巴西、意大利、捷克共和国的 Mozilla 社区今年正在积极参与,所有的必要文件都是本地化的,所以我们可以针对更多的用户。其次,我们在线下活动中教导用户营销 Firefox 以及 Mozilla 的其他产品,以便用户可以亲身体验使用这些工具来帮助保护他们的隐私。第三点,我们鼓励大家参加线下活动并记录他们的学习,例如,最近在印度古吉拉特邦的一个节目中,他们使用 Mozilla 产品来教授隐私。” - -今年的活动继续有线下和线上活动。关注 #PrivacyAware 参加。 - -### 安全提示 - -像 Firefox 这样的 Mozilla 产品具有安全性设置-同时还有[内建][11]还有附加的对残疾人完全[可用][12]的库-这有助于保护用户的隐私和安全性,这些都是协同构建的并且是开源的。 - -[Chrome][14] 和[ Opera][15] 中的 [HTTPS Everywhere][13] 可用于加密用户通信,使外部网站无法查看用户信息。该项目由 [Tor Project][16]以及[电子前沿基金会][17]合作建成。 - -### 2 月自由月 - -[2 月自由月][18]是一个网络活动,旨在教育内容创作者关于[自由内容][19],并向他们展示如何在自由许可证下作出贡献。 - -** 参加规则:** - -* 你在二月份制作或出版的作品必须获得[自由许可证][1]许可。 -* 内容类型包括博客帖子、其他文字和图像。 - -多媒体,基于文本的内容,艺术和设计等创意作品可以通过多个[知识共享许可证][20](CC)进行许可,其他类型的文档可以根据[ GNU 免费文档许可][21](GFDL)许可。Wikipedia 上可以找到很好的例子,其内容根据 CC 和 GFDL 许可证获得许可,允许人们使用、分享、混合和分发衍生用于商业上和非商业性的作品。此外,还有允许开发人员共享他们的软件和软件相关文档的[自由软件许可证][22]。 - --------------------------------------------------------------------------------- - -作者简介: - -Subhashish Panigrahi - Subhashish Panigrahi(@shhapa)是 Mozilla 参与团队的亚洲社区催化师,并从 Wikimedia 基金会印度计划的早期扮演了互联网及社会知识获取中心项目官的角色,另外他是一名印度教育者, - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/1/how-communities-india-support-privacy-software-freedom - -作者:[Subhashish Panigrahi][a] -译者:[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/psubhashish -[1]:https://en.wikipedia.org/wiki/Free_license#Classification_and_licenses -[2]:https://opensource.com/article/17/1/how-communities-india-support-privacy-software-freedom?rate=WhGQOnXdk0m1Yq63nNe0wTVBP-75ALKLlrssFW2lCLk -[3]:https://wiki.mozilla.org/India/task_force/Policy_and_Advocacy/January_Privacy_Month_Campaign -[4]:http://www.freedominfeb.org/ -[5]:http://cis-india.org/ -[6]:https://opensource.com/education/16/8/3-copyright-tips-students-and-educators -[7]:https://reps.mozilla.org/e/privacy-month-campaign/ -[8]:https://en.wikipedia.org/wiki/Data_Privacy_Day -[9]:http://blog.mozillaindia.org/1611 -[10]:https://reps.mozilla.org/u/ankitgadgil -[11]:https://support.mozilla.org/en-US/products/firefox/protect-your-privacy -[12]:https://support.mozilla.org/en-US/kb/advanced-panel-settings-in-firefox -[13]:https://www.eff.org/files/https-everywhere-latest.xpi -[14]:https://chrome.google.com/webstore/detail/gcbommkclmclpchllfjekcdonpmejbdp -[15]:https://addons.opera.com/extensions/details/https-everywhere/ -[16]:https://www.torproject.org/ -[17]:https://eff.org/ -[18]:http://www.freedominfeb.org/ -[19]:https://en.wikipedia.org/wiki/Free_content -[20]:https://creativecommons.org/licenses/ -[21]:https://en.wikipedia.org/wiki/GNU_Free_Documentation_License -[22]:https://www.gnu.org/licenses/license-list.en.html#GPLCompatibleLicenses -[23]:https://opensource.com/user/21177/feed -[24]:https://opensource.com/users/psubhashish From 766e1cf037fc31698ea3f253b1d3370a0ba9a3c3 Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Tue, 28 Mar 2017 23:22:10 -0500 Subject: [PATCH 023/241] Update 20161028 Configuring WINE with Winetricks.md --- sources/tech/20161028 Configuring WINE with Winetricks.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sources/tech/20161028 Configuring WINE with Winetricks.md b/sources/tech/20161028 Configuring WINE with Winetricks.md index 6019c1485f..e7e8a64214 100644 --- a/sources/tech/20161028 Configuring WINE with Winetricks.md +++ b/sources/tech/20161028 Configuring WINE with Winetricks.md @@ -1,3 +1,6 @@ +++翻译中 ++ ++ ### Configuring WINE with Winetricks Contents From d6e0b83890b0ad9008fc2fc657e25a7d0f419368 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Mar 2017 16:50:47 +0800 Subject: [PATCH 024/241] =?UTF-8?q?Fatal=EF=BC=8C=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E9=94=99=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk}/20170117 Arch Linux on a Lenovo Yoga 900.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {published => translated/talk}/20170117 Arch Linux on a Lenovo Yoga 900.md (100%) diff --git a/published/20170117 Arch Linux on a Lenovo Yoga 900.md b/translated/talk/20170117 Arch Linux on a Lenovo Yoga 900.md similarity index 100% rename from published/20170117 Arch Linux on a Lenovo Yoga 900.md rename to translated/talk/20170117 Arch Linux on a Lenovo Yoga 900.md From 35803c5e0606a2c7642c287098ed82e3e83ed284 Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Mar 2017 16:51:21 +0800 Subject: [PATCH 025/241] PUB:20170219 Windows wins the desktop, but Linux takes the world.md @Meditator-hkx --- ...0170219 Windows wins the desktop, but Linux takes the world.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20170219 Windows wins the desktop, but Linux takes the world.md (100%) diff --git a/translated/talk/20170219 Windows wins the desktop, but Linux takes the world.md b/published/20170219 Windows wins the desktop, but Linux takes the world.md similarity index 100% rename from translated/talk/20170219 Windows wins the desktop, but Linux takes the world.md rename to published/20170219 Windows wins the desktop, but Linux takes the world.md From 917a6d782aa28b2d34ab5994e7331f04b5c06eed Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Mar 2017 17:04:03 +0800 Subject: [PATCH 026/241] PUB:20170111 Explore climate data with open source tools.md @martin2011qi @jasminepeng --- ...1 Explore climate data with open source tools.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) rename {translated/tech => published}/20170111 Explore climate data with open source tools.md (74%) diff --git a/translated/tech/20170111 Explore climate data with open source tools.md b/published/20170111 Explore climate data with open source tools.md similarity index 74% rename from translated/tech/20170111 Explore climate data with open source tools.md rename to published/20170111 Explore climate data with open source tools.md index 04a6d60e7d..2037dca967 100644 --- a/translated/tech/20170111 Explore climate data with open source tools.md +++ b/published/20170111 Explore climate data with open source tools.md @@ -1,18 +1,19 @@ 使用开源工具探索气候数据的奥秘 -============================================================[up][1] +============================================================ + ![Explore climate data with open source tools](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/bus-cloud.png?itok=bdROR1aE "Explore climate data with open source tools") 图片源自: [Flickr user: theaucitron][2] (CC BY-SA 2.0) -如今你看地球上的任何地方,都可以看到天气变化的证据,每个月,事实和数据都在向我们诠释一点 —— 全球变暖。 +如今你看地球上的任何地方,都可以找到天气变化的证据,每个月,无论是事实还是数据都在向我们诠释一点 —— 全球变暖。 -气候学家如是告诫我们,如今的不作为,对于我们的将来可能是致命的。五角大楼的军事战略家[最近警告][3]当选总统的川普,申明如果不对气候变化有所动作,可能会造成威胁国家安全的灾难。愈趋减少的的水供应和微薄的降雨量会导致作物歉收,这将迫使大量的移民逃往世界各地,到那些可以维持他们生计的地方去。 +气候学家如是告诫我们,如今的不作为,对于我们的将来可能是致命的。五角大楼的军事战略家[最近警告][3]当选总统的川普,向他申明如果不对气候变化有所动作,可能会造成威胁国家安全的灾难。愈趋减少的的水供应和微薄的降雨量会导致作物歉收,这将迫使大量的移民逃往世界各地,到那些可以维持他们生计的地方去。 -遍览 NASA,美国国防部,以及其他机构针对气候的研究成果,我的心中有个疑惑。那就是是否有开源的工具,使对此感兴趣的人们能够自行去探索气候数据的奥秘,并总结出我们自己的结论。我在网上快速的检索了一下,然后找到了[Open Climate Workbench (开源气候工作台)][4],[Apache 软件基金会][5]旗下的一个工程。 +遍览 NASA、美国国防部,以及其他机构针对气候的研究成果,我的心中有个疑惑。那就是是否有开源的工具,使对此感兴趣的人们能够自行去探索气候数据的奥秘,并总结出我们自己的结论。我在网上快速的检索了一下,然后找到了 [Open Climate Workbench (开源气候工作台)][4],这是 [Apache 软件基金会][5]旗下的一个工程。 -Open Climate Workbench (缩写 OCW) 开发软件,对来自 [地球系统网格联盟Earth System Grid Federation][6](缩写 ESGF)、[协调区域气候降尺度实验Coordinated Regional Climate Downscaling Experiment][7](缩写 CORDEX)、美国全球变化研究项目的[国家气候研究 National Climate Assessment][8]、[北美区域气候评估计划North American Regional Climate Assessment Program][9],以及 NASA、NOAA 和其他组织或机构的数据进行气候模型评价。 +Open Climate Workbench (缩写 OCW) 开发该软件,对来自 [地球系统网格联盟Earth System Grid Federation][6](缩写 ESGF)、[协调区域气候降尺度实验Coordinated Regional Climate Downscaling Experiment][7](缩写 CORDEX)、美国全球变化研究项目的[国家气候研究 National Climate Assessment][8]、[北美区域气候评估计划North American Regional Climate Assessment Program][9],以及 NASA、NOAA 和其他组织或机构的数据进行气候模型评价。 -你可下载 OCW 的 [tar ball][10] 并将它安装到满足以下[条件][11]的 Linux 电脑上。也可以使用 Vagrant 或者 VirtualBox 将 OCW 安装到虚拟机中,详见 OCW 的[虚拟机指南][12]。   +你可下载 OCW 的 [tar 包][10] 并将它安装到满足其[条件][11]的 Linux 电脑上。也可以使用 Vagrant 或者 VirtualBox 将 OCW 安装到虚拟机中,详见 OCW 的[虚拟机指南][12]。   个人觉得想要了解 OCW 是如何工作的,最便捷的方式就是到 区域气候模式评价系统Regional Climate Model Evaluation System (缩写 RCMES),下载一个[虚拟机镜像][13]。 From 854ace19e689c0f119f862a2084130272719e03b Mon Sep 17 00:00:00 2001 From: wxy Date: Wed, 29 Mar 2017 17:16:17 +0800 Subject: [PATCH 027/241] PUB:20170325 How to Install a DHCP Server in Ubuntu and Debian.md @geekpi @jasminepeng --- ...tall a DHCP Server in Ubuntu and Debian.md | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) rename {translated/tech => published}/20170325 How to Install a DHCP Server in Ubuntu and Debian.md (77%) diff --git a/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md b/published/20170325 How to Install a DHCP Server in Ubuntu and Debian.md similarity index 77% rename from translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md rename to published/20170325 How to Install a DHCP Server in Ubuntu and Debian.md index 6f3ec54853..6da6514b2b 100644 --- a/translated/tech/20170325 How to Install a DHCP Server in Ubuntu and Debian.md +++ b/published/20170325 How to Install a DHCP Server in Ubuntu and Debian.md @@ -3,7 +3,7 @@ **动态主机配置协议(DHCP)** 是一种用于使主机能够从服务器自动分配 IP 地址和相关的网络配置的网络协议。 -DHCP 服务器分配给 DHCP 客户端的 IP 地址处于“租用”状态,租用时间通常取决于客户端计算机要求连接的时间或 DHCP 配置的时间。 +DHCP 服务器分配给 DHCP 客户端的 IP 地址处于“租用”状态,租用时间通常取决于客户端计算机要求连接的时间或 DHCP 服务器配置的时间。 #### DHCP 如何工作? @@ -14,26 +14,24 @@ DHCP 服务器分配给 DHCP 客户端的 IP 地址处于“租用”状态, * 然后客户端获取到 **DHCPOFFER** 数据包,并向服务器发送一个 **DHCPREQUEST** 包,表示它已准备好接收 **DHCPOFFER** 包中提供的网络配置信息。 * 最后,DHCP 服务器从客户端收到 **DHCPREQUEST** 报文后,发送 **DHCPACK** 报文,表示现在允许客户端使用分配给它的 IP 地址。 -在本文中,我们将介绍如何在 Ubuntu/Debian Linux 中设置 DHCP 服务器,我们将使用[ sudo 命令][1]来运行所有命令,以获得 root 用户权限。 +在本文中,我们将介绍如何在 Ubuntu/Debian Linux 中设置 DHCP 服务器,我们将使用 [sudo 命令][1]来运行所有命令,以获得 root 用户权限。 ### 测试环境设置 在这步中我们会使用如下的测试环境。 -``` -DHCP Server - Ubuntu 16.04 -DHCP Clients - CentOS 7 and Fedora 25 -``` +- DHCP Server - Ubuntu 16.04 +- DHCP Clients - CentOS 7 and Fedora 25 ### 步骤 1:在 Ubuntu 中安装 DHCP 服务器 -1. 运行下面的命令来安装 DHCP 服务器包,也就是 **dhcp3-server**。 +1、 运行下面的命令来安装 DHCP 服务器包,也就是 **dhcp3-server**。 ``` $ sudo apt install isc-dhcp-server ``` -2. 安装完成后,编辑 **/etc/default/isc-dhcp-server** 使用 INTERFACES 选项定义 DHCPD 响应 DHCP 请求所使用的接口。 +2、 安装完成后,编辑 `/etc/default/isc-dhcp-server` 使用 `INTERFACES` 选项定义 DHCPD 响应 DHCP 请求所使用的接口。 比如,如果你想让 DHCPD 守护进程监听 `eth0`,按如下设置: @@ -45,14 +43,14 @@ INTERFACES="eth0" ### 步骤 2:在 Ubuntu 中配置 DHCP 服务器 -3. DHCP 配置的主文件是 `/etc/dhcp/dhcpd.conf`, 你必须填写会发送到客户端的所有网络信息。 +3、 DHCP 配置的主文件是 `/etc/dhcp/dhcpd.conf`, 你必须填写会发送到客户端的所有网络信息。 并且 DHCP 配置中定义了两种不同的声明,它们是: -* **parameters** - 指定如何执行任务、是否执行任务,还有指定要发送给 DHCP 客户端的网络配置选项。 -* **declarations** - 定义网络拓扑、指定客户端、为客户端提供地址,或将一组参数应用于一组声明。 +* `parameters` - 指定如何执行任务、是否执行任务,还有指定要发送给 DHCP 客户端的网络配置选项。 +* `declarations` - 定义网络拓扑、指定客户端、为客户端提供地址,或将一组参数应用于一组声明。 -4. 现在打开并修改主文件,定义 DHCP 服务器选项: +4、 现在打开并修改主文件,定义 DHCP 服务器选项: ``` $ sudo vi /etc/dhcp/dhcpd.conf @@ -68,7 +66,7 @@ max-lease-time 7200; authoritative; ``` -5. 现在定义一个子网,这里我们为 **192.168.10.0/24** 局域网设置 DHCP (请使用适用你情况的参数): +5、 现在定义一个子网,这里我们为 `192.168.10.0/24` 局域网设置 DHCP (请使用适用你情况的参数): ``` subnet 192.168.10.0 netmask 255.255.255.0 { @@ -83,7 +81,7 @@ range 192.168.10.110 192.168.10.200; ### 步骤 3:在 DHCP 客户端上配置静态地址 -6. 要给特定的客户机分配一个固顶的(静态)的 IP,你需要显式将这台机器的 MAC 地址以及静态分配的地址添加到下面这部分。 +6、 要给特定的客户机分配一个固定的(静态)的 IP,你需要显式将这台机器的 MAC 地址以及静态分配的地址添加到下面这部分。 ``` host centos-node { @@ -98,7 +96,7 @@ fixed-address 192.168.10.106; 保存并关闭文件。 -7.接下来,启动 DHCP 服务,并让它下次开机自启动,如下所示: +7、 接下来,启动 DHCP 服务,并让它下次开机自启动,如下所示: ``` ------------ SystemD ------------ @@ -109,7 +107,7 @@ $ sudo service isc-dhcp-server.service start $ sudo service isc-dhcp-server.service enable ``` -8. 接下来不要忘记允许 DHCP 服务(DHCP 守护进程监听 67 UDP 端口)的防火墙权限: +8、 接下来不要忘记允许 DHCP 服务(DHCP 守护进程监听 67 UDP 端口)的防火墙权限: ``` $ sudo ufw allow 67/udp @@ -119,7 +117,7 @@ $ sudo ufw show ### 步骤 4:配置 DHCP 客户端 -9. 此时,你可以将客户端计算机配置为自动从 DHCP 服务器接收 IP 地址。 +9、 此时,你可以将客户端计算机配置为自动从 DHCP 服务器接收 IP 地址。 登录到客户端并编辑以太网接口的配置文件(注意接口名称/号码): @@ -171,7 +169,7 @@ via: http://www.tecmint.com/install-dhcp-server-in-ubuntu-debian/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/aaronkili/ -[1]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ +[1]:https://linux.cn/tag-sudo.html [2]:http://www.tecmint.com/set-add-static-ip-address-in-linux/ [3]:http://www.tecmint.com/wp-content/uploads/2017/03/Set-DHCP-Network-in-Fedora.png [4]:http://www.tecmint.com/author/aaronkili/ From 675a149eaa3fdf402f47310631a242a82901e2bc Mon Sep 17 00:00:00 2001 From: Jinwen Zhang Date: Wed, 29 Mar 2017 21:28:23 +0800 Subject: [PATCH 028/241] wcnnbdk1 translating 20170214 Basics of network protocol analyzer Wireshark On Linux.md --- ...214 Basics of network protocol analyzer Wireshark On Linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20170214 Basics of network protocol analyzer Wireshark On Linux.md b/sources/tech/20170214 Basics of network protocol analyzer Wireshark On Linux.md index 20bdc37675..1cb7ab9528 100644 --- a/sources/tech/20170214 Basics of network protocol analyzer Wireshark On Linux.md +++ b/sources/tech/20170214 Basics of network protocol analyzer Wireshark On Linux.md @@ -1,3 +1,4 @@ +wcnnbdk1 translating ### Basics of network protocol analyzer Wireshark On Linux From 6afb799139022d28095683bb6905c07fe0d462c9 Mon Sep 17 00:00:00 2001 From: cycoe Date: Wed, 29 Mar 2017 23:03:04 +0800 Subject: [PATCH 029/241] translating by cycoe --- ...reasons to use Cinnamon as your Linux desktop environment.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170118 10 reasons to use Cinnamon as your Linux desktop environment.md b/sources/tech/20170118 10 reasons to use Cinnamon as your Linux desktop environment.md index 77847d9b67..501a2e417e 100644 --- a/sources/tech/20170118 10 reasons to use Cinnamon as your Linux desktop environment.md +++ b/sources/tech/20170118 10 reasons to use Cinnamon as your Linux desktop environment.md @@ -1,3 +1,5 @@ +translating by cycoe + 10 reasons to use Cinnamon as your Linux desktop environment ============================================================ From 9d3c488d6dc280872b6c9a5b0b40b798f309f164 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 Mar 2017 08:57:34 +0800 Subject: [PATCH 030/241] translating --- ... A Smart Tool to Convert Website HTML Page to PDF in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md b/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md index f49a66bf10..22da343455 100644 --- a/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md +++ b/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md @@ -1,3 +1,5 @@ +translating---geekpi + Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux ============================================================ From 470eb4615acbfb1c0a10e64a4c78818c64210a38 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 Mar 2017 09:35:12 +0800 Subject: [PATCH 031/241] translated --- ...Convert Website HTML Page to PDF in Linux.md | 214 ------------------ ...Convert Website HTML Page to PDF in Linux.md | 212 +++++++++++++++++ 2 files changed, 212 insertions(+), 214 deletions(-) delete mode 100644 sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md create mode 100644 translated/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md diff --git a/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md b/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md deleted file mode 100644 index 22da343455..0000000000 --- a/sources/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md +++ /dev/null @@ -1,214 +0,0 @@ -translating---geekpi - -Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux -============================================================ - -**Wkhtmltopdf** is an open source simple and much effective command-line shell utility that enables user to convert any given **HTML** (**Web Page**) to **PDF** document or an image (**jpg**, **png**, etc). - -Wkhtmltopdf is written in **C++** programming language and distributed under **GNU/GPL** (**General Public License**). It uses **WebKit** rendering layout engine to convert **HTML** pages to** PDF**document without loosing the quality of the pages. Its is really very useful and trustworthy solution for creating and storing snapshots of web pages in real-time. - -### Wkhtmltopdf Features - -1. Open source and cross platform. -2. Convert any **HTML** web pages to **PDF** files using **WebKit** engine. -3. Options to add headers and footers -4. Table of Content (**TOC**) generation option. -5. Provides batch mode conversions. -6. Support for **PHP** or **Python** via bindings to libwkhtmltox. - -In this article we will show you how to install **Wkhtmltopdf** program under Linux systems using source tarball files. - -### Install Evince (PDF Viewer) - -Let’s install **evince** (a **PDF** reader) program for viewing **PDF** files in Linux systems. - -``` -$ sudo yum install evince [RHEL/CentOS and Fedora] -$ sudo dnf install evince [On Fedora 22+ versions] -$ sudo apt-get install evince [On Debian/Ubuntu systems] -``` - -### Download Wkhtmltopdf Source File - -Download **wkhtmltopdf** source files for your **Linux** architecture using [Wget command][1], or you can also download latest versions (current stable series is **0.12.4**) at [wkhtmltopdf download][2] page. - -##### On 64-bit Linux OS - -``` -$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -``` - -##### On 32-bit Linux OS - -``` -$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-i386.tar.xz -``` - -### Install Wkhtmltopdf in Linux - -Extract the files to a current working directory using following [tar command][3]. - -``` ------- On 64-bit Linux OS ------ -$ sudo tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz ------- On 32-bit Linux OS ------ -$ sudo tar -xvzf wkhtmltox-0.12.4_linux-generic-i386.tar.xz -``` - -Install the **wkhtmltopdf** under **/usr/bin** directory for easy execution of program from any path. - -``` -$ sudo cp wkhtmltox/bin/wkhtmltopdf /usr/bin/ -``` - -### How to Use Wkhtmltopdf? - -Here we will see how to covert remote **HTML** pages to **PDF** files, verify information, view created files using **evince** program from the **GNOME** Desktop. - -#### Convert Website HTML Page to PDF File - -To convert any website **HTML** web page to **PDF**, run the following example command. It will convert the given webpage to [10-Sudo-Configurations.pdf][4] in current working directory. - -``` -# wkhtmltopdf http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf -``` - -##### Sample Output : - -``` -Loading pages (1/6) -Counting pages (2/6) -Resolving links (4/6) -Loading headers and footers (5/6) -Printing pages (6/6) -Done -``` - -#### View Generated PDF File - -To verify that the file is created, use the following command. - -``` -$ file 10-Sudo-Configurations.pdf -``` - -##### Sample Output : - -``` -10-Sudo-Configurations.pdf: PDF document, version 1.4 -``` - -#### View Information of Generated PDF File - -To view the information of generated file, issue the following command. - -``` -$ pdfinfo 10-Sudo-Configurations.pdf -``` - -##### Sample Output : - -``` -Title: 10 Useful Sudoers Configurations for Setting 'sudo' in Linux -Creator: wkhtmltopdf 0.12.4 -Producer: Qt 4.8.7 -CreationDate: Sat Jan 28 13:02:58 2017 -Tagged: no -UserProperties: no -Suspects: no -Form: none -JavaScript: no -Pages: 13 -Encrypted: no -Page size: 595 x 842 pts (A4) -Page rot: 0 -File size: 697827 bytes -Optimized: no -PDF version: 1.4 -``` - -#### View Created PDF File - -Take a look at the newly created **PDF** file using **evince** program from the desktop. - -``` -$ evince 10-Sudo-Configurations.pdf -``` - -##### Sample Screenshot : - -Looks pretty nice under my Linux Mint 17 box. - -[ - ![View Website Page in PDF](http://www.tecmint.com/wp-content/uploads/2012/10/View-Website-Page-in-PDF.png) -][5] - -View Website Page in PDF - -#### Create TOC (Table Of Content) of a Page to PDF - -To create a table of content for a **PDF** file, use the option as **toc**. - -``` -$ wkhtmltopdf toc http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf -``` - -##### Sample Output : - -``` -Loading pages (1/6) -Counting pages (2/6) -Loading TOC (3/6) -Resolving links (4/6) -Loading headers and footers (5/6) -Printing pages (6/6) -Done -``` - -To check the **TOC** for the created file, again use evince program. - -``` -$ evince 10-Sudo-Configurations.pdf -``` - -##### Sample Screenshot : - -Take a look at the picture below. it looks even more better than the above. - -[ - ![Create Website Page to Table of Contents in PDF](http://www.tecmint.com/wp-content/uploads/2012/10/Create-Website-Page-Table-of-Contents-in-PDF.png) -][6] - -Create Website Page to Table of Contents in PDF - -#### Wkhtmltopdf Options and Usage - -For **Wkhtmltopdf** more usage and options, use the following help command. It will display list of all available options that you can use with it. - -``` -$ wkhtmltopdf --help -``` - --------------------------------------------------------------------------------- - -作者简介: - -I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+ - --------------------------------------------------- - -via: http://www.tecmint.com/wkhtmltopdf-convert-website-html-page-to-pdf-linux/ - -作者:[Ravi Saive][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/admin/ -[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/ -[2]:http://wkhtmltopdf.org/downloads.html -[3]:http://www.tecmint.com/18-tar-command-examples-in-linux/ -[4]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ -[5]:http://www.tecmint.com/wp-content/uploads/2012/10/View-Website-Page-in-PDF.png -[6]:http://www.tecmint.com/wp-content/uploads/2012/10/Create-Website-Page-Table-of-Contents-in-PDF.png diff --git a/translated/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md b/translated/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md new file mode 100644 index 0000000000..27e4649aa7 --- /dev/null +++ b/translated/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md @@ -0,0 +1,212 @@ +wkhtmltopdf - 一个 Linux 中将网页转成 PDF 的智能工具 +============================================================ + +**wkhtmltopdf**是一个开源、简单而有效的命令行 shell 程序,它可以将任何 **HTML** (**网页**)转换为 **PDF** 文档或图像(**jpg**、**png** 等)。 + +wkhtmltopdf 是用 **C++** 编写的,并在 **GNU/GPL** (**通用公共许可证**)下发布。它使用 **WebKit** 渲染引擎将 **HTML** 页面转换为 **PDF** 文档且不会丢失页面的质量。这是一个用于实时创建和存储网页快照的非常有用且可信赖的解决方案。 + +### wkhtmltopdf 的功能 + +1. 开源并且跨平台。 +2. 使用 **WebKit** 引擎将任意 **HTML** 网页转换为 **PDF** 文件。 +3. 添加页眉和页脚的选项 +4. 目录生成 (**TOC**) 选项。 +5. 提供批量模式转换。 +6. 通过绑定 libwkhtmltox 来支持 **PHP** 或 **Python**。 + +在本文中,我们将介绍如何在 Linux 系统下使用 tar 包来安装 **wkhtmltopdf**。 + +### 安装 Evince (PDF 浏览器) + +让我们在 Linux 系统中安装 **evince** (一个 **PDF** 阅读器)来浏览 **PDF** 文件。 + +``` +$ sudo yum install evince [RHEL/CentOS and Fedora] +$ sudo dnf install evince [On Fedora 22+ versions] +$ sudo apt-get install evince [On Debian/Ubuntu systems] +``` + +### 下载 wkhtmltopdf 源码文件 + +使用[ wget 命令][1]根据你的 **Linux** 架构来下载 **wkhtmltopdf** 源码文件,或者你也可以在[wkhtmltopdf 下载页][2]下载最新的版本(目前最新的稳定版是 **0.12.4**) + +##### 在 64 位 Linux 系统中 + +``` +$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz +``` + +##### 在 32 位 Linux 系统中 + +``` +$ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-i386.tar.xz +``` + +### 在 Linux 中安装 wkhtmltopdf + +使用[ tar 命令][3]解压文件到当前目录中。 + +``` +------ On 64-bit Linux OS ------ +$ sudo tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz +------ On 32-bit Linux OS ------ +$ sudo tar -xvzf wkhtmltox-0.12.4_linux-generic-i386.tar.xz +``` + +为了能从任意路径执行程序,将 **wkhtmltopdf** 安装到 **/usr/bin** 目录下。 + +``` +$ sudo cp wkhtmltox/bin/wkhtmltopdf /usr/bin/ +``` + +### 如何使用 wkhtmltopdf? + +我们会看到如何将远程的 **HTML** 页面转换成 **PDF** 文件、验证信息、使用 **evince** 在 **GNOME** 桌面中浏览创建的文件。 + +### 将 HTML 网页转成 PDF 文件 + +要将任意 **HTML** 页面转换成 **PDF**,运行下面的命令。它会在当前目录下将页面转换成 [10-Sudo-Configurations.pdf][4]。 + +``` +# wkhtmltopdf http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf +``` + +##### 示例输出: + +``` +Loading pages (1/6) +Counting pages (2/6) +Resolving links (4/6) +Loading headers and footers (5/6) +Printing pages (6/6) +Done +``` + +#### 浏览生成的 PDF 文件 + +为了验证创建的文件,使用下面的命令。 + +``` +$ file 10-Sudo-Configurations.pdf +``` + +##### 示例输出: + +``` +10-Sudo-Configurations.pdf: PDF document, version 1.4 +``` + +#### 浏览生成的 PDF 文件细腻 + +要浏览生成的文件信息,运行下面的命令。 + +``` +$ pdfinfo 10-Sudo-Configurations.pdf +``` + +##### 示例输出 + +``` +Title: 10 Useful Sudoers Configurations for Setting 'sudo' in Linux +Creator: wkhtmltopdf 0.12.4 +Producer: Qt 4.8.7 +CreationDate: Sat Jan 28 13:02:58 2017 +Tagged: no +UserProperties: no +Suspects: no +Form: none +JavaScript: no +Pages: 13 +Encrypted: no +Page size: 595 x 842 pts (A4) +Page rot: 0 +File size: 697827 bytes +Optimized: no +PDF version: 1.4 +``` + +#### 浏览创建的文件 + +在桌面中使用 **evince** 看一眼最新生成的 **PDF** 文件。 + +``` +$ evince 10-Sudo-Configurations.pdf +``` + +##### 示例截图: + +在我的 Linux Mint 17 中看起来很棒。 + +[ + ![View Website Page in PDF](http://www.tecmint.com/wp-content/uploads/2012/10/View-Website-Page-in-PDF.png) +][5] + +在 PDF 中浏览网页 + +### 将页面的 TOC (Table Of Content 即目录)创建为 PDF + +要创建一个 **PDF** 文件的目录,使用 **toc** 选项。 + +``` +$ wkhtmltopdf toc http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf +``` + +##### 示例输出: + +``` +Loading pages (1/6) +Counting pages (2/6) +Loading TOC (3/6) +Resolving links (4/6) +Loading headers and footers (5/6) +Printing pages (6/6) +Done +``` + +要检查已创建文件的 **TOC**,再次使用 evince。 + +``` +$ evince 10-Sudo-Configurations.pdf +``` + +##### 示例截图: + +看一下下面的图。它上看去比上面的更好。 + +[ + ![Create Website Page to Table of Contents in PDF](http://www.tecmint.com/wp-content/uploads/2012/10/Create-Website-Page-Table-of-Contents-in-PDF.png) +][6] + +在 PDF 中创建网页的目录 + +#### wkhtmltopdf 选项及使用 + +更多关于 **wkhtmltopdf** 的使用及选项,使用下面的帮助命令。它会显示出所有可用的选项。 + +``` +$ wkhtmltopdf --help +``` + +-------------------------------------------------------------------------------- + +作者简介: + +我是 Ravi Saive,TecMint 的创建者。一个爱在网上分享的技巧和提示的电脑极客和 Linux 专家。我的大多数服务器运行在名为 Linux 的开源平台上。请在 Twitter、 Facebook 和 Google+ 等上关注我。 + +-------------------------------------------------- + +via: http://www.tecmint.com/wkhtmltopdf-convert-website-html-page-to-pdf-linux/ + +作者:[Ravi Saive][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ +[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/ +[2]:http://wkhtmltopdf.org/downloads.html +[3]:http://www.tecmint.com/18-tar-command-examples-in-linux/ +[4]:http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ +[5]:http://www.tecmint.com/wp-content/uploads/2012/10/View-Website-Page-in-PDF.png +[6]:http://www.tecmint.com/wp-content/uploads/2012/10/Create-Website-Page-Table-of-Contents-in-PDF.png From eb41e7e3db0606f0622ffcbfe6f8eda0ce57b21a Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Thu, 30 Mar 2017 11:07:17 +0800 Subject: [PATCH 032/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对中 --- translated/tech/20170320 Why Go.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20170320 Why Go.md b/translated/tech/20170320 Why Go.md index b890d1b5cb..7c7efb74b7 100644 --- a/translated/tech/20170320 Why Go.md +++ b/translated/tech/20170320 Why Go.md @@ -45,7 +45,7 @@ via: https://dave.cheney.net/2017/03/20/why-go 作者:[Dave Cheney][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 97846d84de426e6b2b7f6f2fda45fece293ff0fb Mon Sep 17 00:00:00 2001 From: "Cathon.ZHD" Date: Thu, 30 Mar 2017 12:45:46 +0800 Subject: [PATCH 033/241] [Translated]20170302 How to use markers and perform text selection in Vim.md --- ...rkers and perform text selection in Vim.md | 128 ------------------ ...rkers and perform text selection in Vim.md | 113 ++++++++++++++++ 2 files changed, 113 insertions(+), 128 deletions(-) delete mode 100644 sources/tech/20170302 How to use markers and perform text selection in Vim.md create mode 100644 translated/tech/20170302 How to use markers and perform text selection in Vim.md diff --git a/sources/tech/20170302 How to use markers and perform text selection in Vim.md b/sources/tech/20170302 How to use markers and perform text selection in Vim.md deleted file mode 100644 index d3f5060e56..0000000000 --- a/sources/tech/20170302 How to use markers and perform text selection in Vim.md +++ /dev/null @@ -1,128 +0,0 @@ -Cathon is translating -How to use markers and perform text selection in Vim -============================================================ - -When using GUI-based text/source code editors, some features are a given, such as selecting text. I mean, most of us won't even consider this a feature anymore. But that's not the case with command line based editors like Vim. Specifically for Vim, when only using keyboard, you'll have to learn certain commands in order to select text the way you want. In this tutorial we will discuss this feature as well as the 'marks' feature of Vim in detail. - -But before we start doing that, it's worth mentioning that all the examples, commands, and instructions mentioned in this tutorial have been tested on Ubuntu 16.04, and the Vim version we've used is 7.4. - -# Text selection options in Vim - -Assuming that you have the basic knowledge about the Vim editor (No? no problem, just head [here][2]), you would be knowing that the 'd' command lets you cut/delete a line. But what if you want to cut, say, 3 lines? Your answer could be: 'repeat the command thrice'. Fine, but what if the requirement is to cut 15 lines? Is running the 'd' command 15 times a practical solution? - -No, it's not. A better solution, in this case, would be to select the lines you want to cut/delete, and then run the 'd' command just once. Here's an example: - -Suppose I want to cut/delete the complete first paragraph of the INTRODUCTION section shown in the screenshot below: - -[ - ![Text edited in VIM](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-example.png) -][3] - -So what I'll do is, I'll bring the cursor in the beginning of the first line, and (making sure I am out of Insert mode) type the 'V' (Shift+v) command. This will result in the first line being selected and Vim enabling the Visual Line mode. - -[ - ![Select a line with VIM](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-initiated.png) -][4] - -Now, all I have to do is to use the down arrow key to select the whole paragraph. - -[ - ![Select multiple lines with Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-working.png) -][5] - -So that's what we wanted, right? Now just press 'd' and the selected paragraph will be cut/deleted. Needless to say, aside from cut/delete, you can perform any other option on the selected text. - -This brings us to another important aspect: not every time we need to delete the complete line or lines; what to do in those cases?  What that means is, the solution we just discussed only works when you want to perform operation on complete line(s). What if the requirement is to delete the first three sentences in a paragraph? - -Well, there's a command for this as well - just use 'v' instead of 'V' (without single quotes of course). Following is an example where-in I used 'v' and then selected the first three sentences in the paragraph: - -[ - ![Select the first three sentences in Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-partial-lines.png) -][6] - -Moving on, sometimes the data you are dealing with consists of separate columns, and the requirement may be to select a particular column. For example, consider the following screenshot: - -[ - ![Columns in Vom](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-columns.png) -][7] - -Suppose the requirement is to only select the name of countries, which mean the second column of the text. So what you can do in this case is, bring your cursor under the first element of the column in question and press Ctrl+v once. Now, using the down arrow key, select the first letter of each country name: - -[ - ![Select the first char of a column](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-column-1.png) -][8] - -And then using the right arrow key, select the complete column, or the whole names. - -[ - ![Select a whole column in Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-column-2.png) -][9] - -**Tip**: In case you de-selected a block of text for some reason, and now want to again select it, just press 'gv' in the command mode. - -# Using marks - -Sometimes, while working on a large file (say, a source code file or a shell script), you might want to switch to particular location and then come back to the line where you were originally. That's not an issue if the lines in question aren't far away, or you have to do this occasionally. - -But what is it's the other way round - you have to frequently jump between your present location and various far off lines in the file. Well, the solution in that case is to use marks. Just mark your current location, then come back to this location from anywhere in the file by just mentioning the name of the mark. - -To mark a line in vim, use the m command followed by an alphabet that represents the name of the mark (available options are a-z in lowercase). For example, ma. Now, to come back to the mark a, use the 'a command (single quote included). - -**Tip**: You can use apostrophe (`'`) or backtick `(`) depending on whether you want to jump to the beginning of the marked line, or specifically to` the line and column of the mark. - -There can be various other useful applications of Vim markers. For example, you can put a mark on a line, then go to some other line and run the following command: - -``` -d'[mark-name] -``` - - to delete everything between your current position and the marked line. - -Moving on, here's an important tid-bid from the Vim's official documentation: - -``` -Each file has a set of marks identified by lowercase letters (a-z). In addition there is a global set of marks identified by uppercase letters (A-Z) that identify a position within a particular file. For example, you may be editing ten files. Each file could have mark a, but only one file can have mark A.  -``` - -So while we have discussed the basic usage of lowercase alphabets as Vim marks, how and where the uppercase letters are useful. Well, the following excerpt makes it amply clear: - -``` -Because of their limitations, uppercase marks may at first glance seem less versatile than their lowercase counterpart, but this feature allows them to be used as a quick sort of "file bookmark." For example, open your .vimrc, press mV, and close Vim. The next time you want to edit your .vimrc, just press 'V to open it. -``` - -And finally, to delete a mark, use the 'delmarks' command. For example: - -``` -:delmarks a -``` - -The aforementioned command will delete the mark a from the file. Of course, if you delete a line containing a mark, then that mark is also deleted automatically. For more information on marks, head to the [Vim documentation][11]. - -# Conclusion - -As you start using Vim as your primary editor, features like the ones explained in this tutorial become useful tools that save a lot of your time. As you'd agree, there's not much of a learning curve involved with selection and marks features explained here - all that's required is a bit of practice. - -For the complete coverage of Vim-related articles on HowtoForge, head [here][1]. - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/how-to-use-markers-and-perform-text-selection-in-vim/ - -作者:[Himanshu Arora][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.howtoforge.com/tutorial/how-to-use-markers-and-perform-text-selection-in-vim/ -[1]:https://www.howtoforge.com/tutorials/shell/ -[2]:https://www.howtoforge.com/vim-basics -[3]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-example.png -[4]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-initiated.png -[5]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-working.png -[6]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-partial-lines.png -[7]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-columns.png -[8]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-column-1.png -[9]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-column-2.png -[10]:http://vim.wikia.com/wiki/Vimrc -[11]:http://vim.wikia.com/wiki/Using_marks diff --git a/translated/tech/20170302 How to use markers and perform text selection in Vim.md b/translated/tech/20170302 How to use markers and perform text selection in Vim.md new file mode 100644 index 0000000000..5825725e7b --- /dev/null +++ b/translated/tech/20170302 How to use markers and perform text selection in Vim.md @@ -0,0 +1,113 @@ +如何在 Vim 中使用标志和文本选择操作 +============================================================ + +基于图形界面的文本或源代码编辑器,提供了一些诸如文本选择的功能。我是想说,可能大多数人不觉得这是一个功能。不过像 Vim 这种基于命令行的编辑器就不是这样。当你仅使用键盘操作 Vim 的时候,就需要学习特定的命令来选择你想要的文本。在这个教程中,我们将详细讨论文本选择这一功能以及 Vim 中的标志功能。 + +在此之前需要说明的是,本教程中所提到的例子、命令和指令都是在 Ubuntu 16.04 的环境下测试的。Vim 的版本是 7.4。 + +# Vim 的文本选择功能 + +我们假设你已经具备了 Vim 编辑器的基本知识(如果没有,可以先阅读[这篇文章][2])。你应该知道,'d' 命令能够剪切/删除一行内容。如果你想要剪切 3 行的话,可以重复命令 3 次。不过,如果需要剪切 15 行呢?重复 ‘d’ 命令 15 次是个实用的解决方法吗? + +显然不是。这种情况下的最佳方法是,选中你想要剪切/删除的行,再运行 ‘d’ 命令。举个例子: + +假如我想要剪切/删除下面截图中 INTRODUCTION 小节的第一段: + +[![Text edited in VIM](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-example.png)][3] + +那么我的做法是:将光标放在第一行的开始,(确保退出了 Insert 模式)按下 'V'(Shift+v)命令。这时 Vim 会开启视图模式,并选中第一行。 + +[![Select a line with VIM](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-initiated.png)][4] + +现在,我可以使用方向键'下',来选中整个段落。 + +[![Select multiple lines with Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-working.png)][5] + +这就是我们想要的,对吧!现在只需按 'd'键,就可以剪切/删除选中的段落了。当然,除了剪切/删除,你可以对选中的文本做任何操作。 + +这给我们带来了另一个重要的问题:当我们不需要删除整行的时候,该怎么做呢?也就是说,我们刚才讨论的解决方法,仅适用于想要对整行做操作的情况。那么如果我们只想删除段落的前三句话呢? + +其实也有相应的命令 - 只需用 'v' 来代替 'V'(不包括单引号)即可。在下面的例子中,我使用 'v' 来选中段落的前三句话: + +[![Select the first three sentences in Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-partial-lines.png)][6] + +有时候,你需要处理的数据由单独的列组成,你的需求可能是选择特定的一列。考虑下面的截图: + +[![Columns in Vom](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-columns.png)][7] + +假设我们只需选择文本的第二列,即国家的名字。这种情况下,你可以将光标放在这一列的第一个字母上,按 Ctrl+v 一次。然后,按方向键'下',选中每个国家名字的第一个字母: + +[![Select the first char of a column](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-column-1.png)][8] + +然后按方向键'右',选中这一列。 + +[![Select a whole column in Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-column-2.png)][9] + +**小窍门**:如果你之前选中了某个文本块,现在想重新选中那个文本块,只需在命令模式下按 'gv' 即可。 + +# 使用标志 + +有时候,你在处理一个很大的文件(例如源代码文件或者一个 shell 脚本),可能想要切换到一个特定的位置,然后再回到刚才所在的行。如果这两行的位置不远,或者你并不常做这类操作,那么这不是什么问题。 + +但是,如果你需要频繁地在当前位置和一些较远的行之间切换,那么最好的方法就是使用标志。你只需标记当前的位置,然后就能够通过标志名,从文件的任意位置回到当前的位置。 + +在 Vim 中,我们使用 m 命令紧跟一个字母来标记一行(字母表示标志名,可用小写的 a-z)。例如 ma。然后你可以使用命令 'a (包括左单引号)回到标志为 a 的行。 + +**小窍门**:你可以使用单引号来跳转到标志行的第一个字符,或使用反引号来跳转到标志行的特定列。 + +Vim 的标志功能还有很多其他的用法。例如,你可以先标记一行,然后将光标移到其他行,运行下面的命令: + +``` +d'[标志名] +``` + +来删除当前位置和标志行之间的所有内容。 + +在 Vim 官方文档中,有一个重要的内容: + +``` +每个文件有一些由小写字母(a-z)定义的标志。此外,还存在一些由大写字母(A-Z)定义的全局标志,它们定义了一个特定文件的某个位置。例如,你可能在同时编辑十个文件,每个文件都可以有标志 a,但是只有一个文件能够有标志 A。 +``` + +我们已经讨论了使用小写字母作为 Vim 标志的基本用法,以及它们的便捷之处。下面的这段摘录讲解的足够清晰: + +``` +由于种种局限性,大写字母标志可能乍一看不如小写字母标志好用,但它可以用作一种快速的文件书签。例如,打开 .vimrc 文件,按下 mV,然后退出。下次再想要编辑 .vimrc 文件的时候,按下 'V 就能够打开它。 +``` + +最后,我们使用 'delmarks' 命令来删除标志。例如: + +``` +:delmarks a +``` + +这一命令将从文件中删除一个标志。当然,你也可以删除标志行,这样标志将被自动删除。你可以在 [Vim 文档][11] 中找到关于标志的更多信息。 + +# 总结 + +当你开始使用 Vim 作为首选编辑器的时候,类似于这篇教程中提到的功能将会是非常有用的工具,能够节省大量的时间。你得承认,这里介绍的文本选择和标志功能几乎不怎么需要学习,所需要的只是一点练习。 + +你可以在 [HowtoForge][1] 上找到更多有关 Vim 的文章。 + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/how-to-use-markers-and-perform-text-selection-in-vim/ + +作者:[Himanshu Arora][a] +译者:[Cathon](https://github.com/Cathon) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/how-to-use-markers-and-perform-text-selection-in-vim/ +[1]:https://www.howtoforge.com/tutorials/shell/ +[2]:https://www.howtoforge.com/vim-basics +[3]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-example.png +[4]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-initiated.png +[5]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-working.png +[6]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-partial-lines.png +[7]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-columns.png +[8]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-column-1.png +[9]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-column-2.png +[10]:http://vim.wikia.com/wiki/Vimrc +[11]:http://vim.wikia.com/wiki/Using_marks From 54a66ac5488b4c0dd9d919656553cebd16ab7361 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Thu, 30 Mar 2017 14:56:08 +0800 Subject: [PATCH 034/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 谢谢 --- translated/tech/20170320 Why Go.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20170320 Why Go.md b/translated/tech/20170320 Why Go.md index 7c7efb74b7..a03bf8503f 100644 --- a/translated/tech/20170320 Why Go.md +++ b/translated/tech/20170320 Why Go.md @@ -5,34 +5,34 @@ # 安全 -个人而言,你和我或许完全有能力在 C 中编写程序,既不会泄漏内存,也不会不安全地重复使用内存。然而,即使对有超过[ 40 年][5]的经验的人而言,用 C 的程序员也无法可靠地这样做。 +个人而言,你和我或许完全有能力在 C 中编写程序,既不会泄漏内存,也不会不安全地重复使用内存。然而,整体上,即使有超过[ 40 年][5]的经验,用 C 的程序员也无法可靠地这样做。 -尽管静态代码分析、valgrind、tsan 以及 “-Werror” 已经存在了几十年,很少有证据表明这些工具被广泛认可,更不用说广泛采用。总而言之,程序员已经表明他们根本无法自己安全地管理内存。现在是离开 C 的时候了。 +尽管静态代码分析、valgrind、tsan 以及 “-Werror” 已经存在了几十年,很少有证据表明这些工具被广泛认可,更不用说广泛采用。总而言之,事实表明,程序员根本无法安全地管理自己的内存。现在是离开 C 的时候了。 -Go 不依赖于程序员直接管理内存,所有内存分配都由语言运行时管理,使用前初始化,必要时检查边界。它肯定不是提供这些安全保障的第一个主流语言,Java(1995)可能是该冠军的竞争者。关键是,世界对不安全的编程语言没有胃口,所以默认情况下,Go 是内存安全的。 +Go 不依赖于程序员直接管理内存,所有内存分配都由语言运行时管理,使用前初始化,必要时检查边界。它肯定不是提供这些安全保障的第一个主流语言,Java(1995)可能是该冠军的竞争者。关键是,世界对不安全的编程语言没有胃口,所以人们默认认为,Go 是内存安全的。 # 开发人员生产力 -在 20 世纪 70 年代末,开发人员时间变得比硬件时间更昂贵这个问题被忽略了。开发人员的生产力是一个广泛的话题,但它归结为这一点:你花了多少时间做有用的工作还是等待编译器或者失望地迷失在外部代码库中。 +从 20 世纪 70 年代末,开发人员时间变得比硬件时间更昂贵了。开发人员的生产力是一个不断扩展的话题,但它归结为这一点:你花了多少时间做有用的工作,又有多少时间等待编译器或者失望地迷失在外部代码库中。 有个笑话说 Go 是在等待[ C ++ 程序编译][6]时开发的。快速编译是 Go 的一个重要功能,也是吸引新开发人员的关键工具。虽然编译速度仍然是一个[永久的战场][7],但公平地说,在其他语言中需要几分钟的编译,在 Go 中只需要几秒钟。 -Go 程序员意识到生产力更根本的问题是代码是为了_读而写的_,所以将[代码的阅读行为放在编写之上][8]。Go 通过工具和自定义强制所有代码通过格式化成特定的样式。这消除了学习项目特定语言子方言时的困难,并帮助发现错误,因为它们_看上去_不正确。 +Go 程序员意识到生产力更根本的问题是代码是为了_读而写的_,所以将[代码的阅读行为放在编写之上][8]。Go 通过工具和自定义强制所有代码格式化成特定的样式。这消除了学习项目特定语言子方言时的困难,并有助于发现错误,因为它们_看上去_就是不正确。 -由于专注于分析和机器辅助,Go 开发人员开始采用越来越多的工具来发现常见的编码错误,这种工具从来没有在 C 语言中产生共鸣 - Go 开发人员_希望_工具帮助他们保留代码清洁。 +由于专注于分析和机器辅助,Go 开发人员开始采用越来越多的工具来发现常见的编码错误,这种工具从来没有在 C 语言开发者中产生共鸣 - Go 开发人员_希望_工具帮助他们保持代码清洁。 -# 并发 +# 并发性 -十多年来,芯片设计师一直在警告[免费午餐将会结束][9]。从最低端的手机到最耗电的服务器,硬件的并行性以[更多、更慢、堆 cpu 内核][10]的形式出现,只有_如果_你的语言可以利用它们才能实现。因此,并发需要在我们编写的软件中内置到今天的硬件上运行。 +十多年来,芯片设计师一直在警告[免费午餐将会结束][9]。从最低端的手机到最耗电的服务器,硬件的并行性以[更多、更慢、堆 cpu 内核][10]的形式出现,只有_当_你的语言可以利用它们才能实现。因此,并发需要内置到我们编写的要在今天的硬件上运行的软件中。 通过提供一种基于协程的[轻量级并发模型][11],或者是 Go 中已知的 goroutines,Go 超越了那些暴露操作系统的多进程或多线程并行模型的语言。goroutines 允许程序员避开复杂的回调,而语言运行时确保有足够的线程来保持你的内核的活跃。 # 总结 -我给朋友推荐 Go 有三个原因:安全性、生产率和并发性。单独地,有些语言可以涵盖一个也有可能是两个方面,但是这三个方面的结合使得 Go 成为主流程序员的绝佳选择。 +我给朋友推荐 Go 有三个原因:安全性、生产力和并发性。有些语言可以涵盖一个也有可能是两个方面,但是这三个方面的结合使得 Go 成为主流程序员的绝佳选择。 -###相关文章: +## 相关文章: 1. [为什么 Go 和 Rust 不是竞争对手][1] 2. [听听我在 OSCON 上谈 Go 语言性能][2] From e20a246d048f3b4e99b500300dda018d28dcc87c Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Thu, 30 Mar 2017 15:00:06 +0800 Subject: [PATCH 035/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对中 --- .../tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md b/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md index bc0a6eef84..4d380c9819 100644 --- a/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md +++ b/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md @@ -292,7 +292,7 @@ via: http://www.tecmint.com/install-drupal-in-centos-rhel-fedora/ 译者:[imxieke](https://github.com/imxieke) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f7386af065b514d14e20eb1970315b28538825fe Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 30 Mar 2017 15:41:28 +0800 Subject: [PATCH 036/241] PRF:20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md @GHLandy --- ...rdPress with HHVM and Nginx on CentOS 7.md | 114 ++++++++---------- 1 file changed, 50 insertions(+), 64 deletions(-) diff --git a/translated/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md b/translated/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md index 039aba6a10..7b4158ad95 100644 --- a/translated/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md +++ b/translated/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md @@ -1,30 +1,18 @@ 如何在 CentOS 7 中通过 HHVM 和 Nginx 安装 WordPress ======================== -### 导航 +HHVM (HipHop Virtual Machine) 是一个用于执行以 PHP 和 Hack 语言编写的代码的虚拟环境。它是由 Facebook 开发的,提供了当前 PHP 7 的大多数功能。要在你的服务器上运行 HHVM,你需要使用 FastCGI 来将 HHVM 和 Nginx 或 Apache 衔接起来,或者你也可以使用 HHVM 中的内置 Web 服务器 Proxygen。 -1. [步骤 1 - 配置 SELinux 并添加v EPEL 仓库][1] -2. [步骤 2 - 安装 Nginx][2] -3. [步骤 3 - 安装并配置 MariaDB][3] -4. [步骤 4 - 安装 HHVM][4] -5. [步骤 5 - 配置 HHVM][5] -6. [步骤 6 - 配置 HHVM 和 Nginx][6] -7. [步骤 7 - 通过 HHVM 和 Nginx 创建虚拟主机][7] -8. [步骤 8 - 安装 WordPress][8] -9. [参考链接][9] - -HHVM (HipHop Virtual Machine) is an open source virtual machine for executing programs written in PHP and Hack language. HHVM has been developed by Facebook, it provides most features of the current PHP 7 version. To run HHVM on your server, you can use a FastCGI to connect HHVM with a Nginx or Apache web server, or you can use the web server built into HHVM called "Proxygen". - -In this tutorial, I will show you how to install WordPress with HHVM and Nginx as web server. I will use CentOS 7 as the operating system, so basic knowledge of CentOS is required. +在这篇教程中,我将展示给你如何在 Nginx Web 服务器的 HHVM 上安装 WordPress。这里我使用 CentOS 7 作为操作系统,所以你需要懂一点 CentOS 操作的基础。 **先决条件** * CentOS 7 - 64位 -* Root 特权 +* Root 权限 -### 步骤 1 - 配置 SELinux 并添加v EPEL 仓库 +### 步骤 1 - 配置 SELinux 并添加 EPEL 仓库 -在本教程中,我们将以强制模式来运行 SELinux,所以我们需要在系统上安装一个 SELinux 管理工具。这里我们使用 setools 和 setrobleshoot 来管理 SELinux 的各项配置。 +在本教程中,我们将使用 SELinux 的强制模式,所以我们需要在系统上安装一个 SELinux 管理工具。这里我们使用 `setools` 和 `setrobleshoot` 来管理 SELinux 的各项配置。 CentOS 7 已经默认启用 SELinux,我们可以通过以下命令来确认: @@ -37,13 +25,13 @@ CentOS 7 已经默认启用 SELinux,我们可以通过以下命令来确认: 如图,你能够看到,SELinux 已经开启了强制模式。 -接下来就是使用 yum 来安装 setools 和 setroubleshoot 了。 +接下来就是使用 `yum` 来安装 `setools` 和 `setroubleshoot` 了。 ``` # yum -y install setroubleshoot setools net-tools ``` -安装好这两个后,在安装 EPEL 仓库。 +安装好这两个后,再安装 EPEL 仓库。 ``` # yum -y install epel-release @@ -51,22 +39,22 @@ CentOS 7 已经默认启用 SELinux,我们可以通过以下命令来确认: ### 步骤 2 - 安装 Nginx -Nginx (发音:engine-x) 是一个高性能、低消耗的轻量级 Web 服务器软件。在 CentOS 中可以使用 yum 命令来安装 Nginx 包。记住用 root 用登录系统哦。 +Nginx (发音:engine-x) 是一个高性能、低内存消耗的轻量级 Web 服务器软件。在 CentOS 中可以使用 `yum` 命令来安装 Nginx 包。确保你以 root 用户登录系统。 -使用 yum 命令从 CentOS 仓库中安装 nginx。 +使用 `yum` 命令从 CentOS 仓库中安装 nginx。 ``` # yum -y install nginx ``` -现在可以使用 systemctl 命令来启动 Nginx,同时将其设置为跟随系统启动。 +现在可以使用 `systemctl` 命令来启动 Nginx,同时将其设置为跟随系统启动。 ``` # systemctl start nginx # systemctl enable nginx ``` -为确保 Nginx 已经正确运行于服务器中,在浏览上输入服务器的 IP,或者如下使用 curl 命令检查显示结果。 +为确保 Nginx 已经正确运行于服务器中,在浏览器上输入服务器的 IP,或者如下使用 `curl` 命令检查显示结果。 ``` # curl 192.168.1.110 @@ -78,7 +66,7 @@ Nginx (发音:engine-x) 是一个高性能、低消耗的轻量级 Web 服务 ### 步骤 3 - 安装并配置 MariaDB -MariaDB 是由原 MySQL 开发者 Monty Widenius 开发的一款开源数据库软件,它由 MySQL 分支而来,但与 MySQL 的主要用法保持一致。在这一步中,我们要安装 MariaDB 数据库并为之配置好 root 密码,然后在为 WordPress 安装的需要创建一个新的数据库和用户。 +MariaDB 是由原 MySQL 开发者 Monty Widenius 开发的一款开源数据库软件,它由 MySQL 分支而来,与 MySQL 的主要功能保持一致。在这一步中,我们要安装 MariaDB 数据库并为之配置好 root 密码,然后再为所要安装的 WordPress 创建一个新的数据库和用户。 安装 mariadb 和 mariadb-server: @@ -115,7 +103,7 @@ Reload privilege tables now? [Y/n] Y  ... Success! ``` -这样就设置好了 MariaDB 的 root 密码。现在登录到 MariaDB/MySQL shell 并为 WordPress 的安装创建一个新数据库 **"wordpressdb"** 和新用户 **"wpuser"**,密码设置为 **"wpuser@"**。在你的安装设置中要选用一个安全的密码。 +这样就设置好了 MariaDB 的 root 密码。现在登录到 MariaDB/MySQL shell 并为 WordPress 的安装创建一个新数据库 `wordpressdb` 和新用户 `wpuser`,密码设置为 `wpuser@`。为你的设置选用一个安全的密码。 登录到 MariaDB/MySQL shell: @@ -141,9 +129,9 @@ MariaDB [(none)]> \q ### 步骤 4 - 安装 HHVM -对于 HHVM,我们需要安装大量的依赖。作为选择,你可以从 GitHub 下载 HHVM 的源码来编译安装,也可以从网络上获取预编译的包进行安装。在本教程中,我使用的是预编译的安装包。 +对于 HHVM,我们需要安装大量的依赖项。作为选择,你可以从 GitHub 下载 HHVM 的源码来编译安装,也可以从网络上获取预编译的包进行安装。在本教程中,我使用的是预编译的安装包。 -为 HHVM 安装依赖。 +为 HHVM 安装依赖项: ``` # yum -y install cpp gcc-c++ cmake git psmisc {binutils,boost,jemalloc,numactl}-devel \ @@ -154,7 +142,7 @@ MariaDB [(none)]> \q > mariadb mariadb-server libc-client make ``` -然后是使用 rpm 安装从 [HHVM 预编译包镜像站点][13] 下载的 HHVM 预编译包。 +然后是使用 `rpm` 安装从 [HHVM 预编译包镜像站点][13] 下载的 HHVM 预编译包。 ``` # rpm -Uvh http://mirrors.linuxeye.com/hhvm-repo/7/x86_64/hhvm-3.15.2-1.el7.centos.x86_64.rpm @@ -167,7 +155,7 @@ MariaDB [(none)]> \q # hhvm --version ``` -为了能使用 PHP 命令,可以把 hhvm 命令设置为 php。这样在 shell 中输入 'php' 命令的时候,你会看到和输入 hhvm 命令一样的结果。 +为了能使用 PHP 命令,可以把 `hhvm` 命令设置为 `php`。这样在 shell 中输入 `php` 命令的时候,你会看到和输入 `hhvm` 命令一样的结果。 ``` # sudo update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60 @@ -178,9 +166,9 @@ MariaDB [(none)]> \q ### 步骤 5 - 配置 HHVM -这一步中,我们来配置 HHVM 以系统服务器来运行。我们不通过端口这种常规的方式来运行它,而是选择使用 unix socket 文件的方式,这样运行的更快速一点。 +这一步中,我们来配置 HHVM 以系统服务来运行。我们不通过端口这种常规的方式来运行它,而是选择使用 unix socket 文件的方式,这样运行的更快速一点。 -进入 systemd 配置目录,并创建一个 hhvm.service 文件。 +进入 systemd 配置目录,并创建一个 `hhvm.service` 文件。 ``` # cd /etc/systemd/system/ @@ -203,14 +191,14 @@ WantedBy=multi-user.target 保存文件退出 vim。 -接下来,进入 hhvm 目录并编辑 server.ini 文件。 +接下来,进入 `hhvm` 目录并编辑 `server.ini` 文件。 ``` # cd /etc/hhvm/ # vim server.ini ``` -将第 7 行 hhvm.server.port 替换为 unix socket,如下: +将第 7 行 `hhvm.server.port` 替换为 unix socket,如下: ``` hhvm.server.file_socket = /var/run/hhvm/hhvm.sock @@ -218,7 +206,7 @@ hhvm.server.file_socket = /var/run/hhvm/hhvm.sock 保存文件并退出编辑器。 -我们已在 hhvm 服务文件中定义了 hhvm 以 'nginx' 用户身份运行,所以还需要把 socket 文件目录的属主变更为 'nginx'。然后我们还必须在 SELinux 中修改 hhvm 目录内容以便让它可以访问这个 socket 文件。 +我们已在 hhvm 服务文件中定义了 hhvm 以 `nginx` 用户身份运行,所以还需要把 socket 文件目录的属主变更为 `nginx`。然后我们还必须在 SELinux 中修改 hhvm 目录的权限上下文以便让它可以访问这个 socket 文件。 ``` # chown -R nginx:nginx /var/run/hhvm/ @@ -228,7 +216,7 @@ hhvm.server.file_socket = /var/run/hhvm/hhvm.sock 服务器重启之后,hhvm 将不能运行,因为没有存储 socket 文件的目录,所有还必须在启动的时候自动创建一个。 -使用 vim 编辑 rc.local 文件。 +使用 vim 编辑 `rc.local` 文件。 ``` # vim /etc/rc.local @@ -257,7 +245,7 @@ hhvm.server.file_socket = /var/run/hhvm/hhvm.sock # systemctl enable hhvm ``` -要确保无误,使用 netstat 命令验证 hhvm 运行于 socket 文件。 +要确保无误,使用 `netstat` 命令验证 hhvm 运行于 socket 文件。 ``` # netstat -pl | grep hhvm @@ -267,16 +255,16 @@ hhvm.server.file_socket = /var/run/hhvm/hhvm.sock ### 步骤 6 - 配置 HHVM 和 Nginx -在这个步骤中,我们配置好 HHVM 已让它运行在 Nginx Web 服务中,这需要在 Nginx 目录创建一个 hhvm 的配置文件。 +在这个步骤中,我们将配置 HHVM 已让它运行在 Nginx Web 服务中,这需要在 Nginx 目录创建一个 hhvm 的配置文件。 -进入 /etc/nginx 目录,创建 a hhvm.conf 文件。 +进入 `/etc/nginx` 目录,创建 `hhvm.conf` 文件。 ``` # cd /etc/nginx/ # vim hhvm.conf ``` -粘贴一下内容到文件中。 +粘贴以下内容到文件中。 ``` location ~ \.(hh|php)$ { @@ -291,13 +279,13 @@ location ~ \.(hh|php)$ { 然后,保存并退出。 -接下来,编辑 nginx.conf 文件,添加 hhvm 配置文件到 include 行。 +接下来,编辑 `nginx.conf` 文件,添加 hhvm 配置文件到 `include` 行。 ``` # vim nginx.conf ``` -添加配置到第 57 行的 server 指令中。 +添加配置到第 57 行的 `server` 指令中。 ``` include /etc/nginx/hhvm.conf; @@ -305,7 +293,7 @@ include /etc/nginx/hhvm.conf; 保存并退出。 -然后修改 SELinux 中关于 hhvm 配置文件的内容。 +然后修改 SELinux 中关于 hhvm 配置文件的权限上下文。 ``` # semanage fcontext -a -t httpd_config_t /etc/nginx/hhvm.conf @@ -319,19 +307,19 @@ include /etc/nginx/hhvm.conf; # systemctl restart nginx ``` -记住确保没有错误。 +记住确保测试配置没有错误。 ### 步骤 7 - 通过 HHVM 和 Nginx 创建虚拟主机 -在这一步中能,我们要为 Nginx 和 hhvm 创建一个新的虚拟主机配置文件。这里我使用域名 **"natsume.co"** 来作为例子.你可以使用你主机喜欢的域名,并在配置文件中相应位置以及 WordPress 安装过程中进行替换。 +在这一步中,我们要为 Nginx 和 hhvm 创建一个新的虚拟主机配置文件。这里我使用域名 `natsume.co` 来作为例子,你可以使用你主机喜欢的域名,并在配置文件中相应位置以及 WordPress 安装过程中进行替换。 -进入 nginx conf.d 目录,我们将在该目录存储虚拟主机文件。 +进入 nginx 的 `conf.d` 目录,我们将在该目录存储虚拟主机文件。 ``` # cd /etc/nginx/conf.d/ ``` -使用 vim 创建一个名为 "natsume.conf" 的配置文件。 +使用 vim 创建一个名为 `natsume.conf` 的配置文件。 ``` # vim natsume.conf @@ -367,15 +355,14 @@ server { 保存并退出。 -在这给虚拟主机配置文件中,我们定义该域名的 Web 根目录为 "/var/www/hakase"。目前该目录还不存在,所有我们要创建它,并变更属主为 nginx 用户和组。 +在这个虚拟主机配置文件中,我们定义该域名的 Web 根目录为 `/var/www/hakase`。目前该目录还不存在,所有我们要创建它,并变更属主为 nginx 用户和组。 ``` # mkdir -p /var/www/hakase # chown -R nginx:nginx /var/www/hakase ``` - -Next, configure the SELinux context for the file and directory. +接下来,为该文件和目录配置 SELinux 上下文。 ``` # semanage fcontext -a -t httpd_config_t "/etc/nginx/conf.d(/.*)?" @@ -393,28 +380,28 @@ Next, configure the SELinux context for the file and directory. 在步骤 5 的时候,我们已经为 WordPress 配置好了虚拟主机,现在只需要下载 WordPress 和使用我们在步骤 3 的时候创建的数据库和用户来编辑数据库配置就好了。 -进入 Web 根目录 "/var/www/hakase" 并使用 Wget 命令下载 WordPress: +进入 Web 根目录 `/var/www/hakase` 并使用 Wget 命令下载 WordPress: ``` # cd /var/www/hakase # wget wordpress.org/latest.tar.gz ``` -解压 "latest.tar.gz" 并将 wordpress 文件夹中所有的文件和目录移动到当前目录: +解压 `latest.tar.gz` 并将 `wordpress` 文件夹中所有的文件和目录移动到当前目录: ``` # tar -xzvf latest.tar.gz # mv wordpress/* . ``` -下一步,复制一份 "wp-config-sample.php" 并更名为 "wp-config.php",然后使用 vim 进行编辑: +下一步,复制一份 `wp-config-sample.php` 并更名为 `wp-config.php`,然后使用 vim 进行编辑: ``` # cp wp-config-sample.php wp-config.php # vim wp-config.php ``` -将 DB_NAME 设置为 **"wordpressdb"**、DB_USER 设置为 **"wpuser"** 以及 DB_PASSWORD 设置为 **"wpuser@"**。 +将 `DB_NAME` 设置为 `wordpressdb`、`DB_USER` 设置为 `wpuser` 以及 `DB_PASSWORD` 设置为 `wpuser@`。 ``` define('DB_NAME', 'wordpressdb'); @@ -427,28 +414,28 @@ define('DB_HOST', 'localhost'); [![WordPress 配置](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/6.png)][16] -修改关于 WordPress 目录的 SELinux 配置指令。 +修改关于 WordPress 目录的 SELinux 上下文。 ``` # semanage fcontext -a -t httpd_sys_content_t "/var/www/hakase(/.*)?" # restorecon -Rv /var/www/hakase ``` -现在打开 Web 浏览器,在地址栏输入你之前为 WordPress 设置的域名,我这里是 "natsume.co"。 +现在打开 Web 浏览器,在地址栏输入你之前为 WordPress 设置的域名,我这里是 `natsume.co`。 -选择英语并点击 '继续 (Continue)'。 +选择语言并点击继续Continue。 [![安装 Wordpress - 语言选择](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/7.png)][17] -根据自身要求填写站点标题和描述并点击 "安装 Wordpress (Install Wordpress)"。 +根据自身要求填写站点标题和描述并点击安装 WordpressInstall Wordpress"。 [![安装 Wordpress - 配置管理员账号和站点标题](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/8.png)][18] -耐心等待安装完成。你会见到如下页面,点击 "登录 (Log In)" 来登录到管理面板。 +耐心等待安装完成。你会见到如下页面,点击登录Log In来登录到管理面板。 [![安装 Wordpress - 成功安装](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/9.png)][19] -输入你设置的管理员用户账号和密码,在此点击 "登录 (Log In)"。 +输入你设置的管理员用户账号和密码,在此点击登录Log In。 [![登录到 wordpress 管理面板](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/10.png)][20] @@ -456,7 +443,7 @@ define('DB_HOST', 'localhost'); [![Wordpress 管理面](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/11.png)][21] -Wordpress 主页。 +Wordpress 的主页: [![Wordpress 默认主页](https://www.howtoforge.com/images/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/12.png)][22] @@ -464,8 +451,7 @@ Wordpress 主页。 ### 参考链接 -- [https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-opensuse-leap-42-1/](https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-opensuse-leap-42-1/) -- [https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/](https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/) +- https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/ ------------------------------------ @@ -477,9 +463,9 @@ Wordpress 主页。 via: https://www.howtoforge.com/tutorial/how-to-install-wordpress-with-hhvm-and-nginx-on-centos-7/ -作者:[ Muhammad Arul][a] +作者:[Muhammad Arul][a] 译者:[GHLandy](https://github.com/GHLandy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 34225f233f69dbd3c5024d974de83c1b86bb77a5 Mon Sep 17 00:00:00 2001 From: wxy Date: Thu, 30 Mar 2017 15:41:47 +0800 Subject: [PATCH 037/241] PUB:20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md @GHLandy --- ...17 How to Install WordPress with HHVM and Nginx on CentOS 7.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md (100%) diff --git a/translated/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md b/published/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md similarity index 100% rename from translated/tech/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md rename to published/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md From 0504f446fc3d5fb1d2889d9b00fb4d1aeee253d4 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Thu, 30 Mar 2017 16:51:32 +0800 Subject: [PATCH 038/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95=20?= =?UTF-8?q?@imxieke?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 谢谢 --- ...Install Drupal 8 in RHEL CentOS Fedora.md | 164 +++++++++--------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md b/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md index 4d380c9819..91a9a21256 100644 --- a/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md +++ b/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md @@ -1,32 +1,31 @@ -在 RHEL CentOS & Fedora 安装 Drupal 8 +在 RHEL,CentOS 及 Fedora 上安装 Drupal 8 ============================================================ -Drupal 是一个 开源,灵活,高度可拓展和安全的内容管理系统(CMS),使用户轻松的创建一个网站。 -它可以使用模块拓展使用户转换内容管理为强大的数字解决方案 +**Drupal** 是一个开源,灵活,高度可拓展和安全的内容管理系统Content Management System(CMS),使用户轻松的创建网站。 +它可以使用模块拓展,使用户将内容管理转换为强大的数字解决方案。 +**Drupal** 运行在诸如 **Apache,IIS,Lighttpd,Cherokee,Nginx** 的 Web 服务器上,后端数据库可以使用 **Mysql,MongoDB,MariaDB,PostgreSQL,MSSQL Server**。 -Drupal 运行在 Web 服务器上, 像 Apache, IIS, Lighttpd, Cherokee, Nginx, -后端数据库可以使用 Mysql, MongoDB, MariaDB, PostgreSQL, MSSQL Server - -在这个文章, 我们会展示在 RHEL 7/6 CentOS 7/6 和Fedora 20-25 发行版本使用 LAMP 步骤 如何执行手动安装和配置 Drupal 8 +在这篇文章中, 我们会展示在 RHEL 7/6,CentOS 7/6 和 Fedora 20-25 发行版本使用 LAMP,如何手动安装和配置 Drupal 8。 #### Drupal 需求: -1. Apache 2.x(推荐) -2. PHP 5.5.9 或 更高 (推荐PHP 5.5) -3. MYSQL 5.5.3 或 MariaDB 5.5.20 与 PHP 数据对象(PDO) +1. **Apache 2.x** (推荐) +2. **PHP 5.5.9** 或 更高 (推荐 PHP 5.5) +3. **MYSQL 5.5.3** 或 **MariaDB 5.5.20** 与 PHP 数据对象(PDO) -这个步骤,我是使用 `drupal.tecmint.com` 作为网站主机名 和 IP 地址 `192.168.0.104`. -这些设置也许在你的环境不同,因此请适当做出更改 +安装过程中,我使用 `drupal.tecmint.com` 作为网站主机名,IP 地址为 `192.168.0.104`。你的环境也许与这些设置不同,因此请适当做出更改。 -### 第一步: 安装 Apache Web 服务器 -1. 首先我们从官方仓库开始安装 Apache Web 服务器 +### 步骤 1: 安装 Apache Web 服务器 + +1. 首先我们从官方仓库开始安装 Apache Web 服务器。 ``` # yum install httpd ``` -2. 安装完成后,服务将会被被禁用,因此我们需要手动启动它,同时让它从下次系统启动时自动启动像这样: +2. 安装完成后,服务将会被被禁用,因此我们需要手动启动它,同时让它下次系统启动时自动启动,如下: + ``` ------------- 通过 SystemD - CentOS/RHEL 7 和 Fedora 22+ ------------------- # systemctl start httpd @@ -37,7 +36,7 @@ Drupal 运行在 Web 服务器上, 像 Apache, IIS, Lighttpd, Cherokee, Nginx # chkconfig --level 35 httpd on ``` -3. 接下来,为了通过 HTTP 和 HTTPS 访问 Apache 服务,我们必须打开 HTTPD 守护进程正在监听的80和443端口,如下所示: +3. 接下来,为了允许通过 **HTTP** 和 **HTTPS** 访问 Apache 服务,我们必须打开 **HTTPD** 守护进程正在监听的 **80** 和 **443** 端口,如下所示: ``` ------------ 通过 Firewalld - CentOS/RHEL 7 and Fedora 22+ ------------- @@ -52,22 +51,24 @@ Drupal 运行在 Web 服务器上, 像 Apache, IIS, Lighttpd, Cherokee, Nginx # service iptables restart ``` -4. 现在验证 Apache 是否正常工作, 打开浏览器在 URL:http://server_IP` 输入你的服务器 IP 地址使用 HTTP 协议 ` , 默认 Apache 页面外观应该如下面截图所示: +4. 现在验证 Apache 是否正常工作, 打开浏览器在地址栏中输入 http://server_IP, 输入你的服务器 IP 地址, 默认 Apache2 页面应出现,如下面截图所示: [ ![Apache 默认页面](https://dn-coding-net-production-pp.qbox.me/a93436ad-59ee-404d-9a28-ebde4446cd6d.png) ][1] -Apache 默认页面 +*Apache 默认页面* -### 第二部: 安装 Apache PHP 支持 +### 步骤 2: 安装 Apache PHP 支持 -5. 接下来 安装 PHP 和 PHP 所需模块. +5. 接下来,安装 PHP 和 PHP 所需模块. ``` # yum install php php-mbstring php-gd php-xml php-pear php-fpm php-mysql php-pdo php-opcache ``` ->重要: 假如你想要安装 PHP7., 你需要增加以下仓库:EPEL 和 Webtactic 才可以使用 yum 安装 PHP7.0: + +**重要**: 假如你想要安装 **PHP7**, 你需要增加以下仓库:**EPEL** 和 **Webtactic** 才可以使用 yum 安装 PHP7.0: + ``` ------------- Install PHP 7 in CentOS/RHEL and Fedora ------------- # rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm @@ -75,29 +76,32 @@ Apache 默认页面 # yum install php70w php70w-opcache php70w-mbstring php70w-gd php70w-xml php70w-pear php70w-fpm php70w-mysql php70w-pdo ``` -6. 接下来 从浏览器得到关于 PHP 安装和配置完整信息,使用下面命令在 Apache 根文档创建一个 `info.php` 文件 +6. 接下来,要从浏览器得到关于 PHP 安装和配置完整信息,使用下面命令在 Apache 文档根目录 (/var/www/html) 创建一个 `info.php` 文件。 ``` # echo "" > /var/www/html/info.php ``` -然后重启 HTTPD 服务器 ,在浏览器输入 URL `http://server_IP/info.php` +然后重启 HTTPD 服务器 ,在浏览器地址栏输入 `http://server_IP/info.php`。 + ``` # systemctl restart httpd -OR +或 # service httpd restart ``` + [ ![验证 PHP 信息](https://dn-coding-net-production-pp.qbox.me/7dcdb202-ba2e-4b1c-b304-215c5721db03.png) ][2] -验证 PHP 信息 +*验证 PHP 信息* ### 步骤 3: 安装和配置 MariaDB 数据库 -7. 对于你的信息, Red Hat Enterprise Linux/CentOS 7.0 从支持 MYSQL 转移到 MariaDB 作为默认数据库管理系统支持 +7. 请了解, **Red Hat Enterprise Linux/CentOS 7.0** 从支持 **MYSQL** 转为了 **MariaDB** 作为默认数据库管理系统。 + +要安装 **MariaDB** 数据库, 你需要添加 [官方 MariaDB 库][3] 到 `/etc/yum.repos.d/MariaDB.repo` 中,如下所示。 -安装 MariaDB 你需要添加以下内容,[official MariaDB repository][3] 到 `/etc/yum.repos.d/MariaDB.repo` 如下所示 ``` [mariadb] name = MariaDB @@ -106,13 +110,14 @@ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 ``` -当仓库文件就位你可以像这样安装 MariaDB : +当仓库文件准备好后,你可以像这样安装 MariaDB : ``` # yum install mariadb-server mariadb ``` -8. 当 MariaDB 数据库安装完成,同时启动数据库的守护进程使它能够在下次启动后自动启动 +8. 当 MariaDB 数据库安装完成,启动数据库的守护进程,同时使它能够在下次启动后自动启动。 + ``` ------------- 通过 SystemD - CentOS/RHEL 7 and Fedora 22+ ------------- # systemctl start mariadb @@ -122,7 +127,7 @@ gpgcheck=1 # chkconfig --level 35 mysqld on ``` -9. 然后运行 `mysql_secure_installation` 脚本去保护数据库(设置 root 密码, 禁用远程登录,移除测试数据库,和移除匿名用户),如下所示: +9. 然后运行 `mysql_secure_installation` 脚本去保护数据库(设置 root 密码, 禁用远程登录,移除测试数据库并移除匿名用户),如下所示: ``` # mysql_secure_installation @@ -131,25 +136,25 @@ gpgcheck=1 ![Mysql安全安装](https://dn-coding-net-production-pp.qbox.me/15a20560-ea9f-499b-b155-a310e9aa6a88.png) ][4] -Mysql 安全安装 +*Mysql 安全安装* -### 第四步: 在 CentOS 安装和配置 Drupal 8 +### 步骤 4: 在 CentOS 中安装和配置 Drupal 8 -10. 这里我们使用 [wget 命令][6] [下载最新版本 Drupal][5](i.e 8.2.6),如果你没有安装 wget 和 gzil 包 ,请使用下面命令安装它们: +10. 这里我们使用 [wget 命令][6] [下载最新版本 Drupal][5](例如 8.2.6),如果你没有安装 wget 和 gzip 包 ,请使用下面命令安装它们: ``` # yum install wget gzip # wget -c https://ftp.drupal.org/files/projects/drupal-8.2.6.tar.gz ``` -11. 之后,[导出压缩文件][7] 和移动 Drupal 目录到 Apache 根目录(`/var/www/html`). +11. 之后,[解压 tar 文件][7] 并移动 Drupal 目录到 Apache 文档根目录(`/var/www/html`). ``` # tar -zxvf drupal-8.2.6.tar.gz # mv drupal-8.2.6 /var/www/html/drupal ``` -12. 然后从示例设置文件(`/var/www/html/drupal/sites/default`) 目录创建设置文件 `settings.php` , 然后给 Drupal 站点目录设置适当权限,包括子目录和文件,如下所示: +12. 然后,依据 `/var/www/html/drupal/sites/default` 目录下的示例设置文件 default.settings.php,创建设置文件 `settings.php`,然后给 Drupal 站点目录设置适当权限,包括子目录和文件,如下所示: ``` # cd /var/www/html/drupal/sites/default/ @@ -157,141 +162,136 @@ Mysql 安全安装 # chown -R apache:apache /var/www/html/drupal/ ``` -13. 更重要的是在 `/var/www/html/drupal/sites/` 目录设置 SElinux 规则,如下: +13. 更重要的是在 `/var/www/html/drupal/sites/` 目录设置 **SElinux** 规则,如下: ``` # chcon -R -t httpd_sys_content_rw_t /var/www/html/drupal/sites/ ``` -``` -14. 现在我们必须为 Drupal 站点去创建一个数据库和用户来管理 +14. 现在我们必须为 Drupal 站点去创建一个数据库和用户来管理。 + -``` # mysql -u root -p -输入数据库密码: -``` +Enter password: MySQL Shell -``` Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 12 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. -MySQL [(none)]> create database drupal; +**MySQL [(none)]> create database drupal;** Query OK, 1 row affected (0.00 sec) -MySQL [(none)]> create user ravi@localhost identified by 'tecmint123'; +**MySQL [(none)]> create user ravi@localhost identified by 'tecmint123';** Query OK, 0 rows affected (0.00 sec) -MySQL [(none)]> grant all on drupal.* to ravi@localhost; +**MySQL [(none)]> grant all on drupal.* to ravi@localhost;** Query OK, 0 rows affected (0.00 sec) -MySQL [(none)]> flush privileges; +**MySQL [(none)]> flush privileges;** Query OK, 0 rows affected (0.00 sec) -MySQL [(none)]> exit +**MySQL [(none)]> exit** Bye -``` -15. 最后,在这一点,打开URL: `http://server_IP/drupal/` 开始网站的安装,选择你首选的安装语言然后点击保存以继续 +15. 最后,打开地址: `http://server_IP/drupal/` 开始网站的安装,选择你首选的安装语言然后点击保存以继续。 + [ !Drupal 安装语言](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Installation-Language.png) ][8] -Drupal 安装语言 +*Drupal 安装语言* - -16. 下一步,选择安装配置文件,选择 Standard(标准) 点击保存继续 +16. 下一步,选择安装配置文件,选择 Standard(标准),点击保存继续。 [ ![Drupal 安装配置文件](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Installation-Profile.png) ][9] -Drupal 安装配置文件 +*Drupal 安装配置文件* -17. 在进行下一步之前查看并通过需求审查并启用 `Clean URL` +17. 在进行下一步之前查看并通过需求审查并启用 `Clean URL`。 [ ![验证 Drupal 需求](http://www.tecmint.com/wp-content/uploads/2013/07/Verify-Drupal-Requirements.png) ][10] -验证 Drupal 需求 +*验证 Drupal 需求* + +现在在你的 Apache 配置下启用 Clean URL Drupal。 -现在在你的 Apache 配置下启用 `Clean URL` Drupal ``` # vi /etc/httpd/conf/httpd.conf ``` -确保设置 `AllowOverride All` 为默认根文档目录如下图所示 +确保为默认根文档目录 **/var/www/html** 设置 **AllowOverride All**,如下图所示: [ ![在 Drupal 中启用 Clean URL](http://www.tecmint.com/wp-content/uploads/2013/07/Enable-Clean-URL-in-Drupal.png) ][11] -在 Drupal 中启用 Clean URL +*在 Drupal 中启用 Clean URL* -18. 当你为 Drupal 启用 `Clean URL` ,刷新页面从下面界面执行数据库配置,输入 Drupal 站点数据库名,数据库用户和数据库密码. +18. 当你为 Drupal 启用 `Clean URL`,刷新页面从下面界面执行数据库配置,输入 Drupal 站点数据库名,数据库用户和数据库密码。 -当填写完所有信息点击保存继续 +当填写完所有信息点击**保存并继续**。 [ ![Drupal 数据库配置](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Database-Configuration.png) ][12] -Drupal 数据库配置 +*Drupal 数据库配置* -若上述设置正确,Drupal 站点安装应该完成了如下图界面. +若上述设置正确,Drupal 站点安装应该完成了,如下图界面. [ ![Drupal 安装](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Installation.png) ][13] -Drupal 安装 +*Drupal 安装* -19. 接下来配置站点为下面设置值(使用适用你的方案的值): +19. 接下来配置站点为下面的设置(使用适用你的情况的值): - 1. 站点名称  – TecMint Drupal Site - 2. 站点邮箱地址  – admin@tecmint.com - 3. 用户名  – admin - 4. 密码  – ########## - 5. 用户的邮箱地址  – admin@tecmint.com - 6. 默认国家  – India - 7. 默认时区  – UTC + 1. **站点名称**  – TecMint Drupal Site + 2. **站点邮箱地址**  – admin@tecmint.com + 3. **用户名**  – admin + 4. ** 密码**  – ########## + 5. **用户的邮箱地址**  – admin@tecmint.com + 6. **默认国家**  – India + 7. **默认时区**  – UTC -这是适当的值后,点击保存继续去完成站点安装过程! +设置适当的值后,点击**保存并继续**完成站点安装过程。 [ ![Drupal 站点配置](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Site-Configuration.png) ][14] -Drupal 站点配置 +*Drupal 站点配置* -20. 下图是显示的是通过 LAMP 成功安装 Drupal 8 站点 +20. 下图显示的是通过 LAMP 成功安装的 Drupal 8 站点。 [ ![Drupal站点面板](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Site-Dashboard.png) ][15] -Drupal 站点面板 +*Drupal 站点面板* -现在你可以点击增加内容如创建示例网页内容作为一个页面 +现在你可以点击**增加内容**,创建示例网页内容。 -选项: 有些人使用[MYSQL 命令行管理数据库][16]不舒服,可以从浏览器界面 [安装 PHPMYAdmin 管理数据库][17] +选项: 有些人[使用 MYSQL 命令行管理数据库][16]不舒服,可以从浏览器界面 [安装 PHPMYAdmin 管理数据库][17] 浏览 Drupal 文档 : [https://www.drupal.org/docs/8][18] -就这样! 在这个文章, 我们展示了在 CentOS 7 上如何去下载,安装和 LAMP 向导以及基本的配置 Drupal 8。 从下面反馈给我们回信就这个教程,或提供给我们一些相关信息 +就这样! 在这个文章, 我们展示了在 CentOS 7 上如何去下载、安装和使用基本配置来设置 LAMP 以及 Drupal 8。 欢迎就这个教程提供反馈,或提供给我们一些相关信息。 + -------------------------------------------------------------------------------- 作者简介: -Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge. +Aaron Kili 是 linux 和 F.O.S.S 爱好者,将成为 Linux 系统管理员,Web 开发者,目前是 TecMint 的原创作者,热爱计算机工作,并且坚信知识共享。 -Aaron Kili 是 linux 和 F.O.S.S(Free and Open Source Software ) 爱好者,即将推出的 Linux SysAdmin, Web 开发者, 目前是TecMint的内容创作者,热爱计算机工作,并且坚信知识共享。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/install-drupal-in-centos-rhel-fedora/ 作者:[Aaron Kili][a] - 译者:[imxieke](https://github.com/imxieke) - 校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 214509785f9a0f14a99c7b1a8c6c47f49f02bdfc Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Thu, 30 Mar 2017 16:59:10 +0800 Subject: [PATCH 039/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 再修改下格式 --- ...Install Drupal 8 in RHEL CentOS Fedora.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md b/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md index 91a9a21256..a747fad043 100644 --- a/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md +++ b/translated/tech/20170218 Install Drupal 8 in RHEL CentOS Fedora.md @@ -170,7 +170,7 @@ gpgcheck=1 14. 现在我们必须为 Drupal 站点去创建一个数据库和用户来管理。 - +``` # mysql -u root -p Enter password: MySQL Shell @@ -189,11 +189,12 @@ Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) **MySQL [(none)]> exit** Bye +``` 15. 最后,打开地址: `http://server_IP/drupal/` 开始网站的安装,选择你首选的安装语言然后点击保存以继续。 [ - !Drupal 安装语言](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Installation-Language.png) + ![Drupal 安装语言](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Installation-Language.png) ][8] *Drupal 安装语言* @@ -238,7 +239,7 @@ Bye *Drupal 数据库配置* -若上述设置正确,Drupal 站点安装应该完成了,如下图界面. +若上述设置正确,Drupal 站点安装应该完成了,如下图界面。 [ ![Drupal 安装](http://www.tecmint.com/wp-content/uploads/2013/07/Drupal-Installation.png) @@ -248,13 +249,13 @@ Bye 19. 接下来配置站点为下面的设置(使用适用你的情况的值): - 1. **站点名称**  – TecMint Drupal Site - 2. **站点邮箱地址**  – admin@tecmint.com - 3. **用户名**  – admin - 4. ** 密码**  – ########## - 5. **用户的邮箱地址**  – admin@tecmint.com - 6. **默认国家**  – India - 7. **默认时区**  – UTC + - **站点名称**  – TecMint Drupal Site + - **站点邮箱地址**  – admin@tecmint.com + - **用户名**  – admin + - **密码**  – ########## + - **用户的邮箱地址**  – admin@tecmint.com + - **默认国家**  – India + - **默认时区**  – UTC 设置适当的值后,点击**保存并继续**完成站点安装过程。 From 107dd63f27f922ac20cc17fe33b48bd4074e861d Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Thu, 30 Mar 2017 19:23:30 +0800 Subject: [PATCH 040/241] [Translating] 20170324 A formal spec for GitHub Flavored Markdown.md --- .../tech/20170324 A formal spec for GitHub Flavored Markdown.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170324 A formal spec for GitHub Flavored Markdown.md b/sources/tech/20170324 A formal spec for GitHub Flavored Markdown.md index 7b1eb04f59..90e3e950ad 100644 --- a/sources/tech/20170324 A formal spec for GitHub Flavored Markdown.md +++ b/sources/tech/20170324 A formal spec for GitHub Flavored Markdown.md @@ -1,3 +1,5 @@ +GHLandy Translating + [A formal spec for GitHub Flavored Markdown][8] ============================================================ From 0169b7044656afe5f2d2ca9e0b6d7bf9a9d0e1f6 Mon Sep 17 00:00:00 2001 From: fuowang <1106694860@qq.com> Date: Thu, 30 Mar 2017 22:53:19 +0800 Subject: [PATCH 041/241] =?UTF-8?q?fuowang=20=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to change GRUB background in Kali Linux.md | 257 ------------------ ...to change GRUB background in Kali Linux.md | 254 +++++++++++++++++ 2 files changed, 254 insertions(+), 257 deletions(-) delete mode 100644 sources/tech/20151127 5 ways to change GRUB background in Kali Linux.md create mode 100644 translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md diff --git a/sources/tech/20151127 5 ways to change GRUB background in Kali Linux.md b/sources/tech/20151127 5 ways to change GRUB background in Kali Linux.md deleted file mode 100644 index ff1cb85d8d..0000000000 --- a/sources/tech/20151127 5 ways to change GRUB background in Kali Linux.md +++ /dev/null @@ -1,257 +0,0 @@ -fuowang 翻译中 - -5 ways to change GRUB background in Kali Linux -============================================================ - - -This is a simple guide on how to change GRUB background in Kali Linux (i.e. it’s actually Kali Linux GRUB splash image). Kali dev team did few things that seems almost too much work, so in this article I will explain one of two things about GRUB and somewhat make this post little unnecessarily long and boring cause I like to write! So here goes … - -[ - ![Change GRUB background in Kali Linux - blackMORE OPs -10](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-10.jpg) -][10] - -### Finding GRUB settings - -This is usually the first issue everyone faces, where do I look? There’s a many ways to find GRUB settings. Users might have their own opinion but I always found that `update-grub` is the easiest way. If you run `update-grub` in a VMWare/VirtualBox, you will see something like this: - -``` -root@kali:~# update-grub -Generating grub configuration file ... -Found background image: /usr/share/images/desktop-base/desktop-grub.png -Found linux image: /boot/vmlinuz-4.0.0-kali1-amd64 -Found initrd image: /boot/initrd.img-4.0.0-kali1-amd64 - No volume groups found -done -root@kali:~# -``` - -If you’re using a Dual Boot, Triple Boot then you will see GRUB goes in and finds other OS’es as well. However, the part we’re interested is the background image part, in my case this is what I see (you will see exactly the same thing): - -``` -Found background image: /usr/share/images/desktop-base/desktop-grub.png -``` - -### GRUB splash image search order - -In grub-2.02, it will search for the splash image in the following order for a Debian based system: - -1. GRUB_BACKGROUND line in `/etc/default/grub` -2. First image found in `/boot/grub/` ( more images found, it will be taken alphanumerically ) -3. The image specified in `/usr/share/desktop-base/grub_background.sh` -4. The file listed in the WALLPAPER line in `/etc/grub.d/05_debian_theme` - -Now hang onto this info and we will soon revisit it. - -### Kali Linux GRUB splash image - -As I use Kali Linux (cause I like do stuff), we found that Kali is using a background  image from here: `/usr/share/images/desktop-base/desktop-grub.png` - -Just to be sure, let’s check that `.png` file and it’s properties. - -``` -root@kali:~# -root@kali:~# ls -l /usr/share/images/desktop-base/desktop-grub.png -lrwxrwxrwx 1 root root 30 Oct 8 00:31 /usr/share/images/desktop-base/desktop-grub.png -> /etc/alternatives/desktop-grub -root@kali:~# -``` - -[ - ![Change GRUB background in Kali Linux - blackMORE OPs -1](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-1.jpg) -][11] - -What? It’s just a symbolic link to `/etc/alternatives/desktop-grub` file? But `/etc/alternatives/desktop-grub` is not an image file. Looks like I need to check that file and it’s properties as well. - -``` -root@kali:~# -root@kali:~# ls -l /etc/alternatives/desktop-grub -lrwxrwxrwx 1 root root 44 Oct 8 00:27 /etc/alternatives/desktop-grub -> /usr/share/images/desktop-base/kali-grub.png -root@kali:~# -``` - -[ - ![Change GRUB background in Kali Linux - blackMORE OPs -3](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-3.jpg) -][12] - -Alright, that’s confusing as! So `/etc/alternatives/desktop-grub` is another symbolic link which points back to -`/usr/share/images/desktop-base/kali-grub.png` -which is in the same folder we started from. doh! That’s all I can say. But at least now we can just replace that file and get it over with. - -Before we do that we need to check the properties of this file `/usr/share/images/desktop-base/kali-grub.png` and ensure that we will download same type and dimension file. - -``` -root@kali:~# -root@kali:~# file /usr/share/images/desktop-base/kali-grub.png -/usr/share/images/desktop-base/kali-grub.png: PNG image data, 640 x 480, 8-bit/color RGB, non-interlaced -root@kali:~# -``` - -So this file is DEFINITELY a PNG image data, 640 x 480 dimension. - -### GRUB background image properties - -GRUB 2 can use `PNG`, `JPG`/`JPEG` and `TGA` images for the background. The image must meet the following specifications: - -* `JPG`/`JPEG` images must be `8-bit` (`256 color`) -* Images should be non-indexed, `RGB` - -By default, if `desktop-base` package is installed, images conforming to the above specification will be located in `/usr/share/images/desktop-base/` directory. A quick Google search found similar files. Out of those, I picked one. - -``` -root@kali:~# -root@kali:~# file Downloads/wallpaper-1.png -Downloads/wallpaper-1.png: PNG image data, 640 x 480, 8-bit/color RGB, non-interlaced -root@kali:~# -``` - -[ - ![Change GRUB background in Kali Linux - blackMORE OPs -6](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-6.jpg) -][13] - -### Option 1: replace the image - -Now we simply need to replace this `/usr/share/images/desktop-base/kali-grub.png` file with our new file. Note that this is the easiest way without mucking around `grub-config` files. If you are familiar with GRUB, then go ahead and simpy modify GRUB default config and run `update-grub`. - -As usual, I will make a backup of the original file by renaming it to `kali-grub.png.bkp` - -``` -root@kali:~# -root@kali:~# mv /usr/share/images/desktop-base/kali-grub.png /usr/share/images/desktop-base/kali-grub.png.bkp -root@kali:~# -``` - -[ - ![Change GRUB background in Kali Linux - blackMORE OPs -4](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-4.jpg) -][14] - -Now let’s copy our downloaded file and rename that to `kali-grub.png.bkp`. - -``` -root@kali:~# -root@kali:~# cp Downloads/wallpaper-1.png /usr/share/images/desktop-base/kali-grub.png -root@kali:~# -``` - -[ - ![Change GRUB background in Kali Linux - blackMORE OPs -5](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-5.jpg) -][15] - -And finally run `update-grub` - -``` -root@kali:~# update-grub -Generating grub configuration file ... -Found background image: /usr/share/images/desktop-base/desktop-grub.png -Found linux image: /boot/vmlinuz-4.0.0-kali1-amd64 -Found initrd image: /boot/initrd.img-4.0.0-kali1-amd64 - No volume groups found -done -root@kali:~# -``` - -[ - ![Change GRUB background in Kali Linux - blackMORE OPs -7](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-7.jpg) -][16] - -Next time you restart your Kali Linux, you will see your own image as the GRUB background. (GRUB splash image). - -Following is what my new GRUB splash image looks like in Kali Linux now. What about you? Tried this method yet? - -[ - ![Change GRUB background in Kali Linux - blackMORE OPs -9](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-9.jpg) -][17] - -This was the easiest and safest way, if you muck it up the worst, you will see a Blue background in GRUB but will still be able to login and fix things later. Now if you’re confident, lets move to better ways (bit complex) of changing GRUB settings. Next steps are more fun and works with any Linux using GRUB bootloader. - -Now remember those 4 places GRUB looks for a background splash image? Here are those again: - -1. GRUB_BACKGROUND line in `/etc/default/grub` -2. First image found in `/boot/grub/` ( more images found, it will be taken alphanumerically ) -3. The image specified in `/usr/share/desktop-base/grub_background.sh` -4. The file listed in the `WALLPAPER` line in `/etc/grub.d/05_debian_theme` - -So lets again try few of these options in Kali Linux (or any Linux using GRUB2). - -### Option 2: Define an image path in GRUB_BACKGROUND - -So you can use any of the above in the order of priority to make GRUB display your own images. The following is the content of `/etc/default/grub` file on my system. - -``` -root@kali:~# vi /etc/default/grub -``` - -Add a line similar to this: GRUB_BACKGROUND=”/root/World-Map.jpg” where World-Map.jpg is the image file you want to use as GRUB background. - -``` -# If you change this file, run 'update-grub' afterwards to update -# /boot/grub/grub.cfg. -# For full documentation of the options in this file, see: -#   info -f grub -n 'Simple configuration' - -GRUB_DEFAULT=0 -GRUB_TIMEOUT=15 -GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="quiet" -GRUB_CMDLINE_LINUX="initrd=/install/gtk/initrd.gz" -GRUB_BACKGROUND="/root/World-Map.jpg" -``` - -Once changes has been done using any of the above methods, make sure you execute `update-grub` command as shown below. - -``` -root@kali:~# update-grub -Generating grub configuration file ... -Found background: /root/World-Map.jpg -Found background image: /root/World-Map.jpg -Found linux image: /boot/vmlinuz-4.0.0-kali1-amd64 -Found initrd image: /boot/initrd.img-4.0.0-kali1-amd64 -  No volume groups found -done -root@kali:~# -``` - -Now, when you boot your machine, you will see the customized image in GRUB. - -### Option 3: Put an image on /boot/grub/ folder - -If nothing is specified in `GRUB_BACKGROUND` in `/etc/default/grub` file, GRUB ideally should pick first image found in `/boot/grub/` folder and use that a its background. If GRUB finds more than one image in /boot/grub/ folder, it will use the first alphanumerically image name. - -### Option 4: Specify an image path in grub_background.sh - -If nothing is specified in `GRUB_BACKGROUND` in `/etc/default/grub` file or there is no image in `/boot/grub/` folder, GRUB will start looking into `/usr/share/desktop-base/grub_background.sh` file and search for the image path specified. For Kali Linux, it was defined in here. Every Linux distro has it’s own take on it. - -### Option 5: Define an image in WALLPAPER line in /etc/grub.d/05_debian_theme file - -This would be that last part GRUB looking for a Background image. It will search here if everything else failed. - -### Conclusion - -This post was long, but I wanted to cover a few important basic things. If you’ve followed it carefully, you will understand how to follow symbolic links back and forth in Kali Linux. You will get a VERY good idea on exactly which places you need to search to find GRUB Background image in any Linux. Just read a bit more to understand how the colors in GRUB works and you’re all set. - --------------------------------------------------------------------------------- - -via: https://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/ - -作者:[https://www.blackmoreops.com/][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/ -[1]:http://www.facebook.com/sharer.php?u=https://www.blackmoreops.com/?p=5958 -[2]:https://twitter.com/intent/tweet?text=5+ways+to+change+GRUB+background+in+Kali+Linux%20via%20%40blackmoreops&url=https://www.blackmoreops.com/?p=5958 -[3]:https://plusone.google.com/_/+1/confirm?hl=en&url=https://www.blackmoreops.com/?p=5958&name=5+ways+to+change+GRUB+background+in+Kali+Linux -[4]:https://www.blackmoreops.com/how-to/ -[5]:https://www.blackmoreops.com/kali-linux/ -[6]:https://www.blackmoreops.com/kali-linux-2-x-sana/ -[7]:https://www.blackmoreops.com/administration/ -[8]:https://www.blackmoreops.com/usability/ -[9]:https://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/#comments -[10]:http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-10.jpg -[11]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-1/ -[12]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-3/ -[13]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-6/ -[14]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-4/ -[15]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-5/ -[16]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-7/ -[17]:http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-9.jpg diff --git a/translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md b/translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md new file mode 100644 index 0000000000..680562cf97 --- /dev/null +++ b/translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md @@ -0,0 +1,254 @@ +在 Kali Linux 中更改 GRUB 背景的 5 种方式 +============================================================ + + +这是一个关于如何在Kali Linux中更改GRUB背景的简单指南(实际上它是 Kali Linux 的 + GRUB 启动图像)。 Kali 开发团队在这方面做的不多,他们好像太忙了,所以在这篇文章中,我会解释一下关于GRUB两方面中的其中一个,我愿意写是因为这篇文章不会冗长而无聊! 那么我们开始吧…… + +[ + ![Change GRUB background in Kali Linux - blackMORE OPs -10](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-10.jpg) +][10] + +### 查找GRUB设置 + +这通常是所有人首先会遇到的一个问题,在哪里设置?有很多方法来查找GRUB设置。每个人都可能有自己的方法,但我发现 `update-grub` 是最简单的。如果在 VMWare 或 VirtualBox 中执行 `update-grub`,你将看到如下所示的内容: + +``` +root@kali:~# update-grub +Generating grub configuration file ... +Found background image: /usr/share/images/desktop-base/desktop-grub.png +Found linux image: /boot/vmlinuz-4.0.0-kali1-amd64 +Found initrd image: /boot/initrd.img-4.0.0-kali1-amd64 + No volume groups found +done +root@kali:~# +``` + +如果您是双系统,或者三系统,那么您将看到 GRUB 进入查找其他操作系统。然而,我们感兴趣的部分是背景图像,这是在我这里看到的(你会看到完全相同的内容): + +``` +Found background image: /usr/share/images/desktop-base/desktop-grub.png +``` + +### GRUB 启动图像搜索顺序 + +在 grub-2.02 中,它将按照以下顺序搜索基于 Debian 的系统的启动背景: + +1. `/etc/default/grub` 里的 GRUB_BACKGROUND 行  +2. 在 `/boot/grub/` 里找到的第一个图像(如果发现多张,将以字母顺序排序) +3. 在`/usr/share/desktop-base/grub_background.sh` 中指定的 +4. 在`/etc/grub.d/05_debian_theme` 里 WALLPAPER 行列出的 + +现在将此信息挂在这里,我们会尽快重新检查它。 + +### Kali Linux GRUB 启动图像 + +在我使用 Kali Linux 时(因为我喜欢用它做事),我们发现 Kali 正在使用这里的背景图像:`/usr/share/images/desktop-base/desktop-grub.png` + +为了确定,我们来检查一下这个 `.png` 文件的属性。 + +``` +root@kali:~# +root@kali:~# ls -l /usr/share/images/desktop-base/desktop-grub.png +lrwxrwxrwx 1 root root 30 Oct 8 00:31 /usr/share/images/desktop-base/desktop-grub.png -> /etc/alternatives/desktop-grub +root@kali:~# +``` + +[ + ![Change GRUB background in Kali Linux - blackMORE OPs -1](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-1.jpg) +][11] + +什么?它只是 `/etc/alternatives/desktop-grub` 的一个符号链接? 但是 `/etc/alternatives/desktop-grub` 不是图片文件。看来我也要检查一下它的属性。 + +``` +root@kali:~# +root@kali:~# ls -l /etc/alternatives/desktop-grub +lrwxrwxrwx 1 root root 44 Oct 8 00:27 /etc/alternatives/desktop-grub -> /usr/share/images/desktop-base/kali-grub.png +root@kali:~# +``` + +[ + ![Change GRUB background in Kali Linux - blackMORE OPs -3](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-3.jpg) +][12] + +好吧,真让人费解。 `/etc/alternatives/desktop-grub` 也是一个符号链接,它指向 `/usr/share/images/desktop-base/kali-grub.png`,来自最初同样的文件夹。呃! 这就是我能说的。 但是现在我们至少可以替换该文件并将其解决。 + +在替换之前,我们需要检查 `/usr/share/images/desktop-base/kali-grub.png` 的属性,以确保下载相同类型和大小的文件。 + +``` +root@kali:~# +root@kali:~# file /usr/share/images/desktop-base/kali-grub.png +/usr/share/images/desktop-base/kali-grub.png: PNG image data, 640 x 480, 8-bit/color RGB, non-interlaced +root@kali:~# +``` + +可以确定这是一个 PNG 图像文件,像素尺寸为 640 x 480。 + +### GRUB 背景图像属性 + +可以使用 `PNG`, `JPG`/`JPEG` 以及 `TGA` 类型的图像文件作为 GRUB 2 的背景。必须符合以下规范: + +* `JPG`/`JPEG` 图像必须是 `8-bit` (`256 color`) +* 图像应该是非索引的,`RGB` + +默认情况下,如果安装了 `desktop-base` 软件包,符合上述规范的图像将位于 `/usr/share/images/desktop-base/` 目录中。在谷歌上很容易找到类似的文件。我也找了一个。 + +``` +root@kali:~# +root@kali:~# file Downloads/wallpaper-1.png +Downloads/wallpaper-1.png: PNG image data, 640 x 480, 8-bit/color RGB, non-interlaced +root@kali:~# +``` + +[ + ![Change GRUB background in Kali Linux - blackMORE OPs -6](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-6.jpg) +][13] + +### 选项1:替换图像 + +现在我们只需简单的用新文件将 `/usr/share/images/desktop-base/kali-grub.png` 替换掉。值得注意这是最简单的方法,不需要修改 `grub-config` 文件。 如果你对 GRUB 很熟,建议你简单的修改 GRUB 的默认配置文件,然后执行 `update-grub`。 + +像往常一样,我会将原文件重命名为 `kali-grub.png.bkp` 进行备份。 + +``` +root@kali:~# +root@kali:~# mv /usr/share/images/desktop-base/kali-grub.png /usr/share/images/desktop-base/kali-grub.png.bkp +root@kali:~# +``` + +[ + ![Change GRUB background in Kali Linux - blackMORE OPs -4](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-4.jpg) +][14] + +现在我们将下载的文件重命名为 `kali-grub.png`。 + +``` +root@kali:~# +root@kali:~# cp Downloads/wallpaper-1.png /usr/share/images/desktop-base/kali-grub.png +root@kali:~# +``` + +[ + ![Change GRUB background in Kali Linux - blackMORE OPs -5](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-5.jpg) +][15] + +最后执行命令 `update-grub` + +``` +root@kali:~# update-grub +Generating grub configuration file ... +Found background image: /usr/share/images/desktop-base/desktop-grub.png +Found linux image: /boot/vmlinuz-4.0.0-kali1-amd64 +Found initrd image: /boot/initrd.img-4.0.0-kali1-amd64 + No volume groups found +done +root@kali:~# +``` + +[ + ![Change GRUB background in Kali Linux - blackMORE OPs -7](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-7.jpg) +][16] + +下次重新启动你的 Kali Linux 时,你会看到 GRUB 背景变成了你自己的图像(GRUB 启动界面)。 + +下面是我现在正在使用的新 GRUB 启动背景。你呢?要不要试试这个办法? + +[ + ![Change GRUB background in Kali Linux - blackMORE OPs -9](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-9.jpg) +][17] + +这是最简单最安全的办法,最糟不过在 GRUB 看到一个蓝色的背景,但你依然可以登录后修复他们。现在如果你有信心,让我们尝试一个改变 GRUB 设置的更好的方法(有点复杂)。后续步骤更加有趣,而且可以在任何使用 GRUB 引导的 Linux 上使用。 + +现在回忆一下 GRUB 在哪 4 个地方寻找启动背景图像?再看一遍: + +1. `/etc/default/grub` 里的 GRUB_BACKGROUND 行  +2. 在 `/boot/grub/` 里找到的第一个图像(如果发现多张,将以字母顺序排序) +3. 在`/usr/share/desktop-base/grub_background.sh` 中指定的 +4. 在`/etc/grub.d/05_debian_theme` 里 WALLPAPER 行列出的 + +那么我们再在 Kali Linux 上(或任意使用 GRUB2 的 Linux系统)试一下新的选择。 + +### 选项2:在 GRUB_BACKGROUND 中定义图像路径 + +所以你可以根据优先级使用上述任一项,将 GRUB 背景图像改为自己的。以下是我自己系统上  `/etc/default/grub` 的内容。 + +``` +root@kali:~# vi /etc/default/grub +``` + +按照 GRUB_BACKGROUND=”/root/World-Map.jpg” 的格式添加一行,其中 World-Map.jpg 是你要作为 GRUB 背景的图像文件。 + +``` +# If you change this file, run 'update-grub' afterwards to update +# /boot/grub/grub.cfg. +# For full documentation of the options in this file, see: +#   info -f grub -n 'Simple configuration' + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=15 +GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` +GRUB_CMDLINE_LINUX_DEFAULT="quiet" +GRUB_CMDLINE_LINUX="initrd=/install/gtk/initrd.gz" +GRUB_BACKGROUND="/root/World-Map.jpg" +``` + +一旦使用上述方式完成更改,务必执行 `update-grub` 命令,如下所示。 + +``` +root@kali:~# update-grub +Generating grub configuration file ... +Found background: /root/World-Map.jpg +Found background image: /root/World-Map.jpg +Found linux image: /boot/vmlinuz-4.0.0-kali1-amd64 +Found initrd image: /boot/initrd.img-4.0.0-kali1-amd64 +  No volume groups found +done +root@kali:~# +``` + +现在重启机器,你会在 GRUB 看到自定义的图像。 + +### 选项3:把图像文件放到 /boot/grub/ 文件夹 + +如果没有在 `/etc/default/grub` 文件中指定 `GRUB_BACKGROUND` 项,理论上 GRUB 应当使用在 `/boot/grub/` 文件夹找到的第一个图像文件作为背景。如果 GRUB 在 /boot/grub/ 找到多个图像文件,它会按字母排序并使用第一个图像文件。 + +### 选项4:在 grub_background.sh 指定图像路径 + +如果没有在 `/etc/default/grub` 文件中指定 `GRUB_BACKGROUND` 项,而且 `/boot/grub/` 目录下没有图像文件,GRUB 将会开始在 `/usr/share/desktop-base/grub_background.sh` 文件中指定的图像路径搜索。Kali Linux 是在这里指定的。每个 Linux 发行版都有自己的特色。 + +### 选项5:在 /etc/grub.d/05_debian_theme 文件的 WALLPAPER 一行指定图像 + +这是 GRUB 搜寻背景图像的最后一个位置。如果在其他部分都没有找到,它将会在这里查找。 + +### 结论 + +这篇文章较长,但我想介绍一些基础但很重要的东西。如果你有仔细阅读,你会理解如何在 Kali Linux 上来回跟踪符号链接。当你需要在一些 Linux 系统上查找 GRUB 背景图像的位置时,你会感到得心应手。只要再多阅读一点来理解 GRUB 颜色的工作方式,你就是行家了。 + +-------------------------------------------------------------------------------- + +via: https://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/ + +作者:[https://www.blackmoreops.com/][a] +译者:[fuowang](https://github.com/fuowang) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/ +[1]:http://www.facebook.com/sharer.php?u=https://www.blackmoreops.com/?p=5958 +[2]:https://twitter.com/intent/tweet?text=5+ways+to+change+GRUB+background+in+Kali+Linux%20via%20%40blackmoreops&url=https://www.blackmoreops.com/?p=5958 +[3]:https://plusone.google.com/_/+1/confirm?hl=en&url=https://www.blackmoreops.com/?p=5958&name=5+ways+to+change+GRUB+background+in+Kali+Linux +[4]:https://www.blackmoreops.com/how-to/ +[5]:https://www.blackmoreops.com/kali-linux/ +[6]:https://www.blackmoreops.com/kali-linux-2-x-sana/ +[7]:https://www.blackmoreops.com/administration/ +[8]:https://www.blackmoreops.com/usability/ +[9]:https://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/#comments +[10]:http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-10.jpg +[11]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-1/ +[12]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-3/ +[13]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-6/ +[14]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-4/ +[15]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-5/ +[16]:http://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linux/change-grub-background-in-kali-linux-blackmore-ops-7/ +[17]:http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-9.jpg From ccc93abc259e35a5802d09df4c77847f242a73cb Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 31 Mar 2017 09:06:15 +0800 Subject: [PATCH 042/241] =?UTF-8?q?20170331-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20170323 3 open source link shorteners.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20170323 3 open source link shorteners.md diff --git a/sources/tech/20170323 3 open source link shorteners.md b/sources/tech/20170323 3 open source link shorteners.md new file mode 100644 index 0000000000..e37e26dd02 --- /dev/null +++ b/sources/tech/20170323 3 open source link shorteners.md @@ -0,0 +1,84 @@ +3 open source link shorteners +============================================================ + +> Want to build your own URL shortener? These open source projects make it easy. + + ![3 open source link shorteners](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/links.png?itok=AumNmse7 "3 open source link shorteners") +>Image by : [Paul Lewin][2]. Modified by Opensource.com. [CC BY-SA 2.0][3] + +Nobody likes an impossibly long URL. + +They're hard to decipher. But sometimes, between a deep directory structure on a site, plus a large number of parameters tacked on to the end, URLs just begin to get unwieldy. And back in the days before Twitter added their own link shortener to their service, a long URL meant taking precious characters away from your tweets. + +Today, people use link shorteners for a slew of reasons. They can make it much easier to type, or remember, an otherwise lengthy bare URL. They can bring a consistent branding to a social media account. They make it easier to perform analytics across a group of URLs. They make it possible to provide a consistent entryway to a URL that may change frequently on the other side. + +There are some challenges to URL shorteners, to be sure. They make it challenging to figure out where a link is actually taking you before you click, and they're vulnerable to [linkrot][4], should the service providing the short URL for you ever disappear. But despite these challenges, URL shorteners aren't going anywhere anytime soon. + +But with so many free link shortening services out there, why roll your own? In short: control. While some services will let you pick your own domain to use, sometimes, that's about the level of customization you're going to get. With a self-hosted service, you decide how long your service operates for. You decide what format your URLs take. You decide who has access to your analytics. It's yours to own and operate as you please. + +Fortunately, there are many open source options out there if you want to build the next bit.ly, goo.gl, or ow.ly yourself. Here are a few you might consider. + +### Lessn More + +[Lessn More][5] is a personal URL shortener, built in PHP and forked off of an older project called Buttered URLs, which itself was derived from a fork of a project called Lessn. Lessn More provides most of the features you would expect from a URL shortener: API and bookmarklet support, custom URLs, etc. Some helpful features that set Lessn More apart are the ability to use a banned-words list to avoid creating an accidentally-inappropriate URL, the ability to avoid "lookalike" characters to make URLs more readable, the ability to choose whether or not to use mixed-case characters, and a few other helpful features. + +[Lessn More][6] provides its [source code][7] on GitHub under a 3-clause [BSD][8] license. + +### Polr + +[Polr][9] describes itself as a "modern, powerful, and robust URL shortener." It has a fairly straight-forward but modern interface, and like our other options detailed here comes with an API to allow you to use it from within other programs. Of the three presented here, it's the lightest on features, but if you're looking for a simple but functional option it may be a good choice for you. Check out the [online demo][10] before you download. + +The [source code][11] for Polr can be found on GitHub under a [GPLv2][12] license. + +### YOURLS + +[YOURLS][13], short for Your Own URL Shortener, is the option I am most familiar with. In full disclosure, I ran it for several years in production on a personal site, and was very happy with its capabilities. + +Written in PHP, YOURLS is a pretty feature-rich option that works well out of the box. You can configure it to be publicly usable by anyone, or only allow certain users to use it. It supports custom URLs, comes with a bookmarklet to make sharing easy, has pretty robust built-in stats, and supports a pluggable architecture to allow others to add to it. It also has an API, making it easy to create other programs which interface with it. + +You can find the [source code][14] for YOURLS on GitHub under an [MIT license][15]. + +* * * + +Don't like any of these options? Take a look around the Internet and you can find several other choices: [shuri][16], [Nimbus][17], [Lstu][18], and many others. And beyond the options already available, building a link shortener is a good first programming project to get to know a new language or web framework. After all, the core functionality is very simple: Take a URL as input, and issue a redirect to another URL. Beyond that, it's up to you what bells and whistles to add. + +Do you have a favorite we didn't list here? Let us know in the comments below + +-------------------------------------------------------------------------------- + +作者简介: + +Jason Baker - Jason is passionate about using technology to make the world more open, from software development to bringing sunlight to local governments. Linux desktop enthusiast. Map/geospatial nerd. Raspberry Pi tinkerer. Data analysis and visualization geek. Occasional coder. Cloud nativist. Follow him on Twitter. + +------------ + +via: https://opensource.com/article/17/3/url-link-shortener + +作者:[Jason Baker ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker +[1]:https://opensource.com/article/17/3/url-link-shortener?rate=5EGysFmjsUsxCc74bffDni4sFxxaIYiGRUG3UPznav8 +[2]:https://www.flickr.com/photos/digypho/7905320090 +[3]:https://creativecommons.org/licenses/by/2.0/ +[4]:https://en.wikipedia.org/wiki/Linkrot +[5]:https://lessnmore.net/ +[6]:https://lessnmore.net/ +[7]:https://github.com/alanhogan/lessnmore +[8]:https://github.com/alanhogan/lessnmore/blob/master/LICENSE.txt +[9]:https://project.polr.me/ +[10]:http://demo.polr.me/ +[11]:https://github.com/cydrobolt/polr +[12]:https://github.com/cydrobolt/polr/blob/master/LICENSE +[13]:https://yourls.org/ +[14]:https://github.com/YOURLS/YOURLS +[15]:https://github.com/YOURLS/YOURLS/blob/master/LICENSE.md +[16]:https://github.com/pips-/shuri +[17]:https://github.com/ethanal/nimbus +[18]:https://github.com/ldidry/lstu +[19]:https://opensource.com/user/19894/feed +[20]:https://opensource.com/article/17/3/url-link-shortener#comments +[21]:https://opensource.com/users/jason-baker From b67bc50b31598ecc022623bc9aa6578684ea9512 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 31 Mar 2017 09:07:44 +0800 Subject: [PATCH 043/241] =?UTF-8?q?20170331-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20170330 5 open source RSS feed readers.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20170330 5 open source RSS feed readers.md diff --git a/sources/tech/20170330 5 open source RSS feed readers.md b/sources/tech/20170330 5 open source RSS feed readers.md new file mode 100644 index 0000000000..e3766c05a8 --- /dev/null +++ b/sources/tech/20170330 5 open source RSS feed readers.md @@ -0,0 +1,102 @@ +5 open source RSS feed readers +============================================================ + + ![RSS feed](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/rss_feed.png?itok=FHLEh-fZ "RSS feed") +>Image by : [Rob McDonald][2] on Flickr. Modified by Opensource.com. [CC BY-SA 2.0][3]. + +### Do you use an RSS reader regularly? + +
   
+ +When Google Reader was discontinued four years ago, many "technology experts" called it the end of RSS feeds. + +And it's true that for some people, social media and other aggregation tools are filling a need that feed readers for RSS, Atom, and other syndication formats once served. But old technologies never really die just because new technologies come along, particularly if the new technology does not perfectly replicate all of the use cases of the old one. The target audience for a technology might change a bit, and the tools people use to consume the technology might change, too. + +But RSS is no more gone than email, JavaScript, SQL databases, the command line, or any number of other technologies that various people told me more than a decade ago had numbered days. (Is it any wonder that vinyl album sales just hit a [25-year peak][4] last year?) One only has to look at the success of online feed reader site Feedly to understand that there's still definitely a market for RSS readers. + +The truth is, RSS and related feed formats are just more versatile than anything in wide usage that has attempted to replace it. There is no other easy was for me as a consumer to read a wide variety of publications, formatted in a client of my choosing, where I am virtually guaranteed to see every item that is published, while simultaneously not being shown a bunch of articles I have already read. And as a publisher, it's a simple format that most any publishing software I already use will support out of the box, letting me reach more people and easily distribute many types of documents. + +So no, RSS is not dead. Long live RSS! We last looked at [open source RSS reader][5] options in 2013, and it's time for an update. Here are some of my top choices for open source RSS feed readers in 2017, each a little different in its approach. + +### Miniflux + +[Miniflux][6] is an absolutely minimalist web-based RSS reader, but don't confuse its intentionally light approach with laziness on the part of the developers; it is purposefully built to be a simple and efficient design. The philosophy of Miniflux seems to be to keep the application out of the way so that the reader can focus on the content, something many of us can appreciate in a world of bloated web applications. + +But lightweight doesn't mean void of features; its responsive design looks good across any device, and allows for theming, an API interface, multiple languages, bookmark pinning, and more. + +Miniflux's [source code][7] can be found on GitHub under the [GPLv3 Affero][8] license.  If you don't want to set up your own self-hosted version, a paid hosting plan is available for $15/year. + +### RSSOwl + +[RSSOwl][9] is a cross-platform desktop feed reader. Written in Java, it is reminiscent of many popular desktop email clients in style and feel. It features powerful filtering and search capabilities, customizable notifications, and labels and bins for sorting your feeds. If you're used to using Thunderbird or other desktop readers for email, you'll feel right at home in RSSOwl. + +You can find the source code for [RSSOwl][10] on GitHub under the [Eclipse Public License][11]. + +### Tickr + +[Tickr][12] is a slightly different entry in this mix. It's a Linux desktop client, but it's not your traditional browse-and-read format. Instead, it slides your feed's headlines across a bar on your desktop like a news ticker; it's a great choice for news junkies who want to get the latest from a variety of sources. Clicking on a headline will open it in your browser of choice. It's not a dedicated reading client like the rest of the applications on this list, but if you're more interested in skimming headlines than reading every article, it's a good pick. + +Tickr's source code and binaries can be found on the project's [website][13] under a GPL license. + +### Tiny Tiny RSS + +It would be difficult to build a list of modern RSS readers without including [Tiny Tiny RSS][14]. It's among the most popular self-hosted web-based readers, and it's chocked full of features: OPML import and export, keyboard shortcuts, sharing features, a themeable interface, an infrastructure for plug-ins, filtering capabilities, and lots more. + +Tiny Tiny RSS also hosts an official [Android client][15], for those hoping to read on the go. + +Both the [web][16] and [Android][17] source code for Tiny Tiny RSS can be found on GitLab under a [GPLv3 license][18]. + +### Winds + +[Winds][19] is a modern looking self-hosted web feed reader, built on React. It makes use of a hosted machine learning personalization API called Stream, with the intent of helping you find more content that might be of interest to you based on your current interests. An online demo is available so you can [try it out][20] before you download. It's a new project, just a few months old, and so perhaps too soon to evaluate whether it's up to replace my daily feed reader yet, but it's certainly a project I'm watching with interest. + +You can find the [source code][21] for Winds on GitHub under an [MIT][22] license. + +* * * + +These are most definitely not the only options out there. RSS is a relatively easy-to-parse, well-documented format, and so there are many, many different feed readers out there built to suit just about every taste. Here's a [big list][23] of self-hosted open source feed readers you might consider in addition to the ones we listed. We hope you'll share with us what your favorite RSS reader is in the comments below. + +-------------------------------------------------------------------------------- + +作者简介: + +Jason Baker - Jason is passionate about using technology to make the world more open, from software development to bringing sunlight to local governments. Linux desktop enthusiast. Map/geospatial nerd. Raspberry Pi tinkerer. Data analysis and visualization geek. Occasional coder. Cloud nativist. Follow him on Twitter. + + +-------------- + +via: https://opensource.com/article/17/3/rss-feed-readers + +作者:[ Jason Baker][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jason-baker +[1]:https://opensource.com/article/17/3/rss-feed-readers?rate=2sJrLq0K3QPQCznBId7K1Qrt3QAkwhQ435UyP77B5rs +[2]:https://www.flickr.com/photos/evokeartdesign/6002000807 +[3]:https://creativecommons.org/licenses/by/2.0/ +[4]:https://www.theguardian.com/music/2017/jan/03/record-sales-vinyl-hits-25-year-high-and-outstrips-streaming +[5]:https://opensource.com/life/13/6/open-source-rss +[6]:https://miniflux.net/ +[7]:https://github.com/miniflux/miniflux +[8]:https://github.com/miniflux/miniflux/blob/master/LICENSE +[9]:http://www.rssowl.org/ +[10]:https://github.com/rssowl/RSSOwl +[11]:https://github.com/rssowl/RSSOwl/blob/master/LICENSE +[12]:https://www.open-tickr.net/ +[13]:https://www.open-tickr.net/download.php +[14]:https://tt-rss.org/gitlab/fox/tt-rss/wikis/home +[15]:https://tt-rss.org/gitlab/fox/tt-rss-android +[16]:https://tt-rss.org/gitlab/fox/tt-rss/tree/master +[17]:https://tt-rss.org/gitlab/fox/tt-rss-android/tree/master +[18]:https://tt-rss.org/gitlab/fox/tt-rss-android/blob/master/COPYING +[19]:https://winds.getstream.io/ +[20]:https://winds.getstream.io/app/getting-started +[21]:https://github.com/GetStream/Winds +[22]:https://github.com/GetStream/Winds/blob/master/LICENSE.md +[23]:https://github.com/Kickball/awesome-selfhosted#feed-readers +[24]:https://opensource.com/user/19894/feed +[25]:https://opensource.com/article/17/3/rss-feed-readers#comments +[26]:https://opensource.com/users/jason-baker From a77b49ee2323991ff70e039d4a355675efef84bd Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 31 Mar 2017 09:09:13 +0800 Subject: [PATCH 044/241] =?UTF-8?q?20170331-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20170327 Using vi-mode in your shell.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20170327 Using vi-mode in your shell.md diff --git a/sources/tech/20170327 Using vi-mode in your shell.md b/sources/tech/20170327 Using vi-mode in your shell.md new file mode 100644 index 0000000000..0badb7e563 --- /dev/null +++ b/sources/tech/20170327 Using vi-mode in your shell.md @@ -0,0 +1,91 @@ +Using vi-mode in your shell +============================================================ + +> Get an introduction to using vi-mode for line editing at the command line. + + ![Using vi-mode at the command line](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/code_computer_development_programming.png?itok=wMspQJcO "Using vi-mode at the command line") +>Image by : opensource.com + +As a participant in the greater open source community, and more specifically as a member of the [Fedora Project][2], I have the opportunity to meet with many people and talk about all kinds of interesting technical topics. One of my favorites is the "command line," or [shell][3], because learning about how people use the shell proficiently can give you an insight into how they think, what kind of workflows they favor, and to some extent what makes them tick. Many developers and systems operators share their "dot files" (a common slang term for their shell's configuration files) publicly out on the Internet, which leads to an interesting collaboration opportunity that allows everyone to learn tips and tricks from seasoned veterans of the command line as well as share common shortcuts and productivity boosters. + +I'll introduce one for you here by showing the shell's vi-mode. + +In the large ecosystem of computing and operating systems, there are [many shells][4]. However, in the Linux world, the de facto standard has become [bash][5] and it is the default shell installed on all major Linux distributions at of the time of this writing. As such, that is the shell I'll be talking about today. Something to note, though, is that bash is also a reasonably popular option on other UNIX-style operating systems, so it's likely not far from your reach (and for you Windows users out there, there's always [cygwin][6]). + +While exploring the shell, the first thing you do is type commands into it and most often get output, like so: + +``` +$ echo "Hello World!" +Hello World! +``` + +This is common practice and is probably something everyone reading this has done. Something that newcomers and novices alike might not realize is that the default input mode for the [bash][7] shell is [Emacs][8], which means that all line-editing functions you will carry out on commands will use ["Emacs-style" keyboard combinations][9]. (For those interested in the nuts and bolts of things, the function of line-editing is actually carried out by [GNU Readline][10].) + +For example, if you had typed **echo "Hello Wrld!"** and realized that you wanted to quickly jump back one word (space delimited) to fix that typo without having to hold down your left arrow key then you would hit the **Alt+b** keys together and the cursor would jump backward to the **W**. + +``` +$ echo "Hello Wrld!" +              ^ +        Cursor is here. +``` + +This was done using only one of the many Emacs keyboard combinations that is offered to the user of the shell. There are many more available for all kinds of things, such as copying text, pasting text, removing text, and using shortcuts to edit text. Using complex keyboard combinations and committing them to memory may seem silly, but they can be extremely powerful when working with longer commands or recalling a command from your shell history yet wanting to edit a couple things before executing the command again. + +While Emacs key bindings are all well and good if you're familiar with the Emacs text editor or otherwise find them convenient to use, there are those who are more comfortable using "vi-style" keyboard bindings because of their time spent in the vi text editor (normally via [vim][11] or [nvim][12] these days). The bash shell (again, via GNU Readline) is able to provide this functionality for us. In order to enable it, you run the command **$ ****set**** -o vi**. + +Just like magic, you're now in vi-mode and can easily line-edit using vi-style key bindings in order to copy text, remove text, and jump around to different positions in the line of text. This isn't much different in terms of capabilities of Emacs-mode but it's  _how_  you interact with the shell to perform these actions that changes, which is a powerful option pending your specific preference. + +Let's take a look at the same example as before, but with the context that as soon as you land in vi-mode in your shell you're in INSERT mode, which means you can type commands just you did before but you can now hit the **Esc** key on your keyboard and you'll be in NORMAL mode, which is where you can navigate around freely and make text modifications. + +Looking at the same example as before, if you had typed **echo "Hello Wrld!"** and realized you wanted to jump back one word (again, space delimited) to fix up that typo, then you would hit **Esc** to change from INSERT to NORMAL mode. Then you can type **B** (**Shift+b** for those following along at home), which would move the cursor back much like it did before. (For more information on vi-modes, go [here][13].): + +``` +$ echo "Hello Wrld!" +              ^ +        Cursor is here. +``` + +Now, for the vi/vim/nvim users out there this is hopefully a fun "ah ha!" moment when you realize the potential of keeping your tried and true keyboard shortcuts close by at all times and not just while your writing things like code or documentation in your editor. If this is all new to you and you want to learn more, then I might suggest taking a trip to this [interactive vim tutorial][14] and see if the vi style of editing text is something you find useful. + +If you enjoy interacting with your shell in this mode, you can set that persistently by editing the **~/.bashrc** file in your home directory and adding the following line at the bottom. + +**set -o vi** + +For the emacs mode users, hopefully this was a quick and fun look into "the other side" of your shell. At the end of the day I think everyone should use whatever editor and shell line-editing mode that makes them most productive and if that's vi-mode and this article was news to you, then congratulations! Now go forth and be productive. + +Happy hacking... + +-------------------------------------------------------------------------------- + +作者简介: + +Adam Miller is a member of the Fedora Engineering team focusing on Fedora Release Engineering tooling. His work includes next-generation build systems, automation, RPM package maintenance, and infrastructure deployment. Adam has completed his Bachelors of Science in Computer Science and Masters of Science in Information Assurance and Security, both from Sam Houston State University. He is a Red Hat Certified Engineer (Cert# 110-008-810), and an active member of the open source community with a running history of contributions to the Fedora Project (FAS account name: maxamillion). + + +------------------------ +via: https://opensource.com/article/17/3/fun-vi-mode-your-shell + +作者:[Adam Miller ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/maxamillion +[1]:https://opensource.com/article/17/3/fun-vi-mode-your-shell?rate=5_eAB9UtByHOiZMysPcewU4Zz6hOrLwdcgIpu2Ub4vo +[2]:https://getfedora.org/ +[3]:https://opensource.com/business/16/3/top-linux-shells +[4]:https://opensource.com/business/16/3/top-linux-shells +[5]:https://tiswww.case.edu/php/chet/bash/bashtop.html +[6]:http://cygwin.org/ +[7]:https://tiswww.case.edu/php/chet/bash/bashtop.html +[8]:https://www.gnu.org/software/emacs/ +[9]:https://en.wikipedia.org/wiki/GNU_Readline#Emacs_keyboard_shortcuts +[10]:http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html +[11]:http://www.vim.org/ +[12]:https://neovim.io/ +[13]:https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes +[14]:http://www.openvim.com/tutorial.html +[15]:https://opensource.com/user/10726/feed +[16]:https://opensource.com/article/17/3/fun-vi-mode-your-shell#comments +[17]:https://opensource.com/users/maxamillion From 6a9fa3561a583266e43d7c6496f3c04db63f211c Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 31 Mar 2017 09:12:24 +0800 Subject: [PATCH 045/241] translating --- sources/tech/20170323 3 open source link shorteners.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170323 3 open source link shorteners.md b/sources/tech/20170323 3 open source link shorteners.md index e37e26dd02..4849e57d9a 100644 --- a/sources/tech/20170323 3 open source link shorteners.md +++ b/sources/tech/20170323 3 open source link shorteners.md @@ -1,3 +1,5 @@ +translating---geekpi + 3 open source link shorteners ============================================================ From 191a47a90244ef3dbcf767202f33e5c368d57356 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 31 Mar 2017 09:12:28 +0800 Subject: [PATCH 046/241] =?UTF-8?q?20170331-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...g ways AI is rapidly invading our lives.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20170322 5 big ways AI is rapidly invading our lives.md diff --git a/sources/tech/20170322 5 big ways AI is rapidly invading our lives.md b/sources/tech/20170322 5 big ways AI is rapidly invading our lives.md new file mode 100644 index 0000000000..ea06ccc5fa --- /dev/null +++ b/sources/tech/20170322 5 big ways AI is rapidly invading our lives.md @@ -0,0 +1,114 @@ +5 big ways AI is rapidly invading our lives +============================================================ + +> Let's look at five real ways we're already surrounded by artificial intelligence. + + + ![5 big ways AI is rapidly invading our lives](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/brain-think-ai-intelligence-ccby.png?itok=-EK6Vpz1 "5 big ways AI is rapidly invading our lives") +>Image by : opensource.com + +Open source projects [are helping drive][2] artificial intelligence advancements, and we can expect to hear much more about how AI impacts our lives as the technologies mature. Have you considered how AI is changing the world around you already? Let's take a look at our increasingly artificially enhanced universe and consider the bold predictions about our AI-influenced future. + +### 1\. AI influences your purchasing decisions + +A recent story on [VentureBeat][3], "[How AI will help us decipher millennials][4]," caught my eye. I confess that I haven't given much thought to artificial intelligence—nor have I had a hard time deciphering millennials—so I was curious to learn more. As it turns out, the headline was a bit misleading; "How to sell to millennials" would have been a more accurate title. + +According to the article, the millennial generation is a "the demographic segment so coveted that marketing managers from all over the globe are fighting over them." By analyzing online behavior—be it shopping, social media, or other activities—machine learning can help predict behavioral patterns, which can then turn into targeted advertising. The article goes on to explain how the Internet of Things and social media platforms can be mined for data points. "Using machine learning to mine social media data allows companies to determine how millennials talk about its products, what their sentiments are towards a product category, how they respond to competitors’ advertising campaigns, and a multitude of other data that can be used to design targeted advertising campaigns," the article explains. That AI and millennials are the future of marketing is no huge surprise, but Gen Xers and Baby Boomers, you're not off the hook yet. + +>AI is being used to target entire groups—including cities—of people based on behavior changes.AI is being used to target entire groups—including cities—of people based on behavior changes. + +For example, an article on [Raconteur][23], "[How AI will change buyer behaviour][24]," explains that the biggest strength of AI in the online retail industry is its ability to adapt quickly to fluid situations that change customer behavior. Abhinav Aggarwal, chief executive of artificial intelligence startup [Fluid AI][25], says that his company's software was being used by a client to predict customer behavior, and the system noticed a change during a snow storm. "Users who would typically ignore the e-mails or in-app notifications sent in the middle of the day were now opening them as they were stuck at home without much to do. Within an hour the AI system adapted to the new situation and started sending more promotional material during working hours," he explains. + +AI is changing how, why, and when we spend money, but how is it changing the way we earn our paychecks? + +### 2\. AI is changing how we work + +A recent [Fast Company][5] article, "[This is how AI will change your work in 2017][6]," says that job seekers will benefit from artificial intelligence. The author explains that AI will be used to send job seekers alerts for relevant job openings, in addition to updates on salary trends, when you're due for a promotion, and the likelihood that you'll get one. + +Artificial intelligence also will be used by companies to help on-board new talent. "Many new hires get a ton of information during their first couple of days on the job, much of which won't get retained," the article explains. Instead, a bot could "drip information" to a new employee over time as it becomes more relevant. + +On [Inc.][7], "[Businesses Beyond Bias: How AI Will Reshape Hiring Practices][8]" looks at how [SAP SuccessFactors][9], a talent management solutions provider, leverages AI as a job description "bias checker" and to check for bias in employee compensation. + +[Deloitte's 2017 Human Capital Trends Report][10] indicates that AI is motivating organizations to restructure. Fast Company's article "[How AI is changing the way companies are organized][11]" examines the report, which was based on surveys with more than 10,000 HR and business leaders around the world. "Instead of hiring the most qualified person for a specific task, many companies are now putting greater emphasis on cultural fit and adaptability, knowing that individual roles will have to evolve along with the implementation of AI," the article explains. To adapt to changing technologies, organizations are also moving away from top-down structures and to multidisciplinary teams, the article says. + +### 3\. AI is transforming education + +>AI will benefit all the stakeholders of the education ecosystem. + +Education budgets are shrinking, whereas classroom sizes are growing, so leveraging technological advancements can help improve the productivity and efficiency of the education system, and play a role in improving the quality and affordability of education, according to an article on VentureBeat. "[How AI will transform education in 2017][26]" says that this year we'll see AI grading students' written answers, bots answering students' questions, virtual personal assistants tutoring students, and more. "AI will benefit all the stakeholders of the education ecosystem," the article explains. "Students would be able to learn better with instant feedback and guidance, teachers would get rich learning analytics and insights to personalize instruction, parents would see improved career prospects for their children at a reduced cost, schools would be able to scale high-quality education, and governments would be able to provide affordable education to all." + +### 4\. AI is reshaping healthcare + +A February 2017 article on [CB Insights][12] rounded up [106 artificial intelligence startups in healthcare][13], and many of those raised their first equity funding round within the past couple of years. "19 out of the 24 companies under imaging and diagnostics raised their first equity funding round since January 2015," the article says. Other companies on the list include those working on AI for remote patient monitoring, drug discovery, and oncology. + +An article published on March 16 on TechCrunch that looks at [how AI advances are reshaping healthcare][14] explains, "Once a better understanding of human DNA is established, there is an opportunity to go one step further and provide personalized insights to individuals based on their idiosyncratic biological dispositions. This trend is indicative of a new era of 'personalized genetics,' whereby individuals are able to take full control of their health through access to unprecedented information about their own bodies." + +The article goes on to explain that AI and machine learning are lowering the cost and time to discover new drugs. Thanks in part to extensive testing, new drugs can take more than 12 years to enter the market. "ML algorithms can allow computers to 'learn' how to make predictions based on the data they have previously processed or choose (and in some cases, even conduct) what experiments need to be done. Similar types of algorithms also can be used to predict the side effects of specific chemical compounds on humans, speeding up approvals," the article says. In 2015, the article notes, a San Francisco-based startup, [Atomwise][15], completed analysis on two new drugs to reduce Ebola infectivity within one day, instead of taking years. + +>AI is helping with discovering, diagnosing, and managing new diseases. + +Another startup, London-based [BenevolentAI][27], is harnessing AI to look for patterns in scientific literature. "Recently, the company identified two potential chemical compounds that may work on Alzheimer’s, attracting the attention of pharmaceutical companies," the article says. + +In addition to drug discovery, AI is helping with discovering, diagnosing, and managing new diseases. The TechCrunch article explains that, historically, illnesses are diagnosed based on symptoms displayed, but AI is being used to detect disease signatures in the blood, and to develop treatment plans using deep learning insights from analyzing billions of clinical cases. "IBM's Watson is working with Memorial Sloan Kettering in New York to digest reams of data on cancer patients and treatments used over decades to present and suggest treatment options to doctors in dealing with unique cancer cases," the article says. + +### 5\. AI is changing our love lives + +More than 50-million active users across 195 countries swipe through potential mates with [Tinder][16], a dating app launched in 2012\. In a [Forbes Interview podcast][17], Tinder founder and chairman Sean Rad spoke with Steven Bertoni about how artificial intelligence is changing the dating game. In [an article][18] about the interview, Bertoni quotes Rad, who says, "There might be a moment when Tinder is just so good at predicting the few people that you're interested in, and Tinder might do a lot of the leg work in organizing a date, right?" So instead of presenting users with potential partners, the app would make a suggestion for a nearby partner and take it a step further, coordinate schedules, and set up a date. + +>Future generations literally might fall in love with artificial intelligence. + +Are you in love with AI yet? Future generations literally might fall in love with artificial intelligence. An article by Raya Bidshahri on [Singularity Hub][19], "[How AI will redefine love][20]," says that in a few decades we might be arguing that love is not limited by biology. + +"Our technology, powered by Moore's law, is growing at a staggering rate—intelligent devices are becoming more and more integrated to our lives," Bidshahri explains, adding, "Futurist Ray Kurzweil predicts that we will have AI at a human level by 2029, and it will be a billion times more capable than humans by the 2040s. Many predict that one day we will merge with powerful machines, and we ourselves may become artificially intelligent." She argues that it's inevitable in such a world that humans would accept being in love with entirely non-biological beings. + +That might sound a bit freaky, but falling in love with AI is a more optimistic outcome than a future in which robots take over the world. "Programming AI to have the capacity to feel love can allow us to create more compassionate AI and may be the very key to avoiding the AI apocalypse many fear," Bidshahri says. + +This list of big ways AI is invading all areas of our lives barely scrapes the surface of the artificial intelligence bubbling up around us. Which AI innovations are most exciting—or troubling—to you? Let us know about them in the comments. + +-------------------------------------------------------------------------------- + + +作者简介: + +Rikki Endsley - Rikki Endsley is a community manager for Opensource.com. In the past, she worked as the community evangelist on the Open Source and Standards (OSAS) team at Red Hat; a freelance tech journalist; community manager for the USENIX Association; associate publisher of Linux Pro Magazine, ADMIN, and Ubuntu User; and as the managing editor of Sys Admin magazine and UnixReview.com. Follow her on Twitter at: @rikkiends. + + +------------------- + +via: https://opensource.com/article/17/3/5-big-ways-ai-rapidly-invading-our-lives + +作者:[Rikki Endsley ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/rikki-endsley +[1]:https://opensource.com/article/17/3/5-big-ways-ai-rapidly-invading-our-lives?rate=ORfqhKFu9dpA9aFfg-5Za9ZWGcBcx-f0cUlf_VZNeQs +[2]:https://www.linux.com/news/open-source-projects-are-transforming-machine-learning-and-ai +[3]:https://twitter.com/venturebeat +[4]:http://venturebeat.com/2017/03/16/how-ai-will-help-us-decipher-millennials/ +[5]:https://opensource.com/article/17/3/5-big-ways-ai-rapidly-invading-our-lives +[6]:https://www.fastcompany.com/3066620/this-is-how-ai-will-change-your-work-in-2017 +[7]:https://twitter.com/Inc +[8]:http://www.inc.com/bill-carmody/businesses-beyond-bias-how-ai-will-reshape-hiring-practices.html +[9]:https://www.successfactors.com/en_us.html +[10]:https://dupress.deloitte.com/dup-us-en/focus/human-capital-trends.html?id=us:2el:3pr:dup3575:awa:cons:022817:hct17 +[11]:https://www.fastcompany.com/3068492/how-ai-is-changing-the-way-companies-are-organized +[12]:https://twitter.com/CBinsights +[13]:https://www.cbinsights.com/blog/artificial-intelligence-startups-healthcare/ +[14]:https://techcrunch.com/2017/03/16/advances-in-ai-and-ml-are-reshaping-healthcare/ +[15]:http://www.atomwise.com/ +[16]:https://twitter.com/Tinder +[17]:https://www.forbes.com/podcasts/the-forbes-interview/#5e962e5624e1 +[18]:https://www.forbes.com/sites/stevenbertoni/2017/02/14/tinders-sean-rad-on-how-technology-and-artificial-intelligence-will-change-dating/#4180fc2e5b99 +[19]:https://twitter.com/singularityhub +[20]:https://singularityhub.com/2016/08/05/how-ai-will-redefine-love/ +[21]:https://opensource.com/user/23316/feed +[22]:https://opensource.com/article/17/3/5-big-ways-ai-rapidly-invading-our-lives#comments +[23]:https://twitter.com/raconteur +[24]:https://www.raconteur.net/technology/how-ai-will-change-buyer-behaviour +[25]:http://www.fluid.ai/ +[26]:http://venturebeat.com/2017/02/04/how-ai-will-transform-education-in-2017/ +[27]:https://twitter.com/benevolent_ai +[28]:https://opensource.com/users/rikki-endsley From a1215ea30016e5db40c8bcc604cf0253c8e4877c Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 31 Mar 2017 09:13:54 +0800 Subject: [PATCH 047/241] =?UTF-8?q?20170331-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ss legal matters with an open community.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/talk/20170321 7 ways to discuss legal matters with an open community.md diff --git a/sources/talk/20170321 7 ways to discuss legal matters with an open community.md b/sources/talk/20170321 7 ways to discuss legal matters with an open community.md new file mode 100644 index 0000000000..ad3f493882 --- /dev/null +++ b/sources/talk/20170321 7 ways to discuss legal matters with an open community.md @@ -0,0 +1,65 @@ +7 ways to discuss legal matters with an open community +============================================================ + +> Are your organization's lawyers ready to engage an open community? Don't let them make these mistakes. + + + ![7 ways to discuss legal matters with an open community](https://opensource.com/sites/default/files/styles/image-full-size/public/images/law/LAW-Internet_construction_9401467_520x292_0512_dc.png?itok=xmtgmowQ "7 ways to discuss legal matters with an open community") +>Image by : opensource.com + +Having watched a fair number of people attempt to engage both the [Open Source Initiative's licensing evaluation community][3] and the [Apache Software Foundation's legal affairs committee][4], I'd like to offer some hints and tips for succeeding when it's  _your_  turn to conduct a legal discussion with an open community. + +### No proxies + +First and foremost, make sure the person conducting the conversation is both  _qualified_  and  _empowered_ . Don't send proxies; they simply frustrate the community, who quickly work out that your representative is always playing the second-hand car salesman and going to the back room to ask for a deal. Obviously, legal discussions will involve a team at your company, probably involving product management, engineering and in-house counsel. But the representative needs to be able to hold the conversation themselves and not keep delivering cut paste quotes from anonymous personae behind the curtain. + +### Multilaterality + +An open source community reaches a hard-won consensus on the certainties they need in order to collaborate safely. That consensus gets embodied in their governance and especially in the open source license they use. So when you come with a new proposal, it's not like a normal business deal. Those are bilateral negotiations, trading the freedoms of the two parties to create a peace treaty that's an optimal compromise. In this discussion you are just one of many, many parties, and you need to explain why your proposal is good for everyone. Negotiating multilateral change is inherently slow, so don't come with a deadline. And whatever you do, don't suggest changes to the open source license! + +### Study first + +The existing consensus and process exists for a reason. You should understand the reason for each element, preferably along with the history of how it arose, before suggesting changes to it. That way you can couch your proposals in the context of further evolution, and you can avoid being schooled in community history (something that wastes community bandwidth and reduces your chances of effectiveness). Read back through the mailing list and ask your developer colleagues for history and context. + +### Transparency + +Open source developers use a process of iterative, incremental change. Even if a big change is needed, it will almost always be delivered as a sequence of smaller, well-explained or self-evidently correct changes so that everyone can follow along and buy in to the improvement. The same is true of your proposed change. Don't show up with a new contributor agreement or a modified license and expect everyone to trust that you're experts so it must all be good. You need to provide a "red-line" (the legal document equivalent of a diff), document each change, and provide a justification that admits any community impact and justifies it. If you need a thing to be  _just so_  for your own benefit, admit it rather than hoping no one will notice. + +### Humility + +So you are a hot-shot lawyer and you think only programmers use the mailing list. It's clear to you that they'll lack the experience to have a discussion, so you either send a proxy you think is their equal, dumb it all down, or propose having a one-on-one discussion with the community's chosen lawyer. I'm sorry to say that you are so, so wrong on all counts. Since the community's policy is a multilateral consensus, there is a really good chance they know why they settled on what they have now. There will be some people on the list with excellent domain-specific knowledge, likely to be better than yours. And that one-on-one thing is the ultimate insult, like asking if there is an adult you can speak with. + +### Don't back-channel + +There may well be a leadership body of some kind. Maybe you know the boss at the company where the VP Legal works. Perhaps you know the community's General Counsel. While asking for hints on how to navigate the process may be acceptable in some circumstances, trying to conduct a back-channel discussion or negotiation with the expectation of influencing or even determining the outcome can blow back badly. You may eventually be invited for a one-on-one discussion, but you should never demand or expect it. + +### Become a member + +If you do everything right, chances are that the community will respect you for it. Stick around. Build your reputation as a calm, wise contributor. Help others when they show up and make the mistakes you made (or avoided!) As a trusted participant in the "$-legal" mailing list community, you are a real asset to both the project and your employer. Keep contributing and some projects will eventually offer you a role in their governance process. + + _An earlier version of this article [originally appeared][1] at Meshed Insights._ + +-------------------------------------------------------------------------------- + +作者简介: + +Simon Phipps - Computer industry and open source veteran Simon Phipps started Public Software, a European host for open source projects, and volunteers as a director at The Document Foundation. His posts are sponsored by Patreon patrons - become one if you'd like to see more! + +------------ + +via: https://opensource.com/open-organization/17/3/legal-matters-community + +作者:[ Simon Phipps][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/simonphipps +[1]:https://meshedinsights.com/2017/02/28/engaging-communities-on-legal-matters-7-tips/ +[2]:https://opensource.com/open-organization/17/3/legal-matters-community?rate=gSFbyOzBTIipXOdeeL-GVIT1BYoC4f61FKZJ7KRg3d0 +[3]:https://opensource.org/approval +[4]:https://www.apache.org/legal/ +[5]:https://opensource.com/user/12532/feed +[6]:https://opensource.com/open-organization/17/3/legal-matters-community#comments +[7]:https://opensource.com/users/simonphipps From 53a8737744320730ba218be91f140b1173bf5e74 Mon Sep 17 00:00:00 2001 From: Ezio Date: Fri, 31 Mar 2017 09:16:32 +0800 Subject: [PATCH 048/241] =?UTF-8?q?20170331-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Ruby Programming with Open-Source Books.md | 308 ++++++++++++++++++ 1 file changed, 308 insertions(+) create mode 100644 sources/tech/20170330 Study Ruby Programming with Open-Source Books.md diff --git a/sources/tech/20170330 Study Ruby Programming with Open-Source Books.md b/sources/tech/20170330 Study Ruby Programming with Open-Source Books.md new file mode 100644 index 0000000000..20ac5cf826 --- /dev/null +++ b/sources/tech/20170330 Study Ruby Programming with Open-Source Books.md @@ -0,0 +1,308 @@ +STUDY RUBY PROGRAMMING WITH OPEN-SOURCE BOOKS +============================================================ + +### Open Source Ruby Books + +Ruby is a general purpose, scripting, structured, flexible, fully object-oriented programming language developed by Yukihiro “Matz” Matsumoto. It features a fully dynamic type system, which means that the majority of its type checking is performed at run-time rather than at compilation. This stops programmers having to overly worry about integer and string types. Ruby has automatic memory management. The language shares many similar traits with Python, Perl, Lisp, Ada, Eiffel, and Smalltalk. + +Ruby’s popularity was enhanced by the Ruby on Rails framework, a full-stack web framework which has been used to create many popular applications including Basecamp, GitHub, Shopify, Airbnb, Twitch, SoundCloud, Hulu, Zendesk, Square, and Highrise. + +Ruby possesses a high portability running on Linux, Windows, Mac OS X, Cygwin, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, Tru64 UNIX, HP-UX, and many other operating systems. The TIOBE Programming Community index currently ranks Ruby in 12th place. + +This compilation makes 9 strong recommendations. There are books here for beginner, intermediate, and advanced programmers. All of the texts are, of course, released under an open source license. + +This article is part of [OSSBlog’s series of open source programming books][18]. + +| + ![Ruby Best Practices](https://i0.wp.com/www.ossblog.org/wp-content/uploads/2017/03/RubyBestPractices.jpg?resize=200%2C262&ssl=1) + | + +### [Ruby Best Practices][1] + +By Gregory Brown (328 pages) + +Ruby Best Practices is for programmers who want to use Ruby as experienced Rubyists do. Written by the developer of the Ruby project Prawn, this book explains how to design beautiful APIs and domain-specific languages with Ruby, as well as how to work with functional programming ideas and techniques that can simplify your code and make you more productive. + +Ruby Best Practices is much more about how to go about solving problems in Ruby than it is about the exact solution you should use. The book is not targeted at the Ruby beginner, and will be of little use to someone new to programming. The book assumes a reasonable technical understanding of Ruby, and some experience in developing software with it. + +The book is split into two parts, with eight chapters forming its core and three appendixes included as supplementary material. + +This book provides a wealth of information on: + +* Driving Code Through Tests – covers a number testing philosophies and techniques. Use mocks and stubs +* Designing Beautiful APIs with special focus on Ruby’s secret powers: Flexible argument processing and code blocks +* Mastering the Dynamic Toolkit showing developers how to build flexible interfaces, implementing per-object behaviour, extending and modifying pre-existing code, and building classes and modules programmatically +* Text Processing and File Management focusing on regular expressions, working with files, the tempfile standard library, and text-processing strategies +* Functional Programming Techniques highlighting modular code organisation, memoization, infinite lists, and higher-order procedures +* Understand how and why things can go wrong explaining how to work with logger +* Reduce Cultural Barriers by leveraging Ruby’s multilingual capabilities +* Skillful Project Maintenance + +The book is open source, released under the Creative Commons NC-SA license. + + | +| + ![I Love Ruby](https://i2.wp.com/www.ossblog.org/wp-content/uploads/2017/03/LoveRuby.png?resize=200%2C282&ssl=1) + | + +### [I Love Ruby][2] + +By Karthikeyan A K (246 pages) + +I Love Ruby explains fundamental concepts and techniques in greater depth than traditional introductions. This approach provides a solid foundation for writing useful, correct, maintainable, and efficient Ruby code. + +Chapters cover: + +* Variables +* Strings +* Comparison and Logic +* Loops +* Arrays +* Hashes and Symbols +* Ranges +* Functions +* Variable Scope +* Classes & Objects +* Rdoc +* Modules and Mixins +* Date and Time +* Files +* Proc, Lambdas and Blocks +* Multi Threading +* Exception Handling +* Regular Expressions +* Gems +* Meta Programming + +Permission is granted to copy, distribute and/or modify the book under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. + + | +| + ![Programming Ruby - The Pragmatic Programmer's Guide](https://i1.wp.com/www.ossblog.org/wp-content/uploads/2017/03/ProgrammingRuby.jpeg?resize=200%2C248&ssl=1) + | + +### [Programming Ruby – The Pragmatic Programmer’s Guide][3] + +By David Thomas, Andrew Hunt (HTML) + +Programming Ruby is a tutorial and reference for the Ruby programming language. Use Ruby, and you will write better code, be more productive, and make programming a more enjoyable experience. + +Topics covered include: + +* Classes, Objects and Variables +* Containers, Blocks and Iterators +* Standard Types +* More about Methods +* Expressions +* Exceptions, Catch and Throw +* Modules +* Basic Input and Output +* Threads and Processes +* When Trouble Strikes +* Ruby and its World, the Web, Tk, and Microsoft Windows +* Extending Ruby +* Reflection, ObjectSpace and Distributed Ruby +* Standard Library +* Object-Oriented Design Libraries +* Network and Web Libraries +* Embedded Documentation +* Interactive Ruby Shell + +The first edition of this book is released under the Open Publication License, v1.0 or later. An updated Second Edition of this book, covering Ruby 1.8 and including descriptions of all the new libraries is available, but is not released under a freely distributable license. + + | +| + ![Why’s (Poignant) Guide to Ruby](https://i1.wp.com/www.ossblog.org/wp-content/uploads/2017/03/WhysGuideRuby.jpg?resize=200%2C218&ssl=1) + | + +### [Why’s (Poignant) Guide to Ruby][4] + +By why the lucky stiff (176 pages) + +Why’s (poignant) Guide to Ruby is an introductory book to the Ruby programming language. The book includes some wacky humour and goes off-topic on occasions. The book includes jokes that are known within the Ruby community as well as cartoon characters. + +The contents of the book: + +* About this book +* Kon’nichi wa, Ruby +* A Quick (and Hopefully Painless) Ride Through Ruby (with Cartoon Foxes): basic introduction to central Ruby concepts +* Floating Little Leaves of Code: evaluation and values, hashes and lists +* Them What Make the Rules and Them What Live the Dream: case/when, while/until, variable scope, blocks, methods, class definitions, class attributes, objects, modules, introspection in IRB, dup, self, rbconfig module +* Downtown: metaprogramming, regular expressions +* When You Wish Upon a Beard: send method, new methods in existing classes +* Heaven’s Harp + +This book is made available under the Creative Commons Attribution-ShareAlike License. + + | +| + ![Ruby Hacking Guide](https://i1.wp.com/www.ossblog.org/wp-content/uploads/2017/03/RubyHackingGuide.png?resize=200%2C250&ssl=1) + | + +### [Ruby Hacking Guide][5] + +By Minero Aoki – translated by Vincent Isambart and Clifford Escobar Caoille (HTML) + +This book has the following goals: + +* To have knowledge of the structure of Ruby +* To gain knowledge about language processing systems in general +* To acquire skills in reading source code + +This book has four main parts: + +* Objects +* Syntactic analysis +* Evaluation +* Peripheral around the evaluator + +Knowledge about the C language and the basics of object-oriented programming is needed to get the most from the book. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike2.5 license. + +The official support site of the original book is [i.loveruby.net/ja/rhg/][10] + + | +| + ![The Book Of Ruby](https://i1.wp.com/www.ossblog.org/wp-content/uploads/2017/03/BookRuby.jpg?resize=200%2C270&ssl=1) + | + +### [The Book Of Ruby][6] + +By How Collingbourne (425 pages) + +The Book Of Ruby is a free in-depth tutorial to Ruby programming. + +The Book Of Ruby is provided in the form of a PDF document in which each chapter is accompanied by ready-to-run source code for all the examples. There is also an Introduction which explains how to use the source code in Ruby In Steel or any other editor/IDE of your choice plus appendices and an index. It concentrates principally on version 1.8.x of the Ruby language. + +The book is divided up into bite-sized chunks. Each chapter introduces a theme which is subdivided into sub-topics. Each programming topic is accompanied by one or more small self-contained, ready-to-run Ruby programs. + +* Strings, Numbers, Classes, and Objects – getting and putting input, strings and embedded evaluation, numbers, testing a condition: if … then, local and global variables, classes and objects, instance variables, messages, methods and polymorphism, constructors, and inspecting objects +* Class Hierarchies, Attributes, and Class Variables – superclasses and subclasses, passing arguments to the superclass, accessor methods, ‘set’ accessors, attribute readers and writers, calling methods of a superclass, and class variables +* Strings and Ranges – user-defined string delimiters, backquotes, and more +* Arrays and Hashes – shows how to create a list of objects +* Loops and Iterators – for loops, blocks, while loops, while modifiers, and until loops +* Conditional Statements – If..Then..Else, And..Or..Not, If..Elsif, unless, if and unless modifiers, and case statements +* Methods – class methods, class variables, what are class methods for, ruby constructors, singleton methods, singleton classes, overriding methods and more +* Passing Arguments and Returning Values – instance methods, class methods, singleton methods, returning values, returning multiple values, default and multiple arguments, assignment and parameter passing, and more +* Exception Handling – covers rescue, ensure, else, error numbers, retry, and raise +* Blocks, Procs, and Lambdas – explains why they are special to Ruby +* Symbols – symbols and strings, symbols and variables, and why symbols should be used +* Modules and Mixins +* Files and IO – opening and closing files, files and directories, copying files, directory enquiries, a discursion into recursion, and sorting by size +* YAML – includes nested sequences, saving YAML data and more +* Marshal – offers an alternative way of saving and loading data +* Regular Expressions – making matches, match groups, and more +* Threads – shows you how to run more than one task at a time +* Debugging and Testing – covers the interactive ruby shell (IRB.exe), debugging, and unit testing +* Ruby on Rails – goes through a hands-on guide to create a blog +* Dynamic Programming – self-modifying programs, eval magic, special types of eval, adding variables and methods, and more + +The book is distributed by SapphireSteel Software – developers of the Ruby In Steel IDE for Visual Studio. Readers may copy or distribute the text and programs of The Book Of Ruby (free edition). + + | +|   + ![The Little Book of Ruby](https://i0.wp.com/www.ossblog.org/wp-content/uploads/2017/03/TheLittleBookRuby.png?resize=200%2C259&ssl=1) + | + +### [The Little Book Of Ruby][7] + +By Huw Collingbourne (87 pages) + +The Little Book of Ruby is a step-by-step tutorial to programming in Ruby. It guides the reader through the fundamentals of Ruby. It shares content with The Book of Ruby, but aims to be a simpler guide to the main features of Ruby. + +Chapters cover: + +* Strings and Methods – including embedded evaluation. Details the syntax to Ruby methods +* Classes and Objects – explains how to create new types of objects +* Class Hierarchies – a class which is a ‘special  type ’ of some other class simply ‘inherits’ the features of that other class +* Accessors, Attributes, Class Variables – accessor methods, attribute readers and writers, attributes create variables, calling methods of a superclass, and class variables are explored +* Arrays – learn how to create a list of objects: arrays including multi-dimensional arrays, +* Hashes – create, indexing into a hash, and hash operations are covered +* Loops and Iterators – for loops, blocks, while loops, while modifiers, and until loops +* Conditional Statements – If..Then..Else, And..Or..Not, If..Elsif, unless, if and unless modifiers, and case statements +* Modules and Mixins – including module methods, modules as namespaces, module ‘instance methods’, included modules or ‘mixins’, including modules from files, and pre-defined modules +* Saving Files, Moving on.. + +This book can be copied and distributed freely as long as the text is not modified and the copyright notice is retained. + + | +| + ![Kestrels, Quirky Birds, and Hopeless Egocentricity](https://i2.wp.com/www.ossblog.org/wp-content/uploads/2017/03/KestrelsQuirkyBirds.jpeg?resize=200%2C259&ssl=1) + | + +### [Kestrels, Quirky Birds, and Hopeless Egocentricity][8] + +By Reg “raganwald” Braithwaite (123 pages) + +Kestrels, Quirky Birds, and Hopeless Egocentricity collects Reg “Raganwald” Braithwaite’s series of essays about Combinatory Logic, Method Combinators, and Ruby Meta-Programing into a convenient e-book. + +The book provides a gentle introduction to Combinatory Logic, applied using the Ruby programming language. Combinatory Logic is a mathematical notation that is powerful enough to handle set theory and issues in computability. + +In this book, the reader meets some of the standard combinators, and for each one the book explores some of its ramifications when writing programs using the Ruby programming language. In Combinatory Logic, combinators combine and alter each other, and the book’s Ruby examples focus on combining and altering Ruby code. From simple examples like the K Combinator and Ruby’s .tap method, the books works up to meta-programming with aspects and recursive combinators. + +The book is published under the MIT license. + + | +| + ![Ruby Programming](https://i1.wp.com/www.ossblog.org/wp-content/uploads/2017/03/RubyProgrammingWikibooks.png?resize=200%2C285&ssl=1) + | + +### [Ruby Programming][9] + +By Wikibooks.org (261 pages) + +Ruby is an interpreted, object-oriented programming language. + +The book is broken down into several sections and is intended to be read sequentially. + +* Getting started – shows users how to install and begin using Ruby in an environment +* Basic Ruby – explains the main features of the syntax of Ruby. It covers, amongst other things, strings, encoding, writing methods, classes and objects, and exceptions +* Ruby Semantic reference +* Built in classes +* Available modules covers some of the standard library +* Intermediate Ruby covers a selection of slightly more advanced topics + +This book is published under the Creative Commons Attribution-ShareAlike 3.0 Unported license. + + | + +* * * + +In no particular order, I’ll close with useful free-to-download Ruby programming books which are not released under an open source license. + +* [Mr. Neighborly’s Humble Little Ruby Book][11] – an easy to read, easy to follow guide to all things Ruby. +* [Introduction to Programming with Ruby][12] – learn the basic foundational building blocks of programming, starting from the very beginning +* [Object Oriented Programming with Ruby][13] – learn the basic foundational building blocks of object oriented programming, starting from the very beginning +* [Core Ruby Tools][14] – provides a short tour of four core Ruby tools: Gems, Ruby Version Managers, Bundler, and Rake. +* [Learn Ruby the Hard Way, 3rd Edition][15] – a simple book designed to start your programming adventures +* [Learn to Program][16] – by Chris Pine +* [Ruby Essentials][17] – designed to provide a concise and easy to follow guide to learning Ruby. + +-------------------------------------------------------------------------------- + +via: https://www.ossblog.org/study-ruby-programming-with-open-source-books/ + +作者:[Steve Emms ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.ossblog.org/author/steve/ +[1]:https://github.com/practicingruby/rbp-book/tree/gh-pages/pdfs +[2]:https://mindaslab.github.io/I-Love-Ruby/ +[3]:http://ruby-doc.com/docs/ProgrammingRuby/ +[4]:http://poignant.guide/ +[5]:http://ruby-hacking-guide.github.io/ +[6]:http://www.sapphiresteel.com/ruby-programming/The-Book-Of-Ruby.html +[7]:http://www.sapphiresteel.com/ruby-programming/The-Book-Of-Ruby.html +[8]:https://leanpub.com/combinators +[9]:https://en.wikibooks.org/wiki/Ruby_Programming +[10]:http://i.loveruby.net/ja/rhg/ +[11]:http://www.humblelittlerubybook.com/ +[12]:https://launchschool.com/books/ruby +[13]:https://launchschool.com/books/oo_ruby +[14]:https://launchschool.com/books/core_ruby_tools +[15]:https://learnrubythehardway.org/book/ +[16]:https://pine.fm/LearnToProgram +[17]:http://www.techotopia.com/index.php/Ruby_Essentials +[18]:https://www.ossblog.org/opensourcebooks/ From 4b9b912aaaee7de6d702c62d0e5f1e090016023a Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 31 Mar 2017 09:30:27 +0800 Subject: [PATCH 049/241] =?UTF-8?q?PUB:20170111=20Join=20an=20Additional?= =?UTF-8?q?=20Ubuntu=20DC=20to=20Samba4=20AD=20DC=20for=20FailOver=20Repli?= =?UTF-8?q?cation=20=E2=80=93=20Part=205.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @rusking --- ...AD DC for FailOver Replication – Part 5.md | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) rename {translated/tech => published}/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md (82%) diff --git a/translated/tech/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md b/published/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md similarity index 82% rename from translated/tech/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md rename to published/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md index 6bdbbc5992..7ff2bb4169 100644 --- a/translated/tech/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md +++ b/published/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md @@ -1,16 +1,19 @@ -将另一台 Ubuntu DC 服务器加入到 Samba4 AD DC 实现双域控主机模式 ——(五) +Samba 系列(五):将另一台 Ubuntu DC 服务器加入到 Samba4 AD DC 实现双域控主机模式 ============================================================ 这篇文章将讲解如何使用 **Ubuntu 16.04** 服务器版系统来创建第二台 **Samba4** 域控制器,并将其加入到已创建好的 **Samba AD DC** 林环境中,以便为一些关键的 AD DC 服务提供负载均衡及故障切换功能,尤其是为那些重要的服务,比如 DNS 服务和使用 SAM 数据库的 AD DC LDAP 模式。 #### 需求 -1、 这篇文章是 **Samba4 AD DC** 系列的第**五**篇,前边几篇如下: +这篇文章是 **Samba4 AD DC** 系列的第**五**篇,前边几篇如下: -[在 Ubuntu16.04 系统上使用 Samba4 软件来创建活动目录架构(一)][1] -[在 Linux 命令行下管理 Samba4 AD 架构(二)][2] -[使用 Windows 10 系统的 RSAT 工具来管理 Samba4 活动目录架构 (三)][3] -[在 Windows 系统下管理 Samba4 AD 域管制器 DNS 和组策略(四)][4] +1、[在 Ubuntu16.04 系统上使用 Samba4 软件来创建活动目录架构(一)][1] + +2、[在 Linux 命令行下管理 Samba4 AD 架构(二)][2] + +3、[使用 Windows 10 系统的 RSAT 工具来管理 Samba4 活动目录架构 (三)][3] + +4、[在 Windows 系统下管理 Samba4 AD 域管制器 DNS 和组策略(四)][4] ### 第一步:为设置 Samba4 进行初始化配置 @@ -24,7 +27,7 @@ # hostnamectl set-hostname adc2 ``` -或者你也可以手动编辑 **/etc/hostname** 文件,在新的一行输入你想设置的主机名。 +或者你也可以手动编辑 `/etc/hostname` 文件,在新的一行输入你想设置的主机名。 ``` # nano /etc/hostname @@ -55,11 +58,11 @@ IP_of_main_DC FQDN_of_main_DC short_name_of_main_DC *为 Samba4 AD DC 服务器设置主机名* -3、下一步,打开 **/etc/network/interfaces** 配置文件并设置一个静态 IP 地址,如下图所示: +3、下一步,打开 `/etc/network/interfaces` 配置文件并设置一个静态 IP 地址,如下图所示: -注意 **dns-nameservers** 和 **dns-search** 这两个参数的值。为了使 DNS 解析正常工作,需要把这两个值设置成主 Samba4 AD DC 服务器的 IP 地址和域名。 +注意 `dns-nameservers` 和 `dns-search` 这两个参数的值。为了使 DNS 解析正常工作,需要把这两个值设置成主 Samba4 AD DC 服务器的 IP 地址和域名。 -重启网卡服务以让修改的配置生效。检查 **/etc/resolv.conf** 文件,确保该网卡上配置的这两个 DNS 的值已更新到这个文件。 +重启网卡服务以让修改的配置生效。检查 `/etc/resolv.conf` 文件,确保该网卡上配置的这两个 DNS 的值已更新到这个文件。 ``` # nano /etc/network/interfaces @@ -90,7 +93,7 @@ dns-search tecmint.lan *配置 Samba4 AD 服务器的 DNS* -当你通过简写名称(用于构建 FQDN 名)查询主机名时, **dns-search** 值将会自动把域名添加上。 +当你通过简写名称(用于构建 FQDN 名)查询主机名时, `dns-search` 值将会自动把域名添加上。 4、为了测试 DNS 解析是否正常,使用一系列 ping 命令测试,命令后分别为简写名, FQDN 名和域名,如下图所示: @@ -108,7 +111,7 @@ dns-search tecmint.lan # apt-get install ntpdate ``` -6、假设你想手动强制本地服务器与 **samba4 AD DC** 服务器时间同步,使用 **ntpdate** 命令加上主域控服务器的主机名,如下所示: +6、假设你想手动强制本地服务器与 **samba4 AD DC** 服务器时间同步,使用 `ntpdate` 命令加上主域控服务器的主机名,如下所示: ``` # ntpdate adc1 @@ -121,7 +124,7 @@ dns-search tecmint.lan ### 第 2 步:安装 Samba4 必须的依赖包 -7、为了让 **Ubuntu 16.04** 系统加入到你的域中,你需要通过下面的命令从 Ubuntu 官方软件库中安装 **Samba4 套件, Kerberos** 客户端和其它一些重要的软件包以便将来使用: +7、为了让 **Ubuntu 16.04** 系统加入到你的域中,你需要通过下面的命令从 Ubuntu 官方软件库中安装 **Samba4 套件、 Kerberos 客户端** 和其它一些重要的软件包以便将来使用: ``` # apt-get install samba krb5-user krb5-config winbind libpam-winbind libnss-winbind @@ -132,7 +135,7 @@ dns-search tecmint.lan *在 Ubuntu 系统中安装 Samba4* -8、在安装的过程中,你需要提供 Kerberos 域名。输入大写的域名然后按 [Enter] 键完成安装过程。 +8、在安装的过程中,你需要提供 Kerberos 域名。输入大写的域名然后按回车键完成安装过程。 [ ![Configure Kerberos Authentication for Samba4](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-Kerberos-Authentication-for-Samba4.png) @@ -140,7 +143,7 @@ dns-search tecmint.lan *为 Samba4 配置 Kerberos 认证* -9、所有依赖包安装完成后,通过使用 kinit 命令为域管理员请求一个 Kerberos 票据以验证设置是否正确。使用 klist 命令来列出已授权的 kerberos 票据信息。 +9、所有依赖包安装完成后,通过使用 `kinit` 命令为域管理员请求一个 Kerberos 票据以验证设置是否正确。使用 `klist` 命令来列出已授权的 kerberos 票据信息。 ``` # kinit domain-admin-user@YOUR_DOMAIN.TLD @@ -161,7 +164,7 @@ dns-search tecmint.lan # mv /etc/samba/smb.conf /etc/samba/smb.conf.initial ``` -11、在准备加入域前,先启动 **samba-ad-dc** 服务,之后使用域管理员账号运行 **samba-tool** 命令将服务器加入到域。 +11、在准备加入域前,先启动 **samba-ad-dc** 服务,之后使用域管理员账号运行 `samba-tool` 命令将服务器加入到域。 ``` # samba-tool domain join your_domain -U "your_domain_admin" @@ -170,10 +173,10 @@ dns-search tecmint.lan 加入域过程部分截图: ``` -# samba-tool domain join tecmint.lan DC -U"tecmint_user" +# samba-tool domain join tecmint.lan DC -U "tecmint_user" ``` -##### 输出示例 +输出示例: ``` Finding a writeable DC for domain 'tecmint.lan' @@ -242,7 +245,7 @@ Joined domain TECMINT (SID S-1-5-21-715537322-3397311598-55032968) as a DC # nano /etc/samba/smb.conf ``` -添加以下内容到 smb.conf 配置文件中。 +添加以下内容到 `smb.conf` 配置文件中。 ``` dns forwarder = 192.168.1.1 @@ -255,7 +258,7 @@ winbind enum users = yes winbind enum groups = yes ``` -使用你自己的 **DNS forwarder IP** 地址替换掉上面地址。 Samba 将会把域权威区之外的所有 DNS 解析查询转发到这个 IP 地址。 +使用你自己的 **DNS 转发器 IP** 地址替换掉上面 `dns forwarder` 地址。 Samba 将会把域权威区之外的所有 DNS 解析查询转发到这个 IP 地址。 13、最后,重启 samba 服务以使修改的配置生效,然后执行如下命令来检查活动目录复制功能是否正常。 @@ -270,9 +273,9 @@ winbind enum groups = yes *配置 Samba4 DNS* -14、另外,还需要重命名原来的 /etc 下的 kerberos 配置文件,并使用在加入域的过程中 Samba 生成的新配置文件 krb5.conf 替换它。 +14、另外,还需要重命名原来的 `/etc `下的 kerberos 配置文件,并使用在加入域的过程中 Samba 生成的新配置文件 krb5.conf 替换它。 -Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linux 的符号链接将该文件链接到 /etc 目录。 +Samba 生成的新配置文件在 `/var/lib/samba/private` 目录下。使用 Linux 的符号链接将该文件链接到 `/etc` 目录。 ``` # mv /etc/krb6.conf /etc/krb5.conf.initial @@ -285,7 +288,7 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu *配置 Kerberos* -15、同样,使用 samba 的 **krb5.conf** 配置文件验证 Kerberos 认证是否正常。通过以下命令来请求一个管理员账号的票据并且列出已缓存的票据信息。 +15、同样,使用 samba 的 `krb5.conf` 配置文件验证 Kerberos 认证是否正常。通过以下命令来请求一个管理员账号的票据并且列出已缓存的票据信息。 ``` # kinit administrator @@ -299,7 +302,7 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu ### 第 4 步:验证其它域服务 -16、你首先要做的一个测试就是验证 **Samba4 DC DNS** 解析服务是否正常。要验证域 DNS 解析情况,使用 host 命令,加上一些重要的 AD DNS 记录,进行域名查询,如下图所示: +16、你首先要做的一个测试就是验证 **Samba4 DC DNS** 解析服务是否正常。要验证域 DNS 解析情况,使用 `host` 命令,加上一些重要的 AD DNS 记录,进行域名查询,如下图所示: 每一次查询,DNS 服务器都应该返回两个 IP 地址。 @@ -322,15 +325,15 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu *通过 Windows RSAT 工具来验证 DNS 记录* -18、下一个验证是检查域 LDAP 复制同步是否正常。使用 **samba-tool** 工具,在第二个域控制器上创建一个账号,然后检查该账号是否自动同步到第一个 Samba4 AD DC 服务器上。 +18、下一个验证是检查域 LDAP 复制同步是否正常。使用 `samba-tool` 工具,在第二个域控制器上创建一个账号,然后检查该账号是否自动同步到第一个 Samba4 AD DC 服务器上。 -##### On adc2: +在 adc2 上: ``` # samba-tool user add test_user ``` -##### On adc1: +在 adc1 上: ``` # samba-tool user list | grep test_user @@ -349,7 +352,7 @@ Samba 生成的新配置文件在 /var/lib/samba/private 目录下。使用 Linu 19、你也可以从 **Microsoft AD DC** 控制台创建一个账号,然后验证该账号是否都出现在两个域控服务器上。 -默认情况下,这个账号都应该在两个 samba 域控制器上自动创建完成。在 `adc1` 服务器上使用 **wbinfo** 命令查询该账号名。 +默认情况下,这个账号都应该在两个 samba 域控制器上自动创建完成。在 `adc1` 服务器上使用 `wbinfo` 命令查询该账号名。 [ ![Create Account from Microsoft AD UC](http://www.tecmint.com/wp-content/uploads/2017/01/Create-Account-from-Microsoft-AD-UC.png) From 1843f5bb193176546e0510c778cd4f70513cc4a7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 31 Mar 2017 10:31:35 +0800 Subject: [PATCH 050/241] translated --- .../20170323 3 open source link shorteners.md | 86 ------------------- .../20170323 3 open source link shorteners.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 86 deletions(-) delete mode 100644 sources/tech/20170323 3 open source link shorteners.md create mode 100644 translated/tech/20170323 3 open source link shorteners.md diff --git a/sources/tech/20170323 3 open source link shorteners.md b/sources/tech/20170323 3 open source link shorteners.md deleted file mode 100644 index 4849e57d9a..0000000000 --- a/sources/tech/20170323 3 open source link shorteners.md +++ /dev/null @@ -1,86 +0,0 @@ -translating---geekpi - -3 open source link shorteners -============================================================ - -> Want to build your own URL shortener? These open source projects make it easy. - - ![3 open source link shorteners](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/links.png?itok=AumNmse7 "3 open source link shorteners") ->Image by : [Paul Lewin][2]. Modified by Opensource.com. [CC BY-SA 2.0][3] - -Nobody likes an impossibly long URL. - -They're hard to decipher. But sometimes, between a deep directory structure on a site, plus a large number of parameters tacked on to the end, URLs just begin to get unwieldy. And back in the days before Twitter added their own link shortener to their service, a long URL meant taking precious characters away from your tweets. - -Today, people use link shorteners for a slew of reasons. They can make it much easier to type, or remember, an otherwise lengthy bare URL. They can bring a consistent branding to a social media account. They make it easier to perform analytics across a group of URLs. They make it possible to provide a consistent entryway to a URL that may change frequently on the other side. - -There are some challenges to URL shorteners, to be sure. They make it challenging to figure out where a link is actually taking you before you click, and they're vulnerable to [linkrot][4], should the service providing the short URL for you ever disappear. But despite these challenges, URL shorteners aren't going anywhere anytime soon. - -But with so many free link shortening services out there, why roll your own? In short: control. While some services will let you pick your own domain to use, sometimes, that's about the level of customization you're going to get. With a self-hosted service, you decide how long your service operates for. You decide what format your URLs take. You decide who has access to your analytics. It's yours to own and operate as you please. - -Fortunately, there are many open source options out there if you want to build the next bit.ly, goo.gl, or ow.ly yourself. Here are a few you might consider. - -### Lessn More - -[Lessn More][5] is a personal URL shortener, built in PHP and forked off of an older project called Buttered URLs, which itself was derived from a fork of a project called Lessn. Lessn More provides most of the features you would expect from a URL shortener: API and bookmarklet support, custom URLs, etc. Some helpful features that set Lessn More apart are the ability to use a banned-words list to avoid creating an accidentally-inappropriate URL, the ability to avoid "lookalike" characters to make URLs more readable, the ability to choose whether or not to use mixed-case characters, and a few other helpful features. - -[Lessn More][6] provides its [source code][7] on GitHub under a 3-clause [BSD][8] license. - -### Polr - -[Polr][9] describes itself as a "modern, powerful, and robust URL shortener." It has a fairly straight-forward but modern interface, and like our other options detailed here comes with an API to allow you to use it from within other programs. Of the three presented here, it's the lightest on features, but if you're looking for a simple but functional option it may be a good choice for you. Check out the [online demo][10] before you download. - -The [source code][11] for Polr can be found on GitHub under a [GPLv2][12] license. - -### YOURLS - -[YOURLS][13], short for Your Own URL Shortener, is the option I am most familiar with. In full disclosure, I ran it for several years in production on a personal site, and was very happy with its capabilities. - -Written in PHP, YOURLS is a pretty feature-rich option that works well out of the box. You can configure it to be publicly usable by anyone, or only allow certain users to use it. It supports custom URLs, comes with a bookmarklet to make sharing easy, has pretty robust built-in stats, and supports a pluggable architecture to allow others to add to it. It also has an API, making it easy to create other programs which interface with it. - -You can find the [source code][14] for YOURLS on GitHub under an [MIT license][15]. - -* * * - -Don't like any of these options? Take a look around the Internet and you can find several other choices: [shuri][16], [Nimbus][17], [Lstu][18], and many others. And beyond the options already available, building a link shortener is a good first programming project to get to know a new language or web framework. After all, the core functionality is very simple: Take a URL as input, and issue a redirect to another URL. Beyond that, it's up to you what bells and whistles to add. - -Do you have a favorite we didn't list here? Let us know in the comments below - --------------------------------------------------------------------------------- - -作者简介: - -Jason Baker - Jason is passionate about using technology to make the world more open, from software development to bringing sunlight to local governments. Linux desktop enthusiast. Map/geospatial nerd. Raspberry Pi tinkerer. Data analysis and visualization geek. Occasional coder. Cloud nativist. Follow him on Twitter. - ------------- - -via: https://opensource.com/article/17/3/url-link-shortener - -作者:[Jason Baker ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jason-baker -[1]:https://opensource.com/article/17/3/url-link-shortener?rate=5EGysFmjsUsxCc74bffDni4sFxxaIYiGRUG3UPznav8 -[2]:https://www.flickr.com/photos/digypho/7905320090 -[3]:https://creativecommons.org/licenses/by/2.0/ -[4]:https://en.wikipedia.org/wiki/Linkrot -[5]:https://lessnmore.net/ -[6]:https://lessnmore.net/ -[7]:https://github.com/alanhogan/lessnmore -[8]:https://github.com/alanhogan/lessnmore/blob/master/LICENSE.txt -[9]:https://project.polr.me/ -[10]:http://demo.polr.me/ -[11]:https://github.com/cydrobolt/polr -[12]:https://github.com/cydrobolt/polr/blob/master/LICENSE -[13]:https://yourls.org/ -[14]:https://github.com/YOURLS/YOURLS -[15]:https://github.com/YOURLS/YOURLS/blob/master/LICENSE.md -[16]:https://github.com/pips-/shuri -[17]:https://github.com/ethanal/nimbus -[18]:https://github.com/ldidry/lstu -[19]:https://opensource.com/user/19894/feed -[20]:https://opensource.com/article/17/3/url-link-shortener#comments -[21]:https://opensource.com/users/jason-baker diff --git a/translated/tech/20170323 3 open source link shorteners.md b/translated/tech/20170323 3 open source link shorteners.md new file mode 100644 index 0000000000..2980bd43f1 --- /dev/null +++ b/translated/tech/20170323 3 open source link shorteners.md @@ -0,0 +1,84 @@ +3 个开源链接缩短器 +============================================================ + +> 想要构建你自己的 URL 缩短器?这些开源项目使这个变得简单。 + + ![3 open source link shorteners](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/links.png?itok=AumNmse7 "3 open source link shorteners") +>图片提供: [Paul Lewin][2]. Modified by Opensource.com. [CC BY-SA 2.0][3] + +没有人喜欢一个非常长的URL。 + +他们很难解析。但有时候,站点的深层目录结构还有最后加上的大量参数使得 URL 开始变得冗长。在 Twitter 添加自己的链接缩短服务之前的那些日子里,一个长的 URL 意味着从推文中消减珍贵的字符。 + +如今,因为很多原因,人们开始使用链接缩短器。这样人们可以更容易地输入或记住另一个冗长的网址。它们可以为社交媒体帐户带来一贯的品牌建设。它们可以更轻松地在一组网址中进行分析。它们使得为其他网站频繁变化的 URL 提供统一的入口成为可能。 + +URL 缩短器确实有一些挑战。应该为你提供短网址服务也会消失,这使得在点击之前知道链接实际指向哪里也是一个挑战,并且容易受到 [linkrot][4] 的影响。但是尽管面临这些挑战,URL 缩短器不会消失。 + +但是,既然已经有这么多免费链接缩短服务,为什么还要自己构建?简而言之:方便控制。虽然有些服务可以让你选择自己的域名来使用,有时候这有关于你会得到定制级别。使用自助式服务,你可以自己决定服务的运行时间、URL 的格式以及决定谁可以访问你的分析。这是你自己拥有并且可以操作的。 + +幸运的是,如果你想建立下一个 bit.ly、goo.gl或 ow.ly,你可以有很多开源选项。你可以考虑下面几个。 + +### Lessn More + +[Lessn More][5]是一个个人 URL 缩短器,用 PHP 写成,并从一个名为 Buttered URL 的较旧项目 fork 而来,而它又是一个名为 Lessn 的项目的分支衍生而来。Lessn More 能提供你对 URL 缩短器预期的大部分功能:API 和书签支持、自定义 URL 等。还有一些有用的功能比如可以让 Lessn More 使用单词黑名单来避免创建意外不适当的 URL、避免“看着相似”的字符来使 URL 更易读、能够选择是否使用混合大小写的字符等。 + +[Lessn More][6] 在 GitHub 上以 3 句版 [BSD][8]许可证公布了 [源代码][7]。 + +### Polr + +[Polr][9] 将自己描述为“现代、强大、可靠的URL缩短器”。它具有相当直接但现代化的界面,像我们这里详细介绍的其他选择那样还提供了一个 API 来允许你从其他程序中使用它。在这三个选择中,它在功能上是最轻的,但如果你正在寻找一个简单但功能完整的选择,那么这可能是你不错的选择。下载之前你可以查看[在线演示][10]。 + +Polr 的[源代码][11] 在 GitHub 中以 [GPLv2][12] 许可证公布。 + +### YOURLS + +[YOURLS][13],“Your Own URL Shortener”(你自己的 URL 缩短器)的缩写,它是我最熟悉的选择。我在个人网站上已经运行了好几年,并且对其功能非常满意。 + +它是用 PHP 编写的,YOURLS 是一个有非常丰富功能的选择并且可以很好地开箱即用。你可以将其配置为任何人可公开使用,或只允许某些用户使用它。它支持自定义 URL,拥有书签功能使得很容易共享,它还具有非常强大的内置统计信息,并支持可插拔的架构,以允许其他人添加功能。它还有一个API,可以轻松地用它创建其他程序。 + +你可以在 Github 中找到 [MIT许可证][15]下的 YOURLS 的[源代码][14]。 + +* * * + +不喜欢这些选择么?看下互联网,你会发现还有其他几个选择:[shuri][16]、[Nimbus][17]、[Lstu][18] 等等。除了这些选择外,构建链接缩短器也是一个很好的第一个编程项目,它可以帮助了解新的语言或 Web 框架。毕竟,它的核心功能非常简单:以 URL 作为输入,并重定向到另一个 URL。除此之外,它取决于你自己想要添加的功能。 + +你有我们没有在这里列出的最爱吗?在评论栏中让我们知道你的想法。 + +-------------------------------------------------------------------------------- + +作者简介: + +Jason Baker - Jason 热衷于使用技术使世界更加开放,从软件开发到阳光政府行动。Linux 桌面爱好者、地图/地理空间爱好者、树莓派工匠、数据分析和可视化极客、偶尔的码农、云本土主义者。在 Twitter 上关注他。 + +------------ + +via: https://opensource.com/article/17/3/url-link-shortener + +作者:[Jason Baker ][a] +译者:[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 +[1]:https://opensource.com/article/17/3/url-link-shortener?rate=5EGysFmjsUsxCc74bffDni4sFxxaIYiGRUG3UPznav8 +[2]:https://www.flickr.com/photos/digypho/7905320090 +[3]:https://creativecommons.org/licenses/by/2.0/ +[4]:https://en.wikipedia.org/wiki/Linkrot +[5]:https://lessnmore.net/ +[6]:https://lessnmore.net/ +[7]:https://github.com/alanhogan/lessnmore +[8]:https://github.com/alanhogan/lessnmore/blob/master/LICENSE.txt +[9]:https://project.polr.me/ +[10]:http://demo.polr.me/ +[11]:https://github.com/cydrobolt/polr +[12]:https://github.com/cydrobolt/polr/blob/master/LICENSE +[13]:https://yourls.org/ +[14]:https://github.com/YOURLS/YOURLS +[15]:https://github.com/YOURLS/YOURLS/blob/master/LICENSE.md +[16]:https://github.com/pips-/shuri +[17]:https://github.com/ethanal/nimbus +[18]:https://github.com/ldidry/lstu +[19]:https://opensource.com/user/19894/feed +[20]:https://opensource.com/article/17/3/url-link-shortener#comments +[21]:https://opensource.com/users/jason-baker From 3ebf93de7f59086660c0fe1ce600640fb6139604 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 31 Mar 2017 10:54:43 +0800 Subject: [PATCH 051/241] PRF:20151127 5 ways to change GRUB background in Kali Linux.md @fuowang --- ...to change GRUB background in Kali Linux.md | 63 +++++++++---------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md b/translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md index 680562cf97..7dea6c408a 100644 --- a/translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md +++ b/translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md @@ -1,17 +1,16 @@ 在 Kali Linux 中更改 GRUB 背景的 5 种方式 ============================================================ - -这是一个关于如何在Kali Linux中更改GRUB背景的简单指南(实际上它是 Kali Linux 的 - GRUB 启动图像)。 Kali 开发团队在这方面做的不多,他们好像太忙了,所以在这篇文章中,我会解释一下关于GRUB两方面中的其中一个,我愿意写是因为这篇文章不会冗长而无聊! 那么我们开始吧…… +这是一个关于如何在 Kali Linux 中更改 GRUB 背景的简单指南(实际上它是 Kali Linux 的 + GRUB 启动图像)。 Kali 开发团队在这方面做的不多,他们好像太忙了,所以在这篇文章中,我会对 GRUB 解释一二,但是不会冗长到我失去写作的激情。 那么我们开始吧…… [ ![Change GRUB background in Kali Linux - blackMORE OPs -10](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-10.jpg) ][10] -### 查找GRUB设置 +### 查找 GRUB 设置 -这通常是所有人首先会遇到的一个问题,在哪里设置?有很多方法来查找GRUB设置。每个人都可能有自己的方法,但我发现 `update-grub` 是最简单的。如果在 VMWare 或 VirtualBox 中执行 `update-grub`,你将看到如下所示的内容: +这通常是所有人首先会遇到的一个问题,在哪里设置?有很多方法来查找 GRUB 设置。每个人都可能有自己的方法,但我发现 `update-grub` 是最简单的。如果在 VMWare 或 VirtualBox 中执行 `update-grub`,你将看到如下所示的内容: ``` root@kali:~# update-grub @@ -24,7 +23,7 @@ done root@kali:~# ``` -如果您是双系统,或者三系统,那么您将看到 GRUB 进入查找其他操作系统。然而,我们感兴趣的部分是背景图像,这是在我这里看到的(你会看到完全相同的内容): +如果您是双系统,或者三系统,那么您将看到 GRUB 以及其他操作系统入口。然而,我们感兴趣的部分是背景图像,这是在我这里看到的(你会看到完全相同的内容): ``` Found background image: /usr/share/images/desktop-base/desktop-grub.png @@ -32,18 +31,18 @@ Found background image: /usr/share/images/desktop-base/desktop-grub.png ### GRUB 启动图像搜索顺序 -在 grub-2.02 中,它将按照以下顺序搜索基于 Debian 的系统的启动背景: +在 grub-2.02 中,对基于 Debian 的系统来说,它将按照以下顺序搜索启动背景: -1. `/etc/default/grub` 里的 GRUB_BACKGROUND 行  -2. 在 `/boot/grub/` 里找到的第一个图像(如果发现多张,将以字母顺序排序) -3. 在`/usr/share/desktop-base/grub_background.sh` 中指定的 -4. 在`/etc/grub.d/05_debian_theme` 里 WALLPAPER 行列出的 +1. `/etc/default/grub` 里的 `GRUB_BACKGROUND` 行  +2. 在 `/boot/grub/` 里找到的第一个图像(如果发现多张,将以字母顺序排序) +3. 在 `/usr/share/desktop-base/grub_background.sh` 中指定的 +4. 在 `/etc/grub.d/05_debian_theme` 里 `WALLPAPER` 行列出的 -现在将此信息挂在这里,我们会尽快重新检查它。 +现在将此信息留在这里,我们会尽快重新检查它。 ### Kali Linux GRUB 启动图像 -在我使用 Kali Linux 时(因为我喜欢用它做事),我们发现 Kali 正在使用这里的背景图像:`/usr/share/images/desktop-base/desktop-grub.png` +在我使用 Kali Linux 时(因为我喜欢用它做事),会发现 Kali 正在使用这里的背景图像:`/usr/share/images/desktop-base/desktop-grub.png` 为了确定,我们来检查一下这个 `.png` 文件的属性。 @@ -71,7 +70,7 @@ root@kali:~# ![Change GRUB background in Kali Linux - blackMORE OPs -3](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-3.jpg) ][12] -好吧,真让人费解。 `/etc/alternatives/desktop-grub` 也是一个符号链接,它指向 `/usr/share/images/desktop-base/kali-grub.png`,来自最初同样的文件夹。呃! 这就是我能说的。 但是现在我们至少可以替换该文件并将其解决。 +好吧,真让人费解。 `/etc/alternatives/desktop-grub` 也是一个符号链接,它指向 `/usr/share/images/desktop-base/kali-grub.png`,来自最初同样的文件夹。呃! 无语。 但是现在我们至少可以替换该文件并将其解决。 在替换之前,我们需要检查 `/usr/share/images/desktop-base/kali-grub.png` 的属性,以确保下载相同类型和大小的文件。 @@ -88,10 +87,10 @@ root@kali:~# 可以使用 `PNG`, `JPG`/`JPEG` 以及 `TGA` 类型的图像文件作为 GRUB 2 的背景。必须符合以下规范: -* `JPG`/`JPEG` 图像必须是 `8-bit` (`256 color`) +* `JPG`/`JPEG` 图像必须是 `8-bit` (256 色) * 图像应该是非索引的,`RGB` -默认情况下,如果安装了 `desktop-base` 软件包,符合上述规范的图像将位于 `/usr/share/images/desktop-base/` 目录中。在谷歌上很容易找到类似的文件。我也找了一个。 +默认情况下,如果安装了 `desktop-base` 软件包,符合上述规范的图像将放在 `/usr/share/images/desktop-base/` 目录中。在谷歌上很容易找到类似的文件。我也找了一个。 ``` root@kali:~# @@ -104,7 +103,7 @@ root@kali:~# ![Change GRUB background in Kali Linux - blackMORE OPs -6](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-6.jpg) ][13] -### 选项1:替换图像 +### 方式 1:替换图像 现在我们只需简单的用新文件将 `/usr/share/images/desktop-base/kali-grub.png` 替换掉。值得注意这是最简单的方法,不需要修改 `grub-config` 文件。 如果你对 GRUB 很熟,建议你简单的修改 GRUB 的默认配置文件,然后执行 `update-grub`。 @@ -132,7 +131,7 @@ root@kali:~# ![Change GRUB background in Kali Linux - blackMORE OPs -5](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-5.jpg) ][15] -最后执行命令 `update-grub` +最后执行命令 `update-grub`: ``` root@kali:~# update-grub @@ -157,26 +156,26 @@ root@kali:~# ![Change GRUB background in Kali Linux - blackMORE OPs -9](http://www.blackmoreops.com/wp-content/uploads/2015/11/Change-GRUB-background-in-Kali-Linux-blackMORE-OPs-9.jpg) ][17] -这是最简单最安全的办法,最糟不过在 GRUB 看到一个蓝色的背景,但你依然可以登录后修复他们。现在如果你有信心,让我们尝试一个改变 GRUB 设置的更好的方法(有点复杂)。后续步骤更加有趣,而且可以在任何使用 GRUB 引导的 Linux 上使用。 +这是最简单最安全的办法,最糟的情况也不过是在 GRUB 看到一个蓝色的背景,但你依然可以登录后修复它们。现在如果你有信心,让我们尝试一个改变 GRUB 设置的更好的方法(有点复杂)。后续步骤更加有趣,而且可以在任何使用 GRUB 引导的 Linux 上使用。 现在回忆一下 GRUB 在哪 4 个地方寻找启动背景图像?再看一遍: -1. `/etc/default/grub` 里的 GRUB_BACKGROUND 行  -2. 在 `/boot/grub/` 里找到的第一个图像(如果发现多张,将以字母顺序排序) -3. 在`/usr/share/desktop-base/grub_background.sh` 中指定的 -4. 在`/etc/grub.d/05_debian_theme` 里 WALLPAPER 行列出的 +1. `/etc/default/grub` 里的 `GRUB_BACKGROUND` 行  +2. 在 `/boot/grub/` 里找到的第一个图像(如果发现多张,将以字母顺序排序) +3. 在 `/usr/share/desktop-base/grub_background.sh` 中指定的 +4. 在 `/etc/grub.d/05_debian_theme` 里 WALLPAPER 行列出的 那么我们再在 Kali Linux 上(或任意使用 GRUB2 的 Linux系统)试一下新的选择。 -### 选项2:在 GRUB_BACKGROUND 中定义图像路径 +### 方式 2:在 GRUB_BACKGROUND 中定义图像路径 -所以你可以根据优先级使用上述任一项,将 GRUB 背景图像改为自己的。以下是我自己系统上  `/etc/default/grub` 的内容。 +所以你可以根据上述的查找优先级使用上述任一项,将 GRUB 背景图像改为自己的。以下是我自己系统上  `/etc/default/grub` 的内容。 ``` root@kali:~# vi /etc/default/grub ``` -按照 GRUB_BACKGROUND=”/root/World-Map.jpg” 的格式添加一行,其中 World-Map.jpg 是你要作为 GRUB 背景的图像文件。 +按照 `GRUB_BACKGROUND="/root/World-Map.jpg"` 的格式添加一行,其中 World-Map.jpg 是你要作为 GRUB 背景的图像文件。 ``` # If you change this file, run 'update-grub' afterwards to update @@ -208,15 +207,15 @@ root@kali:~# 现在重启机器,你会在 GRUB 看到自定义的图像。 -### 选项3:把图像文件放到 /boot/grub/ 文件夹 +### 方式 3:把图像文件放到 /boot/grub/ 文件夹 -如果没有在 `/etc/default/grub` 文件中指定 `GRUB_BACKGROUND` 项,理论上 GRUB 应当使用在 `/boot/grub/` 文件夹找到的第一个图像文件作为背景。如果 GRUB 在 /boot/grub/ 找到多个图像文件,它会按字母排序并使用第一个图像文件。 +如果没有在 `/etc/default/grub` 文件中指定 `GRUB_BACKGROUND` 项,理论上 GRUB 应当使用在 `/boot/grub/` 文件夹找到的第一个图像文件作为背景。如果 GRUB 在 `/boot/grub/` 找到多个图像文件,它会按字母排序并使用第一个图像文件。 -### 选项4:在 grub_background.sh 指定图像路径 +### 方式 4:在 grub_background.sh 指定图像路径 -如果没有在 `/etc/default/grub` 文件中指定 `GRUB_BACKGROUND` 项,而且 `/boot/grub/` 目录下没有图像文件,GRUB 将会开始在 `/usr/share/desktop-base/grub_background.sh` 文件中指定的图像路径搜索。Kali Linux 是在这里指定的。每个 Linux 发行版都有自己的特色。 +如果没有在 `/etc/default/grub` 文件中指定 `GRUB_BACKGROUND` 项,而且 `/boot/grub/` 目录下没有图像文件,GRUB 将会开始在 `/usr/share/desktop-base/grub_background.sh` 文件中指定的图像路径中搜索。Kali Linux 是在这里指定的。每个 Linux 发行版都有自己的特色。 -### 选项5:在 /etc/grub.d/05_debian_theme 文件的 WALLPAPER 一行指定图像 +### 方式 5:在 /etc/grub.d/05\_debian\_theme 文件的 WALLPAPER 一行指定图像 这是 GRUB 搜寻背景图像的最后一个位置。如果在其他部分都没有找到,它将会在这里查找。 @@ -230,7 +229,7 @@ via: https://www.blackmoreops.com/2015/11/27/change-grub-background-in-kali-linu 作者:[https://www.blackmoreops.com/][a] 译者:[fuowang](https://github.com/fuowang) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 19171cfb43caf9a76504140aaebbdab6224c1b50 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 31 Mar 2017 10:54:59 +0800 Subject: [PATCH 052/241] PUB:20151127 5 ways to change GRUB background in Kali Linux.md @fuowang --- .../20151127 5 ways to change GRUB background in Kali Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20151127 5 ways to change GRUB background in Kali Linux.md (100%) diff --git a/translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md b/published/20151127 5 ways to change GRUB background in Kali Linux.md similarity index 100% rename from translated/tech/20151127 5 ways to change GRUB background in Kali Linux.md rename to published/20151127 5 ways to change GRUB background in Kali Linux.md From d7674a7c8d65b8ca8c3954e2b7976d8b176812de Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 31 Mar 2017 14:45:45 +0800 Subject: [PATCH 053/241] PUB:20170201 Protecting Your Privacy With Firefox on Linux.md @ypingcn @jasminepeng --- ...ting Your Privacy With Firefox on Linux.md | 84 +++++++++---------- 1 file changed, 38 insertions(+), 46 deletions(-) rename {translated/tech => published}/20170201 Protecting Your Privacy With Firefox on Linux.md (65%) diff --git a/translated/tech/20170201 Protecting Your Privacy With Firefox on Linux.md b/published/20170201 Protecting Your Privacy With Firefox on Linux.md similarity index 65% rename from translated/tech/20170201 Protecting Your Privacy With Firefox on Linux.md rename to published/20170201 Protecting Your Privacy With Firefox on Linux.md index 3f8a1fff01..48c84ccfaa 100644 --- a/translated/tech/20170201 Protecting Your Privacy With Firefox on Linux.md +++ b/published/20170201 Protecting Your Privacy With Firefox on Linux.md @@ -1,119 +1,113 @@ -在 Linux 上用火狐保护你的隐私 +在 Linux 上用火狐浏览器保护你的隐私 ============================= -## 介绍 +### 介绍 隐私和安全正在逐渐成为一个重要的话题。虽然不可能做到 100% 安全,但是,还是能采取一些措施,特别是在 Linux 上,在你浏览网页的时候保护你的在线隐私安全。 基于这些目的选择浏览器的时候,火狐或许是你的最佳选择。谷歌 Chrome 不能信任。它是属于谷歌的,一个众所周知的数据收集公司,而且它是闭源的。 Chromium 或许还可以,但并不能保证。只有火狐保持了一定程度的用户权利承诺。 -## 火狐设置 +### 火狐设置 火狐里有几个你能设定的设置,能更好地保护你的隐私。这些设置唾手可得,能帮你控制那些在你浏览的时候分享的数据。 -### 健康报告 +#### 健康报告 -你首先可以设置的是对火狐健康报告发送的限制,以限制数据发送总量。当然,这些数据只是被发送到 Mozilla,但这也是传输数据。 +你首先可以设置的是对火狐健康报告发送的限制,以限制数据发送量。当然,这些数据只是被发送到 Mozilla,但这也是传输数据。 打开火狐的菜单,点击“选项”Preferences。来到侧边栏里的“高级”Advanced选项卡,点击“数据选项”Data Choices。这里你能禁用任意数据的报告。 -### 搜索 +#### 搜索 -新版的火狐浏览器默认使用雅虎搜索引擎。一些发行版更改设置,替代使用的是谷歌。两个方法都不理想。火狐有默认使用 DuckDuckGo 的选项。 +新版的火狐浏览器默认使用雅虎搜索引擎。一些发行版会更改设置,替代使用的是谷歌。两个方法都不理想。火狐可以使用 DuckDuckGo 作为默认选项。 ![在火狐中使用 DuckDuckGo ](https://linuxconfig.org/images/ff-ddg.jpg?58cf18fd) -为了启用 DuckDuckGo,你得打开火狐菜单点击“选项”Preferences。直接来到侧边栏的“搜索”Search选项卡。然后,用“默认搜索引擎”Default Search Engine的下拉菜单来选择 DuckDuckGo 。 +为了启用 DuckDuckGo,你得打开火狐菜单点击“选项”Preferences。直接来到侧边栏的“搜索”Search选项卡。然后,在“默认搜索引擎”Default Search Engine的下拉菜单中选择 DuckDuckGo 。 -### 请勿跟踪Do Not Track +#### 请勿跟踪Do Not Track 这个功能并不完美,但它确实向站点发送了一个信号,告诉它们不要使用分析工具来记录你的活动。这些网页或许会遵从,会许不会。但是,最好启用请勿跟踪,也许它们会遵从呢。 - ![启用火狐中的请勿跟踪](https://linuxconfig.org/images/ff-tracking.jpg?58cf18fc) +![启用火狐中的请勿跟踪](https://linuxconfig.org/images/ff-tracking.jpg?58cf18fc) 再次打开火狐的菜单,点击“选项”Preferences,然后是“隐私”Privacy。页面的最上面有一个“跟踪”Tracking部分。点击那一行写着“您还可以管理您的‘请勿跟踪’设置”You can also manage your Do Not Track settings的链接。会出现一个有复选框的弹出窗口,那里允许你启用“请勿跟踪”设置。 -### 禁用 Pocket +#### 禁用 Pocket 没有任何证据显示 Pocket 正在做一些不好的事情,但是禁用它或许更好,因为它确实连接了一个专有的应用。 -禁用 Pocket 不是太难,但是你得注意只改变 Pocket 相关设置。为了来到你所需的配置页面,在火狐的地址栏里输入`about:config`。 +禁用 Pocket 不是太难,但是你得注意只改变 Pocket 相关设置。要访问你所需的配置页面,在火狐的地址栏里输入`about:config`。 页面会加载一个设置表格,在表格的最上面是搜索栏,在那儿搜索 Pocket 。 -你将会看到一个包含结果的新表格。找一下名为 extensions.pocket.enabled 的设置。当你找到它的时候,双击使其转变为“否”。你也能在这儿编辑 Pocket 的其他相关设置。不过没什么必要。注意不要编辑那些跟 Pocket 扩展不直接相关的任何东西。 +你将会看到一个包含结果的新表格。找一下名为 `extensions.pocket.enabled` 的设置。当你找到它的时候,双击使其转变为“否”。你也能在这儿编辑 Pocket 的其他相关设置。不过没什么必要。注意不要编辑那些跟 Pocket 扩展不直接相关的任何东西。 - ![禁用火狐的 Pocket](https://linuxconfig.org/images/ff-pocket.jpg?58cf18fd) +![禁用火狐的 Pocket](https://linuxconfig.org/images/ff-pocket.jpg?58cf18fd) +### 附加组件Add-ons -## 附加组件Add-ons - - ![安全化火狐的附加组件](https://linuxconfig.org/images/ff-addons.jpg?58cf18fd) +![安全化火狐的附加组件](https://linuxconfig.org/images/ff-addons.jpg?58cf18fd) 火狐最有效地保护你隐私和安全的方式来自附加组件。火狐有大量的附加组件库,其中很多是免费、开源的。在这篇指导中着重提到的附加组件,在使浏览器更安全方面是名列前茅的。 -### HTTPS Everywhere +#### HTTPS Everywhere -针对大量没有使用 SSL 证书的网页、许多不使用 `https` 前缀的链接、指引用户前往不安全版本的网页等现状,电子前线基金会Electronic Frontier Foundation开发了 HTTPS Everywhere。HTTPS Everywhere 确保了如果存在有一个加密版本的网页,用户将会使用它。 +针对大量没有使用 SSL 证书的网页、许多不使用 `https` 协议的链接、指引用户前往不安全版本的网页等现状,电子前线基金会Electronic Frontier Foundation开发了 HTTPS Everywhere。HTTPS Everywhere 确保了如果该链接存在有一个加密的版本,用户将会使用它。 -给火狐设计的 HTTPS Everywhere 已经可以使用,在火狐的附加组件搜索网页上。`https://addons.mozilla.org/en-us/firefox/addon/https-everywhere/`(LCTT 译注:对应的中文页面是 `https://addons.mozilla.org/zh-CN/firefox/addon/https-everywhere/`) +给火狐设计的 [HTTPS Everywhere](https://addons.mozilla.org/en-us/firefox/addon/https-everywhere/) 已经可以使用,在火狐的附加组件搜索网页上。(LCTT 译注:对应的[中文页面](https://addons.mozilla.org/zh-CN/firefox/addon/https-everywhere/)。) -### Privacy Badger +#### Privacy Badger -电子前线基金会同样开发了 Privacy Badger。 Privacy Badger 旨在通过阻止不想要的网页跟踪,弥补“请勿跟踪”功能的不足之处。它同样能通过火狐附加组件仓库安装。`https://addons.mozilla.org/en-us/firefox/addon/privacy-badger17`。(LCTT 译注:对应的中文页面是`https://addons.mozilla.org/zh-CN/firefox/addon/privacy-badger17/`) +电子前线基金会同样开发了 Privacy Badger。 [Privacy Badger](https://addons.mozilla.org/en-us/firefox/addon/privacy-badger17) 旨在通过阻止不想要的网页跟踪,弥补“请勿跟踪”功能的不足之处。它同样能通过火狐附加组件仓库安装。。(LCTT 译注:对应的[中文页面](https://addons.mozilla.org/zh-CN/firefox/addon/privacy-badger17/)。) -### Ublock Origin +#### uBlock Origin -现在有一类更通用的的隐私附加组件,屏蔽广告。这里的选择是 uBlock Origin,uBlock Origin 是个更轻量级的广告屏蔽插件,几乎不遗漏所有它会屏蔽的广告。 uBlock Origin 将主要屏蔽所有广告,特别是侵略性的广告。你能在这儿找到它。`https://addons.mozilla.org/en-us/firefox/addon/ublock-origin/`。(LCTT 译注:对应的中文页面是 `https://addons.mozilla.org/zh-CN/firefox/addon/ublock-origin/`) +现在有一类更通用的的隐私附加组件,屏蔽广告。这里的选择是 uBlock Origin,uBlock Origin 是个更轻量级的广告屏蔽插件,几乎不遗漏所有它会屏蔽的广告。 [uBlock Origin](https://addons.mozilla.org/en-us/firefox/addon/ublock-origin/) 将主要屏蔽各种广告,特别是侵入性的广告。你能在这儿找到它。。(LCTT 译注:对应的[中文页面](https://addons.mozilla.org/zh-CN/firefox/addon/ublock-origin/)。) +#### NoScript -### NoScript - -阻止 JavaScript 是有点争议, JavaScript 虽说驱动了那么多的网站,但还是臭名昭著,因为 JavaScript 成为侵略隐私和攻击的媒介。NoScript 是应对 JavaScript 的绝佳方案。 +阻止 JavaScript 是有点争议, JavaScript 虽说支撑了那么多的网站,但还是臭名昭著,因为 JavaScript 成为侵略隐私和攻击的媒介。NoScript 是应对 JavaScript 的绝佳方案。 ![向 NoScript 的白名单添加网页](https://linuxconfig.org/images/ff-noscript.jpg?58cf18fc) -NoScript 是一个 JavaScript 的白名单,它通常会屏蔽 JavaScript,除非该站点被添加进白名单中。可以通过插件的“选项”菜单,事先将一个站点加入白名单,或者通过在页面上点击 NoScript 图标的方式添加。 +NoScript 是一个 JavaScript 的白名单,它会屏蔽所有 JavaScript,除非该站点被添加进白名单中。可以通过插件的“选项”菜单,事先将一个站点加入白名单,或者通过在页面上点击 NoScript 图标的方式添加。 ![添加你所在的网页到 NoScript 的白名单中](https://linuxconfig.org/images/ff-noscript2.jpg?58cf18fd) -通过火狐附加组件仓库可以安装 NoScript `https://addons.mozilla.org/en-US/firefox/addon/noscript/` +通过火狐附加组件仓库可以安装 [NoScript](https://addons.mozilla.org/en-US/firefox/addon/noscript/) 如果网页提示不支持你使用的火狐版本,点“无论如何下载”Download Anyway。这已经在 Firefox 51 上测试有效。 -### Disconnect +#### Disconnect -Disconnect 做很多跟 Privacy Badger 一样的事情,它只是提供了另一个保护的方法。你能在附加组件仓库中找到它 `https://addons.mozilla.org/en-US/firefox/addon/disconnect/` (LCTT 译注:对应的中文页面是`https://addons.mozilla.org/zh-CN/firefox/addon/disconnect/`)。如果网页提示不支持你使用的火狐版本,点“无论如何下载”Download Anyway。这已经在 Firefox 51 上测试有效。 +[Disconnect](https://addons.mozilla.org/en-US/firefox/addon/disconnect/) 做的事情很多跟 Privacy Badger 一样,它只是提供了另一个保护的方法。你能在附加组件仓库中找到它 (LCTT 译注:对应的[中文页面](https://addons.mozilla.org/zh-CN/firefox/addon/disconnect/))。如果网页提示不支持你使用的火狐版本,点“无论如何下载”Download Anyway。这已经在 Firefox 51 上测试有效。 -### Random Agent Spoofer +#### Random Agent Spoofer -Random Agent Spoofer 能改变火狐浏览器的签名,让浏览器看起来像是在其他任意平台上的其他任意浏览器。虽然有许多其他的应用,但是它也能预防浏览器指纹侦查。 +Random Agent Spoofer 能改变火狐浏览器的签名,让浏览器看起来像是在其他任意平台上的其他任意浏览器。虽然有许多其他的用途,但是它也能用于预防浏览器指纹侦查。 浏览器指纹侦查Browser Fingerprinting是网站基于所使用的浏览器和操作系统来跟踪用户的另一个方式。相比于 Windows 用户,浏览器指纹侦查更多影响到 Linux 和其他替代性操作系统用户,因为他们的浏览器特征更独特。 - -你能通过火狐附加插件仓库添加 Random Agent Spoofer。`https://addons.mozilla.org/en-us/firefox/addon/random-agent-spoofer/`(LCTT 译注:对应的中文页面是`https://addons.mozilla.org/zh-CN/firefox/addon/random-agent-spoofer/`)。像其他附加组件那样,页面或许会提示它不兼容最新版的火狐。再说一次,那并不是真的。 - +你能通过火狐附加插件仓库添加 [Random Agent Spoofer](https://addons.mozilla.org/en-us/firefox/addon/random-agent-spoofer/)。(LCTT 译注:对应的[中文页面](https://addons.mozilla.org/zh-CN/firefox/addon/random-agent-spoofer/))。像其他附加组件那样,页面或许会提示它不兼容最新版的火狐。再说一次,那并不是真的。 ![在火狐上使用Random Agent Spoofer ](https://linuxconfig.org/images/ff-random-agent.jpg?58cf18fc) -你可以通过点击火狐菜单栏上的图标来使用 Random Agent Spoofer。点开后将会出现一个下拉菜单,有不同模拟的浏览器选项。最好的选项之一是选择"Random Desktop" 和任意的改变时间。这样,就不会有绝对的模式来跟踪,也保证了你只能获得网页的桌面版本。 +你可以通过点击火狐菜单栏上的图标来使用 Random Agent Spoofer。点开后将会出现一个下拉菜单,有不同模拟的浏览器选项。最好的选项之一是选择"Random Desktop" 和任意的切换时间。这样,就绝对没有办法来跟踪你了,也保证了你只能获得网页的桌面版本。 +### 系统设置 -## 系统设置 - -### 私人 DNS +#### 私人 DNS 请避免使用公共或者 ISP 的 DNS 服务器!即使你配置你的浏览器满足绝对的隐私标准,你向公共 DNS 服务器发出的 DNS 请求却暴露了所有你访问过的网页。诸如谷歌公共 DNS(IP:8.8.8.8 、8.8.4.4)这类的服务将会记录你的 IP 地址、你的 ISP 和地理位置信息。这些信息或许会被任何合法程序或者强制性的政府请求所分享。 - > **当我在使用谷歌公共 DNS 服务时,谷歌会记录什么信息?** > > 谷歌公共 DNS 隐私页面有一个完整的收集信息列表。谷歌公共 DNS 遵循谷歌的主隐私政策,在“隐私中心”Privacy Center可以看到。 用户的客户端 IP 地址是唯一会被临时记录的(一到两天后删除),但是为了让我们的服务更快、更好、更安全,关于 ISP 和城市/都市级别的信息将会被保存更长的时间。 > 参考资料: `https://developers.google.com/speed/public-dns/faq#privacy` -由于以上原因,如果可能的话,配置并使用你私人的非转发 DNS 服务器。现在,这项任务或许跟在本地部署一些预先配置好的 DNS 服务器 Docker 容器一样简单。例如,假设 docker 服务已经在你的系统安装完成,下列命令将会部署你的私人本地 DNS 服务器: +由于以上原因,如果可能的话,配置并使用你私人的非转发 DNS 服务器。现在,这项任务或许跟在本地部署一些预先配置好的 DNS 服务器的 Docker 容器一样简单。例如,假设 Docker 服务已经在你的系统安装完成,下列命令将会部署你的私人本地 DNS 服务器: ``` # docker run -d --name bind9 -p 53:53/udp -p 53:53 fike/bind9 @@ -141,15 +135,13 @@ google.com. 242 IN A 216.58.199.46 现在,在 `/etc/resolv.conf` 里设置你的域名服务器: - ``` - nameserver 127.0.0.1 ``` -## 结束语 +### 结束语 -没有完美的安全隐私解决方案。虽然本篇指导里的步骤可以明显改进它们。如果你真的很在乎隐私,Tor 浏览器 `https://www.torproject.org/projects/torbrowser.html.en` 是最佳选择。Tor 对于日常使用有点过犹不及,但是它的确使用了这篇指导里列出的一些措施。 +没有完美的安全隐私解决方案。虽然本篇指导里的步骤可以明显改进它们。如果你真的很在乎隐私,[Tor 浏览器](https://www.torproject.org/projects/torbrowser.html.en) 是最佳选择。Tor 对于日常使用有点过犹不及,但是它的确使用了这篇指导里列出的一些措施。 -------------------------------------------------------------------------------- From 00cce25089fe68107dcedb7982be30bda6a32928 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Fri, 31 Mar 2017 16:48:51 +0800 Subject: [PATCH 054/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 谢谢 @geekpi --- .../20170323 3 open source link shorteners.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20170323 3 open source link shorteners.md b/translated/tech/20170323 3 open source link shorteners.md index 2980bd43f1..34c94a7163 100644 --- a/translated/tech/20170323 3 open source link shorteners.md +++ b/translated/tech/20170323 3 open source link shorteners.md @@ -4,29 +4,29 @@ > 想要构建你自己的 URL 缩短器?这些开源项目使这个变得简单。 ![3 open source link shorteners](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/links.png?itok=AumNmse7 "3 open source link shorteners") ->图片提供: [Paul Lewin][2]. Modified by Opensource.com. [CC BY-SA 2.0][3] +>图片提供: [Paul Lewin][2]。Opensource.com 修改。[CC BY-SA 2.0][3] -没有人喜欢一个非常长的URL。 +没有人喜欢一个非常长的 URL。 -他们很难解析。但有时候,站点的深层目录结构还有最后加上的大量参数使得 URL 开始变得冗长。在 Twitter 添加自己的链接缩短服务之前的那些日子里,一个长的 URL 意味着从推文中消减珍贵的字符。 +他们很难解析。但有时候,站点的深层目录结构还有最后加上的大量参数使得 URL 开始变得冗长。在 Twitter 添加自己的链接缩短服务之前的那些日子里,一个长的 URL 意味着推文中珍贵的字符不得不削减。 -如今,因为很多原因,人们开始使用链接缩短器。这样人们可以更容易地输入或记住另一个冗长的网址。它们可以为社交媒体帐户带来一贯的品牌建设。它们可以更轻松地在一组网址中进行分析。它们使得为其他网站频繁变化的 URL 提供统一的入口成为可能。 +如今,因为很多原因,人们开始使用链接缩短器。这样人们可以更容易地输入或记住另一个冗长的网址。它们可以为社交媒体帐户带来一贯的品牌建设。它们使对一组网址进行分析变得更轻松。它们使得为频繁变化的网站 URL 提供统一的入口成为可能。 -URL 缩短器确实有一些挑战。应该为你提供短网址服务也会消失,这使得在点击之前知道链接实际指向哪里也是一个挑战,并且容易受到 [linkrot][4] 的影响。但是尽管面临这些挑战,URL 缩短器不会消失。 +URL 缩短器确实有一些挑战。在点击之前很难知道链接实际指向哪里,而且如果提供短网址服务消失,易导致 [linkrot][4]。但是尽管面临这些挑战,URL 缩短器不会消失。 -但是,既然已经有这么多免费链接缩短服务,为什么还要自己构建?简而言之:方便控制。虽然有些服务可以让你选择自己的域名来使用,有时候这有关于你会得到定制级别。使用自助式服务,你可以自己决定服务的运行时间、URL 的格式以及决定谁可以访问你的分析。这是你自己拥有并且可以操作的。 +但是,既然已经有这么多免费链接缩短服务,为什么还要自己构建?简而言之:方便控制。虽然有些服务可以让你选择自己的域名来使用,但得到的定制级别不同。使用自托管服务,你可以自己决定服务的运行时间、URL 的格式以及决定谁可以访问你的分析。这是你自己拥有并且可以操作的。 -幸运的是,如果你想建立下一个 bit.ly、goo.gl或 ow.ly,你可以有很多开源选项。你可以考虑下面几个。 +幸运的是,如果你想建立下一个 bit.ly、goo.gl 或 ow.ly,你可以有很多开源选项。你可以考虑下面几个。 ### Lessn More -[Lessn More][5]是一个个人 URL 缩短器,用 PHP 写成,并从一个名为 Buttered URL 的较旧项目 fork 而来,而它又是一个名为 Lessn 的项目的分支衍生而来。Lessn More 能提供你对 URL 缩短器预期的大部分功能:API 和书签支持、自定义 URL 等。还有一些有用的功能比如可以让 Lessn More 使用单词黑名单来避免创建意外不适当的 URL、避免“看着相似”的字符来使 URL 更易读、能够选择是否使用混合大小写的字符等。 +[Lessn More][5] 是一个个人 URL 缩短器,用 PHP 写成,并从一个名为 Buttered URL 的较旧项目 fork 而来,而它又是一个名为 Lessn 的项目的分支衍生而来。Lessn More 能提供你对 URL 缩短器预期的大部分功能:API 和书签支持、自定义 URL 等。还有一些有用的功能,比如可以让 Lessn More 使用单词黑名单来避免不小心创建不适当的 URL、避免“看着相似”的字符来使 URL 更易读、能够选择是否使用混合大小写的字符,以及一些其它有用的功能。 -[Lessn More][6] 在 GitHub 上以 3 句版 [BSD][8]许可证公布了 [源代码][7]。 +[Lessn More][6] 在 GitHub 上以 3-clause [BSD][8] 许可证公布了[源代码][7]。 ### Polr -[Polr][9] 将自己描述为“现代、强大、可靠的URL缩短器”。它具有相当直接但现代化的界面,像我们这里详细介绍的其他选择那样还提供了一个 API 来允许你从其他程序中使用它。在这三个选择中,它在功能上是最轻的,但如果你正在寻找一个简单但功能完整的选择,那么这可能是你不错的选择。下载之前你可以查看[在线演示][10]。 +[Polr][9] 将自己描述为“现代、强大、可靠的 URL 缩短器”。它具有相当直接但现代化的界面,像我们这里详细介绍的其他选择那样,还提供了一个 API 来允许你从其他程序中使用它。在这三个选择中,它在功能上是最轻的,但如果你正在寻找一个简单但功能完整的选择,那么这可能是你不错的选择。下载之前你可以查看[在线演示][10]。 Polr 的[源代码][11] 在 GitHub 中以 [GPLv2][12] 许可证公布。 @@ -34,21 +34,21 @@ Polr 的[源代码][11] 在 GitHub 中以 [GPLv2][12] 许可证公布。 [YOURLS][13],“Your Own URL Shortener”(你自己的 URL 缩短器)的缩写,它是我最熟悉的选择。我在个人网站上已经运行了好几年,并且对其功能非常满意。 -它是用 PHP 编写的,YOURLS 是一个有非常丰富功能的选择并且可以很好地开箱即用。你可以将其配置为任何人可公开使用,或只允许某些用户使用它。它支持自定义 URL,拥有书签功能使得很容易共享,它还具有非常强大的内置统计信息,并支持可插拔的架构,以允许其他人添加功能。它还有一个API,可以轻松地用它创建其他程序。 +它是用 PHP 编写的,YOURLS 功能非常丰富并且可以很好地开箱即用。你可以将其配置为任何人可公开使用,或只允许某些用户使用它。它支持自定义 URL,拥有书签功能,使得共享很容易,它还具有非常强大的内置统计信息,并支持可插拔的架构,以允许其他人添加功能。它还有一个 API,可以轻松地用它创建其他程序。 -你可以在 Github 中找到 [MIT许可证][15]下的 YOURLS 的[源代码][14]。 +你可以在 Github 中找到 [MIT 许可证][15]下的 YOURLS [源代码][14]。 * * * -不喜欢这些选择么?看下互联网,你会发现还有其他几个选择:[shuri][16]、[Nimbus][17]、[Lstu][18] 等等。除了这些选择外,构建链接缩短器也是一个很好的第一个编程项目,它可以帮助了解新的语言或 Web 框架。毕竟,它的核心功能非常简单:以 URL 作为输入,并重定向到另一个 URL。除此之外,它取决于你自己想要添加的功能。 +这些选择都不喜欢么?看下互联网,你会发现还有其他几个选择:[shuri][16]、[Nimbus][17]、[Lstu][18] 等等。除了这些选择外,构建链接缩短器可以作为帮助了解新语言或 Web 框架的第一次编程项目。毕竟,它的核心功能非常简单:以 URL 作为输入,并重定向到另一个 URL。除此之外,它取决于你自己想要添加的功能。 -你有我们没有在这里列出的最爱吗?在评论栏中让我们知道你的想法。 +你有喜欢但没有在这里列出的 URL 缩短器吗?请在评论栏中让我们知道你的想法。 -------------------------------------------------------------------------------- 作者简介: -Jason Baker - Jason 热衷于使用技术使世界更加开放,从软件开发到阳光政府行动。Linux 桌面爱好者、地图/地理空间爱好者、树莓派工匠、数据分析和可视化极客、偶尔的码农、云本土主义者。在 Twitter 上关注他。 +Jason Baker - Jason 热衷于使用技术使世界更加开放,从软件开发到阳光政府行动。Linux 桌面爱好者、地图/地理空间爱好者、树莓派工匠、数据分析和可视化极客、偶尔的码农、云本土主义者。在 Twitter 上关注他 @jehb。 ------------ From a994324c4d854e4743b50fd04d866e0808ffc964 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Fri, 31 Mar 2017 16:55:33 +0800 Subject: [PATCH 055/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对中 --- ...eplication Across Two Samba4 AD DC with Rsync - Part 6.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md b/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md index 2e4b94ee3e..657b165ab1 100644 --- a/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md +++ b/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md @@ -1,6 +1,5 @@ -Setup SysVol Replication Across Two Samba4 AD DC with Rsync – Part 6 +使用 Rsync 命令同步两个 Samba4 AD DC 之间的 SysVol 目录 ——(六) ============================================================ -使用 Rsync 命令来同步两个 Samba4 AD DC 之间的 SysVol 目录——(六) 这篇文章讲的是在两个 Samba4 活动目录域控制器之间,通过一些强大的 Linux 工具来完成 SysVol 的复制操作,比如[Rsync 数据同步工具][2],[Cron 任务调度进程][3]和[SSH 协议][4]。 @@ -174,7 +173,7 @@ via: http://www.tecmint.com/samba4-ad-dc-sysvol-replication/ 作者:[Matei Cezar][a] 译者:[rusking](https://github.com/rusking) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 046f5f043433149d236545b031f1cde61c641497 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Fri, 31 Mar 2017 17:31:33 +0800 Subject: [PATCH 056/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对中 --- ...ss Two Samba4 AD DC with Rsync - Part 6.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md b/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md index 657b165ab1..3b7d860ea6 100644 --- a/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md +++ b/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md @@ -1,15 +1,15 @@ -使用 Rsync 命令同步两个 Samba4 AD DC 之间的 SysVol 目录 ——(六) +Samba 系列(六):使用 Rsync 命令同步两个 Samba4 AD DC 之间的 SysVol 目录 ============================================================ -这篇文章讲的是在两个 Samba4 活动目录域控制器之间,通过一些强大的 Linux 工具来完成 SysVol 的复制操作,比如[Rsync 数据同步工具][2],[Cron 任务调度进程][3]和[SSH 协议][4]。 +这篇文章讲的是在两个 **Samba4 活动目录域控制器**之间,通过一些强大的 Linux 工具来完成 SysVol 的复制操作,比如 [Rsync 数据同步工具][2],[Cron 任务调度进程][3]和 [SSH 协议][4]。 #### 要求:: -1、 [将 Ubuntu 16.04 服务器作为域控制器加入到 Samba4 AD DC 环境中——(五)][1] +- [Samba 系列(五):将另一台 Ubuntu DC 服务器加入到 Samba4 AD DC 实现双域控主机模][1] ### 第一步:配置 DC 服务器时间同步 -1、在两个域控制器之间复制 sysvol 目录的内容之前,你得保证这两个服务器时间设置准确且一致。 +1、在两个域控制器之间复制 **sysvol** 目录的内容之前,你得保证这两个服务器时间设置准确且一致。 如果这两个服务器的时间延迟大于 5 分钟,并且时钟也不同步,你将会遇到 AD 账号和域复制的各种问题。 @@ -19,13 +19,13 @@ # apt-get install ntp ``` -2、在 NTP 服务安装完成之后,打开主配置文件,把默认的 pool 值注释(在第一行 pool 参数前添加 # ),并且添加新的 pool 值指向已安装了 NTP 服务端的主 Samba4 AD DC FQDN ,如下所示。 +2、在 NTP 服务安装完成之后,打开主配置文件,把默认的 pool 值注释(在每行 pool 参数前添加 # ),并且添加新的 pool 值,指向已安装了 **NTP** 服务端的主 **Samba4 AD DC FQDN**,如下所示。 ``` # nano /etc/ntp.conf ``` -把下面几行添加到 ntp.conf 配置文件。 +把下面几行添加到 **ntp.conf** 配置文件。 ``` pool 0.ubuntu.pool.ntp.org iburst @@ -40,7 +40,7 @@ pool ntp.ubuntu.com ![Configure NTP for Samba4](http://www.tecmint.com/wp-content/uploads/2017/01/Configure-NTP-for-Samba4.png) ][6] -Samba4 配置 NTP 服务 +*Samba4 配置 NTP 服务* 3、先不要关闭该文件,在文件末尾添加如下内容,这是为了让其它客户端能够查询并[与这个 NTP 服务器同步时间][7],并发出 NTP 签署请求,以防主 DC 离线: @@ -49,7 +49,7 @@ restrict source notrap nomodify noquery mssntp ntpsigndsocket /var/lib/samba/ntp_signd/ ``` -4、最后,关闭并保存该配置文件,然后重启 NTP 服务以应用更改。等待几分钟后时间同步完成,执行 ntpq 命令来查看时间同步情况。 +4、最后,关闭并保存该配置文件,然后重启 NTP 服务以应用更改。等待几分钟后时间同步完成,执行 **ntpq** 命令打印出 **adc1** 时间同步情况。 ``` # systemctl restart ntp @@ -59,23 +59,23 @@ ntpsigndsocket /var/lib/samba/ntp_signd/ ![Synchronize NTP Time with Samba4 AD](http://www.tecmint.com/wp-content/uploads/2017/01/Synchronize-Time.png) ][8] -与 Samba4 AD 同步 NTP 时间 +*与 Samba4 AD 同步 NTP 时间* ### 第二步:通过 Rsync 命令来复制第一个 DC 服务器上的 SysVol 目录 -默认情况下,Samba4 AD DC 不会通过 DFS-R(分布式文件系统复制)或者 FRS(文件复制服务)来复制 SysVol 目录。 +默认情况下,**Samba4 AD DC** 不会通过 **DFS-R**(分布式文件系统复制Distributed File System Replication)或者 **FRS**(文件复制服务File Replication Service)来复制 SysVol 目录。 -这意味着只有在第一个域控制器联机时,组策略对象才可用。否则组策略设置和登录脚本不会应用到已加入域的 Windosws 机器上。 +这意味着只有在第一个域控制器联机时,**组策略对象**Group Policy objects 才可用。否则组策略设置和登录脚本不会应用到已加入域的 Windosws 机器上。 -为了解决这个问题及实现 SysVol 目录的犁,我们通过执行一个[基于 SSH 的身份认证][10]并使用 SSH 加密通道的[Linux 同步命令][9]来从第一个域控制器安全地传输 GPO 对象到第二个域控制器。 +为了克服这个障碍,以及基本实现 SysVol 目录复制的目的,我们通过执行一个[基于 SSH 的身份认证][10]并使用 SSH 加密通道的[Linux 同步命令][9]来从第一个域控制器安全地传输 **GPO** 对象到第二个域控制器。 -这种方式能够确保 GPO 对象在域控制器之间的一致性,但是也有一个很大的缺点。它只能进行单向同步,因为在同步 GPO 目录的时候, rsync 命令会从源 DC 服务器传输所有的更改到目标 DC 服务器, +这种方式能够确保 **GPO** 对象在域控制器之间的一致性,但是也有一个很大的缺点。它只能进行单向同步,因为在同步 GPO 目录的时候, **rsync** 命令会从源 DC 服务器传输所有的更改到目标 DC 服务器, 源 DC 服务器上不存在的组策略对象也会从目标 DC 服务器上删除,为了限制并避免任何冲突,所有的 GPO 编辑操作只能在第一个 DC 服务器上执行。 -5、要进行 SysVol 复制,先到[第一个 AD DC 服务器上生成 SSH 密钥][11],然后使用下面的命令把该密钥传输到第二个 DC 服务器。 +5、要进行 **SysVol** 复制,先到[第一个 AD DC 服务器上生成 SSH 密钥][11],然后使用下面的命令把该密钥传输到第二个 DC 服务器。 -在生成密钥的过程中不要设置密码,以便在无用户干预的情况下进行传输。 +在生成密钥的过程中不要设置密码 **passphrase**,以便在无用户干预的情况下进行传输。 ``` # ssh-keygen -t RSA @@ -87,7 +87,7 @@ ntpsigndsocket /var/lib/samba/ntp_signd/ ![Generate SSH Key on Samba4 DC](http://www.tecmint.com/wp-content/uploads/2017/01/Generate-SSH-Key.png) ][12] -在 Samba4 DC 服务器上生成 SSH 密钥 +*在 Samba4 DC 服务器上生成 SSH 密钥* 6、 当你确认 root 用户可以从第一个 DC 服务器以免密码方式登录到第二个 DC 服务器时,执行下面的 Rsync 命令,加上 `--dry-run` 参数来模拟 SysVol 复制过程。注意把对应的参数值替换成你自己的数据。 @@ -178,7 +178,7 @@ via: http://www.tecmint.com/samba4-ad-dc-sysvol-replication/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/cezarmatei/ -[1]:http://www.tecmint.com/join-additional-ubuntu-dc-to-samba4-ad-dc-failover-replication/ +[1]:https://linux.cn/article-8358-1.html [2]:http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ [3]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ [4]:http://www.tecmint.com/5-best-practices-to-secure-and-protect-ssh-server/ From 003c37085c8820a64cad8f60f1e73d960116a97c Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 31 Mar 2017 21:51:08 +0800 Subject: [PATCH 057/241] PUB:20170323 3 open source link shorteners.md @geekpi @jasminepeng --- .../20170323 3 open source link shorteners.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) rename {translated/tech => published}/20170323 3 open source link shorteners.md (73%) diff --git a/translated/tech/20170323 3 open source link shorteners.md b/published/20170323 3 open source link shorteners.md similarity index 73% rename from translated/tech/20170323 3 open source link shorteners.md rename to published/20170323 3 open source link shorteners.md index 34c94a7163..4389547a92 100644 --- a/translated/tech/20170323 3 open source link shorteners.md +++ b/published/20170323 3 open source link shorteners.md @@ -1,18 +1,19 @@ -3 个开源链接缩短器 +3 个开源的链接缩短器 ============================================================ > 想要构建你自己的 URL 缩短器?这些开源项目使这个变得简单。 - ![3 open source link shorteners](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/links.png?itok=AumNmse7 "3 open source link shorteners") +![3 open source link shorteners](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/links.png?itok=AumNmse7 "3 open source link shorteners") + >图片提供: [Paul Lewin][2]。Opensource.com 修改。[CC BY-SA 2.0][3] 没有人喜欢一个非常长的 URL。 -他们很难解析。但有时候,站点的深层目录结构还有最后加上的大量参数使得 URL 开始变得冗长。在 Twitter 添加自己的链接缩短服务之前的那些日子里,一个长的 URL 意味着推文中珍贵的字符不得不削减。 +它们很难解析。但有时候,站点的深层目录结构还有最后加上的大量参数使得 URL 开始变得冗长。在 Twitter 添加自己的链接缩短服务之前的那些日子里,一个长的 URL 意味着不得不削减推文中珍贵的字符。 如今,因为很多原因,人们开始使用链接缩短器。这样人们可以更容易地输入或记住另一个冗长的网址。它们可以为社交媒体帐户带来一贯的品牌建设。它们使对一组网址进行分析变得更轻松。它们使得为频繁变化的网站 URL 提供统一的入口成为可能。 -URL 缩短器确实有一些挑战。在点击之前很难知道链接实际指向哪里,而且如果提供短网址服务消失,易导致 [linkrot][4]。但是尽管面临这些挑战,URL 缩短器不会消失。 +URL 缩短器确实有一些不足。在点击之前很难知道链接实际指向哪里,而且如果提供短网址服务消失,就会导致 [烂链(linkrot)][4]。但是尽管面临这些挑战,URL 缩短器不会消失。 但是,既然已经有这么多免费链接缩短服务,为什么还要自己构建?简而言之:方便控制。虽然有些服务可以让你选择自己的域名来使用,但得到的定制级别不同。使用自托管服务,你可以自己决定服务的运行时间、URL 的格式以及决定谁可以访问你的分析。这是你自己拥有并且可以操作的。 @@ -20,19 +21,19 @@ URL 缩短器确实有一些挑战。在点击之前很难知道链接实际指 ### Lessn More -[Lessn More][5] 是一个个人 URL 缩短器,用 PHP 写成,并从一个名为 Buttered URL 的较旧项目 fork 而来,而它又是一个名为 Lessn 的项目的分支衍生而来。Lessn More 能提供你对 URL 缩短器预期的大部分功能:API 和书签支持、自定义 URL 等。还有一些有用的功能,比如可以让 Lessn More 使用单词黑名单来避免不小心创建不适当的 URL、避免“看着相似”的字符来使 URL 更易读、能够选择是否使用混合大小写的字符,以及一些其它有用的功能。 +[Lessn More][5] 是一个个人 URL 缩短器,用 PHP 写成,并从一个名为 Buttered URL 的较旧项目 fork 而来,而 Buttered URL 又是从一个名为 Lessn 的项目的分支衍生而来。Lessn More 能提供你对 URL 缩短器所预期的大部分功能:API 和书签支持、自定义 URL 等。还有一些有用的功能,比如可以让 Lessn More 使用单词黑名单来避免不小心创建不适当的 URL、避免“看着相似”的字符来使 URL 更易读、能够选择是否使用混合大小写的字符,以及一些其它有用的功能。 -[Lessn More][6] 在 GitHub 上以 3-clause [BSD][8] 许可证公布了[源代码][7]。 +[Lessn More][6] 在 GitHub 上以三句版 [BSD][8] 许可证公布了[源代码][7]。 ### Polr -[Polr][9] 将自己描述为“现代、强大、可靠的 URL 缩短器”。它具有相当直接但现代化的界面,像我们这里详细介绍的其他选择那样,还提供了一个 API 来允许你从其他程序中使用它。在这三个选择中,它在功能上是最轻的,但如果你正在寻找一个简单但功能完整的选择,那么这可能是你不错的选择。下载之前你可以查看[在线演示][10]。 +[Polr][9] 将自己描述为“现代、强大、可靠的 URL 缩短器”。它具有相当直接但现代化的界面,像我们这里详细介绍的其他选择那样,还提供了一个 API 来允许你从其他程序中使用它。在这三个可选品中,它在功能上是最轻量级的,但如果你正在寻找一个简单但功能完整的选择,那么这可能是你不错的选择。下载之前你可以查看[在线演示][10]。 Polr 的[源代码][11] 在 GitHub 中以 [GPLv2][12] 许可证公布。 ### YOURLS -[YOURLS][13],“Your Own URL Shortener”(你自己的 URL 缩短器)的缩写,它是我最熟悉的选择。我在个人网站上已经运行了好几年,并且对其功能非常满意。 +[YOURLS][13],是 “Your Own URL Shortener”(你自己的 URL 缩短器)的缩写,它是我最熟悉的选择。我在个人网站上已经运行了好几年,并且对其功能非常满意。 它是用 PHP 编写的,YOURLS 功能非常丰富并且可以很好地开箱即用。你可以将其配置为任何人可公开使用,或只允许某些用户使用它。它支持自定义 URL,拥有书签功能,使得共享很容易,它还具有非常强大的内置统计信息,并支持可插拔的架构,以允许其他人添加功能。它还有一个 API,可以轻松地用它创建其他程序。 @@ -54,9 +55,9 @@ Jason Baker - Jason 热衷于使用技术使世界更加开放,从软件开发 via: https://opensource.com/article/17/3/url-link-shortener -作者:[Jason Baker ][a] +作者:[Jason Baker][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[jasminepeng](https://github.com/jasminepeng) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c7ecc3907c39d17fc604260a6d507630595bb941 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 31 Mar 2017 22:09:59 +0800 Subject: [PATCH 058/241] =?UTF-8?q?PRF&PUB:20170128=20Wkhtmltopdf=20?= =?UTF-8?q?=E2=80=93=20A=20Smart=20Tool=20to=20Convert=20Website=20HTML=20?= =?UTF-8?q?Page=20to=20PDF=20in=20Linux.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi --- ...Convert Website HTML Page to PDF in Linux.md | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) rename {translated/tech => published}/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md (63%) diff --git a/translated/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md b/published/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md similarity index 63% rename from translated/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md rename to published/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md index 27e4649aa7..fb1c2af0c4 100644 --- a/translated/tech/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md +++ b/published/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md @@ -1,24 +1,24 @@ -wkhtmltopdf - 一个 Linux 中将网页转成 PDF 的智能工具 +wkhtmltopdf:一个 Linux 中将网页转成 PDF 的智能工具 ============================================================ -**wkhtmltopdf**是一个开源、简单而有效的命令行 shell 程序,它可以将任何 **HTML** (**网页**)转换为 **PDF** 文档或图像(**jpg**、**png** 等)。 +wkhtmltopdf 是一个开源、简单而有效的命令行 shell 程序,它可以将任何 HTML (网页)转换为 PDF 文档或图像(jpg、png 等)。 -wkhtmltopdf 是用 **C++** 编写的,并在 **GNU/GPL** (**通用公共许可证**)下发布。它使用 **WebKit** 渲染引擎将 **HTML** 页面转换为 **PDF** 文档且不会丢失页面的质量。这是一个用于实时创建和存储网页快照的非常有用且可信赖的解决方案。 +wkhtmltopdf 是用 C++ 编写的,并在 GNU/GPL (通用公共许可证)下发布。它使用 WebKit 渲染引擎将 HTML 页面转换为 PDF 文档且不会丢失页面的质量。这是一个用于实时创建和存储网页快照的非常有用且可信赖的解决方案。 ### wkhtmltopdf 的功能 1. 开源并且跨平台。 -2. 使用 **WebKit** 引擎将任意 **HTML** 网页转换为 **PDF** 文件。 +2. 使用 WebKit 引擎将任意 HTML 网页转换为 PDF 文件。 3. 添加页眉和页脚的选项 -4. 目录生成 (**TOC**) 选项。 +4. 目录生成 (TOC) 选项。 5. 提供批量模式转换。 -6. 通过绑定 libwkhtmltox 来支持 **PHP** 或 **Python**。 +6. 通过绑定 libwkhtmltox 来支持 PHP 或 Python。 -在本文中,我们将介绍如何在 Linux 系统下使用 tar 包来安装 **wkhtmltopdf**。 +在本文中,我们将介绍如何在 Linux 系统下使用 tar 包来安装 wkhtmltopdf。 ### 安装 Evince (PDF 浏览器) -让我们在 Linux 系统中安装 **evince** (一个 **PDF** 阅读器)来浏览 **PDF** 文件。 +让我们在 Linux 系统中安装 evince (一个 PDF 阅读器)来浏览 PDF 文件。 ``` $ sudo yum install evince [RHEL/CentOS and Fedora] @@ -28,15 +28,15 @@ $ sudo apt-get install evince [On Debian/Ubuntu systems] ### 下载 wkhtmltopdf 源码文件 -使用[ wget 命令][1]根据你的 **Linux** 架构来下载 **wkhtmltopdf** 源码文件,或者你也可以在[wkhtmltopdf 下载页][2]下载最新的版本(目前最新的稳定版是 **0.12.4**) +使用 [wget 命令][1]根据你的 Linux 架构来下载 wkhtmltopdf 源码文件,或者你也可以在 [wkhtmltopdf 下载页][2]下载最新的版本(目前最新的稳定版是 0.12.4) -##### 在 64 位 Linux 系统中 +在 64 位 Linux 系统中: ``` $ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz ``` -##### 在 32 位 Linux 系统中 +在 32 位 Linux 系统中: ``` $ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-generic-i386.tar.xz @@ -44,7 +44,7 @@ $ wget http://download.gna.org/wkhtmltopdf/0.12/0.12.4/wkhtmltox-0.12.4_linux-ge ### 在 Linux 中安装 wkhtmltopdf -使用[ tar 命令][3]解压文件到当前目录中。 +使用 [tar 命令][3]解压文件到当前目录中。 ``` ------ On 64-bit Linux OS ------ @@ -53,7 +53,7 @@ $ sudo tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz $ sudo tar -xvzf wkhtmltox-0.12.4_linux-generic-i386.tar.xz ``` -为了能从任意路径执行程序,将 **wkhtmltopdf** 安装到 **/usr/bin** 目录下。 +为了能从任意路径执行程序,将 wkhtmltopdf 安装到 `/usr/bin` 目录下。 ``` $ sudo cp wkhtmltox/bin/wkhtmltopdf /usr/bin/ @@ -61,17 +61,17 @@ $ sudo cp wkhtmltox/bin/wkhtmltopdf /usr/bin/ ### 如何使用 wkhtmltopdf? -我们会看到如何将远程的 **HTML** 页面转换成 **PDF** 文件、验证信息、使用 **evince** 在 **GNOME** 桌面中浏览创建的文件。 +我们会看到如何将远程的 HTML 页面转换成 PDF 文件、验证信息、使用 evince 在 GNOME 桌面中浏览创建的文件。 -### 将 HTML 网页转成 PDF 文件 +#### 将 HTML 网页转成 PDF 文件 -要将任意 **HTML** 页面转换成 **PDF**,运行下面的命令。它会在当前目录下将页面转换成 [10-Sudo-Configurations.pdf][4]。 +要将任意 HTML 页面转换成 PDF,运行下面的命令。它会在当前目录下将页面转换成 [10-Sudo-Configurations.pdf][4]。 ``` # wkhtmltopdf http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf ``` -##### 示例输出: +示例输出: ``` Loading pages (1/6) @@ -90,13 +90,13 @@ Done $ file 10-Sudo-Configurations.pdf ``` -##### 示例输出: +示例输出: ``` 10-Sudo-Configurations.pdf: PDF document, version 1.4 ``` -#### 浏览生成的 PDF 文件细腻 +#### 浏览生成的 PDF 文件细节 要浏览生成的文件信息,运行下面的命令。 @@ -104,7 +104,7 @@ $ file 10-Sudo-Configurations.pdf $ pdfinfo 10-Sudo-Configurations.pdf ``` -##### 示例输出 +示例输出: ``` Title: 10 Useful Sudoers Configurations for Setting 'sudo' in Linux @@ -127,13 +127,13 @@ PDF version: 1.4 #### 浏览创建的文件 -在桌面中使用 **evince** 看一眼最新生成的 **PDF** 文件。 +在桌面中使用 evince 查看最新生成的 PDF 文件。 ``` $ evince 10-Sudo-Configurations.pdf ``` -##### 示例截图: +示例截图: 在我的 Linux Mint 17 中看起来很棒。 @@ -141,17 +141,17 @@ $ evince 10-Sudo-Configurations.pdf ![View Website Page in PDF](http://www.tecmint.com/wp-content/uploads/2012/10/View-Website-Page-in-PDF.png) ][5] -在 PDF 中浏览网页 +*在 PDF 中浏览网页* -### 将页面的 TOC (Table Of Content 即目录)创建为 PDF +### 给 PDF 创建页面的 TOC (Table Of Content 即目录) -要创建一个 **PDF** 文件的目录,使用 **toc** 选项。 +要创建一个 PDF 文件的目录,使用 toc 选项。 ``` $ wkhtmltopdf toc http://www.tecmint.com/sudoers-configurations-for-setting-sudo-in-linux/ 10-Sudo-Configurations.pdf ``` -##### 示例输出: +示例输出: ``` Loading pages (1/6) @@ -163,13 +163,13 @@ Printing pages (6/6) Done ``` -要检查已创建文件的 **TOC**,再次使用 evince。 +要查看已创建文件的 TOC,再次使用 evince。 ``` $ evince 10-Sudo-Configurations.pdf ``` -##### 示例截图: +示例截图: 看一下下面的图。它上看去比上面的更好。 @@ -177,11 +177,11 @@ $ evince 10-Sudo-Configurations.pdf ![Create Website Page to Table of Contents in PDF](http://www.tecmint.com/wp-content/uploads/2012/10/Create-Website-Page-Table-of-Contents-in-PDF.png) ][6] -在 PDF 中创建网页的目录 +*在 PDF 中创建网页的目录* #### wkhtmltopdf 选项及使用 -更多关于 **wkhtmltopdf** 的使用及选项,使用下面的帮助命令。它会显示出所有可用的选项。 +更多关于 wkhtmltopdf 的使用及选项,使用下面的帮助命令。它会显示出所有可用的选项。 ``` $ wkhtmltopdf --help @@ -199,7 +199,7 @@ via: http://www.tecmint.com/wkhtmltopdf-convert-website-html-page-to-pdf-linux/ 作者:[Ravi Saive][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c4717efb760652c9623cfa3b15ba4aa3aba22fea Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 1 Apr 2017 08:34:10 +0800 Subject: [PATCH 059/241] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201703?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...113 Your visual how-to guide for SELinux policy enforcement.md | 0 .../20150413 Why most High Level Languages are Slow.md | 0 .../20151127 5 ways to change GRUB background in Kali Linux.md | 0 .../{ => 201703}/20160104 How to Change Linux IO Scheduler.md | 0 .../20160917 A Web Crawler With asyncio Coroutines.md | 0 published/{ => 201703}/20161018 Suspend to Idle.md | 0 ...omain Controller DNS and Group Policy from Windows – Part 4.md | 0 published/{ => 201703}/20170101 FTPS vs SFTP.md | 0 ...to record a region of your desktop as animated GIF on Linux.md | 0 .../20170111 Explore climate data with open source tools.md | 0 ...Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md | 0 ...0111 Linux command line navigation tips and tricks - part 1.md | 0 published/{ => 201703}/20170111 NMAP Common Scans – Part One.md | 0 published/{ => 201703}/20170113 How to Speed up Odoo copy.md | 0 published/{ => 201703}/20170116 Terrible Ideas in Git.md | 0 .../{ => 201703}/20170116 Use Docker remotely on Atomic Host.md | 0 ...17 How to Install WordPress with HHVM and Nginx on CentOS 7.md | 0 ... of Your Linux Machine Part 2 Three More Easy Security Tips.md | 0 ...d to provide access to source code under the AGPLv3 license.md | 0 ...20170118 Why Linux Installers Need to Add Security Features.md | 0 .../20170119 Get to know Tuleap for project management.md | 0 .../20170119 Long-term Embedded Linux Maintenance Made Easier.md | 0 .../20170120 How to write web apps in R with Shiny.md | 0 published/{ => 201703}/20170124 Compile-time assertions in Go.md | 0 .../{ => 201703}/20170126 How to join a technical community.md | 0 ...– A Smart Tool to Convert Website HTML Page to PDF in Linux.md | 0 .../20170130 How to get up and running with sweet Orange Pi.md | 0 .../20170201 Protecting Your Privacy With Firefox on Linux.md | 0 ... Configure Custom SSH Connections to Simplify Remote Access.md | 0 ...gure Network Between Guest VM and Host in Oracle VirtualBox.md | 0 ...7 How To Write and Use Custom Shell Functions and Libraries.md | 0 ... A Standard Command to Check Memory Usage Statistics in Linux.md | 0 ...0210 5 Linux Music Players You Should Consider Switching To.md | 0 .../20170210 How to perform search operations in Vim.md | 0 .../20170213 A beginners guide to understanding sudo on Ubuntu.md | 0 ...ow to Auto Execute CommandsScripts During Reboot or Startup.md | 0 .../{ => 201703}/20170213 Orange Pi as Time Machine Server.md | 0 ... Set Up and Configure a Firewall with FirewallD on CentOS 7.md | 0 ...ating System for Linux Gaming Which One Do You Use and Why.md | 0 published/{ => 201703}/20170214 CentOS-vs-Ubuntu.md | 0 ...w to Install Ubuntu with Separate Root and Home Hard Drives.md | 0 ...5 Best Windows Like Linux Distributions For New Linux Users.md | 0 ...5 Generate random data for your applications with Elizabeth.md | 0 .../20170215 How to change the Linux Boot Splash screen.md | 0 published/{ => 201703}/20170215 openSUSE on Raspberry Pi 3.md | 0 .../20170216 Getting Started with PowerShell 6.0 in Linux.md | 0 .../20170216 MASTER Cpp PROGRAMMING WITH OPEN-SOURCE BOOKS.md | 0 ...0170219 Windows wins the desktop, but Linux takes the world.md | 0 ... to create your own Linux Distribution with Yocto on Ubuntu.md | 0 .../20170221 How to Install and Configure FTP Server in Ubuntu.md | 0 ...ow to access shell or run external commands from within Vim.md | 0 ...ction to LaTeXila - a multi-language LaTeX editor for Linux.md | 0 .../20170223 How to install Arch Linux on VirtualBox.md | 0 ...0224 Setting Up a Secure FTP Server using SSL-TLS on Ubuntu.md | 0 ...to Upload or Download Files-Directories Using sFTP in Linux.md | 0 .../20170227 How to Install MariaDB 10 on Debian and Ubuntu.md | 0 .../20170227 How to setup a Linux server on Amazon AWS.md | 0 .../20170228 How to Install and Secure MariaDB 10 in CentOS 7.md | 0 ... to Install or Upgrade to Latest Kernel Version in CentOS 7.md | 0 .../20170304 7 Ways to Determine the File System Type in Linux.md | 0 .../20170306 How to Upgrade Kernel to Latest Version in Ubuntu.md | 0 .../{ => 201703}/20170307 How to make release notes count.md | 0 ...170308 How to Reset MySQL or MariaDB Root Password in Linux.md | 0 ...09 How to Change Root Password of MySQL or MariaDB in Linux.md | 0 ...ct SSH User Access to Certain Directory Using Chrooted Jail.md | 0 .../20170311 6 Best PDF Page Cropping Tools For Linux.md | 0 published/{ => 201703}/20170314 binary tree.md | 0 .../20170316 How to Install Latest Python 3.6 Version in Linux.md | 0 ...A Simple Shell Script to Create a Gif File from Active Window.md | 0 published/{ => 201703}/20170317 The End of the Line for EPEL-5.md | 0 ...LRepo – Community Repo for Enterprise Linux RHEL CentOS SL.md | 0 published/{ => 201703}/20170323 3 open source link shorteners.md | 0 .../20170324 This Xfce Bug Is Wrecking Users Monitors.md | 0 .../20170325 How to Install a DHCP Server in Ubuntu and Debian.md | 0 74 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201703}/20131113 Your visual how-to guide for SELinux policy enforcement.md (100%) rename published/{ => 201703}/20150413 Why most High Level Languages are Slow.md (100%) rename published/{ => 201703}/20151127 5 ways to change GRUB background in Kali Linux.md (100%) rename published/{ => 201703}/20160104 How to Change Linux IO Scheduler.md (100%) rename published/{ => 201703}/20160917 A Web Crawler With asyncio Coroutines.md (100%) rename published/{ => 201703}/20161018 Suspend to Idle.md (100%) rename published/{ => 201703}/20161207 Manage Samba4 AD Domain Controller DNS and Group Policy from Windows – Part 4.md (100%) rename published/{ => 201703}/20170101 FTPS vs SFTP.md (100%) rename published/{ => 201703}/20170109 How to record a region of your desktop as animated GIF on Linux.md (100%) rename published/{ => 201703}/20170111 Explore climate data with open source tools.md (100%) rename published/{ => 201703}/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md (100%) rename published/{ => 201703}/20170111 Linux command line navigation tips and tricks - part 1.md (100%) rename published/{ => 201703}/20170111 NMAP Common Scans – Part One.md (100%) rename published/{ => 201703}/20170113 How to Speed up Odoo copy.md (100%) rename published/{ => 201703}/20170116 Terrible Ideas in Git.md (100%) rename published/{ => 201703}/20170116 Use Docker remotely on Atomic Host.md (100%) rename published/{ => 201703}/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md (100%) rename published/{ => 201703}/20170117 How to Keep Hackers out of Your Linux Machine Part 2 Three More Easy Security Tips.md (100%) rename published/{ => 201703}/20170118 Do I need to provide access to source code under the AGPLv3 license.md (100%) rename published/{ => 201703}/20170118 Why Linux Installers Need to Add Security Features.md (100%) rename published/{ => 201703}/20170119 Get to know Tuleap for project management.md (100%) rename published/{ => 201703}/20170119 Long-term Embedded Linux Maintenance Made Easier.md (100%) rename published/{ => 201703}/20170120 How to write web apps in R with Shiny.md (100%) rename published/{ => 201703}/20170124 Compile-time assertions in Go.md (100%) rename published/{ => 201703}/20170126 How to join a technical community.md (100%) rename published/{ => 201703}/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md (100%) rename published/{ => 201703}/20170130 How to get up and running with sweet Orange Pi.md (100%) rename published/{ => 201703}/20170201 Protecting Your Privacy With Firefox on Linux.md (100%) rename published/{ => 201703}/20170202 How to Configure Custom SSH Connections to Simplify Remote Access.md (100%) rename published/{ => 201703}/20170204 How to Configure Network Between Guest VM and Host in Oracle VirtualBox.md (100%) rename published/{ => 201703}/20170207 How To Write and Use Custom Shell Functions and Libraries.md (100%) rename published/{ => 201703}/20170208 free – A Standard Command to Check Memory Usage Statistics in Linux.md (100%) rename published/{ => 201703}/20170210 5 Linux Music Players You Should Consider Switching To.md (100%) rename published/{ => 201703}/20170210 How to perform search operations in Vim.md (100%) rename published/{ => 201703}/20170213 A beginners guide to understanding sudo on Ubuntu.md (100%) rename published/{ => 201703}/20170213 How to Auto Execute CommandsScripts During Reboot or Startup.md (100%) rename published/{ => 201703}/20170213 Orange Pi as Time Machine Server.md (100%) rename published/{ => 201703}/20170213 Set Up and Configure a Firewall with FirewallD on CentOS 7.md (100%) rename published/{ => 201703}/20170213 The Best Operating System for Linux Gaming Which One Do You Use and Why.md (100%) rename published/{ => 201703}/20170214 CentOS-vs-Ubuntu.md (100%) rename published/{ => 201703}/20170214 How to Install Ubuntu with Separate Root and Home Hard Drives.md (100%) rename published/{ => 201703}/20170215 Best Windows Like Linux Distributions For New Linux Users.md (100%) rename published/{ => 201703}/20170215 Generate random data for your applications with Elizabeth.md (100%) rename published/{ => 201703}/20170215 How to change the Linux Boot Splash screen.md (100%) rename published/{ => 201703}/20170215 openSUSE on Raspberry Pi 3.md (100%) rename published/{ => 201703}/20170216 Getting Started with PowerShell 6.0 in Linux.md (100%) rename published/{ => 201703}/20170216 MASTER Cpp PROGRAMMING WITH OPEN-SOURCE BOOKS.md (100%) rename published/{ => 201703}/20170219 Windows wins the desktop, but Linux takes the world.md (100%) rename published/{ => 201703}/20170220 How to create your own Linux Distribution with Yocto on Ubuntu.md (100%) rename published/{ => 201703}/20170221 How to Install and Configure FTP Server in Ubuntu.md (100%) rename published/{ => 201703}/20170221 How to access shell or run external commands from within Vim.md (100%) rename published/{ => 201703}/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md (100%) rename published/{ => 201703}/20170223 How to install Arch Linux on VirtualBox.md (100%) rename published/{ => 201703}/20170224 Setting Up a Secure FTP Server using SSL-TLS on Ubuntu.md (100%) rename published/{ => 201703}/20170225 How to Upload or Download Files-Directories Using sFTP in Linux.md (100%) rename published/{ => 201703}/20170227 How to Install MariaDB 10 on Debian and Ubuntu.md (100%) rename published/{ => 201703}/20170227 How to setup a Linux server on Amazon AWS.md (100%) rename published/{ => 201703}/20170228 How to Install and Secure MariaDB 10 in CentOS 7.md (100%) rename published/{ => 201703}/20170301 How to Install or Upgrade to Latest Kernel Version in CentOS 7.md (100%) rename published/{ => 201703}/20170304 7 Ways to Determine the File System Type in Linux.md (100%) rename published/{ => 201703}/20170306 How to Upgrade Kernel to Latest Version in Ubuntu.md (100%) rename published/{ => 201703}/20170307 How to make release notes count.md (100%) rename published/{ => 201703}/20170308 How to Reset MySQL or MariaDB Root Password in Linux.md (100%) rename published/{ => 201703}/20170309 How to Change Root Password of MySQL or MariaDB in Linux.md (100%) rename published/{ => 201703}/20170310 Restrict SSH User Access to Certain Directory Using Chrooted Jail.md (100%) rename published/{ => 201703}/20170311 6 Best PDF Page Cropping Tools For Linux.md (100%) rename published/{ => 201703}/20170314 binary tree.md (100%) rename published/{ => 201703}/20170316 How to Install Latest Python 3.6 Version in Linux.md (100%) rename published/{ => 201703}/20170317 Kgif – A Simple Shell Script to Create a Gif File from Active Window.md (100%) rename published/{ => 201703}/20170317 The End of the Line for EPEL-5.md (100%) rename published/{ => 201703}/20170320 ELRepo – Community Repo for Enterprise Linux RHEL CentOS SL.md (100%) rename published/{ => 201703}/20170323 3 open source link shorteners.md (100%) rename published/{ => 201703}/20170324 This Xfce Bug Is Wrecking Users Monitors.md (100%) rename published/{ => 201703}/20170325 How to Install a DHCP Server in Ubuntu and Debian.md (100%) diff --git a/published/20131113 Your visual how-to guide for SELinux policy enforcement.md b/published/201703/20131113 Your visual how-to guide for SELinux policy enforcement.md similarity index 100% rename from published/20131113 Your visual how-to guide for SELinux policy enforcement.md rename to published/201703/20131113 Your visual how-to guide for SELinux policy enforcement.md diff --git a/published/20150413 Why most High Level Languages are Slow.md b/published/201703/20150413 Why most High Level Languages are Slow.md similarity index 100% rename from published/20150413 Why most High Level Languages are Slow.md rename to published/201703/20150413 Why most High Level Languages are Slow.md diff --git a/published/20151127 5 ways to change GRUB background in Kali Linux.md b/published/201703/20151127 5 ways to change GRUB background in Kali Linux.md similarity index 100% rename from published/20151127 5 ways to change GRUB background in Kali Linux.md rename to published/201703/20151127 5 ways to change GRUB background in Kali Linux.md diff --git a/published/20160104 How to Change Linux IO Scheduler.md b/published/201703/20160104 How to Change Linux IO Scheduler.md similarity index 100% rename from published/20160104 How to Change Linux IO Scheduler.md rename to published/201703/20160104 How to Change Linux IO Scheduler.md diff --git a/published/20160917 A Web Crawler With asyncio Coroutines.md b/published/201703/20160917 A Web Crawler With asyncio Coroutines.md similarity index 100% rename from published/20160917 A Web Crawler With asyncio Coroutines.md rename to published/201703/20160917 A Web Crawler With asyncio Coroutines.md diff --git a/published/20161018 Suspend to Idle.md b/published/201703/20161018 Suspend to Idle.md similarity index 100% rename from published/20161018 Suspend to Idle.md rename to published/201703/20161018 Suspend to Idle.md diff --git a/published/20161207 Manage Samba4 AD Domain Controller DNS and Group Policy from Windows – Part 4.md b/published/201703/20161207 Manage Samba4 AD Domain Controller DNS and Group Policy from Windows – Part 4.md similarity index 100% rename from published/20161207 Manage Samba4 AD Domain Controller DNS and Group Policy from Windows – Part 4.md rename to published/201703/20161207 Manage Samba4 AD Domain Controller DNS and Group Policy from Windows – Part 4.md diff --git a/published/20170101 FTPS vs SFTP.md b/published/201703/20170101 FTPS vs SFTP.md similarity index 100% rename from published/20170101 FTPS vs SFTP.md rename to published/201703/20170101 FTPS vs SFTP.md diff --git a/published/20170109 How to record a region of your desktop as animated GIF on Linux.md b/published/201703/20170109 How to record a region of your desktop as animated GIF on Linux.md similarity index 100% rename from published/20170109 How to record a region of your desktop as animated GIF on Linux.md rename to published/201703/20170109 How to record a region of your desktop as animated GIF on Linux.md diff --git a/published/20170111 Explore climate data with open source tools.md b/published/201703/20170111 Explore climate data with open source tools.md similarity index 100% rename from published/20170111 Explore climate data with open source tools.md rename to published/201703/20170111 Explore climate data with open source tools.md diff --git a/published/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md b/published/201703/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md similarity index 100% rename from published/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md rename to published/201703/20170111 Join an Additional Ubuntu DC to Samba4 AD DC for FailOver Replication – Part 5.md diff --git a/published/20170111 Linux command line navigation tips and tricks - part 1.md b/published/201703/20170111 Linux command line navigation tips and tricks - part 1.md similarity index 100% rename from published/20170111 Linux command line navigation tips and tricks - part 1.md rename to published/201703/20170111 Linux command line navigation tips and tricks - part 1.md diff --git a/published/20170111 NMAP Common Scans – Part One.md b/published/201703/20170111 NMAP Common Scans – Part One.md similarity index 100% rename from published/20170111 NMAP Common Scans – Part One.md rename to published/201703/20170111 NMAP Common Scans – Part One.md diff --git a/published/20170113 How to Speed up Odoo copy.md b/published/201703/20170113 How to Speed up Odoo copy.md similarity index 100% rename from published/20170113 How to Speed up Odoo copy.md rename to published/201703/20170113 How to Speed up Odoo copy.md diff --git a/published/20170116 Terrible Ideas in Git.md b/published/201703/20170116 Terrible Ideas in Git.md similarity index 100% rename from published/20170116 Terrible Ideas in Git.md rename to published/201703/20170116 Terrible Ideas in Git.md diff --git a/published/20170116 Use Docker remotely on Atomic Host.md b/published/201703/20170116 Use Docker remotely on Atomic Host.md similarity index 100% rename from published/20170116 Use Docker remotely on Atomic Host.md rename to published/201703/20170116 Use Docker remotely on Atomic Host.md diff --git a/published/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md b/published/201703/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md similarity index 100% rename from published/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md rename to published/201703/20170117 How to Install WordPress with HHVM and Nginx on CentOS 7.md diff --git a/published/20170117 How to Keep Hackers out of Your Linux Machine Part 2 Three More Easy Security Tips.md b/published/201703/20170117 How to Keep Hackers out of Your Linux Machine Part 2 Three More Easy Security Tips.md similarity index 100% rename from published/20170117 How to Keep Hackers out of Your Linux Machine Part 2 Three More Easy Security Tips.md rename to published/201703/20170117 How to Keep Hackers out of Your Linux Machine Part 2 Three More Easy Security Tips.md diff --git a/published/20170118 Do I need to provide access to source code under the AGPLv3 license.md b/published/201703/20170118 Do I need to provide access to source code under the AGPLv3 license.md similarity index 100% rename from published/20170118 Do I need to provide access to source code under the AGPLv3 license.md rename to published/201703/20170118 Do I need to provide access to source code under the AGPLv3 license.md diff --git a/published/20170118 Why Linux Installers Need to Add Security Features.md b/published/201703/20170118 Why Linux Installers Need to Add Security Features.md similarity index 100% rename from published/20170118 Why Linux Installers Need to Add Security Features.md rename to published/201703/20170118 Why Linux Installers Need to Add Security Features.md diff --git a/published/20170119 Get to know Tuleap for project management.md b/published/201703/20170119 Get to know Tuleap for project management.md similarity index 100% rename from published/20170119 Get to know Tuleap for project management.md rename to published/201703/20170119 Get to know Tuleap for project management.md diff --git a/published/20170119 Long-term Embedded Linux Maintenance Made Easier.md b/published/201703/20170119 Long-term Embedded Linux Maintenance Made Easier.md similarity index 100% rename from published/20170119 Long-term Embedded Linux Maintenance Made Easier.md rename to published/201703/20170119 Long-term Embedded Linux Maintenance Made Easier.md diff --git a/published/20170120 How to write web apps in R with Shiny.md b/published/201703/20170120 How to write web apps in R with Shiny.md similarity index 100% rename from published/20170120 How to write web apps in R with Shiny.md rename to published/201703/20170120 How to write web apps in R with Shiny.md diff --git a/published/20170124 Compile-time assertions in Go.md b/published/201703/20170124 Compile-time assertions in Go.md similarity index 100% rename from published/20170124 Compile-time assertions in Go.md rename to published/201703/20170124 Compile-time assertions in Go.md diff --git a/published/20170126 How to join a technical community.md b/published/201703/20170126 How to join a technical community.md similarity index 100% rename from published/20170126 How to join a technical community.md rename to published/201703/20170126 How to join a technical community.md diff --git a/published/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md b/published/201703/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md similarity index 100% rename from published/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md rename to published/201703/20170128 Wkhtmltopdf – A Smart Tool to Convert Website HTML Page to PDF in Linux.md diff --git a/published/20170130 How to get up and running with sweet Orange Pi.md b/published/201703/20170130 How to get up and running with sweet Orange Pi.md similarity index 100% rename from published/20170130 How to get up and running with sweet Orange Pi.md rename to published/201703/20170130 How to get up and running with sweet Orange Pi.md diff --git a/published/20170201 Protecting Your Privacy With Firefox on Linux.md b/published/201703/20170201 Protecting Your Privacy With Firefox on Linux.md similarity index 100% rename from published/20170201 Protecting Your Privacy With Firefox on Linux.md rename to published/201703/20170201 Protecting Your Privacy With Firefox on Linux.md diff --git a/published/20170202 How to Configure Custom SSH Connections to Simplify Remote Access.md b/published/201703/20170202 How to Configure Custom SSH Connections to Simplify Remote Access.md similarity index 100% rename from published/20170202 How to Configure Custom SSH Connections to Simplify Remote Access.md rename to published/201703/20170202 How to Configure Custom SSH Connections to Simplify Remote Access.md diff --git a/published/20170204 How to Configure Network Between Guest VM and Host in Oracle VirtualBox.md b/published/201703/20170204 How to Configure Network Between Guest VM and Host in Oracle VirtualBox.md similarity index 100% rename from published/20170204 How to Configure Network Between Guest VM and Host in Oracle VirtualBox.md rename to published/201703/20170204 How to Configure Network Between Guest VM and Host in Oracle VirtualBox.md diff --git a/published/20170207 How To Write and Use Custom Shell Functions and Libraries.md b/published/201703/20170207 How To Write and Use Custom Shell Functions and Libraries.md similarity index 100% rename from published/20170207 How To Write and Use Custom Shell Functions and Libraries.md rename to published/201703/20170207 How To Write and Use Custom Shell Functions and Libraries.md diff --git a/published/20170208 free – A Standard Command to Check Memory Usage Statistics in Linux.md b/published/201703/20170208 free – A Standard Command to Check Memory Usage Statistics in Linux.md similarity index 100% rename from published/20170208 free – A Standard Command to Check Memory Usage Statistics in Linux.md rename to published/201703/20170208 free – A Standard Command to Check Memory Usage Statistics in Linux.md diff --git a/published/20170210 5 Linux Music Players You Should Consider Switching To.md b/published/201703/20170210 5 Linux Music Players You Should Consider Switching To.md similarity index 100% rename from published/20170210 5 Linux Music Players You Should Consider Switching To.md rename to published/201703/20170210 5 Linux Music Players You Should Consider Switching To.md diff --git a/published/20170210 How to perform search operations in Vim.md b/published/201703/20170210 How to perform search operations in Vim.md similarity index 100% rename from published/20170210 How to perform search operations in Vim.md rename to published/201703/20170210 How to perform search operations in Vim.md diff --git a/published/20170213 A beginners guide to understanding sudo on Ubuntu.md b/published/201703/20170213 A beginners guide to understanding sudo on Ubuntu.md similarity index 100% rename from published/20170213 A beginners guide to understanding sudo on Ubuntu.md rename to published/201703/20170213 A beginners guide to understanding sudo on Ubuntu.md diff --git a/published/20170213 How to Auto Execute CommandsScripts During Reboot or Startup.md b/published/201703/20170213 How to Auto Execute CommandsScripts During Reboot or Startup.md similarity index 100% rename from published/20170213 How to Auto Execute CommandsScripts During Reboot or Startup.md rename to published/201703/20170213 How to Auto Execute CommandsScripts During Reboot or Startup.md diff --git a/published/20170213 Orange Pi as Time Machine Server.md b/published/201703/20170213 Orange Pi as Time Machine Server.md similarity index 100% rename from published/20170213 Orange Pi as Time Machine Server.md rename to published/201703/20170213 Orange Pi as Time Machine Server.md diff --git a/published/20170213 Set Up and Configure a Firewall with FirewallD on CentOS 7.md b/published/201703/20170213 Set Up and Configure a Firewall with FirewallD on CentOS 7.md similarity index 100% rename from published/20170213 Set Up and Configure a Firewall with FirewallD on CentOS 7.md rename to published/201703/20170213 Set Up and Configure a Firewall with FirewallD on CentOS 7.md diff --git a/published/20170213 The Best Operating System for Linux Gaming Which One Do You Use and Why.md b/published/201703/20170213 The Best Operating System for Linux Gaming Which One Do You Use and Why.md similarity index 100% rename from published/20170213 The Best Operating System for Linux Gaming Which One Do You Use and Why.md rename to published/201703/20170213 The Best Operating System for Linux Gaming Which One Do You Use and Why.md diff --git a/published/20170214 CentOS-vs-Ubuntu.md b/published/201703/20170214 CentOS-vs-Ubuntu.md similarity index 100% rename from published/20170214 CentOS-vs-Ubuntu.md rename to published/201703/20170214 CentOS-vs-Ubuntu.md diff --git a/published/20170214 How to Install Ubuntu with Separate Root and Home Hard Drives.md b/published/201703/20170214 How to Install Ubuntu with Separate Root and Home Hard Drives.md similarity index 100% rename from published/20170214 How to Install Ubuntu with Separate Root and Home Hard Drives.md rename to published/201703/20170214 How to Install Ubuntu with Separate Root and Home Hard Drives.md diff --git a/published/20170215 Best Windows Like Linux Distributions For New Linux Users.md b/published/201703/20170215 Best Windows Like Linux Distributions For New Linux Users.md similarity index 100% rename from published/20170215 Best Windows Like Linux Distributions For New Linux Users.md rename to published/201703/20170215 Best Windows Like Linux Distributions For New Linux Users.md diff --git a/published/20170215 Generate random data for your applications with Elizabeth.md b/published/201703/20170215 Generate random data for your applications with Elizabeth.md similarity index 100% rename from published/20170215 Generate random data for your applications with Elizabeth.md rename to published/201703/20170215 Generate random data for your applications with Elizabeth.md diff --git a/published/20170215 How to change the Linux Boot Splash screen.md b/published/201703/20170215 How to change the Linux Boot Splash screen.md similarity index 100% rename from published/20170215 How to change the Linux Boot Splash screen.md rename to published/201703/20170215 How to change the Linux Boot Splash screen.md diff --git a/published/20170215 openSUSE on Raspberry Pi 3.md b/published/201703/20170215 openSUSE on Raspberry Pi 3.md similarity index 100% rename from published/20170215 openSUSE on Raspberry Pi 3.md rename to published/201703/20170215 openSUSE on Raspberry Pi 3.md diff --git a/published/20170216 Getting Started with PowerShell 6.0 in Linux.md b/published/201703/20170216 Getting Started with PowerShell 6.0 in Linux.md similarity index 100% rename from published/20170216 Getting Started with PowerShell 6.0 in Linux.md rename to published/201703/20170216 Getting Started with PowerShell 6.0 in Linux.md diff --git a/published/20170216 MASTER Cpp PROGRAMMING WITH OPEN-SOURCE BOOKS.md b/published/201703/20170216 MASTER Cpp PROGRAMMING WITH OPEN-SOURCE BOOKS.md similarity index 100% rename from published/20170216 MASTER Cpp PROGRAMMING WITH OPEN-SOURCE BOOKS.md rename to published/201703/20170216 MASTER Cpp PROGRAMMING WITH OPEN-SOURCE BOOKS.md diff --git a/published/20170219 Windows wins the desktop, but Linux takes the world.md b/published/201703/20170219 Windows wins the desktop, but Linux takes the world.md similarity index 100% rename from published/20170219 Windows wins the desktop, but Linux takes the world.md rename to published/201703/20170219 Windows wins the desktop, but Linux takes the world.md diff --git a/published/20170220 How to create your own Linux Distribution with Yocto on Ubuntu.md b/published/201703/20170220 How to create your own Linux Distribution with Yocto on Ubuntu.md similarity index 100% rename from published/20170220 How to create your own Linux Distribution with Yocto on Ubuntu.md rename to published/201703/20170220 How to create your own Linux Distribution with Yocto on Ubuntu.md diff --git a/published/20170221 How to Install and Configure FTP Server in Ubuntu.md b/published/201703/20170221 How to Install and Configure FTP Server in Ubuntu.md similarity index 100% rename from published/20170221 How to Install and Configure FTP Server in Ubuntu.md rename to published/201703/20170221 How to Install and Configure FTP Server in Ubuntu.md diff --git a/published/20170221 How to access shell or run external commands from within Vim.md b/published/201703/20170221 How to access shell or run external commands from within Vim.md similarity index 100% rename from published/20170221 How to access shell or run external commands from within Vim.md rename to published/201703/20170221 How to access shell or run external commands from within Vim.md diff --git a/published/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md b/published/201703/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md similarity index 100% rename from published/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md rename to published/201703/20170222 Introduction to LaTeXila - a multi-language LaTeX editor for Linux.md diff --git a/published/20170223 How to install Arch Linux on VirtualBox.md b/published/201703/20170223 How to install Arch Linux on VirtualBox.md similarity index 100% rename from published/20170223 How to install Arch Linux on VirtualBox.md rename to published/201703/20170223 How to install Arch Linux on VirtualBox.md diff --git a/published/20170224 Setting Up a Secure FTP Server using SSL-TLS on Ubuntu.md b/published/201703/20170224 Setting Up a Secure FTP Server using SSL-TLS on Ubuntu.md similarity index 100% rename from published/20170224 Setting Up a Secure FTP Server using SSL-TLS on Ubuntu.md rename to published/201703/20170224 Setting Up a Secure FTP Server using SSL-TLS on Ubuntu.md diff --git a/published/20170225 How to Upload or Download Files-Directories Using sFTP in Linux.md b/published/201703/20170225 How to Upload or Download Files-Directories Using sFTP in Linux.md similarity index 100% rename from published/20170225 How to Upload or Download Files-Directories Using sFTP in Linux.md rename to published/201703/20170225 How to Upload or Download Files-Directories Using sFTP in Linux.md diff --git a/published/20170227 How to Install MariaDB 10 on Debian and Ubuntu.md b/published/201703/20170227 How to Install MariaDB 10 on Debian and Ubuntu.md similarity index 100% rename from published/20170227 How to Install MariaDB 10 on Debian and Ubuntu.md rename to published/201703/20170227 How to Install MariaDB 10 on Debian and Ubuntu.md diff --git a/published/20170227 How to setup a Linux server on Amazon AWS.md b/published/201703/20170227 How to setup a Linux server on Amazon AWS.md similarity index 100% rename from published/20170227 How to setup a Linux server on Amazon AWS.md rename to published/201703/20170227 How to setup a Linux server on Amazon AWS.md diff --git a/published/20170228 How to Install and Secure MariaDB 10 in CentOS 7.md b/published/201703/20170228 How to Install and Secure MariaDB 10 in CentOS 7.md similarity index 100% rename from published/20170228 How to Install and Secure MariaDB 10 in CentOS 7.md rename to published/201703/20170228 How to Install and Secure MariaDB 10 in CentOS 7.md diff --git a/published/20170301 How to Install or Upgrade to Latest Kernel Version in CentOS 7.md b/published/201703/20170301 How to Install or Upgrade to Latest Kernel Version in CentOS 7.md similarity index 100% rename from published/20170301 How to Install or Upgrade to Latest Kernel Version in CentOS 7.md rename to published/201703/20170301 How to Install or Upgrade to Latest Kernel Version in CentOS 7.md diff --git a/published/20170304 7 Ways to Determine the File System Type in Linux.md b/published/201703/20170304 7 Ways to Determine the File System Type in Linux.md similarity index 100% rename from published/20170304 7 Ways to Determine the File System Type in Linux.md rename to published/201703/20170304 7 Ways to Determine the File System Type in Linux.md diff --git a/published/20170306 How to Upgrade Kernel to Latest Version in Ubuntu.md b/published/201703/20170306 How to Upgrade Kernel to Latest Version in Ubuntu.md similarity index 100% rename from published/20170306 How to Upgrade Kernel to Latest Version in Ubuntu.md rename to published/201703/20170306 How to Upgrade Kernel to Latest Version in Ubuntu.md diff --git a/published/20170307 How to make release notes count.md b/published/201703/20170307 How to make release notes count.md similarity index 100% rename from published/20170307 How to make release notes count.md rename to published/201703/20170307 How to make release notes count.md diff --git a/published/20170308 How to Reset MySQL or MariaDB Root Password in Linux.md b/published/201703/20170308 How to Reset MySQL or MariaDB Root Password in Linux.md similarity index 100% rename from published/20170308 How to Reset MySQL or MariaDB Root Password in Linux.md rename to published/201703/20170308 How to Reset MySQL or MariaDB Root Password in Linux.md diff --git a/published/20170309 How to Change Root Password of MySQL or MariaDB in Linux.md b/published/201703/20170309 How to Change Root Password of MySQL or MariaDB in Linux.md similarity index 100% rename from published/20170309 How to Change Root Password of MySQL or MariaDB in Linux.md rename to published/201703/20170309 How to Change Root Password of MySQL or MariaDB in Linux.md diff --git a/published/20170310 Restrict SSH User Access to Certain Directory Using Chrooted Jail.md b/published/201703/20170310 Restrict SSH User Access to Certain Directory Using Chrooted Jail.md similarity index 100% rename from published/20170310 Restrict SSH User Access to Certain Directory Using Chrooted Jail.md rename to published/201703/20170310 Restrict SSH User Access to Certain Directory Using Chrooted Jail.md diff --git a/published/20170311 6 Best PDF Page Cropping Tools For Linux.md b/published/201703/20170311 6 Best PDF Page Cropping Tools For Linux.md similarity index 100% rename from published/20170311 6 Best PDF Page Cropping Tools For Linux.md rename to published/201703/20170311 6 Best PDF Page Cropping Tools For Linux.md diff --git a/published/20170314 binary tree.md b/published/201703/20170314 binary tree.md similarity index 100% rename from published/20170314 binary tree.md rename to published/201703/20170314 binary tree.md diff --git a/published/20170316 How to Install Latest Python 3.6 Version in Linux.md b/published/201703/20170316 How to Install Latest Python 3.6 Version in Linux.md similarity index 100% rename from published/20170316 How to Install Latest Python 3.6 Version in Linux.md rename to published/201703/20170316 How to Install Latest Python 3.6 Version in Linux.md diff --git a/published/20170317 Kgif – A Simple Shell Script to Create a Gif File from Active Window.md b/published/201703/20170317 Kgif – A Simple Shell Script to Create a Gif File from Active Window.md similarity index 100% rename from published/20170317 Kgif – A Simple Shell Script to Create a Gif File from Active Window.md rename to published/201703/20170317 Kgif – A Simple Shell Script to Create a Gif File from Active Window.md diff --git a/published/20170317 The End of the Line for EPEL-5.md b/published/201703/20170317 The End of the Line for EPEL-5.md similarity index 100% rename from published/20170317 The End of the Line for EPEL-5.md rename to published/201703/20170317 The End of the Line for EPEL-5.md diff --git a/published/20170320 ELRepo – Community Repo for Enterprise Linux RHEL CentOS SL.md b/published/201703/20170320 ELRepo – Community Repo for Enterprise Linux RHEL CentOS SL.md similarity index 100% rename from published/20170320 ELRepo – Community Repo for Enterprise Linux RHEL CentOS SL.md rename to published/201703/20170320 ELRepo – Community Repo for Enterprise Linux RHEL CentOS SL.md diff --git a/published/20170323 3 open source link shorteners.md b/published/201703/20170323 3 open source link shorteners.md similarity index 100% rename from published/20170323 3 open source link shorteners.md rename to published/201703/20170323 3 open source link shorteners.md diff --git a/published/20170324 This Xfce Bug Is Wrecking Users Monitors.md b/published/201703/20170324 This Xfce Bug Is Wrecking Users Monitors.md similarity index 100% rename from published/20170324 This Xfce Bug Is Wrecking Users Monitors.md rename to published/201703/20170324 This Xfce Bug Is Wrecking Users Monitors.md diff --git a/published/20170325 How to Install a DHCP Server in Ubuntu and Debian.md b/published/201703/20170325 How to Install a DHCP Server in Ubuntu and Debian.md similarity index 100% rename from published/20170325 How to Install a DHCP Server in Ubuntu and Debian.md rename to published/201703/20170325 How to Install a DHCP Server in Ubuntu and Debian.md From ef16f0d6b395b4735e9b03c6db91680f052d35fe Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 1 Apr 2017 08:52:56 +0800 Subject: [PATCH 060/241] PRF&PUB:20160708 Manjaro Linux explained.md @Chao-zhi --- .../20160708 Manjaro Linux explained.md | 66 +++++++++++++++++++ .../20160708 Manjaro Linux explained.md | 56 ---------------- 2 files changed, 66 insertions(+), 56 deletions(-) create mode 100644 published/linux-distro-explain/20160708 Manjaro Linux explained.md delete mode 100644 translated/tech/linux-distro -explain/20160708 Manjaro Linux explained.md diff --git a/published/linux-distro-explain/20160708 Manjaro Linux explained.md b/published/linux-distro-explain/20160708 Manjaro Linux explained.md new file mode 100644 index 0000000000..136d89bd18 --- /dev/null +++ b/published/linux-distro-explain/20160708 Manjaro Linux explained.md @@ -0,0 +1,66 @@ +一个值得推荐的发行版:Manjaro Linux +========= + +这个系列的第七篇,我们来说一说什么是 Manjaro。[Manjaro](https://manjaro.org/) 是基于 Arch Linux 并且拥有一个漂亮的用户界面的操作系统。 Manjaro 并不像 Debian 或者 Arch 这些 Linux 发行版一样历史悠久,但是它依然十分的稳定而可靠,从而在各色发行版中显得鹤立鸡群。2011 年 Manjaro 才推出了第一个版本。从那以后它一直在不断的进步,今天最新的版本为 16.06.1,代号为 “Daniella”。(LCTT 译注:本文写作于 2016 年,当下最新版本是:17.0 ) + +**为什么我认为 Manjaro 超越了其他的发行版?** 我并没有强求你使用 Manjaro 来替代其他发行版,但是我会尝试说服你来使用 Manjaro。那么让我开始吧! + +### 基于 Arch + +就像许多人已经知道的那样,不开玩笑的说 Arch 绝对是一个优秀的发行版。但是它对于新手来说十分难以使用。许多新手根本就无法在非图形界面下完成 Arch 的安装。与之相反,Manjaro 有着一个好用的图形安装界面。所以那些想要尝试 Arch 但是又被它的高难度操作所困扰的人们可以去试试 Manjaro。Manjaro 很容易安装并且有着一个友好的用户界面。 + +### 桌面环境 + +Manjaro 在桌面环境上有着许多选择,比如 Xfce、KDE、Deepin、BspWM、Budgie、i3、LXDE、Cinnamon、Enlightenment、Netbook、Fluxbox、Gnome、JWM、LXQT、MATE、Openbox 和 PekWM。所有这些桌面环境在 Manjaro 中都十分漂亮。Manjaro 官方的桌面环境是 Xfce 和 KDE,而其他桌面环境则是社区支持的,我现在就是在 Manjaro 16.06.1 中使用 KDE Plasma 桌面环境。 +[ + ![Manjaro 16.06.1 with KDE plasma 5.6.5](https://4.bp.blogspot.com/-PvT_KN4_avM/V3_eMdhSAvI/AAAAAAAABLY/jjQDrV6dXOw9_vcS5XD3-kZy-chWsR1PQCLcB/s640/Desktop%2B1_001.png "Manjaro 16.06.1 with KDE plasma 5.6.5") +][7] + +*运行着 KDE plasma 5.6.5 的 Manjaro 16.06.1* + +如果你不喜欢 Manjaro 中的 KDE 或者 Xfce,不用担心,你可以从软件包管理器中随时安装其他桌面环境。 + + [ + ![Manjaro 16.06.1 with KDE plasma 5.6.5](https://1.bp.blogspot.com/-vxZ3bI1TTA4/V3_ePOiQG5I/AAAAAAAABLg/ANw2qSmRTVcxl0JZEsUxNGciBdkwuvt9wCKgB/s640/Screenshot_20160708_223023.png "Manjaro 16.06.1 with KDE plasma 5.6.5") +][8] + +*从软件包管理器中下载 Budgie 桌面环境。* + +### 稳定并且独特的包管理机制 + +虽然 Manjaro 很新,但是它也很稳定。Manjaro 的最后一个版本装载的是Linux 内核 4.6.2。Manjaro 不仅仅稳定,更新也比较快。软件更新不久后,就会被它编译到它的库中。Manjaro 用 pacman 来管理它的软件包。Arch Linux 因 Pacman 而名震天下 (当然也饱受争议)。Manjaro 则使用 Octopi 来使其变得更加用户友好,Octopi 是一个用 Qt 编写的 pacman 的图形前端。Manjaro 很好的维护了他自己的库,这也是它的一个优势。 + +[ + ![Manjaro 16.06.1 with KDE plasma 5.6.5](https://1.bp.blogspot.com/-vxZ3bI1TTA4/V3_ePOiQG5I/AAAAAAAABLg/ANw2qSmRTVcxl0JZEsUxNGciBdkwuvt9wCKgB/s640/Screenshot_20160708_223023.png "Manjaro 16.06.1 with KDE plasma 5.6.5") +][9] + +*Octopi 软件包管理器* + +### 社区支持 + +和其他发行版一样,Manjaro 也是一个基于社区的 linux 发行版。当你需要的时候,社区里总是会有人来帮助你。除了 Xfce 和 KDE 是官方支持的以外,其他所有桌面的编译和维护都是由社区完成的。任何用户有了疑问都可以到社区来寻求帮助,这里总是会有真实的 Manjaro 用户来帮助你。 + +在这里,我仅仅只列出了这么几点原因,但是如果你开始使用它了,你会发现更多惊喜的。 + +**还在考虑是否安装它?** 如果你还在彷徨与是否使用 Manjaro 你可以先在 Virtualbox 中试试它,然后再考虑在实体机中安装它。如果你喜欢它,请在这个话题下评论吧,欢迎点赞,关注,丢香蕉给我们,么么哒。 + +-------------------------------------------------------------------------------- + +原文: http://www.techphylum.com/2016/07/manjaro-linux-explained.html + +作者:[sumit rohankar][a] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/112160169713374382262 +[1]:http://www.techphylum.com/2014/08/linux-deepin-distro-with-unique-style.html +[2]:http://www.techphylum.com/2014/06/linux-mint-introduction.html +[3]:http://www.techphylum.com/2014/05/elementary-os-brief-introduction.html +[4]:http://www.techphylum.com/2014/05/Introduction-to-fedora.html +[5]:http://www.techphylum.com/2014/05/what-is-opensuse-introduction.html +[6]:http://www.techphylum.com/2014/05/what-is-debian-brief-introduction.html +[7]:https://4.bp.blogspot.com/-PvT_KN4_avM/V3_eMdhSAvI/AAAAAAAABLY/jjQDrV6dXOw9_vcS5XD3-kZy-chWsR1PQCLcB/s1600/Desktop%2B1_001.png +[8]:https://1.bp.blogspot.com/-vxZ3bI1TTA4/V3_ePOiQG5I/AAAAAAAABLg/ANw2qSmRTVcxl0JZEsUxNGciBdkwuvt9wCKgB/s1600/Screenshot_20160708_223023.png +[9]:https://1.bp.blogspot.com/-vxZ3bI1TTA4/V3_ePOiQG5I/AAAAAAAABLg/ANw2qSmRTVcxl0JZEsUxNGciBdkwuvt9wCKgB/s1600/Screenshot_20160708_223023.png diff --git a/translated/tech/linux-distro -explain/20160708 Manjaro Linux explained.md b/translated/tech/linux-distro -explain/20160708 Manjaro Linux explained.md deleted file mode 100644 index 1f268f7416..0000000000 --- a/translated/tech/linux-distro -explain/20160708 Manjaro Linux explained.md +++ /dev/null @@ -1,56 +0,0 @@ -# 什么是 Manjaro Linux 操作系统? - -这个系列的第七篇,我们来说一说什么是 Manjaro。Manjaro 是基于 Arch Linux 并且拥有一个漂亮的用户界面的操作系统。 Manjaro 并不像 Debian 或者 Arch 这些 Linux 发行版一样古老,但是他依然十分的稳定而可靠,从而在各色发行版中显得鹤立鸡群。2011 年 Manjaro 才推出了第一个版本。从那以后它一直在不断的进步,今天最新的版本为 16.06.1,代号为 “Daniella”。 - -**为什么我认为 Manjaro 超越了其他的发行版?** 我并没有强求你使用 Manjaro 来替代其他发行版,但是我会尝试说服你来使用 Manjaro。那么让我开始吧! - -*   **基于 Arch:**就像许多人已经知道的那样,不开玩笑的说 Arch 绝对是一个优秀的发行版。但是它对于新手来说十分难以使用。许多新手根本就无法在非图形界面下完成 Arch 的安装。与之相反,Manjaro 有着一个好用的图形安装界面。所以那些想要尝试 Arch 但是又被它的高难度操作所困扰的人们可以去试试 Manjaro。Manjaro 很容易安装并且有着一个友好的用户界面。 - -*   **桌面环境:**Manjaro 在桌面环境上有着许多选择,比如 Xfce、KDE、Deepin、BspWM、Budgie、i3、LXDE、Cinnamon、Enlightenment、Netbook、Fluxbox、Gnome、JWM、LXQT、MATE、Openbox 和 PekWM。所有这些桌面环境在 Manjaro 中都十分漂亮。Manjaro 官方的桌面环境是 Xfce 和 KDE,而其他桌面环境则是社区支持的,我现在就是在 Manjaro 16.06.1中使用 KDE Plasma 桌面环境。 - - [ - ![Manjaro 16.06.1 with KDE plasma 5.6.5](https://4.bp.blogspot.com/-PvT_KN4_avM/V3_eMdhSAvI/AAAAAAAABLY/jjQDrV6dXOw9_vcS5XD3-kZy-chWsR1PQCLcB/s640/Desktop%2B1_001.png "Manjaro 16.06.1 with KDE plasma 5.6.5") -][7] - -> 运行着 KDE plasma 5.6.5 的 Manjaro 16.06.1 - -> 如果你不喜欢 Manjaro 中的 KDE 或者 Xfce,不用担心,你可以从软件包管理器中随时安装其他桌面环境。 - - [ - ![Manjaro 16.06.1 with KDE plasma 5.6.5](https://1.bp.blogspot.com/-vxZ3bI1TTA4/V3_ePOiQG5I/AAAAAAAABLg/ANw2qSmRTVcxl0JZEsUxNGciBdkwuvt9wCKgB/s640/Screenshot_20160708_223023.png "Manjaro 16.06.1 with KDE plasma 5.6.5") -][8] -> 从软件包管理器中下载 Budgie 桌面环境。 - -* **稳定并且独特的包管理机制:**虽然 Manjaro 很新,但是它也很稳定。Manjaro 的最后一个版本装载的是Linux 内核 4.6.2。Manjaro 不仅仅稳定,更新也比较快。软件更新不久后,就会被它编译到它的库中。Manjaro 用 pacman 来管理它的软件包。Arch Linux 因 Pacman 而名震天下 (当然也饱受争议)。Manjaro 则使用 Octopi 来使其变得更加用户友好,Octopi 是一个用 Qt 编写的 pacman 的图形前端。Manjaro 很好的维护了他自己的库,这也是它的一个优势。 - -[ - ![Manjaro 16.06.1 with KDE plasma 5.6.5](https://1.bp.blogspot.com/-vxZ3bI1TTA4/V3_ePOiQG5I/AAAAAAAABLg/ANw2qSmRTVcxl0JZEsUxNGciBdkwuvt9wCKgB/s640/Screenshot_20160708_223023.png "Manjaro 16.06.1 with KDE plasma 5.6.5") -][9] ->Octopi 软件包管理器 - -* **社区支持:** 和其他发行版一样,Manjaro 也是一个基于社区的 linux 发行版。当你需要的时候,社区里总是会有人来帮助你。除了 Xfce 和 KDE 是官方支持的以外,其他所有桌面的编译和维护都是由社区完成的。任何用户有了疑问都可以到社区来寻求帮助,这里总是会有真实的 Manjaro 用户来帮助你。 - -在这里,我仅仅只列出了这么几点原因,但是如果你开始使用它了,你会发现更多惊喜的。 - -**还在考虑是否安装它?** 如果你还在彷徨与是否使用 Manjaro 你可以先在 Virtualbox 中试试它,然后再考虑在实体机中安装它。如果你喜欢它,请在这个话题下评论吧,欢迎点赞,关注,丢香蕉给我们,么么哒。 - --------------------------------------------------------------------------------- - -原文: http://www.techphylum.com/2016/07/manjaro-linux-explained.html - -作者:[sumit rohankar ][a] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/112160169713374382262 -[1]:http://www.techphylum.com/2014/08/linux-deepin-distro-with-unique-style.html -[2]:http://www.techphylum.com/2014/06/linux-mint-introduction.html -[3]:http://www.techphylum.com/2014/05/elementary-os-brief-introduction.html -[4]:http://www.techphylum.com/2014/05/Introduction-to-fedora.html -[5]:http://www.techphylum.com/2014/05/what-is-opensuse-introduction.html -[6]:http://www.techphylum.com/2014/05/what-is-debian-brief-introduction.html -[7]:https://4.bp.blogspot.com/-PvT_KN4_avM/V3_eMdhSAvI/AAAAAAAABLY/jjQDrV6dXOw9_vcS5XD3-kZy-chWsR1PQCLcB/s1600/Desktop%2B1_001.png -[8]:https://1.bp.blogspot.com/-vxZ3bI1TTA4/V3_ePOiQG5I/AAAAAAAABLg/ANw2qSmRTVcxl0JZEsUxNGciBdkwuvt9wCKgB/s1600/Screenshot_20160708_223023.png -[9]:https://1.bp.blogspot.com/-vxZ3bI1TTA4/V3_ePOiQG5I/AAAAAAAABLg/ANw2qSmRTVcxl0JZEsUxNGciBdkwuvt9wCKgB/s1600/Screenshot_20160708_223023.png From 996c1374f84f73ce58b5b90bc9190097fdd307ee Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 1 Apr 2017 09:11:11 +0800 Subject: [PATCH 061/241] PUB:20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md @ucasFL @jasminepeng --- ...erminal Emulators For Ubuntu And Fedora.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) rename translated/tech/20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md => published/20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md (87%) diff --git a/translated/tech/20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md b/published/20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md similarity index 87% rename from translated/tech/20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md rename to published/20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md index 872109d884..2a5503ce14 100644 --- a/translated/tech/20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md +++ b/published/20170214 10 Best Linux Terminal Emulators For Ubuntu And Fedora.md @@ -1,10 +1,11 @@ -# [Ubuntu 和 Fedora 上 10 个最好的 Linux 终端仿真器][12] + 10 个常见的 Linux 终端仿真器 +========== [ ![10 Best Linux Terminals](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/10-best-linux-terminals_orig.jpg) ][3] -对于 Linux 用户来说,最重要的应用程序之一就是终端仿真器。它允许每个用户获得对 shell 的访问。Bash 是 Linux 和 UNIX 发行版中最常用的 shell,它很强大,对于新手和高级用户来说,掌握 bash 都很有必要。因此,在这篇文章中,你可以了解 Linux 用户有哪些优秀的终端仿真器可以选择。 +对于 Linux 用户来说,最重要的应用程序之一就是终端仿真器。它允许每个用户获得对 shell 的访问。而 Bash 是 Linux 和 UNIX 发行版中最常用的 shell,它很强大,对于新手和高级用户来说,掌握 bash 都很有必要。因此,在这篇文章中,你可以了解 Linux 用户有哪些优秀的终端仿真器可以选择。 ### 1、Terminator @@ -14,10 +15,10 @@ * 以网格形式排列终端 * Tab 设定 -* 通过拖放重排终端 +* 通过拖放重新排布终端 * 大量的快捷键 * 通过 GUI 参数编辑器保存多个布局和配置文件 -* 同时对不同分组的终端进行输入 +* 同时对任意组合的终端进行输入 [ ![terminator linux terminals](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/terminator-linux-terminals.png?1487082905) @@ -29,9 +30,9 @@ sudo apt-get install terminator ``` -### 2、Tilda - 一个可以拖动的终端 +### 2、Tilda - 一个可以下拉的终端 -**Tilda** 的独特之处在于它不像一个普通的窗口,相反,你可以使用一个特殊的热键从屏幕的顶部上下拖动它。 +**Tilda** 的独特之处在于它不像一个普通的窗口,相反,你可以使用一个特殊的热键从屏幕的顶部拉下和收回它。 另外,Tilda 是高度可配置的,可以自定义绑定热键,改变外观,以及其他许多能够影响 Tilda 特性的选项。 在 Ubuntu 和 Fedora 上都可以使用包管理器安装 Tilda,当然,你也可以查看它的 [GitHub 仓库][14]。 @@ -42,25 +43,26 @@ sudo apt-get install terminator ### 3、Guake -Guake 是一个和 Tilda 或 yakuake 类似的可拖动终端仿真器。如果你知道一些关于 Python、Git 和 GTK 的知识的话,你可以给 Guake 添加一些新的特性。 +Guake 是一个和 Tilda 或 yakuake 类似的下拉式终端仿真器。如果你知道一些关于 Python、Git 和 GTK 的知识的话,你可以给 Guake 添加一些新的特性。 ​ Guake 在许多发行版上均可用,所以如果你想安装它,你可以查看你的版本仓库。 #### 特性浏览 * 轻量 -* 简单、容易且很优雅 -* 从终端到 GUI 的流畅集成 +* 简单易用且优雅 +* 将终端自然地集成到 GUI 之中 * 当你使用的时候出现,一旦按下预定义热键便消失(默认情况下是 F12) -* Compiz 透明支持 +* 支持Compiz 透明 * 多重 Tab * 丰富的调色板 * 还有更多…… + 主页: [http://guake-project.org/][15] ### 4、ROXTerm -如果你正在寻找一个轻量型、高度可定制的终端仿真器,那么 ROXTerm 就是专门为你准备的。这是一个旨在提供和 gnome-terminal 相似特性的终端仿真器,它们都基于相同的 VTE 库。它的最初设计只占用很小的空间并且能够快速启动,它具有比 gnome-terminal 更强的可配置性,更加针对经常使用终端的 “Power” 用户。 +如果你正在寻找一个轻量型、高度可定制的终端仿真器,那么 ROXTerm 就是专门为你准备的。这是一个旨在提供和 gnome-terminal 相似特性的终端仿真器,它们都基于相同的 VTE 库。它的最初设计是只占用很小的资源并且能够快速启动,它具有比 gnome-terminal 更强的可配置性,更加针对经常使用终端的 “Power” 用户。 [ ![roxterm linux terminal](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/roxterm-linux-terminal_orig.png) @@ -90,7 +92,7 @@ Xterm 是 Linux 和 UNIX 系统上最受欢迎的终端仿真器,因为它是 Gnome Terminal 是最受欢迎的终端仿真器之一,它被许多 Linux 用户使用,因为它默认安装在 Gnome 桌面环境中,而 Gnome 桌面很常用。它有许多特性并且支持大量主题。 -在许多 Linux 发行版中都默认安装有 Gnome Terminal,但你也可以使用你的包管理器来安装它。 +在许多 Linux 发行版中都默认安装有 Gnome Terminal,但你如果没有的话,也可以使用你的包管理器来安装它。 [ ![gnome terminal](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/gnome-terminal_orig.jpg) From d401ac4ac8c4955f5ead0eda08f3edfaa5f8d188 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 1 Apr 2017 09:14:43 +0800 Subject: [PATCH 062/241] translating --- sources/tech/20170327 Using vi-mode in your shell.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170327 Using vi-mode in your shell.md b/sources/tech/20170327 Using vi-mode in your shell.md index 0badb7e563..7e38322f13 100644 --- a/sources/tech/20170327 Using vi-mode in your shell.md +++ b/sources/tech/20170327 Using vi-mode in your shell.md @@ -1,3 +1,5 @@ +translating---geekpi + Using vi-mode in your shell ============================================================ From 423e881265472afec8cab50bcdc5a0944f143969 Mon Sep 17 00:00:00 2001 From: jasminepeng Date: Sat, 1 Apr 2017 09:22:48 +0800 Subject: [PATCH 063/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95=20?= =?UTF-8?q?@rusking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 校对完毕 谢谢 --- ...ss Two Samba4 AD DC with Rsync - Part 6.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md b/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md index 3b7d860ea6..eececa659b 100644 --- a/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md +++ b/translated/tech/20170116 Setup SysVol Replication Across Two Samba4 AD DC with Rsync - Part 6.md @@ -3,7 +3,7 @@ Samba 系列(六):使用 Rsync 命令同步两个 Samba4 AD DC 之间的 S 这篇文章讲的是在两个 **Samba4 活动目录域控制器**之间,通过一些强大的 Linux 工具来完成 SysVol 的复制操作,比如 [Rsync 数据同步工具][2],[Cron 任务调度进程][3]和 [SSH 协议][4]。 -#### 要求:: +#### 要求: - [Samba 系列(五):将另一台 Ubuntu DC 服务器加入到 Samba4 AD DC 实现双域控主机模][1] @@ -89,13 +89,14 @@ ntpsigndsocket /var/lib/samba/ntp_signd/ *在 Samba4 DC 服务器上生成 SSH 密钥* -6、 当你确认 root 用户可以从第一个 DC 服务器以免密码方式登录到第二个 DC 服务器时,执行下面的 Rsync 命令,加上 `--dry-run` 参数来模拟 SysVol 复制过程。注意把对应的参数值替换成你自己的数据。 +6、 当你确认 root 用户可以从第一个 **DC** 服务器以免密码方式登录到第二个 **DC** 服务器时,执行下面的 **Rsync** 命令,加上 `--dry-run` 参数来模拟 SysVol 复制过程。注意把对应的参数值替换成你自己的数据。 ``` # rsync --dry-run -XAavz --chmod=775 --delete-after --progress --stats /var/lib/samba/sysvol/ root@adc2:/var/lib/samba/sysvol/ ``` -7、如果模拟复制过程正常,那么再次执行 rsync 命令,去掉 `--dry-run` 参数来真实的在域控制器之间复制 GPO 对象。 +7、如果模拟复制过程正常,那么再次执行去掉 `--dry-run` 参数的 rsync 命令,来真实的在域控制器之间复制 GPO 对象。 + ``` # rsync -XAavz --chmod=775 --delete-after --progress --stats /var/lib/samba/sysvol/ root@adc2:/var/lib/samba/sysvol/ ``` @@ -103,7 +104,7 @@ ntpsigndsocket /var/lib/samba/ntp_signd/ ![Samba4 AD DC SysVol Replication](http://www.tecmint.com/wp-content/uploads/2017/01/SysVol-Replication-for-Samba4-DC.png) ][13] -Samba4 AD DC SysVol 复制 +*Samba4 AD DC SysVol 复制* 8、在 SysVol 复制完成之后,登录到目标域控制器,然后执行下面的命令来列出其中一个 GPO 对象目录的内容。 @@ -116,9 +117,9 @@ Samba4 AD DC SysVol 复制 ![Verify Samba4 DC SysVol Replication](http://www.tecmint.com/wp-content/uploads/2017/01/Verify-Samba4-DC-SysVol-Replication.png) ][14] -验证 Samba4 DC SysVol 复制结果是否正常 +*验证 Samba4 DC SysVol 复制结果是否正常* -9、为了自动完成组策略复制的过程(从网络来传输 sysvol 目录),你可以使用 root 账号设置一个任务来执行同步命令,如下所示,设置为每隔 5 分钟执行一次该命令。 +9、为了自动完成**组策略**复制的过程(通过网络传输 sysvol 目录),你可以使用 root 账号设置一个任务来执行同步命令,如下所示,设置为每隔 5 分钟执行一次该命令。 ``` # crontab -e @@ -130,7 +131,7 @@ Samba4 AD DC SysVol 复制 */5 * * * * rsync -XAavz --chmod=775 --delete-after --progress --stats /var/lib/samba/sysvol/ root@adc2:/var/lib/samba/sysvol/ > /var/log/sysvol-replication.log 2>&1 ``` -10、如果以后 SysVol ACL 权限有问题,你可以通过下面的命令来检测和修复这些异常。 +10、如果以后 **SysVol ACL** 权限有问题,你可以通过下面的命令来检测和修复这些异常。 ``` # samba-tool ntacl sysvolcheck @@ -140,24 +141,24 @@ Samba4 AD DC SysVol 复制 ![Fix SysVol ACL Permissions](http://www.tecmint.com/wp-content/uploads/2017/01/Fix-SysVol-ACL-Permissions.png) ][15] -修复 SysVol ACL 权限问题 +*修复 SysVol ACL 权限问题* -11、如果第一个 Samba4 AD DC 的 FSMO 角色,即“ PDC 模拟器”不可用,你可以强制 Microsoft Windows 系统上的组策略管理控制台只连接到第二个域控制器,通过选择更改域控制器选项和手动选择目标机器,如下图所示。 +11、如果第一个 **Samba4 AD DC** 的 **FSMO** 角色,即“PDC 模拟器”不可用,你可以强制 **Microsoft Windows** 系统上的**组策略管理控制台**只连接到第二个域控制器,通过选择更改域控制器选项和手动选择目标机器,如下图所示。 [ ![Change Samba4 Domain Controller](http://www.tecmint.com/wp-content/uploads/2017/01/Change-Samba4-Domain-Controller.png) ][16] -更改 Samba4 域控制器 +*更改 Samba4 域控制器* [ ![Select Samba4 Domain Controller](http://www.tecmint.com/wp-content/uploads/2017/01/Select-Samba4-Domain-Controller.png) ][17] -选择 Samba4 域控制器 +*选择 Samba4 域控制器* -当你从组策略管理控制台连接到第二个 DC 服务器时,你应该避免对组策略做任何更改。否则,当第一个 DC 服务器恢复正常后, rsync 命令将会删除在第二个 DC 服务器上所做的更改。 +当你从**组策略管理控制台**连接到第二个 **DC** 服务器时,你应该避免对**组策略**做任何更改。否则,当第一个 **DC** 服务器恢复正常后, **rsync 命令**将会删除在第二个 DC 服务器上所做的更改。 -------------------------------------------------------------------------------- @@ -165,7 +166,7 @@ Samba4 AD DC SysVol 复制 ![](http://2.gravatar.com/avatar/be16e54026c7429d28490cce41b1e157?s=128&d=blank&r=g) -我是一个电脑迷,开源软件和 Linux 系统爱好者,有超过 4 年的 Linux 桌面、服务器版本系统和 bash 编程经验。 +Matei Cezar -- 我是一个电脑迷,开源软件和 Linux 系统爱好者,有超过 4 年的 Linux 桌面、服务器版本系统和 bash 编程经验。 -------------------------------------------------------------------------------- From bfee3eda9d1785059ab082ca7db267ac79150c66 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 1 Apr 2017 10:45:36 +0800 Subject: [PATCH 064/241] translated --- .../20170327 Using vi-mode in your shell.md | 93 ------------------- .../20170327 Using vi-mode in your shell.md | 91 ++++++++++++++++++ 2 files changed, 91 insertions(+), 93 deletions(-) delete mode 100644 sources/tech/20170327 Using vi-mode in your shell.md create mode 100644 translated/tech/20170327 Using vi-mode in your shell.md diff --git a/sources/tech/20170327 Using vi-mode in your shell.md b/sources/tech/20170327 Using vi-mode in your shell.md deleted file mode 100644 index 7e38322f13..0000000000 --- a/sources/tech/20170327 Using vi-mode in your shell.md +++ /dev/null @@ -1,93 +0,0 @@ -translating---geekpi - -Using vi-mode in your shell -============================================================ - -> Get an introduction to using vi-mode for line editing at the command line. - - ![Using vi-mode at the command line](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/code_computer_development_programming.png?itok=wMspQJcO "Using vi-mode at the command line") ->Image by : opensource.com - -As a participant in the greater open source community, and more specifically as a member of the [Fedora Project][2], I have the opportunity to meet with many people and talk about all kinds of interesting technical topics. One of my favorites is the "command line," or [shell][3], because learning about how people use the shell proficiently can give you an insight into how they think, what kind of workflows they favor, and to some extent what makes them tick. Many developers and systems operators share their "dot files" (a common slang term for their shell's configuration files) publicly out on the Internet, which leads to an interesting collaboration opportunity that allows everyone to learn tips and tricks from seasoned veterans of the command line as well as share common shortcuts and productivity boosters. - -I'll introduce one for you here by showing the shell's vi-mode. - -In the large ecosystem of computing and operating systems, there are [many shells][4]. However, in the Linux world, the de facto standard has become [bash][5] and it is the default shell installed on all major Linux distributions at of the time of this writing. As such, that is the shell I'll be talking about today. Something to note, though, is that bash is also a reasonably popular option on other UNIX-style operating systems, so it's likely not far from your reach (and for you Windows users out there, there's always [cygwin][6]). - -While exploring the shell, the first thing you do is type commands into it and most often get output, like so: - -``` -$ echo "Hello World!" -Hello World! -``` - -This is common practice and is probably something everyone reading this has done. Something that newcomers and novices alike might not realize is that the default input mode for the [bash][7] shell is [Emacs][8], which means that all line-editing functions you will carry out on commands will use ["Emacs-style" keyboard combinations][9]. (For those interested in the nuts and bolts of things, the function of line-editing is actually carried out by [GNU Readline][10].) - -For example, if you had typed **echo "Hello Wrld!"** and realized that you wanted to quickly jump back one word (space delimited) to fix that typo without having to hold down your left arrow key then you would hit the **Alt+b** keys together and the cursor would jump backward to the **W**. - -``` -$ echo "Hello Wrld!" -              ^ -        Cursor is here. -``` - -This was done using only one of the many Emacs keyboard combinations that is offered to the user of the shell. There are many more available for all kinds of things, such as copying text, pasting text, removing text, and using shortcuts to edit text. Using complex keyboard combinations and committing them to memory may seem silly, but they can be extremely powerful when working with longer commands or recalling a command from your shell history yet wanting to edit a couple things before executing the command again. - -While Emacs key bindings are all well and good if you're familiar with the Emacs text editor or otherwise find them convenient to use, there are those who are more comfortable using "vi-style" keyboard bindings because of their time spent in the vi text editor (normally via [vim][11] or [nvim][12] these days). The bash shell (again, via GNU Readline) is able to provide this functionality for us. In order to enable it, you run the command **$ ****set**** -o vi**. - -Just like magic, you're now in vi-mode and can easily line-edit using vi-style key bindings in order to copy text, remove text, and jump around to different positions in the line of text. This isn't much different in terms of capabilities of Emacs-mode but it's  _how_  you interact with the shell to perform these actions that changes, which is a powerful option pending your specific preference. - -Let's take a look at the same example as before, but with the context that as soon as you land in vi-mode in your shell you're in INSERT mode, which means you can type commands just you did before but you can now hit the **Esc** key on your keyboard and you'll be in NORMAL mode, which is where you can navigate around freely and make text modifications. - -Looking at the same example as before, if you had typed **echo "Hello Wrld!"** and realized you wanted to jump back one word (again, space delimited) to fix up that typo, then you would hit **Esc** to change from INSERT to NORMAL mode. Then you can type **B** (**Shift+b** for those following along at home), which would move the cursor back much like it did before. (For more information on vi-modes, go [here][13].): - -``` -$ echo "Hello Wrld!" -              ^ -        Cursor is here. -``` - -Now, for the vi/vim/nvim users out there this is hopefully a fun "ah ha!" moment when you realize the potential of keeping your tried and true keyboard shortcuts close by at all times and not just while your writing things like code or documentation in your editor. If this is all new to you and you want to learn more, then I might suggest taking a trip to this [interactive vim tutorial][14] and see if the vi style of editing text is something you find useful. - -If you enjoy interacting with your shell in this mode, you can set that persistently by editing the **~/.bashrc** file in your home directory and adding the following line at the bottom. - -**set -o vi** - -For the emacs mode users, hopefully this was a quick and fun look into "the other side" of your shell. At the end of the day I think everyone should use whatever editor and shell line-editing mode that makes them most productive and if that's vi-mode and this article was news to you, then congratulations! Now go forth and be productive. - -Happy hacking... - --------------------------------------------------------------------------------- - -作者简介: - -Adam Miller is a member of the Fedora Engineering team focusing on Fedora Release Engineering tooling. His work includes next-generation build systems, automation, RPM package maintenance, and infrastructure deployment. Adam has completed his Bachelors of Science in Computer Science and Masters of Science in Information Assurance and Security, both from Sam Houston State University. He is a Red Hat Certified Engineer (Cert# 110-008-810), and an active member of the open source community with a running history of contributions to the Fedora Project (FAS account name: maxamillion). - - ------------------------- -via: https://opensource.com/article/17/3/fun-vi-mode-your-shell - -作者:[Adam Miller ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/maxamillion -[1]:https://opensource.com/article/17/3/fun-vi-mode-your-shell?rate=5_eAB9UtByHOiZMysPcewU4Zz6hOrLwdcgIpu2Ub4vo -[2]:https://getfedora.org/ -[3]:https://opensource.com/business/16/3/top-linux-shells -[4]:https://opensource.com/business/16/3/top-linux-shells -[5]:https://tiswww.case.edu/php/chet/bash/bashtop.html -[6]:http://cygwin.org/ -[7]:https://tiswww.case.edu/php/chet/bash/bashtop.html -[8]:https://www.gnu.org/software/emacs/ -[9]:https://en.wikipedia.org/wiki/GNU_Readline#Emacs_keyboard_shortcuts -[10]:http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html -[11]:http://www.vim.org/ -[12]:https://neovim.io/ -[13]:https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes -[14]:http://www.openvim.com/tutorial.html -[15]:https://opensource.com/user/10726/feed -[16]:https://opensource.com/article/17/3/fun-vi-mode-your-shell#comments -[17]:https://opensource.com/users/maxamillion diff --git a/translated/tech/20170327 Using vi-mode in your shell.md b/translated/tech/20170327 Using vi-mode in your shell.md new file mode 100644 index 0000000000..864c4c9264 --- /dev/null +++ b/translated/tech/20170327 Using vi-mode in your shell.md @@ -0,0 +1,91 @@ +在 shell 中使用 vi 模式 +============================================================ + +> 介绍在命令行编辑中使用 vi 模式。 + + ![Using vi-mode at the command line](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/code_computer_development_programming.png?itok=wMspQJcO "Using vi-mode at the command line") +>图片提供: opensource.com + +作为一名更大的开源社区的参与者,更确切地说,作为[ Fedora 项目][2]的成员,我有机会与许多人会面并讨论各种有趣的技术主题。我最喜欢的主题是“命令行”或者 [shell][3],因为了解人们如何熟练使用 shell 可以让你深入地了解他们的想法,他们喜欢什么样的工作流程,以及某种程度上什么激发了他们的灵感。许多开发人员和运维在互联网上公开分享他们的“ dot 文件”(他们的 shell 配置文件的常见俚语),这将是一个有趣的协作机会,让每个人都能从对命令行有丰富经验的人中学习提示和技巧并分享快捷方式以及有效率的技巧。 + +我在这里会为你介绍 shell 中的 vi 模式。 + +在计算和操作系统的庞大生态系统中有[很多 shell][4]。然而,在 Linux 世界中,[bash][5] 已经成为事实上标准,并在在撰写本文时,它是所有主要 Linux 发行版上的默认 shell。因此,它就是我所说的 shell。需要注意的是,bash 在其他类 UNIX 操作系统上也是一个相当受欢迎的选项,所以它可能跟你用的差别不大(对于 Windows 用户,可以用 [cygwin][6])。 + +在探索 shell 时,首先要做的是在其中输入命令并得到输出,如下所示: + +``` +$ echo "Hello World!" +Hello World! +``` + +这是常见的练习,可能每个人都做过。没接触过的人和新手可能没有意识到 [bash][7] shell 的默认输入模式是 [Emacs][8],这意味着命令行中所用的行编辑功能都将使用[ Emacs 风格的“键盘组合][9]。(对这个感兴趣的人,行编辑功能实际上是由[GNU Readline][10]进行的。) + +例如,如果你输入了 **echo "Hello Wrld!"**,并意识到你想要快速跳回一个单词(空格分隔)来修改打字错误,而无需按住左箭头键,那么你可以同时按下 **Alt+b**,光标会将向后跳到 **W**。 + +``` +$ echo "Hello Wrld!" +              ^ +        Cursor is here. +``` + +这只是使用提供给 shell 用户的许多 Emacs 组合键之一完成的。还有其他更多东西,如复制文本、粘贴文本、删除文本以及使用快捷方式来编辑文本。使用复杂的组合键并记住可能看起来很愚蠢,但是在使用较长的命令或从 shell 历史记录中调用一个命令并想再次编辑执行时,它们可能会非常强大。 + +尽管 Emacs 的键盘绑定都不错,如果你对 Emacs 编辑器熟悉或者发现它们很容易使用也不错,但是仍有一些人对“ vi 风格”的键盘绑定更舒服,因为他们经常使用 vi 编辑器(通常是 [vim][11] 或 [nvim][12])。bash shell(再说一次,通过 GNU Readline)可以为我们提供这个功能。要启用它,需要执行命令 **$ ****set**** -o vi**。 + +就像魔术一样,你现在处于 vi 模式了,现在可以使用 vi 风格的键绑定轻松地进行编辑,以便复制文本、删除文本、并跳转到文本行中的不同位置。这与 Emacs 模式在功能方面没有太大的不同,但是它在你_如何_与 shell 进行交互执行操作上有一些差别,根据你的喜好这是一个强大的选择。 + +我们来看看先前的例子,但是在上下文中一旦你在 shell 中进入 vi 模式,你就处于 INSERT 模式中,这意味着你可以和以前一样输入命令,但是现在点击 **Esc** 键,你将处于 NORMAL 模式,你可以自由浏览并进行文字修改。 + +看看先前的例子,如果你输入了 **echo "Hello Wrld!"**,并意识到你想跳回一个单词(再说一次用空格分隔)来修复那个打字错误,那么你可以点击 **Esc** 从 INSERT 变为 NORMAL 模式。然后,您可以输入 **B**(**Shift+b**),光标就能像以前那样回到前面了。(有关 vi 模式的更多信息,请参阅[这里][13]。): + +``` +$ echo "Hello Wrld!" +              ^ +        Cursor is here. +``` + +现在,对于 vi/vim/nvim 用户来说,当你发现你一直可以使用相同的快捷键,而不仅仅是在编辑器中编写代码或文档的时候我希望这是一个惊喜时刻。如果这对你是全新的,并且你想要了解更多,那么我可能会建议你参加这个[交互式 vim 教程][14],看看 vi 风格的编辑是否还有有用的。 + +如果你喜欢在此风格下与 shell 交互,那么你可以在主目录中的 **~/.bashrc** 文件底部添加下面的行来持久设置它。 + +**set -o vi** + +对于 emacs 模式的用户,希望这可以让你快速并愉快地看到 shell 的“另一面”。在结束之前,我认为每个人都应该使用任意一个让他们更有效率的编辑器和 shell 行编辑模式,如果你使用 vi 模式并且这篇对你是新的,那么恭喜你!现在就变得更有效率吧。 + +玩得愉快! + +-------------------------------------------------------------------------------- + +作者简介: + +Adam Miller 是 Fedora 工程团队成员,专注于 Fedora 发布工程。他的工作包括下一代构建系统、自动化、RPM 包维护和基础架构部署。Adam 在山姆休斯顿州立大学完成了计算机科学学士学位与信息保障与安全科学硕士学位。他是一名红帽认证工程师(Cert#110-008-810),也是开源社区的活跃成员,并对 Fedora 项目(FAS 帐户名称:maxamillion)贡献有着悠久的历史。 + + +------------------------ +via: https://opensource.com/article/17/3/fun-vi-mode-your-shell + +作者:[Adam Miller ][a] +译者:[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/maxamillion +[1]:https://opensource.com/article/17/3/fun-vi-mode-your-shell?rate=5_eAB9UtByHOiZMysPcewU4Zz6hOrLwdcgIpu2Ub4vo +[2]:https://getfedora.org/ +[3]:https://opensource.com/business/16/3/top-linux-shells +[4]:https://opensource.com/business/16/3/top-linux-shells +[5]:https://tiswww.case.edu/php/chet/bash/bashtop.html +[6]:http://cygwin.org/ +[7]:https://tiswww.case.edu/php/chet/bash/bashtop.html +[8]:https://www.gnu.org/software/emacs/ +[9]:https://en.wikipedia.org/wiki/GNU_Readline#Emacs_keyboard_shortcuts +[10]:http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html +[11]:http://www.vim.org/ +[12]:https://neovim.io/ +[13]:https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes +[14]:http://www.openvim.com/tutorial.html +[15]:https://opensource.com/user/10726/feed +[16]:https://opensource.com/article/17/3/fun-vi-mode-your-shell#comments +[17]:https://opensource.com/users/maxamillion From 6ac8188e5de6ae9d52f14691309e2fe8ab6acfbf Mon Sep 17 00:00:00 2001 From: Yoo-4x Date: Sat, 1 Apr 2017 17:35:13 +0800 Subject: [PATCH 065/241] Translated --- sources/tech/20170214 CentOS Vs. Ubuntu.md | 82 ------------------- .../tech/20170214 CentOS Vs. Ubuntu.md | 81 ++++++++++++++++++ 2 files changed, 81 insertions(+), 82 deletions(-) delete mode 100644 sources/tech/20170214 CentOS Vs. Ubuntu.md create mode 100644 translated/tech/20170214 CentOS Vs. Ubuntu.md diff --git a/sources/tech/20170214 CentOS Vs. Ubuntu.md b/sources/tech/20170214 CentOS Vs. Ubuntu.md deleted file mode 100644 index 4b06c9b851..0000000000 --- a/sources/tech/20170214 CentOS Vs. Ubuntu.md +++ /dev/null @@ -1,82 +0,0 @@ -Yoo-4x translating -# [CentOS Vs. Ubuntu][5] - -[ - ![centos vs. ubuntu](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/centos-vs-ubuntu_orig.jpg) -][4]Linux options available are almost “limitless” because, everyone can build it, either by changing an already existing distro or a new [Linux From Scratch][7] (LFS).Our choices on getting a Linux Distributions include its user interfaces, file system, package distribution, new features options and even updates periods and maintenance. -​ -On this article we will talk about the two big Linux Distributions, actually, it will be the difference between one another, where one is better than another and other features. - -### What is CentOS? - -CentOS ( _Community Enterprise Operating System_ ) is Linux cloned community-supported distribution derived from Red Hat Enterprise Linux (RHEL) and is compatible with it (RHEL), so we can say that CentOS is a free version of RHEL. Every Distribution is maintained for 10 years and each version released every 2 years. It was on January 14th that CentOS announced the official joining with Red Hat, while staying independent from RHEL under a new CentOS board. - -Also Read - [How To Install CentOS?][1] - -### History and first release of CentOS - -[CentOS][8] was first released in 2004 as cAOs Linux which was an RPM-based distribution and was community maintained and managed. - -It combined aspects of Debian, Red Hat Linux/Fedora and FreeBSD in a way that was stable enough for servers and clusters in a life cycle of 3 to 5 years. It was a part of a larger organization (the CAOS Foundation) with a group of open source developers[1]. - -In June 2006 TAO Linux, another RHEL clone developed by David Parsley announced the retirement of TAO Linux and it’s rolling into development of CentOS. His migration to CentOS didn’t affect his previous users (TAO users), as they were able to migrate just by upgrading their system using yum update. - -​In January 2014 Red Hat started sponsoring CentOS Project transferring the ownership and trademarks to it. - -[[1\. Open Source Software][9]] - -### CentOS Design - -CentOS is exactly the clone of the paid Red Hat version RHEL (Red Had Enterprise Edition). RHEL provides its source code that is later changed (removed the brand and logos) and modified to be released as a final CentOS product. - -### Ubuntu - -Ubuntu is a Linux operating system that is based on Debian, currently used on desktops, servers, smartphones and tablets. Ubuntu is launched by a company called Canonical Ltd based in the UK founded and funded by South African Mark Shuttleworth. - -Also Read - [10 Things To Do After Installing Ubuntu 16.10][2] - -### Ubuntu Design - -Ubuntu is an Open source distro with many contributions from developers around the world. Along the years it has evolved to a stated where its interface has become more intuitive and modern, the Whole system has become fast in response, more secure and with tons of applications to download. - -Since is based on [Debian][10] it supports .deb packages and the post recent package system and more secure [snap package format (snappy)][11]. - -​This new packaging system allows applications to be delivered with all dependencies satisfied. - -Also Read - [LinuxAndUbuntu Review Of Unity 8 In Ubuntu 16.10][3] - -### Differences between CentOS and Ubuntu - -* While ubuntu is based on Debian, CentOS is based on RHEL; -* Ubuntu uses .deb and .snap packages and centOS uses .rpm and flatpak; -* Ubuntu uses apt for updates while centOS uses YUM; -* CentOS seems to be more stable because doesn’t have regular updates to their packages like ubuntu but, this doesn’t mean that ubuntu is less secure; -* Ubuntu has more documentation and free support for problem solving and information; -* Ubuntu Server version has more support for cloud and container deployments. - -### Conclusion - -Regardless of your choice, **Ubuntu or CentOS**, both distros are very good distros and stable. If you want a distro with a short release cycle stick with ubuntu and if you want a distro that doesn't change it’s package so often go with CentOS. Leave your comments below and tell us which one you prefer. | - --------------------------------------------------------------------------------- - -via: http://www.linuxandubuntu.com/home/centos-vs-ubuntu - -作者:[linuxandubuntu.com][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu -[1]:http://www.linuxandubuntu.com/home/how-to-install-centos -[2]:http://www.linuxandubuntu.com/home/10-things-to-do-after-installing-ubuntu-16-04-xenial-xerus -[3]:http://www.linuxandubuntu.com/home/linuxandubuntu-review-of-unity-8-preview-in-ubuntu-1610 -[4]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu -[5]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu -[6]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu#comments -[7]:http://www.linuxandubuntu.com/home/how-to-create-a-linux-distro -[8]:http://www.linuxandubuntu.com/home/10-things-to-do-after-installing-centos -[9]:https://en.wikipedia.org/wiki/Open-source_software -[10]:https://www.debian.org/ -[11]:https://en.wikipedia.org/wiki/Snappy_(package_manager) diff --git a/translated/tech/20170214 CentOS Vs. Ubuntu.md b/translated/tech/20170214 CentOS Vs. Ubuntu.md new file mode 100644 index 0000000000..5c6648b32b --- /dev/null +++ b/translated/tech/20170214 CentOS Vs. Ubuntu.md @@ -0,0 +1,81 @@ +Yoo-4x translating +# [CentOS Vs. Ubuntu][5] + +[ + ![centos vs. ubuntu](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/centos-vs-ubuntu_orig.jpg) +][4]Linux 可以用的选项几乎是"没有限制"的。因为你可以构建它,也可以通过修改已经存在的发行版本或者一个新的 [Linux From Scratch][7] (LFS)。我们的选择选择 Linux 发行版本包括它的用户界面,文件系统,软件包发行版本,新的可选特性甚至包括升级时间和版本支持。​ +这篇文章我们将会它讨论 Linux 的两个大的发现哦每个那么呢没,事实上它将在各自相较更好的特性上对两个发行版本进行区分。 + +### CentOS 是什么? + +CentOS ( _企业社区开源系统_ ) 从 Red Hat Enterprise Linux (RHEL) 派生出社区支持的 Linux 派生版本, 与 RHEL 兼容,所以我们也可以说是免费版本的 RHEL。每个版本技术支持长达10年,并且每两年发行一个版本。在一月十四日 Centos 官方宣布加入 Red Hat,同时将会在一个 CentOS 板块与 RHEL 保持独立。 + +请阅读 - [如何安装 CentOS?][1] + +### CentOS 的历史和第一个版本 + +[CentOS][8] 的第一个版本作为 cAOs 在2004年发行,作为一个基于 RPM(红帽软件包管理系统)并且由社区维护和管理的发行版本。 + +它结合 Debian, Red Hat Linux/Fedora and FreeBSD 的多个方面,使它足够稳定以便运行在服务器上和周期为三到五年的集群。它是一个更大的组织(CAOS 基金)的一部分,这个组织有一群开源开发者[1]。 + +在2016年四月 TAO Linux —— 被 David Parsley 开发的另一个 RHEL 克隆版本宣布 TAO Linux 将停止开发并加入 CentOS 开发。他迁移到 CentOS 并没有影响他之前的用户(TAO 用户),即它们可以通过 yum update 升级他们的系统而迁移到 CentOS 中来。 + +​在2014年二月 Red Hat 开始赞助 CentOS 项目, 将所有权和商标转让给了它。 + +[[1\.开源软件][9]] + +### CentOS 设计 + +CentOS 克隆的是 Red Hat 付费版本(Red Had Enterprise Edition)。RHEL 为其提供源代码, CentOS 将去掉品牌和商标并修改为最终的成品。 + +### Ubuntu + +Ubuntu 是一个基于 Debian 的 Linux 系统,目前用在桌面、服务器、智能手机和平板上。 Ubuntu 由 Canonical Ltd 公司开展,该公司在英国成立并由 South African Mark Shuttleworth 资助。 + +拓展 - [10 Things To Do After Installing Ubuntu 16.10][2] + +### Ubuntu 设计 + +Ubuntu 是一个依靠全世界的开发者贡献的开源发行版本。近年来它的界面越发直观和现代,整个系统已经变得反应快速,更加安全并拥有海量的可供下载的软件资源。 + +因为基于[Debian][10],它支持 .deb 格式的软件包,发布最近了一个更加发安全的软件包系统[snap package format (snappy)][11]。 + +​这个新的软件包系统允许应用程序交付而不需担心依赖。 + +拓展 - [LinuxAndUbuntu Review Of Unity 8 In Ubuntu 16.10][3] + +### CentOS 和 Ubuntu 之间的不同 + +* ubuntu基于 Debian 而 CentOS 基于 RHEL; +* Ubuntu 使用 .deb 和 .snap 软件包,而 centOS 使用 .rpm 和 flatpak; +* Ubuntu 使用 apt 指令来升级 而 centOS 使用同 YUM; +* 因为不需要定期升级软件包,所以 CentOS 显得更加稳定。但是这并不意味着 ubuntu 相对不安全; +* Ubuntu 有着更丰富的文档并且提供免费技术支持; +* Ubuntu 服务器版本对云部署和勇气部署有着更好的支持。 + +### 结论 + +不管你的选择是什么,**Ubuntu or CentOS** 这两个发行版本都非常棒并且稳定。如果你想拥有短的版本周期你将忠于 ubuntu, 如果你不希望发行版本改变它的软件包太快你将经常使用 CentOS。请在下部留言来告诉我你更喜欢哪个发行版本。| + +-------------------------------------------------------------------------------- + +via: http://www.linuxandubuntu.com/home/centos-vs-ubuntu + +作者:[linuxandubuntu.com][a] +译者:[Yoo-4x] +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu +[1]:http://www.linuxandubuntu.com/home/how-to-install-centos +[2]:http://www.linuxandubuntu.com/home/10-things-to-do-after-installing-ubuntu-16-04-xenial-xerus +[3]:http://www.linuxandubuntu.com/home/linuxandubuntu-review-of-unity-8-preview-in-ubuntu-1610 +[4]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu +[5]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu +[6]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu#comments +[7]:http://www.linuxandubuntu.com/home/how-to-create-a-linux-distro +[8]:http://www.linuxandubuntu.com/home/10-things-to-do-after-installing-centos +[9]:https://en.wikipedia.org/wiki/Open-source_software +[10]:https://www.debian.org/ +[11]:https://en.wikipedia.org/wiki/Snappy_(package_manager) From 86f3d7af8e8532753e175d952d40babe30e35e21 Mon Sep 17 00:00:00 2001 From: mec2cod Date: Sun, 2 Apr 2017 15:20:30 +0800 Subject: [PATCH 066/241] finish translating 20170125 An executive's guide to containers.md --- ...70125 An executives guide to containers.md | 132 ----------------- ...0125 An executive's guide to containers.md | 134 ++++++++++++++++++ 2 files changed, 134 insertions(+), 132 deletions(-) delete mode 100644 sources/tech/20170125 An executives guide to containers.md create mode 100644 translated/tech/20170125 An executive's guide to containers.md diff --git a/sources/tech/20170125 An executives guide to containers.md b/sources/tech/20170125 An executives guide to containers.md deleted file mode 100644 index 7f189db4d7..0000000000 --- a/sources/tech/20170125 An executives guide to containers.md +++ /dev/null @@ -1,132 +0,0 @@ -being translated by zhousiyu325 - -An executive's guide to containers -============================================================ - - ![An executive's guide to containers](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/containers_2015-1-osdc-lead.png?itok=E1imOYe4 "An executive's guide to containers") -Image credits : [Maersk Line][1]. [CC SA-BY 4.0][2] - -Discussions with IT leaders about "[containers][4]" can often be summarized as this: - -_As a CxO, I face the constant challenge of doing more with less. IT budgets continue to decrease and I have less resources, yet the amount of work to deliver is greater than ever before. I spend far too many hours dedicated to resolving budgetary constraints. In addition, the IT landscape is undergoing a rapid change and new technologies are being introduced all the time. The latest topic I hear from my trusted advisors is the implementation of a "container strategy." I want to understand:_ - -1. _What are containers?_ -2. _What is the enterprise value to transitioning to containers?_ -3. _Why should I shift to containers now? Are there disadvantages if we don't adopt?_ -4. _Are containers mature enough for enterprise consumption?_ -5. _How do I get my enterprise up to speed with container adoption?_ - -Let's start at the beginning. - -### Containers - -In the past 10 years or so, enterprises have moved from physical infrastructure to virtual machines (VMs). The key advantage of moving towards VMs is a reduction in the datacenter footprint. You can fit more applications on a fewer number of physical machines by running multiple VMs on the same physical box. Using containers is another way of packing applications in a much lighter weight and with a much faster delivery model. They are a fancy way of running multiple application processes on a single box, regardless of whether that box is a VM or a physical machine. In addition, containers also play a major role in the context of fulfilling DevOps, microservices, and cloud strategy. - -### Containers versus VMs - -Containers differ from VMs in a few simple ways. A VM, while not a physical machine, behaves just like one. It is an isolated environment that includes everything, starting with a complete (guest) operating system. On the other hand, containers are processes that share the resources on the same machine, which could be physical or virtual. Containers are notably interesting because: - -* VMs are heavy, comparatively. Containers are light because they only include those libraries needed by the applications they run. -* VMs take minutes to start up. Containers start up in seconds. -* Typically, many more containers fit into your infrastructure than VMs. - - ![Containers versus VMs](https://opensource.com/sites/default/files/containersvmvscontainers.png "Containers versus VMs") - -The technology has evolved enough to keep these containers secure, isolated from each other, and "with right design choices" to make sure that bad containers don't affect the performance of other containers running on the same box. In fact, operating systems are built to optimize and run containers natively. - -Still, you need to make the right choices when moving toward containers. You need to do enough due diligence so you choose the right technology partners and vendors to enable containers. Open source technologies play a key role. The open source [Docker project][5] has made containers with a layering format that is easy to build and use. The [Open Container Initiative][6] (OCI) has become an open source standard for containers supported by all major technology vendors. Open source technology providers like Red Hat make container-ready, secure operating systems available. For example, Red Hat Enterprise Linux 7.x , including Red Hat Enterprise Linux Atomic Host, are optimized to run containers natively and also provide tools to monitor and manage containers. Other open source projects such as CoreOS from Tectonic are also coming into the market. Indeed, containers are ready for adoption by enterprises. - -### Container platforms - -Container platforms make containers enterprise-consumable. You may have dealt with VM sprawl in your enterprises over the past decade, and container sprawl can be many times worse. Running your containers at scale across the various hosts in your datacenter, ensuring high availability for your applications despite container failure, automated health checks, automated scaling of containers based on incoming workloads, etc., are some of the key features you can expect from a container platform. - -While running containers on such a platform is positioned as Container-as-a-Service model (CaaS), some additional features of these platforms, such as build and deployment automation, make this platform a full-fledged Platform-as-a-Service (PaaS). While CaaS can run containers for you at scale, PaaS would take your source code, build it, create containers, and run those containers for you. In addition, these platforms provide complete operations management features, such as management and monitoring of the cluster, detection of security flaws with the containers and run safe containers, tracking logs and metrics, etc. - -While some vendors are using their proprietary technologies to build container platforms, in general, companies are standardizing them around open source technologies built around [Kubernetes][7] (or K8S in short). K8S is an open source project that was started by Google, and many large platform vendors now support it. K8S is also part of [Cloud Native Computing Foundation][8] (CNCF), which is evolving as a standards body for cloud-centric technologies. Standardization around open source orchestration technologies is very important when you make your choices on a container platform. It basically allows you be portable across container platforms if you don't like the choice you made the first time. K8S also allows your container workloads to be portable across different public clouds. These are the reasons why we see more and more technology companies using Kubernetes. - -A few enterprises are trying to build their own DIY container platforms by stitching together several open source projects that include K8S. This is definitely a better solution than going with proprietary technologies, but it also includes lot of plumbing to get it to work. However, an enterprise's ability to sustain and maintain such DIY platforms should be considered seriously. Many enterprises are not in the job of creating IT Platforms, rather they wish to run their mainstream business. There are many K8S-based solutions available, such as [Red Hat's OpenShift Container Platform][9], [Apprenda][10], [Deis][11], [Rancher][12], etc., which provide enterprise-ready versions of a platform, each with different levels of maturity in terms of features they provide. - -These solutions are certified and supported by vendors. Some of these are comprehensive open source PaaS solutions, while others may be CaaS. Based on your enterprise needs, these solutions may serve as better alternatives than a DIY container platform. - -### Enterprise concerns and their relationship to containers - -Today, almost every enterprise is dealing with a digital transformation that impacts multiple areas, including strategies for DevOps, microservices, and the cloud. Containers play a particular role in each of these areas. - -### DevOps strategy - -IT organizations are divided into operations and application development. They operate as two separate teams, and each has its own set of goals. Most of the enterprises are moving in the direction of DevOps to bring these two teams together. - -Containers have a major role to play in the success of DevOps initiatives. One of the key success criteria in DevOps is to increase the developer's stake in operations. Developers should not only hand off code to operations, but also, they should be concerned about how their code runs in the production. The common technique is to treat "infrastructure as code." Rather than provide pages of installation instructions that are error prone, the development team should provide the environment setup as code. - -This is the exact problem that containers solve. Container images, which are templates for containers, include the entire stack, starting from the base operating system through to the application code. With containers, developers would not just build an application artifact (such as a .jar file) from Dev to QA to Prod; instead, they would pass a versioned container image that includes both the built artifact and the environment in which the artifact runs. The container is all inclusive, with everything from operating system libraries to middleware to the application bundled into one image. Therefore, the way the container runs in Development is the same exact way it runs in QA and Production. Containers are essential ingredients for DevOps success. - - ![Container-based model](https://opensource.com/sites/default/files/containerbasedmodel.png "Container-based model") - -In addition, container platforms are going a step further. Typical Continuous Integration and Delivery (CICD) tools, such as [Jenkins][13], are available as containers that run the entire CICD process on the container platform itself without the need for additional infrastructure. Now, you can use the PaaS platform to build and run your CICD pipelines. - -### Microservices strategy - -[Microservices][14] are another hot topic in IT today. Breaking down applications into discrete, small services, each of which do a small job, pretty well, is how applications are being designed. Each of these microservices could be written in a different language based on the technology suitable. They would be created and managed by small (two-pizza fed) teams and they can be changed fast. All these requirements again allude to containers. Containers are small enough to be the foundation for microservices. Containers can support any technology and language of your choice. They are easy to create and run and can be changed fast. Microservices and containers are considered married now, and if people talk of implementing microservices without using containers, they are often given a strange look. - -The reality is that while microservices promise simplicity, their proliferation also increases complexity. Several microservices design and deployment patterns are coming up to ease their implementation. This means developers are now in need of a platform where they can deploy and orchestrate these microservices with ease and that: - -* Implements these microservices design patterns, in a language agnostic way -* Does not increase the complexity of code with code intrusion so that developers have to include a great deal of pattern code into their business logic -* Is flexible enough to deploy on the infrastructure of your choice and not does not tie you to particular clouds - -This is where choosing a right container platform comes into play. Implementing these microservices on specific infrastructures in a particular vendor's way will tie your applications to those vendor platforms. Containerizing microservices using standard technologies such as OCI-compliant containers will ensure your microservices can be run on any OCI-compliant platform. - -Choosing the right container platform to run your microservices is another important decision to make. Today there are very few choices and a lot of FUD. Some of these choices would take you down the non-standard, vendor-specific route if you are not diligent enough when making this choice. - -### Cloud strategy - -Cloud strategy is one more hot topic in IT. Whether you like it or not, the "as-a-Service" model is an inevitable change. If you don't provide this as a service from IT, your development teams will probably find ways to create shadow IT to get to the cloud. In addition, while using the cloud will move you from capital expenditure to operating expenditure, managing cloud expenditure is a constant challenge. - -Cloud provides VMs, and you want to make sure that the CPU, memory and network resources on this cloud are used optimally before you spin up additional VMs. Containers play an important role here. Because containers are much smaller than VMs, and if your applications are run in containers, you can fit more containers in VMs than running one application component per VM. - -Public cloud vendors are numerous, with Amazon Web Services (AWS), Microsoft Azure, and Google Cloud being a few of the more popular ones. In addition, you may want your own private cloud in your datacenter based on OpenStack. Each of these cloud environments have their own protocols, APIs, and tools. While you want your applications to run on the cloud, you don't want to make your application orchestration be cloud vendor specific and you don't want to maintain any cloud-specific code. Locking in your technology with a specific cloud vendor is like signing blank checks to the vendor for years to come. - -Portability across the cloud is important to your cloud strategy. You can write your applications without worrying about where they run, and the container platform shields you from specific cloud vendor protocols, preventing you from being locked in with one cloud vendor. - -### Legacy systems - -The pluses brought to development by the microservices architecture are many, but not every application can be refactored into them and some only in part. Traditional applications are here to stay and they need to be maintained and managed. While containers enable microservices, containers are not _just_ microservices. Conceivably, you can run large applications and non-microservices as containers, so as long as you choose the right container technology and the right application platform, you can run many, if not all, legacy applications as containers. - -### Wrapping up - -I hope this deep dive into various strategies and containers helps your company evaluate your next step. Let me know in the comments lessons your company has learned or if they haven't taken the leap, what information they need I haven't provided. - --------------------------------------------------------------------------------- - -作者简介: - -Veer Muchandi - Open source enthusiast. Container and PaaS advocate. Loves to learn and share. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/1/container-strategy-for-executives - -作者:[Veer Muchandi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/veermuchandi -[1]:https://www.flickr.com/photos/maerskline/6955071566 -[2]:https://creativecommons.org/licenses/by-sa/4.0/ -[3]:https://opensource.com/article/17/1/container-strategy-for-executives?rate=DuiecCOvGMj-GXcdlJsN8xdZJ82yPUX1M3M9ZNkT99A -[4]:https://opensource.com/resources/what-are-linux-containers -[5]:https://opensource.com/resources/what-docker -[6]:https://opensource.com/business/16/8/inside-look-future-linux-containers -[7]:https://opensource.com/resources/what-is-kubernetes -[8]:https://www.cncf.io/ -[9]:https://www.openshift.com/container-platform/ -[10]:https://apprenda.com/ -[11]:http://deis.io/ -[12]:http://rancher.com/ -[13]:https://jenkins.io/ -[14]:https://opensource.com/resources/what-are-microservices -[15]:https://opensource.com/user/92826/feed -[16]:https://opensource.com/article/17/1/container-strategy-for-executives#comments -[17]:https://opensource.com/users/veermuchandi diff --git a/translated/tech/20170125 An executive's guide to containers.md b/translated/tech/20170125 An executive's guide to containers.md new file mode 100644 index 0000000000..7806981a20 --- /dev/null +++ b/translated/tech/20170125 An executive's guide to containers.md @@ -0,0 +1,134 @@ +容器实践指南 +============================================================ + +![An executive's guide to containers](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/containers_2015-1-osdc-lead.png?itok=E1imOYe4 "An executive's guide to containers") 图片来源:[Maersk Line][1]. [CC SA-BY 4.0][2] + +与互联网领域的领导们关于"容器"的讨论通常被总结如下: + +_作为一名CxO,我面临杠杆时间术的持续的压力。IT预算不断减少,我只有有限的资源。然而,交付的工作量却比以往更多。我花费太多的时间致力于解决预算的约束。另外,互联网的格局正在经历一个快速的改变,而且新的技术一直在被引进。我从我最信任的顾问那听来的最新的话题是一个"容器策略"的实现。我想理解:_ + +1. _什么是容器?_ +2. _过渡到容器的企业价值是什么?_ +3. _为什么我现在应该转移到容器?如果我不采纳会有一些坏处吗?_ +4. _容器是否已经足够成熟用于企业消费?_ +5. _我如何让我的企业因使用容器而快速地发展?_ + +让我们从最开头开始。 + +### 容器 + +在过去的10年左右,企业已经从物理基础设施转向了虚拟机(VMs)。转向VMs的关键优势是可以减少数据中心足迹。通过在同一个物理盒子上运行多个虚拟机,你可以在更少数量的物理机器上安装更多的应用程序。使用容器是另一种更轻量地打包应用程序的方式,而且其交付模式更快。它们是一种在单独的盒子里运行多个应用程序进程的奇特方式,无论那个盒子是一个虚拟机还是一个物理机。另外,容器在DevOps的上下文切换、微服务和云战略方面也有重要作用。 + +### 容器vs虚拟机 + +容器和虚拟机在一些方面并不相同。一台虚拟机尽管不是物理机,但是它表现地就像是一台物理机。虚拟机是一个包含所有东西的独立的环境,从一个完整的(来宾)操作系统开始。在另一方面,容器是共享相同物理机或虚拟机上资源的进程。容器显然更加有趣,因为: + +* 相比较而言,虚拟机要重一些,而容器更轻。因为容器只包括了它们所运行的程序所需要的库。 +* 虚拟机需要花费几分钟来启动,而容器在几秒钟内就可以启动。 +* 通常,更多的容器比虚拟机更加适合你的基础设施。 + ![Containers versus VMs](https://opensource.com/sites/default/files/containersvmvscontainers.png "Containers versus VMs") + + +技术已经发展到足以保持这些容器安全、彼此独立,而且正确的设计选择可以保证那些坏掉的容器不会影响运行在同一个盒子里的其他容器的性能。实际上,操作系统是被构建来优化和运行容器本身。 + +然而,当你转向容器时,你需要做出正确的选择。你需要做足够的尽职的调查,所以,你选择合适的技术合作伙伴和能够制作容器的制造商。开源技术起着很关键的作用。开源的[Docker项目][5]使得分层格式的容器很容易构建和使用。[开放容器计划][6](OCI)已经成为被所有主要技术供应商所支持的开源容器标准。如Red Hat这样的开源技术提供商准备好了为容器而准备的安全的操作系统。例如, Red Hat Enterprise Linux 7.x (包括Red Hat Enterprise Linux原子主机)被进行优化以在本机上运行容器,同时也提供监控和管理容器的工具。其他的开源项目如来自Tectonic的CoreOS也正在进入市场。的确,容器正等着被企业所采用。 + +### 容器平台 + +容器平台让容器成为企业消耗品。在过去的十年中,你可能在你的企业里处理过虚拟机散乱的问题,容器散乱比那要糟糕好几倍。在你的数据中心不同主机上运行不同规模的容器,保证你的应用程序的高可用性,尽管容器故障、自动化健康检查和基于流入的工作载荷的自动化容器缩放等等,这些是你能期待容器平台应该有的一些关键特性。 + +当在一个被定位为容器即服务模型(CaaS)的平台上运行容器时,这些平台的一些其他特性如自动化生成和部署使这个平台成为平台即服务模型(PaaS)。虽然CaaS能让你规模化运行容器,但是,PaaS可以让你利用你的源代码编译、创建容器,为你运行那些容器。另外,这些平台提供了完整操作管理特性,例如,集群的管理和监控、容器的安全缺陷检测、运行安全的容器、跟踪日志和度量等等。 + +尽管一引起技术供应商正在使用他们的专有技术来构建容器平台,但总的来说,一些公司正在围绕建立在[Kubernetes][7](K8S)的基础上的开源技术来规范他们自己。K8S是一项由Google发起的开源项目,现在很多大平台的供应商也支持它。KBS也是[云端原生计算基金会][8](CNCF)的一部分,CNCF正在发展成以云为中心技术的标准体。当你在容器平台上做出选择时,围绕开源流程编排技术的标准化是非常重要的。它基本上允许你移植到不同的容器平台,如果你不喜欢你第一次做的选择。K8S还允许你的容器工作载荷移植到不同的公有云。这些就是为什么我们会看到越来域越多的技术公司正在使用Kubernetes的原因。 + +一些企业正在试图通过拼接几个包括K8S在内开源项目来打造他们自己的DIY容器平台。这确实是比继续跟随专有技术要更好的一种解决方案,但是要完成这项工作也仍然包含很多需要探讨的地方。然而,一个企业的维护和保持这样的DIY平台的能力应该被认真考虑。许多企业并不是做着创建IT平台的工作,然而他们希望运行自己的主流业务。有很多可行的基于K8S的解决方案,比如[红帽OpenShift平台容器][9]、[Apprenda][10]、[Deis][11]和[Rancher][12],它们提供一个平台的为企业准备的版本。这些解决方案中的每种都有不同完整程度的功能。 + +这些解决方案是由供应商认证和支持。有些方案是完全的开源PaaS解决方案,而另外一些可能是CaaS。根据你的企业的需求,这些解决方案可以作为比DIY容器平台更好的替代品。 + +### 企业的担忧和它们与容器的关系 + +今天,几乎每个企业都正在与数字变换打交道,这些数字变换影响包括DevOps战略、微服务和云等多个领域。容器在这些领域中的每一个中都起着相当重要的作用。 + +### DevOps策略 + +IT组织被分成运维和应用开发,他们作为两个独立的团队运作,每一队都只有他们自己的一套目标。大多数企业为了将这两个团队联合起来正在朝DevOps的方向前进。 + +容器在DevOps倡议的成功中发挥着重要的作用。在DevOps中成功的关键标准之一是增加开发人员在运营中的股份。开发人员不仅应该把代码交给运维人员,而且他们还应该考虑他们的代码是如何在生产环境中运行的。普遍的技术是采用"架构即代码",而不是提供几页容易出错的安装说明指示,开发团队应该提供像编程时的环境配置。 + + +这恰恰就是容器可以解决的问题。可以作为容器的模版的容器镜像包括整个堆栈,从基本操作系统到应用程序代码。利用容器,开发人员将不再只是从Dev到QA再到Prod这样生成应用程序;相反,他们将传递一个版本化的容器镜像,这个镜像包括生成的运行程序和它运行需要的环境。容器是包罗万象的,从操作系统库到中间件再到应用程序的所有东西都被整合进一个镜像里面。因此,容器在开发环境运行的方式和它在质量保证环境和生产环境下运行的方式完全一样。容器是DevOps成功的重要因素。 + + ![Container-based model](https://opensource.com/sites/default/files/containerbasedmodel.png "Container-based model") + + 另外,容器平台正在进一步发展。典型的持续集成和交付(CICD)工具,如Jenkins, +可以作为容器,这个容器能在容器平台本身而不需要额外的基础设施运行整个CICD过程。现在你可以使用PaaS平台来生成和运行你的CICD管道。 + +### 微服务策略 + +微服务是今天IT领域的另一个热门话题。应用程序是这样被设计的:把应用程序分解为离散化的小的服务,每个服务完成一个小任务。这些服务中的每一个都可以根据合适的技术用不同的编程语言进行编写。它们可以由小团队(双比萨团队)创建和管理,并且可以迅速地改变它们。所有这些要求再次需要用到容器。容器足够小到成为微服务的基础。容器能够支持任何你选择的技术和语言,容器容易创建和运行,并且可以快速地改变。微服务和容器现在已经不分彼此,如果有人说不使用容器来实现微服务,他们将会受到别人奇怪的表情。 + +实际情况是,虽然微服务有望让情况变得简单,但是他们的扩张也增加了复杂性。几个微服务的设计和开发模式即将能缓解它们的实现。这意味着开发人员现在急需这样一个开发平台,在这个平台下,开发人员可以轻松地部署和组织微服务,而且还能: + +* 以一种语言不可知的方式实现这些微服务设计模式。 +* 不会因代码入侵而增加代码的复杂性,因此,开发人员必须将许多模式的代码包括进他们的业务逻辑。 +* 足够灵活以便部署在你所选择的基础设施上,并且不会把你捆绑在特定的云上。 + +这就是选择一个正确的容器平台所起作用的地方。在具体的基础设施上按照某一特定供应商的方法来实现这些微服务将会把你的应用程序捆绑在那些供应商的平台上。使用类似兼容OCI的容器的容器化微服务将可以保证你的微服务能够被运行在任何兼容OCI的平台上。 + +选择正确的容器平台来运行你的微服务是需要做的另一个重要的决定。今天,有很少的选择和许多的FUD。如果你作出选择时不足够慎重,其中一些选择会把你带到非标准的、特定供应商的路线上。 + +### 云策略 + +云战略是IT领域的又一个热门话题。无论你是否喜欢,服务模型都是不可避免的变化。如果你不将这作为IT服务进行提供,你的开发团队将可能会找到创建"shadow IT"的方法来访问云。另外,尽管使用云技术将会让你从资本支出转移到运营支出,但是,管理云支出是一个不断的挑战。 + +云可以提供虚拟机,在你添加额外的虚拟机之前,你想确认这个云上的CPU、内存和网络等资源都处于最佳使用状态。容器在这个地方扮演着很重要的角色。因为容器双虚拟机要小得多。并且,如果你的应用程序正运行在容器中,你可以在虚拟机中安装更多的容器,这比在每台虚拟机中运行一个应用程序组件要多很多。 + +公有云供应商有很多,其中Amazon Web Services (AWS)、Microsoft Azure和Google Cloud最受欢迎。另外,你可能想在你的基于OpenStack的数据中心里拥有你自己的私有云。这些云环境中的每一个都有他们自己的协议、API和工具。当你想让你的应用程序在云上运行时,你不想让您的应用程序业务流程按照云供应商的说明,也不想维护任何特定云的代码。与特定的云供应商锁定你的技术就像在未来几年内向供应商签署空白支票。 + +云的可移植性对您的云战略至关重要。你可以编写应用程序,而不用担心它们在哪里运行,容器平台可以将你和特定的云供应商协议隔离开来,从而避免你与一个云供应商锁定。 + +### 传统系统 + +微服务架构带给开发的优势很多,但并不是每个应用程序都可以重构它们自己,有些只能重构一部分。传统的应用程序被普遍接受,因为它们需要维护和管理。虽然容器可以实现微服务,但容器不仅仅只是微服务。可以想象,你可以将大型应用程序和微服务作为容器来运行,因此只要你选择正确的容器技术和正确的应用程序平台,就可以将许多(如果不是所有)的传统的应用程序作为容器运行。 + +### 总结 + +我希望对各种策略和容器的深入了解有助于你的公司对下一步进行评估。让我在评论里面了解您公司学习到的经验,或者说他们没能大步向前跨越,他们还需要我再提供一些什么信息。 + +------------------------------------------------------------------------------ + +作者简介: + +Veer Muchandi -- 开源爱好者,容器和PaaS倡导者,喜欢学习和分享。 + +------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/1/container-strategy-for-executives + +作者:[Veer Muchandi][a] +译者:[zhousiyu325](https://github.com/zhousiyu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + + + + +[a]:https://opensource.com/users/veermuchandi +[1]:https://www.flickr.com/photos/maerskline/6955071566 +[2]:https://creativecommons.org/licenses/by-sa/4.0/ +[3]:https://opensource.com/article/17/1/container-strategy-for-executives?rate=DuiecCOvGMj-GXcdlJsN8xdZJ82yPUX1M3M9ZNkT99A +[4]:https://opensource.com/resources/what-are-linux-containers +[5]:https://opensource.com/resources/what-docker +[6]:https://opensource.com/business/16/8/inside-look-future-linux-containers +[7]:https://opensource.com/resources/what-is-kubernetes +[8]:https://www.cncf.io/ +[9]:https://www.openshift.com/container-platform/ +[10]:https://apprenda.com/ +[11]:http://deis.io/ +[12]:http://rancher.com/ +[13]:https://jenkins.io/ +[14]:https://opensource.com/resources/what-are-microservices +[15]:https://opensource.com/user/92826/feed +[16]:https://opensource.com/article/17/1/container-strategy-for-executives#comments +[17]:https://opensource.com/users/veermuchandi \ No newline at end of file From 336e699775ca66923819b459c2242f1c910ab39e Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 2 Apr 2017 17:43:39 +0800 Subject: [PATCH 067/241] PRF:20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md @Taylor1024 --- ... for software developers - part 3 a.vim.md | 79 ++++++++----------- 1 file changed, 31 insertions(+), 48 deletions(-) diff --git a/translated/tech/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md b/translated/tech/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md index 62a1297b1d..8b8b627506 100644 --- a/translated/tech/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md +++ b/translated/tech/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md @@ -1,60 +1,47 @@ -软件开发者的高效 vim 编辑器插件 第三部分 a.vim - +开发者的实用 Vim 插件(三) ============================================================ -目前为止,在一系列介绍 vim 插件文章中,我们介绍了使用 Pathogen 插件管理包安装基本的 vim 插件,也提及了另外三个插件 Tagbar,delimitMate 和 Syntastic.现在,在最后一部分,我们将介绍另一个十分有用的插件 a.vim +目前为止,在一系列介绍 vim 插件文章中,我们介绍了使用 Pathogen 插件管理包安装基本的 vim 插件,也提及了另外三个插件:[Tagbar、delimitMate](https://linux.cn/article-7901-1.html) 和 [Syntastic](https://linux.cn/article-7909-1.html)。现在,在最后一部分,我们将介绍另一个十分有用的插件 a.vim。 +请注意所有本篇教程所提及的例子、命令和指导,它们已经在 Ubuntu 16.04 测试完毕,vim 使用版本为 vim7.4 (LCTT 译注:Ubuntu 16.04 的默认版本) -请注意所有本篇教程所提及的例子,命令,和指导,它们已经在 Ubuntu16.04(注:目前是最新版本)测试完毕,vim 使用版本为 vim7.4(注:Ubuntu16.04的默认版本) +### A.vim -A.vim - - -如果你一直用像 C,C++ 这样的语言进行开发工作,你一定有这样的感触:我特么已经数不清我在头文件和源代码之间切换过多少次了.我想说的是,确实,这个操作十分基本,十分频繁. - -尽管使用基于 GUI(图形界面) 的 IDE(集成开发环境) 非常容易通过鼠标的双击切换文件,但是如果你是资深 vim 粉,习惯用命令工作就有点尴尬了.但是不要害怕,我有秘籍--插件 a.vim.它可以让你解决尴尬,专治各种文件切换. +如果你一直用像 C、C++ 这样的语言进行开发工作,你一定有这样的感触:我特么已经数不清我在头文件和源代码之间切换过多少次了。我想说的是,确实,这个操作十分基本,十分频繁。 +尽管使用基于 GUI(图形界面)的 IDE(集成开发环境)非常容易通过鼠标的双击切换文件,但是如果你是资深 vim 粉,习惯用命令工作就有点尴尬了。但是不要害怕,我有秘籍--插件 a.vim。它可以让你解决尴尬,专治各种文件切换。 在我们介绍这个神器用法之前,我必须强调一点:这个插件的安装过程和我们其他篇介绍的不太一样,步骤如下: +* 首先,你需要下载两个文件(a.vim 和 alternate.txt),你可以在[这里][1]找到它们。 +* 接下来,创建如下目录:`~/.vim/bundle/avim`、`~/.vim/bundle/avim/doc`、 `~/.vim/bundle/avim/plugin` 和 `~/.vim/bundle/autoload`。 +* 创建好目录之后,将 `a.vim` 放到 `~/.vim/bundle/avim/plugin` 和 `~/.vim/bundle/autoload`,以及将 `alternate.txt` 放到 `~/.vim/bundle/avim/doc`。 -* Firstly, you need to download a couple of files (a.vim and alternate.txt), which you can do by heading [here][1]. -* Next, create the following directories: ~/.`vim/bundle/avim`, ~/.`vim/bundle/avim/doc`, ~/.`vim/bundle/avim/plugin`, and ~/.`vim/bundle/autoload.` -* Once the directory creation is done, put a.vim into ~/.vim/bundle/avim/plugin as well as ~/.vim/bundle/autoload, and alternate.txt into ~/.vim/bundle/avim/doc. +就是这样,如果上述步骤被你成功完成,你的系统就会安装好这个插件。 -就是这样,如果上述步骤被你成功完成,你的系统就会安装好这个插件 +使用这个插件十分简单,你仅仅需要运行这个命令 `:A` 如果目前的文件是源文件(比如 `test.c`),这个神器就会帮你打开 `test.c` 对应的头文件(`test.h`),反之亦然。 -使用这个插件十分简单,你仅仅需要运行这个命令 :A 如果目前的文件是源文件(比如 test.c),这个神器就会帮你打开 test.c 对应的头文件(test.h),反之亦然. +当然咯,不是每个文件对应的头文件都存在。这种情况下,如果那你运行 `:A` 命令,神器就会为你新建一个文件。比如,如果 `test.h` 不存在,那么运行此命令就会帮你创建一个 `test.h`,然后打开它。 +如果你不想要神器开启此功能,你可以在你的家目录的隐藏文件 `.vimrc` 中写入 `g:alternateNonDefaultAlternate` 变量,并且赋给它一个非零值即可。 -当然咯,不是每个文件对应的头文件都存在.这种情况下,如果那你运行 :A 命令,神器就会为你新建一个文件.比如,如果 -test.h 不存在,那么运行此命令就会帮你创建一个 test.h,然后打开它. +还有一种情况也很普遍,你需要打开的文件并非是当前源代码的头文件。比如你目前在 `test.c` 你想打开 `men.h` 这个头文件,那么你可以输入这个命令 `:IH ` ,毋需赘言,你肯定要在后面输入你要打开的的文件名称 ``。 +目前为止,我们讨论的功能都仅限于你当前文件和要操作的文件都在同一个目录去实现。但是,你也知道,我们还有特殊情况,我是说,许多项目中头文件与对应的源文件并不一定在同一目录下。 -如果你不想要神器开启此功能,你可以在你的家目录的隐藏文件夹 .vimrc 中写入 g:alternateNonDefaultAlternate 变量,并且赋给它一个非零值即可. +为了搞定这个问题,你要使用这个 `g:alternateSearchPath` 这个变量。官方文档是这么[解释](https://github.com/csliu/a.vim/blob/master/doc/alternate.txt)的: +> 这个插件可以让用户配置它的搜索源文件和头文件的搜索路径。这个搜索路径可以通过设置 `g:alternateSearchPath` 这个变量的值指定。默认的设定如下: -还有一种情况也很普遍,你需要打开的文件并非是当前源代码的头文件.比如你目前在 test.c 你想打开 men.h 这个头文件,那么你可以输入这个命令 :IH ,毋需赘言,你肯定要在后面输入你要打开的的文件名称 +> ``` +> g:alternateSearchPath = 'sfr:../source,sfr:../src,sfr:../include,sfr:../inc' +> ``` +> 使用这个代码表示神器将搜索 `../source`、`../src`、`../include` 和 `../inc` 下所有与目标文件相关的文件。 `g:alternateSearchPath` 变量的值由前缀和路径组成,每个单元用逗号隔开。 `sfr` 前缀是指后面的路径是相对于目前文件的,`wdr` 前缀是指目录是相对于目前的工作目录, `abs` 是指路径是绝对路径。如果不指定前缀,那么默认为 `sfr`。 -目前为止,我们讨论的功能都仅限于你当前文件和要操作的文件都在同一个目录去实现.但是,你也知道,我们还有特殊情况,我是说,许多项目中头文件与对应的源文件并不一定在同一目录下 +如果我们前文所提及的特性就能让你觉得很炫酷,那我不得不告诉你,这才哪跟哪。还有一个十分有用的功能是分割 Vim 屏幕,这样你就可以同时看到头文件和相应的源文件。 -为了搞定这个问题,你要使用这个 g:alternateSearchPath 这个变量.官方文档是这么解释的: - - -这个插件可以让用户配置它的搜索源文件和头文件的搜索路径.这个搜索路径可以通过设置 g:alternateSearchPath 这个变量的值指定.默认的设定如下: - -``` -g:alternateSearchPath = 'sfr:../source,sfr:../src,sfr:../include,sfr:../inc' -``` - -使用这个代码表示神器将搜索../source,../src..,../include 和 ../inc 下所有与目标文件相关的文件. g:alternateSearchPath 变量的值由前缀和路径组成,每个单元用逗号隔开. "sfr" 前缀是指后面的路径是相对于目前文件的, "wdr" 前缀是指目录是相对于目前的工作目录, "abs" 是指路径是绝对路径.如果不指定前缀,那么默认为 "sfr". - - -如果我们前文所提及的特性就能让你觉得很炫酷,那我不得不告诉你,这才哪跟哪.还有一个十分有用的功能是分割 Vim 屏幕,这样你就可以同时看到头文件和相应的源文件. - - -o还有,你还可以选择垂直或者水平分割.全凭你心意.使用 :AS 命令可以水平分割,使用 :AV 可以垂直分割 +哦,还有,你还可以选择垂直或者水平分割。全凭你心意。使用 `:AS` 命令可以水平分割,使用 `:AV` 可以垂直分割。 [ ![Vim.a vertical split screen](https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers-3/vim-ver-split.png) @@ -64,33 +51,29 @@ o还有,你还可以选择垂直或者水平分割.全凭你心意.使用 ![vim.a horizontal split screen](https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers-3/vim-hor-split.png) ][6] -使用 :A 命令在已经打开的文件中选择你想要的 - - -r这个插件还可以让你打开多个相应的文件在同一个 Vim 窗口中不同列表中,你键入这个命令 :AT +使用 `:A` 命令在已经打开的文件中切换。 +这个插件还可以让你在同一个 Vim 窗口中不同选项卡中打开多个相应的文件,你键入这个命令 `:AT`。 [ ![tabs in Vim with a.vim.](https://www.howtoforge.com/images/vim-editor-plugins-for-software-developers-3/vim-tab1.png) ][7] -当然,你可以用这些命令 :AV :AS :AT,也可以使用这些命令 :IHV :IHS :IHT +当然,你可以用这些命令 `:AV`、`:AS` 和 `:AT`,也可以使用这些命令 `:IHV`、`:IHS` 和 `:IHT`。 -最后 +### 最后 -还有许多和编程相关的 Vim 的插件,我们在这个第三方系列主要讨论的是,如果你为你的软件开发工作安装了合适的插件,你就会明白为什么 vim 被叫做编辑器之神 - - -当然,我们在这只关注编程方面,对于那些把 Vim 当做日常文档编辑器的人来说,你也应该了解一些 Vim 的插件,让你的编辑更好,更高效.我们就改日再谈这个问题吧. +还有许多和编程相关的 Vim 的插件,我们在这个三篇系列主要讨论的是,如果你为你的软件开发工作安装了合适的插件,你就会明白为什么 vim 被叫做编辑器之神。 +当然,我们在这只关注编程方面,对于那些把 Vim 当做日常文档编辑器的人来说,你也应该了解一些 Vim 的插件,让你的编辑更好,更高效.我们就改日再谈这个问题吧。 -------------------------------------------------------------------------------- via: https://www.howtoforge.com/tutorial/vim-editor-plugins-for-software-developers-3/ 作者:[Ansh][a] -译者:[Taylor1024](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Taylor1024](https://github.com/Taylor1024) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 10c4f517dca3ace47ec7f3f43221c6d36474fc15 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 2 Apr 2017 17:44:00 +0800 Subject: [PATCH 068/241] PUB:20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md @Taylor1024 --- ...l Vim editor plugins for software developers - part 3 a.vim.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md (100%) diff --git a/translated/tech/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md b/published/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md similarity index 100% rename from translated/tech/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md rename to published/20161020 Useful Vim editor plugins for software developers - part 3 a.vim.md From f4996575088aa02fd9a51be1ff766a43831743c8 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 2 Apr 2017 17:54:28 +0800 Subject: [PATCH 069/241] =?UTF-8?q?=E6=92=A4=E9=94=80=E5=B7=B2=E5=9B=9E?= =?UTF-8?q?=E6=94=B6=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Yoo-4x 该篇已经超期,被其它同学翻译并于上月发布。因此,重复提交的本篇做撤销处置。 --- .../tech/20170214 CentOS Vs. Ubuntu.md | 81 ------------------- 1 file changed, 81 deletions(-) delete mode 100644 translated/tech/20170214 CentOS Vs. Ubuntu.md diff --git a/translated/tech/20170214 CentOS Vs. Ubuntu.md b/translated/tech/20170214 CentOS Vs. Ubuntu.md deleted file mode 100644 index 5c6648b32b..0000000000 --- a/translated/tech/20170214 CentOS Vs. Ubuntu.md +++ /dev/null @@ -1,81 +0,0 @@ -Yoo-4x translating -# [CentOS Vs. Ubuntu][5] - -[ - ![centos vs. ubuntu](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/centos-vs-ubuntu_orig.jpg) -][4]Linux 可以用的选项几乎是"没有限制"的。因为你可以构建它,也可以通过修改已经存在的发行版本或者一个新的 [Linux From Scratch][7] (LFS)。我们的选择选择 Linux 发行版本包括它的用户界面,文件系统,软件包发行版本,新的可选特性甚至包括升级时间和版本支持。​ -这篇文章我们将会它讨论 Linux 的两个大的发现哦每个那么呢没,事实上它将在各自相较更好的特性上对两个发行版本进行区分。 - -### CentOS 是什么? - -CentOS ( _企业社区开源系统_ ) 从 Red Hat Enterprise Linux (RHEL) 派生出社区支持的 Linux 派生版本, 与 RHEL 兼容,所以我们也可以说是免费版本的 RHEL。每个版本技术支持长达10年,并且每两年发行一个版本。在一月十四日 Centos 官方宣布加入 Red Hat,同时将会在一个 CentOS 板块与 RHEL 保持独立。 - -请阅读 - [如何安装 CentOS?][1] - -### CentOS 的历史和第一个版本 - -[CentOS][8] 的第一个版本作为 cAOs 在2004年发行,作为一个基于 RPM(红帽软件包管理系统)并且由社区维护和管理的发行版本。 - -它结合 Debian, Red Hat Linux/Fedora and FreeBSD 的多个方面,使它足够稳定以便运行在服务器上和周期为三到五年的集群。它是一个更大的组织(CAOS 基金)的一部分,这个组织有一群开源开发者[1]。 - -在2016年四月 TAO Linux —— 被 David Parsley 开发的另一个 RHEL 克隆版本宣布 TAO Linux 将停止开发并加入 CentOS 开发。他迁移到 CentOS 并没有影响他之前的用户(TAO 用户),即它们可以通过 yum update 升级他们的系统而迁移到 CentOS 中来。 - -​在2014年二月 Red Hat 开始赞助 CentOS 项目, 将所有权和商标转让给了它。 - -[[1\.开源软件][9]] - -### CentOS 设计 - -CentOS 克隆的是 Red Hat 付费版本(Red Had Enterprise Edition)。RHEL 为其提供源代码, CentOS 将去掉品牌和商标并修改为最终的成品。 - -### Ubuntu - -Ubuntu 是一个基于 Debian 的 Linux 系统,目前用在桌面、服务器、智能手机和平板上。 Ubuntu 由 Canonical Ltd 公司开展,该公司在英国成立并由 South African Mark Shuttleworth 资助。 - -拓展 - [10 Things To Do After Installing Ubuntu 16.10][2] - -### Ubuntu 设计 - -Ubuntu 是一个依靠全世界的开发者贡献的开源发行版本。近年来它的界面越发直观和现代,整个系统已经变得反应快速,更加安全并拥有海量的可供下载的软件资源。 - -因为基于[Debian][10],它支持 .deb 格式的软件包,发布最近了一个更加发安全的软件包系统[snap package format (snappy)][11]。 - -​这个新的软件包系统允许应用程序交付而不需担心依赖。 - -拓展 - [LinuxAndUbuntu Review Of Unity 8 In Ubuntu 16.10][3] - -### CentOS 和 Ubuntu 之间的不同 - -* ubuntu基于 Debian 而 CentOS 基于 RHEL; -* Ubuntu 使用 .deb 和 .snap 软件包,而 centOS 使用 .rpm 和 flatpak; -* Ubuntu 使用 apt 指令来升级 而 centOS 使用同 YUM; -* 因为不需要定期升级软件包,所以 CentOS 显得更加稳定。但是这并不意味着 ubuntu 相对不安全; -* Ubuntu 有着更丰富的文档并且提供免费技术支持; -* Ubuntu 服务器版本对云部署和勇气部署有着更好的支持。 - -### 结论 - -不管你的选择是什么,**Ubuntu or CentOS** 这两个发行版本都非常棒并且稳定。如果你想拥有短的版本周期你将忠于 ubuntu, 如果你不希望发行版本改变它的软件包太快你将经常使用 CentOS。请在下部留言来告诉我你更喜欢哪个发行版本。| - --------------------------------------------------------------------------------- - -via: http://www.linuxandubuntu.com/home/centos-vs-ubuntu - -作者:[linuxandubuntu.com][a] -译者:[Yoo-4x] -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu -[1]:http://www.linuxandubuntu.com/home/how-to-install-centos -[2]:http://www.linuxandubuntu.com/home/10-things-to-do-after-installing-ubuntu-16-04-xenial-xerus -[3]:http://www.linuxandubuntu.com/home/linuxandubuntu-review-of-unity-8-preview-in-ubuntu-1610 -[4]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu -[5]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu -[6]:http://www.linuxandubuntu.com/home/centos-vs-ubuntu#comments -[7]:http://www.linuxandubuntu.com/home/how-to-create-a-linux-distro -[8]:http://www.linuxandubuntu.com/home/10-things-to-do-after-installing-centos -[9]:https://en.wikipedia.org/wiki/Open-source_software -[10]:https://www.debian.org/ -[11]:https://en.wikipedia.org/wiki/Snappy_(package_manager) From 8bdeb594ecfba8b531c9dc5f1feb9609d0585e98 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 2 Apr 2017 18:05:17 +0800 Subject: [PATCH 070/241] PUB:20170320 Why Go.md @geekpi @jasminepeng --- .../tech => published}/20170320 Why Go.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) rename {translated/tech => published}/20170320 Why Go.md (63%) diff --git a/translated/tech/20170320 Why Go.md b/published/20170320 Why Go.md similarity index 63% rename from translated/tech/20170320 Why Go.md rename to published/20170320 Why Go.md index a03bf8503f..897b4793d4 100644 --- a/translated/tech/20170320 Why Go.md +++ b/published/20170320 Why Go.md @@ -3,36 +3,35 @@ 几个星期前,我一个朋友问我:“为什么要关心 Go 语言”? 因为他们知道我热衷于 Go 语言,但他们想知道为什么我认为_其他人_也应该关心。本文包含三个我认为 Go 是重要的编程语言的原因。 -# 安全 +### 安全 -个人而言,你和我或许完全有能力在 C 中编写程序,既不会泄漏内存,也不会不安全地重复使用内存。然而,整体上,即使有超过[ 40 年][5]的经验,用 C 的程序员也无法可靠地这样做。 +个人而言,你和我或许完全有能力在 C 中编写程序,既不会泄漏内存,也不会不安全地重复使用内存。然而,整体上,即使有超过 [40 年][5]的经验,用 C 的程序员也无法可靠地这样做。 -尽管静态代码分析、valgrind、tsan 以及 “-Werror” 已经存在了几十年,很少有证据表明这些工具被广泛认可,更不用说广泛采用。总而言之,事实表明,程序员根本无法安全地管理自己的内存。现在是离开 C 的时候了。 +尽管静态代码分析、valgrind、tsan 以及 “-Werror” 已经存在了几十年,却很少有证据表明这些工具被广泛认可,更不用说广泛采用。总而言之,事实表明,程序员根本无法安全地管理自己的内存。现在是离开 C 的时候了。 -Go 不依赖于程序员直接管理内存,所有内存分配都由语言运行时管理,使用前初始化,必要时检查边界。它肯定不是提供这些安全保障的第一个主流语言,Java(1995)可能是该冠军的竞争者。关键是,世界对不安全的编程语言没有胃口,所以人们默认认为,Go 是内存安全的。 +Go 不需要程序员直接管理内存,所有内存分配都由语言运行时自行管理,使用前初始化,必要时检查边界。它肯定不是提供这些安全保障的第一个主流语言,Java(1995)可能是该冠军的竞争者。关键是,世界对不安全的编程语言没有胃口,所以人们默认认为,Go 是内存安全的。 -# 开发人员生产力 +### 开发人员生产力 -从 20 世纪 70 年代末,开发人员时间变得比硬件时间更昂贵了。开发人员的生产力是一个不断扩展的话题,但它归结为这一点:你花了多少时间做有用的工作,又有多少时间等待编译器或者失望地迷失在外部代码库中。 +从 20 世纪 70 年代末,开发人员的时间变得比硬件所耗费的时间更昂贵了。开发人员的生产力是一个不断扩展的话题,但它归结为这一点:你花了多少时间做有用的工作,又有多少时间等待编译器或者失望地迷失在外部代码库中。 -有个笑话说 Go 是在等待[ C ++ 程序编译][6]时开发的。快速编译是 Go 的一个重要功能,也是吸引新开发人员的关键工具。虽然编译速度仍然是一个[永久的战场][7],但公平地说,在其他语言中需要几分钟的编译,在 Go 中只需要几秒钟。 +有个笑话说 Go 是在等待 [C ++ 程序编译][6]时开发的。快速编译是 Go 的一个重要功能,也是吸引新开发人员的关键工具。虽然编译速度仍然是一个[永久的战场][7],但公平地说,在其他语言中需要几分钟的编译,在 Go 中只需要几秒钟。 -Go 程序员意识到生产力更根本的问题是代码是为了_读而写的_,所以将[代码的阅读行为放在编写之上][8]。Go 通过工具和自定义强制所有代码格式化成特定的样式。这消除了学习项目特定语言子方言时的困难,并有助于发现错误,因为它们_看上去_就是不正确。 +Go 程序员意识到生产力的更根本的问题是代码是**为了读而写的**,所以将[代码的阅读行为放在编写之上][8]。Go 通过工具和自定义来强制所有代码格式化成特定的样式。这消除了学习项目特定语言的方言时的困难,并有助于发现错误,因为它们**看上去**就是不正确。 -由于专注于分析和机器辅助,Go 开发人员开始采用越来越多的工具来发现常见的编码错误,这种工具从来没有在 C 语言开发者中产生共鸣 - Go 开发人员_希望_工具帮助他们保持代码清洁。 +由于专注于分析和机器辅助,Go 开发人员开始采用越来越多的工具来发现常见的编码错误,这种工具从来没有在 C 语言开发者中产生共鸣 - Go 开发人员**希望**工具帮助他们保持代码清洁。 -# 并发性 +### 并发性 -十多年来,芯片设计师一直在警告[免费午餐将会结束][9]。从最低端的手机到最耗电的服务器,硬件的并行性以[更多、更慢、堆 cpu 内核][10]的形式出现,只有_当_你的语言可以利用它们才能实现。因此,并发需要内置到我们编写的要在今天的硬件上运行的软件中。 +十多年来,芯片设计师一直在警告[免费午餐将会结束][9]。从最低端的手机到最耗电的服务器,硬件的并行性以[更多、更慢、堆砌 cpu 内核][10]的形式出现,但只有**当**你的语言可以利用它们才有意义。因此,并发特性需要内置到我们编写的要在今天的硬件上运行的软件中。 通过提供一种基于协程的[轻量级并发模型][11],或者是 Go 中已知的 goroutines,Go 超越了那些暴露操作系统的多进程或多线程并行模型的语言。goroutines 允许程序员避开复杂的回调,而语言运行时确保有足够的线程来保持你的内核的活跃。 -# 总结 +### 总结 我给朋友推荐 Go 有三个原因:安全性、生产力和并发性。有些语言可以涵盖一个也有可能是两个方面,但是这三个方面的结合使得 Go 成为主流程序员的绝佳选择。 - -## 相关文章: +### 相关文章: 1. [为什么 Go 和 Rust 不是竞争对手][1] 2. [听听我在 OSCON 上谈 Go 语言性能][2] From 48cd9be47019a9621d5ecda55378f95da7cf5155 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Sun, 2 Apr 2017 07:23:00 -0400 Subject: [PATCH 071/241] tranlsated --- .../20170316 What is Linux VPS Hosting.md | 89 ------------------- .../20170316 What is Linux VPS Hosting.md | 84 +++++++++++++++++ 2 files changed, 84 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20170316 What is Linux VPS Hosting.md create mode 100644 translated/tech/20170316 What is Linux VPS Hosting.md diff --git a/sources/tech/20170316 What is Linux VPS Hosting.md b/sources/tech/20170316 What is Linux VPS Hosting.md deleted file mode 100644 index 045d5b5ad8..0000000000 --- a/sources/tech/20170316 What is Linux VPS Hosting.md +++ /dev/null @@ -1,89 +0,0 @@ -vim-kakali translating - -What is Linux VPS Hosting? -============================================================ - - - ![what is linux vps hosting](https://www.rosehosting.com/blog/wp-content/uploads/2017/03/what-is-linux-vps-hosting.jpg) - -If you have a site that gets a lot of traffic, or at least, is expected to generate a lot of traffic, then you might want to consider getting a [Linux VPS hosting][6] package. A Linux VPS hosting package is also one of your best options if you want more control over the things that are installed on the server where your website is hosted at. Here are some of the frequently asked questions about Linux VPS hosting, answered. - -### What does Linux VPS stand for? - -Basically, Linux VPS stands for a virtual private server running on a Linux system. A virtual private server is a virtual server hosted on a physical server. A server is virtual if it runs in a host computer’s memory. The host computer, in turn, can run a few other virtual servers. - -### So I have to share a server with other users? - -In most cases, yes. However, this does not mean that you will suffer from downtime or decreased performance. Each virtual server can run its own operating system, and each of these systems can be administered independently of each other. A virtual private server has its own operating system, data, and applications that are separated from all the other systems, applications, and data on the physical host server and the other virtual servers. - -Despite sharing the physical server with other virtual private servers, you can still enjoy the benefits of a more expensive dedicated server without spending a lot of money for the service. - -### What are the benefits of a Linux VPS hosting service? - -There are many benefits when using a Linux VPS hosting service, including ease of use, increased security, and improved reliability at a lower total cost of ownership. However, for most webmasters, programmers, designers, and developers, the true benefit of a Linux VPS is the flexibility. Each virtual private server is isolated with its own operating environment, which means that you can easily and safely install the operating system that you prefer or need—in this case, Linux—as well as remove or add software and applications easily whenever you want to. - -You can also modify the environment of your VPS to suit your performance needs, as well as improve the experience of your site’s users or visitors. Flexibility can be the advantage you need to set you apart from your competitors. - -Note that some Linux VPS providers won’t give you full root access to your Linux VPS, in which case you’ll have limited functionality. Be sure to get a [Linux VPS where you’ll have full access to the VPS][7], so you can modify anything you want. - -### Is Linux VPS hosting for everyone? - -Yes! Even if you run a personal blog dedicated to your interests, you can surely benefit from a Linux VPS hosting package. If you are building and developing a website for a company, you would also enjoy the benefits. Basically, if you are expecting growth and heavy site traffic on your website, then a Linux VPS is for you. - -Individuals and companies that want more flexibility in their customization and development options should definitely go for a Linux VPS, especially those who are looking to get great performance and service without paying for a dedicated server, which could eat up a huge chunk of the site’s operating costs. - -### I don’t know how to work with Linux, can I still use a Linux VPS? - -Of course! If you get a fully managed Linux VPS, your provider will manage the server for you, and most probably, will install and configure anything you want to run on your Linux VPS. If you get a VPS from us, we’ll take care of your server 24/7 and we’ll install, configure and optimize anything for you. All these services are included for free with all our [Managed Linux VPS hosting][8] packages. - -So if you use our hosting services, it means that you get to enjoy the benefits of a Linux VPS, without any knowledge of working with Linux. - -Another option to easy the use of a Linux VPS for beginners is to get a [VPS with cPanel][9], [DirectAdmin][10] or any [other hosting control panel][11]. If you use a control panel, you can manage your server via a GUI, which is a lot easier, especially for beginners. Although, [managing a Linux VPS from the command line][12] is fun and you can learn a lot by doing that. - -### How different is a Linux VPS from a dedicated server? - -As mentioned earlier, a virtual private server is just a virtual partition on a physical host computer. The physical server is divided into several virtual servers, which could diffuse the cost and overhead expenses between the users of the virtual partitions. This is why a Linux VPS is comparatively cheaper than a [dedicated server][13], which, as its name implies, is dedicated to only one user. For a more detailed overview of the differences, check our [Physical Server (dedicated) vs Virtual Server (VPS) comparison][14]. - -Aside from being more cost-efficient than dedicated servers, Linux virtual private servers often run on host computers that are more powerful than dedicated servers—performance and capacity are often greater than dedicated servers. - -### I want to move from a shared hosting environment to a Linux VPS, can I do that? - -If you currently use [shared hosting][15], you can easily move to a Linux VPS. One option is to [do it yourself][16], but the migration process can be a bit complicated and is definitely not recommended for beginners. Your best option is to find a host that offers [free website migrations][17] and let them do it for you. You can even move from shared hosting with a control panel to a Linux VPS without a control panel. - -### Any more questions? - -Feel free to leave a comment below. - -If you get a VPS from us, our expert Linux admins will help you with anything you need with your Linux VPS and will answer any questions you have about working with your Linux VPS. Our admins are available 24/7 and will take care of your request immediately. - -PS. If you liked this post please share it with your friends on the social networks using the buttons below or simply leave a reply in the comments section. Thanks. - - --------------------------------------------------------------------------------- - -via: https://www.rosehosting.com/blog/what-is-linux-vps-hosting/ - -作者:[https://www.rosehosting.com ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.rosehosting.com/blog/what-is-linux-vps-hosting/ -[1]:https://www.rosehosting.com/blog/what-is-linux-vps-hosting/ -[2]:https://www.rosehosting.com/blog/what-is-linux-vps-hosting/#comments -[3]:https://www.rosehosting.com/blog/category/guides/ -[4]:https://plus.google.com/share?url=https://www.rosehosting.com/blog/what-is-linux-vps-hosting/ -[5]:http://www.linkedin.com/shareArticle?mini=true&url=https://www.rosehosting.com/blog/what-is-linux-vps-hosting/&title=What%20is%20Linux%20VPS%20Hosting%3F&summary=If%20you%20have%20a%20site%20that%20gets%20a%20lot%20of%20traffic,%20or%20at%20least,%20is%20expected%20to%20generate%20a%20lot%20of%20traffic,%20then%20you%20might%20want%20to%20consider%20getting%20a%20Linux%20VPS%20hosting%20package.%20A%20Linux%20VPS%20hosting%20package%20is%20also%20one%20of%20your%20best%20options%20if%20you%20want%20more%20... -[6]:https://www.rosehosting.com/linux-vps-hosting.html -[7]:https://www.rosehosting.com/linux-vps-hosting.html -[8]:https://www.rosehosting.com/linux-vps-hosting.html -[9]:https://www.rosehosting.com/cpanel-hosting.html -[10]:https://www.rosehosting.com/directadmin-hosting.html -[11]:https://www.rosehosting.com/control-panel-hosting.html -[12]:https://www.rosehosting.com/blog/basic-shell-commands-after-putty-ssh-logon/ -[13]:https://www.rosehosting.com/dedicated-servers.html -[14]:https://www.rosehosting.com/blog/physical-server-vs-virtual-server-all-you-need-to-know/ -[15]:https://www.rosehosting.com/linux-shared-hosting.html -[16]:https://www.rosehosting.com/blog/from-shared-to-vps-hosting/ -[17]:https://www.rosehosting.com/website-migration.html diff --git a/translated/tech/20170316 What is Linux VPS Hosting.md b/translated/tech/20170316 What is Linux VPS Hosting.md new file mode 100644 index 0000000000..4b5a97b526 --- /dev/null +++ b/translated/tech/20170316 What is Linux VPS Hosting.md @@ -0,0 +1,84 @@ + +什么是 Linux VPS Hosting? +============================================================ + + + ![what is linux vps hosting](https://www.rosehosting.com/blog/wp-content/uploads/2017/03/what-is-linux-vps-hosting.jpg) +如果你有一个吞吐量很大的网站,或者至少,你想要增加你的网站吞吐量,那么你可以考虑使用 [Linux VPS hosting][6] 包 。你可以把它安装在网站所在的服务器上,如果你想要控制除此之外的很多事情,那么 Linux VPS hosting 包就是最好的选择之一。这里我会回答一些频繁被提及的关于 Linux VPS hosting 的问题。 + + +### Linux VPS 意味着什么? +事实上, Linux VPS 就像一个运行在 Linux 系统上的虚拟专属服务器 。虚拟专属服务器是一个在物理服务器上的虚拟服务主机 。这种虚拟专属服务器运行在物理主机的内存里。物理主机可以轮流运行很多其他的虚拟专属服务器 。 + +### 我必须和其他用户共享服务器吗? +一般是这样的。但这并不意味着下载时间变长或者服务器性能降低。每个虚拟服务器可以运行它自己的操作系统,这些系统之间可以相互独立的进行管理。一个虚拟专属服务器有它自己的操作系统、数据、应用程序;它们都与物理主机和其他虚拟服务器中的操作系统、应用程序、数据相互分离。 + +尽管必须和其他虚拟专属服务器共享物理主机,但是你却可以不需花费大价钱得到一个昂贵专用服务器的诸多好处。 + +### Linux VPS hosting 的优势是什么? +使用 Linux VPS hosting 服务会有很多的优势,包括容易使用、安全性增加以及在更低的总体成本上提高可用性。然而,对于大多数网站管理者、程序员、设计者和开发者来说,使用 Linux VPS hosting 服务的最大的优势是它的灵活性。每个虚拟专属务器都和它自己的操作环境相互隔离,这意味着你可以容易且安全的安装一个你喜欢的或者迫切需要的操作系统,每当你想要安装操作系统的时候,你可以很容易的卸载或者安装软件及应用程序。 + + +你也可以更改你的 VPS 环境以适应你的性能需求,同样也可以提高你的网站用户或访客的体验。灵活性会是你超越对手的主要优势。 + +记住,一些 Linux VPS 提供商可能不会给你 root 权限。这样你的服务器性能就会受到限制。要确定你得到的是 [拥有 root 权限的 Linux VPS][7] ,这样你就可以做任何你想做的修改。 + + +### 任何人都可以使用 Linux VPS hosting 吗? +当然,你甚至可以运行一个专门的个人兴趣博客,你可以从 Linux VPS hosting 包中受益。如果你为公司搭建开发一个网站,你也会获益匪浅。基本上,如果你想使你的网站更健壮并且增加它的网络吞吐量,那么 Linux VPS 就是为你而生。 + + +个人和企业在进行定制开发的时候都需要很大的灵活行,所以他们肯定会选择 Linux VPS ; 特别是那些正在寻找不使用专用服务器就能得到高性能服务的人们,专用服务器会消耗大量的网站运营成本。 + + +### 不会使用 Linux 也可以使用 Linux VPS 吗? +当然,如果 Linux VPS 由你管理,你的 VPS 提供商会为你管理整个服务器。更有可能,他们将会为你安装、配置一切你想要运行在 Linux VPS 上的服务。如果你使用我们的 VPS,我们会全天候的为你看管 7 天,也会安装、配置 、优化一切服务。这些免费的服务都被包括在所有的我们的 [Linux VPS hosting 管理器][8] 包里。 + +如果你使用我们的主机服务,你会从 Linux VPS 中获益匪浅,并且不需要任何 Linux 工作经验。 + +另一个方面,对于使用 Linux VPS 的新手来说,得到一个 [带有控制面板的 VPS][9]、 [DirectAdmin][10] 或者任何 [其他的主机控制面板][11] 都是很容易的。如果你使用控制面板,就可以通过一个 GUI 管理你的服务器,尤其对于新手,它是很容易使用的。[使用命令行管理 Linux VPS][12] 很有趣,而且你还可以在实践中学到很多。 + +### Linux VPS 和专用服务器有什么不同? +如前所述,一个虚拟专属服务器仅仅是在物理主机上的一个虚拟分区。物理服务器与很多虚拟服务器相互分离,这些虚拟服务器可以降低多个虚拟分区用户的网站维护成本和开销。这就是 Linux VPS 相比一个 [专用服务器][13] 更加便宜的原因,专用服务器的字面意思就是指只有一个用户专用。想要知道关于更多不同点的细节,可以查看 [物理服务器(专用的)vs 虚拟服务器(VPS) 比较][14]。 + +除了比专用服务器有更好的成本效益,Linux 虚拟专属服务器经常运行在主机上,所以它比专用服务器的性能更强大,同时它的容量也比专用服务器更大。 + +### 我可以把网站从共享主机环境迁移到到 Linux VPS 上吗? +如果你当前使用 [共享主机服务][15],你可以很容易的迁移到 Linux VPS 上。一种做法就是 [让它自己完成迁移][16],但是迁移过程很复杂,不建议新手使用。最好的方法是找到一个提供 [免费网站迁移][17] 的主机,然后让它们帮你完成迁移。你还可以从一个带有控制面板的共享主机迁移到一个不带有控制面板的 Linux VPS 。 + +### 更多问题? +随时在下面留下评论。 +如果你使用我们提供的 VPS,我们的 Linux 管理专家会帮助你完成需要在你的 Linux VPS 上的一切工作,并且会回答你的一切关于使用 Linux VPS 的问题。我们的管理员会一周全天候在线及时解决你的问题。 + +PS. 如果你喜欢这个专栏,请使用下面的按钮把它分享给你的网友,或者你也可以在下面的评论区写下你的答复。谢谢。 + + + +-------------------------------------------------------------------------------- + +via: https://www.rosehosting.com/blog/what-is-linux-vps-hosting/ + +作者:[https://www.rosehosting.com ][a] +译者:[vim-kakali](https://github.com/vim-kakali) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.rosehosting.com/blog/what-is-linux-vps-hosting/ +[1]:https://www.rosehosting.com/blog/what-is-linux-vps-hosting/ +[2]:https://www.rosehosting.com/blog/what-is-linux-vps-hosting/#comments +[3]:https://www.rosehosting.com/blog/category/guides/ +[4]:https://plus.google.com/share?url=https://www.rosehosting.com/blog/what-is-linux-vps-hosting/ +[5]:http://www.linkedin.com/shareArticle?mini=true&url=https://www.rosehosting.com/blog/what-is-linux-vps-hosting/&title=What%20is%20Linux%20VPS%20Hosting%3F&summary=If%20you%20have%20a%20site%20that%20gets%20a%20lot%20of%20traffic,%20or%20at%20least,%20is%20expected%20to%20generate%20a%20lot%20of%20traffic,%20then%20you%20might%20want%20to%20consider%20getting%20a%20Linux%20VPS%20hosting%20package.%20A%20Linux%20VPS%20hosting%20package%20is%20also%20one%20of%20your%20best%20options%20if%20you%20want%20more%20... +[6]:https://www.rosehosting.com/linux-vps-hosting.html +[7]:https://www.rosehosting.com/linux-vps-hosting.html +[8]:https://www.rosehosting.com/linux-vps-hosting.html +[9]:https://www.rosehosting.com/cpanel-hosting.html +[10]:https://www.rosehosting.com/directadmin-hosting.html +[11]:https://www.rosehosting.com/control-panel-hosting.html +[12]:https://www.rosehosting.com/blog/basic-shell-commands-after-putty-ssh-logon/ +[13]:https://www.rosehosting.com/dedicated-servers.html +[14]:https://www.rosehosting.com/blog/physical-server-vs-virtual-server-all-you-need-to-know/ +[15]:https://www.rosehosting.com/linux-shared-hosting.html +[16]:https://www.rosehosting.com/blog/from-shared-to-vps-hosting/ +[17]:https://www.rosehosting.com/website-migration.html From 0ec169d5e4c6930d22a68eac5a6aa0b09f695c68 Mon Sep 17 00:00:00 2001 From: vim-kakali <1799225723@qq.com> Date: Sun, 2 Apr 2017 09:25:32 -0400 Subject: [PATCH 072/241] translating --- .../20170127 How to compare directories with Meld on Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170127 How to compare directories with Meld on Linux.md b/sources/tech/20170127 How to compare directories with Meld on Linux.md index ae9591bcc8..eaa06b23d6 100644 --- a/sources/tech/20170127 How to compare directories with Meld on Linux.md +++ b/sources/tech/20170127 How to compare directories with Meld on Linux.md @@ -1,3 +1,5 @@ +vim-kakali translating + How to compare directories with Meld on Linux ============================================================ From 25ec33e2fb9b8df1166427c252907a9ac53b3492 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 3 Apr 2017 06:47:26 +0800 Subject: [PATCH 073/241] PRF:20170125 An executive's guide to containers.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zhousiyu325 翻译的很好! --- ...0125 An executive's guide to containers.md | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/translated/tech/20170125 An executive's guide to containers.md b/translated/tech/20170125 An executive's guide to containers.md index 7806981a20..c734fa7ddf 100644 --- a/translated/tech/20170125 An executive's guide to containers.md +++ b/translated/tech/20170125 An executive's guide to containers.md @@ -5,7 +5,7 @@ 与互联网领域的领导们关于"容器"的讨论通常被总结如下: -_作为一名CxO,我面临杠杆时间术的持续的压力。IT预算不断减少,我只有有限的资源。然而,交付的工作量却比以往更多。我花费太多的时间致力于解决预算的约束。另外,互联网的格局正在经历一个快速的改变,而且新的技术一直在被引进。我从我最信任的顾问那听来的最新的话题是一个"容器策略"的实现。我想理解:_ +_作为一名 CxO,我面临杠杆时间术的持续的压力。IT 预算不断减少,我只有有限的资源。然而,交付的工作量却比以往更多。我花费太多的时间致力于解决预算的约束。另外,互联网的格局正在经历一个快速的改变,而且新的技术一直在被引进。我从我最信任的顾问那听来的最新的话题是一个“容器策略”的实现。我想理解:_ 1. _什么是容器?_ 2. _过渡到容器的企业价值是什么?_ @@ -17,83 +17,81 @@ _作为一名CxO,我面临杠杆时间术的持续的压力。IT预算不断 ### 容器 -在过去的10年左右,企业已经从物理基础设施转向了虚拟机(VMs)。转向VMs的关键优势是可以减少数据中心足迹。通过在同一个物理盒子上运行多个虚拟机,你可以在更少数量的物理机器上安装更多的应用程序。使用容器是另一种更轻量地打包应用程序的方式,而且其交付模式更快。它们是一种在单独的盒子里运行多个应用程序进程的奇特方式,无论那个盒子是一个虚拟机还是一个物理机。另外,容器在DevOps的上下文切换、微服务和云战略方面也有重要作用。 +在过去的 10 年左右,企业已经从物理基础设施转向了虚拟机(VM)。转向 VM 的关键优势是可以减少数据中心的用量。通过在同一个物理机器上运行多个虚拟机,你可以在更少数量的物理机器上安装更多的应用程序。使用容器是另一种更轻量地打包应用程序的方式,而且其交付模式更快。它们是一种在单一的机器里运行多个应用程序进程的奇特方式,无论那个机器是一个虚拟机还是一个物理机。另外,容器在 DevOps 、微服务和云战略场景方面也扮演了重要角色。 -### 容器vs虚拟机 +### 容器 vs 虚拟机 -容器和虚拟机在一些方面并不相同。一台虚拟机尽管不是物理机,但是它表现地就像是一台物理机。虚拟机是一个包含所有东西的独立的环境,从一个完整的(来宾)操作系统开始。在另一方面,容器是共享相同物理机或虚拟机上资源的进程。容器显然更加有趣,因为: +容器和虚拟机在一些方面并不相同。一台虚拟机尽管不是物理机,但是它表现地就像是一台物理机。虚拟机是一个包含所有东西的独立的环境,是一个完整的(来宾)操作系统。在另一方面,容器是一个共享同一个物理机或虚拟机上资源的进程。容器显然更加有趣,因为: * 相比较而言,虚拟机要重一些,而容器更轻。因为容器只包括了它们所运行的程序所需要的库。 * 虚拟机需要花费几分钟来启动,而容器在几秒钟内就可以启动。 -* 通常,更多的容器比虚拟机更加适合你的基础设施。 +* 通常,相当于虚拟机你的基础设施中可以容纳更多的容器。 + ![Containers versus VMs](https://opensource.com/sites/default/files/containersvmvscontainers.png "Containers versus VMs") +技术已经发展到足以保持这些容器安全、彼此独立,而且正确的设计选择可以保证那些坏掉的容器不会影响运行在同一个机器里的其他容器的性能。实际上,操作系统天生就是被用来构建成优化和运行容器的。 -技术已经发展到足以保持这些容器安全、彼此独立,而且正确的设计选择可以保证那些坏掉的容器不会影响运行在同一个盒子里的其他容器的性能。实际上,操作系统是被构建来优化和运行容器本身。 - -然而,当你转向容器时,你需要做出正确的选择。你需要做足够的尽职的调查,所以,你选择合适的技术合作伙伴和能够制作容器的制造商。开源技术起着很关键的作用。开源的[Docker项目][5]使得分层格式的容器很容易构建和使用。[开放容器计划][6](OCI)已经成为被所有主要技术供应商所支持的开源容器标准。如Red Hat这样的开源技术提供商准备好了为容器而准备的安全的操作系统。例如, Red Hat Enterprise Linux 7.x (包括Red Hat Enterprise Linux原子主机)被进行优化以在本机上运行容器,同时也提供监控和管理容器的工具。其他的开源项目如来自Tectonic的CoreOS也正在进入市场。的确,容器正等着被企业所采用。 +然而,当你转向容器时,你需要做出正确的选择。你需要做足够的尽职调查,以便你选择合适的技术合作伙伴和能够制作容器的制造商。开源技术起着很关键的作用。开源的 [Docker 项目][5]使得分层格式的容器很容易构建和使用。[开放容器计划][6](OCI)已经成为被所有主要技术供应商所支持的开源容器标准。如 Red Hat 这样的开源技术提供商提供了为容器而准备的安全的操作系统。例如, Red Hat Enterprise Linux 7.x (包括 Red Hat Enterprise Linux 原子主机)进行了优化以原生地运行容器,同时也提供监控和管理容器的工具。其他的开源项目如来自 Tectonic 的 CoreOS 也正在进入市场。的确,容器正等着被企业所采用。 ### 容器平台 -容器平台让容器成为企业消耗品。在过去的十年中,你可能在你的企业里处理过虚拟机散乱的问题,容器散乱比那要糟糕好几倍。在你的数据中心不同主机上运行不同规模的容器,保证你的应用程序的高可用性,尽管容器故障、自动化健康检查和基于流入的工作载荷的自动化容器缩放等等,这些是你能期待容器平台应该有的一些关键特性。 +容器平台让容器成为企业消耗品。在过去这些年中,你可能在你的企业里处理过虚拟机散乱的问题,容器散乱比那要糟糕好几倍。在你的数据中心横跨不同主机运行不同规模的容器,尽管容器故障仍然保证你的应用程序的高可用性,自动化健康检查和基于流入的工作载荷的自动化容器缩放等等,这些是你能期待容器平台应该有的一些关键特性。 -当在一个被定位为容器即服务模型(CaaS)的平台上运行容器时,这些平台的一些其他特性如自动化生成和部署使这个平台成为平台即服务模型(PaaS)。虽然CaaS能让你规模化运行容器,但是,PaaS可以让你利用你的源代码编译、创建容器,为你运行那些容器。另外,这些平台提供了完整操作管理特性,例如,集群的管理和监控、容器的安全缺陷检测、运行安全的容器、跟踪日志和度量等等。 +当在一个被定位为容器即服务模型(CaaS)的平台上运行容器时,这些平台的一些其它特性如自动化生成和部署使这个平台成为平台即服务模型(PaaS)。虽然 CaaS 能让你规模化运行容器,但是,PaaS 可以让你利用你的源代码编译、创建容器,为你运行那些容器。另外,这些平台提供了完整操作管理特性,例如,集群的管理和监控、容器的安全缺陷检测,以及安全地运行容器、跟踪日志和度量等等。 -尽管一引起技术供应商正在使用他们的专有技术来构建容器平台,但总的来说,一些公司正在围绕建立在[Kubernetes][7](K8S)的基础上的开源技术来规范他们自己。K8S是一项由Google发起的开源项目,现在很多大平台的供应商也支持它。KBS也是[云端原生计算基金会][8](CNCF)的一部分,CNCF正在发展成以云为中心技术的标准体。当你在容器平台上做出选择时,围绕开源流程编排技术的标准化是非常重要的。它基本上允许你移植到不同的容器平台,如果你不喜欢你第一次做的选择。K8S还允许你的容器工作载荷移植到不同的公有云。这些就是为什么我们会看到越来域越多的技术公司正在使用Kubernetes的原因。 +尽管一些技术供应商正在使用他们的专有技术来构建容器平台,但总的来说,企业们正在围绕建立在 [Kubernetes][7](K8S)的基础上的开源技术而进行标准化。K8S 是一项由 Google 发起的开源项目,现在很多大平台的供应商也支持它。K8S 也是[云端原生计算基金会][8](CNCF)的一部分,CNCF 正在发展成以云为中心技术的标准体。当你在容器平台上做出选择时,围绕开源流程编排技术的标准化是非常重要的。它基本上允许你移植到不同的容器平台,如果你不喜欢你第一次做的选择的话。K8S 还允许你的容器工作载荷可跨越不同的公有云进行迁移。这些就是为什么我们会看到越来越多的技术公司正在使用 Kubernetes 的原因。 -一些企业正在试图通过拼接几个包括K8S在内开源项目来打造他们自己的DIY容器平台。这确实是比继续跟随专有技术要更好的一种解决方案,但是要完成这项工作也仍然包含很多需要探讨的地方。然而,一个企业的维护和保持这样的DIY平台的能力应该被认真考虑。许多企业并不是做着创建IT平台的工作,然而他们希望运行自己的主流业务。有很多可行的基于K8S的解决方案,比如[红帽OpenShift平台容器][9]、[Apprenda][10]、[Deis][11]和[Rancher][12],它们提供一个平台的为企业准备的版本。这些解决方案中的每种都有不同完整程度的功能。 +一些企业正在试图通过拼接几个包括 K8S 在内开源项目来打造他们自己 DIY 的容器平台。这确实是比继续跟随专有技术要更好的一种解决方案,但是要完成这项工作也仍然包含很多需要探讨的地方。然而,一个企业的维护和保持这样的 DIY 平台的能力应该被认真评估。许多企业并不是想做创建 IT 平台的工作,而是他们希望运行自己的主流业务。有很多可行的基于 K8S 的解决方案,比如[红帽 OpenShift 平台容器][9]、[Apprenda][10]、[Deis][11] 和 [Rancher][12],它们提供一个企业级平台,这些解决方案中的每种都有不同完整程度的功能。 -这些解决方案是由供应商认证和支持。有些方案是完全的开源PaaS解决方案,而另外一些可能是CaaS。根据你的企业的需求,这些解决方案可以作为比DIY容器平台更好的替代品。 +这些解决方案是由供应商认证和支持。有些方案是完全的开源 PaaS 解决方案,而另外一些可能是 CaaS。根据你的企业的需求,这些解决方案可能是比 DIY 容器平台更好的替代品。 ### 企业的担忧和它们与容器的关系 -今天,几乎每个企业都正在与数字变换打交道,这些数字变换影响包括DevOps战略、微服务和云等多个领域。容器在这些领域中的每一个中都起着相当重要的作用。 +今天,几乎每个企业都正在与数字时代转型打交道,这些转型影响包括 DevOps 战略、微服务和云等多个领域。容器在这些领域中的每一个中都起着相当重要的作用。 -### DevOps策略 +### DevOps 策略 -IT组织被分成运维和应用开发,他们作为两个独立的团队运作,每一队都只有他们自己的一套目标。大多数企业为了将这两个团队联合起来正在朝DevOps的方向前进。 +IT 组织被分成运维和应用开发,他们作为两个独立的团队运作,每一队都只有他们自己的一套目标。大多数企业为了将这两个团队联合起来正在朝 DevOps 的方向前进。 -容器在DevOps倡议的成功中发挥着重要的作用。在DevOps中成功的关键标准之一是增加开发人员在运营中的股份。开发人员不仅应该把代码交给运维人员,而且他们还应该考虑他们的代码是如何在生产环境中运行的。普遍的技术是采用"架构即代码",而不是提供几页容易出错的安装说明指示,开发团队应该提供像编程时的环境配置。 +容器在 DevOps 倡议的成功中发挥着重要的作用。在 DevOps 中成功的关键标准之一是增加开发人员在运营中的份额。开发人员不仅应该把代码交给运维人员,而且他们还应该考虑他们的代码是如何在生产环境中运行的。普遍的技术是采用“架构即代码”,而不是提供几页容易出错的安装说明指示,开发团队应该提供像编程时的环境配置。 - -这恰恰就是容器可以解决的问题。可以作为容器的模版的容器镜像包括整个堆栈,从基本操作系统到应用程序代码。利用容器,开发人员将不再只是从Dev到QA再到Prod这样生成应用程序;相反,他们将传递一个版本化的容器镜像,这个镜像包括生成的运行程序和它运行需要的环境。容器是包罗万象的,从操作系统库到中间件再到应用程序的所有东西都被整合进一个镜像里面。因此,容器在开发环境运行的方式和它在质量保证环境和生产环境下运行的方式完全一样。容器是DevOps成功的重要因素。 +这恰恰就是容器可以解决的问题。可以作为容器的模版的容器镜像包括了从基本操作系统到应用程序代码的整个环境堆栈。利用容器,开发人员将不再只是从 Dev 到 QA 再到 Prod 这样生成应用程序;相反,他们将传递一个版本化的容器镜像,这个镜像包括生成的运行程序和它运行需要的环境。容器是包罗万象的,从操作系统库到中间件再到应用程序的所有东西都被整合进一个镜像里面。因此,容器在开发环境运行的方式和它在质量保证环境和生产环境下运行的方式完全一样。容器是 DevOps 成功的重要因素。 ![Container-based model](https://opensource.com/sites/default/files/containerbasedmodel.png "Container-based model") - 另外,容器平台正在进一步发展。典型的持续集成和交付(CICD)工具,如Jenkins, -可以作为容器,这个容器能在容器平台本身而不需要额外的基础设施运行整个CICD过程。现在你可以使用PaaS平台来生成和运行你的CICD管道。 +另外,容器平台正在进一步发展。典型的持续集成和交付(CICD)工具,如 [Jenkins](https://jenkins.io/),可以作为容器,这个容器能在容器平台本身运行整个 CICD 过程,而不需要额外的基础设施。现在你可以使用 PaaS 平台来生成和运行你的 CICD 管道。 ### 微服务策略 -微服务是今天IT领域的另一个热门话题。应用程序是这样被设计的:把应用程序分解为离散化的小的服务,每个服务完成一个小任务。这些服务中的每一个都可以根据合适的技术用不同的编程语言进行编写。它们可以由小团队(双比萨团队)创建和管理,并且可以迅速地改变它们。所有这些要求再次需要用到容器。容器足够小到成为微服务的基础。容器能够支持任何你选择的技术和语言,容器容易创建和运行,并且可以快速地改变。微服务和容器现在已经不分彼此,如果有人说不使用容器来实现微服务,他们将会受到别人奇怪的表情。 +微服务是今天 IT 领域的另一个热门话题。应用程序是这样被设计的:把应用程序分解为离散化的小的服务,每个服务完成一个小任务。这些服务中的每一个都可以根据合适的技术用不同的编程语言进行编写。它们可以由小团队(双比萨团队)创建和管理,并且可以迅速地改变它们。所有这些要求再次需要用到容器。容器足够小到成为微服务的基础。容器能够支持任何你选择的技术和语言,容器易于创建和运行,并且可以快速地改变。微服务和容器现在已经不分彼此,如果有人说不使用容器来实现微服务,他们将会受到别人奇怪的表情。 -实际情况是,虽然微服务有望让情况变得简单,但是他们的扩张也增加了复杂性。几个微服务的设计和开发模式即将能缓解它们的实现。这意味着开发人员现在急需这样一个开发平台,在这个平台下,开发人员可以轻松地部署和组织微服务,而且还能: +实际情况是,虽然微服务有望让情况变得简单,但是它们的扩张也增加了复杂性。有几个微服务的设计和开发模式将能使它们易于实现。这意味着开发人员现在急需这样一个开发平台,在这个平台下,开发人员可以轻松地部署和组织微服务,而且还能: * 以一种语言不可知的方式实现这些微服务设计模式。 -* 不会因代码入侵而增加代码的复杂性,因此,开发人员必须将许多模式的代码包括进他们的业务逻辑。 +* 不会因代码侵入而增加代码的复杂性,以便开发人员能将许多模式的代码包括进他们的业务逻辑中。 * 足够灵活以便部署在你所选择的基础设施上,并且不会把你捆绑在特定的云上。 -这就是选择一个正确的容器平台所起作用的地方。在具体的基础设施上按照某一特定供应商的方法来实现这些微服务将会把你的应用程序捆绑在那些供应商的平台上。使用类似兼容OCI的容器的容器化微服务将可以保证你的微服务能够被运行在任何兼容OCI的平台上。 +这就是选择一个正确的容器平台所起作用的地方。在具体的基础设施上按照某一特定供应商的方法来实现这些微服务将会把你的应用程序捆绑在那些供应商的平台上。使用类似兼容 OCI 的容器的容器化微服务将可以保证你的微服务能够被运行在任何兼容 OCI 的平台上。 -选择正确的容器平台来运行你的微服务是需要做的另一个重要的决定。今天,有很少的选择和许多的FUD。如果你作出选择时不足够慎重,其中一些选择会把你带到非标准的、特定供应商的路线上。 +选择正确的容器平台来运行你的微服务是需要做的另一个重要的决定。今天,有很少的选择和许多的 FUD。如果你作出选择时不足够慎重,其中一些选择会把你带到非标准的、特定供应商的路线上。 ### 云策略 -云战略是IT领域的又一个热门话题。无论你是否喜欢,服务模型都是不可避免的变化。如果你不将这作为IT服务进行提供,你的开发团队将可能会找到创建"shadow IT"的方法来访问云。另外,尽管使用云技术将会让你从资本支出转移到运营支出,但是,管理云支出是一个不断的挑战。 +云战略是 IT 领域的又一个热门话题。无论你是否喜欢,服务化模型都是不可避免的变化。如果你不将其作为 IT 服务进行提供,你的开发团队将可能会找到创建“shadow IT”的方法来访问云。另外,尽管使用云技术将会让你从资本支出转移到运营支出,但是,管理云支出是一个不断的挑战。 -云可以提供虚拟机,在你添加额外的虚拟机之前,你想确认这个云上的CPU、内存和网络等资源都处于最佳使用状态。容器在这个地方扮演着很重要的角色。因为容器双虚拟机要小得多。并且,如果你的应用程序正运行在容器中,你可以在虚拟机中安装更多的容器,这比在每台虚拟机中运行一个应用程序组件要多很多。 +云可以提供虚拟机,在你添加额外的虚拟机之前,你要确认这个云上的 CPU、内存和网络等资源都处于最佳使用状态。容器在这个地方扮演着很重要的角色。因为容器比虚拟机要小得多。并且,如果你的应用程序正运行在容器中,你可以在虚拟机中安装更多的容器,这比在每台虚拟机中运行一个应用程序组件要多很多。 -公有云供应商有很多,其中Amazon Web Services (AWS)、Microsoft Azure和Google Cloud最受欢迎。另外,你可能想在你的基于OpenStack的数据中心里拥有你自己的私有云。这些云环境中的每一个都有他们自己的协议、API和工具。当你想让你的应用程序在云上运行时,你不想让您的应用程序业务流程按照云供应商的说明,也不想维护任何特定云的代码。与特定的云供应商锁定你的技术就像在未来几年内向供应商签署空白支票。 +公有云供应商有很多,其中 Amazon Web Services(AWS)、Microsoft Azure 和 Google Cloud 最受欢迎。另外,你可能想在你的基于 OpenStack 的数据中心里拥有你自己的私有云。这些云环境中的每一个都有它们自己的协议、API 和工具。当你想让你的应用程序在云上运行时,你不会想要让您的应用编排被云供应商所制约,也不会想要维护任何特定云的代码。在你的技术上与特定的云供应商锁定就像在未来几年内向供应商签署空白支票。 云的可移植性对您的云战略至关重要。你可以编写应用程序,而不用担心它们在哪里运行,容器平台可以将你和特定的云供应商协议隔离开来,从而避免你与一个云供应商锁定。 ### 传统系统 -微服务架构带给开发的优势很多,但并不是每个应用程序都可以重构它们自己,有些只能重构一部分。传统的应用程序被普遍接受,因为它们需要维护和管理。虽然容器可以实现微服务,但容器不仅仅只是微服务。可以想象,你可以将大型应用程序和微服务作为容器来运行,因此只要你选择正确的容器技术和正确的应用程序平台,就可以将许多(如果不是所有)的传统的应用程序作为容器运行。 +微服务架构带给开发的优势很多,但并不是每个应用程序都可以重构它们自己,有些只能重构一部分。传统的应用程序被普遍接受,它们需要维护和管理。虽然容器可以实现微服务,但容器不仅仅只是微服务。可以想象,你可以将大型应用程序和微服务作为容器来运行,因此只要你选择正确的容器技术和正确的应用程序平台,就可以将许多(如果不是所有)的传统的应用程序作为容器运行。 ### 总结 -我希望对各种策略和容器的深入了解有助于你的公司对下一步进行评估。让我在评论里面了解您公司学习到的经验,或者说他们没能大步向前跨越,他们还需要我再提供一些什么信息。 +我希望这篇对各种策略和容器的深入剖析有助于你的公司对下一步进行评估。让我在评论里面了解您公司学习到的经验,或者说没能大步向前跨越,他们还需要我再提供一些什么信息。 ------------------------------------------------------------------------------ @@ -107,7 +105,7 @@ via: https://opensource.com/article/17/1/container-strategy-for-executives 作者:[Veer Muchandi][a] 译者:[zhousiyu325](https://github.com/zhousiyu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d8f717a2fd77d1a35c43101857550ff67e839ef7 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 3 Apr 2017 06:48:00 +0800 Subject: [PATCH 074/241] PUB:20170125 An executive's guide to containers.md @zhousiyu325 --- .../20170125 An executive's guide to containers.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20170125 An executive's guide to containers.md (100%) diff --git a/translated/tech/20170125 An executive's guide to containers.md b/published/20170125 An executive's guide to containers.md similarity index 100% rename from translated/tech/20170125 An executive's guide to containers.md rename to published/20170125 An executive's guide to containers.md From f49becb1c2442b1f52756d852e9dbe3c9f07db25 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 3 Apr 2017 07:02:52 +0800 Subject: [PATCH 075/241] PUB:20170208 4 open source tools for conducting online surveys.md @geekpi @jasminepeng --- ... open source tools for conducting online surveys.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20170208 4 open source tools for conducting online surveys.md (89%) diff --git a/translated/tech/20170208 4 open source tools for conducting online surveys.md b/published/20170208 4 open source tools for conducting online surveys.md similarity index 89% rename from translated/tech/20170208 4 open source tools for conducting online surveys.md rename to published/20170208 4 open source tools for conducting online surveys.md index 9e7b0aff0b..2eab291cff 100644 --- a/translated/tech/20170208 4 open source tools for conducting online surveys.md +++ b/published/20170208 4 open source tools for conducting online surveys.md @@ -7,7 +7,7 @@ 啊,一个好的调查,能够以快速、简单、便宜、有效的方式收集朋友、家人、同学、同事、客户、读者和其他人的意见。 -许多人开始使用专有工具,如 SurveyGizmo、Polldaddy、SurveyMonkey 甚至 Google 表单来设置他们的调查。但是如果你想对应用还有收集到的数据有更多的控制,那么你会希望使用开源工具。 +许多人开始使用专有工具,如 SurveyGizmo、Polldaddy、SurveyMonkey 甚至 Google 表单来设置他们的调查。但是如果你不仅是对这些应用还有你自己收集到的数据有更多的控制,那么你会希望使用开源工具。 让我们来看看四个开源调查工具,无论需求简单还是复杂,它们都可以满足你的需求。 @@ -23,7 +23,7 @@ LimeSurvey 还允许你使用自己的 JavaScript、照片和视频自定义调 如果 LimeSurvey 没有为你提供足够的功能,并且对 Java 驱动的 web 程序感兴趣,那么我推荐 [JD Esurvey][5]。它被称为“一个开源的企业调查 web 应用”。它绝对强大,并满足了那些寻找大容量、健壮的调查工具的组织的很多需求。 -使用 JD Esurvey,你可以收集一系列信息,包括 “是/否” 问题的答案以及产品和服务的星级。你甚至可以处理多个部分的问题的答案。JD Esurvey 支持使用平板电脑和智能手机创建和管理调查,你发布的调查也是移动友好的。根据开发者的说法,该程序[残疾人也可使用][6]。 +使用 JD Esurvey,你可以收集一系列信息,包括 “是/否” 问题的答案以及产品和服务的星级。你甚至可以处理带有多个部分答案的问题。JD Esurvey 支持使用平板电脑和智能手机创建和管理调查,你发布的调查也是移动友好的。根据开发者的说法,该程序[残疾人也可使用][6]。 要使用它,你可以[在 GitHub 上 fork JD Esurvey][7] 或者[下载并安装][8]程序的预编译版本。 @@ -37,11 +37,11 @@ Quick Survey 只允许你创建问答和多选调查列表。你可以添加问 ### TellForm -在功能方面,[TellForm][13] 位于 LimeSurvey 和 Quick Survey 之间。它适合那些功能需求超出最小需求,但无需完全功能的人使用。 +在功能方面,[TellForm][13] 介于 LimeSurvey 和 Quick Survey 之间。它适合那些功能需求超出最小需求,但无需完整功能的人使用。 除了有 11 种不同类型的调查之外,TellForm 还有很好的分析功能。你可以轻松地自定义调查的外观和感觉,而且程序的界面简单干净。 -如果你想自己托管 TellForm,你可以从[ GitHub 仓库][14]中获取代码。或者,你可以注册[免费托管帐户][15]。 +如果你想自己托管 TellForm,你可以从 [GitHub 仓库][14]中获取代码。或者,你可以注册[免费托管帐户][15]。 * * * @@ -58,7 +58,7 @@ Scott Nesbitt - 作家、编辑、雇佣兵(Soldier of fortune)、豹猫牧 via: https://opensource.com/article/17/2/tools-online-surveys-polls -作者:[Scott Nesbitt ][a] +作者:[Scott Nesbitt][a] 译者:[geekpi](https://github.com/geekpi) 校对:[jasminepeng](https://github.com/jasminepeng) From 4aa12a62d93019a226eac5df924c818237a22cf2 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 3 Apr 2017 07:23:12 +0800 Subject: [PATCH 076/241] PUB:20170118 Linux command line navigation tips- the basics of pushd and popd commands.md @geekpi @jasminepeng --- ...- the basics of pushd and popd commands.md | 166 ++++++++++++++++++ ...- the basics of pushd and popd commands.md | 138 --------------- 2 files changed, 166 insertions(+), 138 deletions(-) create mode 100644 published/20170118 Linux command line navigation tips- the basics of pushd and popd commands.md delete mode 100644 translated/tech/20170118 Linux command line navigation tips- the basics of pushd and popd commands.md diff --git a/published/20170118 Linux command line navigation tips- the basics of pushd and popd commands.md b/published/20170118 Linux command line navigation tips- the basics of pushd and popd commands.md new file mode 100644 index 0000000000..7906d13ba9 --- /dev/null +++ b/published/20170118 Linux command line navigation tips- the basics of pushd and popd commands.md @@ -0,0 +1,166 @@ +Linux 命令行工具使用小贴士及技巧(二) +============================================================ + +在本系列的[第一部分][4]中,我们通过讨论 `cd -` 命令的用法,重点介绍了 Linux 中的命令行导航。还讨论了一些其他相关要点/概念。现在进一步讨论,在本文中,我们将讨论如何使用 `pushd` 和 `popd` 命令在 Linux 命令行上获得更快的导航体验。 + +在我们开始之前,值得说明的一点是,此后提到的所有指导和命令已经在 Ubuntu 14.04 和 Bash shell(4.3.11)上测试过。 + +### pushd 和 popd 命令基础 + +为了更好地理解 `pushd` 和 `popd` 命令的作用,让我们先讨论堆栈的概念。想象你厨房案板上有一个空白区域,你想在上面放一套盘子。你会怎么做?很简单,一个接一个地放在上面。 + +所以在整个过程的最后,案板上的第一个盘子是盘子中的最后一个,你手中最后一个盘子是盘子堆中的第一个。现在当你需要一个盘子时,你选择在堆的顶部的那个盘子并使用它,然后需要时选择下一个。 + +`pushd` 和 `popd` 命令是类似的概念。在 Linux 系统上有一个目录堆栈,你可以堆叠目录路径以供将来使用。你可以使用 `dirs` 命令来在任何时间点快速查看堆栈的内容。 + +下面的例子显示了在命令行终端启动后立即在我的系统上使用 dirs 命令的输出: + +``` +$ dirs +~ +``` + +输出中的波浪号(`~`)表示目录堆栈当前仅包含用户的主目录。 + +继续下去,使用 `pushd` 和 `popd` 命令来执行存储目录路径并删除它的操作。使用 `pushd` 非常容易 - 只需将要存储在目录堆栈中的路径作为此命令的参数传递。这里有一个例子: + +``` +pushd /home/himanshu/Downloads/ +``` + +上述命令的作用是,将当前工作目录更改为你作为参数传递的目录,并且还将路径添加到目录堆栈中。为了方便用户,`pushd` 命令在其输出中产生目录堆栈的内容。因此,当运行上面的命令时,产生了以下输出: + +``` +~/Downloads ~ +``` + +输出显示现在堆栈中有两个目录路径:一个是用户的主目录,还有用户的下载目录。它们的保存顺序是:主目录位于底部,新添加的 `Downloads` 目录位于其上。 + +要验证 `pushd` 的输出是正确的,你还可以使用 `dirs` 命令: + +``` +$ dirs +~/Downloads ~ +``` + +因此你可以看到 `dirs` 命令同样产生相同的输出。 + +让我们再使用下 `pushd` 命令: + +``` +$ pushd /usr/lib/; pushd /home/himanshu/Desktop/ +/usr/lib ~/Downloads ~ +~/Desktop /usr/lib ~/Downloads ~ +``` + +所以目录堆栈现在包含总共四个目录路径,其中主目录(`~`)在底部,并且用户的桌面目录在顶部。 + +一定要记住的是堆栈的头是你当前的目录。这意味着现在我们当前的工作目录是 `~/Desktop`。 + +现在,假设你想回到 `/usr/lib` 目录,所以你所要做的就是执行 `popd` 命令: + +``` +$ popd +/usr/lib ~/Downloads ~ +``` + +`popd` 命令不仅会将当前目录切换到 `/usr/lib`,它还会从目录堆栈中删除 `~/Desktop`,这一点可以从命令输出中看出。这样,popd 命令将允许你以相反的顺序浏览这些目录。 + +### 一些高级用法 + +现在我们已经讨论了 `pushd` 和 `popd` 命令的基础知识,让我们继续讨论与这些命令相关的一些其它细节。首先,这些命令还允许你操作目录堆栈。例如,假设你的目录堆栈看起来像这样: + +``` +$ dirs +~/Desktop /usr/lib ~ ~/Downloads +``` + +现在,我们的要求是改变堆栈中目录路径的顺序,最上面的元素(`~/Desktop`)放到底部,剩下的每个都向上移动一个位置。这可以使用以下命令实现: + +``` +pushd +1 +``` + +上面的命令对目录堆栈做的结果: + +``` +$ dirs +/usr/lib ~ ~/Downloads ~/Desktop +``` + +因此,我们看到目录堆栈中的元素顺序已经改变,并且现在和我们想要的一样。当然,你可以让目录堆栈元素移动任何次数。例如,以下命令会将它们向上移动两次: + +``` +$ pushd +2 +~/Downloads ~/Desktop /usr/lib ~ +``` + +你也可以使用负的索引值: + +``` +$ pushd -1 +/usr/lib ~ ~/Downloads ~/Desktop +``` + +相似地,你可以在 `popd` 命令中使用此技术来从目录堆栈删除任何条目,而不用离开当前工作目录。例如,如果要使用 `popd` 从顶部(目前是 `~/Downloads`)删除第三个条目,你可以运行以下命令: + +``` +popd +2 +``` + +记住堆栈索引的初始值是 `0`,因此我们使用 `2` 来访问第三个条目。 + +因此目录堆栈现在包含: + +``` +$ dirs +/usr/lib ~ ~/Desktop +``` + +确认条目已经被移除了。 + +如果由于某些原因,你发现你很难记住元素在目录堆栈中的位置以及它们的索引,你则可以对在 `dirs` 命令中使用 `-v` 选项。这里有一个例子: + +``` +$ dirs -v +0 /usr/lib +1 ~ +2 ~/Desktop +``` + +你可能已经猜到了,左边的数字是索引,接下来跟的是这个索引对应的目录路径。 + +**注意**: 在 `dir` 中使用 `-c` 选项清除目录堆栈。 + +现在让我们简要地讨论一下 `popd` 和 `pushd` 命令的实际用法。虽然它们第一眼看起来可能有点复杂,但是这些命令在编写 shell 脚本时会派上用场 - 你不需要记住你从哪里来;只要执行一下 `popd`,你就能回到你来的目录。 + +经验丰富的脚本编写者通常以以下方式使用这些命令: + +``` +popd >/dev/null 2>&1 +``` + +上述命令确保 `popd` 保持静默(不产生任何输出)。同样,你也可以静默 `pushd`。 + +`pushd` 和 `popd` 命令也被 Linux 服务器管理员使用,他们通常在几个相同的目录之间移动。 在[这里][5]介绍了一些其他有用的使用场景。 + +### 总结 + +我同意 `pushd` 和 `popd` 的概念不是很直接。但是,它需要的只是一点练习 - 是的,你需要多实践。花一些时间在这些命令上,你就会开始喜欢它们,特别是当它们提供了方便时。 + +-------------------------------------------------------------------------------- + +via: https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/ + +作者:[Ansh][a] +译者:[geekpi](https://github.com/geekpi) +校对:[jasminepeng](https://github.com/jasminepeng) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/ +[1]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#the-basics-of-pushd-and-popd-commands +[2]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#some-advanced-points +[3]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#conclusion +[4]:https://linux.cn/article-8335-1.html +[5]:http://unix.stackexchange.com/questions/77077/how-do-i-use-pushd-and-popd-commands diff --git a/translated/tech/20170118 Linux command line navigation tips- the basics of pushd and popd commands.md b/translated/tech/20170118 Linux command line navigation tips- the basics of pushd and popd commands.md deleted file mode 100644 index 8a94b8173b..0000000000 --- a/translated/tech/20170118 Linux command line navigation tips- the basics of pushd and popd commands.md +++ /dev/null @@ -1,138 +0,0 @@ -Linux 命令行工具使用小贴士及技巧(二):pushd 和 popd 命令基础 -============================================================ - -在本系列的[第一部分][4]中,我们通过讨论 **cd -** 命令的用法,重点介绍了 Linux 中的命令行导航。还讨论了一些其他相关要点/概念。现在进一步讨论,在本文中,我们将讨论如何使用 pushd 和 popd 命令在 Linux 命令行上获得更快的导航体验。 - -在我们开始之前,值得说明的一点是,此后提到的所有指导和命令已经在 Ubuntu 14.04 和 Bash shell(4.3.11)上测试过。 - -### pushd 和 popd 命令基础 - -为了更好地理解 pushd 和 popd 命令的作用,让我们先讨论堆栈的概念。想象你厨房案板上有一个空白区域,你想在上面放一套盘子。你会怎么做?很简单,一个接一个地放在上面。 - -所以在整个过程的最后,案板上的第一个盘子是盘子中的最后一个,你手中最后一个盘子是盘子堆中的第一个。现在当你需要一个盘子时,你选择在堆的顶部的那个盘子并使用它,然后需要时选择下一个。 - -pushd 和 popd 命令是类似的概念。在 Linux 系统上有一个目录堆栈,你可以堆叠目录路径以供将来使用。你可以使用 **dirs** 命令来在任何时间点快速查看堆栈的内容。 - -下面的例子显示了在命令行终端启动后立即在我的系统上使用 dirs 命令的输出: - -$ dirs -~ - -输出中的波浪号(〜)表示目录堆栈当前仅包含用户的主目录。 - -继续下去,使用 pushd 和 popd 命令来执行存储目录路径并删除它的操作。使用 pushd 非常容易 - 只需将要存储在目录堆栈中的路径作为此命令的参数传递。这里有一个例子: - -pushd /home/himanshu/Downloads/ - -上述命令的作用是,将当前工作目录更改为你作为参数传递的目录,并且还将路径添加到目录堆栈中。为了方便用户,pushd 命令在其输出中产生目录堆栈的内容。因此,当运行上面的命令时,产生了以下输出: - -``` -~/Downloads ~ -``` - -输出显示现在堆栈中有两个目录路径:一个是用户的主目录,还有用户的下载目录。它们的保存顺序是:主目录位于底部,新添加的 Downloads 目录位于其上。 - -要验证 pushd 的输出是正确的,你还可以使用 dirs 命令: - -$ dirs -~/Downloads ~ - -因此你可以看到 dirs 命令同样产生相同的输出。 - -让我们再使用下 pushd 命令: - -$ pushd /usr/lib/; pushd /home/himanshu/Desktop/ -/usr/lib ~/Downloads ~ -~/Desktop /usr/lib ~/Downloads ~ - -所以目录堆栈现在包含总共四个目录路径,其中主目录(〜)在底部,并且用户的桌面目录在顶部。 - -一定要记住的是堆栈的头是你当前的目录。这意味着现在我们当前的工作目录是 ~/Desktop。 - -现在,假设你想回到 /usr/lib 目录,所以你所要做的就是执行 popd 命令: - -$ popd -/usr/lib ~/Downloads ~ - -popd 命令不仅会将当前目录切换到 /usr/lib,它还会从目录堆栈中删除 ~/Desktop,这一点可以从命令输出中看出。这样,popd 命令将允许你以相反的顺序浏览这些目录。 - -### 一些高级用法 - -现在我们已经讨论了 pushd 和 popd 命令的基础知识,让我们继续讨论与这些命令相关的一些其他细节。首先,这些命令还允许你操作目录堆栈。例如,假设你的目录堆栈看起来像这样: - -$ dirs -~/Desktop /usr/lib ~ ~/Downloads - -现在,我们的要求是改变堆栈中目录路径的顺序,最上面的元素(~/Desktop)放到底部,剩下的每个都向上移动一个位置。这可以使用以下命令实现: - -pushd +1 - -上面的命令对目录堆栈做的结果: - -$ dirs -/usr/lib ~ ~/Downloads ~/Desktop - -因此,我们看到目录堆栈中的元素顺序已经改变,并且现在和我们想要的一样。当然,你可以让目录堆栈元素移动任何次数。例如,以下命令会将它们向上移动两次: - -$ pushd +2 -~/Downloads ~/Desktop /usr/lib ~ - -你也可以使用负的索引值: - -$ pushd -1 -/usr/lib ~ ~/Downloads ~/Desktop - -相似地,你可以在 popd 命令中使用此技术来从目录堆栈删除任何条目,而不用离开当前工作目录。例如,如果要使用 popd 从顶部(目前是 ~/Downloads)删除第三个条目,你可以运行以下命令: - -popd +2 - -记住堆栈索引的初始值是 0,因此我们使用 2 来访问第三个条目。 - -因此目录堆栈现在包含: - -$ dirs -/usr/lib ~ ~/Desktop - -确认条目已经被移除了。 - -如果由于某些原因,你发现你很难记住元素在目录堆栈中的位置以及它们的索引,你则可以对在 dirs 命令中使用 -v 选项。这里有一个例子: - -$ dirs -v -0 /usr/lib -1 ~ -2 ~/Desktop - -你可能已经猜到了,左边的数字是索引,接下来跟的是这个索引对应的目录路径。 - -**注意**: 在 dir 中使用 -c 选项清除目录堆栈。 - -现在让我们简要地讨论一下 popd 和 pushd 命令的实际用法。虽然它们第一眼看起来可能有点复杂,但是这些命令在编写 shell 脚本时会派上用场 - 你不需要记住你从哪里来; 只要执行一下 popd,你就能回到你来的目录。 - -经验丰富的脚本编写者通常以以下方式使用这些命令: - -`popd >/dev/null 2>&1` - -上述命令确保 popd 保持静默(不产生任何输出)。同样,你也可以静默 pushd。 - -pushd 和 popd 命令也被 Linux 服务器管理员使用,他们通常在几个相同的目录之间移动。 在[这里][5]介绍了一些其他有用的使用场景。 - -### 总结 - -我同意 pushd 和 popd 的概念不是很直接。但是,它需要的只是一点练习 - 是的,你需要多实践。花一些时间在这些命令上,你就会开始喜欢它们,特别是当它们提供了方便时。 - --------------------------------------------------------------------------------- - -via: https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/ - -作者:[Ansh ][a] -译者:[geekpi](https://github.com/geekpi) -校对:[jasminepeng](https://github.com/jasminepeng) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/ -[1]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#the-basics-of-pushd-and-popd-commands -[2]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#some-advanced-points -[3]:https://www.howtoforge.com/tutorial/linux-command-line-tips-tricks-part-2/#conclusion -[4]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/ -[5]:http://unix.stackexchange.com/questions/77077/how-do-i-use-pushd-and-popd-commands From 2d4917b0f60c98a9be84413e77c21b53a676aa39 Mon Sep 17 00:00:00 2001 From: "Fuliang.Li" Date: Mon, 3 Apr 2017 20:17:37 +0800 Subject: [PATCH 077/241] [Translated] 20170324 A formal spec for GitHub Flavored Markdown.md --- ...ormal spec for GitHub Flavored Markdown.md | 114 ----------------- ...ormal spec for GitHub Flavored Markdown.md | 119 ++++++++++++++++++ 2 files changed, 119 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20170324 A formal spec for GitHub Flavored Markdown.md create mode 100644 translated/tech/20170324 A formal spec for GitHub Flavored Markdown.md diff --git a/sources/tech/20170324 A formal spec for GitHub Flavored Markdown.md b/sources/tech/20170324 A formal spec for GitHub Flavored Markdown.md deleted file mode 100644 index 90e3e950ad..0000000000 --- a/sources/tech/20170324 A formal spec for GitHub Flavored Markdown.md +++ /dev/null @@ -1,114 +0,0 @@ -GHLandy Translating - -[A formal spec for GitHub Flavored Markdown][8] -============================================================ - -We are glad we chose Markdown as the markup language for user content at GitHub. It provides a powerful yet straightforward way for users (both technical and non-technical) to write plain text documents that can be rendered richly as HTML. - -Its main limitation, however, is the lack of standarization on the most ambiguous details of the language. Things like how many spaces are needed to indent a line, how many empty lines you need to break between different elements, and a plethora of other trivial corner cases change between implementations: very similar looking Markdown documents can be rendered as wildly different outputs depending on your Markdown parser of choice. - -Five years ago, we started building GitHub’s custom version of Markdown, GFM (GitHub Flavored Markdown) on top of [Sundown][13], a parser which we specifically developed to solve some of the shortcomings of the existing Markdown parsers at the time. - -Today we’re hoping to improve on this situation by releasing a formal specification of the syntax for GitHub Flavored Markdown, and its corresponding reference implementation. - -This formal specification is based on [CommonMark][14], an ambitious project to formally specify the Markdown syntax used by many websites on the internet in a way that reflects its real world usage. CommonMark allows people to continue using Markdown the same way they always have, while offering developers a comprehensive specification and reference implementations to interoperate and display Markdown in a consistent way between platforms. - -#### The Specification - -Taking the CommonMark spec and re-engineering our current user content stack around it is not a trivial endeavour. The main issue we struggled with is that the spec (and hence its reference implementations) focuses strictly on the common subset of Markdown that is supported by the original Perl implementation. This does not include some of the extended features that have been always available on GitHub. Most notably, support for  _tables, strikethrough, autolinks and task lists_  are missing. - -In order to fully specify the version of Markdown we use at GitHub (known as GFM), we had to formally define the syntax and semantics of these features, something which we had never done before. We did this on top of the existing CommonMark spec, taking special care to ensure that our extensions are a strict and optional superset of the original specification. - -When reviewing [the GFM spec][15], you can clearly tell which parts are GFM-specific additions because they’re highlighted as such. You can also tell that no parts of the original spec have been modified and therefore should remain fully compliant with all other implementations. - -#### The Implementation - -To ensure that the rendered Markdown in our website is fully compliant with the CommonMark spec, the new backend implementation for GFM parsing on GitHub is based on `cmark`, the reference implementation for CommonMark developed by [John MacFarlane][16] and many other [fantastic contributors][17]. - -Just like the spec itself, `cmark` focuses on parsing a strict subset of Markdown, so we had to also implement support for parsing GitHub’s custom extensions on top of the existing parser. You can find these changes on our [fork of `cmark`][18]; in order to track the always-improving upstream project, we continuously rebase our patches on top of the upstream master. Our hope is that once a formal specification for these extensions is settled, this patchset can be used as a base to upstream the changes in the original project. - -Besides implementing the GFM-specific features in our fork of `cmark`, we’ve also contributed many changes of general interest to the upstream. The vast majority of these contributions are focused around performance and security. Our backend renders a massive volume of Markdown documents every day, so our main concern lies in ensuring we’re doing these operations as efficiently as possible, and making sure that it’s not possible to abuse malicious Markdown documents to attack our servers. - -The first Markdown parsers in C had a terrible security history: it was feasible to cause stack overflows (and sometimes even arbitrary code execution) simply by nesting particular Markdown elements sufficiently deep. The `cmark` implementation, just like our earlier parser Sundown, has been designed from scratch to be resistant to these attacks. The parsing algorithms and its AST-based output are thought out to gracefully handle deep recursion and other malicious document formatting. - -The performance side of `cmark` is a tad more rough: we’ve contributed many optimizations upstream based on performance tricks we learnt while implementing Sundown, but despite all these changes, the current version of `cmark` is still not faster than Sundown itself: Our benchmarks show it to be between 20% to 30% slower on most documents. - -The old optimization adage that  _“the fastest code is the code that doesn’t run”_  applies here: the fact is that `cmark` just does  _more things_  than Sundown ever did. Amongst other functionality, `cmark` is UTF8 aware, has better support for references, cleaner interfaces for extension, and most importantly: it doesn’t  _translate_  Markdown into HTML, like Sundown did. It actually generates an AST (Abstract Syntax Tree) out of the source Markdown, which we can transform and eventually render into HTML. - -If you consider the amount of HTML parsing that we had to do with Sundown’s original implementation (particularly regarding finding user mentions and issue references in the documents, inserting task lists, etc), `cmark`’s AST-based approach saves us a tremendous amount of time  _and_  complexity in our user content stack. The Markdown AST is an incredibly powerful tool, and well worth the performance cost that `cmark` pays to generate it. - -### The Migration - -Changing our user content stack to be CommonMark compliant is not as simple as switching the library we use to parse Markdown: the fundamental roadblock we encountered here is that the corner cases that CommonMark specifies (and that the original Markdown documentation left ambiguous) could cause some old Markdown content to render in unexpected ways. - -Through synthetic analysis of GitHub’s massive Markdown corpus, we determined that less than 1% of the existing user content would be affected by the new implementation: we gathered these stats by rendering a large set of Markdown documents with both the old (Sundown) and the new (`cmark`, CommonMark compliant) libraries, normalizing the resulting HTML, and diffing their trees. - -1% of documents with minor rendering issues seems like a reasonable tradeoff to swap in a new implementation and reap its benefits, but at GitHub’s scale, 1% is a lot of content, and a lot of affected users. We really don’t want anybody to check back on an old issue and see that a table that was previously rendering as HTML now shows as ASCII – that is bad user experience, even though obviously none of the original content was lost. - -Because of this, we came up with ways to soften the transition. The first thing we did was gathering separate statistics on the two different kinds of Markdown user content we host on the website: comments by the users (such as in Gists, issues, Pull Requests, etc), and Markdown documents inside the Git repositories. - -There is a fundamental difference between these two kinds of content: the user comments are stored in our databases, which means their Markdown syntax can be normalized (e.g. by adding or removing whitespace, fixing the indentation, or inserting missing Markdown specifiers until they render properly). The Markdown documents stored in Git repositories, however, cannot be touched  _at all_ , as their contents are hashed as part of Git’s storage model. - -Fortunately, we discovered that the vast majority of user content that was using complex Markdown features were user comments (particularly Issue bodies and Pull Request bodies), while the documents stored in Git repositories were rendering properly with both the old and the new renderer in the overwhelming majority of cases. - -With this in mind, we proceeded to normalize the syntax of the existing user comments, as to make them render identically in both the old and the new implementations. - -Our approach to translation was rather pragmatic: Our old Markdown parser, Sundown, has always acted as a translator more than a parser. Markdown content is fed in, and a set of semantic callbacks convert the original Markdown document into the corresponding markup for the target language (in our use case, this was always HTML5). Based on this design approach, we decided to use the semantic callbacks to make Sundown translate from Markdown to CommonMark-compliant Markdown, instead of HTML. - -More than translation, this was effectively a normalization pass, which we had high confidence in because it was performed by the same parser we’ve been using for the past 5 years, and hence all the existing documents should be parsed cleanly while keeping their original semantic meaning. - -Once we updated Sundown to normalize input documents and sufficiently tested it, we were ready to start the transition process. The first step of the process was flipping the switch on the new `cmark` implementation for all new user content, as to ensure that we had a finite cut-off point to finish the transition at. We actually enabled CommonMark for all **new** user comments in the website several months ago, with barely anybody noticing – this is a testament to the CommonMark team’s fantastic job at formally specifying the Markdown language in a way that is representative of its real world usage. - -In the background, we started a MySQL transition to update in-place the contents of all Markdown user content. After running each comment through the normalization process, and before writing it back to the database, we’d render it with the new implementation and compare the tree to the previous implementation, as to ensure that the resulting HTML output was visually identical and that user data was never destroyed in any circumstances. All in all, less than 1% of the input documents were modified by the normalization process, matching our expectations and again proving that the CommonMark spec really represents the real-world usage of the language. - -The whole process took several days, and the end result was that all the Markdown user content on the website was updated to conform to the new Markdown standard while ensuring that the final rendered output was visually identical to our users. - -#### The Conclusion - -Starting today, we’ve also enabled CommonMark rendering for all the Markdown content stored in Git repositories. As explained earlier, no normalization has been performed on the existing documents, as we expect the overwhelming majority of them to render just fine. - -We are really excited to have all the Markdown content in GitHub conform to a live and pragmatic standard, and to be able to provide our users with a [clear and authoritative reference][19] on how GFM is parsed and rendered. - -We also remain committed to following the CommonMark specification as it irons out any last bugs before a final point release. We hope GitHub.com will be fully conformant to the 1.0 spec as soon as it is released. - -To wrap up, here are some useful links for those willing to learn more about CommonMark or implement it on their own applications: - -* [The CommonMark website][1], with information on the project. -* [The CommonMark discussion forum][2], where questions and changes to the specification can be proposed. -* [The CommonMark specification][3] -* [The reference C Implementation][4] -* [Our fork with support for all GFM extensions][5] -* [The GFM specification][6], based on the original spec. -* [A list of CommonMark implementations in many programming languages][7] - --------------------------------------------------------------------------------- - -via: https://githubengineering.com/a-formal-spec-for-github-markdown/?imm_mid=0ef032&cmp=em-prog-na-na-newsltr_20170318 - -作者:[Yuki Izumi][a][Vicent Martí][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://github.com/kivikakk -[b]:https://github.com/vmg -[1]:http://commonmark.org/ -[2]:http://talk.commonmark.org/ -[3]:http://spec.commonmark.org/ -[4]:https://github.com/jgm/cmark/ -[5]:https://github.com/github/cmark/ -[6]:https://github.github.com/gfm/ -[7]:https://github.com/jgm/CommonMark/wiki/List-of-CommonMark-Implementations -[8]:https://githubengineering.com/a-formal-spec-for-github-markdown/ -[9]:https://github.com/vmg -[10]:https://github.com/vmg -[11]:https://github.com/kivikakk -[12]:https://github.com/kivikakk -[13]:https://github.com/vmg/sundown -[14]:http://commonmark.org/ -[15]:https://github.github.com/gfm/ -[16]:https://github.com/jgm -[17]:https://github.com/jgm/cmark/#authors -[18]:https://github.com/github/cmark -[19]:https://github.github.com/gfm/ diff --git a/translated/tech/20170324 A formal spec for GitHub Flavored Markdown.md b/translated/tech/20170324 A formal spec for GitHub Flavored Markdown.md new file mode 100644 index 0000000000..a28b1fddd0 --- /dev/null +++ b/translated/tech/20170324 A formal spec for GitHub Flavored Markdown.md @@ -0,0 +1,119 @@ +[GitHub 风味的 Markdown 的正式规范][8] +==================== + +很庆幸,我们当初选择 Markdown 作为用户在 GitHub 上托管内容的标记语言,它为用户提供了强大且直接的方式 (不管是技术的还是非技术的) 来编写可以很好的渲染成 HTML 的纯文本文档。 + +其最主要的限制,就是缺乏在最模糊的语言细节上的标准。比如,使用多少个空格来进行行缩进、两个不同元素之间需要使用多少空行区分、大量繁琐细节往往造成不同实现之间的改变:相似的 Markdown 文档会因为你选用的语法解析器而渲染成大量不同的呈现效果。 + +五年前,我们在 [Sundown][13] 的基础之上开始构建 GitHub 自定义版本的 Markdown —— GFM (GitHub 风味的 Markdown),这是我们特地为解决当时已有的 Markdown 解析器的不足而开发的一款解析器。 + +今天,我们希望通过发布 GitHub 风味的 Markdown 的正式语法规范及其相应的参考实现能够改善现状。 + +该正式规范基于 [CommonMark][14],这是一个有野心的项目,旨在通过一个反应现实世界用法的方式来规范目前互联网上绝大多数网站使用的 Markdown 语法。CommonMark 运行人们以他们原有的习惯来使用 Markdown,同时为开发者提供一个综合规范和参考实例,从而实现跨平台的 Markdown 互操作和显示。 + +#### 规范 + +使用 CommonMark 规范并围绕它来重设我们当前用户内容堆栈并非微不足道。目前,我们纠结的主要问题是该规范 (及其参考实现) 过多关注有原生 Perl 实现支持的 Markdown 通用子集。这还不包括那些 GitHub 上已经在用的扩展特性。最明显的就是缺少 _表格 (tables)、删除线 (strikethrough)、自动链接 (autolinks)_ 和 _任务列表 (task lists)_ 的支持。 + +为完全指定 GitHub 的 Markdown 版本 (也成为 GFM),我必须要要正式定义这些特性的的语法和语意。我们是在现存的 CommonMark 规范中来完成这一项工作的,同时还特意关注以确保我们的扩展处于一个严格模式并且是原有规范的一个超集。 + +当评估 [GFM 规范][15] 的时候,你可以清楚的了解那些是 GFM 规范的扩展功能,因为它们都是高亮显示了。并且你也会看到原有规范的所有部分都保存原样,因此,GFM 规范能够与其他任何实现兼容。 + +#### 实现 + +为确保我们网站中的 Markdown 渲染能够完美兼容 CommonMark 规范,GitHub 的 GFM 解析器的后端实现基于 `cmark`来开发,这是 CommonMark 规范的一个参考实现,由 [John MacFarlane][16] 和 许多其他的 [出色的贡献者][17] 开发完成的。 + +就像规范本身那样,`cmark` 是 Markdown 的严格子集解析器,所以我们还必须在现存解析器的基础上完成 GitHub 自定义扩展的解析功能。你可以通过 [`cmark` 的分支][18] 来查看变更记录;为了与跟踪上游项目,我们定义将我们的 patches 变基到上游主线上去。我们希望,这些扩展的正式规范一旦确定,这些 patch 集同样可以应用到原始项目的上游变更中去。 + +除了在 `cmark` 分支中实现 GFM 规范特性,我们也同时将许多目标相似的变更贡献到上游。绝大多数的贡献都主要围绕性能和安全。我们的后端每天都需要渲染大量的 Markdown 文档,所以我们主要关注这些操作可以尽可能的高效率完成,同时还要确保那些滥用的恶意 Markdown 文档无法攻击到我们的服务器。 + +第一版使用 C 语言编写的解析器存在严重的安全隐患:通过足够深度的特殊 Markdown 元素的嵌套,它可能造成堆栈溢出 (甚至有时候可以运行任意代码)。而 `cmark` 实现就行我们之前设计的解析器 Sundown,为抵御这些攻击而专门进行从零开始设计。其解析算法和基于 AST 的输出主要用以优雅的解决深层递归以及其他的恶意文档格式。 + +`cmark` 在性能方面则是有点粗糙:根绝当时构建 Sundown 所了解到的性能技巧,我们向上游贡献了许多最优方案,但除去所有这些变更之外,当前版本的 `cmark` 仍然无法与 Sundown 匹敌:我们的基准测试表明,`cmark` 在绝大多数文档渲染的性能上要比 Sundown 低 20% 到 30%。 + +那句古老的优化谚语 _最快的代码就是不需要运行的代码 (the fastest code is the code that doesn’t run)_ 在此处同样适用:实际上,`cmark` 比 Sundown 要进行 _多一些操作_。在其他的功能上,`cmark` 支持 UTF8 字符集,对参考的支持、扩展的接口清理的效果更佳。最重要的是它如同 Sundown 那样,并不会将 Markdown _翻译成_ HTML。它实际上从 Markdown 源码中生成一个 AST (抽象语法树,Abstract Syntax Tree),然后我们就看将之转换和逐渐渲染成 HTML。 + +如果你有想过我们处理 Sundown 的原型实现 (特别是文档中关于查询用户的 mention 和 issue 参考、插入任务列表等) 时的 HTML 语法剖析,你会发现 `cmark` 基于 AST 的方法可以节约大量时间 _和_ 降低我们用户内容堆栈的复杂度。Markdown AST 是一个非常强大的工具,并且值得 `cmark` 生成它所付出的性能成本。 + +### 迁移 + +变更我们用户的内容堆栈以兼容 CommonMark 规范,并不同于转换我们曾用于解析 Markdown 的库那样容易:目前我们在遇到最根本的障碍就是由于一些不常用语法 (LCTT 译注:原文是 the Corner,作为名词的原意为角落、偏僻处、窘境,这应该是指那些不常用语法),CommonMark 规范 (以及有歧义的 Markdown 原文) 可能会以一种意想不到的凡是来渲染一些老旧的 Markdown 内容。 + +通过综合分析 GitHub 中大量的 Markdown 语料库,我们断定现存的用户内容只有不到 1% 会受到新版本实现的影响:我们是通过同时使用新 (`cmark`,兼容 CommonMark 规范) 旧 (Sundown) 版本的库来渲染大量的 Markdown 文档、标准化 HTML 结果、分析它们的不同点,最后才得到这一个数据的。 + + +只有 1% 的文档存在少量的渲染问题,使得换用新实现并获取其更多出看起来是非常合理的权衡,但是是根据当前 GitHub 的规模,这个 1% 是非常多的内容以及很多的受影响用户。我们真的不想导致任何用户需要重新校对一个老旧的问题、看到先前可以渲染成 HTML 的内容又呈现为 ASCII 码 —— 尽管这明显不会导致任何原始内容的丢失,却是糟糕的用户体验。 + +因此,我们相处相应的方法来缓和迁移过程。首先,第一件我们做的事就是收集用户托管在我们网站上的两种不同类型 Markdown 的数据:用户的评论 (比如Gists、issues、PR 等)以及在 git 仓库中的 Markdown 文档。 + +这两种内容有着本质上的区别:用户文档存储在我们的数据库中,这意味着他们的 Markdown 语法可以标准化 (比如添加或移除空格、修正缩进或则插入缺失的 Markdown 说明符,直到它们可正常渲染为止)。然而,那些存储在 Git 仓库中的 Markdown 文档则是 _根本_ 无法触及,因为这些内容已经散列成为 Git 存储模型的一部分。 + +幸运的是,我们发现绝大多数使用了复杂的 Markdown 特性的用户内容都是用户评论 (特别是 issue 主体和 PR 主体),而存储于仓库中的文档则大多数情况下都可以使用新旧渲染器下正常进行渲染。 + +因此,我们加快了标准化现存用户内容的语法的进程,以便是她们在新旧实现下渲染效果一致。 + +我们用以文档转换的方法相当实用:我们那个旧的 Markdown 解析器 Sundown 更多的是扮演着翻译器而非解析器的角色。输入 Markdown 内容之后,一系列的语意回调就会把原始的 Markdown 内容转换为目标语言 (在我们的实际适用中则是 HTML5) 的对应标记。基于这一设计方法,我们决定适用语意回调让 Sumdown 将原始 Markdown 转换为兼容 CommonMark 的 Markdown,而非 HTML。 + +除了转换之外,这还是一个高效的标准化过程,并且我们对此信心满满,毕竟完成这一任务的是我们在 5 五年前就使用过的解析器。因此,所有的现存文档在保留其原始语意的情况下都能够进行明确的解析。 + +一旦升级 Sundown 来标准化输入文档并充分测试之后,我们就会做好了开启转换进程的准备。最开始的一步,就是在新的 `cmark` 实现上为所有的用户内容进行反置转换,以便确保我们能有一个有限的分界点来进行过渡。我们将为网站上这几个月内所有 **新的** 用户评论启用 CommonMark,这一过程不会引起任何人注意的 —— 他们这是一个关于 CommonMark 团队出色工作的圣约,通过一个最具现实世界用法的方式来正式规范 Markdown 语言. + +在后端,我们开启 MySQL 转换来升级替代用户的 Markdown 内容。在所有的评论进行标准化之后,在将其写回到数据库之前,我们将使用新实现来进行渲染并与旧实现的渲染结果进行对比,以确保 HTML 输出结果视觉可鉴以及用户数据在任何情况下都不被破坏。总而言之,只有不到 1% 的输入文档会受到表彰进程的修改,这符合我们的的期望,同时再次证明 CommonMark 规范能够呈现语言的真实用法。 + +整个过程会持续好几天,最后的结果是网站上所有的 Markdown 用户内容会得到全面升级以符合新的 Markdown 标准,同时确保所有的最终渲染输出效果都对用户视觉可辩。 + +#### 结论 + +从今天 (LCTT 译注:原文发布于 2017 年 3 月 14 日,这里的今天应该是这个日期) 开始, 我们同样为所有存储在 Git 仓库中的 Markdown 内容启动 CommonMark 渲染。正如上文所述,所有的现存文档都不会进行标准化,因为我们所期望中的多数渲染效果都刚刚好。 + +能够让在 GitHub 上的所有 Markdown 内容符合一个动态变化且使用的标准,同时还可以为我的用户提供一个关于 GFM 如何进行解析和渲染 [清晰且权威的参考说明][19],我们是相当激动的。 + +我们还将致力于 CommonMark 规范,一直到在它正式发布之前消沉最后一个 bug。我们也希望 GitHub.com 在 1.0 规范发布之后可以进行完美兼容。 + +作为结束,以下为想要学习 CommonMark 规范或则自己来编写实现的朋友提供一些有用的链接。 + +* [CommonMark 主页][1],可以了解该项目该多信息 +* [CommonMark 论坛讨论区][2],可以提出关于该规范的的问题和更改建议 +* [CommonMark 规范][3] +* [使用 C 语言编写的参考实现][4] +* [Our fork with support for all GFM extensions][5] +* [GFM 规范][6],基于原始规范 +* [使用其他编程语言编写的 CommonMark 实现列表][7] + +------------------------------- + +译者简介: + +[GHLandy](http://GHLandy.com) —— 生活中所有欢乐与苦闷都应藏在心中,有些事儿注定无人知晓,自己也无从说起。 + +------------------------------- + +via: https://githubengineering.com/a-formal-spec-for-github-markdown/ + +作者:[Yuki Izumi][a][Vicent Martí][b] +译者:[GHLandy](https://github.com/GHLandy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://github.com/kivikakk +[b]:https://github.com/vmg +[1]:http://commonmark.org/ +[2]:http://talk.commonmark.org/ +[3]:http://spec.commonmark.org/ +[4]:https://github.com/jgm/cmark/ +[5]:https://github.com/github/cmark/ +[6]:https://github.github.com/gfm/ +[7]:https://github.com/jgm/CommonMark/wiki/List-of-CommonMark-Implementations +[8]:https://githubengineering.com/a-formal-spec-for-github-markdown/ +[9]:https://github.com/vmg +[10]:https://github.com/vmg +[11]:https://github.com/kivikakk +[12]:https://github.com/kivikakk +[13]:https://github.com/vmg/sundown +[14]:http://commonmark.org/ +[15]:https://github.github.com/gfm/ +[16]:https://github.com/jgm +[17]:https://github.com/jgm/cmark/#authors +[18]:https://github.com/github/cmark +[19]:https://github.github.com/gfm/ From 2046ba45acc092f8f2ecd05838e10450706b544c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AE=B6=E6=9C=AA?= Date: Mon, 3 Apr 2017 21:34:38 +0800 Subject: [PATCH 078/241] Update 20170119 A beginners guide to comparing files using visual diffmerge tool Meld on Linux.md --- ...comparing files using visual diffmerge tool Meld on Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170119 A beginners guide to comparing files using visual diffmerge tool Meld on Linux.md b/sources/tech/20170119 A beginners guide to comparing files using visual diffmerge tool Meld on Linux.md index 7d43ffde17..810d3c9922 100644 --- a/sources/tech/20170119 A beginners guide to comparing files using visual diffmerge tool Meld on Linux.md +++ b/sources/tech/20170119 A beginners guide to comparing files using visual diffmerge tool Meld on Linux.md @@ -1,3 +1,5 @@ +GitFuture is translating + A beginner's guide to comparing files using visual diff/merge tool Meld on Linux ============================================================ From b206d9e7d3d92d69c4b21f2d834169c15960a524 Mon Sep 17 00:00:00 2001 From: sanfusu Date: Tue, 4 Apr 2017 00:11:18 +0800 Subject: [PATCH 079/241] Translating --- sources/tech/20150112 Data-Oriented Hash Table.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/tech/20150112 Data-Oriented Hash Table.md b/sources/tech/20150112 Data-Oriented Hash Table.md index 3f814461b6..3600fd8ef5 100644 --- a/sources/tech/20150112 Data-Oriented Hash Table.md +++ b/sources/tech/20150112 Data-Oriented Hash Table.md @@ -1,3 +1,4 @@ +Translating by sanfusu [Data-Oriented Hash Table][1] ============================================================ @@ -47,7 +48,7 @@ There’s a ton of data here. In this section I’ll discuss the results in some Here are the graphed results of all the tests, compiled with Visual Studio 2012, and run on Windows 8.1 on a Core i7-4710HQ machine. (Click to zoom.) [ - ![Results for VS 2012, Windows 8.1, Core i7-4710HQ](http://reedbeta.com/blog/data-oriented-hash-table/results-vs2012.png "Results for VS 2012, Windows 8.1, Core i7-4710HQ") + ![Results for VS 2012, Windows 8.1, Core i7-4710HQ](http://reedbeta.com/blog/data-oriented-hash-table/results-vs2012.png "Results for VS 2012, Windows 8.1, Core i7-4710HQ") ][12] From left to right are different payload sizes, from top to bottom are the various operations, and each graph plots time in milliseconds versus hash table element count for each of the five implementations. (Note that not all the Y-axes have the same scale!) I’ll summarize the main trends for each operation. @@ -75,7 +76,7 @@ UM is the slowest to destruct—by an order of magnitude at small payloads, and I also ran tests with gcc 4.8 and clang 3.5, on Linux Mint 17.1 on a Core i5-4570S machine. The gcc and clang results were very similar, so I’ll only show the gcc ones; the full set of results are in the code download archive, linked above. (Click to zoom.) [ - ![Results for g++ 4.8, Linux Mint 17.1, Core i5-4570S](http://reedbeta.com/blog/data-oriented-hash-table/results-g++4.8.png "Results for g++ 4.8, Linux Mint 17.1, Core i5-4570S") + ![Results for g++ 4.8, Linux Mint 17.1, Core i5-4570S](http://reedbeta.com/blog/data-oriented-hash-table/results-g++4.8.png "Results for g++ 4.8, Linux Mint 17.1, Core i5-4570S") ][15] Most of the results are quite similar to those in Windows, so I’ll just highlight a few interesting differences. From 4583147e4f1056fc2567541708b4f8b08220fd01 Mon Sep 17 00:00:00 2001 From: sanfusu Date: Tue, 4 Apr 2017 00:13:14 +0800 Subject: [PATCH 080/241] Translating for rp --- sources/tech/20150112 Data-Oriented Hash Table.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150112 Data-Oriented Hash Table.md b/sources/tech/20150112 Data-Oriented Hash Table.md index 3600fd8ef5..4bff30d51d 100644 --- a/sources/tech/20150112 Data-Oriented Hash Table.md +++ b/sources/tech/20150112 Data-Oriented Hash Table.md @@ -1,4 +1,5 @@ Translating by sanfusu + [Data-Oriented Hash Table][1] ============================================================ From eaf647f928f393b1f2eed2b1b26f825e043acef5 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Apr 2017 05:36:22 +0800 Subject: [PATCH 081/241] PRF:20170327 Using vi-mode in your shell.md @geekpi --- .../20170327 Using vi-mode in your shell.md | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/translated/tech/20170327 Using vi-mode in your shell.md b/translated/tech/20170327 Using vi-mode in your shell.md index 864c4c9264..1612dd8079 100644 --- a/translated/tech/20170327 Using vi-mode in your shell.md +++ b/translated/tech/20170327 Using vi-mode in your shell.md @@ -4,13 +4,14 @@ > 介绍在命令行编辑中使用 vi 模式。 ![Using vi-mode at the command line](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/code_computer_development_programming.png?itok=wMspQJcO "Using vi-mode at the command line") + >图片提供: opensource.com -作为一名更大的开源社区的参与者,更确切地说,作为[ Fedora 项目][2]的成员,我有机会与许多人会面并讨论各种有趣的技术主题。我最喜欢的主题是“命令行”或者 [shell][3],因为了解人们如何熟练使用 shell 可以让你深入地了解他们的想法,他们喜欢什么样的工作流程,以及某种程度上什么激发了他们的灵感。许多开发人员和运维在互联网上公开分享他们的“ dot 文件”(他们的 shell 配置文件的常见俚语),这将是一个有趣的协作机会,让每个人都能从对命令行有丰富经验的人中学习提示和技巧并分享快捷方式以及有效率的技巧。 +作为一名大型开源社区的参与者,更确切地说,作为 [Fedora 项目][2]的成员,我有机会与许多人会面并讨论各种有趣的技术主题。我最喜欢的主题是“命令行”或者说 [shell][3],因为了解人们如何熟练使用 shell 可以让你深入地了解他们的想法,他们喜欢什么样的工作流程,以及某种程度上是什么激发了他们的灵感。许多开发和运维人员在互联网上公开分享他们的“ dot 文件”(他们的 shell 配置文件的常见俚语),这将是一个有趣的协作机会,让每个人都能从对命令行有丰富经验的人中学习提示和技巧并分享快捷方式以及有效率的技巧。 -我在这里会为你介绍 shell 中的 vi 模式。 +今天我在这里会为你介绍 shell 中的 vi 模式。 -在计算和操作系统的庞大生态系统中有[很多 shell][4]。然而,在 Linux 世界中,[bash][5] 已经成为事实上标准,并在在撰写本文时,它是所有主要 Linux 发行版上的默认 shell。因此,它就是我所说的 shell。需要注意的是,bash 在其他类 UNIX 操作系统上也是一个相当受欢迎的选项,所以它可能跟你用的差别不大(对于 Windows 用户,可以用 [cygwin][6])。 +在计算和操作系统的庞大生态系统中有[很多 shell][4]。然而,在 Linux 世界中,[bash][5] 已经成为事实上的标准,并在在撰写本文时,它是所有主要 Linux 发行版上的默认 shell。因此,它就是我所说的 shell。需要注意的是,bash 在其他类 UNIX 操作系统上也是一个相当受欢迎的选项,所以它可能跟你用的差别不大(对于 Windows 用户,可以用 [cygwin][6])。 在探索 shell 时,首先要做的是在其中输入命令并得到输出,如下所示: @@ -19,9 +20,9 @@ $ echo "Hello World!" Hello World! ``` -这是常见的练习,可能每个人都做过。没接触过的人和新手可能没有意识到 [bash][7] shell 的默认输入模式是 [Emacs][8],这意味着命令行中所用的行编辑功能都将使用[ Emacs 风格的“键盘组合][9]。(对这个感兴趣的人,行编辑功能实际上是由[GNU Readline][10]进行的。) +这是常见的练习,可能每个人都做过。没接触过的人和新手可能没有意识到 [bash][7] shell 的默认输入模式是 [Emacs][8] 模式,也就是说命令行中所用的行编辑功能都将使用 [Emacs 风格的“键盘快捷键”][9]。(行编辑功能实际上是由 [GNU Readline][10] 进行的。) -例如,如果你输入了 **echo "Hello Wrld!"**,并意识到你想要快速跳回一个单词(空格分隔)来修改打字错误,而无需按住左箭头键,那么你可以同时按下 **Alt+b**,光标会将向后跳到 **W**。 +例如,如果你输入了 `echo "Hello Wrld!"`,并意识到你想要快速跳回一个单词(空格分隔)来修改打字错误,而无需按住左箭头键,那么你可以同时按下 `Alt+b`,光标会将向后跳到 `W`。 ``` $ echo "Hello Wrld!" @@ -29,15 +30,15 @@ $ echo "Hello Wrld!"         Cursor is here. ``` -这只是使用提供给 shell 用户的许多 Emacs 组合键之一完成的。还有其他更多东西,如复制文本、粘贴文本、删除文本以及使用快捷方式来编辑文本。使用复杂的组合键并记住可能看起来很愚蠢,但是在使用较长的命令或从 shell 历史记录中调用一个命令并想再次编辑执行时,它们可能会非常强大。 +这只是使用提供给 shell 用户的诸多 Emacs 快捷键组合之一完成的。还有其他更多东西,如复制文本、粘贴文本、删除文本以及使用快捷方式来编辑文本。使用复杂的快捷键组合并记住可能看起来很愚蠢,但是在使用较长的命令或从 shell 历史记录中调用一个命令并想再次编辑执行时,它们可能会非常强大。 -尽管 Emacs 的键盘绑定都不错,如果你对 Emacs 编辑器熟悉或者发现它们很容易使用也不错,但是仍有一些人对“ vi 风格”的键盘绑定更舒服,因为他们经常使用 vi 编辑器(通常是 [vim][11] 或 [nvim][12])。bash shell(再说一次,通过 GNU Readline)可以为我们提供这个功能。要启用它,需要执行命令 **$ ****set**** -o vi**。 +尽管 Emacs 的键盘绑定都不错,如果你对 Emacs 编辑器熟悉或者发现它们很容易使用也不错,但是仍有一些人觉得 “vi 风格”的键盘绑定更舒服,因为他们经常使用 vi 编辑器(通常是 [vim][11] 或 [nvim][12])。bash shell(再说一次,通过 GNU Readline)可以为我们提供这个功能。要启用它,需要执行命令 `$ set -o vi`。 -就像魔术一样,你现在处于 vi 模式了,现在可以使用 vi 风格的键绑定轻松地进行编辑,以便复制文本、删除文本、并跳转到文本行中的不同位置。这与 Emacs 模式在功能方面没有太大的不同,但是它在你_如何_与 shell 进行交互执行操作上有一些差别,根据你的喜好这是一个强大的选择。 +就像魔术一样,你现在处于 vi 模式了,现在可以使用 vi 风格的键绑定来轻松地进行编辑,以便复制文本、删除文本、并跳转到文本行中的不同位置。这与 Emacs 模式在功能方面没有太大的不同,但是它在你_如何_与 shell 进行交互执行操作上有一些差别,根据你的喜好这是一个强大的选择。 -我们来看看先前的例子,但是在上下文中一旦你在 shell 中进入 vi 模式,你就处于 INSERT 模式中,这意味着你可以和以前一样输入命令,但是现在点击 **Esc** 键,你将处于 NORMAL 模式,你可以自由浏览并进行文字修改。 +我们来看看先前的例子,但是在这种情况下一旦你在 shell 中进入 vi 模式,你就处于 INSERT 模式中,这意味着你可以和以前一样输入命令,现在点击 **Esc** 键,你将处于 NORMAL 模式,你可以自由浏览并进行文字修改。 -看看先前的例子,如果你输入了 **echo "Hello Wrld!"**,并意识到你想跳回一个单词(再说一次用空格分隔)来修复那个打字错误,那么你可以点击 **Esc** 从 INSERT 变为 NORMAL 模式。然后,您可以输入 **B**(**Shift+b**),光标就能像以前那样回到前面了。(有关 vi 模式的更多信息,请参阅[这里][13]。): +看看先前的例子,如果你输入了 `echo "Hello Wrld!"`,并意识到你想跳回一个单词(再说一次,用空格分隔的单词)来修复那个打字错误,那么你可以点击 `Esc` 从 INSERT 模式变为 NORMAL 模式。然后,您可以输入 `B`(即 `Shift+b`),光标就能像以前那样回到前面了。(有关 vi 模式的更多信息,请参阅[这里][13]。): ``` $ echo "Hello Wrld!" @@ -45,13 +46,15 @@ $ echo "Hello Wrld!"         Cursor is here. ``` -现在,对于 vi/vim/nvim 用户来说,当你发现你一直可以使用相同的快捷键,而不仅仅是在编辑器中编写代码或文档的时候我希望这是一个惊喜时刻。如果这对你是全新的,并且你想要了解更多,那么我可能会建议你参加这个[交互式 vim 教程][14],看看 vi 风格的编辑是否还有有用的。 +现在,对于 vi/vim/nvim 用户来说,你会惊喜地发现你可以一直使用相同的快捷键,而不仅仅是在编辑器中编写代码或文档的时候。如果你从未了解过这些,并且想要了解更多,那么我可能会建议你看看这个[交互式 vim 教程][14],看看 vi 风格的编辑是否有你所不知道的。 -如果你喜欢在此风格下与 shell 交互,那么你可以在主目录中的 **~/.bashrc** 文件底部添加下面的行来持久设置它。 +如果你喜欢在此风格下与 shell 交互,那么你可以在主目录中的 `~/.bashrc` 文件底部添加下面的行来持久设置它。 -**set -o vi** +``` +set -o vi +``` -对于 emacs 模式的用户,希望这可以让你快速并愉快地看到 shell 的“另一面”。在结束之前,我认为每个人都应该使用任意一个让他们更有效率的编辑器和 shell 行编辑模式,如果你使用 vi 模式并且这篇对你是新的,那么恭喜你!现在就变得更有效率吧。 +对于 emacs 模式的用户,希望这可以让你快速并愉快地看到 shell 的“另一面”。在结束之前,我认为每个人都应该使用任意一个让他们更有效率的编辑器和 shell 行编辑模式,如果你使用 vi 模式并且这篇文章给你展开了新的一页,那么恭喜你!现在就变得更有效率吧。 玩得愉快! @@ -65,9 +68,9 @@ Adam Miller 是 Fedora 工程团队成员,专注于 Fedora 发布工程。他 ------------------------ via: https://opensource.com/article/17/3/fun-vi-mode-your-shell -作者:[Adam Miller ][a] +作者:[Adam Miller][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3446a232f5064259bc8f68fd9029212c500e94d7 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Apr 2017 05:36:40 +0800 Subject: [PATCH 082/241] PUB:20170327 Using vi-mode in your shell.md @geekpi --- .../tech => published}/20170327 Using vi-mode in your shell.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20170327 Using vi-mode in your shell.md (100%) diff --git a/translated/tech/20170327 Using vi-mode in your shell.md b/published/20170327 Using vi-mode in your shell.md similarity index 100% rename from translated/tech/20170327 Using vi-mode in your shell.md rename to published/20170327 Using vi-mode in your shell.md From 1633583b8bb27e36b8d3b9a405bf2397abd38cf1 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Apr 2017 06:00:31 +0800 Subject: [PATCH 083/241] PRF:20170302 How to use markers and perform text selection in Vim.md @Cathon --- ...rkers and perform text selection in Vim.md | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/translated/tech/20170302 How to use markers and perform text selection in Vim.md b/translated/tech/20170302 How to use markers and perform text selection in Vim.md index 5825725e7b..0f92f54e91 100644 --- a/translated/tech/20170302 How to use markers and perform text selection in Vim.md +++ b/translated/tech/20170302 How to use markers and perform text selection in Vim.md @@ -1,33 +1,33 @@ -如何在 Vim 中使用标志和文本选择操作 +如何在 Vim 中进行文本选择操作和使用标志 ============================================================ 基于图形界面的文本或源代码编辑器,提供了一些诸如文本选择的功能。我是想说,可能大多数人不觉得这是一个功能。不过像 Vim 这种基于命令行的编辑器就不是这样。当你仅使用键盘操作 Vim 的时候,就需要学习特定的命令来选择你想要的文本。在这个教程中,我们将详细讨论文本选择这一功能以及 Vim 中的标志功能。 在此之前需要说明的是,本教程中所提到的例子、命令和指令都是在 Ubuntu 16.04 的环境下测试的。Vim 的版本是 7.4。 -# Vim 的文本选择功能 +### Vim 的文本选择功能 -我们假设你已经具备了 Vim 编辑器的基本知识(如果没有,可以先阅读[这篇文章][2])。你应该知道,'d' 命令能够剪切/删除一行内容。如果你想要剪切 3 行的话,可以重复命令 3 次。不过,如果需要剪切 15 行呢?重复 ‘d’ 命令 15 次是个实用的解决方法吗? +我们假设你已经具备了 Vim 编辑器的基本知识(如果没有,可以先阅读[这篇文章][2])。你应该知道,`d` 命令能够剪切/删除一行内容。如果你想要剪切 3 行的话,可以重复命令 3 次。不过,如果需要剪切 15 行呢?重复 `d` 命令 15 次是个实用的解决方法吗? -显然不是。这种情况下的最佳方法是,选中你想要剪切/删除的行,再运行 ‘d’ 命令。举个例子: +显然不是。这种情况下的最佳方法是,选中你想要剪切/删除的行,再运行 `d` 命令。举个例子: 假如我想要剪切/删除下面截图中 INTRODUCTION 小节的第一段: [![Text edited in VIM](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-example.png)][3] -那么我的做法是:将光标放在第一行的开始,(确保退出了 Insert 模式)按下 'V'(Shift+v)命令。这时 Vim 会开启视图模式,并选中第一行。 +那么我的做法是:将光标放在第一行的开始,(确保退出了 Insert 模式)按下 `V`(即 `Shift+v`)命令。这时 Vim 会开启视图模式,并选中第一行。 [![Select a line with VIM](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-initiated.png)][4] -现在,我可以使用方向键'下',来选中整个段落。 +现在,我可以使用方向键“下”,来选中整个段落。 [![Select multiple lines with Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-working.png)][5] -这就是我们想要的,对吧!现在只需按 'd'键,就可以剪切/删除选中的段落了。当然,除了剪切/删除,你可以对选中的文本做任何操作。 +这就是我们想要的,对吧!现在只需按 `d` 键,就可以剪切/删除选中的段落了。当然,除了剪切/删除,你可以对选中的文本做任何操作。 这给我们带来了另一个重要的问题:当我们不需要删除整行的时候,该怎么做呢?也就是说,我们刚才讨论的解决方法,仅适用于想要对整行做操作的情况。那么如果我们只想删除段落的前三句话呢? -其实也有相应的命令 - 只需用 'v' 来代替 'V'(不包括单引号)即可。在下面的例子中,我使用 'v' 来选中段落的前三句话: +其实也有相应的命令 - 只需用小写 `v` 来代替大写 `V` 即可。在下面的例子中,我使用 `v` 来选中段落的前三句话: [![Select the first three sentences in Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-partial-lines.png)][6] @@ -35,25 +35,25 @@ [![Columns in Vom](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-columns.png)][7] -假设我们只需选择文本的第二列,即国家的名字。这种情况下,你可以将光标放在这一列的第一个字母上,按 Ctrl+v 一次。然后,按方向键'下',选中每个国家名字的第一个字母: +假设我们只需选择文本的第二列,即国家的名字。这种情况下,你可以将光标放在这一列的第一个字母上,按 `Ctrl+v` 一次。然后,按方向键“下”,选中每个国家名字的第一个字母: [![Select the first char of a column](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-column-1.png)][8] -然后按方向键'右',选中这一列。 +然后按方向键“右”,选中这一列。 [![Select a whole column in Vim](https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/vim-select-column-2.png)][9] -**小窍门**:如果你之前选中了某个文本块,现在想重新选中那个文本块,只需在命令模式下按 'gv' 即可。 +**小窍门**:如果你之前选中了某个文本块,现在想重新选中那个文本块,只需在命令模式下按 `gv` 即可。 -# 使用标志 +### 使用标志 有时候,你在处理一个很大的文件(例如源代码文件或者一个 shell 脚本),可能想要切换到一个特定的位置,然后再回到刚才所在的行。如果这两行的位置不远,或者你并不常做这类操作,那么这不是什么问题。 但是,如果你需要频繁地在当前位置和一些较远的行之间切换,那么最好的方法就是使用标志。你只需标记当前的位置,然后就能够通过标志名,从文件的任意位置回到当前的位置。 -在 Vim 中,我们使用 m 命令紧跟一个字母来标记一行(字母表示标志名,可用小写的 a-z)。例如 ma。然后你可以使用命令 'a (包括左单引号)回到标志为 a 的行。 +在 Vim 中,我们使用 `m` 命令紧跟一个字母来标记一行(字母表示标志名,可用小写的 `a` - `z`)。例如 `ma`。然后你可以使用命令 `'a` (包括左侧的单引号)回到标志为 `a` 的行。 -**小窍门**:你可以使用单引号来跳转到标志行的第一个字符,或使用反引号来跳转到标志行的特定列。 +**小窍门**:你可以使用“单引号” `'` 来跳转到标志行的第一个字符,或使用“反引号” ` 来跳转到标志行的特定列。 Vim 的标志功能还有很多其他的用法。例如,你可以先标记一行,然后将光标移到其他行,运行下面的命令: @@ -65,43 +65,37 @@ d'[标志名] 在 Vim 官方文档中,有一个重要的内容: -``` -每个文件有一些由小写字母(a-z)定义的标志。此外,还存在一些由大写字母(A-Z)定义的全局标志,它们定义了一个特定文件的某个位置。例如,你可能在同时编辑十个文件,每个文件都可以有标志 a,但是只有一个文件能够有标志 A。 -``` +> 每个文件有一些由小写字母(`a`-`z`)定义的标志。此外,还存在一些由大写字母(`A`-`Z`)定义的全局标志,它们定义了一个特定文件的某个位置。例如,你可能在同时编辑十个文件,每个文件都可以有标志 `a`,但是只有一个文件能够有标志 `A`。 我们已经讨论了使用小写字母作为 Vim 标志的基本用法,以及它们的便捷之处。下面的这段摘录讲解的足够清晰: -``` -由于种种局限性,大写字母标志可能乍一看不如小写字母标志好用,但它可以用作一种快速的文件书签。例如,打开 .vimrc 文件,按下 mV,然后退出。下次再想要编辑 .vimrc 文件的时候,按下 'V 就能够打开它。 -``` +> 由于种种局限性,大写字母标志可能乍一看不如小写字母标志好用,但它可以用作一种快速的文件书签。例如,打开 `.vimrc` 文件,按下 `mV`,然后退出。下次再想要编辑 `.vimrc` 文件的时候,按下 `'V` 就能够打开它。 -最后,我们使用 'delmarks' 命令来删除标志。例如: +最后,我们使用 `delmarks` 命令来删除标志。例如: ``` :delmarks a ``` -这一命令将从文件中删除一个标志。当然,你也可以删除标志行,这样标志将被自动删除。你可以在 [Vim 文档][11] 中找到关于标志的更多信息。 +这一命令将从文件中删除一个标志。当然,你也可以删除标志所在的行,这样标志将被自动删除。你可以在 [Vim 文档][11] 中找到关于标志的更多信息。 -# 总结 +### 总结 当你开始使用 Vim 作为首选编辑器的时候,类似于这篇教程中提到的功能将会是非常有用的工具,能够节省大量的时间。你得承认,这里介绍的文本选择和标志功能几乎不怎么需要学习,所需要的只是一点练习。 -你可以在 [HowtoForge][1] 上找到更多有关 Vim 的文章。 - -------------------------------------------------------------------------------- via: https://www.howtoforge.com/tutorial/how-to-use-markers-and-perform-text-selection-in-vim/ 作者:[Himanshu Arora][a] 译者:[Cathon](https://github.com/Cathon) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:https://www.howtoforge.com/tutorial/how-to-use-markers-and-perform-text-selection-in-vim/ [1]:https://www.howtoforge.com/tutorials/shell/ -[2]:https://www.howtoforge.com/vim-basics +[2]:https://linux.cn/article-8143-1.html [3]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-example.png [4]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-initiated.png [5]:https://www.howtoforge.com/images/how-to-use-markers-and-perform-text-selection-in-vim/big/vim-select-working.png From 12084da123d4ae8cb85db3554d88b7dd254195c4 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Apr 2017 06:00:46 +0800 Subject: [PATCH 084/241] PUB:20170302 How to use markers and perform text selection in Vim.md @Cathon --- ...170302 How to use markers and perform text selection in Vim.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20170302 How to use markers and perform text selection in Vim.md (100%) diff --git a/translated/tech/20170302 How to use markers and perform text selection in Vim.md b/published/20170302 How to use markers and perform text selection in Vim.md similarity index 100% rename from translated/tech/20170302 How to use markers and perform text selection in Vim.md rename to published/20170302 How to use markers and perform text selection in Vim.md From be6c7330b886d5a19618ba9868f6ce7d93a9aec1 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Apr 2017 06:18:14 +0800 Subject: [PATCH 085/241] PUB:20170107 Min Browser Muffles the Web Noise.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @geekpi @GitFuture 谢谢校对! --- ...70107 Min Browser Muffles the Web Noise.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) rename {translated/tech => published}/20170107 Min Browser Muffles the Web Noise.md (77%) diff --git a/translated/tech/20170107 Min Browser Muffles the Web Noise.md b/published/20170107 Min Browser Muffles the Web Noise.md similarity index 77% rename from translated/tech/20170107 Min Browser Muffles the Web Noise.md rename to published/20170107 Min Browser Muffles the Web Noise.md index 81e85b2d97..a8836c6b6f 100644 --- a/translated/tech/20170107 Min Browser Muffles the Web Noise.md +++ b/published/20170107 Min Browser Muffles the Web Noise.md @@ -6,16 +6,17 @@ 在软件设计中,“简单”并不意味着功能低级、有待改进。你如果喜欢花哨工具比较少的文本编辑器和笔记程序,那么在 Min 浏览器中会有同样舒适的感觉。 -我经常在台式机和笔记本电脑上使用 Google Chrome、Chromium和 Firefox。我研究了它们的很多附加功能,所以我在长期的研究和工作中可以享用它们的特色服务。 +我经常在台式机和笔记本电脑上使用 Google Chrome、Chromium 和 Firefox。我研究了它们的很多附加功能,所以我在长期的研究和工作中可以享用它们的特色服务。 -然而,有时我希望有个快速、整洁的替代品来上网。随着多个项目的进行,我需要很快打开一大批选项卡甚至是独立窗口的强大浏览器。 +然而,有时我希望有个快速、整洁的替代品来上网。随着多个项目的进行,我需要一个可以很快打开一大批选项卡甚至是独立窗口的强大浏览器。 我试过其他浏览器但很少能令我满意。替代品通常有一套独特的花哨的附件和功能,它们会让我开小差。 Min 浏览器就不这样。它是一个易于使用,并在 GitHub 开源的 web 浏览器,不会使我分心。 ![Min browser ](http://www.linuxinsider.com/article_images/2017/84212_620x514.jpg) -Min 浏览器是精简的浏览器,提供了简单的功能以及快速的响应。只是不要指望马上上手。 + +*Min 浏览器是精简的浏览器,提供了简单的功能以及快速的响应。只是不要指望马上能上手。* ### 它做些什么 @@ -25,7 +26,7 @@ Min 浏览器提供了 Debian Linux、Windows 和 Mac 机器的版本。它不 其中一个主要原因是其内置的广告拦截功能。开箱即用的 Min 浏览器不需要配置或寻找兼容的第三方应用程序来拦截广告。 -在 Edit/Preferences 中,你可以通过三个选项来设置阻止的内容。它很容易修改屏蔽策略来满足你的喜好。阻止跟踪器和广告选项使用 EasyList 和 EasyPrivacy。 如果没有其他原因,请保持此选项选中。 +在 Edit/Preferences 菜单中,你可以通过三个选项来设置阻止的内容。它很容易修改屏蔽策略来满足你的喜好。阻止跟踪器和广告选项使用 EasyList 和 EasyPrivacy。 如果没有其他原因,请保持此选项选中。 你还可以阻止脚本和图像。这样做可以最大限度地提高网站加载速度,并能有效防御恶意代码。 @@ -37,12 +38,13 @@ Min 浏览器提供了 Debian Linux、Windows 和 Mac 机器的版本。它不 这种方法很节省时间,因为你不必先进入搜索引擎窗口。 还有一个好处是可以搜索你的书签。 -在 Edit/Preferences 菜单中,选择默认的搜索引擎。该列表包括 DuckDuckGo、Google、Bing、Yahoo、Baidu、Wikipedia 和 Yandex。 +在 Edit/Preferences 菜单中,可以选择默认的搜索引擎。该列表包括 DuckDuckGo、Google、Bing、Yahoo、Baidu、Wikipedia 和 Yandex。 尝试将 DuckDuckGo 作为默认搜索引擎。 Min 默认使用这个引擎,但你也能更换。 ![Min browser search function ](http://www.linuxinsider.com/article_images/2017/84212_620x466.jpg) -Min 浏览器的搜索功能是 URL 栏的一部分。Min 利用搜索引擎 DuckDuckGo 和维基百科的内容。你可以直接在 web 地址栏中输入要搜索的东西。 + +*Min 浏览器的搜索功能是 URL 栏的一部分。Min 会使用搜索引擎 DuckDuckGo 和维基百科的内容。你可以直接在 web 地址栏中输入要搜索的东西。* 搜索栏会非常快速地显示问题的答案。它会使用 DuckDuckGo 的信息,包括维基百科条目、计算器和其它的内容。 @@ -54,10 +56,9 @@ Min 允许你使用模糊搜索快速跳转到任何网站。它能立即向你 我喜欢在当前标签旁边打开标签的方式。你不必设置此选项。它在默认情况下没有其他选择,但这也有道理。 -[ - ![Min browser Tasks](http://www.linuxinsider.com/article_images/2017/84212_620x388-small.jpg) -][2] -Min 的一个很酷的功能是将标签整理到任务栏中,这样你随时都可以搜索。(点击图片放大) + ![Min browser Tasks](http://www.linuxinsider.com/article_images/2017/84212_1200x750.jpg) + +*Min 的一个很酷的功能是将标签整理到任务栏中,这样你随时都可以搜索。* 不点击标签,过一会儿它就会消失。这使你可以专注于当前的任务,而不会分心。 @@ -67,11 +68,11 @@ Min 不需要附加工具来控制多个标签。浏览器会显示标签列表 Min 在“视图”菜单中有一个可选的“聚焦模式”。启用后,除了你打开的选项卡外,它会隐藏其它所有选项卡。 你必须返回到菜单,关闭“聚焦模式”,才能打开新选项卡。 -任务功能还可以帮助你保持专注。你可以在“文件(File)”菜单或使用 Ctrl+Shift+N 创建任务。如果要打开新选项卡,可以在“文件”菜单中选择该选项,或使用 Control+T。 +任务功能还可以帮助你保持专注。你可以在 File 菜单或使用 `Ctrl+Shift+N` 创建任务。如果要打开新选项卡,可以在 File 菜单中选择该选项,或使用 `Control+T`。 按照你的风格打开新任务。我喜欢按组来管理和显示标签,这组标签与工作项目或研究的某些部分相关。我可以在任何时间重新打开整个列表,从而轻松快速的方式找到我的浏览记录。 -另一个好用的功能是可以在 tab 区域找到段落对齐按钮。单击它启用阅读模式。此模式会保存文章以供将来参考,并删除页面上的一切,以便你可以专注于阅读任务。 +另一个好用的功能是可以在选项卡区域找到段落对齐按钮。单击它启用阅读模式。此模式会保存文章以供将来参考,并删除页面上的一切,以便你可以专注于阅读任务。 ### 并不完美 @@ -91,7 +92,7 @@ Min 并不是一个功能完善、丰富的 web 浏览器。你在功能完善 我越使用 Min 浏览器,我越觉得它高效 - 但是当你第一次使用它时要小心。 -Min 并不复杂,也不难操作 - 它只是有点古怪。你必须要玩弄一下才能明白它如何使用。 +Min 并不复杂,也不难操作 - 它只是有点古怪。你必须要体验一下才能明白它如何使用。 ### 想要提建议么? @@ -105,11 +106,11 @@ Min 并不复杂,也不难操作 - 它只是有点古怪。你必须要玩弄一 作者简介: -Jack M. Germain 从苹果 II 和 PC 的早期起就一直在写关于计算机技术。他仍然有他原来的 IBM PC-Jr 和一些其他遗留的 DOS 和 Windows 盒子。他为 Linux 桌面的开源世界留下过共享软件。他运行几个版本的 Windows 和 Linux 操作系统,还通常不能决定是否用他的平板电脑、上网本或 Android 智能手机,还是用他的台式机或笔记本电脑。你可以在 Google+ 上与他联系。 +Jack M. Germain 从苹果 II 和 PC 的早期起就一直在写关于计算机技术。他仍然有他原来的 IBM PC-Jr 和一些其他遗留的 DOS 和 Windows 机器。他为 Linux 桌面的开源世界留下过共享软件。他运行几个版本的 Windows 和 Linux 操作系统,还通常不能决定是否用他的平板电脑、上网本或 Android 智能手机,还是用他的台式机或笔记本电脑。你可以在 Google+ 上与他联系。 -------------------------------------------------------------------------------- -via: http://www.linuxinsider.com/story/84212.html?rss=1 +via: http://www.linuxinsider.com/story/84212.html 作者:[Jack M. Germain][a] 译者:[geekpi](https://github.com/geekpi) From 6c899b2bd39a249343f48ea209c35ba307271c00 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 4 Apr 2017 06:35:52 +0800 Subject: [PATCH 086/241] PRF&PUB:20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md @geekpi --- ...Time Streaming Apps with Apache Calcite.md | 55 ++++++++++++++++++ ...Time Streaming Apps with Apache Calcite.md | 56 ------------------- 2 files changed, 55 insertions(+), 56 deletions(-) create mode 100644 published/20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md delete mode 100644 translated/talk/20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md diff --git a/published/20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md b/published/20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md new file mode 100644 index 0000000000..6ccec16fc9 --- /dev/null +++ b/published/20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md @@ -0,0 +1,55 @@ +用 Apache Calcite 构建强大的实时流式应用 +============== + + ![Calcite](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/calcite.jpg?itok=CUZmjPjy "Calcite ") + +Calcite 是一个数据框架,它允许你创建自定义数据库功能,微软开发者 Atri Sharma 在 Apache 2016 年 11 月 14-16 日在西班牙塞维利亚举行的 Big Data Europe 中对此进行了讲演。 + +[Creative Commons Zero][2] Wikimedia Commons: Parent Géry + +[Apache Calcite][7] 数据管理框架包含了典型的数据库管理系统的许多部分,但省略了如数据的存储和处理数据的算法等其他部分。 Microsoft 的 Azure Data Lake 的软件工程师 Atri Sharma 在西班牙塞维利亚的 [Apache:Big Data][6] 会议上的演讲中讨论了使用 [Apache Calcite][5] 的高级查询规划能力。我们与 Sharma 讨论了解有关 Calcite 的更多信息,以及现有程序如何利用其功能。 + + ![Atri Sharma](https://www.linux.com/sites/lcom/files/styles/floated_images/public/atri-sharma.jpg?itok=77cvZWfw "Atri Sharma") + +*Atri Sharma,微软 Azure Data Lake 的软件工程师,已经[授权使用][1]* + +**Linux.com:你能提供一些关于 Apache Calcite 的背景吗? 它有什么作用? + +Atri Sharma:Calcite 是一个框架,它是许多数据库内核的基础。Calcite 允许你构建自定义的数据库功能来使用 Calcite 所需的资源。例如,Hive 使用 Calcite 进行基于成本的查询优化、Drill 和 Kylin 使用 Calcite 进行 SQL 解析和优化、Apex 使用 Calcite 进行流式 SQL。 + +**Linux.com:有哪些是使得 Apache Calcite 与其他框架不同的特性? + +Atri:Calcite 是独一无二的,它允许你建立自己的数据平台。 Calcite 不直接管理你的数据,而是允许你使用 Calcite 的库来定义你自己的组件。 例如,它允许使用 Calcite 中可用的 Planner 定义你的自定义查询优化器,而不是提供通用查询优化器。 + +**Linux.com:Apache Calcite 本身不会存储或处理数据。 它如何影响程序开发? + +Atri:Calcite 是数据库内核中的依赖项。它针对的是希望扩展其功能,而无需从头开始编写大量功能的的数据管理平台。 + +** Linux.com:谁应该使用它? 你能举几个例子吗?** + +Atri:任何旨在扩展其功能的数据管理平台都应使用 Calcite。 我们是你下一个高性能数据库的基础! + +具体来说,我认为最大的例子是 Hive 使用 Calcite 用于查询优化、Flink 解析和流 SQL 处理。 Hive 和 Flink 是成熟的数据管理引擎,并将 Calcite 用于相当专业的用途。这是对 Calcite 应用进一步加强数据管理平台核心的一个好的案例研究。 + +**Linux.com:你有哪些期待的新功能? + +Atri:流式 SQL 增强是令我非常兴奋的事情。这些功能令人兴奋,因为它们将使 Calcite 的用户能够更快地开发实时流式应用程序,并且这些程序的强大和功能将是多方面的。流式应用程序是新的事实,并且在流式 SQL 中具有查询优化的优点对于大部分人将是非常有用的。此外,关于暂存表的讨论还在进行,所以请继续关注! + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/build-strong-real-time-streaming-apps-apache-calcite + +作者:[AMBER ANKERHOLZ][a] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://www.linux.com/users/aankerholz +[1]:https://www.linux.com/licenses/category/used-permission +[2]:https://www.linux.com/licenses/category/creative-commons-zero +[3]:https://www.linux.com/files/images/atri-sharmajpg +[4]:https://www.linux.com/files/images/calcitejpg +[5]:https://calcite.apache.org/ +[6]:http://events.linuxfoundation.org/events/apache-big-data-europe +[7]:https://calcite.apache.org/ diff --git a/translated/talk/20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md b/translated/talk/20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md deleted file mode 100644 index 7b01bd8541..0000000000 --- a/translated/talk/20161104 Build Strong Real-Time Streaming Apps with Apache Calcite.md +++ /dev/null @@ -1,56 +0,0 @@ -# 用 Apache Calcite 构建强大的实时流应用 - - ![Calcite](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/calcite.jpg?itok=CUZmjPjy "Calcite ") - -Calcite 是一个数据框架,它允许你创建自定义数据库功能,微软开发者 Atri Sharma 在 Apache 即将到来的 11 月 14-16 日在西班牙塞维利亚举行的 Big Data Europe 中解释。[Creative Commons Zero][2] - -Wikimedia Commons: Parent Géry - -[Apache Calcite][7] 数据管理框架包含许多典型的数据库管理系统,但省略了其他部分,如存储数据和算法来处理数据。 Microsoft 在 Azure Data Lake 的软件工程师 Atri Sharma 在西班牙塞维利亚的即将到来的 [Apache:Big Data][6] 会议上的演讲中将讨论使用 [Apache Calcite][5]的高级查询规划能力。我们与 Sharma 讨论了解有关 Calcite 的更多信息,以及现有程序如何利用其功能。 - - ![Atri Sharma](https://www.linux.com/sites/lcom/files/styles/floated_images/public/atri-sharma.jpg?itok=77cvZWfw "Atri Sharma") - -Atri Sharma,微软 Azure Data Lake 的软件工程师,已经[授权使用][1] - -**Linux.com:你能提供一些关于 Apache Calcite 的背景吗? 它有什么作用? - -Atri Sharma:Calcite是一个框架,它是许多数据库内核的基础。Calcite 允许你构建自定义数据库功能并使用 Calcite 所需的资源。例如,Hive 使用 Calcite 进行基于成本的查询优化、Drill 和 Kylin 使用 Calcite 进行 SQL 解析和优化、Apex 使用 Calcite 进行流式 SQL。 - -**Linux.com:有哪些是使得 Apache Calcite 与其他框架不同的特性? - -Atri:Calcite 是独一无二的,它允许你建立自己的数据平台。 Calcite 不直接管理你的数据,而是允许你使用 Calcite 的库来定义你自己的组件。 例如,它允许使用 Calcite 中可用的 Planner 定义自定义查询优化器,而不是提供通用查询优化器。 - -**Linux.com:Apache Calcite 本身不会存储或处理数据。 它如何影响程序开发? - -Atri:Calcite 是数据库内核中的依赖项。它面向希望扩展其功能的数据管理平台,而无需从头开始编写大量功能。 - -** Linux.com:谁应该使用它? 你能举几个例子吗?** - -Atri:任何旨在扩展其功能的数据管理平台都应使用 Calcite。 我们是你下一个高性能数据库的基础! - -具体来说,我认为最大的例子是 Hive 使用 Calcite 用于查询优化、Flink 解析和流 SQL 处理。 Hive 和 Flink 是成熟的数据管理引擎,并使用 Calcite 高度专业目的。这是对 Calcite 应用进一步加强数据管理平台核心的一个好的案例研究。 - -**Linux.com:你有哪些期待的新功能? - -Atri:流 SQL 增强是令我非常兴奋的事情。这些功能令人兴奋,因为它们将使 Calcite 的用户能够更快地开发实时流式应用程序,并且这些程序的强大和功能将是多方面的。流程序是新的事实,并且在流 SQL 中具有查询优化的优点对于大部分人将是非常有用的。此外,关于暂存表的讨论还在进行,所以请继续关注! - --------------------------------------------------------------------------------- - -via: https://www.linux.com/news/build-strong-real-time-streaming-apps-apache-calcite - -作者:[AMBER ANKERHOLZ][a] - -译者:[geekpi](https://github.com/geekpi) - -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 组织编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://www.linux.com/users/aankerholz -[1]:https://www.linux.com/licenses/category/used-permission -[2]:https://www.linux.com/licenses/category/creative-commons-zero -[3]:https://www.linux.com/files/images/atri-sharmajpg -[4]:https://www.linux.com/files/images/calcitejpg -[5]:https://calcite.apache.org/ -[6]:http://events.linuxfoundation.org/events/apache-big-data-europe -[7]:https://calcite.apache.org/ From f6178ce5b532b1ba66e648ecc30bc1f8b7839e1f Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:19:52 +0800 Subject: [PATCH 087/241] =?UTF-8?q?2017.4.4-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mmands When I Connect on a Linux Server.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md diff --git a/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md b/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md new file mode 100644 index 0000000000..ca66923eee --- /dev/null +++ b/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md @@ -0,0 +1,122 @@ +First 5 Commands When I Connect on a Linux Server +============================================================ + + ![First 5 shell commands I type when I connect to a linux server](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/first-5-commands_0.jpg?itok=sITDZBzw "First 5 shell commands I type when I connect to a linux server") +[Creative Commons Attribution][1][Sylvain Kalache][2][First 5 shell commands I type when I connect to a linux server][3] + +After half a decade working as a system administrator/SRE, I know where to start when I am connecting to a Linux server. There is a set of information that you must know about the server in order to properly, well most of the time, debug it. + +### First 60 seconds on a Linux server + +These commands are well known for experienced software engineers but I realized that for a beginner who is getting started with Linux systems, such as my students at [Holberton School][5], it is not obvious. That’s why I decided to share the list of the first 5 commands I type when I connect on a Linux server. + +``` +w +history +top +df +netstat +``` + +These 5 commands are shipped with any Linux distribution so you can use them everywhere without extra installation needed. + +### w: + +``` +[ubuntu@ip-172-31-48-251 ~]$ w +23:40:25 up 273 days, 20:52, 2 users, load average: 0.33, 0.14, 0.12 +USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT +ubuntu pts/0 104-7-14-91.ligh 23:39 0.00s 0.02s 0.00s w +root pts/1 104-7-14-91.ligh 23:40 5.00s 0.01s 0.03s sshd: root [priv] +[ubuntu@ip-172-31-48-251 ~]$ +``` + +A lot of great information in there. First, you can see the server [uptime][6] which is the time during which the server has been continuously running. You can then see what users are connected on the server, quite useful when you want to make sure that you are not impacting a colleague’s work. Finally the [load average][7] will give you a good sense of the server health. + +### history: + +``` +[ubuntu@ip-172-31-48-251 ~]$ history + 1 cd /var/app/current/log/ + 2 ls -al + 3 tail -n 3000 production.log + 4 service apache2 status + 5 cat ../../app/services/discourse_service.rb +``` + +`History` will tell you what was previously run by the user you are currently connected to. You will learn a lot about what type work was previously performed on the machine, what could have gone wrong with it, and where you might want to start your debugging work. + +### top: + +``` +top - 23:47:54 up 273 days, 21:00, 2 users, load average: 0.02, 0.07, 0.10 +Tasks: 79 total, 2 running, 77 sleeping, 0 stopped, 0 zombie +Cpu(s): 1.0%us, 0.0%sy, 0.0%ni, 98.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.3%st +Mem: 3842624k total, 3128036k used, 714588k free, 148860k buffers +Swap: 0k total, 0k used, 0k free, 1052320k cached + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND +21095 root 20 0 513m 21m 4980 S 1.0 0.6 1237:05 python +1380 healthd 20 0 669m 36m 5712 S 0.3 1.0 265:43.82 ruby +19703 dd-agent 20 0 142m 25m 4912 S 0.3 0.7 11:32.32 python + 1 root 20 0 19596 1628 1284 S 0.0 0.0 0:10.64 init + 2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd + 3 root 20 0 0 0 0 S 0.0 0.0 27:31.42 ksoftirqd/0 + 4 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0 + 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H + 7 root 20 0 0 0 0 S 0.0 0.0 42:51.60 rcu_sched + 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh +``` + +The next information you want to know: what is currently running on this server. With `top` you can see all running processes, then order them by CPU, memory utilization and catch the ones that are resource intensive. + +### df: + +``` +[ubuntu@ip-172-31-48-251 ~]$ df -h +Filesystem Size Used Avail Use% Mounted on +/dev/xvda1 7.8G 4.5G 3.3G 58% / +devtmpfs 1.9G 12K 1.9G 1% /dev +tmpfs 1.9G 0 1.9G 0% /dev/shm +``` + +The next important resource that your server needs to have to be working properly is disk space. Running out of it is a very classic issue. + +### netstat: + +``` +[ubuntu@ip-172-31-48-251 ec2-user]# netstat -lp +Active Internet connections (only servers) +Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name +tcp 0 0 *:http *:* LISTEN 1637/nginx +tcp 0 0 *:ssh *:* LISTEN 1209/sshd +tcp 0 0 localhost:smtp *:* LISTEN 1241/sendmail +tcp 0 0 localhost:17123 *:* LISTEN 19703/python +tcp 0 0 localhost:22221 *:* LISTEN 1380/puma 2.11.1 (t +tcp 0 0 *:4242 *:* LISTEN 18904/jsvc.exec +tcp 0 0 *:ssh *:* LISTEN 1209/sshd +``` + +Computers are a big part of our world now because they have the ability to communicate between each other via sockets. It is critical for you to know on what port and IP your server is listening on and what processes are using those. + +Obviously this list might change depending on your goal and the amount of existing information you have. For example, when you want to debug specifically for performance, [Netflix came up with a customized list][8]. Do you have a useful command that is not in my top 5? Please share it in the comments section! + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/first-5-commands-when-i-connect-linux-server + +作者:[SYLVAIN KALACHE ][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/sylvainkalache +[1]:https://www.linux.com/licenses/category/creative-commons-attribution +[2]:https://twitter.com/sylvainkalache +[3]:https://www.flickr.com/photos/sylvainkalache/29587668230/in/dateposted/ +[4]:https://www.linux.com/files/images/first-5-commandsjpg-0 +[5]:https://www.holbertonschool.com/ +[6]:http://whatis.techtarget.com/definition/uptime-and-downtime +[7]:http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages +[8]:http://techblog.netflix.com/2015/11/linux-performance-analysis-in-60s.html From 2284940548c7a0e8c4573d7cc66b69d1a158a848 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:22:51 +0800 Subject: [PATCH 088/241] =?UTF-8?q?20170404-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ich Remote Desktop Sharing Tool for Linux.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/tech/20170403 Remmina – A Feature Rich Remote Desktop Sharing Tool for Linux.md diff --git a/sources/tech/20170403 Remmina – A Feature Rich Remote Desktop Sharing Tool for Linux.md b/sources/tech/20170403 Remmina – A Feature Rich Remote Desktop Sharing Tool for Linux.md new file mode 100644 index 0000000000..062d9a40ea --- /dev/null +++ b/sources/tech/20170403 Remmina – A Feature Rich Remote Desktop Sharing Tool for Linux.md @@ -0,0 +1,199 @@ +Remmina – A Feature Rich Remote Desktop Sharing Tool for Linux +============================================================ + + + +Remmina is a is free and open-source, feature-rich and powerful remote desktop client for Linux and other Unix-like systems, written in GTK+3\. It’s intended for system administrators and travelers, who need to remotely access and work with many computers. + +It supports several network protocols in a simple, unified, homogeneous and easy-to-use user interface. + +#### Remmina Features + +* Supports RDP, VNC, NX, XDMCP and SSH. +* Enables users to maintain a list of connection profiles, organized by groups. +* Supports quick connections by users directly putting in the server address. +* Remote desktops with higher resolutions are scrollable/scalable in both window and fullscreen mode. +* Supports viewport fullscreen mode; here the remote desktop automatically scrolls when the mouse moves over the screen edge. +* Also supports floating toolbar in fullscreen mode; enables you to switch between modes, toggle keyboard grabbing, minimize and beyond. +* Offers tabbed interface, optionally managed by groups. +* Also offers tray icon, allows you to quickly access configured connection profiles. + +In this article, we will show you how to install and use Remmina with a few supported protocols in Linux for desktop sharing. + +#### Prerequisites + +* Allow desktop sharing in remote machines (enable remote machines to permit remote connections). +* Setup SSH services on the remote machines. + +### How to Install Remmina Desktop Sharing Tool in Linux + +Remmina and its plugin packages are already provided in the official repositories of the all if not most of the mainstream Linux distributions. Run the commands below to install it with all supported plugins: + +``` +------------ On Debian/Ubuntu ------------ +$ sudo apt-get install remmina remmina-plugin-* +``` + +``` +------------ On CentOS/RHEL ------------ +# yum install remmina remmina-plugin-* +``` + +``` +------------ On Fedora 22+ ------------ +$ sudo dnf copr enable hubbitus/remmina-next +$ sudo dnf upgrade --refresh 'remmina*' 'freerdp*' +``` + +Once you have installed it, search for remmina in the Ubuntu Dash or Linux Mint Menu, then launch it: + +[ + ![Remmina Desktop Sharing Client](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Desktop-Sharing-Client.png) +][1] + +Remmina Desktop Sharing Client + +You can perform any configurations via the graphical interface or by editing the files under `$HOME/.remmina` or `$HOME/.config/remmina`. + +To setup a new connection to a remote server press `[Ctrl+N]` or go to Connection -> New, configure the remote connection profile as shown in the screenshot below. This is the basic settings interface. + +[ + ![Remmina Basic Desktop Preferences](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Basic-Desktop-Preferences.png) +][2] + +Remmina Basic Desktop Preferences + +Click on Advanced from the interface above to configure advanced connection settings. + +[ + ![Remmina Advance Desktop Settings](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Advance-Desktop-Settings.png) +][3] + +Remmina Advance Desktop Settings + +To configure SSH settings, click on the SSH from the profile interface above. + +[ + ![Remmina SSH Settings](http://www.tecmint.com/wp-content/uploads/2017/03/ssh-remote-desktop-preferences.png) +][4] + +Remmina SSH Settings + +Once you have configured all the necessary settings, save the settings by clicking on Save button and from the main interface, you’ll be able to view all your configured remote connection profiles as shown below. + +[ + ![Remmina Configured Servers](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Configured-Servers.png) +][5] + +Remmina Configured Servers + +#### Connecting to Remote Machine Using sFTP + +Choose the connection profile and edit the settings, choose SFTP – Secure File Transfer from the Protocols down menu. Then set a startup path (optional) and specify the SSH authentication details. Lastly, click Connect. + +[ + ![Remmina sftp Connection](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-sftp-connection.png) +][6] + +Remmina sftp Connection + +Enter your SSH user password here. + +[ + ![Enter SSH Password](http://www.tecmint.com/wp-content/uploads/2017/03/enter-userpasswd.png) +][7] + +Enter SSH Password + +If you see the interface below, then the SFTP connection is successful, you can now [transfer files between your machines][8]. + +[ + ![Remmina Remote sFTP Filesystem](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Remote-sFTP-Filesystem.png) +][9] + +Remmina Remote sFTP Filesystem + +#### Connect to Remote Machine Using SSH + +Select the connection profile and edit the settings, then choose SSH – Secure Shell from the Protocolsdown menu and optionally set a startup program and SSH authentication details. Lastly, click Connect, and enter the user SSH password. + +[ + ![Remmina SSH Connection](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-SSH-Connection.png) +][10] + +Remmina SSH Connection + +When you see the interface below, it means your connection is successful, you can now control the remote machine using SSH. + +[ + ![Remmina Remote SSH Connection](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Remote-SSH-Connection.png) +][11] + +Remmina Remote SSH Connection + +#### Connect to Remote Machine Using VNC + +Choose the connection profile from the list and edit the settings, then select VNC – Virtual Network Computing from the Protocols down menu. Configure basic, advanced and ssh settings for the connection and click Connect, then enter the user SSH password. + +[ + ![Remmina VNC Connection](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-VNC-Connection.png) +][12] + +Remmina VNC Connection + +Once you see the following interface, it implies that you have successfully connected to the remote machine using VNC protocol. + +Enter the user login password from the desktop login interface as shown in the screenshot below. + +[ + ![Remmina Remote Desktop Login](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Remote-Desktop-Login.png) +][13] + +Remmina Remote Desktop Login + +[ + ![Remmina Remote Desktop Sharing](http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Remote-Desktop-Sharing.png) +][14] + +Remmina Remote Desktop Sharing + +Simply follow the steps above to use the other remaining protocols to access remote machines, it’s that simple. + +Remmina Homepage: [https://www.remmina.org/wp/][15] + +That’s all! In this article, we showed you how to install and use Remmina remote connection client with a few supported protocols in Linux. You can share any thoughts in the comments via the feedback form below. + +-------------------------------------------------------------------------------- +作者简介: + +Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/remmina-remote-desktop-sharing-and-ssh-client/ + +作者:[Aaron Kili][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/aaronkili/ +[1]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Desktop-Sharing-Client.png +[2]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Basic-Desktop-Preferences.png +[3]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Advance-Desktop-Settings.png +[4]:http://www.tecmint.com/wp-content/uploads/2017/03/ssh-remote-desktop-preferences.png +[5]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Configured-Servers.png +[6]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-sftp-connection.png +[7]:http://www.tecmint.com/wp-content/uploads/2017/03/enter-userpasswd.png +[8]:http://www.tecmint.com/sftp-upload-download-directory-in-linux/ +[9]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Remote-sFTP-Filesystem.png +[10]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-SSH-Connection.png +[11]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Remote-SSH-Connection.png +[12]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-VNC-Connection.png +[13]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Remote-Desktop-Login.png +[14]:http://www.tecmint.com/wp-content/uploads/2017/03/Remmina-Remote-Desktop-Sharing.png +[15]:https://www.remmina.org/wp/ +[16]:http://www.tecmint.com/author/aaronkili/ +[17]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ +[18]:http://www.tecmint.com/free-linux-shell-scripting-books/ From de05faf2a99f0770c35154f64a2f3f05b86a314a Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:24:22 +0800 Subject: [PATCH 089/241] =?UTF-8?q?20170404-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lled From a RPM or DEB Package in Linux.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md diff --git a/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md b/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md new file mode 100644 index 0000000000..1ce737b16d --- /dev/null +++ b/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md @@ -0,0 +1,105 @@ +How to List Files Installed From a RPM or DEB Package in Linux +============================================================ + +Have you ever wondered where the various files contained inside a package are installed (located) in the Linux file system? In this article, we’ll show how to list all files installed from or present in a certain package or group of packages in Linux. + +This can help you to easily locate important package files like configurations files, documentation and more. Let’s look at the different methods of listing files in or installed from a package: + +### How to List All Files of Installed Package in Linux + +You can use the [repoquery command][6] which is part of the [yum-utils to list files installed][7] on a CentOS/RHEL system from a given package. + +To install and use yum-utils, run the commands below: + +``` +# yum update +# yum install yum-utils +``` + +Now you can list files of an installed RPM package, for example httpd web server (note that the package name is case-sensitive). The `--installed` flag means installed packages and `-l` flags enables listing of files: + +``` +# repoquery --installed -l httpd +# dnf repoquery --installed -l httpd [On Fedora 22+ versions] +``` +[ + ![Repoquery List Installed Files of Httpd](http://www.tecmint.com/wp-content/uploads/2017/03/Repoquery-List-Installed-Files-of-Httpd.png) +][8] + +Repoquery List Installed Files of Httpd + +Important: In Fedora 22+ version, the repoquery command is integrated with [dnf package manager][9] for RPM based distribution to list files installed from a package as shown above. + +Alternatively, you can as well use the [rpm command][10] below to list the files inside or installed on the system from a `.rpm` package as follows, where the `-g` and `-l` means to list files in package receptively: + +``` +# rpm -ql httpd +``` +[ + ![RPM Query Package for Installed Files](http://www.tecmint.com/wp-content/uploads/2017/03/rpm-ql-httpd.png) +][11] + +RPM Query Package for Installed Files + +Another useful option is used to use `-p` to list `.rpm` package files before installing it. + +``` +# rpm -qlp telnet-server-1.2-137.1.i586.rpm +``` + +On Debian/Ubuntu distributions, you can use the [dpkg command][12] with the `-L` flag to list files installed to your Debian system or its derivatives, from a given `.deb` package. + +In this example, we will list files installed from apache2 web server: + +``` +$ dpkg -L apache2 +``` +[ + ![dpkg List Installed Packages](http://www.tecmint.com/wp-content/uploads/2017/03/dpkg-List-Installed-Packages.png) +][13] + +dpkg List Installed Packages + +Don’t forget to check out following useful articles for package management in Linux. + +1. [20 Useful ‘Yum’ Commands for Package Management][1] +2. [20 Useful RPM Commands for Package Management][2] +3. [15 Useful APT Commands for Package Management in Ubuntu][3] +4. [15 Useful Dpkg Commands for Ubuntu Linux][4] +5. [5 Best Linux Package Managers for Linux Newbies][5] + +That’s all! In this article, we showed you how to list/locate all files installed from a given package or group of packages in Linux. Share your thoughts with us using the feedback form below. + +-------------------------------------------------------------------------------- + +作者简介: + +Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/list-files-installed-from-rpm-deb-package-in-linux/ + +作者:[Aaron Kili][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/aaronkili/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ +[3]:http://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ +[4]:http://www.tecmint.com/dpkg-command-examples/ +[5]:http://www.tecmint.com/linux-package-managers/ +[6]:http://www.tecmint.com/list-installed-packages-in-rhel-centos-fedora/ +[7]:http://www.tecmint.com/linux-yum-package-management-with-yum-utils/ +[8]:http://www.tecmint.com/wp-content/uploads/2017/03/Repoquery-List-Installed-Files-of-Httpd.png +[9]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ +[10]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ +[11]:http://www.tecmint.com/wp-content/uploads/2017/03/rpm-ql-httpd.png +[12]:http://www.tecmint.com/dpkg-command-examples/ +[13]:http://www.tecmint.com/wp-content/uploads/2017/03/dpkg-List-Installed-Packages.png +[14]:http://www.tecmint.com/author/aaronkili/ +[15]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ +[16]:http://www.tecmint.com/free-linux-shell-scripting-books/ From e2157be92f733cdd5f36214e6e1a20415788013e Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:26:19 +0800 Subject: [PATCH 090/241] =?UTF-8?q?20170404-4=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...a DHCP Server in CentOS RHEL and Fedora.md | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md diff --git a/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md b/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md new file mode 100644 index 0000000000..f405af496f --- /dev/null +++ b/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md @@ -0,0 +1,205 @@ +How to Install a DHCP Server in CentOS, RHEL and Fedora +============================================================ + + +DHCP (Dynamic Host Configuration Protocol) is a network protocol that enables a server to automatically assign an IP address and provide other related network configuration parameters to a client on a network, from a pre-defined IP pool. + +This means that each time a client (connected to the network) boots up, it gets a “dynamic” IP address, as opposed to “static” IP address that never changes. The IP address assigned by a DHCP server to DHCP client is on a “lease”, the lease time can vary depending on how long a client is likely to require the connection or DHCP configuration. + +In this tutorial, we will cover how to install and configure a DHCP server in CentOS/RHEL and Fedora distributions. + +#### Testing Environment Setup + +We are going to use following testing environment for this setup. + +``` +DHCP Server - CentOS 7 +DHCP Clients - Fedora 25 and Ubuntu 16.04 +``` + +#### How Does DHCP Work? + +Before we move any further, let’s briefly explain how DHCP works: + +* When a client computer (configured to use DHCP) and connected to a network is powered on, it forwards a DHCPDISCOVER message to the DHCP server. +* And after the DHCP server receives the DHCPDISCOVER request message, it replies with a DHCPOFFER message. +* Then the client receives the DHCPOFFER message, and it sends a DHCPREQUEST message to the server indicating, it is prepared to get the network configuration offered in the DHCPOFFERmessage. +* Last but not least, the DHCP server receives the DHCPREQUEST message from the client, and sends the DHCPACK message showing that the client is now permitted to use the IP address assigned to it. + +### Step 1: Installing DHCP Server in CentOS + +1. Installing DCHP is quite straight forward, simply run the command below. + +``` +# yum -y install dhcp +``` + +Important: Assuming there is more than one network interface attached to the system, but you want the DHCP server to only be started on one of the interfaces, set the DHCP server to start only on that interface as follows. + +2. Open the file /etc/sysconfig/dhcpd, add the name of the specific interface to the list of DHCPDARGS, for example if the interface is `eth0`, then add: + +``` +DHCPDARGS=eth0 +``` + +Save the file and exit. + +### Step 2: Configuring DHCP Server in CentOS + +3. For starters, to setup a DHCP server, the first step is to create the `dhcpd.conf` configuration file, and the main DHCP configuration file is normally /etc/dhcp/dhcpd.conf (which is empty by default), it keeps all network information sent to clients. + +However, there is a sample configuration file /usr/share/doc/dhcp*/dhcpd.conf.sample, which is a good starting point for configuring a DHCP server. + +And, there are two types of statements defined in the DHCP configuration file, these are: + +* parameters – state how to carry out a task, whether to perform a task, or what network configuration options to send to the DHCP client. +* declarations – specify the network topology, define the clients, offer addresses for the clients, or apply a group of parameters to a group of declarations. + +Therefore, start by copying the sample configuration file as the main configuration file like so: + +``` +# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf +``` + +4. Now, open the main configuration file and define your DHCP server options: + +``` +# vi /etc/dhcp/dhcpd.conf +``` + +Start by setting the following global parameters which will apply to all the subnetworks (do specify values that apply to your scenario) at the top of the file: + +``` +option domain-name "tecmint.lan"; +option domain-name-servers ns1.tecmint.lan, ns2.tecmint.lan; +default-lease-time 3600; +max-lease-time 7200; +authoritative; +``` + +5. Now, define a subnetwork; in this example, we will configure DHCP for 192.168.56.0/24 LAN network (remember to use parameters that apply to your scenario): + +``` +subnet 192.168.56.0 netmask 255.255.255.0 { +option routers 192.168.56.1; +option subnet-mask 255.255.255.0; +option domain-search "tecmint.lan"; +option domain-name-servers 192.168.56.1; +range 192.168.56.10 192.168.56.100; +range 192.168.56.120 192.168.56.200; +} +``` + +### Step 3: Assign Static IP to DHCP Client + +You can assign a static IP address to a specific client computer on the network, simply define the section below in /etc/dhcp/dhcpd.conf file, where you must explicitly specify it’s MAC addresses and the fixed IP to be assigned: + +``` +host ubuntu-node { +hardware ethernet 00:f0:m4:6y:89:0g; +fixed-address 192.168.56.105; +} +host fedora-node { +hardware ethernet 00:4g:8h:13:8h:3a; +fixed-address 192.168.56.110; +} +``` + +Save the file and close it. + +Note: You can find out or display the Linux MAC address using following command. + +``` +# ifconfig -a eth0 | grep HWaddr +``` + +6. Now start the DHCP service for the mean time and enable it to start automatically from the next system boot, using following commands: + +``` +---------- On CentOS/RHEL 7 ---------- +# systemctl start dhcpd +# systemctl enable dhcpd +---------- On CentOS/RHEL 6 ---------- +# service dhcpd start +# chkconfig dhcpd on +``` + +7. Next, do not forget to permit DHCP service (DHCPD daemon listens on port 67/UDP) as below: + +``` +---------- On CentOS/RHEL 7 ---------- +# firewall-cmd --add-service=dhcp --permanent +# firewall-cmd --reload +---------- On CentOS/RHEL 6 ---------- +# iptables -A INPUT -p tcp -m state --state NEW --dport 67 -j ACCEPT +# service iptables save +``` + +### Step 4: Configuring DHCP Clients + +8. Now, you can configure your clients on the network to automatically receive IP addresses from the DHCP server. Login to the client machine and modify the Ethernet interface configuration file as follows (take not of the interface name/number): + +``` +# vi /etc/sysconfig/network-scripts/ifcfg-eth0 +``` + +Add the options below: + +``` +DEVICE=eth0 +BOOTPROTO=dhcp +TYPE=Ethernet +ONBOOT=yes +``` + +Save the file and exit. + +9. You can also perform the settings using the GUI on a desktop computer, set the Method to Automatic (DHCP) as shown in the screenshot below (Ubuntu 16.04 desktop). + +[ + ![Set DHCP in Client Network](http://www.tecmint.com/wp-content/uploads/2017/03/Set-DHCP-in-Client-Network.png) +][3] + +Set DHCP in Client Network + +10. Then restart network services as follows (you can possibly reboot the system): + +``` +---------- On CentOS/RHEL 7 ---------- +# systemctl restart network +---------- On CentOS/RHEL 6 ---------- +# service network restart +``` + +At this point, if all settings were correct, your clients should be receiving IP addresses automatically from the DHCP server. + +You may also read: + +1. [How to Install and Configure Multihomed ISC DHCP Server on Debian Linux][1] +2. [10 Useful “IP” Commands to Configure Network Interfaces][2] + +In this tutorial, we showed you how to setup a DHCP server in RHEL/CentOS. Use the comment form below to write back top us. In an upcoming article, we will show you how to setup a DHCP server in Debian/Ubuntu. Until then, always stay connected to TecMint. + +-------------------------------------------------------------------------------- + +作者简介: + +Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-dhcp-server-in-centos-rhel-fedora/ + +作者:[Aaron Kili][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/aaronkili/ +[1]:http://www.tecmint.com/install-and-configure-multihomed-isc-dhcp-server-on-debian-linux/ +[2]:http://www.tecmint.com/ip-command-examples/ +[3]:http://www.tecmint.com/wp-content/uploads/2017/03/Set-DHCP-in-Client-Network.png +[4]:http://www.tecmint.com/author/aaronkili/ +[5]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ +[6]:http://www.tecmint.com/free-linux-shell-scripting-books/ From 9e077b766b8722daa200ee5aeddc3cca67b2bb72 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:32:19 +0800 Subject: [PATCH 091/241] =?UTF-8?q?20170404-5=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ock to the worlds most expensive cities.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sources/talk/20170402 Why do developers who could work anywhere flock to the worlds most expensive cities.md diff --git a/sources/talk/20170402 Why do developers who could work anywhere flock to the worlds most expensive cities.md b/sources/talk/20170402 Why do developers who could work anywhere flock to the worlds most expensive cities.md new file mode 100644 index 0000000000..d715a85d0b --- /dev/null +++ b/sources/talk/20170402 Why do developers who could work anywhere flock to the worlds most expensive cities.md @@ -0,0 +1,53 @@ +Why do developers who could work anywhere flock to the world’s most expensive cities? +============================================================ + ![](https://tctechcrunch2011.files.wordpress.com/2017/04/img_20170401_1835042.jpg?w=977) + +Politicians and economists [lament][10] that certain alpha regions — SF, LA, NYC, Boston, Toronto, London, Paris — attract all the best jobs while becoming repellently expensive, reducing economic mobility and contributing to further bifurcation between haves and have-nots. But why don’t the best jobs move elsewhere? + +Of course, many of them can’t. The average financier in NYC or London (until Brexit annihilates London’s banking industry, of course…) would be laughed out of the office, and not invited back, if they told their boss they wanted to henceforth work from Chiang Mai. + +But this isn’t true of (much of) the software field. The average web/app developer might have such a request declined; but they would not be laughed at, or fired. The demand for good developers greatly outstrips supply, and in this era of Skype and Slack, there’s nothing about software development that requires meatspace interactions. + +(This is even more true of writers, of course; I did in fact post this piece from Pohnpei. But writers don’t have anything like the leverage of software developers.) + +Some people will tell you that remote teams are inherently less effective and productive than localized ones, or that “serendipitous collisions” are so important that every employee must be forced to the same physical location every day so that these collisions can be manufactured. These people are wrong, as long as the team in question is small — on the order of handfuls, dozens or scores, rather than hundreds or thousands — and flexible. + +I should know: at [HappyFunCorp][11], we work extensively with remote teams, and actively recruit remote developers, and it works out fantastically well. A day in which I interact and collaborate with developers in Stockholm, São Paulo, Shanghai, Brooklyn and New Delhi, from my own home base in San Francisco, is not at all unusual. + +At this point, whether it’s a good idea is almost irrelevant, though. Supply and demand is such that any sufficiently skilled developer could become a so-called digital nomad if they really wanted to. But many who could, do not. I recently spent some time in Reykjavik at a house Airbnb-ed for the month by an ever-shifting crew of temporary remote workers, keeping East Coast time to keep up with their jobs, while spending mornings and weekends exploring Iceland — but almost all of us then returned to live in the Bay Area. + +Economically, of course, this is insane. Moving to and working from Southeast Asia would save us thousands of dollars a month in rent alone. So why do people who could live in Costa Rica on a San Francisco salary, or in Berlin while charging NYC rates, choose not to do so? Why are allegedly hardheaded engineers so financially irrational? + +Of course there are social and cultural reasons. Chiang Mai is very nice, but doesn’t have the Met, or steampunk masquerade parties or 50 foodie restaurants within a 15-minute walk. Berlin is lovely, but doesn’t offer kite surfing, or Sierra hiking or California weather. Neither promises an effectively limitless population of people with whom you share values and a first language. + +And yet I think there’s much more to it than this. I believe there’s a more fundamental economic divide opening than the one between haves and have-nots. I think we are witnessing a growing rift between the world’s Extremistan cities, in which truly extraordinary things can be achieved, and its Mediocristan towns, in which you can work and make money and be happy but never achieve greatness. (Labels stolen from the great Nassim Taleb.) + +The arts have long had Extremistan cities. That’s why aspiring writers move to New York City, and even directors and actors who found international success are still drawn to L.A. like moths to a klieg light. Now it is true of tech, too. Even if you don’t even want to try to (help) build something extraordinary — and the startup myth is so powerful today that it’s a very rare engineer indeed who hasn’t at least dreamed about it — the prospect of being  _where great things happen_  is intoxicatingly enticing. + +But the interesting thing about this is that it could, in theory, change; because — as of quite recently — distributed, decentralized teams can, in fact, achieve extraordinary things. The cards are arguably stacked against them, because VCs tend to be quite myopic. But no law dictates that unicorns may only be born in California and a handful of other secondary territories; and it seems likely that, for better or worse, Extremistan is spreading. It would be pleasantly paradoxical if that expansion ultimately leads to  _lower_  rents in the Mission. + +-------------------------------------------------------------------------------- + +via: https://techcrunch.com/2017/04/02/why-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities/ + +作者:[ Jon Evans ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://techcrunch.com/author/jon-evans/ +[1]:https://techcrunch.com/2017/04/02/why-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities/#comments +[2]:https://techcrunch.com/2017/04/02/why-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities/# +[3]:http://twitter.com/share?via=techcrunch&url=http://tcrn.ch/2owXJ0C&text=Why%20do%20developers%20who%20could%20work%20anywhere%20flock%20to%20the%20world%E2%80%99s%20most%20expensive%C2%A0cities%3F&hashtags= +[4]:https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftechcrunch.com%2F2017%2F04%2F02%2Fwhy-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities%2F&title=Why%20do%20developers%20who%20could%20work%20anywhere%20flock%20to%20the%20world%E2%80%99s%20most%20expensive%C2%A0cities%3F +[5]:https://plus.google.com/share?url=https://techcrunch.com/2017/04/02/why-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities/ +[6]:http://www.reddit.com/submit?url=https://techcrunch.com/2017/04/02/why-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities/&title=Why%20do%20developers%20who%20could%20work%20anywhere%20flock%20to%20the%20world%E2%80%99s%20most%20expensive%C2%A0cities%3F +[7]:http://www.stumbleupon.com/badge/?url=https://techcrunch.com/2017/04/02/why-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities/ +[8]:mailto:?subject=Why%20do%20developers%20who%20could%20work%20anywhere%20flock%20to%20the%20world%E2%80%99s%20most%20expensive%C2%A0cities?&body=Article:%20https://techcrunch.com/2017/04/02/why-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities/ +[9]:https://share.flipboard.com/bookmarklet/popout?v=2&title=Why%20do%20developers%20who%20could%20work%20anywhere%20flock%20to%20the%20world%E2%80%99s%20most%20expensive%C2%A0cities%3F&url=https://techcrunch.com/2017/04/02/why-do-developers-who-could-work-anywhere-flock-to-the-worlds-most-expensive-cities/ +[10]:https://mobile.twitter.com/Noahpinion/status/846054187288866 +[11]:http://happyfuncorp.com/ +[12]:https://twitter.com/rezendi +[13]:https://techcrunch.com/author/jon-evans/ +[14]:https://techcrunch.com/2017/04/01/discussing-the-limits-of-artificial-intelligence/ From f3e0f36a1ee7604bce53bcd0e1e4019ea0c2dd6b Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:34:58 +0800 Subject: [PATCH 092/241] =?UTF-8?q?20170404-6=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... inner curmudgeon A Linux laptop review.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20170403 Discovering my inner curmudgeon A Linux laptop review.md diff --git a/sources/tech/20170403 Discovering my inner curmudgeon A Linux laptop review.md b/sources/tech/20170403 Discovering my inner curmudgeon A Linux laptop review.md new file mode 100644 index 0000000000..2f68b6b491 --- /dev/null +++ b/sources/tech/20170403 Discovering my inner curmudgeon A Linux laptop review.md @@ -0,0 +1,100 @@ +# [Discovering my inner curmudgeon: A Linux laptop review][1] + +Quick refresher: I'm a life-long Mac user, but I was [disappointed by Apple's latest MacBook Pro release][2]. I researched [a set of alternative computers][3] to consider. And, as a surprise even to myself, I decided to leave the Mac platform. + +I chose the HP Spectre x360 13" laptop that was released after CES 2017, the new version with a 4K display. I bought the machine [from BestBuy][4] (not an affiliate link) because that was the only retailer selling this configuration. My goal was to run Ubuntu Linux instead of Windows. + +Here are my impressions from using this computer over the past month, followed by some realizations about myself. + +Ubuntu + +Installing Ubuntu was easy. The machine came with Windows 10 preinstalled. I used Windows' built-in Disk Management app to [shrink the main partition][5] and free up space for Linux. I [loaded the Ubuntu image on a USB drive][6], which conveniently fit in the machine's USB-A port (missing on new Macs). Then I followed [Ubuntu's simple install instructions][7], which required some BIOS changes to [enable booting from USB][8]. + +Screen + +The 4K screen on the Spectre x360 is gorgeous. The latest Ubuntu handles High DPI screens well, which surprised me. With a combination of the built-in settings app and additional packages like [gnome-tweak-tool][9], you can get UI controls rendering on the 4K display at 2x native size, so they look right. You can also boost the default font size to make it proportional. There are even settings to adjust icon sizes in the window titlebar and task manager. It's fiddly, but I got everything set up relatively quickly. + +Trackpad + +The trackpad hardware rattles a little, but it follows your fingers well and supports multi-touch input in Ubuntu by default. However, you immediately realize that something is wrong when you try to type and the mouse starts jumping around. The default Synaptics driver for Linux doesn't properly ignore palm presses on this machine. The solution is to switch to the [new libinput system][10]. By adjusting the [xinput settings][11] you can get it to work decently well.  + +But the gestures I'm used to, like two finger swipe to go back in Chrome, or four-finger swipe to switch workspaces, don't work by default in Ubuntu. You have to use a tool like [libinput-gestures][12] to enable them. Even then, the gestures are only recognized about 50% of the time, which is frustrating. The "clickpad" functionality is also problematic: When you press your thumb on the dual-purpose trackpad/button surface in order to click, the system will often think you meant to move the mouse or you're trying to multi-touch resize. Again: It's frustrating. + +Keyboard + +Physically the keyboard is good. The keys have a lot of travel and I can type fast. The left control key is in the far bottom left so it's usable (unlike Macs that put the function key there). The arrow keys work well. One peculiarity is the keyboard has an extra column of keys on the right side, which includes Delete, Home, Page Up, Page Down, and End. This caused my muscle memory for switching from arrow keys to home row keys to be off by one column. This also puts your hands off center while typing, which can make you feel like you're slightly reaching on your right side. + +At first I thought that the extra column of keys (Home, Page Up, etc) was superfluous. But after struggling to use Sublime Text while writing some code, I realized that the text input controls on Linux and Windows rely on these keys. It makes sense that HP decided to include them. As a Mac user I'm used to Command-Right going to the end of line, where a Windows or Linux user would reach for the End key. Remapping every key to match the Mac setup is possible, but hard to make consistent across all programs. The right thing to do is to relearn how to do text input with these new keys. I spent some time trying to retrain my muscle memory, but it was frustrating, like that summer when I tried [Dvorak][13]. + +Sound + +The machine comes with four speakers: two fancy Bang & Olufsen speakers on top, and two normal ones on the bottom. The top speakers don't work on Linux and there's a [kernel bug open][14] to figure it out. The bottom speakers do work, but they're too quiet. The headphone jack worked correctly, and it would even mute the speakers automatically when you plugged in headphones. I believe this only happened because I had upgraded my kernel to the bleeding edge [4.10 version][15] in my attempts to make other hardware functional. I figure the community will eventually resolve the kernel bug, so the top speaker issue is likely temporary. But this situation emphasizes why HP needs to ship their own custom distribution of Windows with a bunch of extra magical drivers. + +Battery & power + +Initially the battery life was terrible. The 4K screen burns a lot of power. I also noticed that the CPU fan would turn on frequently and blow warm air out the left side of the machine. It's hot enough that it's very uncomfortable if it's on your lap. I figured out that this was mostly the result of a lack of power management in Ubuntu's default configuration. You can enable a variety of powersaving tools, including [powertop][16] and [pm-powersave][17]. Intel also provides [Linux firmware support][18] to make the GPU idle properly. With all of these changes applied, my battery life got up to nearly 5 hours: a disappointment compared to the 9+ hours advertised. On a positive note, the USB-C charger works great and fills the battery quickly. It was also nice to be able to charge my Nexus X phone with the same plug. + +Two-in-one + +The Spectre x360 gets its name from the fact that its special hinges let the laptop's screen rotate completely around, turning it into a tablet. Without any special configuration, touching the screen in Ubuntu works properly for clicking, scrolling, and zooming. Touch even works for forward/back gestures that don't work on the trackpad. The keyboard and trackpad also automatically disable themselves when you rotate into tablet mode. You can set up [Onboard][19], Gnome's on-screen keyboard, and it's decent. Screen auto-rotation doesn't work, but I was able to cobble something together using [iio-sensor-proxy][20] and [this one-off script][21]. Once I did this, though, I realized that the 16:9 aspect ratio of the screen is too much: It hurts my eyeballs to scan down so far vertically in tablet mode. + +Window manager and programs + +I haven't used Linux regularly on a desktop machine since RedHat 5.0 in 1998\. It's come a long way. Ubuntu boots very quickly. The default UI uses their Unity window manager, a Gnome variant, and it's decent. I tried plain Gnome and it felt clunky in comparison. I ended up liking KDE the most, and would choose the KDE [Kubuntu variant][22] if I were to start again. Overall the KDE window manager felt nice and did everything I needed. + +On this journey back into Linux I realized that most of the time I only use eight programs: a web browser (Chrome), a terminal (no preference), a text editor (Sublime Text 3), a settings configurator, a GUI file manager, an automatic backup process (Arq), a Flux-like screen dimmer, and an image editor (the Gimp). My requirements beyond that are also simple. I rely on four widgets: clock, wifi status, battery level, and volume level. I need a task manager (like the Dock) and virtual work spaces (like Mission Control / Expose). I don't use desktop icons, notifications, recent apps, search, or an applications menu. I was able to accommodate all of these preferences on Linux. + +Conclusion + +If you're in the market for a new laptop, by all means check this one out. However, I'll be selling my Spectre x360 and going back to my mid-2012 MacBook Air. It's not HP's fault or because of the Linux desktop. The problem is how I value my time. + +I'm so accustomed to the UX of a Mac that it's extremely difficult for me to use anything else as efficiently. My brain is tuned to a Mac's trackpad, its keyboard layout, its behaviors of text editing, etc. Using the HP machine and Linux slows me down so much that it feels like I'm starting over. When I'm using my computer I want to spend my time improving my (programming, writing, etc) skills. I want to invest all of my "retraining" energy into understanding unfamiliar topics, like [new functional languages][23] and [homomorphic encryption][24]. I don't want to waste my time relearning the fundamentals. + +In contrast, I've spent the past two years learning how to play the piano. It's required rote memorization and repeated physical exercises. By spending time practicing piano, I've opened myself up to ideas that I couldn't appreciate before. I've learned things about music that I couldn't comprehend in the past. My retraining efforts have expanded my horizons. I'm skeptical that adopting HP hardware and the Linux desktop could have a similar effect on me. + +I'm stubborn. There will come a time when I need to master a new way of working to stay relevant, much like how telegraph operators had to switch from Morse code to [teletypes][25]. I hope that I will have the patience and foresight to make such a transition smoothly in the future. Choosing to retrain only when it would create new possibilities seems like a good litmus test for achieving that goal. In the meantime, I'll keep using a Mac. + +-------------------------------------------------------------------------------- + +作者简介: + +I'm the author of the book Effective Python. I'm a software engineer and I've worked at Google for the past 11 years. My current focus is survey statistics. I formerly worked on Cloud infrastructure and open protocols. + +Follow @haxor if you'd like to read posts from me in the future. You can also email me here if you have questions, or leave a comment below. If you enjoyed this post, look here for some of my other favorites. + +----------------- + +via: http://www.onebigfluke.com/2017/04/discovering-my-inner-curmudgeon-linux.html + +作者:[Brett Slatkin ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.onebigfluke.com/ +[1]:http://www.onebigfluke.com/2017/04/discovering-my-inner-curmudgeon-linux.html +[2]:http://www.onebigfluke.com/2016/10/lamenting-progress.html +[3]:http://www.onebigfluke.com/2016/10/alternatives-to-apple-computers.html +[4]:http://www.bestbuy.com/site/hp-spectre-x360-2-in-1-13-3-4k-ultra-hd-touch-screen-laptop-intel-core-i7-16gb-memory-512gb-solid-state-drive-dark-ash-silver/5713178.p?skuId=5713178 +[5]:https://www.howtogeek.com/101862/how-to-manage-partitions-on-windows-without-downloading-any-other-software/ +[6]:https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-windows +[7]:https://www.ubuntu.com/download/desktop/install-ubuntu-desktop +[8]:http://support.hp.com/us-en/document/c00364979 +[9]:https://launchpad.net/gnome-tweak-tool +[10]:https://launchpad.net/xserver-xorg-input-libinput +[11]:https://wiki.archlinux.org/index.php/Libinput#Configuration +[12]:https://github.com/bulletmark/libinput-gestures +[13]:https://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard +[14]:https://bugzilla.kernel.org/show_bug.cgi?id=189331 +[15]:http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.10/ +[16]:https://blog.sleeplessbeastie.eu/2015/08/10/how-to-set-all-tunable-powertop-options-at-system-boot/ +[17]:http://askubuntu.com/questions/765840/does-pm-powersave-start-automatically-when-running-on-battery +[18]:https://01.org/linuxgraphics/downloads/firmware +[19]:https://launchpad.net/onboard +[20]:https://github.com/hadess/iio-sensor-proxy +[21]:http://askubuntu.com/questions/634151/auto-rotate-screen-on-dell-13-7000-with-15-04-gnome/889591#889591 +[22]:https://www.kubuntu.org/ +[23]:http://docs.idris-lang.org/en/latest/tutorial/index.html#tutorial-index +[24]:https://arxiv.org/abs/1702.07588 +[25]:https://en.wikipedia.org/wiki/Teleprinter From 2ad3a2cc7cb739d9596c3dc8cb331c2e22ec8ea7 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:41:55 +0800 Subject: [PATCH 093/241] =?UTF-8?q?20170404-8=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0403 Yes Python is Slow and I Dont Care.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20170403 Yes Python is Slow and I Dont Care.md diff --git a/sources/tech/20170403 Yes Python is Slow and I Dont Care.md b/sources/tech/20170403 Yes Python is Slow and I Dont Care.md new file mode 100644 index 0000000000..ae88755c41 --- /dev/null +++ b/sources/tech/20170403 Yes Python is Slow and I Dont Care.md @@ -0,0 +1,194 @@ +Yes, Python is Slow, and I Don’t Care +============================================================ + +### A rant on sacrificing performance for productivity. + + + ![](https://cdn-images-1.medium.com/max/800/0*pWAgROZ2JbYzlDgj.jpg) + +I’m taking a break from my discussion on asyncio in Python to talk about something that has been on my mind recently: the speed of Python. For those who don’t know, I am somewhat of a Python fanboy, and I aggressively use Python everywhere I can. One of the biggest complaints people have against Python is that it’s slow. Some people almost refuse to even try python because its slower than X. Here are my thoughts as to why you should try python, despite it being slow. + +### Speed No Longer Matters + +It used to be the case that programs took a really long time to run. CPU’s were expensive, memory was expensive. Running time of a program used to be an important metric. Computers were very expensive, and so was the electricity to run them. Optimization of these resources was done because of an eternal business law: + +> Optimize your most expensive resource. + +Historically, the most expensive resource was computer run time. This is what lead to the study of computer science which focuses on efficiency of different algorithms. However, this is no longer true, as silicon is now cheap. Like really cheap. Run time is no longer your most expensive resource. A company’s most expensive resource is now its employee’s time. Or in other words, you. It’s more important to get stuff done than to make it go fast. In fact this is so important, I am going to put it again right here as if it was a quote (for those who are just browsing): + +> It’s more important to get stuff done than to make it go fast. + +You might be saying, “My company cares about speed, I build a web application and all responses have to be faster than x milliseconds.” Or, “We have had customers cancel because they think our app is too slow.” I am not trying to say that speed doesn’t matter at all, I am simply trying to say that its no longer the most important thing; it’s not your most expensive resource. + + + ![](https://cdn-images-1.medium.com/max/800/0*Z6j9zMua_w-T25TC.jpg) + + +### Speed Is The Only Thing That Matters + +When you say  _speed_  in the context of programming, you typically mean performance, aka CPU cycles. When your CEO say’s  _speed_  in the context of programming he means business speed. The most important metric is time-to-market. Ultimately, it doesn’t matter how fast your product/web app is. It doesn’t matter what language its written in. It doesn't even matter how much money it takes to run. At the end of the day, the one thing that will make your company survive or die is time-to-market. I’m not just talking about the startup idea of how long it takes till you make money, but more so the time frame of “from idea, to customers hands.” The only way to survive in business is to innovate faster than your competitors. It doesn’t matter how many good ideas you come up with if your competitors “ship” before you do. You have to be the first to market, or at least keep up. Once you slow down, you are done. + +> The only way to survive in business is to innovate faster than your competitors. + +#### A Case of Microservices + +Companies like Amazon, Google, and Netflix understand the importance of moving fast. They have created a business system where they can move fast and innovate quickly. Microservices are the solution to their problem. This article has nothing to do with whether or not you should be using microservices, but at least accept that Amazon and Google think they should be using them. + + ![](https://cdn-images-1.medium.com/max/600/0*MBM9zatYv_Lzr3QN.jpg) + +Microservices are inherently slow. The very concept of a microservice is to break up a boundary by a network call. This means you are taking what was a function call (a couple cpu cycles) and turning it into a network call. There isn’t much you could do that is worse in terms of performance. Network calls are really slow compared to the CPU. But these big companies still choose to use microservices. There really isn’t an architecture slower than microservices that I know of. Microservices’ biggest con is performance, but greatest pro is time-to-market. By building teams around smaller projects and code bases, a company is able to iterate and innovate at a much faster pace. This just goes to show that very large companies also care about time-to-market, not just startups. + +#### CPU is Not your Bottleneck + + + ![](https://cdn-images-1.medium.com/max/800/0*s1RKhkRIBMEYji_w.jpg) + +If you write a network application, such as a web server, chances are, CPU time is not the bottleneck of your application. When your web server handles a request, it probably makes a couple network calls, such as to your database, or perhaps a cache server like Redis. While these services themselves may be fast, the network call to them is slow. [There is a really great blog article on the speed differences of certain operations.][1] In the article, the author scales CPU cycle times into more understandable human times. If a single CPU cycle was the equivalent of 1 second, then a network call from California to New York, would be the equivalent of 4 years. That is how much slower network is. For some rough estimates, let’s say a normal network call inside the same data center takes about 3 ms. That would be the equivalent of 3 months in our “human scale”. Now imagine your program is very CPU intensive, it takes 100,000 cycles to respond to a single call. That would be the equivalent of just over 1 day. Now let’s say you use a language that is 5 times as slow, now it takes about 5 days. Well, compare that to our 3 month network call, and the 4 day difference doesn’t really matter much at all. If someone has to wait at least 3 months for a package, I don't think an extra 4 days will really matter all that much to them. + +What this ultimately means is that, even if python is slow, it doesn’t matter. The speed of the language (or CPU time) is almost never the issue. Google actually did a study on this very concept, and [they wrote a paper on it][2]. The paper talks about designing a high throughput system. In the conclusion, they say: + +> It may seem paradoxical to use an interpreted language in a high-throughput environment, but we have found that the CPU time is rarely the limiting factor; the expressibility of the language means that most programs are small and spend most of their time in I/O and native run-time code. Moreover, the flexibility of an interpreted implementation has been helpful, both in ease of experimentation at the linguistic level and in allowing us to explore ways to distribute the calculation across many machines. + +or, to emphasise: + +> the CPU time is rarely the limiting factor + +#### What if CPU time is an issue? + +You might be saying, “That’s great and all, but we have had issues where CPU was our bottleneck and caused much slowdown for our web app”, or “Language  _x _ requires much less hardware to run than language  _y_  on the server.” This all might be true. The wonderful thing about web servers is that you can load balance them almost infinitely. In other words, throw more hardware at it. Sure, Python might require better hardware than other languages, such as C. Just throw hardware at your CPU problem. Hardware is very cheap compared to your time. If you save a couple weeks worth of time in productivity in a year, that will more than pay for the added hardware cost. + + +* * * + + ![](https://cdn-images-1.medium.com/max/1000/0*mJFOcWsdEQq98gkF.jpg) + +### So, is Python faster? + +This whole time I have been talking about how the most important thing is development time. So the question remains: Is Python faster than language X when it comes to development time? Anecdotally, I, [google][3], [and][4] [several][5][others][6], can tell you how much more [productive][7] Python is. It abstracts so many things for you, helping you focus on what you’re really trying to code, without getting stuck in the weeds of the small things such as whether you should use a vector or an array. But you might not like to take others’ word for it, so let’s look at some more empirical data. + +For the most part, this debate on whether python is more productive or not really comes down to scripting (or dynamic languages) vs statically typed languages. I think it is commonly excepted that statically typed languages are less productive, but [here is a good paper][8] that explains why. In terms of Python specifically, [here is a good summary][9] from a study that looked at how long it took to write code for strings processing in various languages. + + + ![](https://cdn-images-1.medium.com/max/800/1*cw7Oq54ZflGZhlFglDka4Q.png) + +How long it takes to write a string processing application in various languages. (Prechelt and Garret) + +Python is more than 2x as productive as Java in the above study. There are some other studies that show the same thing as well. Rosetta Code did a [fairly in-depth study][10] of the difference of programming languages. In the paper, they compare python to other scripting/interpreted languages and say: + +> Python tends to be the most concise, even against functional languages (1.2–1.6 times shorter on average) + +The common trend seems to be that “lines of code” is always less in Python. Lines of code might sound like a terrible metric, but [multiple studies][11], including the two already mentioned show that time spent per line of code is about the same in every language. Therefore, limiting the number of lines of code, increases productivity. Even the codinghorror himself (a C# programmer) [wrote an article on how Python is more productive][12]. + +I think it is fair to say that Python is more productive than many other languages. This is mainly due to the fact that python comes with “batteries included” and has many 3rd party libraries. [Here is a simple article talking about the differences between Python and X.][13] If you don’t know why Python is so “small” and productive, I invite you to take this opportunity to learn some python and see for yourself. Here is your first program: + + _import __hello___ + + + +* * * + +### But what if speed really does matter? + + + ![](https://cdn-images-1.medium.com/max/600/0*bg31_URKZ7xzWy5I.jpg) + +The tone of the points above might make it sound like optimization and speed don't matter at all. But the truth is, there are many times when runtime performance really does matter. One example is, you have a web application, and there is a specific endpoint that is taking a really long time to respond. You know how fast it needs to be, and how much it needs to be improved. + +In our example, a couple things happened: + +1. We noticed a single endpoint that was performing slowly +2. We recognize it as slow because we have a metric of what is considered  _fast enough_ , and it’s failing that metric. + +We don’t have to micro-optimize everything in an application. Everything only needs to be “fast enough”. Your users might notice if an endpoint takes a couple seconds to respond, but they won’t notice you improved the response time of a 35 ms call to 25 ms. “Good enough”, really is all you need to achieve.  _Disclaimer_ :  _I should probably state that there are _ _some _ _applications, such as real-time bidding applications, that _ _do _ _need micro optimizations, and every millisecond does matter. But that is the exception, not the rule._ + +In order to figure out how to optimize the endpoint your first step would be to profile the code and try to figure out where you bottleneck is. After all: + +> Any improvements made anywhere besides the bottleneck are an illusion. — Gene Kim + +If your optimizations aren’t touching the bottleneck, you’re wasting your time and not fixing the real issue. You wont get any serious improvements until you optimize the bottleneck. If you try to optimize before you know what the bottleneck is, you’ll just end up playing whack-a-mole with parts of your code. Optimizing code before you measure and determine where the bottleneck is, is known as “premature optimization”. Donald Knuth is often attributed for the following quote, but he claims he stole the quote from someone else: + +> _Premature optimization is the root of all evil._ + +In talking about maintaining code bases, the more full quote from Donald Knuth is: + +> We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. + +In other words, he is saying that most of the time, you need to forget about optimizing your code. Its almost always good enough. In the cases when it isn’t good enough, we typically only need to touch three percent of the code path. You don’t win any prizes by making your endpoint a couple nanoseconds faster because you used an if statement instead of a function for example. Optimize only after you measure. + +Premature optimization includes calling certain  _faster_  methods, or even using a specific data structure because it’s generally faster. Computer Science argues that if a method or algorithm has the same asymptotic growth (or Big-O) as another, then they are equivalent, even if one is 2x as slow in practice. Computers are so fast, that the computational growth of an algorithm as data/usage increases matters much more than the actual speed itself. In other words, if you have two  _O(log n)_  functions, but one is twice as slow, it doesn’t really matter. As the size of data increases, they both “slow down” at the same rate. This is why premature optimization is the root of all evil; It wastes our time, and almost never actually helps our general performance anyways. + +In terms of Big-O, you could argue that all languages are  _O(n) _ for your program where n is lines of code, or instructions. They all grow at the same rate for the same instructions. It doesn’t matter how slow a language/runtime is, in terms of asymptotic growth, all languages are created equal. Under this logic, you could say that choosing a language for your application simply because its “fast” is the ultimate form of premature optimization. Your choosing something supposedly fast without measuring, without understanding where the bottleneck is going to be. + +> Choosing a language for you application simply because its “fast” is the ultimate form of premature optimization. + + +* * * + + ![](https://cdn-images-1.medium.com/max/1000/0*6WaZOtaXLIo1Vy5H.png) + +### Optimizing Python + +One of my favorite things about Python is that it lets you optimize code a little bit at a time. Lets say you have a method in Python that you find to be your bottleneck. You have optimized it several times, possibly following some guidance from [here][14] and [there][15], and now you are at the point where you are pretty sure Python itself is the bottleneck. Python has the ability to call into C code, which means that you can rewrite this one method in C to reduce the performance issue. You can do this one method at a time. This process allows you to write well optimized bottleneck methods in any language that compiles to C compatible assembler. This allows you to stay in Python most of the time, and only go into the lower level things when you really need it. + +There is a language called Cython that is a super-set of Python. It is almost a merge of Python and C, and is a progressively typed language. Any Python code is valid Cython code, and Cython compiles to C code. With Cython, you can write a module or method, and slowly progress to more and more C-Types and performance. You can intermingle C types and Python’s duck types together. Using Cython you get the perfect mix of optimizing only at the bottleneck, and the beauty of Python everywhere else. + + + ![](https://cdn-images-1.medium.com/max/600/0*LStEb38q3d2sOffq.jpg) + +A screenshot of Eve online: A space MMO written in Python + +When you do eventually run into a Python wall of performance woes, you don't need to move your whole code base to a different language. You can almost always get the performance you need by just re-writing a couple methods in Cython. This is the strategy [Eve Online][16] takes. Eve is a Massive Multiplayer Computer Game, that uses Python and Cython for the entire stack. They achieve game level performance by optimizing the bottlenecks in C/Cython. If it works for them, it should work for most anyone. Alternatively, there are also other ways to optimize your python. For example, [PyPy][17] is a JIT implementation of Python that could give you significant runtime improvements for long running applications (such as a web server) simply by swapping out CPython (the default implementation) with PyPy. + + + ![](https://cdn-images-1.medium.com/max/1000/0*mPc5j1btWBFz6YK7.jpg) + +Lets review some of the main points: + +* Optimize for your most expensive resource. That’s YOU, not the computer. +* Choose a language/framework/architecture that helps you develop quickly (such as Python). Do not choose technologies simply because they are fast. +* When you do have performance issues: find your bottleneck +* Your bottleneck is most likely not CPU or Python itself. +* If Python is your bottleneck (you’ve already optimized algorithms/etc.), then move the hot-spot to Cython/C +* Go back to enjoying getting things done quickly + + +* * * + +I hope you enjoyed reading this article as much as I enjoyed writing it. If you’d like to say thank you, just hit the heart button. Also, if you’d like to talk to me about Python sometime, you can hit me up on twitter (@nhumrich) or I can be found on the [Python slack channel][18]. + + +-------------------------------------------------------------------------------- + +作者简介: + +I drink the KoolAid of Continuous Delivery and write tools to help us all get there. Python hacker, Technology fanatic. Currently a devops engineer @canopytax + +-------------- + +via: https://hackernoon.com/yes-python-is-slow-and-i-dont-care-13763980b5a1 + +作者:[Nick Humrich ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://hackernoon.com/@nhumrich +[1]:https://blog.codinghorror.com/the-infinite-space-between-words/ +[2]:https://static.googleusercontent.com/media/research.google.com/en//archive/sawzall-sciprog.pdf +[3]:https://www.codefellows.org/blog/5-reasons-why-python-is-powerful-enough-for-google/ +[4]:https://www.lynda.com/Python-tutorials/Python-Programming-Efficiently/534425-2.html +[5]:https://www.linuxjournal.com/article/3882 +[6]:https://www.codeschool.com/blog/2016/01/27/why-python/ +[7]:http://pythoncard.sourceforge.net/what_is_python.html +[8]:http://www.tcl.tk/doc/scripting.html +[9]:http://www.connellybarnes.com/documents/language_productivity.pdf +[10]:https://arxiv.org/pdf/1409.0252.pdf +[11]:http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.113.1831&rep=rep1&type=pdf +[12]:https://blog.codinghorror.com/are-all-programming-languages-the-same/ +[13]:https://www.python.org/doc/essays/comparisons/ +[14]:https://wiki.python.org/moin/PythonSpeed +[15]:https://wiki.python.org/moin/PythonSpeed/PerformanceTips +[16]:https://www.eveonline.com/ +[17]:http://pypy.org/ +[18]:http://pythondevelopers.herokuapp.com/ From 1516169fd0edea04216343f0c5e1bfd6897b5e9a Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:43:28 +0800 Subject: [PATCH 094/241] =?UTF-8?q?20170404-9=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20170320 Education of a Programmer.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/talk/20170320 Education of a Programmer.md diff --git a/sources/talk/20170320 Education of a Programmer.md b/sources/talk/20170320 Education of a Programmer.md new file mode 100644 index 0000000000..5690c0fd5c --- /dev/null +++ b/sources/talk/20170320 Education of a Programmer.md @@ -0,0 +1,155 @@ +Education of a Programmer +============================================================ + + _When I left Microsoft in October 2016 after almost 21 years there and almost 35 years in the industry, I took some time to reflect on what I had learned over all those years. This is a lightly edited version of that post. Pardon the length!_ + +There are an amazing number of things you need to know to be a proficient programmer — details of languages, APIs, algorithms, data structures, systems and tools. These things change all the time — new languages and programming environments spring up and there always seems to be some hot new tool or language that “everyone” is using. It is important to stay current and proficient. A carpenter needs to know how to pick the right hammer and nail for the job and needs to be competent at driving the nail straight and true. + +At the same time, I’ve found that there are some concepts and strategies that are applicable over a wide range of scenarios and across decades. We have seen multiple orders of magnitude change in the performance and capability of our underlying devices and yet certain ways of thinking about the design of systems still say relevant. These are more fundamental than any specific implementation. Understanding these recurring themes is hugely helpful in both the analysis and design of the complex systems we build. + +Humility and Ego + +This is not limited to programming, but in an area like computing which exhibits so much constant change, one needs a healthy balance of humility and ego. There is always more to learn and there is always someone who can help you learn it — if you are willing and open to that learning. One needs both the humility to recognize and acknowledge what you don’t know and the ego that gives you confidence to master a new area and apply what you already know. The biggest challenges I have seen are when someone works in a single deep area for a long time and “forgets” how good they are at learning new things. The best learning comes from actually getting hands dirty and building something, even if it is just a prototype or hack. The best programmers I know have had both a broad understanding of technology while at the same time have taken the time to go deep into some technology and become the expert. The deepest learning happens when you struggle with truly hard problems. + +End to End Argument + +Back in 1981, Jerry Saltzer, Dave Reed and Dave Clark were doing early work on the Internet and distributed systems and wrote up their [classic description][4] of the end to end argument. There is much misinformation out there on the Internet so it can be useful to go back and read the original paper. They were humble in not claiming invention — from their perspective this was a common engineering strategy that applies in many areas, not just in communications. They were simply writing it down and gathering examples. A minor paraphrasing is: + +When implementing some function in a system, it can be implemented correctly and completely only with the knowledge and participation of the endpoints of the system. In some cases, a partial implementation in some internal component of the system may be important for performance reasons. + +The SRC paper calls this an “argument”, although it has been elevated to a “principle” on Wikipedia and in other places. In fact, it is better to think of it as an argument — as they detail, one of the hardest problem for a system designer is to determine how to divide responsibilities between components of a system. This ends up being a discussion that involves weighing the pros and cons as you divide up functionality, isolate complexity and try to design a reliable, performant system that will be flexible to evolving requirements. There is no simple set of rules to follow. + +Much of the discussion on the Internet focuses on communications systems, but the end-to-end argument applies in a much wider set of circumstances. One example in distributed systems is the idea of “eventual consistency”. An eventually consistent system can optimize and simplify by letting elements of the system get into a temporarily inconsistent state, knowing that there is a larger end-to-end process that can resolve these inconsistencies. I like the example of a scaled-out ordering system (e.g. as used by Amazon) that doesn’t require every request go through a central inventory control choke point. This lack of a central control point might allow two endpoints to sell the same last book copy, but the overall system needs some type of resolution system in any case, e.g. by notifying the customer that the book has been backordered. That last book might end up getting run over by a forklift in the warehouse before the order is fulfilled anyway. Once you realize an end-to-end resolution system is required and is in place, the internal design of the system can be optimized to take advantage of it. + +In fact, it is this design flexibility in the service of either ongoing performance optimization or delivering other system features that makes this end-to-end approach so powerful. End-to-end thinking often allows internal performance flexibility which makes the overall system more robust and adaptable to changes in the characteristics of each of the components. This makes an end-to-end approach “anti-fragile” and resilient to change over time. + +An implication of the end-to-end approach is that you want to be extremely careful about adding layers and functionality that eliminates overall performance flexibility. (Or other flexibility, but performance, especially latency, tends to be special.) If you expose the raw performance of the layers you are built on, end-to-end approaches can take advantage of that performance to optimize for their specific requirements. If you chew up that performance, even in the service of providing significant value-add functionality, you eliminate design flexibility. + +The end-to-end argument intersects with organizational design when you have a system that is large and complex enough to assign whole teams to internal components. The natural tendency of those teams is to extend the functionality of those components, often in ways that start to eliminate design flexibility for applications trying to deliver end-to-end functionality built on top of them. + +One of the challenges in applying the end-to-end approach is determining where the end is. “Little fleas have lesser fleas… and so on ad infinitum.” + +Concentrating Complexity + +Coding is an incredibly precise art, with each line of execution required for correct operation of the program. But this is misleading. Programs are not uniform in the overall complexity of their components or the complexity of how those components interact. The most robust programs isolate complexity in a way that lets significant parts of the system appear simple and straightforward and interact in simple ways with other components in the system. Complexity hiding can be isomorphic with other design approaches like information hiding and data abstraction but I find there is a different design sensibility if you really focus on identifying where the complexity lies and how you are isolating it. + +The example I’ve returned to over and over again in my [writing][5] is the screen repaint algorithm that was used by early character video terminal editors like VI and EMACS. The early video terminals implemented control sequences for the core action of painting characters as well as additional display functions to optimize redisplay like scrolling the current lines up or down or inserting new lines or moving characters within a line. Each of those commands had different costs and those costs varied across different manufacturer’s devices. (See [TERMCAP][6] for links to code and a fuller history.) A full-screen application like a text editor wanted to update the screen as quickly as possible and therefore needed to optimize its use of these control sequences to transition the screen from one state to another. + +These applications were designed so this underlying complexity was hidden. The parts of the system that modify the text buffer (where most innovation in functionality happens) completely ignore how these changes are converted into screen update commands. This is possible because the performance cost of computing the optimal set of updates for  _any_  change in the content is swamped by the performance cost of actually executing the update commands on the terminal itself. It is a common pattern in systems design that performance analysis plays a key part in determining how and where to hide complexity. The screen update process can be asynchronous to the changes in the underlying text buffer and can be independent of the actual historical sequence of changes to the buffer. It is not important  _how_  the buffer changed, but only  _what_  changed. This combination of asynchronous coupling, elimination of the combinatorics of historical path dependence in the interaction between components and having a natural way for interactions to efficiently batch together are common characteristics used to hide coupling complexity. + +Success in hiding complexity is determined not by the component doing the hiding but by the consumers of that component. This is one reason why it is often so critical for a component provider to actually be responsible for at least some piece of the end-to-end use of that component. They need to have clear optics into how the rest of the system interacts with their component and how (and whether) complexity leaks out. This often shows up as feedback like “this component is hard to use” — which typically means that it is not effectively hiding the internal complexity or did not pick a functional boundary that was amenable to hiding that complexity. + +Layering and Componentization + +It is the fundamental role of a system designer to determine how to break down a system into components and layers; to make decisions about what to build and what to pick up from elsewhere. Open Source may keep money from changing hands in this “build vs. buy” decision but the dynamics are the same. An important element in large scale engineering is understanding how these decisions will play out over time. Change fundamentally underlies everything we do as programmers, so these design choices are not only evaluated in the moment, but are evaluated in the years to come as the product continues to evolve. + +Here are a few things about system decomposition that end up having a large element of time in them and therefore tend to take longer to learn and appreciate. + +* Layers are leaky. Layers (or abstractions) are [fundamentally leaky][1]. These leaks have consequences immediately but also have consequences over time, in two ways. One consequence is that the characteristics of the layer leak through and permeate more of the system than you realize. These might be assumptions about specific performance characteristics or behavior ordering that is not an explicit part of the layer contract. This means that you generally are more  _vulnerable_  to changes in the internal behavior of the component that you understood. A second consequence is it also means you are more  _dependent_  on that internal behavior than is obvious, so if you consider changing that layer the consequences and challenges are probably larger than you thought. +* Layers are too functional. It is almost a truism that a component you adopt will have more functionality than you actually require. In some cases, the decision to use it is based on leveraging that functionality for future uses. You adopt specifically because you want to “get on the train” and leverage the ongoing work that will go into that component. There are a few consequences of building on this highly functional layer. 1) The component will often make trade-offs that are biased by functionality that you do not actually require. 2) The component will embed complexity and constraints because of functionality you do not require and those constraints will impede future evolution of that component. 3) There will be more surface area to leak into your application. Some of that leakage will be due to true “leaky abstractions” and some will be explicit (but generally poorly controlled) increased dependence on the full capabilities of the component. Office is big enough that we found that for any layer we built on, we eventually fully explored its functionality in some part of the system. While that might appear to be positive (we are more completely leveraging the component), all uses are not equally valuable. So we end up having a massive cost to move from one layer to another based on this long-tail of often lower value and poorly recognized use cases. 4) The additional functionality creates complexity and opportunities for misuse. An XML validation API we used would optionally dynamically download the schema definition if it was specified as part of the XML tree. This was mistakenly turned on in our basic file parsing code which resulted in both a massive performance degradation as well as an (unintentional) distributed denial of service attack on a w3c.org web server. (These are colloquially known as “land mine” APIs.) +* Layers get replaced. Requirements evolve, systems evolve, components are abandoned. You eventually need to replace that layer or component. This is true for external component dependencies as well as internal ones. This means that the issues above will end up becoming important. +* Your build vs. buy decision will change. This is partly a corollary of above. This does not mean the decision to build or buy was wrong at the time. Often there was no appropriate component when you started and it only becomes available later. Or alternatively, you use a component but eventually find that it does not match your evolving requirements and your requirements are narrow enough, well-understood or so core to your value proposition that it makes sense to own it yourself. It does mean that you need to be just as concerned about leaky layers permeating more of the system for layers you build as well as for layers you adopt. +* Layers get thick. As soon as you have defined a layer, it starts to accrete functionality. The layer is the natural throttle point to optimize for your usage patterns. The difficulty with a thick layer is that it tends to reduce your ability to leverage ongoing innovation in underlying layers. In some sense this is why OS companies hate thick layers built on top of their core evolving functionality — the pace at which innovation can be adopted is inherently slowed. One disciplined approach to avoid this is to disallow any additional state storage in an adaptor layer. Microsoft Foundation Classes took this general approach in building on top of Win32\. It is inevitably cheaper in the short term to just accrete functionality on to an existing layer (leading to all the eventual problems above) rather than refactoring and recomponentizing. A system designer who understands this looks for opportunities to break apart and simplify components rather than accrete more and more functionality within them. + +Einsteinian Universe + +I had been designing asynchronous distributed systems for decades but was struck by this quote from Pat Helland, a SQL architect, at an internal Microsoft talk. “We live in an Einsteinian universe — there is no such thing as simultaneity. “ When building distributed systems — and virtually everything we build is a distributed system — you cannot hide the distributed nature of the system. It’s just physics. This is one of the reasons I’ve always felt Remote Procedure Call, and especially “transparent” RPC that explicitly tries to hide the distributed nature of the interaction, is fundamentally wrong-headed. You need to embrace the distributed nature of the system since the implications almost always need to be plumbed completely through the system design and into the user experience. + +Embracing the distributed nature of the system leads to a number of things: + +* You think through the implications to the user experience from the start rather than trying to patch on error handling, cancellation and status reporting as an afterthought. +* You use asynchronous techniques to couple components. Synchronous coupling is  _impossible._  If something appears synchronous, it’s because some internal layer has tried to hide the asynchrony and in doing so has obscured (but definitely not hidden) a fundamental characteristic of the runtime behavior of the system. +* You recognize and explicitly design for interacting state machines and that these states represent robust long-lived internal system states (rather than ad-hoc, ephemeral and undiscoverable state encoded by the value of variables in a deep call stack). +* You recognize that failure is expected. The only guaranteed way to detect failure in a distributed system is to simply decide you have waited “too long”. This naturally means that [cancellation is first-class][2]. Some layer of the system (perhaps plumbed through to the user) will need to decide it has waited too long and cancel the interaction. Cancelling is only about reestablishing local state and reclaiming local resources — there is no way to reliably propagate that cancellation through the system. It can sometimes be useful to have a low-cost, unreliable way to attempt to propagate cancellation as a performance optimization. +* You recognize that cancellation is not rollback since it is just reclaiming local resources and state. If rollback is necessary, it needs to be an end-to-end feature. +* You accept that you can never really know the state of a distributed component. As soon as you discover the state, it may have changed. When you send an operation, it may be lost in transit, it might be processed but the response is lost, or it may take some significant amount of time to process so the remote state ultimately transitions at some arbitrary time in the future. This leads to approaches like idempotent operations and the ability to robustly and efficiently rediscover remote state rather than expecting that distributed components can reliably track state in parallel. The concept of “[eventual consistency][3]” succinctly captures many of these ideas. + +I like to say you should “revel in the asynchrony”. Rather than trying to hide it, you accept it and design for it. When you see a technique like idempotency or immutability, you recognize them as ways of embracing the fundamental nature of the universe, not just one more design tool in your toolbox. + +Performance + +I am sure Don Knuth is horrified by how misunderstood his partial quote “Premature optimization is the root of all evil” has been. In fact, performance, and the incredible exponential improvements in performance that have continued for over 6 decades (or more than 10 decades depending on how willing you are to project these trends through discrete transistors, vacuum tubes and electromechanical relays), underlie all of the amazing innovation we have seen in our industry and all the change rippling through the economy as “software eats the world”. + +A key thing to recognize about this exponential change is that while all components of the system are experiencing exponential change, these exponentials are divergent. So the rate of increase in capacity of a hard disk changes at a different rate from the capacity of memory or the speed of the CPU or the latency between memory and CPU. Even when trends are driven by the same underlying technology, exponentials diverge. [Latency improvements fundamentally trail bandwidth improvements][7]. Exponential change tends to look linear when you are close to it or over short periods but the effects over time can be overwhelming. This overwhelming change in the relationship between the performance of components of the system forces reevaluation of design decisions on a regular basis. + +A consequence of this is that design decisions that made sense at one point no longer make sense after a few years. Or in some cases an approach that made sense two decades ago starts to look like a good trade-off again. Modern memory mapping has characteristics that look more like process swapping of the early time-sharing days than it does like demand paging. (This does sometimes result in old codgers like myself claiming that “that’s just the same approach we used back in ‘75” — ignoring the fact that it didn’t make sense for 40 years and now does again because some balance between two components — maybe flash and NAND rather than disk and core memory — has come to resemble a previous relationship). + +Important transitions happen when these exponentials cross human constraints. So you move from a limit of two to the sixteenth characters (which a single user can type in a few hours) to two to the thirty-second (which is beyond what a single person can type). So you can capture a digital image with higher resolution than the human eye can perceive. Or you can store an entire music collection on a hard disk small enough to fit in your pocket. Or you can store a digitized video recording on a hard disk. And then later the ability to stream that recording in real time makes it possible to “record” it by storing it once centrally rather than repeatedly on thousands of local hard disks. + +The things that stay as a fundamental constraint are three dimensions and the speed of light. We’re back to that Einsteinian universe. We will always have memory hierarchies — they are fundamental to the laws of physics. You will always have stable storage and IO, memory, computation and communications. The relative capacity, latency and bandwidth of these elements will change, but the system is always about how these elements fit together and the balance and tradeoffs between them. Jim Gray was the master of this analysis. + +Another consequence of the fundamentals of 3D and the speed of light is that much of performance analysis is about three things: locality, locality, locality. Whether it is packing data on disk, managing processor cache hierarchies, or coalescing data into a communications packet, how data is packed together, the patterns for how you touch that data with locality over time and the patterns of how you transfer that data between components is fundamental to performance. Focusing on less code operating on less data with more locality over space and time is a good way to cut through the noise. + +Jon Devaan used to say “design the data, not the code”. This also generally means when looking at the structure of a system, I’m less interested in seeing how the code interacts — I want to see how the data interacts and flows. If someone tries to explain a system by describing the code structure and does not understand the rate and volume of data flow, they do not understand the system. + +A memory hierarchy also implies we will always have caches — even if some system layer is trying to hide it. Caches are fundamental but also dangerous. Caches are trying to leverage the runtime behavior of the code to change the pattern of interaction between different components in the system. They inherently need to model that behavior, even if that model is implicit in how they fill and invalidate the cache and test for a cache hit. If the model is poor  _or becomes_  poor as the behavior changes, the cache will not operate as expected. A simple guideline is that caches  _must_  be instrumented — their behavior will degrade over time because of changing behavior of the application and the changing nature and balance of the performance characteristics of the components you are modeling. Every long-time programmer has cache horror stories. + +I was lucky that my early career was spent at BBN, one of the birthplaces of the Internet. It was very natural to think about communications between asynchronous components as the natural way systems connect. Flow control and queueing theory are fundamental to communications systems and more generally the way that any asynchronous system operates. Flow control is inherently resource management (managing the capacity of a channel) but resource management is the more fundamental concern. Flow control also is inherently an end-to-end responsibility, so thinking about asynchronous systems in an end-to-end way comes very naturally. The story of [buffer bloat][8]is well worth understanding in this context because it demonstrates how lack of understanding the dynamics of end-to-end behavior coupled with technology “improvements” (larger buffers in routers) resulted in very long-running problems in the overall network infrastructure. + +The concept of “light speed” is one that I’ve found useful in analyzing any system. A light speed analysis doesn’t start with the current performance, it asks “what is the best theoretical performance I could achieve with this design?” What is the real information content being transferred and at what rate of change? What is the underlying latency and bandwidth between components? A light speed analysis forces a designer to have a deeper appreciation for whether their approach could ever achieve the performance goals or whether they need to rethink their basic approach. It also forces a deeper understanding of where performance is being consumed and whether this is inherent or potentially due to some misbehavior. From a constructive point of view, it forces a system designer to understand what are the true performance characteristics of their building blocks rather than focusing on the other functional characteristics. + +I spent much of my career building graphical applications. A user sitting at one end of the system defines a key constant and constraint in any such system. The human visual and nervous system is not experiencing exponential change. The system is inherently constrained, which means a system designer can leverage ( _must_  leverage) those constraints, e.g. by virtualization (limiting how much of the underlying data model needs to be mapped into view data structures) or by limiting the rate of screen update to the perception limits of the human visual system. + +The Nature of Complexity + +I have struggled with complexity my entire career. Why do systems and apps get complex? Why doesn’t development within an application domain get easier over time as the infrastructure gets more powerful rather than getting harder and more constrained? In fact, one of our key approaches for managing complexity is to “walk away” and start fresh. Often new tools or languages force us to start from scratch which means that developers end up conflating the benefits of the tool with the benefits of the clean start. The clean start is what is fundamental. This is not to say that some new tool, platform or language might not be a great thing, but I can guarantee it will not solve the problem of complexity growth. The simplest way of controlling complexity growth is to build a smaller system with fewer developers. + +Of course, in many cases “walking away” is not an alternative — the Office business is built on hugely valuable and complex assets. With OneNote, Office “walked away” from the complexity of Word in order to innovate along a different dimension. Sway is another example where Office decided that we needed to free ourselves from constraints in order to really leverage key environmental changes and the opportunity to take fundamentally different design approaches. With the Word, Excel and PowerPoint web apps, we decided that the linkage with our immensely valuable data formats was too fundamental to walk away from and that has served as a significant and ongoing constraint on development. + +I was influenced by Fred Brook’s “[No Silver Bullet][9]” essay about accident and essence in software development. There is much irreducible complexity embedded in the essence of what the software is trying to model. I just recently re-read that essay and found it surprising on re-reading that two of the trends he imbued with the most power to impact future developer productivity were increasing emphasis on “buy” in the “build vs. buy” decision — foreshadowing the change that open-source and cloud infrastructure has had. The other trend was the move to more “organic” or “biological” incremental approaches over more purely constructivist approaches. A modern reader sees that as the shift to agile and continuous development processes. This in 1986! + +I have been much taken with the work of Stuart Kauffman on the fundamental nature of complexity. Kauffman builds up from a simple model of Boolean networks (“[NK models][10]”) and then explores the application of this fundamentally mathematical construct to things like systems of interacting molecules, genetic networks, ecosystems, economic systems and (in a limited way) computer systems to understand the mathematical underpinning to emergent ordered behavior and its relationship to chaotic behavior. In a highly connected system, you inherently have a system of conflicting constraints that makes it (mathematically) hard to evolve that system forward (viewed as an optimization problem over a rugged landscape). A fundamental way of controlling this complexity is to batch the system into independent elements and limit the interconnections between elements (essentially reducing both “N” and “K” in the NK model). Of course this feels natural to a system designer applying techniques of complexity hiding, information hiding and data abstraction and using loose asynchronous coupling to limit interactions between components. + +A challenge we always face is that many of the ways we want to evolve our systems cut across all dimensions. Real-time co-authoring has been a very concrete (and complex) recent example for the Office apps. + +Complexity in our data models often equates with “power”. An inherent challenge in designing user experiences is that we need to map a limited set of gestures into a transition in the underlying data model state space. Increasing the dimensions of the state space inevitably creates ambiguity in the user gesture. This is “[just math][11]” which means that often times the most fundamental way to ensure that a system stays “easy to use” is to constrain the underlying data model. + +Management + +I started taking leadership roles in high school (student council president!) and always found it natural to take on larger responsibilities. At the same time, I was always proud that I continued to be a full-time programmer through every management stage. VP of development for Office finally pushed me over the edge and away from day-to-day programming. I’ve enjoyed returning to programming as I stepped away from that job over the last year — it is an incredibly creative and fulfilling activity (and maybe a little frustrating at times as you chase down that “last” bug). + +Despite having been a “manager” for over a decade by the time I arrived at Microsoft, I really learned about management after my arrival in 1996\. Microsoft reinforced that “engineering leadership is technical leadership”. This aligned with my perspective and helped me both accept and grow into larger management responsibilities. + +The thing that most resonated with me on my arrival was the fundamental culture of transparency in Office. The manager’s job was to design and use transparent processes to drive the project. Transparency is not simple, automatic, or a matter of good intentions — it needs to be designed into the system. The best transparency comes by being able to track progress as the granular output of individual engineers in their day-to-day activity (work items completed, bugs opened and fixed, scenarios complete). Beware subjective red/green/yellow, thumbs-up/thumbs-down dashboards! + +I used to say my job was to design feedback loops. Transparent processes provide a way for every participant in the process — from individual engineer to manager to exec to use the data being tracked to drive the process and result and understand the role they are playing in the overall project goals. Ultimately transparency ends up being a great tool for empowerment — the manager can invest more and more local control in those closest to the problem because of confidence they have visibility to the progress being made. Coordination emerges naturally. + +Key to this is that the goal has actually been properly framed (including key resource constraints like ship schedule). Decision-making that needs to constantly flow up and down the management chain usually reflects poor framing of goals and constraints by management. + +I was at Beyond Software when I really internalized the importance of having a singular leader over a project. The engineering manager departed (later to hire me away for FrontPage) and all four of the leads were hesitant to step into the role — not least because we did not know how long we were going to stick around. We were all very technically sharp and got along well so we decided to work as peers to lead the project. It was a mess. The one obvious problem is that we had no strategy for allocating resources between the pre-existing groups — one of the top responsibilities of management! The deep accountability one feels when you know you are personally in charge was missing. We had no leader really accountable for unifying goals and defining constraints. + +I have a visceral memory of the first time I fully appreciated the importance of  _listening_  for a leader. I had just taken on the role of Group Development Manager for Word, OneNote, Publisher and Text Services. There was a significant controversy about how we were organizing the text services team and I went around to each of the key participants, heard what they had to say and then integrated and wrote up all I had heard. When I showed the write-up to one of the key participants, his reaction was “wow, you really heard what I had to say”! All of the largest issues I drove as a manager (e.g. cross-platform and the shift to continuous engineering) involved carefully listening to all the players. Listening is an active process that involves trying to understand the perspectives and then writing up what I learned and testing it to validate my understanding. When a key hard decision needed to happen, by the time the call was made everyone knew they had been heard and understood (whether they agreed with the decision or not). + +It was the previous job, as FrontPage development manager, where I internalized the “operational dilemma” inherent in decision making with partial information. The longer you wait, the more information you will have to make a decision. But the longer you wait, the less flexibility you will have to actually implement it. At some point you just need to make a call. + +Designing an organization involves a similar tension. You want to increase the resource domain so that a consistent prioritization framework can be applied across a larger set of resources. But the larger the resource domain, the harder it is to actually have all the information you need to make good decisions. An organizational design is about balancing these two factors. Software complicates this because characteristics of the software can cut across the design in an arbitrary dimensionality. Office has used [shared teams][12] to address both these issues (prioritization and resources) by having cross-cutting teams that can share work (add resources) with the teams they are building for. + +One dirty little secret you learn as you move up the management ladder is that you and your new peers aren’t suddenly smarter because you now have more responsibility. This reinforces that the organization as a whole better be smarter than the leader at the top. Empowering every level to own their decisions within a consistent framing is the key approach to making this true. Listening and making yourself accountable to the organization for articulating and explaining the reasoning behind your decisions is another key strategy. Surprisingly, fear of making a dumb decision can be a useful motivator for ensuring you articulate your reasoning clearly and make sure you listen to all inputs. + +Conclusion + +At the end of my interview round for my first job out of college, the recruiter asked if I was more interested in working on “systems” or “apps”. I didn’t really understand the question. Hard, interesting problems arise at every level of the software stack and I’ve had fun plumbing all of them. Keep learning. + +-------------------------------------------------------------------------------- + +via: https://hackernoon.com/education-of-a-programmer-aaecf2d35312 + +作者:[ Terry Crowley][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://hackernoon.com/@terrycrowley +[1]:https://medium.com/@terrycrowley/leaky-by-design-7b423142ece0#.x67udeg0a +[2]:https://medium.com/@terrycrowley/how-to-think-about-cancellation-3516fc342ae#.3pfjc5b54 +[3]:http://queue.acm.org/detail.cfm?id=2462076 +[4]:http://web.mit.edu/Saltzer/www/publications/endtoend/endtoend.pdf +[5]:https://medium.com/@terrycrowley/model-view-controller-and-loose-coupling-6370f76e9cde#.o4gnupqzq +[6]:https://en.wikipedia.org/wiki/Termcap +[7]:http://www.ll.mit.edu/HPEC/agendas/proc04/invited/patterson_keynote.pdf +[8]:https://en.wikipedia.org/wiki/Bufferbloat +[9]:http://worrydream.com/refs/Brooks-NoSilverBullet.pdf +[10]:https://en.wikipedia.org/wiki/NK_model +[11]:https://medium.com/@terrycrowley/the-math-of-easy-to-use-14645f819201#.untmk9eq7 +[12]:https://medium.com/@terrycrowley/breaking-conways-law-a0fdf8500413#.gqaqf1c5k From e0d95cabce691aba7955855465b77d834b360746 Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:49:50 +0800 Subject: [PATCH 095/241] =?UTF-8?q?20170404-10=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Introduction to functional programming.md | 252 ++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 sources/tech/20170403 Introduction to functional programming.md diff --git a/sources/tech/20170403 Introduction to functional programming.md b/sources/tech/20170403 Introduction to functional programming.md new file mode 100644 index 0000000000..ea2543e388 --- /dev/null +++ b/sources/tech/20170403 Introduction to functional programming.md @@ -0,0 +1,252 @@ +Introduction to functional programming +============================================================ + +> We explain what functional programming is, explore its benefits, and look at resources for learning functional programming. + + + ![Introduction to functional programming ](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/lightbulb_computer_person_general_.png?itok=ZY3UuQQa "Introduction to functional programming ") +Image by :  + +opensource.com + +Depending on whom you ask,  _functional programming_  (FP) is either an enlightened approach to programming that should be spread far and wide, or an overly academic approach to programming with few real-world benefits. In this article, I will explain what functional programming is, explore its benefits, and recommend resources for learning functional programming. + +### Syntax primer + +Code examples in this article are in the [Haskell][40] programming language. All that you need to understand for this article is the basic function syntax: + +``` + even :: Int -> Bool + even = ... -- implementation goes here +``` + +This defines a one-argument function named **even**. The first line is the  _type declaration_ , which says that **even** takes an **Int** and returns a **Bool**. The implementation follows and consists of one or more  _equations_ . We'll ignore the implementation (the name and type tell us enough): + +``` + map :: (a -> b) -> [a] -> [b] + map = ... +``` + +In this example, **map** is a function that takes two arguments: + +1. **(a -> b)**: a functions that turns an **a** into a **b** +2. **[a]**: a list of **a** + +and returns a list of **b**. Again, we don't care about the definition—the type is more interesting! **a** and **b** are  _type variables_  that could stand for any type. In the expression below, **a** is **Int** and **b** is **Bool**: + +``` +  map even [1,2,3] +``` + +It evaluates to a **[Bool]**: + +``` +  [False,True,False] +``` + +If you see other syntax that you do not understand, don't panic; full comprehension of the syntax is not essential. + +### Myths about functional programming + +Programming and development + +* [Our latest JavaScript articles][1] +* [Recent Perl posts][2] +* [New Python content][3] +* [Red Hat Developers Blog][4] +* [Tools for Red Hat Developers][5] + +Let's begin by dispelling common misconceptions: + +* Functional programming is not the rival or antithesis of imperative or object-oriented programming. This is a false dichotomy. +* Functional programming is not just the domain of academics. It is true that the history of functional programming is steeped in academia, and languages such as like Haskell and OCaml are popular research languages. But today many companies use functional programming for large-scale systems, small specialized programs, and everything in between. There's even an annual conference for [Commercial Users of Functional Programming][33]; past programs give an insight into how functional programming is being used in industry, and by whom. +* Functional programming has nothing to do with [monads][34], nor any other particular abstraction. For all the hand-wringing around this topic, monad is just an abstraction with laws. Some things are monads, others are not. +* Functional programming is not especially hard to learn. Some languages may have different syntax or evaluation semantics from those you already know, but these differences are superficial. There are dense concepts in functional programming, but this is also true of other approaches. + +### What is functional programming? + +At its core, functional programming is just programming with functions— _pure_  mathematical functions. The result of a function depends only on the arguments, and there are no side effects, such as I/O or mutation of state. Programs are built by combining functions together. One way of combining functions is  _function composition_ : + +``` + (.) :: (b -> c) -> (a -> b) -> (a -> c) + (g . f) x = g (f x) +``` + +This  _infix_  function combines two functions into one, applying **g** to the output of **f**. We'll see it used in an upcoming example. For comparison, the same function in Python looks like: + +``` + def compose(g, f): + return lambda x: g(f(x)) +``` + +The beauty of functional programming is that because functions are deterministic and have no side effects, you can always replace a function application with the result of the application. This substitution of equals for equals enables  _equational reasoning_ . Every programmer has to reason about their code and others', and equational reasoning is a great tool for doing that. Let's look at an example. You encounter the expression: + +``` +  map even . map (+1) +``` + +What does this program do? Can it be simplified? Equational reasoning lets you analyze the code through a series of substitutions: + +``` + map even . map (+1) + map (even . (+1)) -- from definition of 'map' + map (\x -> even (x + 1)) -- lambda abstraction + map odd -- from definition of 'even' +``` + +We can use equational reasoning to understand programs and optimize for readability. The Haskell compiler uses equational reasoning to perform many kinds of program optimizations. Without pure functions, equational reasoning either isn't possible, or requires an inordinate effort from the programmer. + +### Functional programming languages + +What do you need from a programming language to be able to do functional programming? + +Doing functional programming meaningfully in a language without  _higher-order functions_  (the ability to pass functions as arguments and return functions),  _lambdas_  (anonymous functions), and  _generics_  is difficult. Most modern languages have these, but there are differences in  _how well_  different languages support functional programming. The languages with the best support are called  _functional programming languages_ . These include  _Haskell_ ,  _OCaml_ ,  _F#_ , and  _Scala_ , which are statically typed, and the dynamically typed  _Erlang_  and  _Clojure_ . + +Even among functional languages there are big differences in how far you can exploit functional programming. Having a type system helps a lot, especially if it supports  _type inference_  (so you don't always have to type the types). There isn't room in this article to go into detail, but suffice it to say, not all type systems are created equal. + +As with all languages, different functional languages emphasize different concepts, techniques, or use cases. When choosing a language, considering how well it supports functional programming and whether it fits your use case is important. If you're stuck using some non-FP language, you will still benefit from applying functional programming to the extent the language supports it. + +### Don't open that trap door! + +Recall that the result of a function depends only on its inputs. Alas, almost all programming languages have "features" that break this assumption. Null values, type case (**instanceof**), type casting, exceptions, side-effects, and the possibility of infinite recursion are trap doors that break equational reasoning and impair a programmer's ability to reason about the behavior or correctness of a program. ( _Total languages_ , which do not have any trap doors, include Agda, Idris, and Coq.) + +Fortunately, as programmers, we can choose to avoid these traps, and if we are disciplined, we can pretend that the trap doors do not exist. This idea is called  _fast and loose reasoning_ . It costs nothing—almost any program can be written without using the trap doors—and by avoiding them you win back equational reasoning, composability and reuse. + +Let's discuss exceptions in detail. This trap door breaks equational reasoning because the possibility of abnormal termination is not reflected in the type. (Count yourself lucky if the documentation even mentions the exceptions that could be thrown.) But there is no reason why we can't have a return type that encompasses all the failure modes. + +Avoiding trap doors is an area in which language features can make a big difference. For avoiding exceptions,  _algebraic data types_  can be used to model error conditions, like so: + +``` + -- new data type for results of computations that can fail + -- + data Result e a = Error e | Success a + + -- new data type for three kinds of arithmetic errors + -- + data ArithError = DivByZero | Overflow | Underflow + + -- integer division, accounting for divide-by-zero + -- + safeDiv :: Int -> Int -> Result ArithError Int + safeDiv x y = + if y == 0 + then Error DivByZero + else Success (div x y) +``` + +The trade-off in this example is that you must now work with values of type **Result ArithError Int** instead of plain old **Int**, but there are abstractions for dealing with this. You no longer need to handle exceptions and can use fast and loose reasoning, so overall it's a win. + +### Theorems for free + +Most modern statically typed languages have  _generics_  (also called  _parametric polymorphism_ ), where functions are defined over one or more abstract types. For example, consider a function over lists: + +``` + f :: [a] -> [a] + f = ... +``` + +The same function in Java looks like: + +``` +  static List f(List xs) { ... } +``` + +The compiled program is a proof that this function will work with  _any_  choice for the type **a**. With that in mind, and employing fast and loose reasoning, can you work out what the function does? Does knowing the type help? + +In this case, the type doesn't tell us exactly what the function does (it could reverse the list, drop the first element, or many other things), but it does tell us a lot. Just from the type, we can derive theorems about the function: + +* **Theorem 1**: Every element in the output appears in the input; it couldn't possibly add an **a** to the list because it has no knowledge of what **a** is or how to construct one. +* **Theorem 2**: If you map any function over the list then apply **f**, the result is the same as applying **f** then mapping. + +Theorem 1 helps us understand what the code is doing, and Theorem 2 is useful for program optimization. We learned all this just from the type! This result—the ability to derive useful theorems from types—is called  _parametricity_ . It follows that a type is a partial (sometimes complete) specification of a function's behavior, and a kind of machine-checked documentation. + +Now it's your turn to exploit parametricity. What can you conclude from the types of **map** and **(.)**, or the following functions? + +* **foo :: a -> (a, a)** +* **bar :: a -> a -> a** +* **baz :: b -> a -> a** + +### Resources for learning functional programming + +Perhaps you have been convinced that functional programming is a better way to write software, and you are wondering how to get started? There are several approaches to learning functional programming; here are some I recommend (with, I admit, a strong bias toward Haskell): + +* UPenn's [CIS 194: Introduction to Haskell][35] is a solid introduction to functional programming concepts and real-world Haskell development. The course material is available, but the lectures are not (you could view Brisbane Functional Programming Group's [series of talks covering CIS 194][36] from a few years ago instead). +* Good introductory books include  _[Functional Programming in Scala][30]_ ,  _[Thinking Functionally with Haskell][31]_ , and  _[Haskell Programming from first principles][32]_ . +* The [Data61 FP course][37] (f.k.a.,  _NICTA_  course) teaches foundational abstractions and data structures through  _type-driven development_ . The payoff is huge, but it is  _difficult by design_ , having its origins in training workshops, so only attempt it if you know a functional programmer who is willing to mentor you. +* Start practicing functional programming in whatever code you're working on. Write pure functions (avoid non-determinism and mutation), use higher-order functions and recursion instead of loops, exploit parametricity for improved readability and reuse. Many people start out in functional programming by experimenting and experiencing the benefits in all kinds of languages. +* Join a functional programming user group or study group in your area—or start one—and look out for functional programming conferences (new ones are popping up all the time). + +### Conclusion + +In this article, I discussed what functional programming is and is not, and looked at advantages of functional programming, including equational reasoning and parametricity. We learned that you can do  _some_  functional programming in most programming languages, but the choice of language affects how much you can benefit, with  _functional programming languages_ , such as Haskell, having the most to offer. I also recommended resources for learning functional programming. + +Functional programming is a rich field and there are many deeper (and denser) topics awaiting exploration. I would be remiss not to mention a few that have practical implications, such as: + +* lenses and prisms (first-class, composable getters and setters; great for working with nested data); +* theorem proving (why test your code when you could  _prove it correct_  instead?); +* lazy evaluation (lets you work with potentially infinite data structures); +* and category theory (the origin of many beautiful and practical abstractions in functional programming). + +I hope that you have enjoyed this introduction to functional programming and are inspired to dive into this fun and practical approach to software development. + + _This article is published under the [CC BY 4.0][38] license._ + +-------------------------------------------------------------------------------- + +作者简介: + +Software Engineer at Red Hat. Interested in functional programming, category theory and other intersections of math and programming. Crazy about jalapeños. + +---------------------- + +via: https://opensource.com/article/17/4/introduction-functional-programming + +作者:[Fraser Tweedale ][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/frasertweedale +[1]:https://opensource.com/tags/javascript?src=programming_resource_menu +[2]:https://opensource.com/tags/perl?src=programming_resource_menu +[3]:https://opensource.com/tags/python?src=programming_resource_menu +[4]:https://developers.redhat.com/?intcmp=7016000000127cYAAQ&src=programming_resource_menu +[5]:https://developers.redhat.com/products/#developer_tools?intcmp=7016000000127cYAAQ&src=programming_resource_menu +[6]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Int +[7]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Int +[8]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Int +[9]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:div +[10]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:even +[11]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Int +[12]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:Bool +[13]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:even +[14]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[15]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[16]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[17]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:even +[18]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[19]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:even +[20]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[21]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[22]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:even +[23]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[24]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[25]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:even +[26]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[27]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:even +[28]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:map +[29]:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:odd +[30]:https://www.manning.com/books/functional-programming-in-scala +[31]:http://www.cambridge.org/gb/academic/subjects/computer-science/programming-languages-and-applied-logic/thinking-functionally-haskell +[32]:http://haskellbook.com/ +[33]:http://cufp.org/ +[34]:https://www.haskell.org/tutorial/monads.html +[35]:https://www.cis.upenn.edu/~cis194/fall16/ +[36]:https://github.com/bfpg/cis194-yorgey-lectures +[37]:https://github.com/data61/fp-course +[38]:https://creativecommons.org/licenses/by/4.0/ +[39]:https://opensource.com/article/17/4/introduction-functional-programming?rate=_tO5hNzT4hRKNMJtWwQM-K3Jmxm10iPeqoy3bbS12MQ +[40]:https://wiki.haskell.org/Introduction +[41]:https://opensource.com/user/123116/feed +[42]:https://opensource.com/users/frasertweedale From 7bddd76d4a1d6631900b141c13671afcd0cfbf2d Mon Sep 17 00:00:00 2001 From: Ezio Date: Tue, 4 Apr 2017 14:51:37 +0800 Subject: [PATCH 096/241] =?UTF-8?q?20170404-11=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cing Flashback an Internet mocking tool.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20170403 Introducing Flashback an Internet mocking tool.md diff --git a/sources/tech/20170403 Introducing Flashback an Internet mocking tool.md b/sources/tech/20170403 Introducing Flashback an Internet mocking tool.md new file mode 100644 index 0000000000..25e1328d9c --- /dev/null +++ b/sources/tech/20170403 Introducing Flashback an Internet mocking tool.md @@ -0,0 +1,209 @@ +Introducing Flashback, an Internet mocking tool +============================================================ + +> Flashback is designed to mock HTTP and HTTPS resources, like web services and REST APIs, for testing purposes. + + ![Introducing Flashback, an Internet mocking tool](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/OSDC_Internet_Cables_520x292_0614_RD.png?itok=U4sZjWv5 "Introducing Flashback, an Internet mocking tool") +>Image by : Opensource.com + +At LinkedIn, we often develop web applications that need to interact with third-party websites. We also employ automatic testing to ensure the quality of our software before it is shipped to production. However, a test is only as useful as it is reliable. + +With that in mind, it can be highly problematic for a test to have external dependencies, such as on a third-party website, for instance. These external sites may change without notice, suffer from downtime, or otherwise become temporarily inaccessible, as the Internet is not 100% reliable. + +If one of our tests relies on being able to communicate with a third-party website, the cause of any failures is hard to pinpoint. A failure could be due to an internal change at LinkedIn, an external change made by the maintainers of the third-party website, or an issue with the network infrastructure. As you can imagine, there are many reasons why interactions with a third-party website may fail, so you may wonder, how will I deal with this problem? + +The good news is that there are many Internet mocking tools that can help. One such tool is [Betamax][4]. It works by intercepting HTTP connections initiated by a web application and then later replaying them. For a test, Betamax can be used to replace any interaction over HTTP with previously recorded responses, which can be served very reliably. + +Initially, we chose to use Betamax in our test automation at LinkedIn. It worked quite well, but we ran into a few problems: + +* For security reasons, our test environment does not have Internet access; however, as with most proxies, Betamax requires an Internet connection to function properly. +* We have many use cases that require using authentication protocols, such as OAuth and OpenId. Some of these protocols require complex interactions over HTTP. In order to mock them, we needed a sophisticated model for capturing and replaying the requests. + +To address these challenges, we decided to build upon ideas established by Betamax and create our own Internet mocking tool, called Flashback. We are also proud to announce that Flashback is now open source. + +### What is Flashback? + +Flashback is designed to mock HTTP and HTTPS resources, like web services and [REST][5] APIs, for testing purposes. It records HTTP/HTTPS requests and plays back a previously recorded HTTP transaction—which we call a "scene"—so that no external connection to the Internet is required in order to complete testing. + +Flashback can also replay scenes based on the partial matching of requests. It does so using "match rules." A match rule associates an incoming request with a previously recorded request, which is then used to generate a response. For example, the following code snippet implements a basic match rule, where the test method "matches" an incoming request via [this URL][6]. + +HTTP requests generally contain a URL, method, headers, and body. Flashback allows match rules to be defined for any combination of these components. Flashback also allows users to add whitelist or blacklist labels to URL query parameters, headers, and the body. + +For instance, in an OAuth authorization flow, the request query parameters may look like the following: + +``` +oauth_consumer_key="jskdjfljsdklfjlsjdfs", +      oauth_nonce="ajskldfjalksjdflkajsdlfjasldfja;lsdkj", +oauth_signature="asdfjaklsdjflasjdflkajsdklf", +oauth_signature_method="HMAC-SHA1", +oauth_timestamp="1318622958", +oauth_token="asdjfkasjdlfajsdklfjalsdjfalksdjflajsdlfa", +oauth_version="1.0" +``` + +Many of these values will change with every request because OAuth requires clients to generate a new value for **oauth_nonce** every time. In our testing, we need to verify values of **oauth_consumer_key, oauth_signature_method**, and **oauth_version** while also making sure that **oauth_nonce**, **oauth_signature**, **oauth_timestamp**, and **oauth_token** exist in the request. Flashback gives us the ability to create our own match rules to achieve this goal. This feature lets us test requests with time-varying data, signatures, tokens, etc. without any changes on the client side. + +This flexible matching and the ability to function without connecting to the Internet are the attributes that separate Flashback from other mocking solutions. Some other notable features include: + +* Flashback is a cross-platform and cross-language solution, with the ability to test both JVM (Java Virtual Machine) and non-JVM (C++, Python, etc.) apps. +* Flashback can generate SSL/TLS certificates on the fly to emulate secured channels for HTTPS requests. + +### How to record an HTTP transaction + +Recording an HTTP transaction for later playback using Flashback is a relatively straightforward process. Before we dive into the procedure, let us first lay out some terminology: + +* A** Scene** stores previously recorded HTTP transactions (in JSON format) that can be replayed later. For example, here is one sample [Flashback scene][1].      +* The **Root Path** is the file path of the directory that contains the Flashback scene data. +* A **Scene Name** is the name of a given scene. +* A **Scene Mode** is the mode in which the scene is being used—either "record" or "playback." +* A **Match Rule** is a rule that determines if the incoming client request matches the contents of a given scene. +* **Flashback Proxy** is an HTTP proxy with two modes of operation, record and playback.  +* **Host** and **port** are the proxy host and port. + +In order to record a scene, you must make a real, external request to the destination, and the HTTPS request and response will then be stored in the scene with the match rule that you have specified. When recording, Flashback behaves exactly like a typical MITM (Man in the Middle) proxy—it is only in playback mode that the connection flow and data flow are restricted to just between the client and the proxy. + +To see Flashback in action, let us create a scene that captures an interaction with example.org by doing the following: + +1\. Check out the Flashback source code: + +``` +git clone https://github.com/linkedin/flashback.git +``` + +2\. Start the Flashback admin server: + +``` +./startAdminServer.sh -port 1234 +``` + +3\. Start the [Flashback Proxy][7]. Note the Flashback above will be started in record mode on localhost, port 5555\. The match rule requires an exact match (match HTTP body, headers, and URL). The scene will be stored under **/tmp/test1**. + +4\. Flashback is now ready to record, so use it to proxy a request to example.org: + +``` +curl http://www.example.org -x localhost:5555 -X GET +``` + +5\. Flashback can (optionally) record multiple requests in a single. To finish recording, [shut down Flashback][8]. + +6\. To verify what has been recorded, we can view the contents of the scene in the output directory (**/tmp/test1**). It should [contain the following][9]. + +It's also easy to [use Flashback in your Java code][10]. + +### How to replay an HTTP transaction + +To replay a previously stored scene, use the same basic setup as is used when recording; the only difference is that you [set the "Scene Mode" to "playback" in Step 3 above][11]. + +One way to verify that the response is from the scene, and not the external source, is to disable your Internet connectivity temporarily when you go through Steps 1 through 6\. Another way is to modify your scene file and see if the response is the same as what you have in the file. + +Here is [an example in Java][12]. + +### How to record and replay an HTTPS transaction + +The process for recording and replaying an HTTPS transaction with Flashback is very similar to that used for HTTP transactions. However, special care needs to be given to the security certificates used for the SSL component of HTTPS. In order for Flashback to act as a MITM proxy, creating a Certificate Authority (CA) certificate is necessary. This certificate will be used during the creation of the secure channel between the client and Flashback, and will allow Flashback to inspect the data in HTTPS requests it proxies. This certificate should then be stored as a trusted source so that the client will be able to authenticate Flashback when making calls to it. For instructions on how to create a certificate, there are many resources [like this one][13] that can be quite helpful. Most companies have their own internal policies for administering and securing certificates—be sure to follow yours. + +It is worth noting here that Flashback is intended to be used for testing purposes only. Feel free to integrate Flashback with your service whenever you need it, but note that the record feature of Flashback will need to store everything from the wire, then use it during the replay mode. We recommend that you pay extra attention to ensure that no sensitive member data is being recorded or stored inadvertently. Anything that may violate your company's data protection or privacy policy is your responsibility. + +Once the security certificate is accounted for, the only difference between HTTP and HTTPS in terms of setup for recording is the addition of a few further parameters. + +* **RootCertificateInputStream**: This can be either a stream or file path that indicates the CA certificate's filename. +* **RootCertificatePassphrase**: This is the passphrase created for the CA certificate. +* **CertificateAuthority**: These are the CA certificate's properties. + +[View the code used to record an HTTPS transaction][14] with Flashback, including the above terms. + +Replaying an HTTPS transaction with Flashback uses the same process as recording. The only difference is that the scene mode is set to "playback." This is demonstrated in [this code][15]. + +### Supporting dynamic changes + +In order to allow for flexibility in testing, Flashback lets you dynamically change scenes and match rules. Changing scenes dynamically allows for testing the same requests with different responses, such as success, **time_out**, **rate_limit**, etc. [Scene changes][16] only apply to scenarios where we have POSTed data to update the external resource. See the following diagram as an example. + + ![Scenarios where we have POSTed data to update the external resource.](https://opensource.com/sites/default/files/changingscenes.jpg "Scenarios where we have POSTed data to update the external resource.") + +Being able to [change the match rule][17] dynamically allows us to test complicated scenarios. For example, we have a use case that requires us to test HTTP calls to both public and private resources of Twitter. For public resources, the HTTP requests are constant, so we can use the "MatchAll" rule. However, for private resources, we need to sign requests with an OAuth consumer secret and an OAuth access token. These requests contain a lot of parameters that have unpredictable values, so the static MatchAll rule wouldn't work. + +### Use cases + +At LinkedIn, Flashback is mainly used for mocking different Internet providers in integration tests, as illustrated in the diagrams below. The first diagram shows an internal service inside a LinkedIn production data center interacting with Internet providers (such as Google) via a proxy layer. We want to test this internal service in a testing environment. + + ![Testing this internal service in a testing environment.](https://opensource.com/sites/default/files/testingenvironment.jpg "Testing this internal service in a testing environment.") + +The second and third diagrams show how we can record and playback scenes in different environments. Recording happens in our dev environment, where the user starts Flashback on the same port as the proxy started. All external requests from the internal service to providers will go through Flashback instead of our proxy layer. After the necessary scenes get recorded, we can deploy them to our test environment. + + ![After the necessary scenes get recorded, we can deploy them to our test environment.](https://opensource.com/sites/default/files/testenvironmentimage2.jpg "After the necessary scenes get recorded, we can deploy them to our test environment.") + +In the test environment (which is isolated and has no Internet access), Flashback is started on the same port as in the dev environment. All HTTP requests are still coming from the internal service, but the responses will come from Flashback instead of the Internet providers. + + ![Responses will come from Flashback instead of the Internet providers.](https://opensource.com/sites/default/files/flashbackresponsesimage.jpg "Responses will come from Flashback instead of the Internet providers.") + +### Future directions + +We'd like to see if we can support non-HTTP protocols, such as FTP or JDBC, in the future, and maybe even give users the flexibility to inject their own customized protocol using the MITM proxy framework. We will continue improving the Flashback setup API to make supporting non-Java languages easier. + +### Now available as an open source project + +We were fortunate enough to present Flashback at GTAC 2015\. At the show, several members of the audience asked if we would be releasing Flashback as an open source project so they could use it for their own testing efforts. + +### Google TechTalks: GATC 2015—Mock the Internet + + + +We're happy to announce that Flashback is now open source and is available under a BSD (Berkeley Software Distribution) two-clause license. To get started, visit the [Flashback GitHub repo][18]. + + _Originally posted on the [LinkedIn Engineering blog][2]. Reposted with permission._ + +### Acknowledgements + +Flashback was created by [Shangshang Feng][19], [Yabin Kang][20], and [Dan Vinegrad][21], and inspired by [Betamax][22]. Special thanks to [Hwansoo Lee][23], [Eran Leshem][24], [Kunal Kandekar][25], [Keith Dsouza][26], and [Kang Wang][27] for help with code reviews. We would also thank our management—[Byron Ma][28], [Yaz Shimizu][29], [Yuliya Averbukh][30], [Christopher Hazlett][31], and [Brandon Duncan][32]—for their support in the development and open sourcing of Flashback. + +-------------------------------------------------------------------------------- + +作者简介: + +Shangshang Feng - Shangshang is senior software engineer in LinkedIn's NYC office. He spent the last three and half years working on a gateway platform at LinkedIn. Before LinkedIn, he worked on infrastructure teams at Thomson Reuters and ViewTrade securities. + +--------- + +via: https://opensource.com/article/17/4/flashback-internet-mocking-tool + +作者:[ Shangshang Feng][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/shangshangfeng +[1]:https://gist.github.com/anonymous/17d226050d8a9b79746a78eda9292382 +[2]:https://engineering.linkedin.com/blog/2017/03/flashback-mocking-tool +[3]:https://opensource.com/article/17/4/flashback-internet-mocking-tool?rate=Jwt7-vq6jP9kS7gOT6f6vgwVlZupbyzWsVXX41ikmGk +[4]:https://github.com/betamaxteam/betamax +[5]:https://en.wikipedia.org/wiki/Representational_state_transfer +[6]:https://gist.github.com/anonymous/91637854364287b38897c0970aad7451 +[7]:https://gist.github.com/anonymous/2f5271191edca93cd2e03ce34d1c2b62 +[8]:https://gist.github.com/anonymous/f899ebe7c4246904bc764b4e1b93c783 +[9]:https://gist.github.com/sf1152/c91d6d62518fe62cc87157c9ce0e60cf +[10]:https://gist.github.com/anonymous/fdd972f1dfc7363f4f683a825879ce19 +[11]:https://gist.github.com/anonymous/ae1c519a974c3bc7de2a925254b6550e +[12]:https://gist.github.com/anonymous/edcc1d60847d51b159c8fd8a8d0a5f8b +[13]:https://jamielinux.com/docs/openssl-certificate-authority/introduction.html +[14]:https://gist.github.com/anonymous/091d13179377c765f63d7bf4275acc11 +[15]:https://gist.github.com/anonymous/ec6a0fd07aab63b7369bf8fde69c1f16 +[16]:https://gist.github.com/anonymous/1f1660280acb41277fbe2c257bab2217 +[17]:https://gist.github.com/anonymous/0683c43f31bd916b76aff348ff87f51b +[18]:https://github.com/linkedin/flashback +[19]:https://www.linkedin.com/in/shangshangfeng +[20]:https://www.linkedin.com/in/benykang +[21]:https://www.linkedin.com/in/danvinegrad/ +[22]:https://github.com/betamaxteam/betamax +[23]:https://www.linkedin.com/in/hwansoo/ +[24]:https://www.linkedin.com/in/eranl/ +[25]:https://www.linkedin.com/in/kunalkandekar/ +[26]:https://www.linkedin.com/in/dsouzakeith/ +[27]:https://www.linkedin.com/in/kang-wang-44960b4/ +[28]:https://www.linkedin.com/in/byronma/ +[29]:https://www.linkedin.com/in/yazshimizu/ +[30]:https://www.linkedin.com/in/yuliya-averbukh-818a41/ +[31]:https://www.linkedin.com/in/chazlett/ +[32]:https://www.linkedin.com/in/dudcat/ +[33]:https://opensource.com/user/125361/feed +[34]:https://opensource.com/users/shangshangfeng From 6d58387db6669a4333ef521af38d502eb45acfe7 Mon Sep 17 00:00:00 2001 From: mec2cod Date: Tue, 4 Apr 2017 15:02:53 +0800 Subject: [PATCH 097/241] translating 20170403 Yes Python is Slow and I Dont Care.md --- sources/tech/20170403 Yes Python is Slow and I Dont Care.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170403 Yes Python is Slow and I Dont Care.md b/sources/tech/20170403 Yes Python is Slow and I Dont Care.md index ae88755c41..6c355ad772 100644 --- a/sources/tech/20170403 Yes Python is Slow and I Dont Care.md +++ b/sources/tech/20170403 Yes Python is Slow and I Dont Care.md @@ -1,3 +1,5 @@ +translated by zhousiyu325 + Yes, Python is Slow, and I Don’t Care ============================================================ From eed7aa0efc3431a7e604fb111658dd02c9dc8799 Mon Sep 17 00:00:00 2001 From: trnhoe <446846115@qq.com> Date: Tue, 4 Apr 2017 15:22:54 +0800 Subject: [PATCH 098/241] trnhoe translating~ --- sources/tech/20170403 Introduction to functional programming.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20170403 Introduction to functional programming.md b/sources/tech/20170403 Introduction to functional programming.md index ea2543e388..fc3bfb34d9 100644 --- a/sources/tech/20170403 Introduction to functional programming.md +++ b/sources/tech/20170403 Introduction to functional programming.md @@ -1,3 +1,4 @@ +trnhoe translating~ Introduction to functional programming ============================================================ From bd52713c167bc4e1aad9e3e8beabfb8a2a4010ae Mon Sep 17 00:00:00 2001 From: sanfusu Date: Tue, 4 Apr 2017 18:34:31 +0800 Subject: [PATCH 099/241] translationg been finished --- .../tech/20150112 Data-Oriented Hash Table.md | 144 ------- ...ating]20150112 Data-Oriented Hash Table.md | 380 ++++++++++++++++++ 2 files changed, 380 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20150112 Data-Oriented Hash Table.md create mode 100644 translated/tech/[Translating]20150112 Data-Oriented Hash Table.md diff --git a/sources/tech/20150112 Data-Oriented Hash Table.md b/sources/tech/20150112 Data-Oriented Hash Table.md deleted file mode 100644 index 4bff30d51d..0000000000 --- a/sources/tech/20150112 Data-Oriented Hash Table.md +++ /dev/null @@ -1,144 +0,0 @@ -Translating by sanfusu - -[Data-Oriented Hash Table][1] -============================================================ - -In recent years, there’s been a lot of discussion and interest in “data-oriented design”—a programming style that emphasizes thinking about how your data is laid out in memory, how you access it and how many cache misses it’s going to incur. With memory reads taking orders of magnitude longer for cache misses than hits, the number of misses is often the key metric to optimize. It’s not just about performance-sensitive code—data structures designed without sufficient attention to memory effects may be a big contributor to the general slowness and bloatiness of software. - -The central tenet of cache-efficient data structures is to keep things flat and linear. For example, under most circumstances, to store a sequence of items you should prefer a flat array over a linked list—every pointer you have to chase to find your data adds a likely cache miss, while flat arrays can be prefetched and enable the memory system to operate at peak efficiency. - -This is pretty obvious if you know a little about how the memory hierarchy works—but it’s still a good idea to test things sometimes, even if they’re “obvious”! [Baptiste Wicht tested `std::vector` vs `std::list` vs `std::deque`][4] (the latter of which is commonly implemented as a chunked array, i.e. an array of arrays) a couple of years ago. The results are mostly in line with what you’d expect, but there are a few counterintuitive findings. For instance, inserting or removing values in the middle of the sequence—something lists are supposed to be good at—is actually faster with an array, if the elements are a POD type and no bigger than 64 bytes (i.e. one cache line) or so! It turns out to actually be faster to shift around the array elements on insertion/removal than to first traverse the list to find the right position and then patch a few pointers to insert/remove one element. That’s because of the many cache misses in the list traversal, compared to relatively few for the array shift. (For larger element sizes, non-POD types, or if you already have a pointer into the list, the list wins, as you’d expect.) - -Thanks to data like Baptiste’s, we know a good deal about how memory layout affects sequence containers. But what about associative containers, i.e. hash tables? There have been some expert recommendations: [Chandler Carruth tells us to use open addressing with local probing][5] so that we don’t have to chase pointers, and [Mike Acton suggests segregating keys from values][6] in memory so that we get more keys per cache line, improving locality when we have to look at multiple keys. These ideas make good sense, but again, it’s a good idea to test things, and I couldn’t find any data. So I had to collect some of my own! - -### [][7]The Tests - -I tested four different quick-and-dirty hash table implementations, as well as `std::unordered_map`. All five used the same hash function, Bob Jenkins’ [SpookyHash][8] with 64-bit hash values. (I didn’t test different hash functions, as that wasn’t the point here; I’m also not looking at total memory consumption in my analysis.) The implementations are identified by short codes in the results tables: - -* **UM**: `std::unordered_map`. In both VS2012 and libstdc++-v3 (used by both gcc and clang), UM is implemented as a linked list containing all the elements, and an array of buckets that store iterators into the list. In VS2012, it’s a doubly-linked list and each bucket stores both begin and end iterators; in libstdc++, it’s a singly-linked list and each bucket stores just a begin iterator. In both cases, the list nodes are individually allocated and freed. Max load factor is 1. -* **Ch**: separate chaining—each bucket points to a singly-linked list of element nodes. The element nodes are stored in a flat array pool, to avoid allocating each node individually. Unused nodes are kept on a free list. Max load factor is 1. -* **OL**: open addressing with linear probing—each bucket stores a 62-bit hash, a 2-bit state (empty, filled, or removed), key, and value. Max load factor is 2/3. -* **DO1**: “data-oriented 1”—like OL, but the hashes and states are segregated from the keys and values, in two separate flat arrays. -* **DO2**: “data-oriented 2”—like OL, but the hashes/states, keys, and values are segregated in three separate flat arrays. - -All my implementations, as well as VS2012’s UM, use power-of-2 sizes by default, growing by 2x upon exceeding their max load factor. In libstdc++, UM uses prime-number sizes by default and grows to the next prime upon exceeding its max load factor. However, I don’t think these details are very important for performance. The prime-number thing is a hedge against poor hash functions that don’t have enough entropy in their lower bits, but we’re using a good hash function. - -The OL, DO1 and DO2 implementations will collectively be referred to as OA (open addressing), since we’ll find later that their performance characteristics are often pretty similar. - -For each of these implementations, I timed several different operations, at element counts from 100K to 1M and for payload sizes (i.e. total key+value size) from 8 to 4K bytes. For my purposes, keys and values were always POD types and keys were always 8 bytes (except for the 8-byte payload, in which key and value were 4 bytes each). I kept the keys to a consistent size because my purpose here was to test memory effects, not hash function performance. Each test was repeated 5 times and the minimum timing was taken. - -The operations tested were: - -* **Fill**: insert a randomly shuffled sequence of unique keys into the table. -* **Presized fill**: like Fill, but first reserve enough memory for all the keys we’ll insert, to prevent rehashing and reallocing during the fill process. -* **Lookup**: perform 100K lookups of random keys, all of which are in the table. -* **Failed lookup**: perform 100K lookups of random keys, none of which are in the table. -* **Remove**: remove a randomly chosen half of the elements from a table. -* **Destruct**: destroy a table and free its memory. - -You can [download my test code here][9]. It builds for Windows or Linux, in 64-bit only. There are some flags near the top of `main()` that you can toggle to turn on or off different tests—with all of them on, it will likely take an hour or two to run. The results I gathered are also included, in an Excel spreadsheet in that archive. (Beware that the Windows and Linux results are run on different CPUs, so timings aren’t directly comparable.) The code also runs unit tests to verify that all the hash table implementations are behaving correctly. - -Incidentally, I also tried two additional implementations: separate chaining with the first node stored in the bucket instead of the pool, and open addressing with quadratic probing. Neither of these was good enough to include in the final data, but the code for them is still there. - -### [][10]The Results - -There’s a ton of data here. In this section I’ll discuss the results in some detail, but if your eyes are glazing over in this part, feel free to skip down to the conclusions in the next section. - -### [][11]Windows - -Here are the graphed results of all the tests, compiled with Visual Studio 2012, and run on Windows 8.1 on a Core i7-4710HQ machine. (Click to zoom.) - -[ - ![Results for VS 2012, Windows 8.1, Core i7-4710HQ](http://reedbeta.com/blog/data-oriented-hash-table/results-vs2012.png "Results for VS 2012, Windows 8.1, Core i7-4710HQ") -][12] - -From left to right are different payload sizes, from top to bottom are the various operations, and each graph plots time in milliseconds versus hash table element count for each of the five implementations. (Note that not all the Y-axes have the same scale!) I’ll summarize the main trends for each operation. - -**Fill**: Among my hash tables, chaining is a bit better than any of the OA variants, with the gap widening at larger payloads and table sizes. I guess this is because chaining only has to pull an element off the free list and stick it on the front of its bucket, while OA may have to search a few buckets to find an empty one. The OA variants perform very similarly to each other, but DO1 appears to have a slight advantage. - -All of my hash tables beat UM by quite a bit at small payloads, where UM pays a heavy price for doing a memory allocation on every insert. But they’re about equal at 128 bytes, and UM wins by quite a bit at large payloads: there, all of my implementations are hamstrung by the need to resize their element pool and spend a lot of time moving the large elements into the new pool, while UM never needs to move elements once they’re allocated. Notice the extreme “steppy” look of the graphs for my implementations at large payloads, which confirms that the problem comes when resizing. In contrast, UM is quite linear—it only has to resize its bucket array, which is cheap enough not to make much of a bump. - -**Presized fill**: Generally similar to Fill, but the graphs are more linear, not steppy (since there’s no rehashing), and there’s less difference between all the implementations. UM is still slightly faster than chaining at large payloads, but only slightly—again confirming that the problem with Fill was the resizing. Chaining is still consistently faster than the OA variants, but DO1 has a slight advantage over the other OAs. - -**Lookup**: All the implementations are closely clustered, with UM and DO2 the front-runners, except at the smallest payload, where it seems like DO1 and OL may be faster. It’s impressive how well UM is doing here, actually; it’s holding its own against the data-oriented variants despite needing to traverse a linked list. - -Incidentally, it’s interesting to see that the lookup time weakly depends on table size. Hash table lookup is expected constant-time, so from the asymptotic view it shouldn’t depend on table size at all. But that’s ignoring cache effects! When we do 100K lookups on a 10K-entry table, for instance, we’ll get a speedup because most of the table will be in L3 after the first 10K–20K lookups. - -**Failed lookup**: There’s a bit more spread here than the successful lookups. DO1 and DO2 are the front-runners, with UM not far behind, and OL a good deal worse than the rest. My guess is this is probably a case of OL having longer searches on average, especially in the case of a failed lookup; with the hash values spaced out in memory between keys and values, that hurts. DO1 and DO2 have equally-long searches, but they have all the hash values packed together in memory, and that turns things around. - -**Remove**: DO2 is the clear winner, with DO1 not far behind, chaining further behind, and UM in a distant last place due to the need to free memory on every remove; the gap widens at larger payloads. The remove operation is the only one that doesn’t touch the value data, only the hashes and keys, which explains why DO1 and DO2 are differentiated from each other here but pretty much equal in all the other tests. (If your value type was non-POD and needed to run a destructor, that difference would presumably disappear.) - -**Destruct**: Chaining is the fastest except at the smallest payload, where it’s about equal to the OA variants. All the OA variants are essentially equal. Note that for my hash tables, all they’re doing on destruction is freeing a handful of memory buffers, but [on Windows, freeing memory has a cost proportional to the amount allocated][13]. (And it’s a significant cost—an allocation of ~1 GB is taking ~100 ms to free!) - -UM is the slowest to destruct—by an order of magnitude at small payloads, and only slightly slower at large payloads. The need to free each individual element instead of just freeing a couple of arrays really hurts here. - -### [][14]Linux - -I also ran tests with gcc 4.8 and clang 3.5, on Linux Mint 17.1 on a Core i5-4570S machine. The gcc and clang results were very similar, so I’ll only show the gcc ones; the full set of results are in the code download archive, linked above. (Click to zoom.) - -[ - ![Results for g++ 4.8, Linux Mint 17.1, Core i5-4570S](http://reedbeta.com/blog/data-oriented-hash-table/results-g++4.8.png "Results for g++ 4.8, Linux Mint 17.1, Core i5-4570S") -][15] - -Most of the results are quite similar to those in Windows, so I’ll just highlight a few interesting differences. - -**Lookup**: Here, DO1 is the front-runner, where DO2 was a bit faster on Windows. Also, UM and chaining are way behind all the other implementations, which is actually what I expected to see in Windows as well, given that they have to do a lot of pointer chasing while the OA variants just stride linearly through memory. It’s not clear to me why the Windows and Linux results are so different here. UM is also a good deal slower than chaining, especially at large payloads, which is odd; I’d expect the two of them to be about equal. - -**Failed lookup**: Again, UM is way behind all the others, even slower than OL. Again, it’s puzzling to me why this is so much slower than chaining, and why the results differ so much between Linux and Windows. - -**Destruct**: For my implementations, the destruct cost was too small to measure at small payloads; at large payloads, it grows quite linearly with table size—perhaps proportional to the number of virtual memory pages touched, rather than the number allocated? It’s also orders of magnitude faster than the destruct cost on Windows. However, this isn’t anything to do with hash tables, really; we’re seeing the behavior of the respective OSes’ and runtimes’ memory systems here. It seems that Linux frees large blocks memory a lot faster than Windows (or it hides the cost better, perhaps deferring work to process exit, or pushing things off to another thread or process). - -UM with its per-element frees is now orders of magnitude slower than all the others, across all payload sizes. In fact, I cut it from the graphs because it was screwing up the Y-axis scale for all the others. - -### [][16]Conclusions - -Well, after staring at all that data and the conflicting results for all the different cases, what can we conclude? I’d love to be able to tell you unequivocally that one of these hash table variants beats out the others, but of course it’s not that simple. Still, there is some wisdom we can take away. - -First, in many cases it’s  _easy_  to do better than `std::unordered_map`. All of the implementations I built for these tests (and they’re not sophisticated; it only took me a couple hours to write all of them) either matched or improved upon `unordered_map`, except for insertion performance at large payload sizes (over 128 bytes), where `unordered_map`‘s separately-allocated per-node storage becomes advantageous. (Though I didn’t test it, I also expect `unordered_map` to win with non-POD payloads that are expensive to move.) The moral here is that if you care about performance at all, don’t assume the data structures in your standard library are highly optimized. They may be optimized for C++ standard conformance, not performance. :P - -Second, you could do a lot worse than to just use DO1 (open addressing, linear probing, with the hashes/states segregated from keys/values in separate flat arrays) whenever you have small, inexpensive payloads. It’s not the fastest for insertion, but it’s not bad either (still way better than `unordered_map`), and it’s very fast for lookup, removal, and destruction. What do you know—“data-oriented design” works! - -Note that my test code for these hash tables is far from production-ready—they only support POD types, don’t have copy constructors and such, don’t check for duplicate keys, etc. I’ll probably build some more realistic hash tables for my utility library soon, though. To cover the bases, I think I’ll want two variants: one based on DO1, for small, cheap-to-move payloads, and another that uses chaining and avoids ever reallocating and moving elements (like `unordered_map`) for large or expensive-to-move payloads. That should give me the best of both worlds. - -In the meantime, I hope this has been illuminating. And remember, if Chandler Carruth and Mike Acton give you advice about data structures, listen to them. 😉 - --------------------------------------------------------------------------------- - - -作者简介: - -I’m a graphics programmer, currently freelancing in Seattle. Previously I worked at NVIDIA on the DevTech software team, and at Sucker Punch Productions developing rendering technology for the Infamous series of games for PS3 and PS4. - -I’ve been interested in graphics since about 2002 and have worked on a variety of assignments, including fog, atmospheric haze, volumetric lighting, water, visual effects, particle systems, skin and hair shading, postprocessing, specular models, linear-space rendering, and GPU performance measurement and optimization. - -You can read about what I’m up to on my blog. In addition to graphics, I’m interested in theoretical physics, and in programming language design. - -You can contact me at nathaniel dot reed at gmail dot com, or follow me on Twitter (@Reedbeta) or Google+. I can also often be found answering questions at Computer Graphics StackExchange. - --------------- - -via: http://reedbeta.com/blog/data-oriented-hash-table/ - -作者:[Nathan Reed][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://reedbeta.com/about/ -[1]:http://reedbeta.com/blog/data-oriented-hash-table/ -[2]:http://reedbeta.com/blog/category/coding/ -[3]:http://reedbeta.com/blog/data-oriented-hash-table/#comments -[4]:http://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-deque.html -[5]:https://www.youtube.com/watch?v=fHNmRkzxHWs -[6]:https://www.youtube.com/watch?v=rX0ItVEVjHc -[7]:http://reedbeta.com/blog/data-oriented-hash-table/#the-tests -[8]:http://burtleburtle.net/bob/hash/spooky.html -[9]:http://reedbeta.com/blog/data-oriented-hash-table/hash-table-tests.zip -[10]:http://reedbeta.com/blog/data-oriented-hash-table/#the-results -[11]:http://reedbeta.com/blog/data-oriented-hash-table/#windows -[12]:http://reedbeta.com/blog/data-oriented-hash-table/results-vs2012.png -[13]:https://randomascii.wordpress.com/2014/12/10/hidden-costs-of-memory-allocation/ -[14]:http://reedbeta.com/blog/data-oriented-hash-table/#linux -[15]:http://reedbeta.com/blog/data-oriented-hash-table/results-g++4.8.png -[16]:http://reedbeta.com/blog/data-oriented-hash-table/#conclusions diff --git a/translated/tech/[Translating]20150112 Data-Oriented Hash Table.md b/translated/tech/[Translating]20150112 Data-Oriented Hash Table.md new file mode 100644 index 0000000000..c7f1485bab --- /dev/null +++ b/translated/tech/[Translating]20150112 Data-Oriented Hash Table.md @@ -0,0 +1,380 @@ +Translating by sanfusu + +[面向数据的哈希表][1] +============================================================ + + +最近几年中,面向数据的设计已经受到了很多的关注 —— 一种强调内存中数据布局的编程风格,包括如何访问以及将会引发多少的 cache 缺失。 + +由于在内存读取操作中缺失所占的数量级要大于命中的数量级,所以缺失的数量通常是优化的关键标准。 + + 这不仅仅关乎那些对性能有要求的 code-data 结构设计的软件,由于缺乏对内存效益的重视而成为软件运行缓慢、膨胀的一个很大因素。 + + + +高效缓存数据结构的中心原则是将事情变得平滑和线性。 +比如,在大部分情况下,存储一个序列元素更倾向于使用平滑的数组而不是链表 —— 每一次通过指针来查找数据都会为 cache 缺失增加一份风险;而平滑的数组可以预先获取,并使得内存系统以最大的效率运行 + + + +如果你知道一点内存层级如何运作的知识,下面的内容会是想当然的结果——但是有时候即便他们相当明显,测试一下任不失为一个好主意。 +[Baptiste Wicht 测试过了 `std::vector` vs `std::list` vs `std::deque`][4] +(几年前,后者通常使用分块数组来实现,比如:一个数组的数组) +结果大部分会和你预期的保持一致,但是会存在一些违反直觉的东西。 +作为实例:在序列链表的中间位置做插入或者移除操作被认为会比数组快 +但如果该元素是一个 POD 类型,并且不大于 64 字节或者在 64 字节左右(在一个 cache 流水线内), +通过对要操作的元素周围的数组元素进行移位操作要比从头遍历链表来的快。 +这是由于在遍历链表以及通过指针插入/删除元素的时候可能会导致不少的 cache 缺失,相对而言,数组移位则很少会发生。 +(对于更大的元素,非 POD 类型,或者你你已经有了指向链表元素的指针,此时和预期的一样,链表胜出) + + + + +多亏了 Baptiste 的数据,我们知道了内存布局如何影响序列容器。 + +但是关联容器,比如 hash 表会怎么样呢? + +已经有了些权威推荐: + +[Chandler Carruth 推荐的带局部探测的开放寻址][5] + +(此时,我们没必要追踪指针) + +以及[Mike Acton 推荐的在内存中将 value 和 key 隔离][6](这种情况下,我们可以在每一个 cache 流水线中得到更多的 key), 这可以在我们不得查找多个 key 时提高局部性能。 + + +这些想法很有意义,但再一次的说明:测试永远是好习惯,但由于我找不到任何数据,所以只好自己收集了。 + + +### [][7]测试 + + +我测试了四个不同的 quick-and-dirty 哈希表实现,另外还包括 `std::unordered_map` 。 +这五个哈希表都使用了同一个哈希函数 —— Bob Jenkins' [SpookyHash][8](64 位哈希值)。 +(由于哈希函数在这里不是重点,所以我没有测试不同的哈希函数;我同样也没有检测我的分析中的总内存消耗。) +实现会通过短代码在测试结果表中标注出来。 + +* **UM**: `std::unordered_map` 。 +在 VS2012 和 libstdc++-v3 (libstdc++-v3: gcc 和 clang 都会用到这东西)中, +UM 是以链接表的形式实现,所有的元素都在链表中,buckets 数组中存储了链表的迭代器。 +VS2012 中,则是一个双链表,每一个 bucket 存储了起始迭代器和结束迭代器; +libstdc++ 中,是一个单链表,每一个 bucket 只存储了一个起始迭代器。 +这两种情况里,链表节点是独立申请和释放的。最大负载因子是 1 。 + +* **Ch**: +分离的、链状 buket 指向一个元素节点的单链表。 +为了避免分开申请每一个节点,元素节点存储在平滑的数组池中。 +未使用的节点保存在一个空闲链表中。 +最大负载因子是 1。 + +* **OL**: +开地址线性探测 —— 每一个 bucket 存储一个 62 bit 的 hash 值,一个 2 bit 的状态值(包括 empty,filled,removed 三个状态),key 和 vale 。最大负载因子是 2/3。 +* **DO1**: +data-oriented 1 —— 和 OL 相似,但是哈希值、状态值和 key、values 分离在两个隔离的平滑数组中。 + +* **DO2**: +"data-oriented 2" —— 与 OL 类似,但是哈希/状态,keys 和 values 被分离在 3 个相隔离的平滑数组中。 + + +在我的所有实现中,包括 VS2012 的 UM 实现,默认使用尺寸为 2 的 n 次方。如果超出了最大负载因子,则扩展两倍。 + +在 libstdc++ 中,UM 默认尺寸是一个素数。如果超出了最大负载因子,则扩展为下一个素数大小。 + +但是我不认为这些细节对性能很重要。 + +素数是一种对低 bit 位上没有足够熵的低劣 hash 函数的挽救手段,但是我们正在用的是一个很好的 hash 函数。 + + +OL,DO1 和 DO2 的实现将共同的被称为 OA(open addressing)——稍后我们将发现他们在性能特性上非常相似。 + +在每一个实现中,单元数从 100 K 到 1 M,有效负载(比如:总的 key + value 大小)从 8 到 4 k 字节 +我为几个不同的操作记了时间。 + + keys 和 values 永远是 POD 类型,keys 永远是 8 个字节(除了 8 字节的有效负载,此时 key 和 value 都是 4 字节) + +因为我的目的是为了测试内存影响而不是哈希函数性能,所以我将 key 放在连续的尺寸空间中。 +每一个测试都会重复 5 遍,然后记录最小的耗时。 + + +测试的操作在这里: + +* **Fill**: +将一个随机的 key 序列插入到表中(key 在序列中是唯一的)。 +* **Presized fill**: +和 Fill 相似,但是在插入之间我们先为所有的 key 保留足够的内存空间,以防止在 fill 过程中 rehash 或者重申请。 +* **Lookup**: +执行 100 k 随机 key 查找,所有的 key 都在 table 中。 +* **Failed lookup**: +执行 100 k 随机 key 查找,所有的 key 都不在 table 中。 +* **Remove**: +从 table 中移除随机选择的半数元素。 +* **Destruct**: +销毁 table 并释放内存. + + +你可以[在这里下载我的测试代码][9]。 + +这些代码只能在 64 机器上编译(包括Windows和Linux)。 + +在 `main()` 函数附件有一些标记,你可把他们打开或者关掉——如果全开,可能会需要一两个小时才能结束运行。 + +我搜集的结果也放在了那个打包文件里的 Excel 表中。 + +(注意: Windows 和 Linux 在不同的 CPU 上跑的,所以时间不具备可比较性) + +代码也跑了一些单元测试,用来验证所有的 hash 表实现都能运行正确。 + + +我还顺带尝试了附加的两个实现: + +Ch 中第一个节点存放在 bucket 中而不是 pool 里,二次探测的开放寻址。 + +这两个都不足以好到可以放在最终的数据里,但是他们的代码仍放在了打包文件里面。 + +### [][10]结果 + + +这里有成吨的数据!! + +这一节我将详细的讨论一下结果,但是如果你对此不感兴趣,可以直接跳到下一节的总结。 + +### [][11]Windows + + +这是所有的测试的图表结果,使用 Visual Studio 2012 编译,运行于 Windows8.1 和 Core i7-4710HQ 机器上。(点击可以放大。) + +[ + ![Results for VS 2012, Windows 8.1, Core i7-4710HQ](http://reedbeta.com/blog/data-oriented-hash-table/results-vs2012.png "Results for VS 2012, Windows 8.1, Core i7-4710HQ") +][12] + + +从左至右是不同的有效负载大小,从上往下是不同的操作 + +(注意:不是所有的Y轴都是相同的比例!)我将为每一个操作总结一下主要趋向。 + +**Fill**: + +在我的 hash 表中,Ch 稍比任何的 OA 变种要好。随着哈希表大小和有效负载的加大,差距也随之变大。 + +我猜测这是由于 Ch 只需要从一个空闲链表中拉取一个元素,然后把他放在 bucket 前面,而 OA 不得不搜索一部分 buckets 来找到一个空位置。 + +所有的 OA 变种的性能表现基本都很相似,当然 DO1 稍微有点优势。 + + +在小负载的情况,UM 几乎是所有 hash 表中表现最差的 —— 因为 UM 为每一次的插入申请(内存)付出了沉重的代价。 + +但是在 128 字节的时候,这些 hash 表基本相当,大负载的时候 UM 还赢了点。 + +因为,我所有的实现都需要重新调整元素池的大小,并需要移动大量的元素到新池里面,这一点我几乎无能为力;而 UM 一旦为元素申请了内存后便不需要移动了。 + +注意大负载中图表上夸张的跳步! + +这更确认了重新调整大小带来的问题。 + +相反,UM 只是线性上升 —— 只需要重新调整 bucket 数组大小。由于没有太多隆起的地方,所以相对有效率。 + +**Presized fill**: + +大致和 Fill 相似,但是图示结果更加的线性光滑,没有太大的跳步(因为不需要 rehash ),所有的实现差距在这一测试中要缩小了些。 + +大负载时 UM 依然稍快于 Ch,问题还是在于重新调整大小上。 + +Ch 仍是稳步少快于 OA 变种,但是 DO1 比其他的 OA 稍有优势。 + +**Lookup**: + +所有的实现都相当的集中。除了最小负载时,DO1 和 OL 稍快,其余情况下 UM 和 DO2 都跑在了前面。 + +真的,我无法描述 UM 在这一步做的多么好。 + +尽管需要遍历链表,但是 UM 还是坚守了面向数据的本性。 + + +顺带一提,查找时间和 hash 表的大小有着很弱的关联,这真的很有意思。 + +哈希表查找时间期望上是一个常量时间,所以在的渐进视图中,性能不应该依赖于表的大小。但是那是在忽视了 cache 影响的情况下! + +作为具体的例子,当我们在具有 10 k 条目的表中做 100 k 查找时,速度会便变快,因为在第一次 10 k - 20 k 查找后,大部分的表会处在 L3 中。 + +**Failed lookup**: + +相对于成功查找,这里就有点更分散一些。 + +DO1 和 DO2 跑在了前面,但 UM 并没有落下,OL 则是捉襟见肘啊。 + +我猜测,这可能是因为 OL 整体上具有更长的搜索路径,尤其是在失败查询时; + +内存中,hash 值在 key 和 value 之飘来荡去的找不着出路,我也很受伤啊。 + +DO1 和 DO2 具有相同的搜索长度,但是他们将所有的 hash 值打包在内存中,这使得问题有所缓解。 + +**Remove**: + +DO2 很显然是赢家,但 DO1 也未落下。Ch 则落后,UM 则是差的不是一丁半点(主要是因为每次移除都要释放内存); + +差距随着负载的增加而拉大。 + +移除操作是唯一不需要接触数据的操作,只需要 hash 值和 key 的帮助,这也是为什么 DO1 和 DO2 在移除操作中的表现大相径庭,而其他测试中却保持一致。 + +(如果你的值不是 POD 类型的,并需要析构,这种差异应该是会消失的。) + +**Destruct**: + +Ch 除了最小负载,其他的情况都是最快的(最小负载时,约等于 OA 变种)。 + +所有的 OA 变种基本都是相等的。 + +注意,在我的 hash 表中所做的所有析构操作都是释放少量的内存 buffer 。 + +但是 [在Windows中,释放内存的消耗和大小成比例关系][13]。 + +(而且,这是一个很显著的开支 —— 申请 ~1 GB 的内存需要 ~100 ms 的时间去释放!) + + +UM 在析构时是最慢的一个(小负载时,慢的程度可以用数量级来衡量),大负载时依旧是稍慢些。 + +对于 UM 来讲,释放每一个元素而不是释放一组数组真的是一个硬伤。 + +### [][14]Linux + + +我还在装有 Linux Mint 17.1 的 Core i5-4570S 机器上使用 gcc 4.8 和 clang 3.5 来运行了测试。gcc 和 clang 的结果很相像,因此我只展示了 gcc 的;完整的结果集合包含在了代码下载打包文件中,链接在上面。(点击来缩放) +[ + ![Results for g++ 4.8, Linux Mint 17.1, Core i5-4570S](http://reedbeta.com/blog/data-oriented-hash-table/results-g++4.8.png "Results for g++ 4.8, Linux Mint 17.1, Core i5-4570S") +][15] + + +大部分结果和 Windows 很相似,因此我只高亮了一些有趣的不同点。 + +**Lookup**: + +这里 DO1 跑在前头,而在 Windows 中 DO2 更快些。 + +同样,UM 和 Ch 落后于其他所有的实现——过多的指针追踪,然而 OA 只需要在内存中线性的移动即可。 + +至于 Windows 和 Linux 结果为何不同,则不是很清楚。UM 同样比 Ch 慢了不少,特别是大负载时,这很奇怪;我期望的是他们可以基本相同。 + +**Failed lookup**: + +UM 再一次落后于其他实现,甚至比 OL 还要慢。 + +我再一次无法理解为何 UM 比 Ch 慢这么多,Linux 和 Windows 的结果为何有着如此大的差距。 + + +**Destruct**: + +在我的实现中,小负载的时候,析构的消耗太少了,以至于无法测量; + +在大负载中,线性增加的比例和创建的虚拟内存页数量相关,而不是申请到的数量? + +同样,要比 Windows 中的析构快上几个数量级。 + +但是并不是所有的都和 hash 表有关; + +我们在这里可以看出不同系统和运行时内存系统的表现。 + +貌似,Linux 释放大内存块是要比 Windows 快上不少(或者 Linux 很好的隐藏了开支,或许将释放工作推迟到了进程退出,又或者将工作推给了其他线程或者进程)。 + + +UM 由于要释放每一个元素,所以在所有的负载中都比其他慢上几个数量级。 + +事实上,我将图片做了剪裁,因为 UM 太慢了,以至于破坏了 Y 轴的比例。 + + +### [][16]总结 + + +好,当我们凝视各种情况下的数据和矛盾的结果时,我们可以得出什么结果呢? + +我想直接了当的告诉你这些 hash 表变种中有一个打败了其他所有的 hash 表,但是这显然不那么简单。 + +不过我们仍然可以学到一些东西。 + + +首先,在大多数情况下我们“很容易”做的比 `std::unordered_map` 还要好。 + +我为这些测试所写的所有实现(他们并不复杂;我只花了一两个小时就写完了)要么是符合 `unordered_map` 要么是在其基础上做的提高, + +除了大负载(超过128字节)中的插入性能, `unordered_map` 为每一个节点独立申请存储占了优势。 + +(尽管我没有测试,我同样期望 `unordered_map` 能在非 POD 类型的负载上取得胜利。) + +具有指导意义的是,如果你非常关心性能,不要假设你的标准库中的数据结构是高度优化的。 + +他们可能只是在 C++ 标准的一致性上做了优化,但不是性能。:P + + +其次,如果不管在小负载还是超负载中,若都只用 DO1 (开放寻址,线性探测,hashes/states 和 key/vaules分别处在隔离的平滑数组中),那可能不会有啥好表现。 + +这不是最快的插入,但也不坏(还比 `unordered_map` 快),并且在查找,移除,析构中也很快。 + +你所知道的 —— “面向数据设计”完成了! + + +注意,我的为这些哈希表做的测试代码远未能用于生产环境——他们只支持 POD 类型, + +没有拷贝构造函数以及类似的东西,也未检测重复的 key,等等。 + +我将可能尽快的构建一些实际的 hash 表,用于我的实用库中。 + +为了覆盖基础部分,我想我将有两个变种:一个基于 DO1,用于小的,移动时不需要太大开支的负载;另一个用于链接并且避免重新申请和移动元素(就像 `unordered_map` ),用于大负载或者移动起来需要大开支的负载情况。 + +这应该会给我带来最好的两个世界。 + + +与此同时,我希望你们会有所启迪。 + +最后记住,如果 Chandler Carruth 和 Mike Acton 在数据结构上给你提出些建议,你一定要听 😉 + +-------------------------------------------------------------------------------- + + +作者简介: + + +我是一名图形程序员,目前在西雅图做自由职业者。之前我在 NVIDIA 的 DevTech 软件团队中工作,并在美少女特工队工作室中为 PS3 和 PS4 的 Infamous 系列游戏开发渲染技术。 + + +自 2002 年起,我对图形非常感兴趣,并且已经完成了一系列的工作,包括:雾、大气雾霾、体积照明、水、视觉效果、粒子系统、皮肤和头发阴影、后处理、镜面模型、线性空间渲染、和 GPU 性能测量和优化。 + + +你可以在我的博客了解更多和我有关的事,处理图形,我还对理论物理和程序设计感兴趣。 + + +你可以在 nathaniel.reed@gmail.com 或者在 Twitter(@Reedbeta)/Google+ 上关注我。我也会经常在 StackExchange 上回答计算机图形的问题。 + +-------------- + +via: http://reedbeta.com/blog/data-oriented-hash-table/ + +作者:[Nathan Reed][a] +译者:[sanfusu](https://github.com/sanfusu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://reedbeta.com/about/ +[1]:http://reedbeta.com/blog/data-oriented-hash-table/ +[2]:http://reedbeta.com/blog/category/coding/ +[3]:http://reedbeta.com/blog/data-oriented-hash-table/#comments +[4]:http://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-deque.html +[5]:https://www.youtube.com/watch?v=fHNmRkzxHWs +[6]:https://www.youtube.com/watch?v=rX0ItVEVjHc +[7]:http://reedbeta.com/blog/data-oriented-hash-table/#the-tests +[8]:http://burtleburtle.net/bob/hash/spooky.html +[9]:http://reedbeta.com/blog/data-oriented-hash-table/hash-table-tests.zip +[10]:http://reedbeta.com/blog/data-oriented-hash-table/#the-results +[11]:http://reedbeta.com/blog/data-oriented-hash-table/#windows +[12]:http://reedbeta.com/blog/data-oriented-hash-table/results-vs2012.png +[13]:https://randomascii.wordpress.com/2014/12/10/hidden-costs-of-memory-allocation/ +[14]:http://reedbeta.com/blog/data-oriented-hash-table/#linux +[15]:http://reedbeta.com/blog/data-oriented-hash-table/results-g++4.8.png +[16]:http://reedbeta.com/blog/data-oriented-hash-table/#conclusions From e7fee4e31429a4ee5c8901a4cf44b506e791c54a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 5 Apr 2017 09:12:17 +0800 Subject: [PATCH 100/241] translating --- ...o List Files Installed From a RPM or DEB Package in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md b/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md index 1ce737b16d..4590f5a8e1 100644 --- a/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md +++ b/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md @@ -1,3 +1,5 @@ +translating---geekpi + How to List Files Installed From a RPM or DEB Package in Linux ============================================================ From 3365b85389e50b390d0109739e3b8bc31570d009 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 5 Apr 2017 09:51:22 +0800 Subject: [PATCH 101/241] translated --- ...lled From a RPM or DEB Package in Linux.md | 107 ------------------ ...lled From a RPM or DEB Package in Linux.md | 105 +++++++++++++++++ 2 files changed, 105 insertions(+), 107 deletions(-) delete mode 100644 sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md create mode 100644 translated/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md diff --git a/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md b/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md deleted file mode 100644 index 4590f5a8e1..0000000000 --- a/sources/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md +++ /dev/null @@ -1,107 +0,0 @@ -translating---geekpi - -How to List Files Installed From a RPM or DEB Package in Linux -============================================================ - -Have you ever wondered where the various files contained inside a package are installed (located) in the Linux file system? In this article, we’ll show how to list all files installed from or present in a certain package or group of packages in Linux. - -This can help you to easily locate important package files like configurations files, documentation and more. Let’s look at the different methods of listing files in or installed from a package: - -### How to List All Files of Installed Package in Linux - -You can use the [repoquery command][6] which is part of the [yum-utils to list files installed][7] on a CentOS/RHEL system from a given package. - -To install and use yum-utils, run the commands below: - -``` -# yum update -# yum install yum-utils -``` - -Now you can list files of an installed RPM package, for example httpd web server (note that the package name is case-sensitive). The `--installed` flag means installed packages and `-l` flags enables listing of files: - -``` -# repoquery --installed -l httpd -# dnf repoquery --installed -l httpd [On Fedora 22+ versions] -``` -[ - ![Repoquery List Installed Files of Httpd](http://www.tecmint.com/wp-content/uploads/2017/03/Repoquery-List-Installed-Files-of-Httpd.png) -][8] - -Repoquery List Installed Files of Httpd - -Important: In Fedora 22+ version, the repoquery command is integrated with [dnf package manager][9] for RPM based distribution to list files installed from a package as shown above. - -Alternatively, you can as well use the [rpm command][10] below to list the files inside or installed on the system from a `.rpm` package as follows, where the `-g` and `-l` means to list files in package receptively: - -``` -# rpm -ql httpd -``` -[ - ![RPM Query Package for Installed Files](http://www.tecmint.com/wp-content/uploads/2017/03/rpm-ql-httpd.png) -][11] - -RPM Query Package for Installed Files - -Another useful option is used to use `-p` to list `.rpm` package files before installing it. - -``` -# rpm -qlp telnet-server-1.2-137.1.i586.rpm -``` - -On Debian/Ubuntu distributions, you can use the [dpkg command][12] with the `-L` flag to list files installed to your Debian system or its derivatives, from a given `.deb` package. - -In this example, we will list files installed from apache2 web server: - -``` -$ dpkg -L apache2 -``` -[ - ![dpkg List Installed Packages](http://www.tecmint.com/wp-content/uploads/2017/03/dpkg-List-Installed-Packages.png) -][13] - -dpkg List Installed Packages - -Don’t forget to check out following useful articles for package management in Linux. - -1. [20 Useful ‘Yum’ Commands for Package Management][1] -2. [20 Useful RPM Commands for Package Management][2] -3. [15 Useful APT Commands for Package Management in Ubuntu][3] -4. [15 Useful Dpkg Commands for Ubuntu Linux][4] -5. [5 Best Linux Package Managers for Linux Newbies][5] - -That’s all! In this article, we showed you how to list/locate all files installed from a given package or group of packages in Linux. Share your thoughts with us using the feedback form below. - --------------------------------------------------------------------------------- - -作者简介: - -Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/list-files-installed-from-rpm-deb-package-in-linux/ - -作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/aaronkili/ -[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ -[2]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ -[3]:http://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ -[4]:http://www.tecmint.com/dpkg-command-examples/ -[5]:http://www.tecmint.com/linux-package-managers/ -[6]:http://www.tecmint.com/list-installed-packages-in-rhel-centos-fedora/ -[7]:http://www.tecmint.com/linux-yum-package-management-with-yum-utils/ -[8]:http://www.tecmint.com/wp-content/uploads/2017/03/Repoquery-List-Installed-Files-of-Httpd.png -[9]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ -[10]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ -[11]:http://www.tecmint.com/wp-content/uploads/2017/03/rpm-ql-httpd.png -[12]:http://www.tecmint.com/dpkg-command-examples/ -[13]:http://www.tecmint.com/wp-content/uploads/2017/03/dpkg-List-Installed-Packages.png -[14]:http://www.tecmint.com/author/aaronkili/ -[15]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ -[16]:http://www.tecmint.com/free-linux-shell-scripting-books/ diff --git a/translated/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md b/translated/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md new file mode 100644 index 0000000000..6d91c7ee77 --- /dev/null +++ b/translated/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md @@ -0,0 +1,105 @@ +如何在 Linux 中通过 RPM 或者 DEB 包安装的文件 +============================================================ + +你有没有想要了解安装包中各个文件在 Linux 系统中安装(位于)的位置?本文中,我们将介绍如何列出文件的来源或存在于某个特定包或者一组软件包中的文件。 + +这篇文章可以帮你轻松地找到重要的软件包文件,如配置文件、文档等。我们来看看找出文件在哪个包中或者从哪个包中安装的几个方法: + +### 如何在 Linux 中列出所有已安装包的文件 + +你可以使用[ repoquery 命令][6],它是 [yum-utils][7] 的一部分用来列出给定的包在 CentOS/RHEL 系统上安装的文件。 + +要安装并使用 yum-utils, 运行下面的命令: + +``` +# yum update +# yum install yum-utils +``` + +现在你可以列出一个已安装包的文件了,比如 httpd 服务器 (注意包名是大小写敏感的)。`--installed` 表示安装的报名,`-l` 列出所有的文件: + +``` +# repoquery --installed -l httpd +# dnf repoquery --installed -l httpd [On Fedora 22+ versions] +``` +[ + ![Repoquery List Installed Files of Httpd](http://www.tecmint.com/wp-content/uploads/2017/03/Repoquery-List-Installed-Files-of-Httpd.png) +][8] + +repoquery 列出 httpd 安装的文件 + +重要:在 In Fedora 22+ 的版本中,repoquery 命令在基于 RPM 的发行版中已经与[ dnf 包管理器][9]整合,可以用上面的方法列出所有文件。 + +除此之外,你也可以使用下面的[ rpm 命令][10]列出 `.rpm` 包中或已经安装的 `.rpm` 包的文件,下面的 `-q` 和 `-l` 表示列出包中的文件: + +``` +# rpm -ql httpd +``` +[ + ![RPM Query Package for Installed Files](http://www.tecmint.com/wp-content/uploads/2017/03/rpm-ql-httpd.png) +][11] + +rpm 查询包安装的文件 + +另外一个有用的选项是使用 `-p` 在安装之前列出 `.rpm` 中的文件。 + +``` +# rpm -qlp telnet-server-1.2-137.1.i586.rpm +``` + +在 Debian/Ubuntu 发行版中,你可以使用[ dpkg 命令][12]带上 `-L` 标志在 Debian 系统或其衍生版本中列出给定 `.deb` 包的已安装文件。 + +在这个例子中,我们会列出 apache2 服务器安装的文件: + +``` +$ dpkg -L apache2 +``` +[ + ![dpkg List Installed Packages](http://www.tecmint.com/wp-content/uploads/2017/03/dpkg-List-Installed-Packages.png) +][13] + +dpkg 列出安装的包 + +也不要忘记查看在 Linux 中有关软件包管理的文章。 + +1. [20 个有用的 “yum” 包管理命令][1] +2. [20 个有用的 rpm 包管理命令] [2] +3. [15 个 Ubuntu 中有用的 apt 包管理命令] [3] +4. [15 个 Ubuntu 中有用的 dpkg命令][4] +5. [5 个最佳的对 Linux 新手的包管理器][5] + +就是这样了!在本文中,我们向你展示了如何在 Linux 中列出/找到给定的软件包或软件包组安装的所有文件。在下面的评论栏中分享你的想法。 + +-------------------------------------------------------------------------------- + +作者简介: + +Aaron Kili 是 Linux 和 F.O.S.S 的爱好者,目前任 TecMint 的作者,志向是一名 Linux 系统管理员、web 开发者。他喜欢用电脑工作,并热衷于分享知识。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/list-files-installed-from-rpm-deb-package-in-linux/ + +作者:[Aaron Kili][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/aaronkili/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ +[3]:http://www.tecmint.com/apt-advanced-package-command-examples-in-ubuntu/ +[4]:http://www.tecmint.com/dpkg-command-examples/ +[5]:http://www.tecmint.com/linux-package-managers/ +[6]:http://www.tecmint.com/list-installed-packages-in-rhel-centos-fedora/ +[7]:http://www.tecmint.com/linux-yum-package-management-with-yum-utils/ +[8]:http://www.tecmint.com/wp-content/uploads/2017/03/Repoquery-List-Installed-Files-of-Httpd.png +[9]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ +[10]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ +[11]:http://www.tecmint.com/wp-content/uploads/2017/03/rpm-ql-httpd.png +[12]:http://www.tecmint.com/dpkg-command-examples/ +[13]:http://www.tecmint.com/wp-content/uploads/2017/03/dpkg-List-Installed-Packages.png +[14]:http://www.tecmint.com/author/aaronkili/ +[15]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ +[16]:http://www.tecmint.com/free-linux-shell-scripting-books/ From 2950169d2dd640d1814d3f0c491b27a4e6d78623 Mon Sep 17 00:00:00 2001 From: Ezio Date: Wed, 5 Apr 2017 10:40:07 +0800 Subject: [PATCH 102/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lled From a RPM or DEB Package in Linux.md | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/translated/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md b/translated/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md index 6d91c7ee77..7cf65b8313 100644 --- a/translated/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md +++ b/translated/tech/20170330 How to List Files Installed From a RPM or DEB Package in Linux.md @@ -1,13 +1,13 @@ -如何在 Linux 中通过 RPM 或者 DEB 包安装的文件 +如何在 Linux 中列出通过 RPM 或者 DEB 包安装的文件 ============================================================ -你有没有想要了解安装包中各个文件在 Linux 系统中安装(位于)的位置?本文中,我们将介绍如何列出文件的来源或存在于某个特定包或者一组软件包中的文件。 +你是否想要了解安装包中各个文件在 Linux 系统中安装(位于)的位置?我们将在本文介绍如何列出文件的来源,或存在于某个特定包或者一组软件包中的文件。 -这篇文章可以帮你轻松地找到重要的软件包文件,如配置文件、文档等。我们来看看找出文件在哪个包中或者从哪个包中安装的几个方法: +这篇文章可以帮你轻松地找到重要的软件包文件,如配置文件、帮助文档等。我们来看看找出文件在哪个包中或者从哪个包中安装的几个方法: -### 如何在 Linux 中列出所有已安装包的文件 +### 如何列出 Linux 中全部已安装软件包的文件 -你可以使用[ repoquery 命令][6],它是 [yum-utils][7] 的一部分用来列出给定的包在 CentOS/RHEL 系统上安装的文件。 +你可以使用[ repoquery 命令][6],它是 [yum-utils][7] 的一部分,用来列出给定的软件包在 CentOS/RHEL 系统上安装的文件。 要安装并使用 yum-utils, 运行下面的命令: @@ -16,51 +16,54 @@ # yum install yum-utils ``` -现在你可以列出一个已安装包的文件了,比如 httpd 服务器 (注意包名是大小写敏感的)。`--installed` 表示安装的报名,`-l` 列出所有的文件: +现在你可以列出一个已安装包的文件了,比如 httpd 服务器 (注意包名是大小写敏感的)。`--installed` 表示安装的包名,`-l` 列出所有的文件: ``` # repoquery --installed -l httpd # dnf repoquery --installed -l httpd [On Fedora 22+ versions] ``` + [ ![Repoquery List Installed Files of Httpd](http://www.tecmint.com/wp-content/uploads/2017/03/Repoquery-List-Installed-Files-of-Httpd.png) ][8] -repoquery 列出 httpd 安装的文件 +>repoquery 列出 httpd 安装的文件 -重要:在 In Fedora 22+ 的版本中,repoquery 命令在基于 RPM 的发行版中已经与[ dnf 包管理器][9]整合,可以用上面的方法列出所有文件。 +重要:在 Fedora 22 以上的版本中,`repoquery` 命令在基于 RPM 的发行版中已经与 [dnf 包管理器][9]整合,可以用上面的方法列出所有文件。 -除此之外,你也可以使用下面的[ rpm 命令][10]列出 `.rpm` 包中或已经安装的 `.rpm` 包的文件,下面的 `-q` 和 `-l` 表示列出包中的文件: +除此之外,你也可以使用下面的 [rpm 命令][10]列出 `.rpm` 包中或已经安装的 `.rpm` 包的文件,下面的 `-q` 和 `-l` 表示列出包中的文件: ``` # rpm -ql httpd ``` + [ ![RPM Query Package for Installed Files](http://www.tecmint.com/wp-content/uploads/2017/03/rpm-ql-httpd.png) ][11] -rpm 查询包安装的文件 +>rpm 查询已安装程序的安装包 -另外一个有用的选项是使用 `-p` 在安装之前列出 `.rpm` 中的文件。 +另外一个有用的建议是使用 `-p` 在安装之前列出 `.rpm` 中的文件。 ``` # rpm -qlp telnet-server-1.2-137.1.i586.rpm ``` -在 Debian/Ubuntu 发行版中,你可以使用[ dpkg 命令][12]带上 `-L` 标志在 Debian 系统或其衍生版本中列出给定 `.deb` 包的已安装文件。 +在 Debian/Ubuntu 发行版中,你可以使用 [dpkg 命令][12]带上 `-L` 标志在 Debian 系统或其衍生版本中列出给定 `.deb` 包的安装的文件。 在这个例子中,我们会列出 apache2 服务器安装的文件: ``` $ dpkg -L apache2 ``` + [ ![dpkg List Installed Packages](http://www.tecmint.com/wp-content/uploads/2017/03/dpkg-List-Installed-Packages.png) ][13] -dpkg 列出安装的包 +>dpkg 列出安装的包 -也不要忘记查看在 Linux 中有关软件包管理的文章。 +不要忘记查看其它有关在 Linux 中软件包管理的文章。 1. [20 个有用的 “yum” 包管理命令][1] 2. [20 个有用的 rpm 包管理命令] [2] @@ -81,8 +84,8 @@ Aaron Kili 是 Linux 和 F.O.S.S 的爱好者,目前任 TecMint 的作者, via: http://www.tecmint.com/list-files-installed-from-rpm-deb-package-in-linux/ 作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[ezio](https://github.com/oska874) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1d466d3ced6be275e778b6b89873c29fc2d832cd Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Wed, 5 Apr 2017 03:07:12 -0500 Subject: [PATCH 103/241] Update 20161028 Configuring WINE with Winetricks.md --- ...161028 Configuring WINE with Winetricks.md | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/sources/tech/20161028 Configuring WINE with Winetricks.md b/sources/tech/20161028 Configuring WINE with Winetricks.md index e7e8a64214..be3392cda1 100644 --- a/sources/tech/20161028 Configuring WINE with Winetricks.md +++ b/sources/tech/20161028 Configuring WINE with Winetricks.md @@ -1,89 +1,89 @@ -++翻译中 -+ -+ -### Configuring WINE with Winetricks +用Winetricks配置WINE -Contents +目录 -* * [1. Introduction][1] - * [2. Installing][2] - * [3. Fonts][3] - * [4. .dlls and Components][4] - * [5. Registry][5] - * [6. Closing][6] - * [7. Table of Contents][7] -### Introduction + [1简介][1] + [2安装][2] + [3字体][3] + [4.dulls 和其他组件][4] + [5注册][5] + [6关闭][6] + [7内容表][7] -If `winecfg` is a screwdriver, `winetricks` is a power drill. They both have their place, but `winetricks` is just a much more powerful tool. Actually, it even has the ability to launch `winecfg`.  -While `winecfg` gives you the ability to change the settings of WINE itself, `winetricks` gives you the ability to modify the actual Windows layer. It allows you to install important components like `.dlls` and system fonts as well as giving you the capability to edit the Windows registry. It also has a task manager, an uninstall utility, and file browser.  +简介 + +如果 winecfg (WINE的配置文件) 是一把螺丝刀,那么 winetricks 就是一个钻床.它们各有特长.但是 winetricks 真的是一个强大的工具.实际上,它完全有能力配置 winecfg,充当配置文件的配置文件 + +winecfg 让你可以改变 WINE 本身的设置,而winetricks 则可以让你改造 Windows 层,它可以让你安装 Windows重要的系统组件,比如 .dulls 文件,还可以允许你修改 Windows注册表的信息.它还有任务管理器,卸载工具和文件浏览器. + + +尽管 winetricks 可以功能强大,但是大部分时间我们用到的功能也就是管理 dll 文件和 Windows 组件 Even though `winetricks` can do all of this, the majority of the time, you're going to be using it to manage `dlls` and Windows components. -### Installing +安装 -Unlike `winecfg`, `winetricks` doesn't come with WINE. That's fine, though, since it's actually just a script, so it's very easy to download and use on any distribution. Now, many distributions do package `winetricks`. You can definitely use the packaged version if you'd like. Sometimes, those packages fall out-of-date, so this guide is going to use the script, since it's both current and universal. By default, the graphical window is fairly ugly, so if you'd prefer a stylized window, install `zenity` through your distribution's package manager.  +和 winecfg 不同,winetricks 不是集成在 WINE 中的.这样也没什么问题,毕竟它实际上只是个脚本文件.所以你可以很轻松随意地下载到各种 winetricks 的发行版.现在,许多发行版把 winetricks 打包.只要你喜欢,你完全可以下载打包过的文件.不过有些包可能会过期,所以最好是使用引导脚本,毕竟引导脚本有着通用性.一般情况下,图形界面都比较丑,所以你要是想个性化界面,你最好通过发行版的包管理器安装一个 zenity + +现在假定你想在你的家目录(~)下配置 winetricks. cd 到此,然后 wget(Linux下强大的下载命令) 这个脚本 -Assuming that you want `winetricks` in your `/home` directory, `cd` there and `wget` the script. ``` $ cd ~ $ wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks ``` -Then, make the script executable. +然后,给这个脚本可执行权限即可 + ``` $ chmod+x winetricks ``` -`winetricks` can be run in the command line, specifying what needs to be installed at the end of the command, but in most cases, you won't know the exact names of the `.dlls` or fonts that you're trying to install. For that reason, the graphical utility is best. Launching it really isn't any different. Just don't specify anything on the end. +winetricks 可以通过命令行运行,在行末指定要安装的东西即可.但是大部分情况下,你都不知道 .dlls 或者是你想安装字体的名字,那么,这时候最好利用图形界面的程序.使用这个程序真的很简单,和其他程序没什么不同,就是别在末尾什么都别输入就行了 ``` $ ~/winetricks ``` ![The winetricks main menu](https://linuxconfig.org/images/winetricks-main.png) - -When the window first opens, it will display a menu with options including "View help" and "Install an application." By default, "Select the default wineprefix" will be selected. That's the primary option that you will use. The others may work, but aren't really recommended. To proceed, click "OK," and you will be brought to the menu for that WINE prefix.Everything that you will need to do through `winetricks` can be done through this prefix menu.  +当窗口第一次打开时候,将会给你一个有 View help 和 Install an application 选项的菜单.一般情况下,我们都选择 Select the default wineprefix,这将是你主要使用的选项.其他的也能用,但是我们不推荐.接下来,单击 OK,你就会进入到 WINE 的配置菜单,你可以在这完成所有的你要使用 winetricks 完成的事情 ![The winetricks prefix menu](https://linuxconfig.org/images/winetricks-prefix.png) +字体 -### Fonts ![The winetricks font menu](https://linuxconfig.org/images/winetricks-font.png) +字体一直很重要,一些应用程序没有字体没法正常的加载.winetricks 可以轻松地安装许多常用 Windows 字体.在配置菜单中,选中 Install a font 单选按钮,然后点击 OK 即可. -Fonts are surprisingly important. Some applications won't load or won't load properly without them.`winetricks` makes installing many common Windows fonts very easy. From the prefix menu, select the "Install a font" radio button and press "OK."  +然后你就会得到一列字体清单,它们都有着相对应的确认框.你很难确切地知道你到底要安装什么字体,毕竟它们都是在应用程序的配置中预先被设定的,那么我们可以先安装一款插件 corefonts,它包含了大多数 Windows 系统中应用程序被设定的字体.安装它也十分简单,所以可以试试. -You will be presented with a new list of fonts and corresponding checkboxes. It's hard to say exactly which fonts you will need, so most of this should be decided on a per-application basis, but it's usually a good idea to install `corefonts`. It contains the major Windows system fonts that many applications would be expecting to be present on a Windows machine. Installing them can't really hurt anything, so just having them is usually best.  +要安装 corefonts ,请选择相应的确认框,然后点击 OK ,你就会看到大概和在 Windows 下差不多的提示,字体就会被安装了.完成了这个插件的安装,你就会回到先前的菜单界面.接下来就是安装你需要的别的插件,步骤相同. -To install `corefonts`, check the corresponding checkbox and press "OK." You will be given roughly the same install prompts as you would on Windows, and the fonts will be installed. When it's done, you will be taken back to the prefix menu. Follow that same process for each additional font that you need. - -### .dlls and Components +.dlls和组件 ![The winetricks dll menu](https://linuxconfig.org/images/winetricks-dll.png) +winetricks 安装 Windows 下的 .dll 文件和别的组件也十分简单.如果你需要安装的话,在菜单页选择 Install a Windows DLL or component,然后点击 OK  -`winetricks` tries to make installing Windows `.dll` files and other components as simple as possible. If you need to install them, select "Install a Windows DLL or component" on the prefix menu and click "OK."  +窗口就会进入到另一个菜单界面,其中包含可用的 dlls 和其他 Windows 组件.选择相应的确认框,点击 OK,winetricks 就会下载你选择的组件,接着通过 Windows 一般安装进程进行安装.跟着提示,它很像 Windows 界面下的那种提示,忽略掉报错信息.很多时候,Windows 安装程序会报错,但是你会发现 winetricks 已经将它安装到工作区.这很正常.由于组件之间的相互依赖关系,你可能会也可能不会看到成功安装的信息.只要安装完成时候,确定在菜单页中你的选项仍旧处于被选中状态就行了 -The window will switch over to a menu of available `dlls` and other Windows components. Using the corresponding checkboxes, check off any that you need, and click "OK." The script will download each selected component and begin installing them via the usual Windows install process. Follow the prompts like you would on a Windows machine. Expect error messages. Many times, the Windows installers will present errors, but you will then receive windows from `winetricks` stating that it is following a workaround. That is perfectly normal. Depending on the component, you may or may not receive a success message. Just ensure that the box is still checked in the menu when the install is complete. - -### Registry +注册表 ![WINE regedit](https://linuxconfig.org/images/winetricks-regedit.png) +在WINE中你不需要常常编辑注册表对应的值,但是对于有些程序确实需要.技术层面来讲,winetricks 不向用户提供注册表编辑器,但是要获取编辑器也很容易.在菜单页选中 Run regedit,点击 OK,你就可以打开一个简单的注册表编辑器.讲真,写入注册表的值有点超出本篇引导文章的范围了,但是我还要多说一句,如果你已经知道你在干什么,增加一个注册表条目不是很难.注册表有点像电子表格,你可以将正确的值填入右面的格子中.这个有点过于简单,但是就是这样做的.你可以在以下地址精准地找到你需要在 WINE Appdp所要填入的东西. -It's not all that often that you have to edit registry values in WINE, but with some programs, you may. Technically, `winetricks` doesn't provide the registry editor, but it makes accessing it easier. Select "Run regedit" from the prefix menu and press "OK." A basic Windows registry editor will open up. Actually creating registry values is a bit out of the scope of this guide, but adding entries isn't too hard if you already know what you're entering. The registry acts sort of like a spreadsheet, so you can just plug in the right values into the right cells. That's somewhat of an oversimplification, but it works. You can usually find exactly what needs to be added or edited on the WINE Appdb `https://appdb.winehq.org`. +关闭 -### Closing - -There's obviously much more that can be done with `winetricks`, but the purpose of this guide is to give you the basic knowledge that you'll need to use this powerful tool to get your programs up and running through WINE. The WINE Appdb is a wealth of knowledge on a per-program basis, and will be an invaluable resource going forward. +很明显 winetricks 还有许多许多强大的功能远,远不止此,但是本篇引导的目的只是给你一点基础的知识,在你通过 WINE 运行程序一般都会用到.WINE Appdp 提供了强大的各种程序库,是一笔宝贵的知识财富,以后,它会变得更加无价.好好利用它吧. -------------------------------------------------------------------------------- via: https://linuxconfig.org/configuring-wine-with-winetricks 作者:[Nick Congleton][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Taylor1024](https://github.com/Taylor1024) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 599181bbcc251e66d82452d9e3672c8380b03b47 Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Wed, 5 Apr 2017 03:08:26 -0500 Subject: [PATCH 104/241] Update 20161028 Configuring WINE with Winetricks.md --- .../tech/20161028 Configuring WINE with Winetricks.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sources/tech/20161028 Configuring WINE with Winetricks.md b/sources/tech/20161028 Configuring WINE with Winetricks.md index be3392cda1..deb676f8fc 100644 --- a/sources/tech/20161028 Configuring WINE with Winetricks.md +++ b/sources/tech/20161028 Configuring WINE with Winetricks.md @@ -14,14 +14,12 @@ 简介 - 如果 winecfg (WINE的配置文件) 是一把螺丝刀,那么 winetricks 就是一个钻床.它们各有特长.但是 winetricks 真的是一个强大的工具.实际上,它完全有能力配置 winecfg,充当配置文件的配置文件 winecfg 让你可以改变 WINE 本身的设置,而winetricks 则可以让你改造 Windows 层,它可以让你安装 Windows重要的系统组件,比如 .dulls 文件,还可以允许你修改 Windows注册表的信息.它还有任务管理器,卸载工具和文件浏览器. - 尽管 winetricks 可以功能强大,但是大部分时间我们用到的功能也就是管理 dll 文件和 Windows 组件 -Even though `winetricks` can do all of this, the majority of the time, you're going to be using it to manage `dlls` and Windows components. + 安装 @@ -49,8 +47,8 @@ $ ~/winetricks ![The winetricks prefix menu](https://linuxconfig.org/images/winetricks-prefix.png) -字体 +字体 ![The winetricks font menu](https://linuxconfig.org/images/winetricks-font.png) @@ -60,6 +58,7 @@ $ ~/winetricks 要安装 corefonts ,请选择相应的确认框,然后点击 OK ,你就会看到大概和在 Windows 下差不多的提示,字体就会被安装了.完成了这个插件的安装,你就会回到先前的菜单界面.接下来就是安装你需要的别的插件,步骤相同. + .dlls和组件 ![The winetricks dll menu](https://linuxconfig.org/images/winetricks-dll.png) @@ -68,12 +67,14 @@ winetricks 安装 Windows 下的 .dll 文件和别的组件也十分简单. 窗口就会进入到另一个菜单界面,其中包含可用的 dlls 和其他 Windows 组件.选择相应的确认框,点击 OK,winetricks 就会下载你选择的组件,接着通过 Windows 一般安装进程进行安装.跟着提示,它很像 Windows 界面下的那种提示,忽略掉报错信息.很多时候,Windows 安装程序会报错,但是你会发现 winetricks 已经将它安装到工作区.这很正常.由于组件之间的相互依赖关系,你可能会也可能不会看到成功安装的信息.只要安装完成时候,确定在菜单页中你的选项仍旧处于被选中状态就行了 + 注册表 ![WINE regedit](https://linuxconfig.org/images/winetricks-regedit.png) 在WINE中你不需要常常编辑注册表对应的值,但是对于有些程序确实需要.技术层面来讲,winetricks 不向用户提供注册表编辑器,但是要获取编辑器也很容易.在菜单页选中 Run regedit,点击 OK,你就可以打开一个简单的注册表编辑器.讲真,写入注册表的值有点超出本篇引导文章的范围了,但是我还要多说一句,如果你已经知道你在干什么,增加一个注册表条目不是很难.注册表有点像电子表格,你可以将正确的值填入右面的格子中.这个有点过于简单,但是就是这样做的.你可以在以下地址精准地找到你需要在 WINE Appdp所要填入的东西. + 关闭 很明显 winetricks 还有许多许多强大的功能远,远不止此,但是本篇引导的目的只是给你一点基础的知识,在你通过 WINE 运行程序一般都会用到.WINE Appdp 提供了强大的各种程序库,是一笔宝贵的知识财富,以后,它会变得更加无价.好好利用它吧. From 41911dae12e6fc9589abbf6c0f9ae1cba7f68e58 Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Wed, 5 Apr 2017 03:44:10 -0500 Subject: [PATCH 105/241] =?UTF-8?q?Create=20=E7=94=A8Winetricks=E9=85=8D?= =?UTF-8?q?=E7=BD=AEWINE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/tech/用Winetricks配置WINE | 1 + 1 file changed, 1 insertion(+) create mode 100644 translated/tech/用Winetricks配置WINE diff --git a/translated/tech/用Winetricks配置WINE b/translated/tech/用Winetricks配置WINE new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/translated/tech/用Winetricks配置WINE @@ -0,0 +1 @@ + From 235d049727daa3fc135fd48c173763ce9e0e3a0c Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Wed, 5 Apr 2017 03:45:49 -0500 Subject: [PATCH 106/241] =?UTF-8?q?Update=20and=20rename=20=E7=94=A8Winetr?= =?UTF-8?q?icks=E9=85=8D=E7=BD=AEWINE=20to=20Winetricks=E9=85=8D=E7=BD=AEW?= =?UTF-8?q?INE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/tech/Winetricks配置WINE | 79 ++++++++++++++++++++++++++++ translated/tech/用Winetricks配置WINE | 1 - 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 translated/tech/Winetricks配置WINE delete mode 100644 translated/tech/用Winetricks配置WINE diff --git a/translated/tech/Winetricks配置WINE b/translated/tech/Winetricks配置WINE new file mode 100644 index 0000000000..d5b451bc91 --- /dev/null +++ b/translated/tech/Winetricks配置WINE @@ -0,0 +1,79 @@ + + +用Winetricks配置WINE + +目录 + + [1简介][1] + [2安装][2] + [3字体][3] + [4.dulls 和其他组件][4] + [5注册][5] + [6关闭][6] + [7内容表][7] + +简介 + +如果 winecfg (WINE的配置文件) 是一把螺丝刀,那么 winetricks 就是一个钻床.它们各有特长.但是 winetricks 真的是一个强大的工具.实际上,它完全有能力配置 winecfg,充当配置文件的配置文件 + +winecfg 让你可以改变 WINE 本身的设置,而winetricks 则可以让你改造 Windows 层,它可以让你安装 Windows重要的系统组件,比如 .dulls 文件,还可以允许你修改 Windows注册表的信息.它还有任务管理器,卸载工具和文件浏览器. + +尽管 winetricks 可以功能强大,但是大部分时间我们用到的功能也就是管理 dll 文件和 Windows 组件 + +安装 + +和 winecfg 不同,winetricks 不是集成在 WINE 中的.这样也没什么问题,毕竟它实际上只是个脚本文件.所以你可以很轻松随意地下载到各种 winetricks 的发行版.现在,许多发行版把 winetricks 打包.只要你喜欢,你完全可以下载打包过的文件.不过有些包可能会过期,所以最好是使用引导脚本,毕竟引导脚本有着通用性.一般情况下,图形界面都比较丑,所以你要是想个性化界面,你最好通过发行版的包管理器安装一个 zenity + +现在假定你想在你的家目录(~)下配置 winetricks. cd 到此,然后 wget(Linux下强大的下载命令) 这个脚本 + +$ cd ~ +$ wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks + +然后,给这个脚本可执行权限即可 + +$ chmod+x winetricks + +winetricks 可以通过命令行运行,在行末指定要安装的东西即可.但是大部分情况下,你都不知道 .dlls 或者是你想安装字体的名字,那么,这时候最好利用图形界面的程序.使用这个程序真的很简单,和其他程序没什么不同,就是别在末尾什么都别输入就行了 + +$ ~/winetricks + +The winetricks main menu + +当窗口第一次打开时候,将会给你一个有 View help 和 Install an application 选项的菜单.一般情况下,我们都选择 Select the default wineprefix,这将是你主要使用的选项.其他的也能用,但是我们不推荐.接下来,单击 OK,你就会进入到 WINE 的配置菜单,你可以在这完成所有的你要使用 winetricks 完成的事情 + +The winetricks prefix menu + +字体 + +The winetricks font menu + +字体一直很重要,一些应用程序没有字体没法正常的加载.winetricks 可以轻松地安装许多常用 Windows 字体.在配置菜单中,选中 Install a font 单选按钮,然后点击 OK 即可. + +然后你就会得到一列字体清单,它们都有着相对应的确认框.你很难确切地知道你到底要安装什么字体,毕竟它们都是在应用程序的配置中预先被设定的,那么我们可以先安装一款插件 corefonts,它包含了大多数 Windows 系统中应用程序被设定的字体.安装它也十分简单,所以可以试试. + +要安装 corefonts ,请选择相应的确认框,然后点击 OK ,你就会看到大概和在 Windows 下差不多的提示,字体就会被安装了.完成了这个插件的安装,你就会回到先前的菜单界面.接下来就是安装你需要的别的插件,步骤相同. + +.dlls和组件 + +The winetricks dll menu + +winetricks 安装 Windows 下的 .dll 文件和别的组件也十分简单.如果你需要安装的话,在菜单页选择 Install a Windows DLL or component,然后点击 OK + +窗口就会进入到另一个菜单界面,其中包含可用的 dlls 和其他 Windows 组件.选择相应的确认框,点击 OK,winetricks 就会下载你选择的组件,接着通过 Windows 一般安装进程进行安装.跟着提示,它很像 Windows 界面下的那种提示,忽略掉报错信息.很多时候,Windows 安装程序会报错,但是你会发现 winetricks 已经将它安装到工作区.这很正常.由于组件之间的相互依赖关系,你可能会也可能不会看到成功安装的信息.只要安装完成时候,确定在菜单页中你的选项仍旧处于被选中状态就行了 + +注册表 + +WINE regedit + +在WINE中你不需要常常编辑注册表对应的值,但是对于有些程序确实需要.技术层面来讲,winetricks 不向用户提供注册表编辑器,但是要获取编辑器也很容易.在菜单页选中 Run regedit,点击 OK,你就可以打开一个简单的注册表编辑器.讲真,写入注册表的值有点超出本篇引导文章的范围了,但是我还要多说一句,如果你已经知道你在干什么,增加一个注册表条目不是很难.注册表有点像电子表格,你可以将正确的值填入右面的格子中.这个有点过于简单,但是就是这样做的.你可以在以下地址精准地找到你需要在 WINE Appdp所要填入的东西. + +关闭 + +很明显 winetricks 还有许多许多强大的功能远,远不止此,但是本篇引导的目的只是给你一点基础的知识,在你通过 WINE 运行程序一般都会用到.WINE Appdp 提供了强大的各种程序库,是一笔宝贵的知识财富,以后,它会变得更加无价.好好利用它吧. + +via: https://linuxconfig.org/configuring-wine-with-winetricks + +作者:Nick Congleton 译者:Taylor1024 校对:校对者ID + +本文由 LCTT 原创编译,Linux中国 荣誉推出 + diff --git a/translated/tech/用Winetricks配置WINE b/translated/tech/用Winetricks配置WINE deleted file mode 100644 index 8b13789179..0000000000 --- a/translated/tech/用Winetricks配置WINE +++ /dev/null @@ -1 +0,0 @@ - From 892036f76802caa53d8c136b6e2d1fc9f9247f84 Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Wed, 5 Apr 2017 03:48:06 -0500 Subject: [PATCH 107/241] Delete 20161028 Configuring WINE with Winetricks.md --- ...161028 Configuring WINE with Winetricks.md | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 sources/tech/20161028 Configuring WINE with Winetricks.md diff --git a/sources/tech/20161028 Configuring WINE with Winetricks.md b/sources/tech/20161028 Configuring WINE with Winetricks.md deleted file mode 100644 index deb676f8fc..0000000000 --- a/sources/tech/20161028 Configuring WINE with Winetricks.md +++ /dev/null @@ -1,99 +0,0 @@ -用Winetricks配置WINE - -目录 - - - [1简介][1] - [2安装][2] - [3字体][3] - [4.dulls 和其他组件][4] - [5注册][5] - [6关闭][6] - [7内容表][7] - - -简介 - -如果 winecfg (WINE的配置文件) 是一把螺丝刀,那么 winetricks 就是一个钻床.它们各有特长.但是 winetricks 真的是一个强大的工具.实际上,它完全有能力配置 winecfg,充当配置文件的配置文件 - -winecfg 让你可以改变 WINE 本身的设置,而winetricks 则可以让你改造 Windows 层,它可以让你安装 Windows重要的系统组件,比如 .dulls 文件,还可以允许你修改 Windows注册表的信息.它还有任务管理器,卸载工具和文件浏览器. - -尽管 winetricks 可以功能强大,但是大部分时间我们用到的功能也就是管理 dll 文件和 Windows 组件 - - -安装 - -和 winecfg 不同,winetricks 不是集成在 WINE 中的.这样也没什么问题,毕竟它实际上只是个脚本文件.所以你可以很轻松随意地下载到各种 winetricks 的发行版.现在,许多发行版把 winetricks 打包.只要你喜欢,你完全可以下载打包过的文件.不过有些包可能会过期,所以最好是使用引导脚本,毕竟引导脚本有着通用性.一般情况下,图形界面都比较丑,所以你要是想个性化界面,你最好通过发行版的包管理器安装一个 zenity - -现在假定你想在你的家目录(~)下配置 winetricks. cd 到此,然后 wget(Linux下强大的下载命令) 这个脚本 - -``` -$ cd ~ -$ wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks -``` -然后,给这个脚本可执行权限即可 - -``` -$ chmod+x winetricks -``` -winetricks 可以通过命令行运行,在行末指定要安装的东西即可.但是大部分情况下,你都不知道 .dlls 或者是你想安装字体的名字,那么,这时候最好利用图形界面的程序.使用这个程序真的很简单,和其他程序没什么不同,就是别在末尾什么都别输入就行了 -``` -$ ~/winetricks -``` - - ![The winetricks main menu](https://linuxconfig.org/images/winetricks-main.png) - -当窗口第一次打开时候,将会给你一个有 View help 和 Install an application 选项的菜单.一般情况下,我们都选择 Select the default wineprefix,这将是你主要使用的选项.其他的也能用,但是我们不推荐.接下来,单击 OK,你就会进入到 WINE 的配置菜单,你可以在这完成所有的你要使用 winetricks 完成的事情 - - ![The winetricks prefix menu](https://linuxconfig.org/images/winetricks-prefix.png) - - -字体 - - ![The winetricks font menu](https://linuxconfig.org/images/winetricks-font.png) - -字体一直很重要,一些应用程序没有字体没法正常的加载.winetricks 可以轻松地安装许多常用 Windows 字体.在配置菜单中,选中 Install a font 单选按钮,然后点击 OK 即可. - -然后你就会得到一列字体清单,它们都有着相对应的确认框.你很难确切地知道你到底要安装什么字体,毕竟它们都是在应用程序的配置中预先被设定的,那么我们可以先安装一款插件 corefonts,它包含了大多数 Windows 系统中应用程序被设定的字体.安装它也十分简单,所以可以试试. - -要安装 corefonts ,请选择相应的确认框,然后点击 OK ,你就会看到大概和在 Windows 下差不多的提示,字体就会被安装了.完成了这个插件的安装,你就会回到先前的菜单界面.接下来就是安装你需要的别的插件,步骤相同. - - -.dlls和组件 - - ![The winetricks dll menu](https://linuxconfig.org/images/winetricks-dll.png) - -winetricks 安装 Windows 下的 .dll 文件和别的组件也十分简单.如果你需要安装的话,在菜单页选择 Install a Windows DLL or component,然后点击 OK  - -窗口就会进入到另一个菜单界面,其中包含可用的 dlls 和其他 Windows 组件.选择相应的确认框,点击 OK,winetricks 就会下载你选择的组件,接着通过 Windows 一般安装进程进行安装.跟着提示,它很像 Windows 界面下的那种提示,忽略掉报错信息.很多时候,Windows 安装程序会报错,但是你会发现 winetricks 已经将它安装到工作区.这很正常.由于组件之间的相互依赖关系,你可能会也可能不会看到成功安装的信息.只要安装完成时候,确定在菜单页中你的选项仍旧处于被选中状态就行了 - - -注册表 - - ![WINE regedit](https://linuxconfig.org/images/winetricks-regedit.png) - -在WINE中你不需要常常编辑注册表对应的值,但是对于有些程序确实需要.技术层面来讲,winetricks 不向用户提供注册表编辑器,但是要获取编辑器也很容易.在菜单页选中 Run regedit,点击 OK,你就可以打开一个简单的注册表编辑器.讲真,写入注册表的值有点超出本篇引导文章的范围了,但是我还要多说一句,如果你已经知道你在干什么,增加一个注册表条目不是很难.注册表有点像电子表格,你可以将正确的值填入右面的格子中.这个有点过于简单,但是就是这样做的.你可以在以下地址精准地找到你需要在 WINE Appdp所要填入的东西. - - -关闭 - -很明显 winetricks 还有许多许多强大的功能远,远不止此,但是本篇引导的目的只是给你一点基础的知识,在你通过 WINE 运行程序一般都会用到.WINE Appdp 提供了强大的各种程序库,是一笔宝贵的知识财富,以后,它会变得更加无价.好好利用它吧. - --------------------------------------------------------------------------------- - -via: https://linuxconfig.org/configuring-wine-with-winetricks - -作者:[Nick Congleton][a] -译者:[Taylor1024](https://github.com/Taylor1024) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://linuxconfig.org/configuring-wine-with-winetricks -[1]:https://linuxconfig.org/configuring-wine-with-winetricks#h1-introduction -[2]:https://linuxconfig.org/configuring-wine-with-winetricks#h2-installing -[3]:https://linuxconfig.org/configuring-wine-with-winetricks#h3-fonts -[4]:https://linuxconfig.org/configuring-wine-with-winetricks#h4-dlls-and-components -[5]:https://linuxconfig.org/configuring-wine-with-winetricks#h5-registry -[6]:https://linuxconfig.org/configuring-wine-with-winetricks#h6-closing -[7]:https://linuxconfig.org/configuring-wine-with-winetricks#h7-table-of-contents From bd0fc0ae7c7b386a4ad2648827ebba84c78525ce Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Wed, 5 Apr 2017 03:48:43 -0500 Subject: [PATCH 108/241] =?UTF-8?q?Rename=20Winetricks=E9=85=8D=E7=BD=AEWI?= =?UTF-8?q?NE=20to=20Configuring=20WINE=20with=20Winetricks.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{Winetricks配置WINE => Configuring WINE with Winetricks.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{Winetricks配置WINE => Configuring WINE with Winetricks.md} (100%) diff --git a/translated/tech/Winetricks配置WINE b/translated/tech/Configuring WINE with Winetricks.md similarity index 100% rename from translated/tech/Winetricks配置WINE rename to translated/tech/Configuring WINE with Winetricks.md From 78611fd6e0179dffad46b32f6feff5e3a60e6f67 Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Wed, 5 Apr 2017 03:50:08 -0500 Subject: [PATCH 109/241] Update Configuring WINE with Winetricks.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成 --- translated/tech/Configuring WINE with Winetricks.md | 1 - 1 file changed, 1 deletion(-) diff --git a/translated/tech/Configuring WINE with Winetricks.md b/translated/tech/Configuring WINE with Winetricks.md index d5b451bc91..d838d06582 100644 --- a/translated/tech/Configuring WINE with Winetricks.md +++ b/translated/tech/Configuring WINE with Winetricks.md @@ -76,4 +76,3 @@ via: https://linuxconfig.org/configuring-wine-with-winetricks 作者:Nick Congleton 译者:Taylor1024 校对:校对者ID 本文由 LCTT 原创编译,Linux中国 荣誉推出 - From 91af9ca66ca921e9c5bf30dcfd8cdbeabd0f3d8e Mon Sep 17 00:00:00 2001 From: Taylor1024 <1192877628@qq.com> Date: Wed, 5 Apr 2017 03:52:03 -0500 Subject: [PATCH 110/241] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translated/tech/Configuring WINE with Winetricks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/translated/tech/Configuring WINE with Winetricks.md b/translated/tech/Configuring WINE with Winetricks.md index d838d06582..d5b451bc91 100644 --- a/translated/tech/Configuring WINE with Winetricks.md +++ b/translated/tech/Configuring WINE with Winetricks.md @@ -76,3 +76,4 @@ via: https://linuxconfig.org/configuring-wine-with-winetricks 作者:Nick Congleton 译者:Taylor1024 校对:校对者ID 本文由 LCTT 原创编译,Linux中国 荣誉推出 + From 066c8376a1896f956bdd105ad57ff0ff9cda1e58 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 5 Apr 2017 17:47:00 +0800 Subject: [PATCH 111/241] Translating sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md --- ...21 How to Install a DHCP Server in CentOS RHEL and Fedora.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md b/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md index f405af496f..ffdb08a7e8 100644 --- a/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md +++ b/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md @@ -1,3 +1,5 @@ +ictlyh translating + How to Install a DHCP Server in CentOS, RHEL and Fedora ============================================================ From 06032b209ee750aa0d51248525362d61b5d1df23 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 5 Apr 2017 19:26:21 +0800 Subject: [PATCH 112/241] Translated tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md --- ...a DHCP Server in CentOS RHEL and Fedora.md | 207 ------------------ ...a DHCP Server in CentOS RHEL and Fedora.md | 203 +++++++++++++++++ 2 files changed, 203 insertions(+), 207 deletions(-) delete mode 100644 sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md create mode 100644 translated/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md diff --git a/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md b/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md deleted file mode 100644 index ffdb08a7e8..0000000000 --- a/sources/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md +++ /dev/null @@ -1,207 +0,0 @@ -ictlyh translating - -How to Install a DHCP Server in CentOS, RHEL and Fedora -============================================================ - - -DHCP (Dynamic Host Configuration Protocol) is a network protocol that enables a server to automatically assign an IP address and provide other related network configuration parameters to a client on a network, from a pre-defined IP pool. - -This means that each time a client (connected to the network) boots up, it gets a “dynamic” IP address, as opposed to “static” IP address that never changes. The IP address assigned by a DHCP server to DHCP client is on a “lease”, the lease time can vary depending on how long a client is likely to require the connection or DHCP configuration. - -In this tutorial, we will cover how to install and configure a DHCP server in CentOS/RHEL and Fedora distributions. - -#### Testing Environment Setup - -We are going to use following testing environment for this setup. - -``` -DHCP Server - CentOS 7 -DHCP Clients - Fedora 25 and Ubuntu 16.04 -``` - -#### How Does DHCP Work? - -Before we move any further, let’s briefly explain how DHCP works: - -* When a client computer (configured to use DHCP) and connected to a network is powered on, it forwards a DHCPDISCOVER message to the DHCP server. -* And after the DHCP server receives the DHCPDISCOVER request message, it replies with a DHCPOFFER message. -* Then the client receives the DHCPOFFER message, and it sends a DHCPREQUEST message to the server indicating, it is prepared to get the network configuration offered in the DHCPOFFERmessage. -* Last but not least, the DHCP server receives the DHCPREQUEST message from the client, and sends the DHCPACK message showing that the client is now permitted to use the IP address assigned to it. - -### Step 1: Installing DHCP Server in CentOS - -1. Installing DCHP is quite straight forward, simply run the command below. - -``` -# yum -y install dhcp -``` - -Important: Assuming there is more than one network interface attached to the system, but you want the DHCP server to only be started on one of the interfaces, set the DHCP server to start only on that interface as follows. - -2. Open the file /etc/sysconfig/dhcpd, add the name of the specific interface to the list of DHCPDARGS, for example if the interface is `eth0`, then add: - -``` -DHCPDARGS=eth0 -``` - -Save the file and exit. - -### Step 2: Configuring DHCP Server in CentOS - -3. For starters, to setup a DHCP server, the first step is to create the `dhcpd.conf` configuration file, and the main DHCP configuration file is normally /etc/dhcp/dhcpd.conf (which is empty by default), it keeps all network information sent to clients. - -However, there is a sample configuration file /usr/share/doc/dhcp*/dhcpd.conf.sample, which is a good starting point for configuring a DHCP server. - -And, there are two types of statements defined in the DHCP configuration file, these are: - -* parameters – state how to carry out a task, whether to perform a task, or what network configuration options to send to the DHCP client. -* declarations – specify the network topology, define the clients, offer addresses for the clients, or apply a group of parameters to a group of declarations. - -Therefore, start by copying the sample configuration file as the main configuration file like so: - -``` -# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf -``` - -4. Now, open the main configuration file and define your DHCP server options: - -``` -# vi /etc/dhcp/dhcpd.conf -``` - -Start by setting the following global parameters which will apply to all the subnetworks (do specify values that apply to your scenario) at the top of the file: - -``` -option domain-name "tecmint.lan"; -option domain-name-servers ns1.tecmint.lan, ns2.tecmint.lan; -default-lease-time 3600; -max-lease-time 7200; -authoritative; -``` - -5. Now, define a subnetwork; in this example, we will configure DHCP for 192.168.56.0/24 LAN network (remember to use parameters that apply to your scenario): - -``` -subnet 192.168.56.0 netmask 255.255.255.0 { -option routers 192.168.56.1; -option subnet-mask 255.255.255.0; -option domain-search "tecmint.lan"; -option domain-name-servers 192.168.56.1; -range 192.168.56.10 192.168.56.100; -range 192.168.56.120 192.168.56.200; -} -``` - -### Step 3: Assign Static IP to DHCP Client - -You can assign a static IP address to a specific client computer on the network, simply define the section below in /etc/dhcp/dhcpd.conf file, where you must explicitly specify it’s MAC addresses and the fixed IP to be assigned: - -``` -host ubuntu-node { -hardware ethernet 00:f0:m4:6y:89:0g; -fixed-address 192.168.56.105; -} -host fedora-node { -hardware ethernet 00:4g:8h:13:8h:3a; -fixed-address 192.168.56.110; -} -``` - -Save the file and close it. - -Note: You can find out or display the Linux MAC address using following command. - -``` -# ifconfig -a eth0 | grep HWaddr -``` - -6. Now start the DHCP service for the mean time and enable it to start automatically from the next system boot, using following commands: - -``` ----------- On CentOS/RHEL 7 ---------- -# systemctl start dhcpd -# systemctl enable dhcpd ----------- On CentOS/RHEL 6 ---------- -# service dhcpd start -# chkconfig dhcpd on -``` - -7. Next, do not forget to permit DHCP service (DHCPD daemon listens on port 67/UDP) as below: - -``` ----------- On CentOS/RHEL 7 ---------- -# firewall-cmd --add-service=dhcp --permanent -# firewall-cmd --reload ----------- On CentOS/RHEL 6 ---------- -# iptables -A INPUT -p tcp -m state --state NEW --dport 67 -j ACCEPT -# service iptables save -``` - -### Step 4: Configuring DHCP Clients - -8. Now, you can configure your clients on the network to automatically receive IP addresses from the DHCP server. Login to the client machine and modify the Ethernet interface configuration file as follows (take not of the interface name/number): - -``` -# vi /etc/sysconfig/network-scripts/ifcfg-eth0 -``` - -Add the options below: - -``` -DEVICE=eth0 -BOOTPROTO=dhcp -TYPE=Ethernet -ONBOOT=yes -``` - -Save the file and exit. - -9. You can also perform the settings using the GUI on a desktop computer, set the Method to Automatic (DHCP) as shown in the screenshot below (Ubuntu 16.04 desktop). - -[ - ![Set DHCP in Client Network](http://www.tecmint.com/wp-content/uploads/2017/03/Set-DHCP-in-Client-Network.png) -][3] - -Set DHCP in Client Network - -10. Then restart network services as follows (you can possibly reboot the system): - -``` ----------- On CentOS/RHEL 7 ---------- -# systemctl restart network ----------- On CentOS/RHEL 6 ---------- -# service network restart -``` - -At this point, if all settings were correct, your clients should be receiving IP addresses automatically from the DHCP server. - -You may also read: - -1. [How to Install and Configure Multihomed ISC DHCP Server on Debian Linux][1] -2. [10 Useful “IP” Commands to Configure Network Interfaces][2] - -In this tutorial, we showed you how to setup a DHCP server in RHEL/CentOS. Use the comment form below to write back top us. In an upcoming article, we will show you how to setup a DHCP server in Debian/Ubuntu. Until then, always stay connected to TecMint. - --------------------------------------------------------------------------------- - -作者简介: - -Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-dhcp-server-in-centos-rhel-fedora/ - -作者:[Aaron Kili][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/aaronkili/ -[1]:http://www.tecmint.com/install-and-configure-multihomed-isc-dhcp-server-on-debian-linux/ -[2]:http://www.tecmint.com/ip-command-examples/ -[3]:http://www.tecmint.com/wp-content/uploads/2017/03/Set-DHCP-in-Client-Network.png -[4]:http://www.tecmint.com/author/aaronkili/ -[5]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ -[6]:http://www.tecmint.com/free-linux-shell-scripting-books/ diff --git a/translated/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md b/translated/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md new file mode 100644 index 0000000000..33fa8c3bc3 --- /dev/null +++ b/translated/tech/20170321 How to Install a DHCP Server in CentOS RHEL and Fedora.md @@ -0,0 +1,203 @@ +如何在 CentOS、RHEL 和 Fedora 上安装 DHCP 服务 +============================================================ + +DHCP(Dynamic Host Configuration Protocol)是一个网络协议,它使得服务器能从预定义的 IP 池中为网络中的客户端节点自动分配 IP 地址并提供其它相关的网络配置参数。 + +这意味着每次客户端节点启动(连接到网络)的时候,它都会获得一个和从不改变的“静态” IP 地址相反的“动态” IP 地址。DHCP 服务器给 DHCP 客户端分配 IP 地址称为“租约”,租约时间随客户端需要的连接时间或 DHCP 的配置而异。 + +在这篇指南中,我们会介绍如何在 CentOS/RHEL 和 Fedora 发行版中安装和配置 DHCP 服务。 + +#### 设置测试环境 + +本次安装中我们使用如下的测试环境。 + +``` +DHCP 服务器 - CentOS 7 +DHCP 客户端 - Fedora 25 和 Ubuntu 16.04 +``` + +#### DHCP 如何工作? + +在进入下一步之前,让我们首先了解一下 DHCP 的工作流程: + +* 当已连接到网络的客户端计算机(配置为使用 DHCP)启动时,它会发送一个 DHCPDISCOVER 消息到 DHCP 服务器。 +* 当 DHCP 服务器接收到 DHCPDISCOVER 请求消息时,它会回复一个 DHCPOFFER 消息。 +* 客户端收到 DHCPOFFER 消息后,它再发送给服务器一个 DHCPREQUEST 消息,表示客户端已准备好获取 DHCPOFFER 消息中提供的网络配置。 +* 最后,DHCP 服务器收到客户端的 DHCPREQUEST 消息,并回复 DHCPACK 消息,表示允许客户端使用分配给它的 IP 地址。 + +### 第一步:在 CentOS 上安装 DHCP 服务 + +1. 安装 DHCP 服务非常简单,只需要运行下面的命令即可。 + +``` +$ yum -y install dhcp +``` + +重要:假如系统中有多个网卡,但你想只在其中一个网卡上启用 DHCP 服务,可以按照下面的步骤在该网卡上启用 DHCP 服务。 + +2. 打开文件 /etc/sysconfig/dhcpd,将指定网卡的名称添加到 DHCPDARGS 列表,假如网卡名称为 `eth0`,则添加: + +``` +DHCPDARGS=eth0 +``` + +保存文件并退出 。 + +### 第二步:在 CentOS 上配置 DHCP 服务 + +3. 对于初学者来说,配置 DHCP 服务的第一步是创建 `dhcpd.conf` 配置文件,DHCP 主要配置文件一般是 /etc/dhcp/dhcpd.conf(默认情况下该文件为空),该文件保存了发送给客户端的所有网络信息。 + +但是,有一个样例配置文件 /usr/share/doc/dhcp*/dhcpd.conf.sample,这是配置 DHCP 服务的良好开始。 + +DHCP 配置文件中定义了两种类型的语句: + +* 参数 - 说明如何执行任务、是否执行任务、或者给 DHCP 客户端发送什么网络配置选项。 +* 声明 - 指定网络拓扑、定义客户端、提供客户端地址、或将一组参数应用于一组声明。 + +因此,首先复制示例配置文件为主配置文件: + +``` +$ cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf +``` + +4. 然后,打开主配置文件并定义你的 DHCP 服务选项: + +``` +$ vi /etc/dhcp/dhcpd.conf +``` + +首先在文件开头设置以下应用于全部子网的全局参数(注意要使用你实际场景中的值): + +``` +option domain-name "tecmint.lan"; +option domain-name-servers ns1.tecmint.lan, ns2.tecmint.lan; +default-lease-time 3600; +max-lease-time 7200; +authoritative; +``` + +5. 然后,定义一个子网;在这个事例中,我们会为 192.168.56.0/24 局域网配置 DHCP(注意使用你实际场景中的值): + +``` +subnet 192.168.56.0 netmask 255.255.255.0 { +option routers 192.168.56.1; +option subnet-mask 255.255.255.0; +option domain-search "tecmint.lan"; +option domain-name-servers 192.168.56.1; +range 192.168.56.10 192.168.56.100; +range 192.168.56.120 192.168.56.200; +} +``` + +### 第三步:为 DHCP 客户端分配静态 IP + +只需要在 /etc/dhcp/dhcpd.conf 文件中定义下面的部分,其中你必须显式指定它的 MAC 地址和打算分配的 IP,你就可以为网络中指定的客户端计算机分配一个静态 IP 地址: + +``` +host ubuntu-node { +hardware ethernet 00:f0:m4:6y:89:0g; +fixed-address 192.168.56.105; +} +host fedora-node { +hardware ethernet 00:4g:8h:13:8h:3a; +fixed-address 192.168.56.110; +} +``` + +保存文件并关闭。 + +注意:你可以使用下面的命令找到 Linux 的 MAC 地址。 + +``` +$ ifconfig -a eth0 | grep HWaddr +``` + +6. 现在,使用下面的命令启动 DHCP 服务,并使在下次系统启动时自动启动: + +``` +---------- On CentOS/RHEL 7 ---------- +$ systemctl start dhcpd +$ systemctl enable dhcpd +---------- On CentOS/RHEL 6 ---------- +$ service dhcpd start +$ chkconfig dhcpd on``` + +7. 另外,别忘了使用下面的命令允许 DHCP 服务通过防火墙(DHCPD 守护进程通过 UDP 监听67号端口): + +``` +---------- On CentOS/RHEL 7 ---------- +$ firewall-cmd --add-service=dhcp --permanent +$ firewall-cmd --reload +---------- On CentOS/RHEL 6 ---------- +$ iptables -A INPUT -p tcp -m state --state NEW --dport 67 -j ACCEPT +$ service iptables save +``` + +### 第四步:配置 DHCP 客户端 + +8. 现在,你可以为网络中的客户端配置自动从 DHCP 服务器中获取 IP 地址。登录到客户端机器并按照下面的方式修改以太网接口的配置文件(注意网卡的名称和编号): + +``` +# vi /etc/sysconfig/network-scripts/ifcfg-eth0 +``` + +添加下面的选项: + +``` +DEVICE=eth0 +BOOTPROTO=dhcp +TYPE=Ethernet +ONBOOT=yes +``` + +保存文件并退出。 + +9. 你也可以在桌面服务器中按照下面的截图(Ubuntu 16.04桌面版)通过 GUI 设置 Method 为 Automatic (DHCP)。 + +[ + ![Set DHCP in Client Network](http://www.tecmint.com/wp-content/uploads/2017/03/Set-DHCP-in-Client-Network.png) +][3] + +在客户端网络中设置 DHCP + +10. 按照下面的命令重启网络服务(你也可以通过重启系统): + +``` +---------- On CentOS/RHEL 7 ---------- +$ systemctl restart network +---------- On CentOS/RHEL 6 ---------- +$ service network restart +``` + +到了这里,如果所有设置都是正确的,你的客户端就应该能自动从 DHCP 服务器中获取 IP 地址。 + +你也可以阅读: + +1. [如何在 Debian Linux 中安装和配置 Multihomed ISC DHCP 服务][1] +2. [配置网络的10个有用的 “IP” 命令][2] + +在这篇文章中我们为你展示了如何在 RHEL/CentOS 中安装 DHCP 服务。在下面的评论框中给我们反馈吧。在接下来的文章中,我们还会为你展示如何在 Debian/Ubuntu 中安装 DHCP 服务。和 TecMint 保持联系。 + +-------------------------------------------------------------------------------- + +作者简介: + +Aaron Kili 是一个 Linux 和 F.O.S.S 的爱好者,即将推出的 Linux SysAdmin 网络开发人员,目前也是 TecMint 的内容创作者,他喜欢和电脑一起工作,并且坚信共享知识。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-dhcp-server-in-centos-rhel-fedora/ + +作者:[Aaron Kili][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/aaronkili/ +[1]:http://www.tecmint.com/install-and-configure-multihomed-isc-dhcp-server-on-debian-linux/ +[2]:http://www.tecmint.com/ip-command-examples/ +[3]:http://www.tecmint.com/wp-content/uploads/2017/03/Set-DHCP-in-Client-Network.png +[4]:http://www.tecmint.com/author/aaronkili/ +[5]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/ +[6]:http://www.tecmint.com/free-linux-shell-scripting-books/ From 59cfc6c56bf137376bbb4d3d61768bec6575efc8 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 5 Apr 2017 19:35:33 +0800 Subject: [PATCH 113/241] Translating tech/20160926 First 5 Commands When I Connect on a Linux Server.md --- ...0160926 First 5 Commands When I Connect on a Linux Server.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md b/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md index ca66923eee..37dc939cb4 100644 --- a/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md +++ b/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md @@ -1,3 +1,5 @@ +ictlyh translating + First 5 Commands When I Connect on a Linux Server ============================================================ From af0cd0a4cc6aa443d30f8cc912ccdf1667a4f64d Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 5 Apr 2017 20:20:02 +0800 Subject: [PATCH 114/241] Translated tech/20160926 First 5 Commands When I Connect on a Linux Server.md --- ...mmands When I Connect on a Linux Server.md | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) rename {sources => translated}/tech/20160926 First 5 Commands When I Connect on a Linux Server.md (68%) diff --git a/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md b/translated/tech/20160926 First 5 Commands When I Connect on a Linux Server.md similarity index 68% rename from sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md rename to translated/tech/20160926 First 5 Commands When I Connect on a Linux Server.md index 37dc939cb4..d0f2994467 100644 --- a/sources/tech/20160926 First 5 Commands When I Connect on a Linux Server.md +++ b/translated/tech/20160926 First 5 Commands When I Connect on a Linux Server.md @@ -1,16 +1,14 @@ -ictlyh translating - -First 5 Commands When I Connect on a Linux Server +当我连接到 Linux 服务器时运行的前 5 个命令 ============================================================ - ![First 5 shell commands I type when I connect to a linux server](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/first-5-commands_0.jpg?itok=sITDZBzw "First 5 shell commands I type when I connect to a linux server") -[Creative Commons Attribution][1][Sylvain Kalache][2][First 5 shell commands I type when I connect to a linux server][3] + ![当我连接到 Linux 服务器时运行的前 5 个命令](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/first-5-commands_0.jpg?itok=sITDZBzw "当我连接到 Linux 服务器时运行的前 5 个命令") +[Creative Commons Attribution][1][Sylvain Kalache][2][当我连接到 Linux 服务器时运行的前 5 个命令][3] -After half a decade working as a system administrator/SRE, I know where to start when I am connecting to a Linux server. There is a set of information that you must know about the server in order to properly, well most of the time, debug it. +作为一个系统管理员/SRE 工作50年后,我知道当我连接到一台 Linux 服务器时我首先应该做什么。为了(在大部分时间里)更好的调试该服务器,这里有一系列关于服务器你必须了解的信息。 -### First 60 seconds on a Linux server +### 连上 Linux 服务器的第一分钟 -These commands are well known for experienced software engineers but I realized that for a beginner who is getting started with Linux systems, such as my students at [Holberton School][5], it is not obvious. That’s why I decided to share the list of the first 5 commands I type when I connect on a Linux server. +这些命令对于有经验的软件工程师来说都非常熟悉,但我意识到对于一个刚开始接触 Linux 系统的初学者来说,例如我在 [Holberton 学习][5]任教的学生,却并非如此。这也是我为什么决定分享当我连上 Linux 服务器首先要运行的5个命令的原因。 ``` w @@ -20,7 +18,7 @@ df netstat ``` -These 5 commands are shipped with any Linux distribution so you can use them everywhere without extra installation needed. +这5个命令在任何一个 Linux 发行版中都有,因此不需要额外的安装步骤你就可以直接使用它们。 ### w: @@ -33,7 +31,7 @@ root pts/1 104-7-14-91.ligh 23:40 5.00s 0.01s 0.03s sshd: root [priv] [ubuntu@ip-172-31-48-251 ~]$ ``` -A lot of great information in there. First, you can see the server [uptime][6] which is the time during which the server has been continuously running. You can then see what users are connected on the server, quite useful when you want to make sure that you are not impacting a colleague’s work. Finally the [load average][7] will give you a good sense of the server health. +这里列出了很多有用的信息。首先,你可以看到服务器运行时间 [uptime][6],也就是服务器持续运行的时间。然后你可以看到有哪些用户连接到了服务器,当你要确认你没有影响你同事工作的时候这非常有用。最后 [load average][7] 能很好的向你展示服务器的健康状态。 ### history: @@ -46,7 +44,7 @@ A lot of great information in there. First, you can see the server [uptime][6] 5 cat ../../app/services/discourse_service.rb ``` -`History` will tell you what was previously run by the user you are currently connected to. You will learn a lot about what type work was previously performed on the machine, what could have gone wrong with it, and where you might want to start your debugging work. +`history` 能告诉你当前连接的用户之前运行了什么命令。你可以看到很多关于这台机器之前在执行什么类型的任务、可能出现了什么错误、可以从哪里开始调试工作等信息。 ### top: @@ -70,7 +68,7 @@ Swap: 0k total, 0k used, 0k free, 1052320k cached 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh ``` -The next information you want to know: what is currently running on this server. With `top` you can see all running processes, then order them by CPU, memory utilization and catch the ones that are resource intensive. +你想知道的下一个信息:服务器当前在执行什么工作。使用 `top` 命令你可以看到所有正在执行的进程,然后可以按照 CPU、内存使用进行排序,并找到资源敏感的进程。 ### df: @@ -82,7 +80,7 @@ devtmpfs 1.9G 12K 1.9G 1% /dev tmpfs 1.9G 0 1.9G 0% /dev/shm ``` -The next important resource that your server needs to have to be working properly is disk space. Running out of it is a very classic issue. +你服务器正常工作需要的下一个重要资源就是磁盘空间。磁盘空间消耗完是非常典型的问题。 ### netstat: @@ -99,16 +97,16 @@ tcp 0 0 *:4242 *:* LIST tcp 0 0 *:ssh *:* LISTEN 1209/sshd ``` -Computers are a big part of our world now because they have the ability to communicate between each other via sockets. It is critical for you to know on what port and IP your server is listening on and what processes are using those. +计算机已成为我们世界的重要一部分,因为它们有通过套接字进行相互交流的能力。知道你的服务器正在监听什么端口、IP地址是什么、以及哪些进程在使用它们,这对于你来说都非常重要。 -Obviously this list might change depending on your goal and the amount of existing information you have. For example, when you want to debug specifically for performance, [Netflix came up with a customized list][8]. Do you have a useful command that is not in my top 5? Please share it in the comments section! +显然这个列表会随着你的目的和你已有的信息而变化。例如,当你需要调试性能的时候,[Netflix就有一个自定义的列表][8]。你有任何不在我 Top 5中的有用命令吗?在评论部分和我们一起分享吧! -------------------------------------------------------------------------------- via: https://www.linux.com/blog/first-5-commands-when-i-connect-linux-server 作者:[SYLVAIN KALACHE ][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ictlyh](https://github.com/ictlyh) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 89cf7189a5a3c343576a6ba5acb10d9b41e60d69 Mon Sep 17 00:00:00 2001 From: Mars Wong Date: Wed, 5 Apr 2017 22:37:32 +0800 Subject: [PATCH 115/241] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=E5=AE=8C=E6=AF=95=20?= =?UTF-8?q?@OneNewLife?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...about traditional JavaScript benchmarks.md | 134 +++++++++--------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/translated/tech/20161216 The truth about traditional JavaScript benchmarks.md b/translated/tech/20161216 The truth about traditional JavaScript benchmarks.md index 3d616d8fa7..c9c52bab03 100644 --- a/translated/tech/20161216 The truth about traditional JavaScript benchmarks.md +++ b/translated/tech/20161216 The truth about traditional JavaScript benchmarks.md @@ -1,43 +1,43 @@ 探索传统 JavaScript 基准测试 ============================================================ -可以很公平地说,[JavaScript][22] 是当下软件工程最为重要的技术。由于在语言设计者看来,JavaScript 不是十分优雅;在编译器工程师看来,它的性能没有多卓越;并且它还没有一个足够庞大的标准库,所以对于深入接触过编程语言、编译器和虚拟机的人来说,这依然是一个惊喜。取决于你和谁吐槽,JavaScript 的缺点花上数周都列举不完,不过你总会找到一些你从所未知的神奇的东西。尽管这看起来明显困难重重,不过 JavaScript 今天还是成为了 web 的核心,并且还成为服务器/云端的主要技术(通过 [Node.js][23]),甚至还开辟了进入物联网领域的道路。 +可以很公平地说,[JavaScript][22] 是当下软件工程最重要的技术。对于那些深入接触过编程语言、编译器和虚拟机的人来说,这仍然有点令人惊讶,因为在语言设计者看来,`JavaScript` 不是十分优雅;在编译器工程师看来,它没有多少可优化的地方;而且还没有一个伟大的标准库。取决于你和谁吐槽,`JavaScript` 的缺点你花上数周都枚举不完,不过你总会找到一些你从所未知的神奇的东西。尽管这看起来明显困难重重,不过 `JavaScript` 还是成为当今 web 的核心,并且还成为服务器端/云端的主导技术(通过 [Node.js][23]),甚至还开辟了进军物联网空间的道路。 -问题来了,为什么 JavaScript 如此受欢迎/成功?我从未得到一个很好的答案。如今我们有很多理由使用 JavaScript,或许最重要的是围绕其构建的庞大的生态系统以及今天大量可用的资源。但所有这一切实际上是发展到一定程度的结果。为什么 JavaScript 变得流行起来了?嗯,你或许会说,这是 web 多年来的通用语了。但是在很长一段时间里,人们极其讨厌 JavaScript。回顾过去,似乎第一次 JavaScript 浪潮爆发在上个年代的后半段。不出所料,那个时候 JavaScript 引擎在不同的负载下实现了巨大的加速,这可能刷新了很多人对 JavaScript 的看法。 +问题来了,为什么 `JavaScript` 如此受欢迎/成功?我知道没有一个很好的答案。如今我们有许多使用 `JavaScript` 的好理由,或许最重要的是围绕其构建的庞大的生态系统,以及今天大量可用的资源。但所有这一切实际上是发展到一定程度的后果。为什么 `JavaScript` 变得流行起来了?嗯,你或许会说,这是 web 多年来的通用语了。但是在很长一段时间里,人们极其讨厌 `JavaScript`。回顾过去,似乎第一波 `JavaScript` 浪潮爆发在上个年代的后半段。不出所料,那个时候 `JavaScript` 引擎在不同的负载下实现了巨大的加速,这可能让很多人对 `JavaScript` 刮目相看。 -回到过去那些日子,这些加速测试使用了今天所谓的传统 JavaScript 基准,从苹果的 [SunSpider 基准][24](所有 JavaScript 微基准之母)到 Mozilla 的 [Kraken 基准][25] 和谷歌的 V8 基准。后来,V8 基准被 [Octane 基准][26] 取代,而苹果发布了自家新的 [JetStream 基准][27]。这些传统的 JavaScript 基准测试驱动了令人惊叹的努力,使 JavaScript 的性能达到一个在本世纪初没人能预料到的水平。据报道加速达到了 1000 倍,一夜之间在网站使用 `