From f25bdccbce77f39c3973962f2ee712f1bf646e53 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 27 Apr 2015 12:05:05 +0800 Subject: [PATCH 001/133] Translating by ZTinoZ --- ...9 Install Inkscape - Open Source Vector Graphic Editor.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md b/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md index fcbe4ee240..ba022a2efd 100644 --- a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md +++ b/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md @@ -1,7 +1,6 @@ -Translating by ZTinoZ -Install Inkscape - Open Source Vector Graphic Editor +安装Inkscape - 开源适量图形编辑器 ================================================================================ -Inkscape is an open source vector graphic editing tool which uses Scalable Vector Graphics (SVG) and that makes it different from its competitors like Xara X, Corel Draw and Adobe Illustrator etc. SVG is a widely-deployed royalty-free graphics format developed and maintained by the W3C SVG Working Group. It is a cross platform tool which runs fine on Linux, Windows and Mac OS. +Inkscape是一款开源矢量图形编辑工具,它使用可缩放矢量图形(SVG)图形格式并不同于它的竞争对手如Xara X、Corel Draw和Adobe Illustrator等等。SVG是一个广泛部署、免版税使用的图形格式,由W3C SVG工作组开发和维护。这是一个跨平台工具,完美运行于Linux、Windows和Mac OS上。 Inkscape development was started in 2003, Inkscape's bug tracking system was hosted on Sourceforge initially but it was migrated to Launchpad afterwards. Its current latest stable version is 0.91. It is under continuous development and bug fixes and we will be reviewing its prominent features and installing process in the article. From 62d045dd58e4a568aca855d2418ca55a12c0e426 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 27 Apr 2015 15:41:46 +0800 Subject: [PATCH 002/133] PUB:30 Things to Do After Minimal RHEL or CentOS 7 Installation--1 @ictlyh --- ...inimal RHEL or CentOS 7 Installation--1.md | 80 ++++++++++++------- 1 file changed, 51 insertions(+), 29 deletions(-) rename {translated/tech => published}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md (70%) diff --git a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md similarity index 70% rename from translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md rename to published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md index 6736eda4e0..45ccd2208a 100644 --- a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md +++ b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md @@ -1,13 +1,13 @@ -安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情--1 +安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(一) ================================================================================ -CentOS 是一个工业标准的 Linux 发行版,是红帽企业版 Linux 的衍生版本。你安装完后马上就可以使用,但是为了更好地使用你的系统,你需要进行一些升级、软件包安装、配置特定服务和应用程序等操作。 +CentOS 是一个工业标准的 Linux 发行版,是红帽企业版 Linux 的衍生版本。你安装完后马上就可以使用,但是为了更好地使用你的系统,你需要进行一些升级、安装新的软件包、配置特定服务和应用程序等操作。 -这篇文章介绍了 “安装完 RHEL/CentOS 7 后需要做的 30 件事情”。阅读帖子的时候请牢记已经完成了 RHEL/CentOS 最小化安装,这是首选的企业和生产环境,如果还没有,你可以按照下面的指南,它会告诉你两者的最小化安装方法。 +这篇文章介绍了 “安装完 RHEL/CentOS 7 后需要做的 30 件事情”。阅读帖子的时候请先完成 RHEL/CentOS 最小化安装,这是首选的企业和生产环境。如果还没有,你可以按照下面的指南,它会告诉你两者的最小化安装方法。 - [最小化安装 CentOS 7][1] - [最小化安装 RHEL 7][2] -下面是一些重要的事情列表,基于工业标准需求我们都会进行介绍。我们希望这些东西在你配置服务器的时候能有所帮助。 +我们会基于工业标准的需求来介绍以下列出的这些重要工作。我们希望这些东西在你配置服务器的时候能有所帮助。 1. 注册并启用红帽订阅 2. 使用静态 IP 地址配置网络 @@ -42,50 +42,54 @@ CentOS 是一个工业标准的 Linux 发行版,是红帽企业版 Linux 的 ### 1. 注册并启用红帽订阅 ### -RHEL 7 最小化安装完成后,是时候注册并启用系统红帽订阅库,以及执行一个完整的系统更新。这只当你有一个可用的红帽订阅时才能有效。你要注册才能启用官方红帽系统库并时不时进行操作系统更新。 +RHEL 7 最小化安装完成后,就应该注册并启用系统红帽订阅库, 并执行一个完整的系统更新。这只当你有一个可用的红帽订阅时才能有用。你要注册才能启用官方红帽系统库,并时不时进行操作系统更新。(LCTT 译注:订阅服务是收费的) 在下面的指南中我们已经包括了一个如何注册并激活红帽订阅的详细说明。 - [在 RHEL 7 中注册并启用红帽订阅][3] -**注意**: 这一步仅适用于有一个有效订阅的红帽企业版 Linux. 如果你用的是 CentOS 服务器,请查看后面的章节。 +**注意**: 这一步仅适用于有一个有效订阅的红帽企业版 Linux。如果你用的是 CentOS 服务器,请查看后面的章节。 ### 2. 使用静态 IP 地址配置网络 ### -你第一件要做的事情就是为你的 CentOS 服务器配置静态 IP 地址,路由以及 DNS。我们会使用 ip 命令代替 ifconfig 命令。当然,ifconfig 命令对于大部分 Linux 发行版来说还是可用的,还能从默认库安装。 +你第一件要做的事情就是为你的 CentOS 服务器配置静态 IP 地址、路由以及 DNS。我们会使用 ip 命令代替 ifconfig 命令。当然,ifconfig 命令对于大部分 Linux 发行版来说还是可用的,还能从默认库安装。 - # yum install net-tools [提供 ifconfig 工具] + # yum install net-tools [它提供 ifconfig 工具,如果你不习惯 ip 命令,还可以使用它] ![在 Linux 上安装 ifconfig](http://www.tecmint.com/wp-content/uploads/2015/04/Install-ifconfig.jpeg) +(LCTT 译注:关于 ip 命令的使用,请参照:http://www.linux.cn/article-3631-1.html ) + 但正如我之前说,我们会使用 ip 命令来配置静态 IP 地址。所以,确认你首先检查了当前的 IP 地址。 # ip addr show ![在 CentOS 查看 IP 地址](http://www.tecmint.com/wp-content/uploads/2015/04/Check-IP-Address.jpeg) -现在用你的编辑器打开并编辑文件 /etc/sysconfig/network-scripts/ifcfg-enp0s3。这里,我使用 Vi 编辑器,另外你要确保你是 root 用户才能保存更改。 +现在用你的编辑器打开并编辑文件 /etc/sysconfig/network-scripts/ifcfg-enp0s3 (LCTT 译注:你的网卡名称可能不同,如果希望修改为老式网卡名称,参考:http://www.linux.cn/article-4045-1.html )。这里,我使用 vi 编辑器,另外你要确保你是 root 用户才能保存更改。 # vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 我们会编辑文件中的四个地方。注意下面的四个地方并保证不碰任何其它的东西。也保留双引号,在它们中间输入你的数据。 - IPADDR = “[在这里输入你的静态 IP]” - GATEWAY = “[输入你的默认网关]” - DNS1 = “[你的域名系统 1]” - DNS2 = “[你的域名系统 2]” + IPADDR = "[在这里输入你的静态 IP]" + GATEWAY = "[输入你的默认网关]" + DNS1 = "[你的DNS 1]" + DNS2 = "[你的DNS 2]" -更改了 ‘ifcfg-enp0s3’ 之后,看起来像下面的图片。注意你的 IP,网关和 DNS 可能会变化,请和你的 ISP(译者注:互联网服务提供商商) 确认。保存并退出。 +更改了 ‘ifcfg-enp0s3’ 之后,它看起来像下面的图片。注意你的 IP,网关和 DNS 可能会变化,请和你的 ISP(译者注:互联网服务提供商,即给你提供接入的服务的电信或 IDC) 确认。保存并退出。 ![网络详情](http://www.tecmint.com/wp-content/uploads/2015/04/Network-Details.jpeg) -网络详情 + +*网络详情* 重启网络服务并检查 IP 是否和分配的一样。如果一切都顺利,用 Ping 查看网络状态。 # service network restart ![重启网络服务](http://www.tecmint.com/wp-content/uploads/2015/04/Restarat-Network.jpeg) -重启网络服务 + +*重启网络服务* 重启网络后,确认检查了 IP 地址和网络状态。 @@ -93,10 +97,14 @@ RHEL 7 最小化安装完成后,是时候注册并启用系统红帽订阅库 # ping -c4 google.com ![验证 IP 地址](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-IP-Address.jpeg) -验证 IP 地址 + +*验证 IP 地址* ![检查网络状态](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Network-Status.jpeg) -检查网络状态 + +*检查网络状态* + +(LCTT 译注:关于设置静态 IP 地址的更多信息,请参照:http://www.linux.cn/article-3977-1.html ) ### 3. 设置服务器的主机名称 ### @@ -105,34 +113,40 @@ RHEL 7 最小化安装完成后,是时候注册并启用系统红帽订阅库 # echo $HOSTNAME ![查看系统主机名称](http://www.tecmint.com/wp-content/uploads/2015/04/Check-System-Hostname.jpeg) -查看系统主机名称 + +*查看系统主机名称* 要设置新的主机名称,我们需要编辑 ‘/etc/hostsname’ 文件并用想要的名称替换旧的主机名称。 # vi /etc/hostname ![在 CentOS 中设置主机名称](http://www.tecmint.com/wp-content/uploads/2015/04/Set-System-Hostname.jpeg) -在 CentOS 中设置主机名称 + +*在 CentOS 中设置主机名称* 设置完了主机名称之后,务必注销后重新登录确认主机名称。登录后检查新的主机名称。 $ echo $HOSTNAME ![确认主机名称](http://www.tecmint.com/wp-content/uploads/2015/04/Confirm-Hostname.jpeg) -确认主机名称 + +*确认主机名称* 你也可以用 ‘hostname’ 命令查看你当前的主机名。 $ hostname +(LCTT 译注:关于设置静态、瞬态和灵活主机名的更多信息,请参考:http://www.linux.cn/article-3937-1.html ) + ### 4. 更新或升级最小化安装的 CentOS ### -除了更新和安装已经有的软件的最新版本以及安全升级,这不会安装任何新的软件。总的来说更新和升级是相同的,除了事实上 升级 = 更新 + 更新时进行废弃处理。 +这样做除了更新安装已有的软件最新版本以及安全升级,不会安装任何新的软件。总的来说更新(update)和升级(upgrade)是相同的,除了事实上 升级 = 更新 + 更新时进行废弃处理。 # yum update && yum upgrade ![更新最小化安装的 CentOS 服务器](http://www.tecmint.com/wp-content/uploads/2015/04/Update-CentOS-Server.jpeg) -更新最小化安装的 CentOS 服务器 + +*更新最小化安装的 CentOS 服务器* **重要**: 你也可以运行下面的命令,这不会弹出软件更新的提示,你也就不需要输入 ‘y’ 接受更改。 @@ -147,7 +161,8 @@ RHEL 7 最小化安装完成后,是时候注册并启用系统红帽订阅库 # yum install links ![安装命令行浏览器](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Commandline-Browser.jpeg) -Links: 命令行 Web 浏览器 + +*Links: 命令行 Web 浏览器* 请查看我们的文章 [用 links 工具命令行浏览 Web][4] 了解用 links 工具浏览 web 的方法和例子。 @@ -157,8 +172,9 @@ Links: 命令行 Web 浏览器 # yum install httpd -![在 CentOS 上安装 Apache](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Apache-on-CentOS.jpeg.) -安装 Apache 服务器 +![在 CentOS 上安装 Apache](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Apache-on-CentOS.jpeg) + +*安装 Apache 服务器* 如果你想更改 Apache HTTP 服务器的默认端口号(80)为其它端口,你需要编辑配置文件 ‘/etc/httpd/conf/httpd.conf’ 并查找以下面开始的行: @@ -167,7 +183,8 @@ Links: 命令行 Web 浏览器 把端口号 ‘80’ 改为其它任何端口(例如 3221),保存并退出。 ![在 CentOS 上更改 Apache 端口](http://www.tecmint.com/wp-content/uploads/2015/04/Change-Apache-Port.jpeg) -更改 Apache 端口 + +*更改 Apache 端口* 增加刚才分配给 Apache 的端口通过防火墙,然后重新加载防火墙。 @@ -183,6 +200,8 @@ Links: 命令行 Web 浏览器 # firewall-cmd –reload +(LCTT 译注:关于 firewall 的进一步使用,请参照:http://www.linux.cn/article-4425-1.html ) + 完成上面的所有事情之后,是时候重启 Apache HTTP 服务器了,然后新的端口号才能生效。 # systemctl restart httpd.service @@ -192,12 +211,15 @@ Links: 命令行 Web 浏览器 # systemctl start httpd.service # systemctl enable httpd.service +(LCTT 译注:关于 systemctl 的进一步使用,请参照:http://www.linux.cn/article-3719-1.html ) + 如下图所示,用 links 命令行工具 验证 Apache HTTP 服务器。 # links 127.0.0.1 ![验证 Apache 状态](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-Apache-Status.jpeg) -验证 Apache 状态 + +*验证 Apache 状态* -------------------------------------------------------------------------------- @@ -205,7 +227,7 @@ via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installatio 作者:[Avishek Kumar][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 1e64ea0c0bb77d008ff63f79544862fc370bf7b7 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 27 Apr 2015 16:10:40 +0800 Subject: [PATCH 003/133] PUB:30 Things to Do After Minimal RHEL or CentOS 7 Installation--2 @ictlyh --- ...inimal RHEL or CentOS 7 Installation--2.md | 59 +++++++++++-------- 1 file changed, 35 insertions(+), 24 deletions(-) rename {translated/tech => published}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md (62%) diff --git a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md similarity index 62% rename from translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md rename to published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md index c5e0f29857..6eeff54bae 100644 --- a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md +++ b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md @@ -1,8 +1,8 @@ -安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情--2 +安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(二) ================================================================================ ### 7. 安装 PHP ### -PHP 是用于 web 基础服务的服务器端脚本语言。它也经常被用作通用编程语言。在最小化安装的 CentOS 中安装 PHP。 +PHP 是用于 web 基础服务的服务器端脚本语言。它也经常被用作通用编程语言。在最小化安装的 CentOS 中安装 PHP: # yum install php @@ -12,7 +12,7 @@ PHP 是用于 web 基础服务的服务器端脚本语言。它也经常被用 下一步,通过在 Apache 文档根目录下创建下面的 php 脚本验证 PHP。 - # echo -e "" > /var/ww/html/phpinfo.php + # echo -e "" > /var/www/html/phpinfo.php 现在在 Linux 命令行中查看我们刚才创建的 PHP 文件(phpinfo.php)。 @@ -21,32 +21,35 @@ PHP 是用于 web 基础服务的服务器端脚本语言。它也经常被用 # links http://127.0.0.1/phpinfo.php ![验证 PHP](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-PHP.jpeg) -验证 PHP + +*验证 PHP* ### 8. 安装 MariaDB 数据库 ### -MariaDB 是 MySQL 的一个分支。红帽企业版 Linux 以及它的衍生版已经从 MySQL 迁移到 MariaDB。这是个主要的数据库管理系统。这又是一个你必须拥有的工具,不管你在配置怎样的服务器,或迟或早你都会需要它。在最小化安装的 CentOS 上安装 MariaDB,如下所示。 +MariaDB 是 MySQL 的一个分支。RHEL 以及它的衍生版已经从 MySQL 迁移到 MariaDB。这是一个主流的数据库管理系统,也是一个你必须拥有的工具。不管你在配置怎样的服务器,或迟或早你都会需要它。在最小化安装的 CentOS 上安装 MariaDB,如下所示: # yum install mariadb-server mariadb ![安装 MariaDB 数据库](http://www.tecmint.com/wp-content/uploads/2015/04/Install-MariaDB-Database.jpeg) -安装 MariaDB 数据库 -启动被配置 MariaDBs 随机启动。 +*安装 MariaDB 数据库* + +启动 MariaDB 并配置它开机时自动启动。 # systemctl start mariadb.service # systemctl enable mariadb.service -允许 mysql(mariadb) 服务通过防火墙 +允许 mysql(mariadb) 服务通过防火墙(LCTT 译注:如果你的 MariaDB 只用在本机,则务必不要设置防火墙允许通过,使用 UNIX Socket 连接你的数据库;如果需要在别的服务器上连接数据库,则尽量使用内部网络,而不要将数据库服务暴露在公开的互联网上。) # firewall-cmd –add-service=mysql -现在是时候确保 MariaDB 服务器安全了。 +现在是时候确保 MariaDB 服务器安全了(LCTT 译注:这个步骤主要是设置 mysql 管理密码)。 # /usr/bin/mysql_secure_installation ![保护 MariaDB 数据库](http://www.tecmint.com/wp-content/uploads/2015/04/Secure-MariaDB.jpeg) -保护 MariaDB 数据库 + +*保护 MariaDB 数据库* 请阅读: @@ -55,18 +58,19 @@ MariaDB 是 MySQL 的一个分支。红帽企业版 Linux 以及它的衍生版 ### 9. 安装和配置 SSH 服务器 ### -SSH 表示 Secure Shell,是 Linux 远程管理的默认协议。 SSH 是随最小化 CentOS 服务器一起发布的最重要的软件之一。 +SSH 即 Secure Shell,是 Linux 远程管理的默认协议。 SSH 是随最小化 CentOS 服务器中安装运行的最重要的软件之一。 检查当前已安装的 SSH 版本。 # SSH -V ![检查 SSH 版本](http://www.tecmint.com/wp-content/uploads/2015/04/Check-SSH-Version.jpeg) -检查 SSH 版本 -在默认的 SSH 协议上使用安全协议,更改端口号进一步加强安全。编辑 SSH 的配置文件 ‘/etc/ssh/ssh_config’。 +*检查 SSH 版本* -去掉下面行的注释或者从协议行中删除 1,然后行看起来像这样: +使用更安全的 SSH 协议,而不是默认的协议,并更改端口号进一步加强安全。编辑 SSH 的配置文件 ‘/etc/ssh/ssh_config’。 + +去掉下面行的注释或者从协议行中删除 1,然后行看起来像这样(LCTT 译注: SSH v1 是过期废弃的不安全协议): # Protocol 2,1 (原来) Protocol 2 (现在) @@ -74,15 +78,17 @@ SSH 表示 Secure Shell,是 Linux 远程管理的默认协议。 SSH 是随最 这个改变强制 SSH 使用 协议 2,它被认为比协议 1 更安全,同时也确保在配置中更改端口号 22 为其它。 ![保护 SSH 登录](http://www.tecmint.com/wp-content/uploads/2015/04/Secure-SSH.jpeg) -保护 SSH 登录 -取消 SSH ‘root login’ 然后允许只有当以普通用户账号登录后才能连接到 root 以进一步加强安全。为了做到这个,打开并编辑配置文件 ‘/etc/ssh/sshd_config’ 并更改 PermitRootLogin yes 为 PermitRootLogin no。 +*保护 SSH 登录* + +取消 SSH 中的‘root login’, 只允许通过普通用户账号登录后才能使用 su 切换到 root,以进一步加强安全。请打开并编辑配置文件 ‘/etc/ssh/sshd_config’ 并更改 PermitRootLogin yes 为 PermitRootLogin no。 # PermitRootLogin yes (原来) PermitRootLogin no (现在) ![取消 SSH Root 登录](http://www.tecmint.com/wp-content/uploads/2015/04/Disable-SSH-Root-Login.jpeg) -取消 SSH Root 登录 + +*取消 SSH Root 直接登录* 最后,重启 SSH 服务启用更改。 @@ -96,34 +102,39 @@ SSH 表示 Secure Shell,是 Linux 远程管理的默认协议。 SSH 是随最 ### 10. 安装 GCC (GNU 编译器集) ### -GCC 表示 GNU 编译器集,是一个 GNU 项目开发的支持多种编程语言的编译系统。在最小化安装的 CentOS 没有默认安装。运行下面的命令安装 gcc 编译器。 +GCC 即 GNU 编译器集,是一个 GNU 项目开发的支持多种编程语言的编译系统(LCTT 译注:在你需要自己编译构建软件时需要它)。在最小化安装的 CentOS 没有默认安装。运行下面的命令安装 gcc 编译器。 + # yum install gcc ![在 CentOS 上安装 GCC](http://www.tecmint.com/wp-content/uploads/2015/04/Install-GCC-in-CentOS.jpeg) -在 CentOS 上安装 GCC + +*在 CentOS 上安装 GCC* 检查安装的 gcc 版本。 # gcc --version ![检查 GCC 版本](http://www.tecmint.com/wp-content/uploads/2015/04/Check-GCC-Version.jpeg) -检查 GCC 版本 + +*检查 GCC 版本* ### 11. 安装 Java ### -Java是一种通用的基于类的,面向对象的编程语言。在最小化 CentOS 服务器中没有默认安装。按照下面命令从库中安装 Java。 +Java是一种通用的基于类的,面向对象的编程语言。在最小化 CentOS 服务器中没有默认安装(LCTT 译注:如果你没有任何 Java 应用,可以不用装它)。按照下面命令从库中安装 Java。 # yum install java ![在 CentOS 上安装 Java](http://www.tecmint.com/wp-content/uploads/2015/04/Install-java.jpeg) -安装 Java + +*安装 Java* 检查安装的 Java 版本。 # java -version ![检查 Java 版本](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Java-Version.jpeg) -检查 Java 版本 + +*检查 Java 版本* -------------------------------------------------------------------------------- @@ -131,7 +142,7 @@ via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installatio 作者:[Avishek Kumar][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 944c76f2cfcfa45bea8ba6fe399d95dced8150d1 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 27 Apr 2015 16:34:01 +0800 Subject: [PATCH 004/133] =?UTF-8?q?20150427-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...o After Installing Ubuntu 15.04 Desktop.md | 298 ++++++++++++++++++ ...0427 How to set up NTP server in CentOS.md | 165 ++++++++++ 2 files changed, 463 insertions(+) create mode 100644 sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md create mode 100644 sources/tech/20150427 How to set up NTP server in CentOS.md diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md new file mode 100644 index 0000000000..6f1114b9bb --- /dev/null +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -0,0 +1,298 @@ +15 Things to Do After Installing Ubuntu 15.04 Desktop +================================================================================ +This tutorial is intended for beginners and covers some basic steps on what to do after you have installed Ubuntu 15.04 “Vivid Vervet” Desktop version on your computer in order to customize the system and install basic programs for daily usage. + +![Things to Do After Installing Ubuntu 15.04](http://www.tecmint.com/wp-content/uploads/2015/04/things-to-do-after-installing-ubuntu-15.04.jpeg) +15 Things to Do After Installing Ubuntu 15.04 + +### 1. Enable Ubuntu Extra Repositories and Update the System ### + +The first thing you should take care of after a fresh installation of Ubuntu is to enable Ubuntu Extra Repositories provided by official Canonical Partners and keep an up-to-date system with the last security patches and software updates. + +In order to accomplish this step, open from the left Launcher System Settings -> Software and Updates utility and check all Ubuntu Software and Other Software (Canonical Partners) repositories. After you finish hit the Close button and wait for the utility to Reload the cache sources tree. + +![Software Updates](http://www.tecmint.com/wp-content/uploads/2015/04/Software-Updates.jpg) +Software Updates + +![Other Software (Canonical Partners)](http://www.tecmint.com/wp-content/uploads/2015/04/Other-Software.jpg) +Other Software (Canonical Partners) + +For a fast and smooth update process, open a Terminal and issue the following command in order to update the system using the new software repositories: + + $ sudo apt-get update + $ sudo apt-get upgrade + +![Ubuntu Upgrade](http://www.tecmint.com/wp-content/uploads/2015/04/Ubuntu-Upgrade.jpg) +Ubuntu Upgrade + +### 2. Install Additional Drivers ### + +In order for the system to scan and install additional hardware proprietary drivers, open Software and Updates utility from System Settings, go to Additional Drivers tab and wait for the utility to scan for drivers. + +If some drivers matching your hardware are found, check the drivers you want to install and hit the Apply Changes button to install it. In case the proprietary drivers are not working as expected, uninstall them using the Revert button or check Do not use the device and Apply Changes. + +![Install Drivers in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-drivers.jpg) +Install Drivers + +### 3. Install Synaptic and Gdebi Package Tools ### + +Besides Ubuntu Software Center, Synaptic is a Graphical utility for apt command line through which you can manage repositories or install, remove, search, upgrade and configure software packages. Similar way, Gdebi has the same functionality for local .deb packages. To install this two package managers on your system issue the following command on Terminal: + + $ sudo apt-get install synaptic gdebi + +![Install Synaptic and Gdebi](http://www.tecmint.com/wp-content/uploads/2015/04/install-synaptic-gdebi.jpg) +Install Synaptic and Gdebi + +![Synaptic Package Manager](http://www.tecmint.com/wp-content/uploads/2015/04/synaptic-package-manager.jpg) +Synaptic Package Manager + +### 4. Change System Appearance and Behavior ### + +If you want to change Desktop Background or Launcher Icon Size, open System Settings –> Appearance –> Look and personalize the desktop. To move the menu to window title bar, enable workspaces and desktop icons or auto-hide the Launcher visit Behavior tab. + +![System Appearances](http://www.tecmint.com/wp-content/uploads/2015/04/system-appearance.jpg) +System Appearances + +### 5. Improve System Security and Privacy ### + +![System Security Enhancement](http://www.tecmint.com/wp-content/uploads/2015/04/system-security-1.jpg) +System Security Enhancement + +![System Security Options](http://www.tecmint.com/wp-content/uploads/2015/04/system-security-2.jpg) +System Security Options + +### 5. Disable Unneeded Startup Applications ### + +To improve system login speed, reveal hidden Startup Applications by issuing the below command on Terminal, open Startup Applications utility by searching it in Dash and uncheck the unneeded applications during login process. + + $ sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart/*.desktop + +![Disable Unwanted Applications](http://www.tecmint.com/wp-content/uploads/2015/04/disable-unwanted-applications.jpg) +Disable Unwanted Applications + +### 6. Add Extended Multimedia Support ### + +By default, Ubuntu comes with a minimal support for media files. In order to play various media formats or manipulate video files, install the following multimedia applications: + +- VLC +- Smplayer +- Audacious +- QMMP +- Mixxx +- XBMC +- Handbrake +- Openshot + +Use the following command line to install all with one shot: + + $ sudo apt-get install vlc smplayer audacious qmmp mixxx xbmc handbrake openshot + +![Install Media Players](http://www.tecmint.com/wp-content/uploads/2015/04/install-media-players.jpg) +Install Media Players + +![Media Player Playlist](http://www.tecmint.com/wp-content/uploads/2015/04/media-playllist.jpg) +Media Player Playlist + +Besides this multimedia players also install ubuntu-restricted-extras and Java support packages in order to decode and support other restricted media formats. + + $ sudo apt-get install ubuntu-restricted-extras openjdk-8-jdk + +![Install Ubuntu Extras](http://www.tecmint.com/wp-content/uploads/2015/04/install-ubuntu-extras.jpg) +Install Ubuntu Extras + +To enable DVD Playback and other multimedia codecs issue the following command on Terminal: + + $ sudo apt-get install ffmpeg gstreamer0.10-plugins-bad lame libavcodec-extra + $ sudo /usr/share/doc/libdvdread4/install-css.sh + +![Enable Video Codes](http://www.tecmint.com/wp-content/uploads/2015/04/enable-video-playbacks.jpg) +Enable Video Codes + +### 7. Install Image Applications ### + +If you are a photography enthusiast and you want to handle and manipulate images on Ubuntu, probably you want to install the following imaging programs: + +- GIMP (alternative for Adobe Photoshop) +- Darktable +- Rawtherapee +- Pinta +- Shotwell +- Inkscape (alternative for Adobe Illustrator) +- Digikam +- Cheese + +This applications can be installed from Ubuntu Software Center or all at once by using the following command line on Terminal: + + $ sudo apt-get install gimp gimp-plugin-registry gimp-data-extras darktable rawtherapee pinta shotwell inkscape + +![Install Image Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-image-applications.jpg) +Install Image Applications + +![Rawtherapee Tool](http://www.tecmint.com/wp-content/uploads/2015/04/rawtherapee.jpg) +Rawtherapee Tool + +### 8. Install Media Burners ### + +To mount ISO images or burn a CDs or a DVD, you can choose and install from the following software: + +- Brasero Disk Burner +- K3b +- Xfburn +- Furius ISO Mount + + $ sudo apt-get install brasero + $ sudo apt-get install k3b + $ sudo apt-get install xfburn + $ sudo apt-get install furiusisomount + +![Install Media Burners](http://www.tecmint.com/wp-content/uploads/2015/04/install-media-burners.jpg) +Install Media Burners + +### 9. Install Archive Applications ### + +To handle most of archive formatted files (zip, tar.gz, zip, 7zip rar etc) install the following packages by issuing the below command: + + $ sudo apt-get install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract file-roller + +![Install Archive Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-archive-apps.jpg) +Install Archive Applications + +### 10. Install Chat Application ### + +If you want to talk to people all over the world, here is a list of the most popular chat applications for Linux: + +- Pidgin +- Skype +- Xchat +- Telegram +- aMSN +- Viber + +You can install most of them from Ubuntu Software Center or by using the command line: + + $ sudo apt-get install pidgin + $ sudo apt-get install skype + $ sudo apt-get install xchat + $ sudo apt-get install amsn + $ sudo add-apt-repository ppa:atareao/telegram -y + $ sudo apt-get update + $ sudo apt-get install telegram + +![Install Chat Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-chat-apps.jpg) +Install Chat Applications + +To install Viber application on Ubuntu visit [Viber official webpage][1], download the Debian package locally and install the viber.deb application using Gdebi package manager (left click – > Open with -> GDebi Package Installer). + +![Install Viber in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-viber.jpg) +Install Viber + +### 11. Install Torrent Software ### + +The most popular torrent applications and peer-to-peer file sharing programs for Ubuntu are: + +- Deluge +- Transmission +- Qbittorrent +- LinuxDC++ + +To install your favorite peer-to-peer file sharing application on Ubuntu issue the following command on Terminal. + + $ sudo apt-get install deluge + $ sudo apt-get install transmission + $ sudo apt-get install qbittorrent + $ sudo apt-get install linuxdcpp + +![Install Torrent](http://www.tecmint.com/wp-content/uploads/2015/04/install-torrent.jpg) +Install Torrent + +### 12. Install Windows Emulator -Wine and Gaming Support – Steam ### + +Wine emulator allows you to install and run Windows applications on Linux. On the other hand, Steam is a popular gaming platform for Linux based systems developed by Valve. To install both of them on your machine issue the following command on Terminal or use Ubuntu Software Center. + + $ sudo apt-get install steam wine winetricks + +![Install Wine](http://www.tecmint.com/wp-content/uploads/2015/04/install-wine.jpg) +Install Wine + +### 13. Install Cairo-Dock and Enable Desktop Visual Effects ### + +Cairo-Dock is a beautiful and flexible launcher bar for Linux desktops similar to the Mac OS X dock. To install it on Ubuntu, run the following command on Terminal. + + $ sudo apt-get install cairo-dock cairo-dock-plug-ins + +![Install Cairo Dock](http://www.tecmint.com/wp-content/uploads/2015/04/install-cairo-dock.jpg) +Install Cairo Dock + +![Add Cairo Dock at Startup](http://www.tecmint.com/wp-content/uploads/2015/04/add-cairo-dock-startup.jpg) +Add Cairo Dock at Startup + +To enable a set of Desktop Effects, such as Cube effect, install Compiz package with the following command: + + $ sudo apt-get install compiz compizconfig-settings-manager compiz-plugins-extra + +To activate the Desktop Cube effect, search for ccsm on Dash, open CompizConfig Settings Manager, go to General Options – > Desktop Size and set Horizontal Virtual Size value to 4 and Vertical Virtual Size to 1. Then go back and check Desktop Cube (Disable Desktop Wall) and Rotate Cube boxes (Resolve Conflicts ->Disable Switch to Viewport 1) and press Ctrl+Alt+Left Mouse Click to view the cube effect. + +![Enable Compiz](http://www.tecmint.com/wp-content/uploads/2015/04/enable-compiz.jpg) +Enable Compiz + +![Compiz Settings](http://www.tecmint.com/wp-content/uploads/2015/04/compiz-settings.jpg) +Compiz Settings + +![Compiz Settings Addons](http://www.tecmint.com/wp-content/uploads/2015/04/compiz-settings-1.jpg) +Compiz Settings Addons + +![Desktop Window Rotating](http://www.tecmint.com/wp-content/uploads/2015/04/desktop-cube.jpg) +Desktop Window Rotating + +### 14. Add Extra Browser Support ### + +Ubuntu 15.04 comes by default with Mozilla Firefox Web Browser. To install other browsers such as Google Chrome or Opera, visit their official web pages, download the provided .deb packages and install them on your system using the Gdebi Package Installer. + +![Enable Browser Support](http://www.tecmint.com/wp-content/uploads/2015/04/enable-browser-support.jpg) +Enable Browser Support + +![Opera Browser Support](http://www.tecmint.com/wp-content/uploads/2015/04/opera.jpg) +Opera Browser Support + +To install Chromium Open Source browser issue the following command on Terminal. + + $ sudo apt-get install chromium-browser + +### 15. Install Tweak Tools ### + +Want extra applications for customizing Ubuntu? Then install Unity Tweak Tool and Gnome Tweak Tool by issuing the following commands on Terminal. + + $ sudo apt-get install unity-tweak-tool gnome-tweak-tool + +![Install Tweak Tool](http://www.tecmint.com/wp-content/uploads/2015/04/install-tweak-tool.jpg) +Install Tweak Tool + +![Tweak Tool Settings](http://www.tecmint.com/wp-content/uploads/2015/04/tweak-settings.jpg) +Tweak Tool Settings + +Another interesting tweak tool is represented by the Ubuntu Tweak package which can be obtained and installed by visiting the webpage: [http://ubuntu-tweak.com/][2]. + +![Tweak Tool: System Information](http://www.tecmint.com/wp-content/uploads/2015/04/tweak-system-info.jpg) +Tweak Tool: System Information + +After you have installed all this bunch of software, you might want to clean your system in order to free some space on the hard drive, by issuing the following commands: + + $ sudo apt-get -y autoremove + $ sudo apt-get -y autoclean + $ sudo apt-get -y clean + +This are just a few tweaks and programs that an average user might install and use on Ubuntu 15.04 Desktop for daily basic utilization. For more advanced programs, features and utilities use Ubuntu Software Center or consult Ubuntu Wiki webpage. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/things-to-do-after-installing-ubuntu-15-04-desktop/ + +作者:[Matei Cezar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/cezarmatei/ +[1]:http://www.viber.com/en/products/linux +[2]:http://ubuntu-tweak.com/ \ No newline at end of file diff --git a/sources/tech/20150427 How to set up NTP server in CentOS.md b/sources/tech/20150427 How to set up NTP server in CentOS.md new file mode 100644 index 0000000000..54400aef7b --- /dev/null +++ b/sources/tech/20150427 How to set up NTP server in CentOS.md @@ -0,0 +1,165 @@ +How to set up NTP server in CentOS +================================================================================ +Network Time Protocol (NTP) is used to synchronize system clocks of different hosts over network. All managed hosts can synchronize their time with a designated time server called an NTP server. An NTP server on the other hand synchronizes its own time with any public NTP server, or any server of your choice. The system clocks of all NTP-managed devices are synchronized to the millisecond precision. + +In a corporate environment, if they do not want to open up their firewall for NTP traffic, it is necessary to set up in-house NTP server, and let employees use the internal server as opposed to public NTP servers. In this tutorial, we will describe how to configure a CentOS system as an NTP server. Before going into the detail, let's go over the concept of NTP first. + +### Why Do We Need NTP? ### + +Due to manufacturing variances, all (non-atomic) clocks do not run at the exact same speed. Some clocks tend to run faster, while some run slower. So over a large timeframe, the time of one clock gradually drifts from another, causing what is known as "clock drift" or "time drift". To minimize the effect of clock drift, the hosts using NTP should periodically communicate with a designated NTP server to keep their clock in sync. + +Time synchrony across different hosts is important for things like scheduled backup, [intrusion detection][1] logging, [distributed job scheduling ][2]or transaction bookkeeping. It may even be required as part of regulatory compliance. + +### NTP Hierarchy ### + +NTP clocks are organized in a layered hierarchy. Each level of the hierarchy is called a *stratum*. The notion of stratum describes how many NTP hops away a machine is from an authoritative time source. + +![](https://farm8.staticflickr.com/7590/16645732413_3b7af58186_c.jpg) + +Stratum 0 is populated with clocks that have virtually no time drifts, such as atomic clocks. These clocks cannot be directly used over the network. Stratum N (N > 1) servers synchronize their time against Stratum N-1 servers. Stratum N clocks may be connected with each other over network. + +NTP supports up to 15 stratums in the hierarchy. Stratum 16 is considered unsynchronized and unusable. + +### Preparing CentOS Server ### + +Now let's proceed to set up an NTP server on CentOS. + +First of all, we need to make sure that the time zone of the server is set up correctly. In CentOS 7, we can use the timedatectl command to view and change the server time zone (e.g., "Australia/Adelaide") + + # timedatectl list-timezones | grep Australia + # timedatectl set-timezone Australia/Adelaide + # timedatectl + +![](https://farm8.staticflickr.com/7605/16645732463_db75a0bdcd_o.png) + +Go ahead and set up necessary software using yum. + + # yum install ntp + +Then we will add the global NTP servers to synchronize time with. + + # vim /etc/ntp.conf + +---------- + + server 0.oceania.pool.ntp.org + server 1.oceania.pool.ntp.org + server 2.oceania.pool.ntp.org + server 3.oceania.pool.ntp.org + +By default, NTP server logs are saved in /var/log/messages. If you want to use a custom log file, that can be specified as well. + + logfile /var/log/ntpd.log + +If you opt for a custom log file, make sure to change its ownership and SELinux context. + + # chown ntp:ntp /var/log/ntpd.log + # chcon -t ntpd_log_t /var/log/ntpd.log + +Now initiate NTP service and make sure it's added to startup. + + # systemctl restart ntp + # systemctl enable ntp + +### Verifying NTP Server Clock ### + +We can use the ntpq command to check how the local server's clock is synchronized via NTP. + +![](https://farm9.staticflickr.com/8713/16645732513_1823736ca8_b.jpg) + +The following table explains the output columns. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
remoteThe sources defined at ntp.conf. '*' indicates the current and best source; '+' indicates that these sources are available as NTP source. Sources with - are considered unusable.
refidThe IP address of the clock with which the remote server clock is synchronized with.
stStratum
tType. 'u' is for unicast. Other values may include local, multicast, broadcast.
whenThe time elapsed (in seconds) since the last contact with the server.
pollPolling frequency with the server in seconds.
reachAn octal value that indicates whether there are any errors in communication with the server. The value 377 indicates 100% success.
delayThe round trip time between our server and the remote server.
offsetThe time difference between our server and the remote server in milliseconds.
jitterThe average time difference in milliseconds between two samples.
+ +### Controlling Access to NTP Server ### + +By default, NTP server allows incoming queries from all hosts. If you want to filter incoming NTP synchronization connections, you could add a rule in your firewall to filter the traffic. + + # iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 123 -j ACCEPT + # iptables -A INPUT -p udp --dport 123 -j DROP + +The rule will allow NTP traffic (on port UDP/123) from 192.168.1.0/24, and deny traffic from all other networks. You can update the rule to match your requirements. + +### Configuring NTP Clients ### + +#### 1. Linux #### + +NTP client hosts need the ntpdate package to synchronize time against the server. The package can be easily installed using yum or apt-get. After installing the package, run the command with the IP address of the server. + + # ntpdate + +The command is identical for RHEL and Debian based systems. + +#### 2. Windows #### + +If you are using Windows, look for 'Internet Time' under Date and Time settings. + +#### 3. Cisco Devices #### + +If you want to synchronize the time of a Cisco device, you can use the following command from the global configuration mode. + + # ntp server + +NTP enabled devices from other vendors have their own parameters for Internet time. Please check the documentation of the device if you want to synchronize its time with the NTP server. + +### Conclusion ### + +To sum up, NTP is a protocol that keeps the clocks across all your hosts in sync. We have demonstrated how we can set up an NTP server, and let NTP enabled devices synchronize their time against the server. + +Hope this helps. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/setup-ntp-server-centos.html + +作者:[Sarmed Rahman][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://xmodulo.com/how-to-compile-and-install-snort-from-source-code-on-ubuntu.html +[2]:http://xmodulo.com/how-to-install-hdfs-and-hadoop-using.html \ No newline at end of file From c59801a39ae20f143ff332748836699954213711 Mon Sep 17 00:00:00 2001 From: runningwater Date: Mon, 27 Apr 2015 20:01:42 +0800 Subject: [PATCH 005/133] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E4=B8=ADby=20running?= =?UTF-8?q?water?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Manage and Use LVM (Logical Volume Management) in Ubuntu.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md index 570217f220..d062a85336 100644 --- a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md +++ b/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md @@ -1,3 +1,4 @@ +translating by runningwater How to Manage and Use LVM (Logical Volume Management) in Ubuntu ================================================================================ ![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) @@ -258,7 +259,7 @@ That should cover most of what you need to know to use LVM. If you’ve got some via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ -译者:[译者ID](https://github.com/译者ID) +译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From baee0efc8effe0c5a1519ec4e235ef69014ed347 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Mon, 27 Apr 2015 23:22:52 +0800 Subject: [PATCH 006/133] Update 20150128 Docker-2 Setting up a private Docker registry.md --- .../20150128 Docker-2 Setting up a private Docker registry.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md b/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md index 9a9341b4b7..625281ee7c 100644 --- a/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md +++ b/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md @@ -1,3 +1,4 @@ +[Translating by DongShuaike] Setting up a private Docker registry ================================================================================ ![](http://cocoahunter.com/content/images/2015/01/docker2.jpg) @@ -238,4 +239,4 @@ via: http://cocoahunter.com/2015/01/23/docker-2/ [8]:http://localhost:5000/v1/search [9]:http://cocoahunter.com/2015/01/23/docker-3/ [10]:http://boot2docker.io/ -[11]:https://github.com/docker/docker-registry/ \ No newline at end of file +[11]:https://github.com/docker/docker-registry/ From 38708b4f44d7ab040aa836b5a8584483b111e604 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Apr 2015 00:11:57 +0800 Subject: [PATCH 007/133] =?UTF-8?q?=E5=B7=B2=E6=A0=A1=E5=AF=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 已转载别处译文,十分可惜的放弃发布本篇 @KayGuoWhu --- .../20150318 The future of Linux storage.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/talk => published}/20150318 The future of Linux storage.md (86%) diff --git a/translated/talk/20150318 The future of Linux storage.md b/published/20150318 The future of Linux storage.md similarity index 86% rename from translated/talk/20150318 The future of Linux storage.md rename to published/20150318 The future of Linux storage.md index 23a2dfc674..f2224a5bb7 100644 --- a/translated/talk/20150318 The future of Linux storage.md +++ b/published/20150318 The future of Linux storage.md @@ -2,7 +2,7 @@ Linux存储的未来 ================================================================================ > **摘要**:Linux系统的软件开发者们正致力于使Linux支持更多种类的文件和存储方案。 -波士顿 - 在[Linux基金会][1]最近的[Vault][2]展示会上,全都是关于文件系统和存储方案的讨论。你可以会想关于这两个主题并没有什么展值得讨论的最新进展,但事实并非如此。 +波士顿 - 在[Linux基金会][1]最近的[Vault][2]展示会上,全都是关于文件系统和存储方案的讨论。你可以会觉得关于这两个主题并没有什么值得讨论的最新进展,但事实并非如此。 ![](http://zdnet2.cbsistatic.com/hub/i/r/2015/03/12/c8f92cc2-b963-4238-80a0-d785ec93698c/resize/770x578/08d93a8a393d3f50b2a56e6b0e7a0ca9/btrfs-1.jpg) @@ -14,17 +14,17 @@ Linux存储的未来 ### Btrfs ### -例如,Chris Mason,一位来自Facebook的软件工程师,也是[Btrfs][6](对外宣称Butter FS)的维护者之一,说明了Facebook是如何使用这种文件系统。Btrfs拥有文件系统固有的许多优点,比如既能处理大量的小文件,也能处理大小可达16EB的单个文件;支持RAID的baked(烦请校正补充);内置的文件系统压缩,以及集成了对多种存储设备的支持。 +例如,Chris Mason,一位来自Facebook的软件工程师,也是[Btrfs][6](念做 Butter FS)的维护者之一,介绍了Facebook是如何使用这种文件系统。Btrfs拥有文件系统固有的许多优点,比如既能处理大量的小文件,也能处理大小可达16EB的单个文件;支持RAID ;内置的文件系统压缩,以及集成了对多种存储设备的支持。 -当然,Facebook的服务器也运行在Linux上。更准确地讲,是运行在一个基于[CentOS][7]的内部发行版上,它是基于3.10和3.18版的内核。对Facebook来说,真正的收获是Btrfs在由Facebook持续的更新用户操作带来的巨大的IOPS(每秒钟输入输出的操作数)的负载下依旧保持稳定和快速。 +当然,Facebook的服务器也运行在Linux上。更准确地讲,是运行在一个基于[CentOS][7]的内部发行版上,它是基于3.10和3.18版的内核。对Facebook来说,真正的收获是Btrfs在Facebook持续更新的用户操作所带来的巨大的IOPS(每秒钟输入输出的操作数)的负载下依旧保持稳定和快速。 这就是好消息,但坏消息是对于像MySQL一样的传统DBMS(数据库管理系统)来说Btrfs还是太慢了。对此,Facebook采用了[XFS][8]。为了协同这两种文件系统,Facebook又用到了一种叫做[Gluster][9]的开源分布式文件系统。 -Facebook,一直与上游的负责Btrfs的Linux内核开发者保持密切联系,致力于提高Btrfs在DBMS上的速度。Mason和他的同事在[RocksDB][10]数据库上使用Btrfs以达成目标,RocksDB是一种为提供快速存储开发的持久化键值存储系统,可以作为客户端服务器模式数据库的基础部分。 +Facebook,一直与上游的负责Btrfs的Linux内核开发者保持密切联系,致力于提高Btrfs在DBMS上的速度。Mason和他的同事的目标是在[RocksDB][10]数据库上使用Btrfs,RocksDB是一种为提供快速存储开发的持久化键值存储系统,可以作为客户端服务器模式数据库的基础部分。 当然Btrfs也还存在一些问题,比如,如果有用户傻到用数据把硬盘几乎要撑爆时,Btrfs会在硬盘被完全装满前阻止用户继续写入。对某些工程来说,比如[CoreOS][12],一款依赖容器化的企业版Linux系统,这种问题是致命的。[因此,CoreOS已经切换到使用xt4和overlayfs了][11]。 -Btrfs的开发人员正致力于数据去重。在这一点上,当文件系统中拥有超过一个的相同文件时,会自动删除多余文件。正如Mason所说,“并非每个人都需要这个功能,但如果有人需要,那就是真的需要!” +Btrfs的开发人员正致力于数据去重。在这一点上,当文件系统中拥有超过一个的相同文件时,会自动删除多余文件。正如Mason所说,“并非每个人都需要这个功能,但如果有人需要,那就是真的有用!” 在正在开展的重要性工作中,Btrfs并非是唯一的文件系统。John Spary,[Red Hat][13]的一位高级软件工程师,提到了另一款名为[Ceph][14]的分布式文件系统。 @@ -38,7 +38,7 @@ Ceph提供了一种分布式对象存储方案和文件系统,反过来它依 但是,Ceph FS仍值得去做,正如Spray所说,“因为兼容POSIX的文件系统是操作系统通用的。”这并不是说Ceph FS就一无是处。“它并不是支离破碎的,相反它奏效了。所缺的是修复和监控工具。” -Red Hat目前正致力于获得[fsck][17]和日志修复工具、快照强化、更好客户端访问控制,以及云与容器的集成。尽管Ceph FS到目前为止只是一种有潜力或者没前景的文件系统,但仍然值得用在生产环境中。 +Red Hat目前正致力于完成[fsck][17]和日志修复工具开发、快照强化、更好客户端访问控制,以及云与容器的集成。尽管Ceph FS到目前为止只是一种有潜力或者没前景的文件系统,但仍然值得用在生产环境中。 ### 文件与存储的差别与目标 ### @@ -56,7 +56,7 @@ via: http://www.zdnet.com/article/linux-storage-futures/ 作者:[Steven J. Vaughan-Nichols][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 40a4508387cec4d96e2b1dffcf5d10792f849a06 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 28 Apr 2015 10:56:47 +0800 Subject: [PATCH 008/133] [Translating]tech/20150427 How to set up NTP server in CentOS --- sources/tech/20150427 How to set up NTP server in CentOS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150427 How to set up NTP server in CentOS.md b/sources/tech/20150427 How to set up NTP server in CentOS.md index 54400aef7b..e04a8841c7 100644 --- a/sources/tech/20150427 How to set up NTP server in CentOS.md +++ b/sources/tech/20150427 How to set up NTP server in CentOS.md @@ -1,3 +1,4 @@ +Translating by ictlyh How to set up NTP server in CentOS ================================================================================ Network Time Protocol (NTP) is used to synchronize system clocks of different hosts over network. All managed hosts can synchronize their time with a designated time server called an NTP server. An NTP server on the other hand synchronizes its own time with any public NTP server, or any server of your choice. The system clocks of all NTP-managed devices are synchronized to the millisecond precision. From 1b6c5aa4792a99edbed674ff9fe6787a32952aef Mon Sep 17 00:00:00 2001 From: Mo Date: Tue, 28 Apr 2015 11:24:39 +0800 Subject: [PATCH 009/133] [translated]GNOME-Pie 0.6 Application Launcher Released --- ...E-Pie 0.6 Application Launcher Released.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 translated/news/GNOME-Pie 0.6 Application Launcher Released.md diff --git a/translated/news/GNOME-Pie 0.6 Application Launcher Released.md b/translated/news/GNOME-Pie 0.6 Application Launcher Released.md new file mode 100644 index 0000000000..94cdfd1006 --- /dev/null +++ b/translated/news/GNOME-Pie 0.6 Application Launcher Released.md @@ -0,0 +1,53 @@ +GNOME-Pie 0.6.1 应用启动器发布,酷炫新特性[多图+视频] +============================================= + +**Simon Schneegans高兴地[宣布][1]他的GNOME-Pie 0.6.1已可供下载使用。GNOME-Pie是一个可以在不同桌面环境中作为应用启动器的小工具,包括GNOME和Unity。** + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-3.jpg) + +GNOME-Pie 0.6.1看起来是个大版本更新,引入了许多新特性,比如支持半个或四分之一圆,可选择每个启动器想要的形状,也可以自动生成形状,以及多彩的动态图标。 + +此外,软件现在还适配若干类dock应用,包括elementary OS的Plank,Ubuntu的Unity,以及通用的Docky。一些已有的GNOME-Pie主题也已更新,还引入了全新主题Simple,为半圆启动器布局设计。 + +“Gnome-Pie新版本已发布,实际上已经发布了两个版本:0.6.0和之后的0.6.1,修复了[issue #73][2],”Simon Schneegans在发布声明上说道,“新版本修复了许多bug,还带来了许多新特性!” + + + +### 现在就可在Ubuntu上安装GNOME-Pie ### + +Ubuntu及其衍生版用户现在就可通过Simon Schneegans的PPA源安装GNOME-Pie。只需打开终端,运行下列命令即可。GNOME-Pie适用于Ubuntu 14.04 LTS,14.10和15.04。 + +

+sudo add-apt-repository ppa:simonschneegans/testing
+sudo apt-get update
+sudo apt-get install gnome-pie
+
+ +其他GNU/Linux发行版用户可以从官网下载GNOME-Pie 0.6.1的源代码,或者近期在系统的软件源中搜索新版GNOME-Pie。 + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-2.jpg) + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-4.jpg) + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-5.jpg) + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-6.jpg) + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-7.jpg) + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-8.jpg) + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-9.jpg) + +![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-10.jpg) + +-------------------------------------------------- + +via:http://news.softpedia.com/news/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914.shtml + +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://simmesimme.github.io/news/2015/04/18/gnome-pie-061/ +[2]:https://github.com/Simmesimme/Gnome-Pie/issues/73 From 6386204f886da9156e110ffad0e81eecc3a6151e Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 28 Apr 2015 12:03:53 +0800 Subject: [PATCH 010/133] [Translate]tech/20150427 How to set up NTP server in CentOS --- ...0427 How to set up NTP server in CentOS.md | 166 ------------------ ...0427 How to set up NTP server in CentOS.md | 165 +++++++++++++++++ 2 files changed, 165 insertions(+), 166 deletions(-) delete mode 100644 sources/tech/20150427 How to set up NTP server in CentOS.md create mode 100644 translated/tech/20150427 How to set up NTP server in CentOS.md diff --git a/sources/tech/20150427 How to set up NTP server in CentOS.md b/sources/tech/20150427 How to set up NTP server in CentOS.md deleted file mode 100644 index e04a8841c7..0000000000 --- a/sources/tech/20150427 How to set up NTP server in CentOS.md +++ /dev/null @@ -1,166 +0,0 @@ -Translating by ictlyh -How to set up NTP server in CentOS -================================================================================ -Network Time Protocol (NTP) is used to synchronize system clocks of different hosts over network. All managed hosts can synchronize their time with a designated time server called an NTP server. An NTP server on the other hand synchronizes its own time with any public NTP server, or any server of your choice. The system clocks of all NTP-managed devices are synchronized to the millisecond precision. - -In a corporate environment, if they do not want to open up their firewall for NTP traffic, it is necessary to set up in-house NTP server, and let employees use the internal server as opposed to public NTP servers. In this tutorial, we will describe how to configure a CentOS system as an NTP server. Before going into the detail, let's go over the concept of NTP first. - -### Why Do We Need NTP? ### - -Due to manufacturing variances, all (non-atomic) clocks do not run at the exact same speed. Some clocks tend to run faster, while some run slower. So over a large timeframe, the time of one clock gradually drifts from another, causing what is known as "clock drift" or "time drift". To minimize the effect of clock drift, the hosts using NTP should periodically communicate with a designated NTP server to keep their clock in sync. - -Time synchrony across different hosts is important for things like scheduled backup, [intrusion detection][1] logging, [distributed job scheduling ][2]or transaction bookkeeping. It may even be required as part of regulatory compliance. - -### NTP Hierarchy ### - -NTP clocks are organized in a layered hierarchy. Each level of the hierarchy is called a *stratum*. The notion of stratum describes how many NTP hops away a machine is from an authoritative time source. - -![](https://farm8.staticflickr.com/7590/16645732413_3b7af58186_c.jpg) - -Stratum 0 is populated with clocks that have virtually no time drifts, such as atomic clocks. These clocks cannot be directly used over the network. Stratum N (N > 1) servers synchronize their time against Stratum N-1 servers. Stratum N clocks may be connected with each other over network. - -NTP supports up to 15 stratums in the hierarchy. Stratum 16 is considered unsynchronized and unusable. - -### Preparing CentOS Server ### - -Now let's proceed to set up an NTP server on CentOS. - -First of all, we need to make sure that the time zone of the server is set up correctly. In CentOS 7, we can use the timedatectl command to view and change the server time zone (e.g., "Australia/Adelaide") - - # timedatectl list-timezones | grep Australia - # timedatectl set-timezone Australia/Adelaide - # timedatectl - -![](https://farm8.staticflickr.com/7605/16645732463_db75a0bdcd_o.png) - -Go ahead and set up necessary software using yum. - - # yum install ntp - -Then we will add the global NTP servers to synchronize time with. - - # vim /etc/ntp.conf - ----------- - - server 0.oceania.pool.ntp.org - server 1.oceania.pool.ntp.org - server 2.oceania.pool.ntp.org - server 3.oceania.pool.ntp.org - -By default, NTP server logs are saved in /var/log/messages. If you want to use a custom log file, that can be specified as well. - - logfile /var/log/ntpd.log - -If you opt for a custom log file, make sure to change its ownership and SELinux context. - - # chown ntp:ntp /var/log/ntpd.log - # chcon -t ntpd_log_t /var/log/ntpd.log - -Now initiate NTP service and make sure it's added to startup. - - # systemctl restart ntp - # systemctl enable ntp - -### Verifying NTP Server Clock ### - -We can use the ntpq command to check how the local server's clock is synchronized via NTP. - -![](https://farm9.staticflickr.com/8713/16645732513_1823736ca8_b.jpg) - -The following table explains the output columns. - -注:表格 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
remoteThe sources defined at ntp.conf. '*' indicates the current and best source; '+' indicates that these sources are available as NTP source. Sources with - are considered unusable.
refidThe IP address of the clock with which the remote server clock is synchronized with.
stStratum
tType. 'u' is for unicast. Other values may include local, multicast, broadcast.
whenThe time elapsed (in seconds) since the last contact with the server.
pollPolling frequency with the server in seconds.
reachAn octal value that indicates whether there are any errors in communication with the server. The value 377 indicates 100% success.
delayThe round trip time between our server and the remote server.
offsetThe time difference between our server and the remote server in milliseconds.
jitterThe average time difference in milliseconds between two samples.
- -### Controlling Access to NTP Server ### - -By default, NTP server allows incoming queries from all hosts. If you want to filter incoming NTP synchronization connections, you could add a rule in your firewall to filter the traffic. - - # iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 123 -j ACCEPT - # iptables -A INPUT -p udp --dport 123 -j DROP - -The rule will allow NTP traffic (on port UDP/123) from 192.168.1.0/24, and deny traffic from all other networks. You can update the rule to match your requirements. - -### Configuring NTP Clients ### - -#### 1. Linux #### - -NTP client hosts need the ntpdate package to synchronize time against the server. The package can be easily installed using yum or apt-get. After installing the package, run the command with the IP address of the server. - - # ntpdate - -The command is identical for RHEL and Debian based systems. - -#### 2. Windows #### - -If you are using Windows, look for 'Internet Time' under Date and Time settings. - -#### 3. Cisco Devices #### - -If you want to synchronize the time of a Cisco device, you can use the following command from the global configuration mode. - - # ntp server - -NTP enabled devices from other vendors have their own parameters for Internet time. Please check the documentation of the device if you want to synchronize its time with the NTP server. - -### Conclusion ### - -To sum up, NTP is a protocol that keeps the clocks across all your hosts in sync. We have demonstrated how we can set up an NTP server, and let NTP enabled devices synchronize their time against the server. - -Hope this helps. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/setup-ntp-server-centos.html - -作者:[Sarmed Rahman][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/sarmed -[1]:http://xmodulo.com/how-to-compile-and-install-snort-from-source-code-on-ubuntu.html -[2]:http://xmodulo.com/how-to-install-hdfs-and-hadoop-using.html \ No newline at end of file diff --git a/translated/tech/20150427 How to set up NTP server in CentOS.md b/translated/tech/20150427 How to set up NTP server in CentOS.md new file mode 100644 index 0000000000..3924edd93f --- /dev/null +++ b/translated/tech/20150427 How to set up NTP server in CentOS.md @@ -0,0 +1,165 @@ +如何在 CentOS 中设置 NTP 服务器 +================================================================================ +网络时间协议(NTP)用来同步网络上不同主机的系统时间。所有托管的主机都可以和一个指定的被称为 NTP 服务器的时间服务器同步它们的时间。另一方面一个 NTP 服务器将它的时间和任何公共 NTP 服务器,或者你选定的服务器同步。NTP 托管的所有系统时钟都同步精确到毫秒级。 + +在一个协作环境中,如果他们不想为 NTP 传输打开防火墙,就有必要设置一个内部 NTP 服务器,然后让员工使用内部服务器而不是公共 NTP 服务器。在这个指南中,我们会介绍如何将一个 CentOS 系统配置为 NTP 服务器。在介绍详细内容之前,让我们先来简单了解一下 NTP 的概念。 + +### 为什么我们需要 NTP? ### + +由于制造工艺多种多样,所有的(非原子)时钟并不按照完全一致的速度行走。有一些时钟走的比较快而有一些走的比较慢。因此经过很长一段时间以后,一个时钟的时间慢慢的偏移于其它,导致有名的 “时钟漂移” 或 “时间漂移”。为了最小化时钟漂移的影响,使用 NTP 的主机应该周期性地和指定的 NTP 服务器交互以保持它们的时钟同步。 + +在不同的主机之间进行时间同步对于计划备份、[干扰检测][1]日志、[分布式任务调度][2]或者事务订单管理来说是很重要的事情。它甚至可能要求作为日常任务的一部分。 + +### NTP 层次 ### + +NTP 时钟以层次模型组织。层级中的每层被称为一个 *stratum*。stratum 的概念说明了一台机器到授权的时间源有多少 NTP 跳。 + +![](https://farm8.staticflickr.com/7590/16645732413_3b7af58186_c.jpg) + +Stratum 0 由没有时间漂移的时钟组成,例如原子时钟。这种时钟不能在网络上直接使用。Stratum N (N > 1) 层服务器从 Stratum N-1 层服务器同步时间。Stratum N 时钟可能通过网络和彼此互联。 + +NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不能使用的。 + +### 准备 CentOS 服务器 ### + +现在让我们来开始在 CentOS 上设置 NTP 服务器。 + +首先,我们需要保证正确设置了服务器的时区。在 CentOS 7 中,我们可以使用 timedatectl 命令查看和更改服务器的时区(比如,"Australia/Adelaide") + + # timedatectl list-timezones | grep Australia + # timedatectl set-timezone Australia/Adelaide + # timedatectl + +![](https://farm8.staticflickr.com/7605/16645732463_db75a0bdcd_o.png) + +继续并使用 yum 安装需要的软件 + + # yum install ntp + +然后我们会添加全球 NTP 服务器用于同步时间。 + + # vim /etc/ntp.conf + +---------- + + server 0.oceania.pool.ntp.org + server 1.oceania.pool.ntp.org + server 2.oceania.pool.ntp.org + server 3.oceania.pool.ntp.org + +默认情况下,NTP 服务器的日志保存在 /var/log/messages。如果你希望使用自定义的日志文件,那也可以指定。 + + logfile /var/log/ntpd.log + +如果你选择自定义日志文件,确保更改了它的属主和 SELinux 环境。 + + # chown ntp:ntp /var/log/ntpd.log + # chcon -t ntpd_log_t /var/log/ntpd.log + +现在初始化 NTP 服务并确保把它添加到了随机启动。 + + # systemctl restart ntp + # systemctl enable ntp + +### 验证 NTP Server 时钟 ### + +我们可以使用 ntpq 命令来检查本地服务器的时钟如何通过 NTP 同步。 + +![](https://farm9.staticflickr.com/8713/16645732513_1823736ca8_b.jpg) + +下面的表格解释了输出列。 + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
remote源在 ntp.conf 中定义。‘*’ 表示当前使用的最好的源;‘+’ 表示可作为 NTP 源的源;‘-’ 标记的源是不可用的。
refid和远程服务器时钟同步的时钟的 IP 地址。
stStratum
t类型。 'u' 表示单播(unicast)。其它值包括本地(local)、多播(multicast)、广播(broadcast)。
when自从上次和服务器交互经过的时间(以秒数计)。
poll和服务器的轮询频率,以秒数计。
reach表示和服务器交互是否有任何错误的十进制数。值 337 表示 100% 成功。
delay服务器和远程服务器来回的时间。
offset我们服务器和远程服务器的时间差异,以毫秒数计。
jitter两个例子之间平局时间差异,以毫秒数计。
+ +### 控制到 NTP 服务器的访问 ### + +默认情况下,NTP 服务器允许来自所有主机的查询。如果你想过滤进来的 NTP 同步连接,你可以在你的防火墙中添加规则过滤流量。 + + # iptables -A INPUT -s 192.168.1.0/24 -p udp --dport 123 -j ACCEPT + # iptables -A INPUT -p udp --dport 123 -j DROP + +该规则允许从 192.168.1.0/24 来的 NTP 流量(端口 UDP/123),任何其它网络的流量会被截停。你可以根据需要更改规则。 + +### 配置 NTP 客户端 ### + +#### 1. Linux #### + +NTP 客户端主机需要 ntpupdate 软件包和服务器同步时间。可以轻松地使用 yum 或 apt-get 安装这个软件包。安装完软件包之后,用服务器的 IP 地址运行下面的命令。 + + # ntpdate + +基于 RHEL 和 Debian 的系统命令都相同。 + +#### 2. Windows #### + +如果你正在使用 Windows,在日期和时间设置(Date and Time settings)下查找网络时间(Internet Time)。 + +#### 3. Cisco 设备 #### + +如果你想和 Cisco 设备同步时间,你可以在全局配置模式下使用下面的命令。 + + # ntp server + +其它有支持 NTP 的卖家有自己的参数用于网络时间。如果你想将设备和 NTP服务器同步时间,请查看设备的说明文档。 + +### 结论 ### + +总而言之,NTP 是在你的所有主机上同步时钟的一个协议。我们已经介绍了如何设置 NTP 服务器并使支持 NTP 的设备和服务器同步时间。 + +希望能对你有所帮助 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/setup-ntp-server-centos.html + +作者:[Sarmed Rahman][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/sarmed +[1]:http://xmodulo.com/how-to-compile-and-install-snort-from-source-code-on-ubuntu.html +[2]:http://xmodulo.com/how-to-install-hdfs-and-hadoop-using.html \ No newline at end of file From 4d7ee735532e94c3fbfe603f035c856d3363ddef Mon Sep 17 00:00:00 2001 From: chenjt Date: Tue, 28 Apr 2015 12:13:29 +0800 Subject: [PATCH 011/133] [bazz2 translating]How to secure SSH login with one-time passwords on Linux --- ...How to secure SSH login with one-time passwords on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150330 How to secure SSH login with one-time passwords on Linux.md b/sources/tech/20150330 How to secure SSH login with one-time passwords on Linux.md index 9133679994..56888f3342 100644 --- a/sources/tech/20150330 How to secure SSH login with one-time passwords on Linux.md +++ b/sources/tech/20150330 How to secure SSH login with one-time passwords on Linux.md @@ -1,3 +1,4 @@ +[bazz222222222] How to secure SSH login with one-time passwords on Linux ================================================================================ As someone says, security is a not a product, but a process. While SSH protocol itself is cryptographically secure by design, someone can wreak havoc on your SSH service if it is not administered properly, be it weak passwords, compromised keys or outdated SSH client. @@ -177,4 +178,4 @@ via: http://xmodulo.com/secure-ssh-login-one-time-passwords-linux.html [a]:http://xmodulo.com/author/nanni [1]:http://xmodulo.com/how-to-force-ssh-login-via-public-key-authentication.html [2]:http://xmodulo.com/two-factor-authentication-ssh-login-linux.html -[3]:http://www.cl.cam.ac.uk/~mgk25/otpw.html \ No newline at end of file +[3]:http://www.cl.cam.ac.uk/~mgk25/otpw.html From 49604b1666241f2d54ec64d0852963e2a73b4480 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Apr 2015 13:42:53 +0800 Subject: [PATCH 012/133] PUB:GNOME-Pie 0.6 Application Launcher Released @alim0x --- ...E-Pie 0.6 Application Launcher Released.md | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) rename {translated/news => published}/GNOME-Pie 0.6 Application Launcher Released.md (56%) diff --git a/translated/news/GNOME-Pie 0.6 Application Launcher Released.md b/published/GNOME-Pie 0.6 Application Launcher Released.md similarity index 56% rename from translated/news/GNOME-Pie 0.6 Application Launcher Released.md rename to published/GNOME-Pie 0.6 Application Launcher Released.md index 94cdfd1006..199d13f1a6 100644 --- a/translated/news/GNOME-Pie 0.6 Application Launcher Released.md +++ b/published/GNOME-Pie 0.6 Application Launcher Released.md @@ -1,29 +1,28 @@ GNOME-Pie 0.6.1 应用启动器发布,酷炫新特性[多图+视频] ============================================= -**Simon Schneegans高兴地[宣布][1]他的GNOME-Pie 0.6.1已可供下载使用。GNOME-Pie是一个可以在不同桌面环境中作为应用启动器的小工具,包括GNOME和Unity。** +**Simon Schneegans 高兴地[宣布][1]他的 GNOME-Pie 0.6.1 已可供下载使用。GNOME-Pie 是一个可以在包括 GNOME 和 Unity 在内的多种桌面环境中作为应用启动器的小工具。** ![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-3.jpg) -GNOME-Pie 0.6.1看起来是个大版本更新,引入了许多新特性,比如支持半个或四分之一圆,可选择每个启动器想要的形状,也可以自动生成形状,以及多彩的动态图标。 +GNOME-Pie 0.6.1 看起来是个主要版本更新,引入了许多新特性,比如支持半个或四分之一圆,可选择每个启动器想要的形状,也可以自动根据位置调整形状(圆形,半个或四分之一圆),以及多彩的动态图标。 -此外,软件现在还适配若干类dock应用,包括elementary OS的Plank,Ubuntu的Unity,以及通用的Docky。一些已有的GNOME-Pie主题也已更新,还引入了全新主题Simple,为半圆启动器布局设计。 +此外,软件现在还适配若干类dock应用,包括elementary OS 的 Plank,Ubuntu 的 Unity,以及通用的 Docky。一些已有的 GNOME-Pie 主题也已更新,还引入了全新的为半圆启动器布局设计的主题 Simple,。 -“Gnome-Pie新版本已发布,实际上已经发布了两个版本:0.6.0和之后的0.6.1,修复了[issue #73][2],”Simon Schneegans在发布声明上说道,“新版本修复了许多bug,还带来了许多新特性!” +“Gnome-Pie 新版本已发布,实际上已经发布了两个版本:0.6.0和之后的0.6.1,修复了[issue #73][2],”Simon Schneegans 在发布声明上说道,“新版本修复了许多 bug,还带来了许多新特性!” ### 现在就可在Ubuntu上安装GNOME-Pie ### -Ubuntu及其衍生版用户现在就可通过Simon Schneegans的PPA源安装GNOME-Pie。只需打开终端,运行下列命令即可。GNOME-Pie适用于Ubuntu 14.04 LTS,14.10和15.04。 +Ubuntu 及其衍生版用户现在就可通过 Simon Schneegans 的PPA源安装 GNOME-Pie。只需打开终端,运行下列命令即可。GNOME-Pie 适用于 Ubuntu 14.04 LTS,14.10和15.04。 -

-sudo add-apt-repository ppa:simonschneegans/testing
-sudo apt-get update
-sudo apt-get install gnome-pie
-
+ sudo add-apt-repository ppa:simonschneegans/testing + sudo apt-get update + sudo apt-get install gnome-pie -其他GNU/Linux发行版用户可以从官网下载GNOME-Pie 0.6.1的源代码,或者近期在系统的软件源中搜索新版GNOME-Pie。 + +其他 GNU/Linux 发行版用户可以从官网下载 GNOME-Pie 0.6.1 的源代码,或者近期在系统的软件源中搜索新版GNOME-Pie。 ![GNOME-Pie](http://i1-news.softpedia-static.com/images/news2/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914-2.jpg) @@ -43,9 +42,9 @@ sudo apt-get install gnome-pie -------------------------------------------------- -via:http://news.softpedia.com/news/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914.shtml +via: http://news.softpedia.com/news/GNOME-Pie-0-6-Application-Launcher-Released-with-Many-New-Features-Video-478914.shtml -译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) +译者:[alim0x](https://github.com/alim0x) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 6f612fb4dd2f3e3f25525b97dc99bb0fe9c198f2 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Apr 2015 14:08:56 +0800 Subject: [PATCH 013/133] PUB:20150309 15 Interview Questions on Linux 'ls ' Command--Part 1 @theo-l --- ...uestions on Linux 'ls ' Command--Part 1.md | 99 +++++++++++-------- 1 file changed, 57 insertions(+), 42 deletions(-) rename {translated/tech => published}/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md (63%) diff --git a/translated/tech/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md b/published/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md similarity index 63% rename from translated/tech/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md rename to published/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md index 77e42ff9e9..db7c9a3b88 100644 --- a/translated/tech/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md +++ b/published/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md @@ -1,85 +1,91 @@ -关于linux中的“ls”命令的15个面试问题 - 第一部分 +15 个‘ls’命令的面试问题(一) ================================================================================ -Unix或类Unix系统中的“文件列表”命令“ls”是最基础并且使用的最广泛的命令行中工具之一。 -它是一个在GNU基本工具集以及BSD各种变体上可用的与POSIX兼容的工具。 -“ls”命令可以通过与大量的选项一起使用来达到想要的结果。 +Unix或类Unix系统中的“文件列表”命令“ls”是最基础并且使用的最广泛的命令行中工具之一。它是一个POSIX兼容工具,在GNU基本工具集以及BSD各种变体上都可以使用。“ls”命令可以结合大量的选项来达到想要的结果。 + 这篇文章的目的在于通过相关的样例来深入讨论文件列表命令。 ![15 ls Command Questions](http://www.tecmint.com/wp-content/uploads/2014/09/ls-Command-Questions.png) -15个“ls”命令问题。 -### 1. 你会如何从目录中列出文件?### +*15个“ls”命令问题。* -答:使用linux文件列表命令“ls”驾到拯救。 +### 1. 如何列出目录中的文件?### + +答:linux文件列表命令“ls”就是干这个的。 # ls ![List Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-files.gif) -列出文件 -同时,我们也可以使用“echo(打印)”命令与一个通配符(*)相关联的方式在目录中列出其中的所有文件。 +*列出文件* + +同时,我们也可以使用“echo(回显)”命令与一个通配符(*)参数来雷锤目录中的所有文件。 # echo * ![List All Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-files.gif) -列出所有的文件。 -### 2. 你会如何只通过使用echo命令来列出目录中的所有文件?### +*列出所有的文件。* + +### 2. 如何只使用echo命令来只列出所有目录?### # echo */ ![List All Directories](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-directories.gif) -列出所有的目录 -### 3. 你会怎样列出一个目录中的所有文件, 包括隐藏的dot文件?### +*列出所有的目录* + +### 3. 怎样列出一个目录中的所有文件, 包括隐藏的以“.”开头的文件?### 答:我们需要将“-a”选项与“ls”命令一起使用。 # ls -a ![List All Hidden Files](http://www.tecmint.com/wp-content/uploads/2014/09/list-all-hidden-files.gif) -列出所有的隐藏文件。 -### 4. 如何列出目录中除了 “当前目录暗喻(.)”和“父目录暗喻(..)”之外的所有文件,包括隐藏文件?### +*列出所有的隐藏文件。* + +### 4. 如何列出目录中除了 “当前目录 .”和“父目录 ..”之外的所有文件,包括隐藏文件?### 答: 我们需要将“-A”选项与“ls”命令一起使用 # ls -A ![Do Not List Implied](http://www.tecmint.com/wp-content/uploads/2014/09/Do-not-list-Implied.gif) -别列出暗喻文件。 -### 5. 如何将当前目录中的内容使用长格式打印列表?### +*别列出指代当前目录和父目录的文件* + +### 5. 如何使用长格式打印出当前目录内容?### 答: 我们需要将“-l”选项与“ls”命令一起使用。 # ls -l ![List Files Long](http://www.tecmint.com/wp-content/uploads/2014/09/list-files-long.gif) -列出文件的长格式。 + +*列出文件的长格式。* 上面的样例中,其输出结果看起来向下面这样。 drwxr-xr-x 5 avi tecmint 4096 Sep 30 11:31 Binary -上面的drwxr-xr-x 是文件的权限,分别代表了文件所有者,组以及对整个世界。 所有者具有读(r),写(w)以及执行(x)等权限。 该文件所属组具有读(r)和执行(x)但是没有写的权限,相同的权限预示着 -对于整个世界的其他可以访问该文件的用户。 +上面的drwxr-xr-x 是文件的权限,分别代表了文件所有者,所属组以及“整个世界”。 所有者具有读(r),写(w)以及执行(x)等权限。 该文件所属组具有读(r)和执行(x)但是没有写的权限,整个世界的其他可以访问到该文件的人也具有相同权限。 - 开头的‘d’意味着这是一个目录 -- 数字'5'表示符号链接 +- 数字'5'表示符号链接(有5个符号链接) - 文件 Binary归属于用户 “avi”以及用户组 "tecmint" - Sep 30 11:31 表示文件最后一次的访问日期与时间。 ### 6. 假如让你来将目录中的内容以长格式列表打印,并且显示出隐藏的“点文件”,你会如何实现?### -答: 我们需要同时将"-a"和"-l"选项与“ls”命令一起使用。 +答: 我们需要同时将"-a"和"-l"选项与“ls”命令一起使用(LCTT 译注:单字符选项可以合并写)。 # ls -la ![Print Content of Directory](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Content-of-Directory.gif) -打印目录内容 -同时,如果我们不想列出“当前目录暗喻”和"父目录暗喻",可以将“-A”和“-l”选项同“ls”命令一起使用。 +*打印目录内容* + +此外,如果我们不想列出“当前目录”和"父目录",可以将“-A”和“-l”选项同“ls”命令一起使用。 # ls -lA @@ -90,9 +96,10 @@ Unix或类Unix系统中的“文件列表”命令“ls”是最基础并且使 # ls --author -l ![List Author Files](http://www.tecmint.com/wp-content/uploads/2014/09/List-Author-Files.gif) -列出文件创建者。 -### 8. 如何对非显示字符进行转义打印?### +*列出文件创建者。* + +### 8. 如何对用转义字符打印出非显示字符?### 答:我们只需要使用“-b”选项来对非显示字符进行转义打印 @@ -100,52 +107,58 @@ Unix或类Unix系统中的“文件列表”命令“ls”是最基础并且使 ![Print Escape Character](http://www.tecmint.com/wp-content/uploads/2014/09/Print-Escape-Character.gif) -### 9. 指定特定的单位格式来列出文件和目录的大小,你会如何实现?### -答: 在此可以同时使用选项“-block-size=scale”和“-l”,但是我们需要用特定的单位如M,K等来替换‘scale’。 +### 9. 用指定特定的单位格式来列出文件和目录的大小,你会如何实现?### + +答: 在此可以同时使用选项“-block-size=scale”和“-l”,但是我们需要用特定的单位如M,K等来替换‘scale’参数。 # ls --block-size=M -l # ls --block-size=K -l ![List File Scale Format](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Scale-Format.gif) -列出文件大小单位格式。 -### 10. 列出目录中的非备份文件,也就是那些文件名以‘~’结尾的文件### +*列出文件大小单位格式。* + +### 10. 列出目录中的文件,但是不显示备份文件,即那些文件名以‘~’结尾的文件### 答: 选项‘-B’赶来救驾。 # ls -B ![List File Without Backup](http://www.tecmint.com/wp-content/uploads/2014/09/List-File-Without-Backup.gif) -列出非备份文件 -### 11. 将目录中的所有文件按照名称进行排序并与最后修改时间信息进行关联显示### +*列出非备份文件* + +### 11. 将目录中的所有文件按照名称进行排序,并显示其最后修改时间信息?### 答: 为了实现这个需求,我们需要同时将“-c”和"-l"选项与命令一起使用。 # ls -cl ![Sort Files](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files.gif) -文件排序 + +*文件排序* ### 12. 将目录中的文件按照修改时间进行排序,并显示相关联的信息。### -答: 我们需要同时使用3个选项--'-l','-t','-c'--与命令‘ls’一起使用来对文件使用修改时间排序,最新的修改时间排在最前。 +答: 我们需要同时使用3个选项:'-l','-t','-c' 来对文件使用修改时间排序,最新的修改时间排在最前。 # ls -ltc ![Sort Files by Modification](http://www.tecmint.com/wp-content/uploads/2014/09/Sort-Files-by-Modification.gif) -按照修改时间对文件排序。 + +*按照修改时间对文件排序。* ### 13. 如何控制‘ls’命令的输出颜色的有无?### -答: 需要使用选项‘--color=parameter’,parameter参数值具有三种不同值,“auto(自动)”,“always(一直)”,“never(无色)”。 +答: 需要使用选项‘--color=parameter’,参数具有三种不同值,“auto(自动)”,“always(一直)”,“never(无色)”。 # ls --color=never # ls --color=auto # ls --color=always ![ls Colorful Output](http://www.tecmint.com/wp-content/uploads/2014/09/ls-colorful-output.gif) -ls的输出颜色 + +*ls的输出颜色* ### 14. 假如只需要列出目录本身,而不是目录的内容,你会如何做?### @@ -154,9 +167,10 @@ ls的输出颜色 # ls -d ![List Directory Entries](http://www.tecmint.com/wp-content/uploads/2014/09/List-Directory-Entries.gif) -列出目录本身 -### 15. 为长格式列表命令"ls -l"创建别名“ll”,并将其结果输出到一个文件而不是标准输出中。### +*列出目录本身* + +### 15. 为长格式列表命令"ls -l"创建一个别名“ll”,并将其结果输出到一个文件而不是标准输出中。### 答:在上述的这个场景中,我们需要将别名添加到.bashrc文件中,然后使用重定向操作符将输出写入到文件而不是标准输出中。我们将会使用编辑器nano。 @@ -166,13 +180,14 @@ ls的输出颜色 # nano ll.txt ![Create Alias for ls command](http://www.tecmint.com/wp-content/uploads/2014/09/Create-ls-Alias.gif) -为ls命令创建别名。 + +*为ls命令创建别名。* 先到此为止,别忘了在下面的评论中提出你们的宝贵意见,我会再次带着另外的有趣的文章在此闪亮登场。 ### 参考阅读:### -- [10 个‘ls’命令的面试问题-第二部分][1] +- [10 个‘ls’命令的面试问题(二)][1] - [Linux中15个基础的'ls'命令][2] -------------------------------------------------------------------------------- @@ -187,4 +202,4 @@ via: http://www.tecmint.com/ls-command-interview-questions/ [a]:http://www.tecmint.com/author/avishek/ [1]:http://www.tecmint.com/ls-interview-questions/ -[2]:http://www.tecmint.com/15-basic-ls-command-examples-in-linux/ +[2]:http://linux.cn/article-5109-1.html From 5226789354a73a7c6e470572042550620152d8c8 Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Apr 2015 14:45:27 +0800 Subject: [PATCH 014/133] PUB:20150309 10 Useful 'ls' Command Interview Questions--Part 2 @theo-l --- ...ls' Command Interview Questions--Part 2.md | 109 ++++++++++-------- 1 file changed, 62 insertions(+), 47 deletions(-) rename {translated/tech => published}/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md (56%) diff --git a/translated/tech/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md b/published/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md similarity index 56% rename from translated/tech/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md rename to published/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md index f2cd020692..a166b8d36d 100644 --- a/translated/tech/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md +++ b/published/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md @@ -1,154 +1,169 @@ -10个有用的‘ls’命令面试问题-第二部分 +10 个‘ls’命 令面试的问题(二) ================================================================================ -这是关于文件列表命令的第二篇文章,继续探讨‘ls’命令的其他方面。该系列的第一篇文章收到了Tecmint社区的高度关注,如果你错过了该系列的第一部分,你可能会访问以下地址: +这是关于文件列表命令的第二篇文章,继续探讨‘ls’命令的其他方面。该系列的第一篇文章受到了社区的高度关注,如果你错过了该系列的第一部分,可以访问以下地址: -- [15 Interview Questions on “ls” Command – Part 1][1] +- [15 个‘ls’命令的面试问题(一)][1] 这篇文章通过样例来很好地展现‘ls’命令的深入应用,我们加倍小心地来写这篇文章来保持其简洁可理解性,同时又能提供最全面的服务。 ![10 Interview Questions on ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-Command-Interview-Questions.jpg) -10 Interview Questions on ls Command -### 1. 假如你想要以长列表的形式列出目录中的内容,但是不打印文件创建者名称以及文件所属组。同时在输出中显示其不同之处。### +*10 ‘ls’ 命令面试的问题* + +### 16. 假如你想要以长列表的形式列出目录中的内容,但是不打印文件创建者名称以及文件所属组。看看输出有何不同之处。### a. ls 命令在与‘-l’选项一起使用时会将文件以长列表格式输出。 # ls -l ![List Files in- Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-inLong-List-Format.gif) -List Files in- Long List Format + +*以长格式列出文件* b. ls 命令在与‘-l’和‘--author’一起使用时,会将文件以长列表格式输出并带有文件创建者的名称信息。 # ls -l --author ![List Files By Author](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-By-Author.gif) -List Files By Author + +*列出文件的创建者* c. ls 命令在与‘-g’选项 一起将会列出文件名但是不带属主名称。 # ls -g ![List Files Without Printing Owner Name](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Printing-Author.gif) -List Files Without Printing Owner Name -d. ls 命令在与'-G'和‘-l’选项一起将会使用长列表格式列出文件名称带式不带文件所属组名称。 +*列出文件但不列出属主* + +d. ls 命令在与'-G'和‘-l’选项一起将会使用长列表格式列出文件名称但是不带文件所属组名称。 + # ls -Gl ![List Files Without Printing Group](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Printing-Group.gif) -List Files Without Printing Group -### 2. 使用用户友好的格式打印出当前目录中的文件以及文件夹的大小,你会如何做?### +*列出文件但是不列出所属组* + +### 17. 使用易读格式打印出当前目录中的文件以及文件夹的大小,你会如何做?### + +这里我们需要使用'-h'选项(人类可阅读的、易读的)同‘-l’或‘-s’选项与ls命令一起使用来得到想要的输出。 -这里我们需要使用'-h'选项(人类可阅读的)同‘-l’或‘-s’选项与ls命令一起使用来得到想要的输出。 # ls -hl ![List Files in Human Readable Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-Size-of-Files-with-ls.gif) -List Files in Human Readable Format + +*以易读格式的长列表列出文件* # ls -hs ![List File Sizes in Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/List-File-Sizes-in-Readable-Format.gif) -List File Sizes in Long List Format + +*以易读格式的短列表列出文件* **注意**: ‘-h’选项使用1024(计算机中的标准)的幂,文件或文件夹的大小分别以K,M和G作为输出单位。 -### 3. 既然‘-h’选项是使用1024的幂作为标准来输出大小,那么ls命令还支持其他的幂值呢?### +### 18. 既然‘-h’选项是使用1024的幂作为标准来输出大小,那么ls命令是否还支持其他的幂值呢?### -存在一个选项 ‘-si’与选项‘-h’相似,不同之处在于前者以使用1000的幂,后者使用1024的幂。 +存在一个选项 ‘--si’与选项‘-h’相似,不同之处在于前者以使用1000的幂,后者使用1024的幂。 - # ls -si + # ls --si -![Supported Power Values of ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/ls-supported-power-values.gif) -Supported Power Values of ls Command +所以'--si'也可以与‘-l’选项一起使用来按照1000的幂来输出文件夹的大小,并且以长列表格式显示。 -所以'-si'也可以与‘-l’选项一起使用来按照1000的幂来输出文件夹的大小,并且以长列表格式显示。 + # ls --si -l - # ls -si -l +(LCTT 译注:此处原文参数有误,附图也不对,因此删除之) -![List Files by Power Values](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-by-Power-Values.gif) -List Files by Power Values +### 19. 假如要你使用逗号‘,’作为分隔符来打印一个目录中的内容,可以吗? 对于长列表形式也可行吗?### -### 4. 假如要你使用逗号‘,’作为分隔符来打印一个目录中的内容,可以吗? 对于长列表形式也可行吗?### - -当然!linux的ls命令当与其选项‘-m’一起使用时可以在打印目录内容时以逗号‘,’分割。由于逗号分割的内容是水平填充的,ls命令不能在垂直列出内容时使用逗号来分割内容。 +当然!linux的ls命令当与其选项‘-m’一起使用时可以在打印目录内容时以逗号‘,’分割。由于逗号分割的内容是水平填充的,ls命令不能在垂直列出内容时使用逗号来分割内容。 # ls -m ![Print Contents of Directory by Comma](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Contents-of-Directory-by-Comma.gif) -Print Contents of Directory by Comma + +*以逗号分隔显示内容* 当使用长列表格式时,‘-m’选项就没有什么效果了。 # ls -ml ![Listing Content Horizontally](http://www.tecmint.com/wp-content/uploads/2015/03/Listing-Content-Horizentally.gif) -Listing Content Horizontally -### 5. 有办法将目录的内容逆序打印出来吗?### +*长列表不能使用逗号分隔列表* + +### 20. 有办法将目录的内容逆序打印出来吗?### 可以!上面的情形可以轻松地通过'-r'选项搞定,该选项将输出顺序倒置。这个选项也可以与‘-l’选项一起使用。 # ls -r ![List Content in Reverse Order](http://www.tecmint.com/wp-content/uploads/2015/03/List-Content-in-Reverse-Order.gif) -List Content in Reverse Order + +*逆序列出* # ls -rl ![Long List Content in Reverse Order](http://www.tecmint.com/wp-content/uploads/2015/03/Long-List-Content-in-Reverse-Order.gif) -Long List Content in Reverse Order -### 6. 如果你被分配一个任务,来递归地打印各个子目录,你会如何应付?注意哟,只针对子目录而不是文件哦。### +*逆序长列表* + +### 21. 如果你被分配一个任务,来递归地打印各个子目录,你会如何应付?注意,只针对子目录而不是文件哦。### 小意思!使用“-R”选项就可以轻轻松松拿下,它也可以更进一步地与其他选项如‘-l’和‘-m’选项等组合使用。 + # ls -R ![Print Sub Directories in Recursively](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Sub-Directories-in-Recursively.gif) -Print Sub Directories in Recursively -### 7. 如何按照文件大小对其进行排序?### +*递归列出子目录* + +### 22. 如何按照文件大小对其进行排序?### linux命令行选项'-S'赋予了ls命令这个超能力。按照文件大小从大到小的顺序排序: # ls -S ![Sort Files with ls Command](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Files-in-Linux.gif) -Sort Files with ls Command +*按文件大小排序* 按照文件大小从小到大的顺序排序。 # ls -Sr ![Sort Files in Descending Order](http://www.tecmint.com/wp-content/uploads/2015/03/Sort-Files-in-Descending-Order.gif) -Sort Files in Descending Order -### 8. 列出目录中的内容按照一行一个文件并且不带额外信息的方式 ### +*从小到大的排序* -选项‘-l’在此可以解决这个问题,使用‘-l’选项来使用ls命令可以将目录中的内容按照一行一个文件并且不带额外信息的方式进行输出。 +### 23. 按照一行一个文件列出目录中的内容,并且不带额外信息的方式 ### + +选项‘-1’在此可以解决这个问题,使用‘-1’选项来使用ls命令可以将目录中的内容按照一行一个文件并且不带额外信息的方式进行输出。 # ls -1 ![List Files Without Information](http://www.tecmint.com/wp-content/uploads/2015/03/List-Files-Without-Information.gif) -List Files Without Information -### 9. 现在委派给你一个任务,你必须将目录中的内容输出到终端而且需要使用双引号引起来,你会如何做?### +*不带其他信息,一行一个列出文件* -存在一个选项‘-Q’会将ls命令的输出内容用双引号引起来。 +### 24. 现在委派给你一个任务,你必须将目录中的内容输出到终端而且需要使用双引号引起来,你会如何做?### + +有一个选项‘-Q’会将ls命令的输出内容用双引号引起来。 # ls -Q ![Print Files with Double Quotes](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Files-with-Double-Quotes.gif) -Print Files with Double Quotes -### 10. 想象一下你正在与一个包含有很多文件和文件夹的目录打交道,你需要使目录名显示在文件名之前,你如何做?### +*输出的文件名用引号引起来* + +### 25. 想象一下你正在与一个包含有很多文件和文件夹的目录打交道,你需要使目录名显示在文件名之前,你如何做?### # ls --group-directories-first ![Print Directories First](http://www.tecmint.com/wp-content/uploads/2015/03/Print-Directories-First.gif) -Print Directories First -先点到为止,我们会马上提供该系列文章的下一部分。别换频道,关注Tecmint。 另外别忘了在下面的评论中提出你们宝贵的反馈信息,喜欢就分享,帮助我们得到更好的传播吧! +*目录优先显示* + +先点到为止,我们会马上提供该系列文章的下一部分。别换频道,关注我们。 另外别忘了在下面的评论中提出你们宝贵的反馈信息,喜欢就分享,帮助我们得到更好的传播吧! -------------------------------------------------------------------------------- @@ -156,9 +171,9 @@ via: http://www.tecmint.com/ls-interview-questions/ 作者:[Ravi Saive][a] 译者:[theo-l](https://github.com/theo-l) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/admin/ -[1]:http://www.tecmint.com/ls-command-interview-questions/ +[1]:http://linux.cn/article-5349-1.html From c6869763159dbca1c2af22c84131fe3caf5f7d1d Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Apr 2015 21:07:42 +0800 Subject: [PATCH 015/133] PUB:30 Things to Do After Minimal RHEL or CentOS 7 Installation--3 @ictlyh --- ...inimal RHEL or CentOS 7 Installation--3.md | 108 +++++++++++------- 1 file changed, 66 insertions(+), 42 deletions(-) rename {translated/tech => published}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md (74%) diff --git a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md similarity index 74% rename from translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md rename to published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md index b3630b5aa5..318d38b03c 100644 --- a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md +++ b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md @@ -1,4 +1,4 @@ -安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情--3 +安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(三) ================================================================================ ### 12. 安装 Apache Tomcat ### @@ -7,7 +7,8 @@ Tomcat 是由 Apache 设计的用来运行 Java HTTP web 服务器的 servlet # yum install tomcat ![安装 Apache Tomcat](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Apache-Tomcat.jpeg) -安装 Apache Tomcat + +*安装 Apache Tomcat* 安装完 tomcat 之后,启动 tomcat 服务。 @@ -18,11 +19,12 @@ Tomcat 是由 Apache 设计的用来运行 Java HTTP web 服务器的 servlet # /usr/sbin/tomcat version ![查看 tomcat 版本](http://www.tecmint.com/wp-content/uploads/2015/04/Check-tomcat-version.jpeg) -查看 tomcat 版本 + +*查看 tomcat 版本* 允许 tomcat 服务和默认端口(8080) 通过防火墙并重新加载设置。 - # firewall-cmd –zone=public –add-port=8080/tcp --permannet + # firewall-cmd –zone=public –add-port=8080/tcp --permanent # firewall-cmd –reload 现在该保护 tomcat 服务器了,添加一个用于访问和管理的用户和密码。我们需要编辑文件 ‘/etc/tomcat/tomcat-users.xml’。查看类似下面的部分: @@ -32,7 +34,7 @@ Tomcat 是由 Apache 设计的用来运行 Java HTTP web 服务器的 servlet - + @@ -42,44 +44,48 @@ Tomcat 是由 Apache 设计的用来运行 Java HTTP web 服务器的 servlet ![保护 Tomcat](http://www.tecmint.com/wp-content/uploads/2015/04/Secure-Tomcat.jpeg) -保护 Tomcat -我们在这里添加用户 “tecmint” 到 tomcat 的管理员/管理 组中,使用 “tecmint” 作为密码。先停止在启动 tomcat 服务以使更改生效,并添加 tomcat 服务到随系统启动。 +*保护 Tomcat* + +我们在这里添加用户 “tecmint” 到 tomcat 的管理员/管理组中,使用 “tecmint” 作为密码。先停止再启动 tomcat 服务以使更改生效,并添加 tomcat 服务到随系统启动。 # systemctl stop tomcat # systemctl start tomcat # systemctl enable tomcat.service -请阅读: 在 RHEL/CentOS 7.0/6.x 中安装和配置 Apache Tomcat 8.0.9 +请阅读: [在 RHEL/CentOS 7.0/6.x 中安装和配置 Apache Tomcat 8.0.9][5] ### 13. 安装 Nmap 监视开放端口 ### -Nmap 网络映射器通过检查运行它的主机以及分析网络创建一个网络映射。nmap 并没有默认安装,你需要从库中安装它。 +Nmap 网络映射器用来分析网络,通过运行它可以发现网络的映射关系。nmap 并没有默认安装,你需要从库中安装它。 # yum install nmap ![安装 Nmap 监视工具](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Nmap.jpeg) -安装 Nmap 监视工具 + +*安装 Nmap 监视工具* 列出主机中所有的开放端口以及对应使用它们的服务。 # namp 127.0.01 !监视开放端口](http://www.tecmint.com/wp-content/uploads/2015/04/Monitor-Open-Ports.jpeg) -监视开放端口 + +*监视开放端口* 你也可以使用 firewall-cmd 列出所有端口,但我发现 nmap 更有用。 # firewall-cmd –list-ports ![在防火墙中检查开放端口](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Open-Ports-in-Firewall.jpeg) -在防火墙中检查开放端口 + +*在防火墙中检查开放端口* 请阅读: [Nmap 监视开放端口的 29 个有用命令][1] ### 14. 配置 FirewallD ### -firewalld 是动态管理服务器的防火墙服务。在 CentOS 7 中 Firewalld 移除了 iptables。在红帽企业版 Linux 和它的衍生版中默认安装了 Firewalld。如果有 iptables 的话为了使每个更改生效需要清空所有旧的规则然后创建新规则。 +firewalld 是动态管理服务器的防火墙服务。在 CentOS 7 中 Firewalld 移除了 iptables 服务。在红帽企业版 Linux 和它的衍生版中默认安装了 Firewalld。如果有 iptables 的话为了使每个更改生效需要清空所有旧的规则然后创建新规则。 然而用firewalld,不需要清空并重新创建新规则就可以实现更改生效。 @@ -90,59 +96,66 @@ firewalld 是动态管理服务器的防火墙服务。在 CentOS 7 中 Firewall # firewall-cmd –state ![检查 Firewalld 状态](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Firewalld-Status.jpeg) -检查 Firewalld 状态 + +*检查 Firewalld 状态* 获取所有的区域列表。 # firewall-cmd --get-zones ![检查 Firewalld 区域](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Firewalld-Zones.jpeg) -检查 Firewalld 区域 + +*检查 Firewalld 区域* 在切换之前先获取区域的详细信息。 # firewall-cmd --zone=work --list-all ![检查区域详情](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Zone-Details.jpeg) -检查区域详情 + +*检查区域详情* 获取默认区域。 # firewall-cmd --get-default-zone ![Firewalld 默认区域](http://www.tecmint.com/wp-content/uploads/2015/04/Firewalld-Default-Zone.jpeg) -Firewalld 默认区域 + +*Firewalld 默认区域* 切换到另一个区域,比如 ‘work’。 # firewall-cmd --set-default-zone=work ![切换 Firewalld 区域](http://www.tecmint.com/wp-content/uploads/2015/04/Swich-Zones.jpeg) -切换 Firewalld 区域 + +*切换 Firewalld 区域* 列出区域中的所有服务。 # firewall-cmd --list-services ![列出 Firewalld 区域的服务](http://www.tecmint.com/wp-content/uploads/2015/04/List-Firewalld-Service.jpeg) -列出 Firewalld 区域的服务 + +*列出 Firewalld 区域的服务* 添加临时服务,比如 http,然后重载 firewalld。 # firewall-cmd --add-service=http # firewall-cmd –reload -添加临时 http 服务 +![添加临时 http 服务](http://www.tecmint.com/wp-content/uploads/2015/04/Add-http-Service-Temporarily.jpeg) -添加临时 http 服务 +*添加临时 http 服务* 添加永久服务,比如 http,然后重载 firewalld。 -# firewall-cmd --add-service=http --permanent -# firewall-cmd --reload + # firewall-cmd --add-service=http --permanent + # firewall-cmd --reload ![添加永久 http 服务](http://www.tecmint.com/wp-content/uploads/2015/04/Add-http-Service-Temporarily.jpeg) -添加永久 http 服务 + +*添加永久 http 服务* 删除临时服务,比如 http。 @@ -150,7 +163,8 @@ Firewalld 默认区域 # firewall-cmd --reload ![删除临时 Firewalld 服务](http://www.tecmint.com/wp-content/uploads/2015/04/Add-http-Service-Permanent.jpeg) -删除临时 Firewalld 服务 + +*删除临时 Firewalld 服务* 删除永久服务,比如 http @@ -158,7 +172,8 @@ Firewalld 默认区域 # firewall-cmd --reload ![删除永久服务](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Service-Parmanently.jpeg) -删除永久服务 + +*删除永久服务* 允许一个临时端口(比如 331)。 @@ -166,7 +181,8 @@ Firewalld 默认区域 # firewall-cmd --reload ![打开临时 Firewalld 端口](http://www.tecmint.com/wp-content/uploads/2015/04/Open-Port-Temporarily.jpeg) -打开临时端口 + +*打开临时端口* 允许一个永久端口(比如 331)。 @@ -174,7 +190,8 @@ Firewalld 默认区域 # firewall-cmd --reload ![打开永久 Firewalld 端口](http://www.tecmint.com/wp-content/uploads/2015/04/Open-Port-Permanent.jpeg) -打开永久端口 + +*打开永久端口* 阻塞/移除临时端口(比如 331)。 @@ -182,7 +199,8 @@ Firewalld 默认区域 # firewall-cmd --reload ![移除 Firewalld 临时端口](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Port-Temporarily.jpeg) -移除临时端口 + +*移除临时端口* 阻塞/移除永久端口(比如 331)。 @@ -190,7 +208,8 @@ Firewalld 默认区域 # firewall-cmd --reload ![移除 Firewalld 永久端口](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Port-Permanently.jpeg) -移除永久端口 + +*移除永久端口* 停用 firewalld。 @@ -199,7 +218,8 @@ Firewalld 默认区域 # firewall-cmd --state ![在 CentOS 7 中停用 Firewalld](http://www.tecmint.com/wp-content/uploads/2015/04/Disable-Firewalld.jpeg) -停用 Firewalld 服务 + +*停用 Firewalld 服务* 启用 firewalld。 @@ -208,33 +228,36 @@ Firewalld 默认区域 # firewall-cmd --state ![在 CentOS 7 中取消 Firewalld](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Firewalld.jpeg) -启用 Firewalld + +*启用 Firewalld* - [如何在 RHEL/CentOS 7 中配置 ‘Firewalld’][2] - [配置和管理 Firewalld 的有用 ‘Firewalld’ 规则][3] ### 15. 安装 Wget ### -Wget 是基于 Linux 命令行从 web 服务器获取(下载)内容的工具。它是你使用 wget 命令获取 web 内容或下载任何文件必须要有的重要工具。 +Wget 是从 web 服务器获取(下载)内容的命令行工具。它是你使用 wget 命令获取 web 内容或下载任何文件必须要有的重要工具。 # yum install wget ![安装 Wget 工具](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Wget.png) -安装 Wget 工具 + +*安装 Wget 工具* 关于在终端中如何使用 wget 命令下载文件的方法和实际例子,请阅读[10 个 Wget 命令例子][4]。 -### 16. 安装 Telnet ### +### 16. 安装 Telnet 客户端### -Telnet 是通过 TCP/IP 允许用户登录到相同网络上的另一台计算机的网络协议。和远程计算机的连接建立后,它就成为了一个允许你在自己的计算机上用所有提供给你的权限和远程主机交互的虚拟终端。 +Telnet 是通过 TCP/IP 允许用户登录到相同网络上的另一台计算机的网络协议。和远程计算机的连接建立后,它就成为了一个允许你在自己的计算机上用所有提供给你的权限和远程主机交互的虚拟终端。(LCTT 译注:除非你真的需要,不要安装 telnet 服务,也不要用 telnet 客户端连接另外一个 telnet 服务,因为 telnet 是明文传输的。不过如下用 telnet 客户端检测另外一个服务的端口是否工作是常用的操作。) Telnet 对于检查远程计算机或主机的监听端口也非常有用。 # yum install telnet # telnet google.com 80 -![检查 Telnet 端口](http://www.tecmint.com/wp-content/uploads/2015/04/telnet-testing.png) -检查 Telnet 端口 +![Telnet 端口检查](http://www.tecmint.com/wp-content/uploads/2015/04/telnet-testing.png) + +*Telnet 端口检查* -------------------------------------------------------------------------------- @@ -242,12 +265,13 @@ via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installatio 作者:[Avishek Kumar][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/nmap-command-examples/ -[2]:http://www.tecmint.com/configure-firewalld-in-centos-7/ +[1]:http://linux.cn/article-2561-1.html +[2]:http://linux.cn/article-4425-1.html [3]:http://www.tecmint.com/firewalld-rules-for-centos-7/ -[4]:http://www.tecmint.com/10-wget-command-examples-in-linux/ \ No newline at end of file +[4]:http://linux.cn/article-4129-1.html +[5]:http://www.tecmint.com/install-apache-tomcat-in-centos/ \ No newline at end of file From 642e1881a52bd9409915fd807d287e6e295a311e Mon Sep 17 00:00:00 2001 From: wxy Date: Tue, 28 Apr 2015 22:17:19 +0800 Subject: [PATCH 016/133] PUB:20150215 How to analyze and view Apache web server logs interactively on Linux @disylee --- ... web server logs interactively on Linux.md | 144 +++++++++++++++ ... web server logs interactively on Linux.md | 167 ------------------ 2 files changed, 144 insertions(+), 167 deletions(-) create mode 100644 published/20150215 How to analyze and view Apache web server logs interactively on Linux.md delete mode 100644 translated/tech/20150215 How to analyze and view Apache web server logs interactively on Linux.md diff --git a/published/20150215 How to analyze and view Apache web server logs interactively on Linux.md b/published/20150215 How to analyze and view Apache web server logs interactively on Linux.md new file mode 100644 index 0000000000..06a32d3fcb --- /dev/null +++ b/published/20150215 How to analyze and view Apache web server logs interactively on Linux.md @@ -0,0 +1,144 @@ +在 Linux 中以交互方式实时查看Apache web访问统计 +================================================================================ + +无论你是在网站托管业务,还是在自己的VPS上运行几个网站,你总会有需要显示访客统计信息,例如前几的访客、访问请求的文件(无论动态或者静态)、所用的带宽、客户端的浏览器,和访问的来源网站,等等。 + +[GoAccess][1] 是一款用于Apache或者Nginx的命令行日志分析器和交互式查看器。使用这款工具,你不仅可以浏览到之前提及的相关数据,还可以通过分析网站服务器日志来进一步挖掘数据 - 而且**这一切都是在一个终端窗口实时输出的**。由于今天的[大多数web服务器][2]都使用Debian的衍生版或者基于RedHat的发行版来作为底层操作系统,所以本文中我告诉你如何在Debian和CentOS中安装和使用GoAccess。 + +### 在Linux系统安装GoAccess ### + +在Debian,Ubuntu及其衍生版本,运行以下命令来安装GoAccess: + + # aptitude install goaccess + +在CentOS中,你将需要使你的[EPEL 仓库][3]可用然后执行以下命令: + + # yum install goaccess + +在Fedora,同样使用yum命令: + + # yum install goaccess + + +如果你想从源码安装GoAccess来使用更多功能(例如 GeoIP 定位功能),需要在你的操作系统安装[必需的依赖包][4],然后按以下步骤进行: + + # wget http://tar.goaccess.io/goaccess-0.8.5.tar.gz + # tar -xzvf goaccess-0.8.5.tar.gz + # cd goaccess-0.8.5/ + # ./configure --enable-geoip + # make + # make install + +以上安装的版本是 0.8.5,但是你也可以在该软件的网站[下载页][5]确认是否是最新版本。 + +由于GoAccess不需要后续的配置,一旦安装你就可以马上使用。 + +### 运行 GoAccess ### + +开始使用GoAccess,只需要对它指定你的Apache访问日志。 + +对于Debian及其衍生版本: + + # goaccess -f /var/log/apache2/access.log + +基于红帽的发行版: + + # goaccess -f /var/log/httpd/access_log + +当你第一次启动GoAccess,你将会看到如下的屏幕中选择日期和日志格式。正如前面所述,你可以按空格键进行选择,并按F10确认。至于日期和日志格式,你可能需要参考[Apache 文档][6]来刷新你的记忆。 + +在这个例子中,选择常见日志格式(Common Log Format(CLF)): + +![](https://farm8.staticflickr.com/7422/15868350373_30c16d7c30.jpg) + +然后按F10 确认。你将会从屏幕上看到统计数据。为了简洁起见,这里只显示了首部,也就是日志文件的摘要,如下图所示: + +![](https://farm9.staticflickr.com/8683/16486742901_7a35b5df69_b.jpg) + +### 通过 GoAccess来浏览网站服务器统计数据 ### + +你可以按向下的箭头滚动页面,你会发现以下区域,它们是按请求排序的。这里提及的目录顺序可能会根据你的发行版或者你所选的安装方式(从源和库)不同而不同: + +1. 每天唯一访客(来自同样IP、同一日期和同一浏览器的请求被认为是是唯一访问) + + ![](https://farm8.staticflickr.com/7308/16488483965_a439dbc5e2_b.jpg) + +2. 请求的文件(网页URL) + + ![](https://farm9.staticflickr.com/8651/16488483975_66d05dce51_b.jpg) + +3. 请求的静态文件(例如,.png文件,.js文件等等) + +4. 来源的URLs(每一个URL请求的出处) + +5. HTTP 404 未找到的响应代码 + + ![](https://farm9.staticflickr.com/8669/16486742951_436539b0da_b.jpg) + +6. 操作系统 + +7. 浏览器 + +8. 主机地址(客户端IP地址) + + ![](https://farm8.staticflickr.com/7392/16488483995_56e706d77c_z.jpg) + +9. HTTP 状态代码 + + ![](https://farm8.staticflickr.com/7282/16462493896_77b856f670_b.jpg) + +10. 前几位的来源站点 + +11. 来自谷歌搜索引擎的前几位的关键字 + +如果你想要检查已经存档的日志,你可以通过管道将它们发送给GoAccess,如下: + +在Debian及其衍生版本: + + # zcat -f /var/log/apache2/access.log* | goaccess + +在基于红帽的发行版: + + # cat /var/log/httpd/access* | goaccess + +如果你需要上述部分的详细报告(1至11项),直接按下其序号再按O(大写o),就可以显示出你需要的详细视图。下面的图像显示5-O的输出(先按5,再按O) + +![](https://farm8.staticflickr.com/7382/16302213429_48d9233f40_b.jpg) + +如果要显示GeoIP位置信息,打开主机部分的详细视图,如前面所述,你将会看到正在请求你的服务器的客户端IP地址所在的位置。 + +![](https://farm8.staticflickr.com/7393/16488484075_d778aa91a2_z.jpg) + +如果你的系统还不是很忙碌,以上提及的章节将不会显示大量的信息,但是这种情形可以通过在你网站服务器越来越多的请求发生改变。 + +### 保存用于离线分析的报告 ### + +有时候你不想每次都实时去检查你的系统状态,可以保存一份在线的分析文件或打印出来。要生成一个HTML报告,只需要通过之前提到GoAccess命令,将输出来重定向到一个HTML文件即可。然后,用web浏览器来将这份报告打开即可。 + + # zcat -f /var/log/apache2/access.log* | goaccess > /var/www/webserverstats.html + +一旦报告生成,你将需要点击展开的链接来显示每个类别详细的视图信息: + +![](https://farm9.staticflickr.com/8658/16486743041_bd8a80794d_o.png) + +可以查看youtube视频:https://youtu.be/UVbLuaOpYdg 。 + +正如我们通过这篇文章讨论,GoAccess是一个非常有价值的工具,它能给系统管理员实时提供可视的HTTP 统计分析。虽然GoAccess的默认输出是标准输出,但是你也可以将他们保存到JSON,HTML或者CSV文件。这种转换可以让 GoAccess在监控和显示网站服务器的统计数据时更有用。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html + +作者:[Gabriel Cánepa][a] +译者:[disylee](https://github.com/disylee) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/gabriel +[1]:http://goaccess.io/ +[2]:http://w3techs.com/technologies/details/os-linux/all/all +[3]:http://linux.cn/article-2324-1.html +[4]:http://goaccess.io/download#dependencies +[5]:http://goaccess.io/download +[6]:http://httpd.apache.org/docs/2.4/logs.html diff --git a/translated/tech/20150215 How to analyze and view Apache web server logs interactively on Linux.md b/translated/tech/20150215 How to analyze and view Apache web server logs interactively on Linux.md deleted file mode 100644 index 51ad96d272..0000000000 --- a/translated/tech/20150215 How to analyze and view Apache web server logs interactively on Linux.md +++ /dev/null @@ -1,167 +0,0 @@ -如何在Linux中以交互方式分析和查看Apache web服务器日志? -================================================================================ - -无论你是在网站托管业务,还是在自己的VPS上运行几个网站,你总会有机会想要显示访客数量例如前几的房客,请求使用的文件(无论是动态或者是静态),带宽的使用,客户端的浏览器,和相关的网站,等等。 - - -[GoAccess][1] 是一款用于Apache或者Nginx命令行日志分析和交互式查看器。有了这款工具,你不仅可以浏览到之前提及的相关数据,还可以分析网站服务器日志来进一步挖掘数据 - 然而 **这一切都可以在一个终端窗口实时输出**.由于今天的[大多数web服务器][2]使用一个Debian的衍生版或者基于红帽发行版来作为底层操作系统,我将会告诉你如何在Debian和CentOS中安装和使用GoAccess。 - - -### 在Linux系统安装GoAccess ### - - -在Debian,Ubuntu及其衍生版本,运行一下命令来安装GoAccess: - - # aptitude install goaccess - -在CentOS中,你将需要使你的[EPEL 仓库][3]可用然后执行以下命令: - - # yum install goaccess - -在Fedora,同样使用yum命令: - - # yum install goaccess - - -如果你想从源码安装GoAccess来使后续的功能可用(例如 GeoIP 的位置),为你的操作系统安装[必需的依赖包][4],按以下步骤进行: - - # wget http://tar.goaccess.io/goaccess-0.8.5.tar.gz - # tar -xzvf goaccess-0.8.5.tar.gz - # cd goaccess-0.8.5/ - # ./configure --enable-geoip - # make - # make install - - -以上安装的版本是 0.8.5,但是你也可以在该软件的网站[下载页][5]确认是否是最新版本。 - - -由于GoAccess不需要后续的配置,一旦安装你就可以马上使用。 - - -### 运行 GoAccess ### - -开始使用GoAccess,只需要对它运行你的Apache访问日志。 - - -对于Debian及其衍生版本: - - # goaccess -f /var/log/apache2/access.log - - -基于红帽的发型版本: - - # goaccess -f /var/log/httpd/access_log - - -当你第一次启动GoAccess,你将会看到下方屏幕中选择日期和日志格式。正如前面所述,你可以选择在空格键和F10之间相互切换。至于日期和日志格式,你可能希望参考[Apache 文档][6]来刷新你的记忆。 - - -在这个例子中,选择常见日志格式(CLI): - -![](https://farm8.staticflickr.com/7422/15868350373_30c16d7c30.jpg) - -然后按F10.你将会从屏幕中获得统计数据。为了简约,只显示首部,也就是总结日志文件的摘要,如下图所示: - - -![](https://farm9.staticflickr.com/8683/16486742901_7a35b5df69_b.jpg) - -### 通过 GoAccess来浏览网站服务器统计数据 ### - -当你通过向下的剪头滚动页面,你会发现一下章节,按要求进行排序。这里提及的目录顺序可能会根据你的发型版本或者(从源和库)首选的安装方式: - -1. 每天唯一访客(具有同样IP,同一日期和统一代理被认为是) - -![](https://farm8.staticflickr.com/7308/16488483965_a439dbc5e2_b.jpg) - -2. 请求的文件(网页URL) - - -![](https://farm9.staticflickr.com/8651/16488483975_66d05dce51_b.jpg) - -3. 请求的静态文件(例如,.png文件,.js文件等等) - -4. 请求的URLs(每一个URL请求的出处) - -5. HTTP 404 不能找到响应的代码 - -![](https://farm9.staticflickr.com/8669/16486742951_436539b0da_b.jpg) - -6. 操作系统 - -7. 浏览器 - -8. 主机(客户端IP地址) - -![](https://farm8.staticflickr.com/7392/16488483995_56e706d77c_z.jpg) - -9. HTTP 状态代码 - -![](https://farm8.staticflickr.com/7282/16462493896_77b856f670_b.jpg) - -10. 前几位的推荐站点 - -11. 在谷歌的搜索引擎使用的排名在前的关键字 - - -如果你还想检查已经存档的日志,你可以在GoAccess通过使用管道符号如下。 - -在Debian及其衍生版本: - - # zcat -f /var/log/apache2/access.log* | goaccess - -在基于红帽的发型版本: - - # cat /var/log/httpd/access* | goaccess - - -如果你需要任何更多关于以上的详细报告(1至11项),直接按下章节序号再按O(大写o),就可以显示出你需要的详细视图。下面的图像显示5-O的输出(先按5,再按O) - -![](https://farm8.staticflickr.com/7382/16302213429_48d9233f40_b.jpg) - - -如果要现实GeoIP位置信息,打开详细视图的主机部分,如前面所述,你将会看到客户端IP地址所在的位置以及显示web服务器的请求。 - - -![](https://farm8.staticflickr.com/7393/16488484075_d778aa91a2_z.jpg) - - -如果你的系统还尚未达到很忙碌的状态,以上提及的章节将不会显示大量的信息,但是这种情形可以通过在你网站服务器越来越多的请求发生改变。 - -### 在线保存分析的报告 ### - - -当然有时候你不想每次都实时去检查你的系统状态,但是保存一份在线的分析文件或者打印版是由必要的。要生成一个HTML报告,只需要通过之前提到GoAccess命令输出来简单地重定向道一个HTML文件。然后,你只需通过web浏览器来将这份报告打开即可。 - - - - # zcat -f /var/log/apache2/access.log* | goaccess > /var/www/webserverstats.html - - -一旦报告生成,你将需要点击展开的链接来显示每个类别详细的视图信息: - -![](https://farm9.staticflickr.com/8658/16486743041_bd8a80794d_o.png) - -注释:youtube视频 - - - -正如我们通过这篇文章讨论,GoAccess是一个非常可贵的工具,它提供给作为百忙之中的系统管理员一份HTTP统计的静态可是报告。虽然GoAccess默认其输出结果为标准输出,但是你也可以将他们保存到JSON,HTML或者CSV文件。这样的转换,GoAccess将作为一个非常有用的工具来监控和显示网站服务器的统计数据。 - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html - -作者:[Gabriel Cánepa][a] -译者:[disylee](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/gabriel -[1]:http://goaccess.io/ -[2]:http://w3techs.com/technologies/details/os-linux/all/all -[3]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html -[4]:http://goaccess.io/download#dependencies -[5]:http://goaccess.io/download -[6]:http://httpd.apache.org/docs/2.4/logs.html From b4ed95c3e83b69a24c46fdf2c5b3e8fcfced0b42 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 28 Apr 2015 22:44:54 +0800 Subject: [PATCH 017/133] [Translating] tech/20150108 Interface (NICs) Bonding in Linux using nmcli --- .../20150108 Interface (NICs) Bonding in Linux using nmcli.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md b/sources/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md index fa02f19ce6..41eee7a86f 100644 --- a/sources/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md +++ b/sources/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md @@ -1,3 +1,4 @@ +Translating by ictlyh Interface (NICs) Bonding in Linux using nmcli ================================================================================ Today, we'll learn how to perform Interface (NICs) bonding in our CentOS 7.x using nmcli (Network Manager Command Line Interface). From c2ebd5809c556fec2eeb3d85dbded027f2f8b2cb Mon Sep 17 00:00:00 2001 From: KS Date: Wed, 29 Apr 2015 09:57:23 +0800 Subject: [PATCH 018/133] Update 20141013 Compact Text Editors Great for Remote Editing and Much More.md --- ...pact Text Editors Great for Remote Editing and Much More.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md index 401a4da2fc..21b0756b9a 100644 --- a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md +++ b/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md @@ -1,3 +1,4 @@ +wyangsun翻译中 Compact Text Editors Great for Remote Editing and Much More ================================================================================ A text editor is software used for editing plain text files. This type of software has many different uses including modifying configuration files, writing programming language source code, jotting down thoughts, or even making a grocery list. Given that editors can be used for such a diverse range of activities, it is worth spending the time finding an editor that best suites your preferences. @@ -216,4 +217,4 @@ via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html [2]:http://www.vim.org/ [3]:http://ne.di.unimi.it/ [4]:http://www.gnu.org/software/zile/ -[5]:http://nano-editor.org/ \ No newline at end of file +[5]:http://nano-editor.org/ From f869d942b1d6881fddb89dc2c21e17a70b5ee872 Mon Sep 17 00:00:00 2001 From: royaso Date: Wed, 29 Apr 2015 10:57:30 +0800 Subject: [PATCH 019/133] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=BF=BB=E8=AF=91:we?= =?UTF-8?q?b=20caching=20basics=20terminology=20http=20headers=20and=20cac?= =?UTF-8?q?hing=20strategies.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ogy http headers and caching strategies.md | 444 ++++++++++++++++++ 1 file changed, 444 insertions(+) create mode 100644 sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md diff --git a/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md new file mode 100644 index 0000000000..df0eb8b723 --- /dev/null +++ b/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -0,0 +1,444 @@ +Web Caching Basics: Terminology, HTTP Headers, and Caching Strategies +===================================================================== + +### Introduction + +Intelligent content caching is one of the most effective ways to improve +the experience for your site's visitors. Caching, or temporarily storing +content from previous requests, is part of the core content delivery +strategy implemented within the HTTP protocol. Components throughout the +delivery path can all cache items to speed up subsequent requests, +subject to the caching policies declared for the content. + +In this guide, we will discuss some of the basic concepts of web content +caching. This will mainly cover how to select caching policies to ensure +that caches throughout the internet can correctly process your content. +We will talk about the benefits that caching affords, the side effects +to be aware of, and the different strategies to employ to provide the +best mixture of performance and flexibility. + +What Is Caching? +---------------- + +Caching is the term for storing reusable responses in order to make +subsequent requests faster. There are many different types of caching +available, each of which has its own characteristics. Application caches +and memory caches are both popular for their ability to speed up certain +responses. + +Web caching, the focus of this guide, is a different type of cache. Web +caching is a core design feature of the HTTP protocol meant to minimize +network traffic while improving the perceived responsiveness of the +system as a whole. Caches are found at every level of a content's +journey from the original server to the browser. + +Web caching works by caching the HTTP responses for requests according +to certain rules. Subsequent requests for cached content can then be +fulfilled from a cache closer to the user instead of sending the request +all the way back to the web server. + +Benefits +-------- + +Effective caching aids both content consumers and content providers. +Some of the benefits that caching brings to content delivery are: + +- **Decreased network costs**: Content can be cached at various points + in the network path between the content consumer and content origin. + When the content is cached closer to the consumer, requests will not + cause much additional network activity beyond the cache. +- **Improved responsiveness**: Caching enables content to be retrieved + faster because an entire network round trip is not necessary. Caches + maintained close to the user, like the browser cache, can make this + retrieval nearly instantaneous. +- **Increased performance on the same hardware**: For the server where + the content originated, more performance can be squeezed from the + same hardware by allowing aggressive caching. The content owner can + leverage the powerful servers along the delivery path to take the + brunt of certain content loads. +- **Availability of content during network interruptions**: With + certain policies, caching can be used to serve content to end users + even when it may be unavailable for short periods of time from the + origin servers. + +Terminology +----------- + +When dealing with caching, there are a few terms that you are likely to +come across that might be unfamiliar. Some of the more common ones are +below: + +- **Origin server**: The origin server is the original location of the + content. If you are acting as the web server administrator, this is + the machine that you control. It is responsible for serving any + content that could not be retrieved from a cache along the request + route and for setting the caching policy for all content. +- **Cache hit ratio**: A cache's effectiveness is measured in terms of + its cache hit ratio or hit rate. This is a ratio of the requests + able to be retrieved from a cache to the total requests made. A high + cache hit ratio means that a high percentage of the content was able + to be retrieved from the cache. This is usually the desired outcome + for most administrators. +- **Freshness**: Freshness is a term used to describe whether an item + within a cache is still considered a candidate to serve to a client. + Content in a cache will only be used to respond if it is within the + freshness time frame specified by the caching policy. +- **Stale content**: Items in the cache expire according to the cache + freshness settings in the caching policy. Expired content is + "stale". In general, expired content cannot be used to respond to + client requests. The origin server must be re-contacted to retrieve + the new content or at least verify that the cached content is still + accurate. +- **Validation**: Stale items in the cache can be validated in order + to refresh their expiration time. Validation involves checking in + with the origin server to see if the cached content still represents + the most recent version of item. +- **Invalidation**: Invalidation is the process of removing content + from the cache before its specified expiration date. This is + necessary if the item has been changed on the origin server and + having an outdated item in cache would cause significant issues for + the client. + +There are plenty of other caching terms, but the ones above should help +you get started. + +What Can be Cached? +------------------- + +Certain content lends itself more readily to caching than others. Some +very cache-friendly content for most sites are: + +- Logos and brand images +- Non-rotating images in general (navigation icons, for example) +- Style sheets +- General Javascript files +- Downloadable Content +- Media Files + +These tend to change infrequently, so they can benefit from being cached +for longer periods of time. + +Some items that you have to be careful in caching are: + +- HTML pages +- Rotating images +- Frequently modified Javascript and CSS +- Content requested with authentication cookies + +Some items that should almost never be cached are: + +- Assets related to sensitive data (banking info, etc.) +- Content that is user-specific and frequently changed + +In addition to the above general rules, it's possible to specify +policies that allow you to cache different types of content +appropriately. For instance, if authenticated users all see the same +view of your site, it may be possible to cache that view anywhere. If +authenticated users see a user-sensitive view of the site that will be +valid for some time, you may tell the user's browser to cache, but tell +any intermediary caches not to store the view. + +Locations Where Web Content Is Cached +------------------------------------- + +Content can be cached at many different points throughout the delivery +chain: + +- **Browser cache**: Web browsers themselves maintain a small cache. + Typically, the browser sets a policy that dictates the most + important items to cache. This may be user-specific content or + content deemed expensive to download and likely to be requested + again. +- **Intermediary caching proxies**: Any server in between the client + and your infrastructure can cache certain content as desired. These + caches may be maintained by ISPs or other independent parties. +- **Reverse Cache**: Your server infrastructure can implement its own + cache for backend services. This way, content can be served from the + point-of-contact instead of hitting backend servers on each request. + +Each of these locations can and often do cache items according to their +own caching policies and the policies set at the content origin. + +Caching Headers +--------------- + +Caching policy is dependent upon two different factors. The caching +entity itself gets to decide whether or not to cache acceptable content. +It can decide to cache less than it is allowed to cache, but never more. + +The majority of caching behavior is determined by the caching policy, +which is set by the content owner. These policies are mainly articulated +through the use of specific HTTP headers. + +Through various iterations of the HTTP protocol, a few different +cache-focused headers have arisen with varying levels of sophistication. +The ones you probably still need to pay attention to are below: + +- **`Expires`**: The `Expires` header is very straight-forward, + although fairly limited in scope. Basically, it sets a time in the + future when the content will expire. At this point, any requests for + the same content will have to go back to the origin server. This + header is probably best used only as a fall back. +- **`Cache-Control`**: This is the more modern replacement for the + `Expires` header. It is well supported and implements a much more + flexible design. In almost all cases, this is preferable to + `Expires`, but it may not hurt to set both values. We will discuss + the specifics of the options you can set with `Cache-Control` a bit + later. +- **`Etag`**: The `Etag` header is used with cache validation. The + origin can provide a unique `Etag` for an item when it initially + serves the content. When a cache needs to validate the content it + has on-hand upon expiration, it can send back the `Etag` it has for + the content. The origin will either tell the cache that the content + is the same, or send the updated content (with the new `Etag`). +- **`Last-Modified`**: This header specifies the last time that the + item was modified. This may be used as part of the validation + strategy to ensure fresh content. +- **`Content-Length`**: While not specifically involved in caching, + the `Content-Length` header is important to set when defining + caching policies. Certain software will refuse to cache content if + it does not know in advanced the size of the content it will need to + reserve space for. +- **`Vary`**: A cache typically uses the requested host and the path + to the resource as the key with which to store the cache item. The + `Vary` header can be used to tell caches to pay attention to an + additional header when deciding whether a request is for the same + item. This is most commonly used to tell caches to key by the + `Accept-Encoding` header as well, so that the cache will know to + differentiate between compressed and uncompressed content. + +### An Aside about the Vary Header + +The `Vary` header provides you with the ability to store different +versions of the same content at the expense of diluting the entries in +the cache. + +In the case of `Accept-Encoding`, setting the `Vary` header allows for a +critical distinction to take place between compressed and uncompressed +content. This is needed to correctly serve these items to browsers that +cannot handle compressed content and is necessary in order to provide +basic usability. One characteristic that tells you that +`Accept-Encoding` may be a good candidate for `Vary` is that it only has +two or three possible values. + +Items like `User-Agent` might at first glance seem to be a good way to +differentiate between mobile and desktop browsers to serve different +versions of your site. However, since `User-Agent` strings are +non-standard, the result will likely be many versions of the same +content on intermediary caches, with a very low cache hit ratio. The +`Vary` header should be used sparingly, especially if you do not have +the ability to normalize the requests in intermediate caches that you +control (which may be possible, for instance, if you leverage a content +delivery network). + +How Cache-Control Flags Impact Caching +-------------------------------------- + +Above, we mentioned how the `Cache-Control` header is used for modern +cache policy specification. A number of different policy instructions +can be set using this header, with multiple instructions being separated +by commas. + +Some of the `Cache-Control` options you can use to dictate your +content's caching policy are: + +- **`no-cache`**: This instruction specifies that any cached content + must be re-validated on each request before being served to a + client. This, in effect, marks the content as stale immediately, but + allows it to use revalidation techniques to avoid re-downloading the + entire item again. +- **`no-store`**: This instruction indicates that the content cannot + be cached in any way. This is appropriate to set if the response + represents sensitive data. +- **`public`**: This marks the content as public, which means that it + can be cached by the browser and any intermediate caches. For + requests that utilized HTTP authentication, responses are marked + `private` by default. This header overrides that setting. +- **`private`**: This marks the content as `private`. Private content + may be stored by the user's browser, but must *not* be cached by any + intermediate parties. This is often used for user-specific data. +- **`max-age`**: This setting configures the maximum age that the + content may be cached before it must revalidate or re-download the + content from the origin server. In essence, this replaces the + `Expires` header for modern browsing and is the basis for + determining a piece of content's freshness. This option takes its + value in seconds with a maximum valid freshness time of one year + (31536000 seconds). +- **`s-maxage`**: This is very similar to the `max-age` setting, in + that it indicates the amount of time that the content can be cached. + The difference is that this option is applied only to intermediary + caches. Combining this with the above allows for more flexible + policy construction. +- **`must-revalidate`**: This indicates that the freshness information + indicated by `max-age`, `s-maxage` or the `Expires` header must be + obeyed strictly. Stale content cannot be served under any + circumstance. This prevents cached content from being used in case + of network interruptions and similar scenarios. +- **`proxy-revalidate`**: This operates the same as the above setting, + but only applies to intermediary proxies. In this case, the user's + browser can potentially be used to serve stale content in the event + of a network interruption, but intermediate caches cannot be used + for this purpose. +- **`no-transform`**: This option tells caches that they are not + allowed to modify the received content for performance reasons under + any circumstances. This means, for instance, that the cache is not + able to send compressed versions of content it did not receive from + the origin server compressed and is not allowed. + +These can be combined in different ways to achieve various caching +behavior. Some mutually exclusive values are: + +- `no-cache`, `no-store`, and the regular caching behavior indicated + by absence of either +- `public` and `private` + +The `no-store` option supersedes the `no-cache` if both are present. For +responses to unauthenticated requests, `public` is implied. For +responses to authenticated requests, `private` is implied. These can be +overridden by including the opposite option in the `Cache-Control` +header. + +Developing a Caching Strategy +----------------------------- + +In a perfect world, everything could be cached aggressively and your +servers would only be contacted to validate content occasionally. This +doesn't often happen in practice though, so you should try to set some +sane caching policies that aim to balance between implementing long-term +caching and responding to the demands of a changing site. + +### Common Issues + +There are many situations where caching cannot or should not be +implemented due to how the content is produced (dynamically generated +per user) or the nature of the content (sensitive banking information, +for example). Another problem that many administrators face when setting +up caching is the situation where older versions of your content are out +in the wild, not yet stale, even though new versions have been +published. + +These are both frequently encountered issues that can have serious +impacts on cache performance and the accuracy of content you are +serving. However, we can mitigate these issues by developing caching +policies that anticipate these problems. + +### General Recommendations + +While your situation will dictate the caching strategy you use, the +following recommendations can help guide you towards some reasonable +decisions. + +There are certain steps that you can take to increase your cache hit +ratio before worrying about the specific headers you use. Some ideas +are: + +- **Establish specific directories for images, css, and shared + content**: Placing content into dedicated directories will allow you + to easily refer to them from any page on your site. +- **Use the same URL to refer to the same items**: Since caches key + off of both the host and the path to the content requested, ensure + that you refer to your content in the same way on all of your pages. + The previous recommendation makes this significantly easier. +- **Use CSS image sprites where possible**: CSS image sprites for + items like icons and navigation decrease the number of round trips + needed to render your site and allow your site to cache that single + sprite for a long time. +- **Host scripts and external resources locally where possible**: If + you utilize javascript scripts and other external resources, + consider hosting those resources on your own servers if the correct + headers are not being provided upstream. Note that you will have to + be aware of any updates made to the resource upstream so that you + can update your local copy. +- **Fingerprint cache items**: For static content like CSS and + Javascript files, it may be appropriate to fingerprint each item. + This means adding a unique identifier to the filename (often a hash + of the file) so that if the resource is modified, the new resource + name can be requested, causing the requests to correctly bypass the + cache. There are a variety of tools that can assist in creating + fingerprints and modifying the references to them within HTML + documents. + +In terms of selecting the correct headers for different items, the +following can serve as a general reference: + +- **Allow all caches to store generic assets**: Static content and + content that is not user-specific can and should be cached at all + points in the delivery chain. This will allow intermediary caches to + respond with the content for multiple users. +- **Allow browsers to cache user-specific assets**: For per-user + content, it is often acceptable and useful to allow caching within + the user's browser. While this content would not be appropriate to + cache on any intermediary caching proxies, caching in the browser + will allow for instant retrieval for users during subsequent visits. +- **Make exceptions for essential time-sensitive content**: If you + have content that is time-sensitive, make an exception to the above + rules so that the out-dated content is not served in critical + situations. For instance, if your site has a shopping cart, it + should reflect the items in the cart immediately. Depending on the + nature of the content, the `no-cache` or `no-store` options can be + set in the `Cache-Control` header to achieve this. +- **Always provide validators**: Validators allow stale content to be + refreshed without having to download the entire resource again. + Setting the `Etag` and the `Last-Modified` headers allow caches to + validate their content and re-serve it if it has not been modified + at the origin, further reducing load. +- **Set long freshness times for supporting content**: In order to + leverage caching effectively, elements that are requested as + supporting content to fulfill a request should often have a long + freshness setting. This is generally appropriate for items like + images and CSS that are pulled in to render the HTML page requested + by the user. Setting extended freshness times, combined with + fingerprinting, allows caches to store these resources for long + periods of time. If the assets change, the modified fingerprint will + invalidate the cached item and will trigger a download of the new + content. Until then, the supporting items can be cached far into the + future. +- **Set short freshness times for parent content**: In order to make + the above scheme work, the containing item must have relatively + short freshness times or may not be cached at all. This is typically + the HTML page that calls in the other assisting content. The HTML + itself will be downloaded frequently, allowing it to respond to + changes rapidly. The supporting content can then be cached + aggressively. + +The key is to strike a balance that favors aggressive caching where +possible while leaving opportunities to invalidate entries in the future +when changes are made. Your site will likely have a combination of: + +- Aggressively cached items +- Cached items with a short freshness time and the ability to + re-validate +- Items that should not be cached at all + +The goal is to move content into the first categories when possible +while maintaining an acceptable level of accuracy. + +Conclusion +---------- + +Taking the time to ensure that your site has proper caching policies in +place can have a significant impact on your site. Caching allows you to +cut down on the bandwidth costs associated with serving the same content +repeatedly. Your server will also be able to handle a greater amount of +traffic with the same hardware. Perhaps most importantly, clients will +have a faster experience on your site, which may lead them to return +more frequently. While effective web caching is not a silver bullet, +setting up appropriate caching policies can give you measurable gains +with minimal work. + + +--- + +作者: [Justin Ellingwood](https://www.digitalocean.com/community/users/jellingwood) + +译者:[译者ID](https://github.com/译者ID) + +校对:[校对者ID](https://github.com/校对者ID) + +推荐:[royaso](https://github.com/royaso) + +via: https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + + From 7e0ab09ba617374d7726c4ad5bc95fc13d4c39a9 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 29 Apr 2015 11:29:09 +0800 Subject: [PATCH 020/133] =?UTF-8?q?20150429-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1.0--Open Source Animation Gets Serious.md | 41 ++++++ ...e2 With Tomcat 7 Using mod_jk Connector.md | 138 ++++++++++++++++++ ...Here' s How To Upgrade in Kubuntu 15.04.md | 86 +++++++++++ 3 files changed, 265 insertions(+) create mode 100644 sources/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md create mode 100644 sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md create mode 100644 sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md diff --git a/sources/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md b/sources/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md new file mode 100644 index 0000000000..70f76b418c --- /dev/null +++ b/sources/share/20150429 Synfig Studio 1.0--Open Source Animation Gets Serious.md @@ -0,0 +1,41 @@ +Synfig Studio 1.0 — Open Source Animation Gets Serious +================================================================================ +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/synfig-free-animations-750x467.jpg) + +**A brand new version of the free, open-source 2D animation software Synfig Studio is now available to download. ** + +The first release of the cross-platform software in well over a year, Synfig Studio 1.0 builds on its claim of offering “industrial-strength solution for creating film-quality animation” with a suite of new and improved features. + +Among them is an improved user interface that the project developers say is ‘easier’ and ‘more intuitive’ to use. The client adds a new **single-window mode** for tidy working and has been **reworked to use the latest GTK3 libraries**. + +On the features front there are several notable changes, including the addition of a fully-featured bone system. + +This **joint-and-pivot ‘skeleton’ framework** is well suited to 2D cut-out animation and should prove super efficient when coupled with the complex deformations new to this release, or used with Synfig’s popular ‘automatic interpolated keyframes’ (read: frame-to-frame morphing). + +注:youtube视频 + + +New non-destructive cutout tools, friction effects and initial support for full frame-by-frame bitmap animation, may help unlock the creativity of open-source animators, as might the addition of a sound layer for syncing the animation timeline with a soundtrack! + +### Download Synfig Studio 1.0 ### + +Synfig Studio is not a tool suited for everyone, though the latest batch of improvements in this latest release should help persuade some animators to give the free animation software a try. + +If you want to find out what open-source animation software is like for yourself, you can grab an installer for Ubuntu for the latest release direct from the project’s Sourceforge page using the links below. + +- [Download Synfig 1.0 (64bit) .deb Installer][1] +- [Download Synfig 1.0 (32bit) .deb Installer][2] + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/04/synfig-studio-new-release-features + +作者:[oey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:http://sourceforge.net/projects/synfig/files/releases/1.0/linux/synfigstudio_1.0_amd64.deb/download +[2]:http://sourceforge.net/projects/synfig/files/releases/1.0/linux/synfigstudio_1.0_x86.deb/download \ No newline at end of file diff --git a/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md b/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md new file mode 100644 index 0000000000..11882847a7 --- /dev/null +++ b/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md @@ -0,0 +1,138 @@ +How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector +================================================================================ +Apache is the most popular available web server. A web server is used basically to accept requests from clients and send responses to those requests. It gets an URL, translates it to a filename (for static requests), and sends that file back over the internet from the local disk, or it translates it to a program name, executes it, and then sends the output of that program back over the internet to the requesting party. If the web server was not able to process and complete the request, it instead returns an error message. + +In this article we will list the features of Apache, and how we can integrate it with Tomcat8 and Tomcat7 using the mod_jk connector. + +### Features of Apache ### + +As we said Apache is the most popular available web server. The reasons behind its popularity are the following features: + +- It is free tool that you can download and install it easily. +- It is open source web server so you can easily see the code, adjust it, optimize it, and fix errors and security holes. New features and modules can be also added. +- It can be used for small websites of one or two pages, or huge websites of hundreds and thousands of pages, serving millions of regular visitors each month. It can serve both static and dynamic content. +- Improved caching modules (mod_cache, mod_disk_cache, mod_mem_cache). +- Apache 2 supports the Internet protocol IPv6. + +### Tomcat directory ### + +${tomcat_home} is the root directory of tomcat. Your Tomcat installation should have the following subdirectories: + +- ${tomcat_home}\conf – Where you can place various configuration files +- ${tomcat_home}\webapps – Containing example applications +- ${tomcat_home}\bin – Where you place web server plugins + +### Mod_jk module ### + +The mod_jk can be obtained in two formats: binary and source. Depending on the platform you are running your web server on, a binary version of mod_jk may be available. It is recommended to use the binary version if it is available. + +The mod_jk module was developed and tested on: + +- Linux, FreeBSD, AIX, HP-UX, MacOS X, Solaris and should work on major Unix’s platforms supporting Apache 1.3 and/or 2.x +- 0-i386 SP4/SP5/SP6a (should be able to work with other service packs), Win2K and WinXP and Win98 +- Cygwin (until you have an apache server and autoconf/automake support tools) +- Netware +- i5/OS V5R4 (System I) with Apache HTTP Server 2.0.58. Be sure to have the latest Apache PTF installed. +- Tomcat 3.2 to Tomcat 8. + +The mod_jk requires two entities: + +- **mod_jk.xxx** – The Apache HTTP Server module, depending on your operating system, it will be mod_jk.so, mod_jk.nlm or MOD_JK.SRVPGM. +- **workers.properties** – A file that describes the host and used ports by the workers (Tomcat processes). A sample workers.properties can be found under the conf directory in the source download. + +Also as with other Apache HTTP Server modules, mod_jk should be first installed on the modules directory of your Apache webserver: /usr/lib/apache and you should update your **httpd.conf** file. + +### Installation ### + +It is required to have a non-root user system with the “sudo” privileges before starting the installation. Now we will start our installation, so we will install Apache2 and Tomcat using the following command: + + sudo apt-get install apache2 + + sudo apt-get install tomcat7 + + sudo apt-get install tomcat7-admin + +And now we will create a test application for Tomcat using the following commands: + + cd /var/lib/tomcat7/webapps + sudo mkdir tomcat-demo + sudo mkdir tomcat-demo/goodmoring + sudo vim tomcat-demo/helloworld/index.jsp + +And paste the following code: + + + + Good Morning + + +

Good Morning

+ Today is: <%= new java.util.Date().toString() %> + + + +Everything is okay, good now we will install and configure the mod_jk using the following command: + + sudo apt-get install libapache2-mod-jk + +We have to start by enabling the redirect port 8443 on Tomcat using the following command: + + sudo vim /etc/tomcat7/server.xml + +And we will uncomment the following line: + + + +After that, we will create our workers.properties file for Apache using the following command: + + sudo vim /etc/apache2/workers.properties + +Paste the following text: + + # Define 1 real worker using ajp13 + worker.list=worker + # Set properties for worker (ajp13) + worker.worker.type=ajp13 + worker.worker.host=localhost + worker.worker.port=8009 + +Now we will use the following command to let Apache use this worker: + + sudo vim /etc/apache2/mods-available/jk.conf + +And we will change the JkWorkersFile property to the following one; + + /etc/apache2/workers.properties + +Finally to configure the URL Apache should pass through the Tomcat + + sudo vim /etc/apache2/sites-enabled/000-default + +And we will add the following line in the configurtation file: + + + ....................................... + ....................................... + JkMount /tomcat-demo* worker1 + + +You can now restart the servers using the following commands to check their functionality: + + sudo /etc/init.d/tomcat7 restart + sudo /etc/init.d/apache2 restart + +### Conclusion ### + +In this article we showed you how to configure and install Apache2 and Tomcat 7 using the mod_jk connector. + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/integrate-apache2-tomcat-7-using-mod_jk-connector/ + +作者:[anismaj][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/anis/ \ No newline at end of file diff --git a/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md b/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md new file mode 100644 index 0000000000..43b2adc3dd --- /dev/null +++ b/sources/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md @@ -0,0 +1,86 @@ +KDE Plasma 5.3 Released, Here’s How To Upgrade in Kubuntu 15.04 +================================================================================ +**KDE [has announced][1] the stable release of Plasma 5.3, which comes charged with a slate of new power management features. ** + +Having impressed and excited [with an earlier beta release in April][2], the latest update to the new stable update to the Plasma 5 desktop environments is now considered stable and ready for download. + +Plasma 5.3 continues to refine and finesse the new-look KDE desktop. It sees plenty of feature additions for desktop users to enjoy and **almost 400 bug fixes** packed in it should also improvements the performance and overall stability, too. + +### What’s New in Plasma 5.3 ### + +![Better Bluetooth Management in Plasma 5.3](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/bluetooth-applet-in-kde.jpg) +Better Bluetooth Management in Plasma 5.3 + +While we touched on the majority of the **new features** [in Plasma 5.3 in an earlier article][3] many are worth reiterating. + +**Enhanced power management** features and configuration options, including a **new battery applet, energy usage monitor** and **animated changes in screen brightness**, will help KDE last longer on portable devices. + +Closing a laptop when an external monitor is connected no longer triggers ‘suspend’. This new behaviour is called ‘**cinema mode**‘ and comes enabled by default, but can be disabled using an option in power management settings. + +**Bluetooth functionality is improved**, with a brand new panel applet making connecting and configuring paired bluetooth devices like smartphones, keyboards and speakers easier than ever. + +Similarly, **trackpad configuration in KDE is easier** with Plasma 5.3 thanks to a new set-up and settings module. + +![Trackpad, Touchpad. Tomato, Tomayto.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/touchpad-kde.jpg) +Trackpad, Touchpad. Tomato, Tomayto. + +For Plasma widget fans there is a new **Press and Hold** gesture. When enabled this hides the settings handle that appears when on mouseover. Instead making it only appear when long-clicking on widget. + +On the topic of widget-y things, several **old Plasmoid favourites are reintroduced** with this release, including a useful system monitor, handy hard-drive stats and a comic reader. + +### Learning More & Trying It Out ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/plasma-5.3-beta.jpg\) + +A full list of everything — and I mean everything — that is new and improved in Plasma 5.3 is listed [in the official change log][4]. + +Live images that let you try Plasma 5.3 on a Kubuntu base **without affecting your own system** are available from the KDE community: + +- [Download KDE Plasma Live Images][5] + +If you need super stable system you can use these live images to try the features but stick with the version of KDE that comes with your distribution on your main computer. + +However, if you’re happy to experiment — read: can handle any package conflicts or system issues resulting from attempting to upgrade your desktop environment — you can. + +### Install Plasma 5.3 in Kubuntu 15.04 ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/02/logo-kubuntu.png) + +To **install Plasma 5.3 in Kubuntu 15.04** you need to add the KDE Backports PPA, run the Software Updater tool and install any available updates. + +The Kubuntu backports PPA may/will also upgrade other parts of the KDE Platform other than Plasma that are installed on your system including KDE applications, frameworks and Kubuntu specific configuration files. + +Using the command line is by far the fastest way to upgrade to Plasma 5.3 in Kubuntu: + + sudo add-apt-repository ppa:kubuntu-ppa/backports + + sudo apt-get update && sudo apt-get dist-upgrade + +After the upgrade process has completed, and assuming everything went well, you should reboot your computer. + +If you’re using an alternative desktop environment, like LXDE, Unity or GNOME, you will need to install the Kubuntu desktop package (you’ll find it in the Ubuntu Software Centre) after running both of the commands above. + +To downgrade to the stock version of Plasma in 15.04 you can use the PPA-Purge tool: + + sudo apt-get install ppa-purge + + sudo ppa-purge ppa:kubuntu-ppa/backports + +Let us know how your upgrade/testing goes in the comments below and don’t forget to mention the features you hope to see added to the Plasma 5 desktop next. + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2015/04/kde-plasma-5-3-released-heres-how-to-upgrade-in-kubuntu-15-04 + +作者:[Joey-Elijah Sneddon][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/117485690627814051450/?rel=author +[1]:https://www.kde.org/announcements/plasma-5.3.0.php +[2]:http://www.omgubuntu.co.uk/2015/04/beta-plasma-5-3-features +[3]:http://www.omgubuntu.co.uk/2015/04/beta-plasma-5-3-features +[4]:https://www.kde.org/announcements/plasma-5.2.2-5.3.0-changelog.php +[5]:https://community.kde.org/Plasma/Live_Images \ No newline at end of file From d783802859ce5f224209ccfd71e46921effbb60c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 29 Apr 2015 11:35:03 +0800 Subject: [PATCH 021/133] =?UTF-8?q?20150429-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sed--How to Upgrade on Fedora or CentOS.md | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md diff --git a/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md b/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md new file mode 100644 index 0000000000..abdca76f92 --- /dev/null +++ b/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md @@ -0,0 +1,167 @@ +Docker 1.6 Released - How to Upgrade on Fedora / CentOS +================================================================================ +Docker, a popular open source container platform for packaging applications, has a new release 1.6 with lot of new features in it. This version has updates to Docker Registry, Engine, Swarm, Compose and Machine. The release aims at improvements in performance, developer and system administrator experiences. Let us take a quick look at the new features available. + +**Docker Registry (2.0)** which is a service for pushing Docker images for storing and sharing, has undergone architectural changes as it was facing performance issues when under load. It is still backward compatible. The language in which Docker Registry is written is now changed from Python to Google's Go to improve performance. In combination with Docker Engine 1.6, it is capable of pulling the images faster. Earlier the images were delivered sequentially, but now in parallel. + +**Docker Engine (1.6)** is greatly improved from its previous version. It supports containers and image labels. With labels you can attach user-defined metadata to images and containers which in turn can be used by other tools. Labels will not be visible to the running applications and can be used to speed up the searching of containers and images. + +There is a Windows version of the Docker client which can connect to a remote Docker engine that runs Linux. + +Docker now supports logging driver API that allows us to send container logs to systems like Syslog or to a third-party. It is going to be benefitting the system administrators. + +**Swarm (0.2)** is a clustering tool for Docker which turns a pool of Docker hosts into one virtual host. In the new feature, containers are evenly placed on the available nodes. Effort is made towards supporting the complete Docker API by adding more Docker commands. In the future, it will be possible to use third-party drivers for clustering. + +**Compose (1.2)** which is a tool for defining and running complex applications in Docker has also got an upgrade. In the new version, one can create multiple sub-files instead of one flat file to describe a multi-container application. + +With **Machine (0.2)**, we can easily create Docker hosts on local computers, clouds and data centers. The new release provides a cleaner driver interface to write drivers for providers. Provisioning is handled centrally by Machine instead of each individual driver. New command added to regenerate host's TLS certificates which increases security. + +### Upgrade instructions on Fedora / CentOS ### + +In this section, let us learn how to upgrade the existing docker version to the latest on Fedora and CentOS. Please note that currently Docker runs only on 64-bit architecture. As both Fedora and CentOS are from RedHat, commands used are pretty much identical except that the Docker package in Fedora20 and CentOS6.5 is called “docker-io”. + +If you do not already have Docker installed on the system, install it using: + + "yum install docker-io" – on Fedora20 / CentOS6.5 + + "yum install docker" - on Fedora21 / CentOS7 + +Before upgrading, it is good to have a backup of the docker images and container volumes. + +Refer [filesystem to a tar archive][1] and [volumes backups, restores or migrations options][2] for more details. + +Currently the test system has Docker version 1.5 installed. Output shown in the examples are from a Fedora 20 system. + +Verify the current version of Docker installed on the system + + [root@TestNode1 ~]#sudo docker -v + + Docker version 1.5.0, build a8a31ef/1.5.0 + +If the Docker service is running, first stop it. + + [root@TestNode1 ~]# sudo systemctl stop docker + +Upgrade to the latest version using yum update. But at the time of writing this article, the repositories were not yet updated with the latest version(1.6). Hence you need to use the binary method of upgradation. + + [root@TestNode1 ~]#sudo yum -y update docker-io + + No packages marked for update + + [root@TestNode1 ~]#sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker + + --2015-04-19 13:40:48-- https://get.docker.com/builds/Linux/x86_64/docker-latest + + Resolving get.docker.com (get.docker.com)... 162.242.195.82 + + Connecting to get.docker.com (get.docker.com)|162.242.195.82|:443... connected. + + HTTP request sent, awaiting response... 200 OK + + Length: 15443598 (15M) [binary/octet-stream] + + Saving to: /usr/bin/docker + + 100%[======================================>] 15,443,598 8.72MB/s in 1.7s + + 2015-04-19 13:40:50 (8.72 MB/s) - /usr/bin/docker saved + +Check the updated version + + [root@TestNode1 ~]#sudo docker -v + + Docker version 1.6.0, build 4749651 + +Restart the docker service + + [root@TestNode1 ~]# sudo systemctl start docker + +Verify that Docker is working + + [root@TestNode1 ~]# docker images + + REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE + + fedora latest 834629358fe2 3 months ago 241.3 MB + + [root@TestNode1 ~]# docker run fedora /bin/echo Hello World + + Hello World + +**Note** on CentOS installation , after installing Docker on CentOS, you might get error messages like the following while trying to start the Docker service + + docker.service - Docker Application Container Engine + + Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled) + + Active: failed (Result: exit-code) since Mon 2015-04-20 03:24:24 EDT; 6h ago + + Docs: http://docs.docker.com + + Process: 21069 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=127) + + Main PID: 21069 (code=exited, status=127) + + Apr 20 03:24:24 centos7 systemd[1]: Starting Docker Application Container E..... + + Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)" + + Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)" + + Apr 20 03:24:24 centos7 docker[21069]: /usr/bin/docker: relocation error: /...ce + + Apr 20 03:24:24 centos7 systemd[1]: docker.service: main process exited, co.../a + + Apr 20 03:24:24 centos7 systemd[1]: Failed to start Docker Application Cont...e. + + Apr 20 03:24:24 centos7 systemd[1]: Unit docker.service entered failed state. + +This is a known bug ( [https://bugzilla.redhat.com/show_bug.cgi?id=1207839][3] ) and needs an upgrade of the device mapper to the latest level. + + [root@centos7 ~]# rpm -qa device-mapper + + device-mapper-1.02.84-14.el7.x86_64 + + [root@centos7 ~]# yum update device-mapper + + [root@centos7 ~]# rpm -qa device-mapper + + device-mapper-1.02.93-3.el7.x86_64 + + [root@centos7 ~]# systemctl start docker + +### Summary ### + +Though the docker technology is quite recent one, it is quickly gaining popularity. It has made life easy for developers and ops teams to quickly create and deploy applications respectively. With the company releasing quick updates to Docker in order to improve the product and address customer requirements, the future is definitely bright for Docker. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/docker-1-6-features-upgrade-fedora-centos/ + +作者:[B N Poornima][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/bnpoornima/ +[1]:http://docs.docker.com/reference/commandline/cli/#export +[2]:http://docs.docker.com/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes +[3]:https://bugzilla.redhat.com/show_bug.cgi?id=1207839 +[4]: +[5]: +[6]: +[7]: +[8]: +[9]: +[10]: +[11]: +[12]: +[13]: +[14]: +[15]: +[16]: +[17]: +[18]: +[19]: +[20]: \ No newline at end of file From 8263c03c488c36a7183626f7fbe5dd263722d62b Mon Sep 17 00:00:00 2001 From: ictlyh Date: Wed, 29 Apr 2015 11:46:23 +0800 Subject: [PATCH 022/133] [Translated] tech/20150108 Interface (NICs) Bonding in Linux using nmcli --- ...ace (NICs) Bonding in Linux using nmcli.md | 137 ------------------ ...ace (NICs) Bonding in Linux using nmcli.md | 136 +++++++++++++++++ 2 files changed, 136 insertions(+), 137 deletions(-) delete mode 100644 sources/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md create mode 100644 translated/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md diff --git a/sources/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md b/sources/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md deleted file mode 100644 index 41eee7a86f..0000000000 --- a/sources/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md +++ /dev/null @@ -1,137 +0,0 @@ -Translating by ictlyh -Interface (NICs) Bonding in Linux using nmcli -================================================================================ -Today, we'll learn how to perform Interface (NICs) bonding in our CentOS 7.x using nmcli (Network Manager Command Line Interface). - -NICs (Interfaces) bonding is a method for linking **NICs** together logically to allow fail-over or higher throughput. One of the ways to increase the network availability of a server is by using multiple network interfaces. The Linux bonding driver provides a method for aggregating multiple network interfaces into a single logical bonded interface. It is a new implementation that does not affect the older bonding driver in linux kernel; it offers an alternate implementation. - -**NIC bonding is done to provide two main benefits for us:** - -1. **High bandwidth** -1. **Redundancy/resilience** - -Now lets configure NICs bonding in CentOS 7. We'll need to decide which interfaces that we would like to configure a Team interface. - -run **ip link** command to check the available interface in the system. - - $ ip link - -![ip link](http://blog.linoxide.com/wp-content/uploads/2015/01/ip-link.png) - -Here we are using **eno16777736** and **eno33554960** NICs to create a team interface in **activebackup** mode. - -Use **nmcli** command to create a connection for the network team interface,with the following syntax. - - # nmcli con add type team con-name CNAME ifname INAME [config JSON] - -Where **CNAME** will be the name used to refer the connection ,**INAME** will be the interface name and **JSON** (JavaScript Object Notation) specifies the runner to be used.**JSON** has the following syntax: - - '{"runner":{"name":"METHOD"}}' - -where **METHOD** is one of the following: **broadcast, activebackup, roundrobin, loadbalance** or **lacp**. - -### 1. Creating Team Interface ### - -Now let us create the team interface. here is the command we used to create the team interface. - - # nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}' - -![nmcli con create](http://blog.linoxide.com/wp-content/uploads/2015/01/nmcli-con-create.png) - -run **# nmcli con show** command to verify the team configuration. - - # nmcli con show - -![Show Teamed Interace](http://blog.linoxide.com/wp-content/uploads/2015/01/show-team-interface.png) - -### 2. Adding Slave Devices ### - -Now lets add the slave devices to the master team0. here is the syntax for adding the slave devices. - - # nmcli con add type team-slave con-name CNAME ifname INAME master TEAM - -Here we are adding **eno16777736** and **eno33554960** as slave devices for **team0** interface. - - # nmcli con add type team-slave con-name team0-port1 ifname eno16777736 master team0 - - # nmcli con add type team-slave con-name team0-port2 ifname eno33554960 master team0 - -![adding slave devices to team](http://blog.linoxide.com/wp-content/uploads/2015/01/adding-to-team.png) - -Verify the connection configuration using **#nmcli con show** again. now we could see the slave configuration. - - #nmcli con show - -![show slave config](http://blog.linoxide.com/wp-content/uploads/2015/01/show-slave-config.png) - -### 3. Assigning IP Address ### - -All the above command will create the required configuration files under **/etc/sysconfig/network-scripts/**. - -Lets assign an IP address to this team0 interface and enable the connection now. Here is the command to perform the IP assignment. - - # nmcli con mod team0 ipv4.addresses "192.168.1.24/24 192.168.1.1" - # nmcli con mod team0 ipv4.method manual - # nmcli con up team0 - -![ip assignment](http://blog.linoxide.com/wp-content/uploads/2015/01/ip-assignment.png) - -### 4. Verifying the Bonding ### - -Verify the IP address information in **#ip add show team0** command. - - #ip add show team0 - -![verfiy ip address](http://blog.linoxide.com/wp-content/uploads/2015/01/verfiy-ip-adress.png) - -Now lets check the **activebackup** configuration functionality using the **teamdctl** command. - - # teamdctl team0 state - -![teamdctl active backup check](http://blog.linoxide.com/wp-content/uploads/2015/01/teamdctl-activebackup-check.png) - -Now lets disconnect the active port and check the state again. to confirm whether the active backup configuration is working as expected. - - # nmcli dev dis eno33554960 - -![disconnect activeport](http://blog.linoxide.com/wp-content/uploads/2015/01/disconnect-activeport.png) - -disconnected the active port and now check the state again using **#teamdctl team0 state**. - - # teamdctl team0 state - -![teamdctl check activeport disconnect](http://blog.linoxide.com/wp-content/uploads/2015/01/teamdctl-check-activeport-disconnect.png) - -Yes its working cool !! we will connect the disconnected connection back to team0 using the following command. - - #nmcli dev con eno33554960 - -![nmcli dev connect disconected](http://blog.linoxide.com/wp-content/uploads/2015/01/nmcli-dev-connect-disconected.png) - -We have one more command called **teamnl** let us show some options with **teamnl** command. - -to check the ports in team0 run the following command. - - # teamnl team0 ports - -![teamnl check ports](http://blog.linoxide.com/wp-content/uploads/2015/01/teamnl-check-ports.png) - -Display currently active port of **team0**. - - # teamnl team0 getoption activeport - -![display active port team0](http://blog.linoxide.com/wp-content/uploads/2015/01/display-active-port-team0.png) - -Hurray, we have successfully configured NICs bonding :-) Please share feedback if any. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-command/interface-nics-bonding-linux/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ \ No newline at end of file diff --git a/translated/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md b/translated/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md new file mode 100644 index 0000000000..0b5bf2cd8e --- /dev/null +++ b/translated/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md @@ -0,0 +1,136 @@ +在 Linux 中用 nmcli 命令绑定网卡(NICs) +================================================================================ +今天,我们来学习一下在 CentOS 7.x 中如何用 nmcli(Network Manager Command Line Interface:网络管理命令行接口) 进行网卡(NICs 译者注:Netword Interface Card,网卡或网络适配器)绑定(译者注:bond 是指把多个物理网卡绑定成一个逻辑上的网卡,这样多个网卡可以使用同一个 IP 从而可以避免单点故障)。 + +网卡绑定是将 **网卡** 逻辑地连接到一起从而允许故障转移或者提高吞吐率的方法。提高服务器网络可用性的一个方式是使用多个网卡。Linux 绑定驱动提供了一个将多个网卡聚合到一个逻辑绑定接口的方法。这是个并不影响 linux 内核中旧绑定驱动的新的实现;它提供了另一种实现方法。 + +**网卡绑定为我们提供了两个主要的好处:** + +1. **高带宽** +1. **冗余/弹性** + +现在让我们在 CentOS 7 上配置网卡绑定吧。我们需要决定选取哪些接口配置成一个组接口。 + +运行 **ip link** 命令查看系统中可用的接口。 + + $ ip link + +![ip link](http://blog.linoxide.com/wp-content/uploads/2015/01/ip-link.png) + +这里我们使用 **eno16777736** 和 **eno33554960** 网卡在 “主动备份” 模式下创建一个组接口。(译者注:关于不同模式可以参考:多网卡的7种bond模式原理) + +按照下面的语法,用 **nmcli** 命令为网络组接口创建一个连接。 + + # nmcli con add type team con-name CNAME ifname INAME [config JSON] + +**CNAME** 指代连接的名称,**INAME** 是接口名称,**JSON** (JavaScript Object Notation) 指定所使用的处理器(runner)。**JSON** 语法格式如下: + + '{"runner":{"name":"METHOD"}}' + +**METHOD** 是以下的其中一个:**broadcast、activebackup、roundrobin、loadbalance** 或者 **lacp**。 + +### 1. 创建组接口 ### + +现在让我们来创建组接口。这是我们创建组接口所使用的命令。 + + # nmcli con add type team con-name team0 ifname team0 config '{"runner":{"name":"activebackup"}}' + +![nmcli con create](http://blog.linoxide.com/wp-content/uploads/2015/01/nmcli-con-create.png) + +运行 **# nmcli con show** 命令验证组接口配置。 + + # nmcli con show + +![显示组接口](http://blog.linoxide.com/wp-content/uploads/2015/01/show-team-interface.png) + +### 2. 添加从设备 ### + +现在让我们天际从设备到主设备 team0。这是添加从设备的语法。 + + # nmcli con add type team-slave con-name CNAME ifname INAME master TEAM + +在这里我们添加 **eno16777736** 和 **eno33554960** 作为 **team0** 接口的从设备。 + + # nmcli con add type team-slave con-name team0-port1 ifname eno16777736 master team0 + + # nmcli con add type team-slave con-name team0-port2 ifname eno33554960 master team0 + +![添加从设备到 team](http://blog.linoxide.com/wp-content/uploads/2015/01/adding-to-team.png) + +再次用命令 **#nmcli con show** 验证连接配置。现在我们可以看到从设备配置信息。 + + #nmcli con show + +![显示从设备配置](http://blog.linoxide.com/wp-content/uploads/2015/01/show-slave-config.png) + +### 3. 分配 IP 地址 ### + +上面的命令会在 **/etc/sysconfig/network-scripts/** 目录下创建需要的配置文件。 + +现在让我们为 team0 接口分配一个 IP 地址并启用这个连接。这是进行 IP 分配的命令。 + + # nmcli con mod team0 ipv4.addresses "192.168.1.24/24 192.168.1.1" + # nmcli con mod team0 ipv4.method manual + # nmcli con up team0 + +![分配 ip](http://blog.linoxide.com/wp-content/uploads/2015/01/ip-assignment.png) + +### 4. 验证绑定 ### + +用 **#ip add show team0** 命令验证 IP 地址信息。 + + #ip add show team0 + +![验证 ip 地址](http://blog.linoxide.com/wp-content/uploads/2015/01/verfiy-ip-adress.png) + +现在用 **teamdctl** 命令检查 **主动备份** 配置功能。 + + # teamdctl team0 state + +![teamdctl 检查主动备份](http://blog.linoxide.com/wp-content/uploads/2015/01/teamdctl-activebackup-check.png) + +现在让我们和激活的端口断开连接并再次检查状态来确认主动备份配置是否像希望的那样工作。 + + # nmcli dev dis eno33554960 + +![断开激活端口连接](http://blog.linoxide.com/wp-content/uploads/2015/01/disconnect-activeport.png) + +断开激活端口后再次用命令 **#teamdctl team0 state** 检查状态。 + + # teamdctl team0 state + +![teamdctl 检查断开激活端口连接](http://blog.linoxide.com/wp-content/uploads/2015/01/teamdctl-check-activeport-disconnect.png) + +是的,它运行良好!!我们会使用下面的命令连接回到 team0 的断开的连接。 + + #nmcli dev con eno33554960 + +![nmcli dev 连接断开的连接](http://blog.linoxide.com/wp-content/uploads/2015/01/nmcli-dev-connect-disconected.png) + +我们还有一个 **teamnl** 命令可以显示 **teamnl** 命令的一些选项。 + +用下面的命令检查在 team0 运行的端口。 + + # teamnl team0 ports + +![teamnl 检查端口](http://blog.linoxide.com/wp-content/uploads/2015/01/teamnl-check-ports.png) + +显示 **team0** 当前活动的端口。 + + # teamnl team0 getoption activeport + +![显示 team0 活动端口](http://blog.linoxide.com/wp-content/uploads/2015/01/display-active-port-team0.png) + +好了,我们已经成功地配置了网卡绑定 :-) ,如果有任何反馈,请告诉我们。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-command/interface-nics-bonding-linux/ + +作者:[Arun Pyasi][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ \ No newline at end of file From b7c78629570e4a9a87b2df98bd9ba2384fc31837 Mon Sep 17 00:00:00 2001 From: royaso Date: Wed, 29 Apr 2015 13:54:59 +0800 Subject: [PATCH 023/133] =?UTF-8?q?=E6=A0=A1=E5=AF=B9=2020140804=20Group?= =?UTF-8?q?=20Test--Linux=20Text=20Editors.md=20(=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E9=94=99=E5=88=AB=E5=AD=97,=E4=B8=80?= =?UTF-8?q?=E5=8F=A5=E6=BC=8F=E7=BF=BB=E8=AF=91,=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E9=80=9A=E9=A1=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20140804 Group Test--Linux Text Editors.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/share/20140804 Group Test--Linux Text Editors.md b/translated/share/20140804 Group Test--Linux Text Editors.md index fa9b275588..1976cfca32 100644 --- a/translated/share/20140804 Group Test--Linux Text Editors.md +++ b/translated/share/20140804 Group Test--Linux Text Editors.md @@ -8,7 +8,7 @@ 得益于能向它们注入足以抗衡其它类型的以文本为中心的应用程序能力的插件,一些简单的文本编辑器甚至超过了它们的设计目标。它们能胜任一个源代码编辑器的任务,甚至是一个集成开发环境。 -Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一些原因,我们在这个组测试中并没有包括它们。首先,如果你使用它们中的任何一个,那么恭喜你:你不需要更换了。其次,它们都有陡峭的学习曲线,尤其是对于那些对有面向图形用户界面的桌面系统的替代能力更有兴趣的用户。 +Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一些原因,我们在这个组测试中并没有包括它们。首先,如果你使用它们中的任何一个,那么恭喜你:你不需要更换了。其次,它们都有陡峭的学习曲线,尤其是那些熟悉了桌面环境的用户:他们很更愿意投入其他有图形界面的文本编辑器。 ### 目录: ### @@ -54,9 +54,9 @@ Emacs和Vim是两款最流行和强大的纯文本编辑器。但是,由于一 除了Gedit和jEdit以外的所有工具,都是通过推荐的安装方法安装在Fedora和Ubuntu上。前者已经兼容默认的Gnome桌面,后者仍然固执地反对安装在Fedora上。由于这些是相对简单的应用程序,他们没有复杂的依赖,唯一例外的是jEdit,它要求要有Oracle Java。 -得益于Gnome和KDE持续的努力,不论他们运行的桌面环境,所有编辑器看起来很好,功能也很正常。这不仅是作为环境评价的标准,也意味着你不再受制于要找到和你的桌面环境兼容的工具。 +得益于Gnome和KDE持续的努力,不论他们运行的桌面环境,所有编辑器看起来很好,功能也很正常。这不仅是作为评价的标准,也意味着你不再受制于要找到和你的桌面环境兼容的工具。 -除了它们老派的功能,我们也对所有候选者测试了通用文本编辑功能。然而,它们并没有被设计为模仿现代字处理器的所有功能,我们也不以此评判。 +除了它们奇特的功能,我们也对所有候选者测试了通用文本编辑功能。然而,它们并没有被设计为模仿现代字处理器的所有功能,我们也不以此评判。 ![Kate能搭建为功能丰富的集成开发环境](http://www.linuxvoice.com/wp-content/uploads/2014/08/kate-web.png) @@ -64,7 +64,7 @@ Kate能搭建为功能丰富的集成开发环境。 ### 编程语言支持 ### -UltraEdit 能进行语法高亮,代码折叠以及拥有项目管理的能力。这也有一个罗列源文件中所有功能的功能列表,但并不适用于我们任何的测试代码文件。UltraEdit也支持HTML5,有能添加常用HTML标记的HTML工具栏。 +UltraEdit 能进行语法高亮,代码折叠以及拥有项目管理的能力。这也有一个罗列源文件中所有函数的功能列表,但并不适用于我们任何的测试代码文件。UltraEdit也支持HTML5,有能添加常用HTML标记的HTML工具栏。 即使Gnome的默认文本编辑器Gedit,也有几个面向编码的功能特性,例如括号匹配,自动缩进以及为包括C, C++, Java, HTML, XML, Python, Perl, 以及许多其它编程语言进行语法高亮。 @@ -74,15 +74,15 @@ UltraEdit 能进行语法高亮,代码折叠以及拥有项目管理的能力 正如Komodo IDE,Sublime也可滚动浏览显示完整的代码,这对于长代码文件导航和在文件中的不同部分跳转很方便。 -Sublime最好的功能之一就是能在编辑器内部为特定语言,例如C++, Python, Ruby等运行代码,当然假设在你的电脑上安装有编译器以及其它系统工具。 +Sublime最好的功能之一就是能在编辑器内部为特定语言,例如C++, Python, Ruby等运行代码,当然假设在你的电脑上安装有编译器以及其它系统工具。省时间而且不用再开终端. 你也可以用插件在Kate中开启构建系统功能。另外,你可以为GDB调试器添加一个简单的前端。Kate能和Git,Subversion以及Mercurial版本控制系统一起工作,也提供了一些项目管理的功能。 -除了能为超过180中语言进行语法高亮,它支持所有的这些辅助功能,例如括号匹配,自动补全和自动缩进。它也支持代码折叠,甚至在一个程序中包括有错误的函数。 +除了能为超过180中语言进行语法高亮,它支持所有的这些辅助功能,例如括号匹配,自动补全和自动缩进。它也支持代码折叠,甚至在一个程序中折叠函数。 -jEdit是唯一的遗憾,它声称自己是一个程序员的文本编辑器,但它缺少其他的基本功能,例如代码折叠,它甚至不支持补全功能。 +唯一的遗憾的是jEdit,它声称自己是一个程序员的文本编辑器,但它缺少其他的基本功能,例如代码折叠,它甚至不能提示或者不全函数. -**Verdict:** +**评分:** - Gedit:3/5 - Kate:5/5 @@ -98,7 +98,7 @@ jEdit是唯一的遗憾,它声称自己是一个程序员的文本编辑器, 高级文本编辑器用户希望能完全通过键盘控制和操作,一些应用程序甚至运行他们的用户自定义快捷方式的键盘绑定。 -你可以轻松的使用Gedit的扩展键盘快捷键。这里有编辑文件,为普通任务,例如对一个文档进行拼写检查,唤起工具的快捷键。你可以获取应用程序内部的一系列默认快捷键,但并没有图形化的方式去自定义它们。相似的,在Sublime中自定义键绑定,你需要修改他的XML键映射文件。Sublime由于缺少定义键盘快捷键的图形化界面而饱受批评,但长期使用的用户已经支持当前的基于文件的机制,这给他们更多的控制能力。 +你可以轻松的使用Gedit的扩展键盘快捷键。这里有编辑文件,为普通任务,例如对一个文档进行拼写检查,唤起工具的快捷键。你可以获取应用程序内部的一系列默认快捷键,但并没有图形化的方式去自定义它们。相似的,在Sublime中自定义键绑定,你需要修改他的XML键映射文件。Sublime由于缺少定义键盘快捷键的图形化界面而饱受批评,但长期使用的用户支持当前的基于文件的机制:这给他们更多的控制能力。 UltraEdit为它"一切都可自定义"的座右铭感到自豪,这也包括键盘快捷键。你可以自定义菜单导航的热键,以及定义你自己的访问大量函数的多键键映射。 @@ -148,7 +148,7 @@ UltraEdit的用户界面是高度可配置的 — 你可以正如改变其它许 Gedit有很普通的外观。通过最小化菜单和按钮有一个简单的界面。但这也是一种双刃剑,因为有些用户可能不会发现它真正的潜能。 -应用程序可以通过在窗口中能重排和移动的选项卡打开多个文件。用户可以通过使用一个插件选择性地启用旁边或者底部用来显示文件浏览和工具输出的面板。这个应用程序会检测到被其它应用程序更改的文件并可以重新加载这个文件。 +Gedit可以通过在窗口中能重排和移动的选项卡打开多个文件。用户可以通过使用一个插件选择性地启用旁边或者底部用来显示文件浏览和工具输出的面板。这个应用程序会检测到被其它应用程序更改的文件并可以重新加载这个文件。 为了适配Gnome,在应用程序的最后一个版本中考虑了大量的用户界面。然而它还并不稳定,尽管包括了所有的功能,和菜单交互的一些插件还需要升级。 @@ -232,7 +232,7 @@ jEdit拥有最令人映像深刻的插件设施。该应用有超过200个插件 ### 纯文本编辑 ### -尽管它们强大的额外功能甚至可能会取代几个流派完全成熟的应用程序,有时候可能只需要使用这些庞大的文本编辑器读写或者编辑简单的纯文本。虽然你可以使用它们中的任何一个输入文本,我们通过普通文本编辑的方便性平均它们。 +尽管它们强大的额外功能甚至可能会取代几个流派完全成熟的应用程序,有时候可能只需要使用这些庞大的文本编辑器读写或者编辑简单的纯文本。虽然你可以使用它们中的任何一个输入文本,我们通过普通文本编辑的方便性评价它们。 Gnome的默认文本编辑器Gedit,支持取消和重做机制以及搜索和替换。它可以对多种语言进行拼写检查,并能通过使用Gnome GVFS库访问和编辑远程文件。 @@ -303,7 +303,7 @@ Kate为能快速响应你的需要而设计,它的界面并不会使你茫然 随你发行版发布的默认文本编辑器也能帮助你一些高级任务。例如KDE的KWrite和Raspbian的Nano。得益于KDE的katepart组件,KWrite继承了一些Kate的功能,得益于在树莓派上的可用性,Nano也开始重现风头。 -如果你希望跟随Linux大师的脚本,你总是可以尝试崇高的文本编辑机Emacs和Vim。想尝试Vim强大的用户首先可以考虑gVim,它通过图形界面展现了Vim的强大。 +如果你希望跟随Linux大师的脚步,你总是可以尝试崇高的文本编辑机Emacs和Vim。想尝试Vim强大的用户首先可以考虑gVim,它通过图形界面展现了Vim的强大。 除了jEdit和Kate,这里还有其他模仿例如Emacs和Vim之类的老派高级编辑器的编辑器,比如JED 编辑器和Joe's Own Editor,这两者都有Emacs的模拟模式。另一方面,如果你在寻找轻量级的代码编辑器,可以看看Bluefish和Geany。他们的存在是为了填补文本编辑器和全面集成的开发平台之间的空隙。 @@ -313,7 +313,7 @@ via: http://www.linuxvoice.com/text-editors/ 作者:[Ben Everard][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[royaso](https://github.com/royaso) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From e240424ea94a3c75cda6a3a36e0a450f5a1f7b3f Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 29 Apr 2015 14:42:32 +0800 Subject: [PATCH 024/133] =?UTF-8?q?20150429-3=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...What are good command line HTTP clients.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/share/20150429 What are good command line HTTP clients.md diff --git a/sources/share/20150429 What are good command line HTTP clients.md b/sources/share/20150429 What are good command line HTTP clients.md new file mode 100644 index 0000000000..d809be1a06 --- /dev/null +++ b/sources/share/20150429 What are good command line HTTP clients.md @@ -0,0 +1,110 @@ +What are good command line HTTP clients? +================================================================================ +The whole is greater than the sum of its parts is a very famous quote from Aristotle, a Greek philosopher and scientist. This quote is particularly pertinent to Linux. In my view, one of Linux's biggest strengths is its synergy. The usefulness of Linux doesn't derive only from the huge raft of open source (command line) utilities. Instead, it's the synergy generated by using them together, sometimes in conjunction with larger applications. + +The Unix philosophy spawned a "software tools" movement which focused on developing concise, basic, clear, modular and extensible code that can be used for other projects. This philosophy remains an important element for many Linux projects. + +Good open source developers writing utilities seek to make sure the utility does its job as well as possible, and work well with other utilities. The goal is that users have a handful of tools, each of which seeks to excel at one thing. Some utilities work well independently. + +This article looks at 3 open source command line HTTP clients. These clients let you download files off the internet from a command line. But they can also be used for many more interesting purposes such as testing, debugging and interacting with HTTP servers and web applications. Working with HTTP from the command-line is a worthwhile skill for HTTP architects and API designers. If you need to play around with an API, HTTPie and cURL will be invaluable. + +---------- + +![HTTPie](http://www.linuxlinks.com/portal/content2/png/HTTPie.png) + +![HTTPie in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-httpie.png) + +HTTPie (pronounced aych-tee-tee-pie) is an open source command line HTTP client. It is a a command line interface, cURL-like tool for humans. + +The goal of this software is to make CLI interaction with web services as human-friendly as possible. It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output. HTTPie can be used for testing, debugging, and generally interacting with HTTP servers. + +#### Features include: #### + +- Expressive and intuitive syntax +- Formatted and colorized terminal output +- Built-in JSON support +- Forms and file uploads +- HTTPS, proxies, and authentication +- Arbitrary request data +- Custom headers +- Persistent sessions +- Wget-like downloads +- Python 2.6, 2.7 and 3.x support +- Linux, Mac OS X and Windows support +- Plugins +- Documentation +- Test coverage + +- Website: [httpie.org][1] +- Developer: Jakub Roztočil +- License: Open Source +- Version Number: 0.9.2 + +---------- + +![cURL](http://www.linuxlinks.com/portal/content2/png/cURL1.png) + +![cURL in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-cURL.png) + +cURL is an open source command line tool for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP. + +curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks. + +#### Features include: #### + +- Config file support +- Multiple URLs in a single command line +- Range "globbing" support: [0-13], {one,two,three} +- Multiple file upload on a single command line +- Custom maximum transfer rate +- Redirectable stderr +- Metalink support + +- Website: [curl.haxx.se][2] +- Developer: Daniel Stenberg +- License: MIT/X derivate license +- Version Number: 7.42.0 + +---------- + +![Wget](http://www.linuxlinks.com/portal/content2/png/Wget1.png) + +![Wget in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Wget.png) + +Wget is open source software that retrieves content from web servers. Its name is derived from World Wide Web and get. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. + +Wget can follow links in HTML pages and create local versions of remote web sites, fully recreating the directory structure of the original site. This is known as "recursive downloading." + +Wget has been designed for robustness over slow or unstable network connections. + +Features include: + +- Resume aborted downloads, using REST and RANGE +- Use filename wild cards and recursively mirror directories +- NLS-based message files for many different languages +- Optionally converts absolute links in downloaded documents to relative, so that downloaded documents may link to each other locally +- Runs on most UNIX-like operating systems as well as Microsoft Windows +- Supports HTTP proxies +- Supports HTTP cookies +- Supports persistent HTTP connections +- Unattended / background operation +- Uses local file timestamps to determine whether documents need to be re-downloaded when mirroring + +- Website: [www.gnu.org/software/wget/][3] +- Developer: Hrvoje Niksic, Gordon Matzigkeit, Junio Hamano, Dan Harkless, and many others +- License: GNU GPL v3 +- Version Number: 1.16.3 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150425174537249/HTTPclients.html + +作者:Frazer Kline +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://httpie.org/ +[2]:http://curl.haxx.se/ +[3]:https://www.gnu.org/software/wget/ \ No newline at end of file From 61a4f5a2f9ec61551d22c7d9bae6fc83372d34ab Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Wed, 29 Apr 2015 18:37:00 +0800 Subject: [PATCH 025/133] Translating by ZTinoZ --- ...kscape - Open Source Vector Graphic Editor.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md b/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md index ba022a2efd..f4a957a15f 100644 --- a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md +++ b/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md @@ -2,22 +2,22 @@ ================================================================================ Inkscape是一款开源矢量图形编辑工具,它使用可缩放矢量图形(SVG)图形格式并不同于它的竞争对手如Xara X、Corel Draw和Adobe Illustrator等等。SVG是一个广泛部署、免版税使用的图形格式,由W3C SVG工作组开发和维护。这是一个跨平台工具,完美运行于Linux、Windows和Mac OS上。 -Inkscape development was started in 2003, Inkscape's bug tracking system was hosted on Sourceforge initially but it was migrated to Launchpad afterwards. Its current latest stable version is 0.91. It is under continuous development and bug fixes and we will be reviewing its prominent features and installing process in the article. +Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上但是 后来迁移到了Launchpad上。当前它最新的一个稳定版本是0.91,它不断地在发展和修改中。我们将在本文里了解一下它的突出特点和安装过程。 -### Salient Features ### +### 显著特性 ### -Lets review the outstanding features of this application categorically. +让我们直接来了解这款应用程序的显著特性。 -#### Creating Objects #### +#### 创建对象 #### - Drawing different colored sized and shaped freehand lines through pencil tool, straight lines and curves through Bezier (pen) tool, applying freehand calligraphic strokes through calligraphic tool etc - Creating, selecting, editing and formatting text through text tool. Manipulating text in plain text boxes, on paths or in shapes - Helps draw various shapes like rectangles, ellipses, circles, arcs, polygons, stars, spirals etc and then resize, rotate and modify (turn sharp edges round) them - Create and embed bitmaps with simple commands -#### Object manipulation #### +#### 项目控制 #### -- Skewing, moving, scaling, rotating objects through interactive manipulations and pacifying the numeric values +- 通过交互式操作来扭曲、移动、测量、旋转目标Skewing, moving, scaling, rotating objects through interactive manipulations and pacifying the numeric values - Performing raising and lowering Z-order operations - Grouping and ungrouping objects to create a virtual scope for editing or manipulation - Layers form a hierarchal tree and can be locked or rearranged for various manipulations @@ -76,7 +76,7 @@ Congratulation, Inkscape has been installed now and all set for image editing an ![Inkscape Main](http://blog.linoxide.com/wp-content/uploads/2015/03/Inkscape-Main1.png) -### Conclusion ### +### 结论 ### Inkscape is a feature rich graphic editing tool which empowers its user with state of the art capabilities. It is an open source application which is freely available for installation and customizations and supports wide range of file formats including but not limited to JPEG, PNG, GIF and PDF. Visit its [official website][2] for more news and updates regarding this application. @@ -85,7 +85,7 @@ Inkscape is a feature rich graphic editing tool which empowers its user with sta via: http://linoxide.com/tools/install-inkscape-open-source-vector-graphic-editor/ 作者:[Aun Raza][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ZTinoZ](https://github.com/ZTinoZ) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 4c0e81d9d2aa3aed175e86c60b22d59bf9fbbb26 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Wed, 29 Apr 2015 21:40:12 +0800 Subject: [PATCH 026/133] Translated by DongShuaike --- ...-2 Setting up a private Docker registry.md | 242 ------------------ ...-2 Setting up a private Docker registry.md | 241 +++++++++++++++++ 2 files changed, 241 insertions(+), 242 deletions(-) delete mode 100644 sources/tech/20150128 Docker-2 Setting up a private Docker registry.md create mode 100644 translated/tech/20150128 Docker-2 Setting up a private Docker registry.md diff --git a/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md b/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md deleted file mode 100644 index 625281ee7c..0000000000 --- a/sources/tech/20150128 Docker-2 Setting up a private Docker registry.md +++ /dev/null @@ -1,242 +0,0 @@ -[Translating by DongShuaike] -Setting up a private Docker registry -================================================================================ -![](http://cocoahunter.com/content/images/2015/01/docker2.jpg) - -[TL;DR] This is the second post in a series of 3 on how my company moved its infrastructure from PaaS to Docker based deployment. - -- [First part][1]: where I talk about the process we went thru before approaching Docker; -- [Third pard][2]: where I show how to automate the entire process of building images and deploying a Rails app with Docker. - ----------- - -Why would ouy want ot set up a provate registry? Well, for starters, Docker Hub only allows you to have one free private repo. Other companies are beginning to offer similar services, but they are all not very cheap. In addition, if you need to deploy production ready applications built with Docker, you might not want to publish those images on the public Docker Hub. - -This is a very pragmatic approach to dealing with the intricacies of setting up a private Docker registry. For the tutorial we will be using a small 512MB instance on DigitalOcean (from now on DO). I also assume you already know the basics of Docker since I will be concentrating on some more complicated stuff. - -### Local set up ### - -First of all you need to install **boot2docker** and docker CLI. If you already have your basic Docker environment up and running, you can just skip to the next section. - -From the terminal run the following command[1][3]: - - brew install boot2docker docker - -If everything is ok[2][4], you will now be able to start the VM inside which Docker will run with the following command: - - boot2docker up - -Follow the instructions, copy and paste the export commands that boot2docker will print in the terminal. If you now run `docker ps` you should be greeted by the following line - - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - -Ok, Docker is ready to go. This will be enough for the moment. Let's go back to setting up the registry. - -### Creating the server ### - -Log into you DO account and create a new Droplet by selecting an image with Docker pre-installed[^n]. - -![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-18-26-14.png) - -You should receive your root credentials via email. Log into your instance and run `docker ps` to see if eveything is ok. - -### Setting up AWS S3 ### - -We are going to use Amazon Simple Storage Service (S3) as the storage layer for our registry / repository. We will need to create a bucket and user credentials to allow our docker container accessoing it. - -Login into your AWS account (if you don't have one you can set one up at [http://aws.amazon.com/][5]) and from the console select S3 (Simple Storage Service). - -![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-29-21.png) - -Click on **Create Bucket**, enter a unique name for your bucket (and write it down, we're gonna need it later), then click on **Create**. - -![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-22-50.png) - -That's it! We're done setting up the storage part. - -### Setup AWS access credentials ### - -We are now going to create a new user. Go back to your AWS console and select IAM (Identity & Access Management). - -![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-29-08.png) - -In the dashboard, on the left side of the webpage, you should click on Users. Then select **Create New Users**. - -You should be presented with the following screen: - -![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-31-42.png) - -Enter a name for your user (e.g. docker-registry) and click on Create. Write down (or download the csv file with) your Access Key and Secret Access Key that we'll need when running the Docker container. Go back to your users list and select the one you just created. - -Under the Permission section, click on Attach User Policy. In the next screen, you will be presented with multiple choices: select Custom Policy. - -![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-41-21.png) - -Here's the content of the custom policy: - - { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "SomeStatement", - "Effect": "Allow", - "Action": [ - "s3:*" - ], - "Resource": [ - "arn:aws:s3:::docker-registry-bucket-name/*", - "arn:aws:s3:::docker-registry-bucket-name" - ] - } - ] - } - -This will allow the user (i.e. the registry) to manage (read/write) content on the bucket (make sure to use the bucket name you previously defined when setting up AWS S3). To sum it up: when you'll be pushing Docker images from your local machine to your repository, the server will be able to upload them to S3. - -### Installing the registry ### - -Now let's head back to our DO server and SSH into it. We are going to use[^n] one of the [official Docker registry images][6]. - -Let's start our registry with the following command: - - docker run \ - -e SETTINGS_FLAVOR=s3 \ - -e AWS_BUCKET=bucket-name \ - -e STORAGE_PATH=/registry \ - -e AWS_KEY=your_aws_key \ - -e AWS_SECRET=your_aws_secret \ - -e SEARCH_BACKEND=sqlalchemy \ - -p 5000:5000 \ - --name registry \ - -d \ - registry - -Docker should pull the required fs layers from the Docker Hub and eventually start the daemonised container. - -### Testing the registry ### - -If everything worked out, you should now be able to test the registry by pinging it and by searching its content (though for the time being it's still empty). - -Our registry is very basic and it does not provide any means of authentication. Since there are no easy ways of adding authentication (at least none that I'm aware of that are easy enough to implment in order to justify the effort), I've decided that the easiest way of querying / pulling / pushing the registry is an unsecure (over HTTP) connection tunneled thru SSH. - -Opening an SSH tunnel from your local machine is straightforward: - - ssh -N -L 5000:localhost:5000 root@your_registry.com - -The command is tunnelling connections over SSH from port 5000 of the registry server (which is the one we exposed with the `docker run` command in the previous paragraph) to port 5000 on the localhost. - -If you now browse to the following address [http://localhost:5000/v1/_ping][7] you should get the following very simple response - - {} - -This just means that the registry is working correctly. You can also list the whole content of the registry by browsing to [http://localhost:5000/v1/search][8] that will get you a similar response: - - { - "num_results": 2, - "query": "", - "results": [ - { - "description": "", - "name": "username/first-repo" - }, - { - "description": "", - "name": "username/second-repo" - } - ] - } - -### Building an image ### - -Let's now try and build a very simple Docker image to test our newly installed registry. On your local machine, create a Dockerfile with the following content[^n]: - - # Base image with ruby 2.2.0 - FROM ruby:2.2.0 - - MAINTAINER Michelangelo Chasseur - -...and build it: - - docker build -t localhost:5000/username/repo-name . - -The `localhost:5000` part is especially important: the first part of the name of a Docker image will tell the `docker push` command the endpoint towards which we are trying to push our image. In our case, since we are connecting to our remote private registry via an SSH tunnel, `localhost:5000` represents exactly the reference to our registry. - -If everything works as expected, when the command returns, you should be able to list your newly created image with the `docker images` command. Run it and see it for yourself. - -### Pushing to the registry ### - -Now comes the trickier part. It took a me a while to realize what I'm about to describe, so just be patient if you don't get it the first time you read and try to follow along. I know that all this stuff will seem pretty complicated (and it would be if you didn't automate the process), but I promise in the end it will all make sense. In the next post I will show a couple of shell scripts and Rake tasks that will automate the whole process and will let you deploy a Rails to your registry app with a single easy command. - -The docker command you are running from your terminal is actually using the boot2docker VM to run the containers and do all the magic stuff. So when we run a command like `docker push some_repo` what is actually happening is that it's the boot2docker VM that is reacing out for the registry, not our localhost. - -This is an extremely important point to understand: in order to push the Docker image to the remote private registry, the SSH tunnel needs to be established from the boot2docker VM and not from your local machine. - -There are a couple of ways to go with it. I will show you the shortest one (which is not probably the easiest to understand, but it's the one that will let us automate the process with shell scripts). - -First of all though we need to sort one last thing with SSH. - -### Setting up SSH ### - -Let's add our boot2docker SSH key to our remote server (registry) known hosts. We can do so using the ssh-copy-id utility that you can install with the following command shouldn't you already have it: - - brew install ssh-copy-id - -Then run: - - ssh-copy-id -i /Users/username/.ssh/id_boot2docker root@your-registry.com - -Make sure to substitute `/Users/username/.ssh/id_boot2docker` with the correct path of your ssh key. - -This will allow us to connect via SSH to our remote registry without being prompted for the password. - -Finally let's test it out: - - boot2docker ssh "ssh -o 'StrictHostKeyChecking no' -i /Users/michelangelo/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@registry.touchwa.re &" & - -To break things out a little bit: - -- `boot2docker ssh` lets you pass a command as a parameter that will be executed by the boot2docker VM; -- the final `&` indicates that we want our command to be executed in the background; -- `ssh -o 'StrictHostKeyChecking no' -i /Users/michelangelo/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@registry.touchwa.re &` is the actual command our boot2docker VM will run; - - the `-o 'StrictHostKeyChecking no'` will make sure that we are not prompted with security questions; - - the `-i /Users/michelangelo/.ssh/id_boot2docker` indicates which SSH key we want our VM to use for authentication purposes (note that this should be the key you added to your remote registry in the previous step); - - finally we are opening a tunnel on mapping port 5000 to localhost:5000. - -### Pulling from another server ### - -You should now be able to push your image to the remote registry by simply issuing the following command: - - docker push localhost:5000/username/repo_name - -In the [next post][9] we'll se how to automate some of this stuff and we'll containerize a real Rails application. Stay tuned! - -P.S. Please use the comments to let me know of any inconsistencies or fallacies in my tutorial. Hope you enjoyed it! - -1. I'm also assuming you are running on OS X. -1. For a complete list of instructions to set up your docker environment and requirements, please visit [http://boot2docker.io/][10] -1. Select Image > Applications > Docker 1.4.1 on 14.04 at the time of this writing. -1. [https://github.com/docker/docker-registry/][11] -1. This is just a stub, in the next post I will show you how to bundle a Rails application into a Docker container. - --------------------------------------------------------------------------------- - -via: http://cocoahunter.com/2015/01/23/docker-2/ - -作者:[Michelangelo Chasseur][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://cocoahunter.com/author/michelangelo/ -[1]:http://cocoahunter.com/2015/01/23/docker-1/ -[2]:http://cocoahunter.com/2015/01/23/docker-3/ -[3]:http://cocoahunter.com/2015/01/23/docker-2/#fn:1 -[4]:http://cocoahunter.com/2015/01/23/docker-2/#fn:2 -[5]:http://aws.amazon.com/ -[6]:https://registry.hub.docker.com/_/registry/ -[7]:http://localhost:5000/v1/_ping -[8]:http://localhost:5000/v1/search -[9]:http://cocoahunter.com/2015/01/23/docker-3/ -[10]:http://boot2docker.io/ -[11]:https://github.com/docker/docker-registry/ diff --git a/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md b/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md new file mode 100644 index 0000000000..6e4f6e4fba --- /dev/null +++ b/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md @@ -0,0 +1,241 @@ +搭建一个私有的Docker registry +================================================================================ +![](http://cocoahunter.com/content/images/2015/01/docker2.jpg) + +[TL;DR]这是系列的第二篇文章,这系列讲述了我的公司如何把基础服务从PaaS迁移到Docker上 + +- [First part][1]: 第一篇文章里我谈到了接触Docker之前的经历; +- [Third pard][2]: 第三篇文章里我展示如何使创建images的过程自动化以及如何用Docker部署一个Rails应用。 + +---------- + +为什么需要搭建一个私有的registry呢?嗯,Docker Hub(一个Docker公共仓库)只允许你拥有一个免费的私有版本库(repo)。其他的公司提供类似服务,但是价格可不便宜。另外,如果你需要部署一个基于Docker的应用产品,恐怕你不希望这些images在开放的Docker Hub被公开吧! + +这篇文章提供了一个非常务实的方法来处理搭建私有Docke registry时出现的各种错综复杂的情况。我们将会使用一个运行于DigitalOcean(之后简称为DO)的非常小巧的512MB实例。并且我会假定你已经了解了Docker的基本概念,因为我必须集中精力在复杂的事情上! + +###本地搭建### + +首先你需要安装**boot2docker**以及docker CLI。如果你已经搭建好了基本的Docker环境,你可以直接跳过这一步。 + +从终端运行以下命令[1][3]: + brew install boot2docker docker + +如果一切顺利[2][4],你现在将能够启动VM,在VM当中输入下列命令: + boot2docker up + +Follow the instructions, copy and paste the export commands that boot2docker will print in the terminal. If you now run `docker ps` you should be greeted by the following line +按照说明,复制粘贴book2docker打印在终端的export命令(这块翻译不太好)。现在运行`docker ps`命令,终端将有以下显示。 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + +好了,Docker已经准备就绪。我们回过头去搭建registry。 + +###创建服务器### + +登录进你的DO账号,选择一个提前安装好Docker的映像文件,创建一个新的Drople。[^n] + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-18-26-14.png) + + +你将会以邮件的方式收到一个根用户凭证。登录进去,然后运行`docker ps`命令来查看系统状态。 + +### 搭建AWS S3 ### + +我们现在将使用Amazo Simple Storage Service(S3)作为我们registry/repository的存储层。我们讲需要创建一个桶(bucket)以及用户凭证(user credentials)来允许我们的docker容器访问它。 + +登录到我们的AWS账号(如果没有,就申请一个[http://aws.amazon.com/][5]),在控制台选择S3(Simpole Storage Service) + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-29-21.png) + +点击 **Create Bucket**,为你的桶输入一个名字(把它写下来,我们一会需要用到它),然后点击**Create**。 + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-22-50.png) + +OK!我们已经搭建好存储部分了。 + +### 安装AWS访问凭证### + +我们现在将要创建一个新的用户。退回到AWS控制台然后选择IAM(Identity & Access Management)。 + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-29-08.png) + +在dashboard的左边,点击Users。然后选择 **Create New Users**。 + +如图所示: + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-31-42.png) + +输入你的用户名(例如 docker-registry)然后点击Create。写下(或者下载csv文件)你的Access Key以及Secret Access Key。回到你的用户列表然后选择你刚刚创建的用户。 + +在Permission section下面,点击Attach User Policy。之后,选择Custom Policy。 + +![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-41-21.png) + +custom policy的内容如下: + + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "SomeStatement", + "Effect": "Allow", + "Action": [ + "s3:*" + ], + "Resource": [ + "arn:aws:s3:::docker-registry-bucket-name/*", + "arn:aws:s3:::docker-registry-bucket-name" + ] + } + ] + } + +这个配置将允许用户(也就是regitstry)来对桶上的内容进行操作(读/写)(确保使用你之前创建AWS S3时使用的桶名)。总结起来:当你想把你的Docker映像从你的本机推送到仓库中时,服务器将能够将他们上传到S3。 + +### 安装registry ### + +现在回过头来看我们的DO服务器,SSH登录其上。我们将要使用[^n]一个官方Docker registry映像。[6] + +输入如下命令,开启registry。 + + docker run \ + -e SETTINGS_FLAVOR=s3 \ + -e AWS_BUCKET=bucket-name \ + -e STORAGE_PATH=/registry \ + -e AWS_KEY=your_aws_key \ + -e AWS_SECRET=your_aws_secret \ + -e SEARCH_BACKEND=sqlalchemy \ + -p 5000:5000 \ + --name registry \ + -d \ + registry + +Docker将会从Docker Hub上拉取所需的文件系统层(fs layers)并启动守护容器(daemonised container)。 + +### 测试registry ### + +如果上述操作奏效,你可以通过ping命令,或者查找它的内容来测试registry(虽然这个时候容器还是空的)。 + +我们的registry非常基础,而且没有提供任何“验明正身”的方式。因为添加身份验证可不是一件轻松事(至少我认为没有一种部署方法是简单的,像是为了证明你努力过似的),我觉得 查询/拉取/推送 仓库内容的最简单方法就是通过SSH的未加密连接(通过HTTP)。 + +打开SSH通道的操作非常简单: + + ssh -N -L 5000:localhost:5000 root@your_registry.com + +这条命令建立了一条从registry服务器(前面执行`docker run`命令的时候我们见过它)的5000号端口到本机的5000号端口之间的连接。 + +如果你现在登录[http://localhost:5000/v1/_ping][7],将会看到下面这个非常简短的回复。 + + {} + +这个意味着registry工作正常。你还可以通过登录[http://localhost:5000/v1/search][8]来查看registry内容,回复相似: + + { + "num_results": 2, + "query": "", + "results": [ + { + "description": "", + "name": "username/first-repo" + }, + { + "description": "", + "name": "username/second-repo" + } + ] + } + +### 创建一个映像 ### + +我们现在创建一个非常简答的Docker映像,来检验我们新弄好的registry。在我们的本机上,用如下内容创建一个Dockerfile[^n]: + + + # Base image with ruby 2.2.0 + FROM ruby:2.2.0 + + MAINTAINER Michelangelo Chasseur + +……创建: + + docker build -t localhost:5000/username/repo-name . + +`localhost:5000`非常重要:Docker映像名的最前面一个部分将告知`docker push`命令我们将要把我们的image推送到哪里。在我们这个例子当中,因为我们要通过SSH管道连接远端私有registry,`localhost:5000`精确地表示了对我们的registry的一个引用。 + +如果一切顺利,当命令执行完成返回后,你可以输入`docker images`命令来列出新近创建的映像。执行它看看会出现什么现象? + +### 推送到仓库 ### + +接下来是更好玩的部分。实现我所描述的东西着实花了我一点时间,所以如果你第一次读的话就耐心一点吧,跟着我一起操作。我知道接下来的东西会非常复杂(如果你不自动化进程就一定会这样),但是我保证到最后你一定都能明白。在下一篇文章里我将会使用到一大波shell脚本和Rake任务,通过它们实现自动化并且用简单的命令实现部署Rails应用。 + +你运行的docker命令都是实际上都是在boot2docker虚拟机上运行的。所以当你执行像`docker push some_repo`这样的命令时,是boot2docker虚拟机在与registry交互,而不是我们自己的机器。 + +接下来是一个非常重要的点:为了将Docker映像推送到远端的私有才哭,SSH管道需要在boot2docker虚拟机上配置好。 + +由许多种方法实现它。我给你展示最简短的一种(可能不是最容易理解的,但是能够帮助你实现自动化) + +First of all though we need to sort one last thing with SSH. +(不太会翻译) + +### Setting up SSH ### + +我们添加boot2docker SSH key到远端服务器已知的hosts里面。我们可以使用ssh-copy-id工具,通过下面的命令就可以安装上它了: + + brew install ssh-copy-id + +然后运行: + + ssh-copy-id -i /Users/username/.ssh/id_boot2docker root@your-registry.com + +用你ssh key的真实路径代替`/Users/username/.ssh/id_boot2docker`。 + +这样做能够让我们面密码登录SSH。 + +现在我们来测试以下: + + boot2docker ssh "ssh -o 'StrictHostKeyChecking no' -i /Users/michelangelo/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@registry.touchwa.re &" & + +分开阐述: + +- `boot2docker ssh`允许你以参数的形式传递给boot2docker虚拟机一条执行命令; +- 最后面那个`&`表明这条命令将在后台执行; +- `ssh -o 'StrictHostKeyChecking no' -i /Users/michelangelo/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@registry.touchwa.re &`是boot2docker虚拟机实际运行的命令; + -`-o 'StrictHostKeyChecking no'`——不提示安全问题; + - `-i /Users/michelangelo/.ssh/id_boot2docker`指出虚拟机使用哪个SSH key来进行身份验证。(注意这里的key应该是你前面添加到远程仓库的那个) + - 最后我们将打开一条端口5000到本地端口5000的SSH通道。 + +### 从其他服务器上拉取 ### + +你现在将可以通过下面的简单命令将你的映像推送到远端仓库: + + docker push localhost:5000/username/repo_name + +在下一篇文章[9]中,我们将会了解到如何自动化处理这些事务,并且真正地容器化一个Rails应用。请继续收听! +如有错误,请不吝指出。祝你Docker之路顺利! +1. 我假设你使用OS X。 +1. 想要了解搭建docker环境的完整之南,请参阅[http://boot2docker.io/][10]。 +1. 本文写成时选择的是 Image > Applications > Docker 1.4.1 on 14.04。 +1. [https://github.com/docker/docker-registry/][11] +1. 这是一个存根,在下一篇文章里我将会展示给你如何将一个Rails应用绑定进Docker容器中。 + +-------------------------------------------------------------------------------- + +via: http://cocoahunter.com/2015/01/23/docker-2/ + +作者:[Michelangelo Chasseur][a] +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://cocoahunter.com/author/michelangelo/ +[1]:http://cocoahunter.com/2015/01/23/docker-1/ +[2]:http://cocoahunter.com/2015/01/23/docker-3/ +[3]:http://cocoahunter.com/2015/01/23/docker-2/#fn:1 +[4]:http://cocoahunter.com/2015/01/23/docker-2/#fn:2 +[5]:http://aws.amazon.com/ +[6]:https://registry.hub.docker.com/_/registry/ +[7]:http://localhost:5000/v1/_ping +[8]:http://localhost:5000/v1/search +[9]:http://cocoahunter.com/2015/01/23/docker-3/ +[10]:http://boot2docker.io/ +[11]:https://github.com/docker/docker-registry/ From 94df559a044fa86a6162e221dcd1b8ac21919cb9 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Wed, 29 Apr 2015 21:53:42 +0800 Subject: [PATCH 027/133] DongShuaike translating --- ...150128 Docker-3 Automated Docker-based Rails deployments.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md b/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md index f450361a68..9b41996378 100644 --- a/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md +++ b/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md @@ -1,3 +1,4 @@ +[Translating by DongShuaike] Automated Docker-based Rails deployments ================================================================================ ![](http://cocoahunter.com/content/images/2015/01/docker3.jpeg) @@ -250,4 +251,4 @@ via: http://cocoahunter.com/2015/01/23/docker-3/ [7]:http://cocoahunter.com/2015/01/23/docker-3/#fn:1 [8]:http://cocoahunter.com/2015/01/23/docker-3/#fn:2 [9]:http://cocoahunter.com/2015/01/23/docker-2/ -[10]:http://cocoahunter.com/2015/01/23/docker-2/ \ No newline at end of file +[10]:http://cocoahunter.com/2015/01/23/docker-2/ From c9fbf07b4047ecff872ac1754745a812f93014ac Mon Sep 17 00:00:00 2001 From: Mo Date: Wed, 29 Apr 2015 23:34:22 +0800 Subject: [PATCH 028/133] [translated]The history of Android - 14 --- .../14 - The history of Android.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 translated/talk/The history of Android/14 - The history of Android.md diff --git a/translated/talk/The history of Android/14 - The history of Android.md b/translated/talk/The history of Android/14 - The history of Android.md new file mode 100644 index 0000000000..ce808f63da --- /dev/null +++ b/translated/talk/The history of Android/14 - The history of Android.md @@ -0,0 +1,82 @@ +安卓编年史 +================================================================================ +### 语音操作——口袋里的超级电脑 ### + +2010年8月,作为语音搜索应用的一项新功能,“[语音命令][1]”登陆了安卓市场。语音命令允许用户向他们的手机发出语音命令,然后安卓会试着去理解他们并完成任务。像“导航至[地址]”这样的命令会打开谷歌地图并且开始逐向导航至你所陈述的目的地。你还可以仅仅通过语音来发送短信或电子邮件,拨打电话,打开网站,获取方向,或是在地图上查看一个地点。 + +注:youtube视频地址 + + +语音命令是谷歌新应用设计哲学的顶峰。语音命令是那时候最先进的语音控制软件,秘密在于谷歌并不在设备上做任运算。一般来说,语音识别是对CPU的密集任务要求。实际上,许多语音识别程序仍然有“速度与准确性”设置,用户可以选择他们愿意为语音识别算法运行等待的时间——更多的CPU处理意味着更加准确。 + +谷歌的创新在于没有劳烦手机上能力有限的处理器来进行语音识别运算。当说出一个命令时,用户的声音会被打包并通过互联网发送到谷歌云服务器。在那里,谷歌超算中心的超级计算机分析并解释语音,然后发送回手机。这是很长的一段旅程,但互联网最终还是有足够快的速度在一两秒内完成像这样的任务。 + +很多人抛出词语“云计算”来表达“所有东西都被存储在服务器上”,但这才是真正的云计算。谷歌在云端进行这些巨量的运算操作,又因为在这个问题上投入了看似荒唐的CPU资源数目,所以语音识别准确性的唯一限制就是算法本身了。软件不需要由每个用户独立“训练”,因为所有使用语音操作的人无时不刻都在训练它。借助互联网的力量,安卓在你的口袋里放了一部超级电脑,同时相比于已有的解决方案,把语音识别这个工作量从口袋大小的电脑转移到房间大小的电脑上大大提高了准确性。 + +语音识别作为谷歌的项目已经有一段时间了,它的出现都是因为一个800号码。[1-800-GOOG-411][2]是个谷歌从2007年4月起开通的免费电话信息服务。它就像411信息服务一样工作了多年——用户可以拨打这个号码询问电话号码——但是谷歌免费提供这项服务。查询过程中没有人工的干预,411服务由语音识别和文本语音转换引擎驱动。语音命令就是人们教谷歌如何去听之后三年才有实现的可能。 + +语音识别是谷歌长远思考的极佳范例——公司并不怕在一个可能成不了商业产品的项目上投资多年。今天,语音识别驱动的产品遍布谷歌。它被用在谷歌搜索应用的输入,安卓的语音输入,以及Google.com。同时它还是Google Glass和[Android Wear][3]的默认输入界面。 + +谷歌甚至还在输入之外的地方使用语音识别。谷歌的语音识别技术被用在了转述Youtube视频上,它能自动生成字幕供听障用户观看。生成的字幕甚至被谷歌做成了索引,所以你可以搜索某句话在视频的哪里说过。语音是许多产品的未来,并且这项长期计划将谷歌带入了屈指可数的拥有自家语音识别服务的公司行列。大部分其它的语音识别产品,像苹果的Siri和三星设备,被迫使用——并且为其支付了授权费——Nuance的语音识别。 + +在计算机听觉系统设立运行之后,谷歌下一步将把这项策略应用到计算机视觉上。这就是为什么像Google Goggles,Google图像搜索和[Project Tango][4]这样的项目存在的原因。就像GOOG-411的那段日子,这些项目还处在早期阶段。当[谷歌的机器人部门][5]造出了机器人,它会需要看和听,谷歌的计算机视觉和听觉项目会给谷歌一个先机。 + +![Nexus S,第一部三星制造的Nexus手机。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/NS500.png) +Nexus S,第一部三星制造的Nexus手机。 + +### Android 2.3 Gingerbread——第一次UI大变 ### + +Gingerbread(姜饼人)发布于2010年12月,这已是2.2发布整整七个月之后了。尽管如此,等待是值得的,因为安卓2.3整个系统的每个界面几乎都改变了。这是从安卓0.9最初的样式以来第一次重大的更新。2.3开始了一系列持续的改进,试着将安卓从丑陋的小鸭子变成能承载它自己的合适的样子——从美学角度——来对抗iPhone。 + +说到苹果,六个月前,它发布了iPhone 4和iOS 4,新增了多任务处理和Facetime视频聊天。微软同样也终于重返这场游戏。微软在2010年11月发布了Windows Phone 7,也进入了智能手机时代。 + +安卓2.3在界面设计上投入了很多精力,但是由于缺乏方向或设计文档,许多应用仅仅止步于获得了一个新的定制主题而已。一些应用用了更扁平的暗色主题,一些用了充满渐变,活泼的暗色主题,其他应用则是高对比度的白色和绿色组合。尽管2.3并没有做到风格统一,Gingerbread还是完成了让系统几乎每个部分变得更现代化的任务。这同样是件好事,因为下一个手机版安卓要在将近一年后才到来。 + +Gingerbread的首发设备是Nexus S,谷歌的第二部旗舰设备,并且是第一部由三星生产的Nexus设备。尽管今天我们已经习惯了每年都有更新型号的CPU,那时候可不是这个样子。Nexus S有个1GHz Cortex A8处理器,和Nexus One是一样的。GPU从速度来说略微有所变快。Nexus S稍微比Nexus One大一点,拥有800×480分辨率的AMOLED显示屏。 + +从参数上来说,Nexus S看起来只是个平淡无奇的升级,但他确实开了安卓的许多先河。Nexus S是谷歌第一部没有MicroSD卡槽的旗舰,板载16GB存储。Nexus One只有512MB存储空间,但它有MicroSD卡槽。移除SD卡槽为用户简化了存储管理——现在只有一个存储地点了——但是影响了高级用户的扩展能力。它是谷歌第一部带有NFC的手机,手机背面的一个特殊芯片能够在和其他NFC芯片接触时传输数据。Nexus S暂时只能读取NFC标签,而不能发送数据。 + +托Gingerbread中一些升级的福,Nexus S是第一部不带有硬件十字方向键或轨迹球安卓手机之一。Nexus S缩减到只有电源,音量以及四个导航键。Nexus S同时还是如今[疯狂的曲面手机][6]的先驱,因为三星给Nexus S配备了一块略微有些弯曲的玻璃。 + +![Gingerbread更改了状态栏和壁纸,并且添加了许多新图标。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/appdrawershop.png) +Gingerbread更改了状态栏和壁纸,并且添加了许多新图标。 +Ron Amadeo供图 + +升级过的“Nexus”动态壁纸作为Nexus S的独占发布。这个壁纸基本上和Nexus One的一样,带有带动画轨迹的光点。在Nexus S上,去除了方阵设计,取而代之的是波浪形的蓝/灰色背景。底部dock有了直角和彩色图标。 + +![新通知面板和菜单。](http://cdn.arstechnica.net/wp-content/uploads/2014/02/32.png) +新通知面板和菜单。 +Ron Amadeo供图 + +状态栏自0.9的首次登场以来终于得到了重制。状态栏从白色渐变变成纯黑,所有图标重绘成了灰色和绿色。所有东西看起来都更加清爽和现代,这要感谢锐角图标设计和高分辨率。最奇怪的决定可能是从状态栏时钟移除了时间段显示以及信号强度那令人疑惑的灰色。尽管灰色被用在状态栏的许多图标上,而且上面截图有四格灰色信号,安卓实际上指示的是没有信号。绿色格表示信号强度,灰色格指示的是“空”信号格。 + +Gingerbread的状态栏图标同时还作为网络连接的状态指示。如果你的设备连接到了谷歌的服务器,图标会变绿,如果没有谷歌的连接,图标会是白色的。这让你可以在外出时轻松了解你的网络连接状态。 + +通知面板的设计从安卓1.5的设计改进而来。我们看到UI部分再次从浅色主题变为暗色主题,有个深灰色顶部,黑色背景以及在灰色底色上的黑色文本。 + +菜单颜色同样变深了,背景从白色变成了带点透明的黑色。菜单图标和背景的对比并没有它应该有的那么强烈,因为灰色图标的颜色和它们在白色背景上的时候是一样的。要求改变颜色意味着每个开发者都得制作新的图标,所以谷歌在黑色背景上使用了先前就有的灰色。这是系统级别的改变,所以这个新菜单会出现在每个应用中。 + +---------- + +![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) + +[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。 + +[@RonAmadeo][t] + +-------------------------------------------------------------------------------- + +via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/14/ + +译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://arstechnica.com/gadgets/2010/08/google-beefs-up-voice-search-mobile-sync/ +[2]:http://arstechnica.com/business/2007/04/google-rolls-out-free-411-service/ +[3]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ +[4]:http://arstechnica.com/gadgets/2014/02/googles-project-tango-is-a-smartphone-with-kinect-style-computer-vision/ +[5]:http://arstechnica.com/gadgets/2013/12/google-robots-former-android-chief-will-lead-google-robotics-division/ +[6]:http://arstechnica.com/gadgets/2013/12/lg-g-flex-review-form-over-even-basic-function/ +[a]:http://arstechnica.com/author/ronamadeo +[t]:https://twitter.com/RonAmadeo From 359cf39c069a5c40b9cf4cc38aa35f9544d963a0 Mon Sep 17 00:00:00 2001 From: chenjt Date: Thu, 30 Apr 2015 08:43:08 +0800 Subject: [PATCH 029/133] [translated]How to secure SSH login with one-time passwords on Linux --- ... login with one-time passwords on Linux.md | 181 ------------------ ... login with one-time passwords on Linux.md | 178 +++++++++++++++++ 2 files changed, 178 insertions(+), 181 deletions(-) delete mode 100644 sources/tech/20150330 How to secure SSH login with one-time passwords on Linux.md create mode 100644 translated/tech/20150330 How to secure SSH login with one-time passwords on Linux.md diff --git a/sources/tech/20150330 How to secure SSH login with one-time passwords on Linux.md b/sources/tech/20150330 How to secure SSH login with one-time passwords on Linux.md deleted file mode 100644 index 56888f3342..0000000000 --- a/sources/tech/20150330 How to secure SSH login with one-time passwords on Linux.md +++ /dev/null @@ -1,181 +0,0 @@ -[bazz222222222] -How to secure SSH login with one-time passwords on Linux -================================================================================ -As someone says, security is a not a product, but a process. While SSH protocol itself is cryptographically secure by design, someone can wreak havoc on your SSH service if it is not administered properly, be it weak passwords, compromised keys or outdated SSH client. - -As far as SSH authentication is concerned, [public key authentication][1] is in general considered more secure than password authentication. However, key authentication is actually not desirable or even less secure if you are logging in from a public or shared computer, where things like stealth keylogger or memory scraper can always a possibility. If you cannot trust the local computer, it is better to use something else. This is when "one-time passwords" come in handy. As the name implies, each one-time password is for single-use only. Such disposable passwords can be safely used in untrusted environments as they cannot be re-used even when they are stolen. - -One way to generate disposable passwords is [Google Authenticator][2]. In this tutorial, I am going to demonstrate another way to create one-time passwords for SSH login: [OTPW][3], a one-time password login package. Unlike Google Authenticator, you do not rely on any third party for one-time password generation and verification. - -### What is OTPW? ### - -OTPW consists of one-time password generator and PAM-integrated verification routines. In OTPW, one-time passwords are generated apriori with the generator, and carried by a user securely (e.g., printed in a paper sheet). Cryptographic hash of the generated passwords are then stored in the SSH server host. When a user logs in with a one-time password, OTPW's PAM module verifies the password, and invalidates it to prevent re-use. - -### Step One: Install and Configure OTPW on Linux ### - -#### Debian, Ubuntu or Linux Mint #### - -Install OTPW packages with apt-get. - - $ sudo apt-get install libpam-otpw otpw-bin - -Open a PAM configuration file for SSH (/etc/pam.d/sshd) with a text editor, and comment out the following line (to disable password authentication). - - #@include common-auth - -and add the following two lines (to enable one-time password authentication): - - auth required pam_otpw.so - session optional pam_otpw.so - -![](https://farm8.staticflickr.com/7599/16775121360_d1f93feefa_b.jpg) - -#### Fedora or CentOS/RHEL #### - -OTPW is not available as a prebuilt package on Red Hat based systems. So let's install OTPW by building it from the source. - -First, install prerequites: - - $ sudo yum git gcc pam-devel - $ git clone https://www.cl.cam.ac.uk/~mgk25/git/otpw - $ cd otpw - -Open Makefile with a text editor, and edit a line that starts with "PAMLIB=" as follows. - -On 64-bit system: - - PAMLIB=/usr/lib64/security - -On 32-bit system: - - PAMLIB=/usr/lib/security - -Compile and install it. Note that installation will automatically restart an SSH server. So be ready to be disconnected if you are on an SSH connection. - - $ make - $ sudo make install - -Now you need to update SELinux policy since /usr/sbin/sshd tries to write to user's home directory, which is not allowed by default SELinux policy. The following commands will do. If you are not using SELinux, skip this step. - - $ sudo grep sshd /var/log/audit/audit.log | audit2allow -M mypol - $ sudo semodule -i mypol.pp - -Next, open a PAM configuration file for SSH (/etc/pam.d/sshd) with a text editor, and comment out the following line (to disable password authentication). - - #auth substack password-auth - -and add the following two lines (to enable one-time password authentication): - - auth required pam_otpw.so - session optional pam_otpw.so - -#### Step Two: Configure SSH Server for One-time Passwords #### - -The next step is to configure an SSH server to accept one-time passwords. - -Open /etc/ssh/sshd_config with a text editor, and set the following three parameters. Make sure that you do not add these lines more than once, because that will cause an SSH server to fail. - - UsePrivilegeSeparation yes - ChallengeResponseAuthentication yes - UsePAM yes - -You also need to disable default password authentication. Optionally, enable public key authentication, so that you can fall back to key-based authentication in case you do not have one-time passwords. - - PubkeyAuthentication yes - PasswordAuthentication no - -Now restart SSH server. - -Debian, Ubuntu or Linux Mint: - - $ sudo service ssh restart - -Fedora or CentOS/RHEL 7: - - $ sudo systemctl restart sshd - -#### Step Three: Generate One-time Passwords with OTPW #### - -As mentioned earlier, you need to create one-time passwords beforehand, and have them stored on the remote SSH server host. For this, run otpw-gen tool as the user you will be logging in as. - - $ cd ~ - $ otpw-gen > temporary_password.txt - -![](https://farm9.staticflickr.com/8751/16961258882_c49cfe03fb_b.jpg) - -It will ask you to set a prefix password. When you later log in, you need to type this prefix password AND one-time password. Essentially the prefix password is another layer of protection. Even if the password sheet falls into the wrong hands, the prefix password forces them to brute-force. - -Once the prefix password is set, the command will generate 280 one-time passwords, and store them in the output text file (e.g., temporary_password.txt). Each password (length of 8 characters by default) is preceded by a three-digit index number. You are supposed to print the file in a sheet and carry it with you. - -![](https://farm8.staticflickr.com/7281/16962594055_c2696d5ae1_b.jpg) - -You will also see ~/.otpw file created, where cryptographic hashs of these passwords are stored. The first three digits in each line indicate the index number of the password that will be used for SSH login. - - $ more ~/.otpw - ----------- - - OTPW1 - 280 3 12 8 - 191ai+:ENwmMqwn - 218tYRZc%PIY27a - 241ve8ns%NsHFmf - 055W4/YCauQJkr: - 102ZnJ4VWLFrk5N - 2273Xww55hteJ8Y - 1509d4b5=A64jBT - 168FWBXY%ztm9j% - 000rWUSdBYr%8UE - 037NvyryzcI+YRX - 122rEwA3GXvOk=z - -### Test One-time Passwords for SSH Login ### - -Now let's login to an SSH server in a usual way: - - $ ssh user@remote_host - -If OTPW is successfully set up, you will see a slightly different password prompt: - - Password 191: - -Now open up your password sheet, and look for index number "191" in the sheet. - - 023 kBvp tq/G 079 jKEw /HRM 135 oW/c /UeB 191 fOO+ PeiD 247 vAnZ EgUt - -According to sheet above, the one-time password for number "191" is "fOO+PeiD". You need to prepend your prefix password to it. For example, if your prefix password is "000", the actual one-time password you need to type is "000fOO+PeiD". - -Once you successfully log in, the password used is automatically invalidated. If you check ~/.otpw, you will notice that the first line is replaced with "---------------", meaning that password "191" has been voided. - - OTPW1 - 280 3 12 8 - --------------- - 218tYRZc%PIY27a - 241ve8ns%NsHFmf - 055W4/YCauQJkr: - 102ZnJ4VWLFrk5N - 2273Xww55hteJ8Y - 1509d4b5=A64jBT - 168FWBXY%ztm9j% - 000rWUSdBYr%8UE - 037NvyryzcI+YRX - 122rEwA3GXvOk=z - -### Conclusion ### - -In this tutorial, I demonstrated how to set up one-time password login for SSH using OTPW package. You may realized that a print sheet can be considered a less fancy version of security token in two-factor authentication. Yet, it is simpler and you do not rely on any third-party for its implementation. Whatever mechanism you are using to create disposable passwords, they can be helpful when you need to log in to an SSH server from an untrusted public computer. Feel free to share your experience or opinion on this topic. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/secure-ssh-login-one-time-passwords-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://xmodulo.com/how-to-force-ssh-login-via-public-key-authentication.html -[2]:http://xmodulo.com/two-factor-authentication-ssh-login-linux.html -[3]:http://www.cl.cam.ac.uk/~mgk25/otpw.html diff --git a/translated/tech/20150330 How to secure SSH login with one-time passwords on Linux.md b/translated/tech/20150330 How to secure SSH login with one-time passwords on Linux.md new file mode 100644 index 0000000000..f3668f14f0 --- /dev/null +++ b/translated/tech/20150330 How to secure SSH login with one-time passwords on Linux.md @@ -0,0 +1,178 @@ +使用 SSH 和一次性密码安全登录 Linux +================================================================================ +有人说,安全不是一个产品,而是一个过程(LCTT 注:安全公司 McAfee 认为,安全风险管理是一个方法论,而不是安全产品的堆叠)。虽然 SSH 协议被设计成使用加密技术来确保安全,但如果使用不当,别人还是能够破坏你的系统:比如弱密码、密钥泄露、使用的 SSH 客户端过时等,都能引发安全问题。 + +在考虑 SSH 认证方案时,大家普遍认为[公钥认证][1]比密码认证更安全。然而,公钥认证技术并不是为公共环境设置的,如果你在一台公用电脑上使用公钥认证登录 SSH 服务器,你的服务器已经毫无安全可言了,公用的电脑可能会记录你的公钥,或从你的内存中读取公钥。如果你不信任本地电脑,那你最好还是使用其他方式登录服务器。现在就是“一次性密码”派上用场的时候了,就像名字所示,一次性密码只能被使用一次。这种一次性密码非常合适在不安全的环境下发挥作用,就算它被窃取,也无法再次使用。 + +有个一次性密码方案叫[谷歌认证][2],但在本文中,我要介绍的是另一种 SSH 登录方案:[OTPW][3],它是个一次性密码登录的软件包。不像谷歌认证,OTPW 不需要依赖任何第三方库。 + +### OTPW 是什么 ### + +OTPW 由一次性密码生成器和 PAM 认证规则组成。在 OTPW 中一次性密码由生成器事先生成,然后由用户以某种安全的方式获得(比如打印到纸上)。另一方面,这些密码会通过 Hash 加密保存在 SSH 服务器端。当用户使用一次性密码登录系统时,OTPW 的 PAM 模块认证这些密码,并且保证它们不能再次使用。 + +### 步骤1:OTPW 的安装和配置 ### + +#### 在 Debian, Ubuntu 或 Linux Mint 发行版上 #### + +使用 apt-get 安装: + + $ sudo apt-get install libpam-otpw otpw-bin + +打开针对 SSH 服务的 PAM 配置文件(/etc/pam.d/sshd),注释掉下面这行(目的是禁用 PAM 的密码认证功能): + + #@include common-auth + +添加下面两行(用于打开一次性密码认证功能): + + auth required pam_otpw.so + session optional pam_otpw.so + +![](https://farm8.staticflickr.com/7599/16775121360_d1f93feefa_b.jpg) + +#### 在 Fedora 或 CentOS/RHEL 发行版上 #### + +在基于 RedHat 的发行版中没有编译好的 OTPW,所以我们需要使用源代码来安装它。 + +首先,安装编译环境: + + $ sudo yum git gcc pam-devel + $ git clone https://www.cl.cam.ac.uk/~mgk25/git/otpw + $ cd otpw + +打开 Makefile 文件,编辑以“PAMLIB=”开头的那行配置: + +64 位系统: + + PAMLIB=/usr/lib64/security + +32 位系统: + + PAMLIB=/usr/lib/security + +编译安装。需要注意的是安装过程会把 SSH 服务重启一下,所以如果你是使用 SSH 连接到服务器,做好被断开连接的准备吧。 + + $ make + $ sudo make install + +现在你需要更新 SELinux 策略,因为 /usr/sbin/sshd 会往你的 home 目录写数据,而 SELinux 默认是不允许这么做的。如果你使用了 SELinux 服务(LCTT 注:使用 getenforce 命令查看结果,如果是 enforcing,就是打开了 SELinux 服务),如果没有使用 SELinux 服务,请跳过这一步。 + + $ sudo grep sshd /var/log/audit/audit.log | audit2allow -M mypol + $ sudo semodule -i mypol.pp + +接下来打开 PAM 配置文件(/etc/pam.d/sshd),注释下面这行(为了禁用密码认证): + + #auth substack password-auth + +添加下面两行(用于打开一次性密码认证功能): + + auth required pam_otpw.so + session optional pam_otpw.so + +#### 步骤2:配置 SSH 服务器,使用一次性密码 #### + +打开 /etc/ssh/sshd_config 文件,设置下面三个参数。你要确保下面的参数不会重复存在,否则 SSH 服务器可能会出现异常。 + + UsePrivilegeSeparation yes + ChallengeResponseAuthentication yes + UsePAM yes + +你还需要禁用默认的密码认证功能。另外可以选择开启公钥认证功能,那样的话你就可以在没有一次性密码的时候使用公钥进行认证。 + + PubkeyAuthentication yes + PasswordAuthentication no + +重启 SSH 服务器。 + +Debian, Ubuntu 或 Linux Mint 发行版: + + $ sudo service ssh restart + +Fedora 或 CentOS/RHEL 7 发行版: + + $ sudo systemctl restart sshd + +#### 步骤3:使用 OTPW 产生一次性密码 #### + +之前提到过,你需要事先创建一次性密码,并保存起来。使用 otpw-gen 命令创建密码: + + $ cd ~ + $ otpw-gen > temporary_password.txt + +![](https://farm9.staticflickr.com/8751/16961258882_c49cfe03fb_b.jpg) + +这个命令会让你输入密码前缀,当你以后登录的时候,你需要同时输入这个前缀以及一次性密码。密码前缀是另外一层保护,就算你的一次性密码表被泄漏,别人也无法通过暴力破解你的 SSH 密码。 + +设置好密码前缀后,这个命令会产生 280 个一次性密码,并将它们保存在一个文本文件中(如 temporary_password.txt)。每个密码(默认是 8 个字符)由一个 3 位十进制数索引。你需要将这个密码表打印出来,并随身携带。 + +![](https://farm8.staticflickr.com/7281/16962594055_c2696d5ae1_b.jpg) + +查看 ./.otpw 文件,它存放了一次性密码的 HASH 值。头 3 位十进制数与你随身携带的密码表的索引一一对应,在你登录 SSH 服务器的时候会被用到。 + + $ more ~/.otpw + +---------- + + OTPW1 + 280 3 12 8 + 191ai+:ENwmMqwn + 218tYRZc%PIY27a + 241ve8ns%NsHFmf + 055W4/YCauQJkr: + 102ZnJ4VWLFrk5N + 2273Xww55hteJ8Y + 1509d4b5=A64jBT + 168FWBXY%ztm9j% + 000rWUSdBYr%8UE + 037NvyryzcI+YRX + 122rEwA3GXvOk=z + +### 测试一次性密码登录 SSH 服务器 ### + +使用普通的方式登录 SSH 服务器: + + $ ssh user@remote_host + +如果 OTPW 成功运行,你会看到一点与平时登录不同的地方: + + Password 191: + +现在打开你的密码表,找到索引号为 191 的密码。 + + 023 kBvp tq/G 079 jKEw /HRM 135 oW/c /UeB 191 fOO+ PeiD 247 vAnZ EgUt + +从上表可知,191 号密码是“fOO+PeiD”。你需要加上密码前缀,比如你设置的前缀是“000”,则你实际需要输入的密码是“000fOO+PeiD”。 + +成功登录后,你这次输入的密码自动失效。查看 ~/.otpw 文件,你会发现第一行变成“---------------”,这表示 191 号密码失效了。 + + OTPW1 + 280 3 12 8 + --------------- + 218tYRZc%PIY27a + 241ve8ns%NsHFmf + 055W4/YCauQJkr: + 102ZnJ4VWLFrk5N + 2273Xww55hteJ8Y + 1509d4b5=A64jBT + 168FWBXY%ztm9j% + 000rWUSdBYr%8UE + 037NvyryzcI+YRX + 122rEwA3GXvOk=z + +### 总结 ### + +在这个教程中,我介绍了如何使用 OTPW 工具来设置一次性登录密码。你也许意识到了在这种两个因子的认证方式中,打印一张密码表让人感觉好 low,但是这种方式是最简单的,并且不用依赖任何第三方软件。无论你用哪种方式创建一次性密码,在你需要在一个不被信任的环境登录 SSH 服务器的时候,它们都很有用。你可以就这个主题来分享你的经验和观点。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/secure-ssh-login-one-time-passwords-linux.html + +作者:[Dan Nanni][a] +译者:[bazz2](https://github.com/bazz2) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/how-to-force-ssh-login-via-public-key-authentication.html +[2]:http://xmodulo.com/two-factor-authentication-ssh-login-linux.html +[3]:http://www.cl.cam.ac.uk/~mgk25/otpw.html From bd972dd5044ecd6bb0d2a7e20569379a424b280f Mon Sep 17 00:00:00 2001 From: Vic___ Date: Thu, 30 Apr 2015 14:19:41 +0800 Subject: [PATCH 030/133] translated --- ... ixgbe driver on CentOS, RHEL or Fedora.md | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/sources/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md b/sources/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md index ac871512e1..e5f8f6bcc7 100644 --- a/sources/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md +++ b/sources/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md @@ -1,61 +1,62 @@ - Vic020 +Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe -Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora ================================================================================ -> **Question**: I want to build and install the latest ixgbe 10G NIC driver. How can I compile ixgbe driver on CentOS, Fedora or RHEL? +> **提问**:我想要安装最新版的ixgbe 10G网卡驱动。在CentOS, Fedora 或 RHEL中,我应该如何编译ixgbe驱动? -To use Intel's PCI Express 10G NICs (e.g., 82598, 82599, x540) on your Linux system, you need to install ixgbe driver. While modern Linux distributions come with ixgbe driver pre-installed as a loadable module, the pre-built ixgbe driver is not fully customizable with limited parameters. If you want to enable and customize all available features of the 10G NICs (e.g., RSS, multi-queue, virtual functions, hardware offload), you will need to build the driver from the source. -Here is how to compile ixgbe driver from the source on Red Hat based platforms (e.g., CentOS, RHEL or Fedora). For Debian based systems, refer to [this guideline][1] instead. +想要在linux使用Intel的PCI Express 10G网卡(例如,82598,82599,x540),需要安装Ixgbe驱动。如今的Linux发行版都会欲安装ixgbe作为可加载模块,但是预安装的ixgbe驱动不是完整功能版。如果想要开启和定制所有10G网卡(如,RSS,多)的功能,需要源码编译安装。 -### Step One: Install Prerequisites ### +本文基于红帽系平台(如,CentOS,RHEL或Fedora)。Debian系系统,请看[这篇文章][1] -First, set up necessary developmen environment and install matching kernel headers. + +### 第一步: 安装依赖 ### + +首先,安装必要的开发环境和安装匹配的内核头 $ sudo yum install gcc make $ sudo yum install kernel-devel -### Step Two: Compile Ixgbe Driver ### +### 第二步: 编译Ixgbe ### -Download the latest ixgbe source code from the [official site][2]. +从[官方页面][2]下载最新Ixgbe源码 $ wget http://downloads.sourceforge.net/project/e1000/ixgbe%20stable/3.23.2/ixgbe-3.23.2.tar.gz -Be sure to check supported kernel versions. For example, the ixgbe driver 3.23.2 supports Linux kernel versions 2.6.18 up to 3.18.1. +确保检查支持内核版本。例如,Ixgbe3.23.2版本支持Linux内核版本2.6.18以上到3.18.1. -Extract the tarball and compile it. +提取压缩包并编译 $ tar -xvf ixgbe-3.23.2.tar.gz $ cd ixgbe-3.23.2/src $ make -If successful, the compiled driver (ixgbe.ko) will be found in the current directory. +如果成功,编译完成的驱动(ixgbe.ko)可以在当前目录找到。 -You can check the information of the compiled driver by running: +可以运行这个命令来查看编译信息: $ modinfo ./ixgbe.ko -The output will show a list of available parameters of the ixgbe driver. +将会输出一个Ixgbe驱动的可用参数列表 ![](https://farm9.staticflickr.com/8789/16429483653_b9b6e6cd7f_c.jpg) -### Step Three: Load Ixgbe Driver ### +### 第三步: 加载 Ixgbe 驱动 ### -Now you are ready to load the compiled ixgbe driver. +这步准备加载已经编译好的驱动。 -If the stock ixgbe driver is already loaded on your system, you need to unload it first. Otherwise, you won't be able to load the new ixgbe driver. +如果系统已经加载了Ixgbe驱动,首先需要卸载掉老版本。否者,新版本不能够加载。 $ sudo rmmod ixgbe.ko -Then insert the compiled driver in the kernel by running: +然后插入编译完成的驱动到内核中: $ sudo insmod ./ixgbe.ko -Optionally, you can supply any parameters while loading the driver. +同时,你可以设置启动参数 $ sudo insmod ./ixgbe.ko FdirPballoc=3 RSS=16 -To verify that the driver is loaded successfully, check the output of dmesg command. +验证驱动是否加载成功,使用dmesg命令,查看其输出 $ dmesg @@ -167,17 +168,17 @@ To verify that the driver is loaded successfully, check the output of dmesg comm eth3: no IPv6 routers present eth4: no IPv6 routers present -### Step Four: Install Ixgbe Driver ### +### 第四步: 安装Ixgbe驱动 ### -Once you have checked that the driver is loaded successfully, go ahead and install the driver on your system. +当确认驱动已经加载后,就可以安装驱动到系统中了 $ sudo make install -ixgbe.ko will be installed in the following location. +ixgbe.ko将会安装在下列目录 /lib/modules//kernel/drivers/net/ixgbe -At this point, the compiled driver will be loaded automatically upon boot, or you can load it by running: +此时,编译完蛋程序将在启动时自动加载,也可以通过运行命令加载它: $ sudo modprobe ixgbe @@ -188,7 +189,7 @@ At this point, the compiled driver will be loaded automatically upon boot, or yo via: http://ask.xmodulo.com/compile-ixgbe-driver-centos-rhel-fedora.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Vic020](http://vicyu.net) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From f8252967610c0e7cc8d7b64356a3abc63bb3f5d6 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Thu, 30 Apr 2015 14:19:54 +0800 Subject: [PATCH 031/133] translating wi-cuckoo --- ... Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md b/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md index abdca76f92..c3b1a737ce 100644 --- a/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md +++ b/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md @@ -1,3 +1,4 @@ +translating wi-cuckoo Docker 1.6 Released - How to Upgrade on Fedora / CentOS ================================================================================ Docker, a popular open source container platform for packaging applications, has a new release 1.6 with lot of new features in it. This version has updates to Docker Registry, Engine, Swarm, Compose and Machine. The release aims at improvements in performance, developer and system administrator experiences. Let us take a quick look at the new features available. @@ -164,4 +165,4 @@ via: http://linoxide.com/linux-how-to/docker-1-6-features-upgrade-fedora-centos/ [17]: [18]: [19]: -[20]: \ No newline at end of file +[20]: From 1b7a1a1f7c48ee399a2c8019a3680f85cec5c837 Mon Sep 17 00:00:00 2001 From: Vic___ Date: Thu, 30 Apr 2015 14:20:22 +0800 Subject: [PATCH 032/133] Moved --- ...wers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md (100%) diff --git a/sources/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md b/translated/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md similarity index 100% rename from sources/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md rename to translated/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md From 49eef7944d1ed9e4175d040922403b217a3ed705 Mon Sep 17 00:00:00 2001 From: chenjt Date: Thu, 30 Apr 2015 15:07:19 +0800 Subject: [PATCH 033/133] [translating by bazz2]How to set up networking between Docker containers --- ...50323 How to set up networking between Docker containers.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150323 How to set up networking between Docker containers.md b/sources/tech/20150323 How to set up networking between Docker containers.md index 7f950494be..dca3457c4e 100644 --- a/sources/tech/20150323 How to set up networking between Docker containers.md +++ b/sources/tech/20150323 How to set up networking between Docker containers.md @@ -1,3 +1,4 @@ +[bazz222] How to set up networking between Docker containers ================================================================================ As you may be aware, Docker container technology has emerged as a viable lightweight alternative to full-blown virtualization. There are a growing number of use cases of Docker that the industry adopted in different contexts, for example, enabling rapid build environment, simplifying configuration of your infrastructure, isolating applications in multi-tenant environment, and so on. While you can certainly deploy an application sandbox in a standalone Docker container, many real-world use cases of Docker in production environments may involve deploying a complex multi-tier application in an ensemble of multiple containers, where each container plays a specific role (e.g., load balancer, LAMP stack, database, UI). @@ -157,4 +158,4 @@ via: http://xmodulo.com/networking-between-docker-containers.html [2]:http://xmodulo.com/recommend/dockerbook [3]:http://xmodulo.com/manage-linux-containers-docker-ubuntu.html [4]:http://xmodulo.com/docker-containers-centos-fedora.html -[5]:http://zettio.github.io/weave/features.html \ No newline at end of file +[5]:http://zettio.github.io/weave/features.html From 4a14483874552aac8b9b08a1b2f59c758a3720b2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 1 May 2015 10:13:45 +0800 Subject: [PATCH 034/133] translating --- ... Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md b/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md index 11882847a7..8626cabdaa 100644 --- a/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md +++ b/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md @@ -1,3 +1,5 @@ +translating---geekpi + How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector ================================================================================ Apache is the most popular available web server. A web server is used basically to accept requests from clients and send responses to those requests. It gets an URL, translates it to a filename (for static requests), and sends that file back over the internet from the local disk, or it translates it to a program name, executes it, and then sends the output of that program back over the internet to the requesting party. If the web server was not able to process and complete the request, it instead returns an error message. @@ -135,4 +137,4 @@ via: http://www.unixmen.com/integrate-apache2-tomcat-7-using-mod_jk-connector/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 -[a]:http://www.unixmen.com/author/anis/ \ No newline at end of file +[a]:http://www.unixmen.com/author/anis/ From d940662076a78528f84e4e8a1c1df8e49979b70c Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Fri, 1 May 2015 10:28:30 +0800 Subject: [PATCH 035/133] Translated by DongShuaike --- ...utomated Docker-based Rails deployments.md | 254 ------------------ ...utomated Docker-based Rails deployments.md | 254 ++++++++++++++++++ 2 files changed, 254 insertions(+), 254 deletions(-) delete mode 100644 sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md create mode 100644 translated/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md diff --git a/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md b/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md deleted file mode 100644 index 9b41996378..0000000000 --- a/sources/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md +++ /dev/null @@ -1,254 +0,0 @@ -[Translating by DongShuaike] -Automated Docker-based Rails deployments -================================================================================ -![](http://cocoahunter.com/content/images/2015/01/docker3.jpeg) - -[TL;DR] This is the third post in a series of 3 on how my company moved its infrastructure from PaaS to Docker based deployment. - -- [First part][1]: where I talk about the process we went thru before approaching Docker; -- [Second part][2]: where I explain how setting up a private registry for in house secure deployments. - ----------- - -In this final part we will see how to automate the whole deployment process with a real world (though very basic) example. - -### Basic Rails app ### - -Let's dive into the topic right away and bootstrap a basic Rails app. For the purpose of this demonstration I'm going to use Ruby 2.2.0 and Rails 4.1.1 - -From the terminal run: - - $ rvm use 2.2.0 - $ rails new && cd docker-test - -Let's create a basic controller: - - $ rails g controller welcome index - -...and edit `routes.rb` so that the root of the project will point to our newly created welcome#index method: - - root 'welcome#index' - -Running `rails s` from the terminal and browsing to [http://localhost:3000][3] should bring you to the index page. We're not going to make anything fancier to the app, it's just a basic example to prove that when we'll build and deploy the container everything is working. - -### Setup the webserver ### - -We are going to use Unicorn as our webserver. Add `gem 'unicorn'` and `gem 'foreman'` to the Gemfile and bundle it up (run `bundle install` from the command line). - -Unicorn needs to be configured when the Rails app launches, so let's put a **unicorn.rb** file inside the **config** directory. [Here is an example][4] of a Unicorn configuration file. You can just copy & paste the content of the Gist. - -Let's also add a Procfile with the following content inside the root of the project so that we will be able to start the app with foreman: - - web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb - -If you now try to run the app with **foreman start** everything should work as expected and you should have a running app on [http://localhost:5000][5] - -### Building a Docker image ### - -Now let's build the image inside which our app is going to live. In the root of our Rails project, create a file named **Dockerfile** and paste in it the following: - - # Base image with ruby 2.2.0 - FROM ruby:2.2.0 - - # Install required libraries and dependencies - RUN apt-get update && apt-get install -qy nodejs postgresql-client sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/* - - # Set Rails version - ENV RAILS_VERSION 4.1.1 - - # Install Rails - RUN gem install rails --version "$RAILS_VERSION" - - # Create directory from where the code will run - RUN mkdir -p /usr/src/app - WORKDIR /usr/src/app - - # Make webserver reachable to the outside world - EXPOSE 3000 - - # Set ENV variables - ENV PORT=3000 - - # Start the web app - CMD ["foreman","start"] - - # Install the necessary gems - ADD Gemfile /usr/src/app/Gemfile - ADD Gemfile.lock /usr/src/app/Gemfile.lock - RUN bundle install --without development test - - # Add rails project (from same dir as Dockerfile) to project directory - ADD ./ /usr/src/app - - # Run rake tasks - RUN RAILS_ENV=production rake db:create db:migrate - -Using the provided Dockerfile, let's try and build an image with the following command[1][7]: - - $ docker build -t localhost:5000/your_username/docker-test . - -And again, if everything worked out correctly, the last line of the long log output should read something like: - - Successfully built 82e48769506c - $ docker images - REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE - localhost:5000/your_username/docker-test latest 82e48769506c About a minute ago 884.2 MB - -Let's try and run the container! - - $ docker run -d -p 3000:3000 --name docker-test localhost:5000/your_username/docker-test - -You should be able to reach your Rails app running inside the Docker container at port 3000 of your boot2docker VM[2][8] (in my case [http://192.168.59.103:3000][6]). - -### Automating with shell scripts ### - -Since you should already know from the previous post3 how to push your newly created image to a private regisitry and deploy it on a server, let's skip this part and go straight to automating the process. - -We are going to define 3 shell scripts and finally tie it all together with rake. - -### Clean ### - -Every time we build our image and deploy we are better off always clean everything. That means the following: - -- stop (if running) and restart boot2docker; -- remove orphaned Docker images (images that are without tags and that are no longer used by your containers). - -Put the following into a **clean.sh** file in the root of your project. - - echo Restarting boot2docker... - boot2docker down - boot2docker up - - echo Exporting Docker variables... - sleep 1 - export DOCKER_HOST=tcp://192.168.59.103:2376 - export DOCKER_CERT_PATH=/Users/user/.boot2docker/certs/boot2docker-vm - export DOCKER_TLS_VERIFY=1 - - sleep 1 - echo Removing orphaned images without tags... - docker images | grep "" | awk '{print $3}' | xargs docker rmi - -Also make sure to make the script executable: - - $ chmod +x clean.sh - -### Build ### - -The build process basically consists in reproducing what we just did before (docker build). Create a **build.sh** script at the root of your project with the following content: - - docker build -t localhost:5000/your_username/docker-test . - -Make the script executable. - -### Deploy ### - -Finally, create a **deploy.sh** script with this content: - - # Open SSH connection from boot2docker to private registry - boot2docker ssh "ssh -o 'StrictHostKeyChecking no' -i /Users/username/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@your-registry.com &" & - - # Wait to make sure the SSH tunnel is open before pushing... - echo Waiting 5 seconds before pushing image. - - echo 5... - sleep 1 - echo 4... - sleep 1 - echo 3... - sleep 1 - echo 2... - sleep 1 - echo 1... - sleep 1 - - # Push image onto remote registry / repo - echo Starting push! - docker push localhost:5000/username/docker-test - -If you don't understand what's going on here, please make sure you've read thoroughfully [part 2][9] of this series of posts. - -Make the script executable. - -### Tying it all together with rake ### - -Having 3 scripts would now require you to run them individually each time you decide to deploy your app: - -1. clean -1. build -1. deploy / push - -That wouldn't be much of an effort, if it weren't for the fact that developers are lazy! And lazy be it, then! - -The final step to wrap things up, is tying the 3 parts together with rake. - -To make things even simpler you can just append a bunch of lines of code to the end of the already present Rakefile in the root of your project. Open the Rakefile file - pun intended :) - and paste the following: - - namespace :docker do - desc "Remove docker container" - task :clean do - sh './clean.sh' - end - - desc "Build Docker image" - task :build => [:clean] do - sh './build.sh' - end - - desc "Deploy Docker image" - task :deploy => [:build] do - sh './deploy.sh' - end - end - -Even if you don't know rake syntax (which you should, because it's pretty awesome!), it's pretty obvious what we are doing. We have declared 3 tasks inside a namespace (docker). - -This will create the following 3 tasks: - -- rake docker:clean -- rake docker:build -- rake docker:deploy - -Deploy is dependent on build, build is dependent on clean. So every time we run from the command line - - $ rake docker:deploy - -All the script will be executed in the required order. - -### Test it ### - -To see if everything is working, you just need to make a small change in the code of your app and run - - $ rake docker:deploy - -and see the magic happening. Once the image has been uploaded (and the first time it could take quite a while), you can ssh into your production server and pull (thru an SSH tunnel) the docker image onto the server and run. It's that easy! - -Well, maybe it takes a while to get accustomed to how everything works, but once it does, it's almost (almost) as easy as deploying with Heroku. - -P.S. As always, please let me have your ideas. I'm not sure this is the best, or the fastest, or the safest way of doing devops with Docker, but it certainly worked out for us. - -- make sure to have **boot2docker** up and running. -- If you don't know your boot2docker VM address, just run `$ boot2docker ip` -- if you don't, you can read it [here][10] - --------------------------------------------------------------------------------- - -via: http://cocoahunter.com/2015/01/23/docker-3/ - -作者:[Michelangelo Chasseur][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://cocoahunter.com/author/michelangelo/ -[1]:http://cocoahunter.com/docker-1 -[2]:http://cocoahunter.com/2015/01/23/docker-2/ -[3]:http://localhost:3000/ -[4]:https://gist.github.com/chasseurmic/0dad4d692ff499761b20 -[5]:http://localhost:5000/ -[6]:http://192.168.59.103:3000/ -[7]:http://cocoahunter.com/2015/01/23/docker-3/#fn:1 -[8]:http://cocoahunter.com/2015/01/23/docker-3/#fn:2 -[9]:http://cocoahunter.com/2015/01/23/docker-2/ -[10]:http://cocoahunter.com/2015/01/23/docker-2/ diff --git a/translated/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md b/translated/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md new file mode 100644 index 0000000000..cd3917dfcf --- /dev/null +++ b/translated/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md @@ -0,0 +1,254 @@ + +自动化部署基于Docker的Rails应用 +================================================================================ +![](http://cocoahunter.com/content/images/2015/01/docker3.jpeg) + +[TL;DR] 这是系列文章的第三篇,讲述了我的公司是如何将基础设施从PaaS移植到Docker上的。 +- [第一部分][1]:谈论了我接触Docker之前的经历; +- [第二部分][2]:一步步搭建一个安全而又私有的registry。 +---------- +在系列文章的最后一篇里,我们将用一个实例来学习如何自动化整个部署过程。 + +### 基本的Rails应用程序### + +现在让我们启动一个基本的Rails应用。为了更好的展示,我使用Ruby 2.2.0和Rails 4.1.1 + +在终端运行: + + $ rvm use 2.2.0 + $ rails new && cd docker-test + +创建一个基础控制器: + + $ rails g controller welcome index + +……然后编辑 `routes.rb` ,以便让工程的根指向我们新创建的welcome#index方法:(这句话理解不太理解) + + root 'welcome#index' + +在终端运行 `rails s` ,然后打开浏览器,登录[http://localhost:3000][3],你会进入到索引界面当中。我们不准备给应用加上多么神奇的东西,这只是一个基础实例,用来验证当我们将要创建并部署容器的时候,一切运行正常。 + +### 安装webserver ### + +我们打算使用Unicorn当做我们的webserver。在Gemfile中添加 `gem 'unicorn'`和 `gem 'foreman'`然后将它bundle起来(运行 `bundle install`命令)。 + +在Rails应用启动的伺候,需要配置Unicorn,所以我们将一个**unicorn.rb**文件放在**config**目录下。[这里有一个Unicorn配置文件的例子][4]你可以直接复制粘贴Gist的内容。 + +Let's also add a Procfile with the following content inside the root of the project so that we will be able to start the app with foreman: +接下来,在工程的根目录下添加一个Procfile,以便可以使用foreman启动应用,内容为下: + + web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb + +现在运行**foreman start**命令启动应用,一切都将正常运行,并且你将能够在[http://localhost:5000][5]上看到一个正在运行的应用。 + +### 创建一个Docker映像 ### + +现在我们创建一个映像来运行我们的应用。在Rails工程的跟目录下,创建一个名为**Dockerfile**的文件,然后粘贴进以下内容: + + # Base image with ruby 2.2.0 + FROM ruby:2.2.0 + + # Install required libraries and dependencies + RUN apt-get update && apt-get install -qy nodejs postgresql-client sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/* + + # Set Rails version + ENV RAILS_VERSION 4.1.1 + + # Install Rails + RUN gem install rails --version "$RAILS_VERSION" + + # Create directory from where the code will run + RUN mkdir -p /usr/src/app + WORKDIR /usr/src/app + + # Make webserver reachable to the outside world + EXPOSE 3000 + + # Set ENV variables + ENV PORT=3000 + + # Start the web app + CMD ["foreman","start"] + + # Install the necessary gems + ADD Gemfile /usr/src/app/Gemfile + ADD Gemfile.lock /usr/src/app/Gemfile.lock + RUN bundle install --without development test + + # Add rails project (from same dir as Dockerfile) to project directory + ADD ./ /usr/src/app + + # Run rake tasks + RUN RAILS_ENV=production rake db:create db:migrate + +使用提供的Dockerfile,执行下列命令创建一个映像[1][7]: + + $ docker build -t localhost:5000/your_username/docker-test . + +然后,如果一切正常,长日志输出的最后一行应该类似于: + + Successfully built 82e48769506c + $ docker images + REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE + localhost:5000/your_username/docker-test latest 82e48769506c About a minute ago 884.2 MB + +来运行容器吧! + + $ docker run -d -p 3000:3000 --name docker-test localhost:5000/your_username/docker-test + +You should be able to reach your Rails app running inside the Docker container at port 3000 of your boot2docker VM[2][8] (in my case [http://192.168.59.103:3000][6]). +通过你的boot2docker虚拟机[2][8]的3000号端口(我的是[http://192.168.59.103:3000][6]),你可以观察你的Rails应用。 + +### 使用shell脚本进行自动化部署 ### + +前面的文章(指文章1和文章2)已经告诉了你如何将新创建的映像推送到私有registry中,并将其部署在服务器上,所以我们跳过这一部分直接开始自动化进程。 + +我们将要定义3个shell脚本,然后最后使用rake将它们捆绑在一起。 + +### 清除 ### + +每当我们创建映像的时候, + +- 停止并重启boot2docker; +- 去除Docker孤儿映像(那些没有标签,并且不再被容器所使用的映像们)。 + +在你的工程根目录下的**clean.sh**文件中输入下列命令。 + + echo Restarting boot2docker... + boot2docker down + boot2docker up + + echo Exporting Docker variables... + sleep 1 + export DOCKER_HOST=tcp://192.168.59.103:2376 + export DOCKER_CERT_PATH=/Users/user/.boot2docker/certs/boot2docker-vm + export DOCKER_TLS_VERIFY=1 + + sleep 1 + echo Removing orphaned images without tags... + docker images | grep "" | awk '{print $3}' | xargs docker rmi + +给脚本加上执行权限: + + $ chmod +x clean.sh + +### 创建 ### + +创建的过程基本上和之前我们所做的(docker build)内容相似。在工程的根目录下创建一个**build.sh**脚本,填写如下内容: + + docker build -t localhost:5000/your_username/docker-test . + +给脚本执行权限。 + +### 部署 ### + +最后,创建一个**deploy.sh**脚本,在里面填进如下内容: + + # Open SSH connection from boot2docker to private registry + boot2docker ssh "ssh -o 'StrictHostKeyChecking no' -i /Users/username/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@your-registry.com &" & + + # Wait to make sure the SSH tunnel is open before pushing... + echo Waiting 5 seconds before pushing image. + + echo 5... + sleep 1 + echo 4... + sleep 1 + echo 3... + sleep 1 + echo 2... + sleep 1 + echo 1... + sleep 1 + + # Push image onto remote registry / repo + echo Starting push! + docker push localhost:5000/username/docker-test + +如果你不理解这其中的含义,请先仔细阅读这部分[part 2][9]。 + +给脚本加上执行权限。 + +### 使用rake将以上所有绑定 ### + +现在的情况是,每次你想要部署你的应用时,你都需要单独运行这三个脚本。 + +1. clean +1. build +1. deploy / push + +这一点都不费工夫,可是事实上开发者比你想象的要懒得多!那么咱们就索性再懒一点! + +我们最后再把工作好好整理一番,我们现在要将三个脚本捆绑在一起,通过rake。 + +为了更简单一点,你可以在工程根目录下已经存在的Rakefile中添加几行代码,打开Rakefile文件——pun intended——把下列内容粘贴进去。 + + + namespace :docker do + desc "Remove docker container" + task :clean do + sh './clean.sh' + end + + desc "Build Docker image" + task :build => [:clean] do + sh './build.sh' + end + + desc "Deploy Docker image" + task :deploy => [:build] do + sh './deploy.sh' + end + end + +即使你不清楚rake的语法(其实你真应该去了解一下,这玩意太酷了!),上面的内容也是很显然的吧。我们在一个命名空间(docker)里声明了三个任务。 + +三个任务是: + +- rake docker:clean +- rake docker:build +- rake docker:deploy + +Deploy独立于build,build独立于clean。所以每次我们输入命令运行的时候。 + + $ rake docker:deploy + +所有的脚本都会按照顺序执行。 + +### 测试 ### + +现在我们来看看是否一切正常,你只需要在app的代码里做一个小改动: + + $ rake docker:deploy + +接下来就是见证奇迹的时刻了。一旦映像文件被上传(第一次可能花费较长的时间),你就可以ssh登录产品服务器,并且(通过SSH管道)把docker映像拉取到服务器并运行了。多么简单! + +也许你需要一段时间来习惯,但是一旦成功,它几乎与用Heroku部署一样简单。 + +备注:像往常一样,请让我了解到你的意见。我不敢保证这种方法是最好,最快,或者最安全的Docker开发的方法,但是这东西对我们确实奏效。 + +- 确保**boot2docker**已经启动并在运行当中。 +- 如果你不了解你的boot2docker虚拟地址,输入` $ boot2docker ip`命令查看。 +- 点击[here][10],教你怎样搭建私有的registry。 + +-------------------------------------------------------------------------------- + +via: http://cocoahunter.com/2015/01/23/docker-3/ + +作者:[Michelangelo Chasseur][a] +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://cocoahunter.com/author/michelangelo/ +[1]:http://cocoahunter.com/docker-1 +[2]:http://cocoahunter.com/2015/01/23/docker-2/ +[3]:http://localhost:3000/ +[4]:https://gist.github.com/chasseurmic/0dad4d692ff499761b20 +[5]:http://localhost:5000/ +[6]:http://192.168.59.103:3000/ +[7]:http://cocoahunter.com/2015/01/23/docker-3/#fn:1 +[8]:http://cocoahunter.com/2015/01/23/docker-3/#fn:2 +[9]:http://cocoahunter.com/2015/01/23/docker-2/ +[10]:http://cocoahunter.com/2015/01/23/docker-2/ From edb7d1be45af3f21e3ed26ae39b7a41fe9485663 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Fri, 1 May 2015 10:51:33 +0800 Subject: [PATCH 036/133] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Docker2=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E4=BA=9B=E5=B0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ocker-2 Setting up a private Docker registry.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md b/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md index 6e4f6e4fba..6d73b53326 100644 --- a/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md +++ b/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md @@ -128,7 +128,7 @@ Docker将会从Docker Hub上拉取所需的文件系统层(fs layers)并启动 {} -这个意味着registry工作正常。你还可以通过登录[http://localhost:5000/v1/search][8]来查看registry内容,回复相似: +这个意味着registry工作正常。你还可以通过登录[http://localhost:5000/v1/search][8]来查看registry内容,内容相似: { "num_results": 2, @@ -147,7 +147,7 @@ Docker将会从Docker Hub上拉取所需的文件系统层(fs layers)并启动 ### 创建一个映像 ### -我们现在创建一个非常简答的Docker映像,来检验我们新弄好的registry。在我们的本机上,用如下内容创建一个Dockerfile[^n]: +我们现在创建一个非常简答的Docker映像,来检验我们新弄好的registry。在我们的本机上,用如下内容创建一个Dockerfile:[^n] # Base image with ruby 2.2.0 @@ -169,7 +169,7 @@ Docker将会从Docker Hub上拉取所需的文件系统层(fs layers)并启动 你运行的docker命令都是实际上都是在boot2docker虚拟机上运行的。所以当你执行像`docker push some_repo`这样的命令时,是boot2docker虚拟机在与registry交互,而不是我们自己的机器。 -接下来是一个非常重要的点:为了将Docker映像推送到远端的私有才哭,SSH管道需要在boot2docker虚拟机上配置好。 +接下来是一个非常重要的点:为了将Docker映像推送到远端的私有仓库,SSH管道需要在boot2docker虚拟机上配置好。 由许多种方法实现它。我给你展示最简短的一种(可能不是最容易理解的,但是能够帮助你实现自动化) @@ -212,10 +212,10 @@ First of all though we need to sort one last thing with SSH. 在下一篇文章[9]中,我们将会了解到如何自动化处理这些事务,并且真正地容器化一个Rails应用。请继续收听! 如有错误,请不吝指出。祝你Docker之路顺利! 1. 我假设你使用OS X。 -1. 想要了解搭建docker环境的完整之南,请参阅[http://boot2docker.io/][10]。 -1. 本文写成时选择的是 Image > Applications > Docker 1.4.1 on 14.04。 -1. [https://github.com/docker/docker-registry/][11] -1. 这是一个存根,在下一篇文章里我将会展示给你如何将一个Rails应用绑定进Docker容器中。 +2. 想要了解搭建docker环境的完整之南,请参阅[http://boot2docker.io/][10]。 +3. 本文写成时选择的是 Image > Applications > Docker 1.4.1 on 14.04。 +4. [https://github.com/docker/docker-registry/][11] +5. 这是一个存根,在下一篇文章里我将会展示给你如何将一个Rails应用绑定进Docker容器中。 -------------------------------------------------------------------------------- From ce65089aadb0eca1f6171464291ad741be8204e9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 1 May 2015 11:01:09 +0800 Subject: [PATCH 037/133] translated --- ...e2 With Tomcat 7 Using mod_jk Connector.md | 140 ------------------ ...e2 With Tomcat 7 Using mod_jk Connector.md | 138 +++++++++++++++++ 2 files changed, 138 insertions(+), 140 deletions(-) delete mode 100644 sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md create mode 100644 translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md diff --git a/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md b/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md deleted file mode 100644 index 8626cabdaa..0000000000 --- a/sources/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md +++ /dev/null @@ -1,140 +0,0 @@ -translating---geekpi - -How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector -================================================================================ -Apache is the most popular available web server. A web server is used basically to accept requests from clients and send responses to those requests. It gets an URL, translates it to a filename (for static requests), and sends that file back over the internet from the local disk, or it translates it to a program name, executes it, and then sends the output of that program back over the internet to the requesting party. If the web server was not able to process and complete the request, it instead returns an error message. - -In this article we will list the features of Apache, and how we can integrate it with Tomcat8 and Tomcat7 using the mod_jk connector. - -### Features of Apache ### - -As we said Apache is the most popular available web server. The reasons behind its popularity are the following features: - -- It is free tool that you can download and install it easily. -- It is open source web server so you can easily see the code, adjust it, optimize it, and fix errors and security holes. New features and modules can be also added. -- It can be used for small websites of one or two pages, or huge websites of hundreds and thousands of pages, serving millions of regular visitors each month. It can serve both static and dynamic content. -- Improved caching modules (mod_cache, mod_disk_cache, mod_mem_cache). -- Apache 2 supports the Internet protocol IPv6. - -### Tomcat directory ### - -${tomcat_home} is the root directory of tomcat. Your Tomcat installation should have the following subdirectories: - -- ${tomcat_home}\conf – Where you can place various configuration files -- ${tomcat_home}\webapps – Containing example applications -- ${tomcat_home}\bin – Where you place web server plugins - -### Mod_jk module ### - -The mod_jk can be obtained in two formats: binary and source. Depending on the platform you are running your web server on, a binary version of mod_jk may be available. It is recommended to use the binary version if it is available. - -The mod_jk module was developed and tested on: - -- Linux, FreeBSD, AIX, HP-UX, MacOS X, Solaris and should work on major Unix’s platforms supporting Apache 1.3 and/or 2.x -- 0-i386 SP4/SP5/SP6a (should be able to work with other service packs), Win2K and WinXP and Win98 -- Cygwin (until you have an apache server and autoconf/automake support tools) -- Netware -- i5/OS V5R4 (System I) with Apache HTTP Server 2.0.58. Be sure to have the latest Apache PTF installed. -- Tomcat 3.2 to Tomcat 8. - -The mod_jk requires two entities: - -- **mod_jk.xxx** – The Apache HTTP Server module, depending on your operating system, it will be mod_jk.so, mod_jk.nlm or MOD_JK.SRVPGM. -- **workers.properties** – A file that describes the host and used ports by the workers (Tomcat processes). A sample workers.properties can be found under the conf directory in the source download. - -Also as with other Apache HTTP Server modules, mod_jk should be first installed on the modules directory of your Apache webserver: /usr/lib/apache and you should update your **httpd.conf** file. - -### Installation ### - -It is required to have a non-root user system with the “sudo” privileges before starting the installation. Now we will start our installation, so we will install Apache2 and Tomcat using the following command: - - sudo apt-get install apache2 - - sudo apt-get install tomcat7 - - sudo apt-get install tomcat7-admin - -And now we will create a test application for Tomcat using the following commands: - - cd /var/lib/tomcat7/webapps - sudo mkdir tomcat-demo - sudo mkdir tomcat-demo/goodmoring - sudo vim tomcat-demo/helloworld/index.jsp - -And paste the following code: - - - - Good Morning - - -

Good Morning

- Today is: <%= new java.util.Date().toString() %> - - - -Everything is okay, good now we will install and configure the mod_jk using the following command: - - sudo apt-get install libapache2-mod-jk - -We have to start by enabling the redirect port 8443 on Tomcat using the following command: - - sudo vim /etc/tomcat7/server.xml - -And we will uncomment the following line: - - - -After that, we will create our workers.properties file for Apache using the following command: - - sudo vim /etc/apache2/workers.properties - -Paste the following text: - - # Define 1 real worker using ajp13 - worker.list=worker - # Set properties for worker (ajp13) - worker.worker.type=ajp13 - worker.worker.host=localhost - worker.worker.port=8009 - -Now we will use the following command to let Apache use this worker: - - sudo vim /etc/apache2/mods-available/jk.conf - -And we will change the JkWorkersFile property to the following one; - - /etc/apache2/workers.properties - -Finally to configure the URL Apache should pass through the Tomcat - - sudo vim /etc/apache2/sites-enabled/000-default - -And we will add the following line in the configurtation file: - - - ....................................... - ....................................... - JkMount /tomcat-demo* worker1 - - -You can now restart the servers using the following commands to check their functionality: - - sudo /etc/init.d/tomcat7 restart - sudo /etc/init.d/apache2 restart - -### Conclusion ### - -In this article we showed you how to configure and install Apache2 and Tomcat 7 using the mod_jk connector. - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/integrate-apache2-tomcat-7-using-mod_jk-connector/ - -作者:[anismaj][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/anis/ diff --git a/translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md b/translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md new file mode 100644 index 0000000000..be9297c370 --- /dev/null +++ b/translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md @@ -0,0 +1,138 @@ +如何用mod_jk连接器来集成Apache2和Tomcat 7 +================================================================================ +Apache是最流行的web服务器。通常用来接收客户端的请求并响应。它得到一个URL并将它翻译成一个文件名(或者静态请求),并将文件从本地磁盘中通过因特网返回,或者将它翻译成程序名执行它,接着将输出返回给请求方。如果web服务器不能处理和完成请求,它会返回一个错误信息。 + +在本篇中,我们会列出Apache的特性以及我们该如何用mod_jk连接器来集成Tomcat7和Tomcat8. + +### Apache的特性 ### + +如我们所说Apache是最流行的web服务器。下面是流行背后的原因: + +- 它是自由工具,你可以很简单地下载和安装 +- 它开放源码因此你可以查看源码,调整它,优化它,并且修复错误和安全漏洞。也可以增加新的功能和模块。 +- 它可以用在只有一两个页面的小网站,或者是有成千上万个页面的大网站,每月处理上百万的常规访问者的请求。它可以同时处理静态和动态内容。 +- 提高的缓存模块(mod_cache、 mod_disk_cache、 mod_mem_cache)。 +- Apache 2 支持 IPv6. + +### Tomcat 目录 ### + +${tomcat_home} 是tomcat的根目录。你的tomcat安装应该有下面的子目录: + +- ${tomcat_home}\conf – 存放不同配置文件的地方 +- ${tomcat_home}\webapps – 包含示例程序 +- ${tomcat_home}\bin – 存放插件的地方 + +### Mod_jk 模块 ### + +mod_jk有两种可接受的方式:二进制或者源码。取决于你运行的web服务器的平台,二进制版本的mod_jk也许可以找到。如果有二进制版本的话建议使用这个。 + +mod_jk模块在这些平台上开发及测试过: + +- Linux、 FreeBSD、 AIX、 HP-UX、 MacOS X、 Solaris ,应该在主流的Unix平台上都支持Apache 1.3 和/或者 2.x。 +- 0-i386 SP4/SP5/SP6a (应该可以于其他的服务包一起工作), Win2K and WinXP and Win98 +- Cygwin (需要你有apache服务器及autoconf/automake支持工具) +- Netware +- i5/OS V5R4 (System I) 中的 Apache HTTP Server 2.0.58。 确保已经安装了Apache PTF +- Tomcat 3.2 到 Tomcat 8. + +The mod_jk 需要两个组件: + +- **mod_jk.xxx** – Apache HTTP服务器模块,取决于你的操作系统,它可能是mod_jk.so、mod_jk.nlm或者MOD_JK.SRVPGM。 +- **workers.properties** - 描述主机以及处理器使用的端口(Tomcat进程)。在下载的源码内可以在conf目录下找到workers.properties文件。 + +和Apache HTTP服务器其他的模块一样,mod_jk应该安装在你的Apache服务器下的模块目录下:/usr/lib/apache,你应该更新你的**httpd.conf**文件。 + +### 安装 ### + +它需要非root用户在安装钱使用“sudo”特权。现在我们开始安装,我们将使用下面的命令来安装Apache2和Tomcat: + + sudo apt-get install apache2 + + sudo apt-get install tomcat7 + + sudo apt-get install tomcat7-admin + +下面在我们将会使用下面的命令来创建一个测试程序: + + cd /var/lib/tomcat7/webapps + sudo mkdir tomcat-demo + sudo mkdir tomcat-demo/goodmoring + sudo vim tomcat-demo/helloworld/index.jsp + +粘贴下面的代码: + + + + Good Morning + + +

Good Morning

+ Today is: <%= new java.util.Date().toString() %> + + + +一切完毕后,我们将使用下面的命令安装和配置mod_jk: + + sudo apt-get install libapache2-mod-jk + +我们将使用下面的命令启用Tomcat的8443转发端口: + + sudo vim /etc/tomcat7/server.xml + +我们将解除下面的注释行: + + + +之后,我们将用下面的命令位Apache创建workers.properties文件: + + sudo vim /etc/apache2/workers.properties + +粘贴下面的行: + + # Define 1 real worker using ajp13 + worker.list=worker + # Set properties for worker (ajp13) + worker.worker.type=ajp13 + worker.worker.host=localhost + worker.worker.port=8009 + +现在我们将使用下面的命令来让Apache使用这个worker: + + sudo vim /etc/apache2/mods-available/jk.conf + +我们将JkWorkersFile属性成下面这行: + + /etc/apache2/workers.properties + +最后配置Apache交给Tomcat处理的URL + + sudo vim /etc/apache2/sites-enabled/000-default + +我们将在配置文件中下面的行: + + + ....................................... + ....................................... + JkMount /tomcat-demo* worker1 + + +现在用下面的命令重启服务来检查它们的功能: + + sudo /etc/init.d/tomcat7 restart + sudo /etc/init.d/apache2 restart + +### 总结 ### + +在本篇中我们展示了你该如何使用mod_jk连接器配置和安装Apache2以及Tomcat7。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/integrate-apache2-tomcat-7-using-mod_jk-connector/ + +作者:[anismaj][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/anis/ From e263f7a46df9c51b5395f3eb519344cf73e3e1dc Mon Sep 17 00:00:00 2001 From: VicYu Date: Fri, 1 May 2015 11:10:48 +0800 Subject: [PATCH 038/133] Update 20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md --- ...swers--How to configure PCI-passthrough on virt-manager.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md b/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md index f90070d34a..4703e96d38 100644 --- a/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md +++ b/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md @@ -1,3 +1,5 @@ +Vic020 + Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager ================================================================================ > **Question**: I would like to dedicate a physical network interface card to one of my guest VMs created by KVM. For that, I am trying to enable PCI passthrough of the NIC for the VM. How can I add a PCI device to a guest VM with PCI passthrough on virt-manager? @@ -52,4 +54,4 @@ via: http://ask.xmodulo.com/pci-passthrough-virt-manager.html [a]:http://ask.xmodulo.com/author/nanni [1]:http://wiki.xenproject.org/wiki/VTdHowTo -[2]:http://xmodulo.com/add-kernel-boot-parameters-via-grub-linux.html \ No newline at end of file +[2]:http://xmodulo.com/add-kernel-boot-parameters-via-grub-linux.html From 140d2e80a1310fc65db6b4165c7dcc2e79cde9f3 Mon Sep 17 00:00:00 2001 From: Mo Date: Fri, 1 May 2015 14:05:45 +0800 Subject: [PATCH 039/133] [translating]The history of Android -15 --- .../14 - The history of Android.md | 84 ------------------- .../15 - The history of Android.md | 4 +- 2 files changed, 3 insertions(+), 85 deletions(-) delete mode 100644 sources/talk/The history of Android/14 - The history of Android.md diff --git a/sources/talk/The history of Android/14 - The history of Android.md b/sources/talk/The history of Android/14 - The history of Android.md deleted file mode 100644 index 3377527026..0000000000 --- a/sources/talk/The history of Android/14 - The history of Android.md +++ /dev/null @@ -1,84 +0,0 @@ -alim0x translating - -The history of Android -================================================================================ -### Voice Actions—a supercomputer in your pocket ### - -In August 2010, a new feature “[Voice Actions][1]" launched in the Android Market as part of the Voice Search app. Voice Actions allowed users to issue voice commands to their phone, and Android would try to interpret them and do something smart. Something like "Navigate to [address]" would fire up Google Maps and start turn-by-turn navigation to your stated destination. You could also send texts or e-mails, make a call, open a Website, get directions, or view a location on a map—all just by speaking. - -注:youtube视频地址 - - -Voice Actions was the culmination of a new app design philosophy for Google. Voice Actions was the most advanced voice control software for its time, and the secret was that Google wasn’t doing any computing on the device. In general, voice recognition was very CPU intensive. In fact, many voice recognition programs still have a “speed versus accuracy" setting, where users can choose how long they are willing to wait for the voice recognition algorithms to work—more CPU power means better accuracy. - -Google’s innovation was not bothering to do the voice recognition computing on the phone’s limited processor. When a command was spoken, the user’s voice was packaged up and shipped out over the Internet to Google’s cloud servers. There, Google’s farm of supercomputers pored over the message, interpreted it, and shipped it back to the phone. It was a long journey, but the Internet was finally fast enough to accomplish something like this in a second or two. - -Many people throw the phrase “cloud computing" around to mean “anything that is stored on a server," but this was actual cloud computing. Google was doing hardcore compute operations in the cloud, and because it is throwing a ridiculous amount of CPU power at the problem, the only limit to the voice recognition accuracy is the algorithms themselves. The software didn't need to be individually “trained" by each user, because everyone who used Voice Actions was training it all the time. Using the power of the Internet, Android put a supercomputer in your pocket, and, compared to existing solutions, moving the voice recognition workload from a pocket-sized computer to a room-sized computer greatly increased accuracy. - -Voice recognition had been a project of Google’s for some time, and it all started with an 800 number. [1-800-GOOG-411][1] was a free phone information service that Google launched in April 2007. It worked just like 411 information services had for years—users could call the number and ask for a phone book lookup—but Google offered it for free. No humans were involved in the lookup process, the 411 service was powered by voice recognition and a text-to-speech engine. Voice Actions was only possible after three years of the public teaching Google how to hear. - -Voice recognition was a great example of Google’s extremely long-term thinking—the company wasn't afraid to invest in a project that wouldn’t become a commercial product for several years. Today, voice recognition powers products all across Google. It’s used for voice input in the Google Search app, Android’s voice typing, and on Google.com. It’s also the primary input interface for Google Glass and [Android Wear][2]. - -The company even uses it beyond input. Google's voice recognition technology is used to transcribe YouTube videos, which powers automatic closed captioning for the hearing impaired. The transcription is even indexed by Google, so you can search for words that were said in the video. Voice is the future of many products, and this long-term planning has led Google to be one of the few major tech companies with an in-house voice recognition service. Most other voice recognition products, like Apple’s Siri and Samsung devices, are forced to use—and pay a license fee for—voice recognition from Nuance. - -With the computer hearing system up and running, Google is applying this strategy to computer vision next. That's why things like Google Goggles, Google Image Search, and [Project Tango][3] exist. Just like the days of GOOG-411, these projects are in the early stages. When [Google's robot division][4] gets off the ground with a real robot, it will need to see and hear, and Google's computer vision and hearing projects will likely give the company a head start. - -![The Nexus S, the first Nexus phone made by Samsung.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/NS500.png) -The Nexus S, the first Nexus phone made by Samsung. - -### Android 2.3 Gingerbread—the first major UI overhaul ### - -Gingerbread was released in December 2010, a whopping seven months after the release of 2.2. The wait was worth it, though, as Android 2.3 changed just about every screen in the OS. It was the first major overhaul since the initial formation of Android in version 0.9. 2.3 would kick off a series of continual revamps in an attempt to turn Android from an ugly duckling into something that was capable of holding its own—aesthetically—against the iPhone. - -And speaking of Apple, six months earlier, the company released the iPhone 4 and iOS 4, which added multitasking and Facetime video chat. Microsoft was finally back in the game, too. The company jumped into the modern smartphone era with the launch of Windows Phone 7 in November 2010. - -Android 2.3 focused a lot on the interface design, but with no direction or design documents, many apps ended up getting a new bespoke theme. Some apps went with a flatter, darker theme, some used a gradient-filled, bubbly dark theme, and others went with a high-contrast white and green look. While it wasn't cohesive, Gingerbread accomplished the goal of modernizing nearly every part of the OS. It was a good thing, too, because the next phone version of Android wouldn’t arrive until nearly a year later. - -Gingerbread’s launch device was the Nexus S, Google’s second flagship device and the first Nexus manufactured by Samsung. While today we are used to new CPU models every year, back then that wasn't the case. The Nexus S had a 1GHz Cortex A8 processor, just like the Nexus One. The GPU was slightly faster, and that was it in the speed department. It was a little bigger than the Nexus One, with a 4-inch, 800×480 AMOLED display. - -Spec wise, the Nexus S might seem like a tame upgrade, but it was actually home to a lot of firsts for Android. The Nexus S was Google’s first flagship to shun a MicroSD slot, shipping with 16GB on-board memory. The Nexus One had only 512MB of storage, but it had a MicroSD slot. Removing the SD slot simplified storage management for users—there was just one pool now—but hurt expandability for power users. It was also Google's first phone to have NFC, a special chip in the back of the phone that could transfer information when touched to another NFC chip. For now, the Nexus S could only read NFC tags—it couldn't send data. - -Thanks to some upgrades in Gingerbread, the Nexus S was one of the first Android phones to ship without a hardware D-Pad or trackball. The Nexus S was now down to just the power, volume, and the four navigation buttons. The Nexus S was also a precursor to the [crazy curved-screen phones][6] of today, as Samsung outfitted the Nexus S with a piece of slightly curved glass. - -![Gingerbread changed the status bar and wallpaper, and it added a bunch of new icons.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/appdrawershop.png) -Gingerbread changed the status bar and wallpaper, and it added a bunch of new icons. -Photo by Ron Amadeo - -An upgraded "Nexus" live wallpaper was released as an exclusive addition to the Nexus S. It was basically the same idea as the Nexus One version, with its animated streaks of light. On the Nexus S, the "grid" design was removed and replaced with a wavy blue/gray background. The dock at the bottom was given square corners and colored icons. - -![The new notification panel and menu.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/32.png) -The new notification panel and menu. -Photo by Ron Amadeo - -The status bar was finally overhauled from the version that first debuted in 0.9. The bar was changed from a white gradient to flat black, and all the icons were redrawn in gray and green. Just about everything looked crisper and more modern thanks to the sharp-angled icon design and higher resolution. The strangest decisions were probably the removal of the time period from the status bar clock and the confusing shade of gray that was used for the signal bars. Despite gray being used for many status bar icons, and there being four gray bars in the above screenshot, Android was actually indicating no cellular signal. Green bars would indicate a signal, gray bars indicated “empty" signal slots. - -The green status bar icons in Gingerbread also doubled as a status indicator of network connectivity. If you had a working connection to Google's servers, the icons would be green, if there was no connection to Google, the icons turned white. This let you easily identify the connectivity status of your connection while you were out and about. - -The notification panel was changed from the aging Android 1.5 design. Again, we saw a UI piece that changed from a light theme to a dark theme, getting a dark gray header, black background, and black-on-gray text. - -The menu was darkened too, changing from a white background to a black one with a slight transparency. The contrast between the menu icons and the background wasn’t as strong as it should be, because the gray icons are the same color as they were on the white background. Requiring a color change would mean every developer would have to make new icons, so Google went with the preexisting gray color on black. This was a change at the system level, so this new menu would show up in every app. - ----------- - -![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg) - -[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work. - -[@RonAmadeo][t] - --------------------------------------------------------------------------------- - -via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/14/ - -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://arstechnica.com/gadgets/2010/08/google-beefs-up-voice-search-mobile-sync/ -[2]:http://arstechnica.com/business/2007/04/google-rolls-out-free-411-service/ -[3]:http://arstechnica.com/gadgets/2014/03/in-depth-with-android-wear-googles-quantum-leap-of-a-smartwatch-os/ -[4]:http://arstechnica.com/gadgets/2014/02/googles-project-tango-is-a-smartphone-with-kinect-style-computer-vision/ -[5]:http://arstechnica.com/gadgets/2013/12/google-robots-former-android-chief-will-lead-google-robotics-division/ -[6]:http://arstechnica.com/gadgets/2013/12/lg-g-flex-review-form-over-even-basic-function/ -[a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo diff --git a/sources/talk/The history of Android/15 - The history of Android.md b/sources/talk/The history of Android/15 - The history of Android.md index 078e106d1c..9ca4176245 100644 --- a/sources/talk/The history of Android/15 - The history of Android.md +++ b/sources/talk/The history of Android/15 - The history of Android.md @@ -1,3 +1,5 @@ +alim0x translating + The history of Android ================================================================================ ![Gingerbread's new keyboard, text selection UI, overscroll effect, and new checkboxes.](http://cdn.arstechnica.net/wp-content/uploads/2014/02/3kb-high-over-check.png) @@ -83,4 +85,4 @@ via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-histor 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://arstechnica.com/author/ronamadeo -[t]:https://twitter.com/RonAmadeo \ No newline at end of file +[t]:https://twitter.com/RonAmadeo From 3a1a3791ffe994500f0a24e5e99396f33c676986 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 1 May 2015 18:27:00 +0800 Subject: [PATCH 040/133] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201504?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...xaile 3.4.1 Overview--A Feature-Complete GNOME Music Player.md | 0 .../20141204 Intense Gameplay--Try these 13 Roguelike games.md | 0 ...rld WordPress Benchmarks with PHP5.5 PHP5.6 PHP-NG and HHVM.md | 0 ... to Install Cherokee Lightweight Web Server on Ubuntu 14.04.md | 0 ... to Remember and Restore Running Applications on Next Logon.md | 0 ...How are C data types “supported directly by most computers”.md | 0 published/{ => 201504}/20150128 Docker-1 Moving to Docker.md | 0 ...50202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md | 0 .../20150202 tespeed - Python Tool To Test Your Internet Speed.md | 0 ...ll Linux-dash Web Based Monitoring System In CentOS or RHEL.md | 0 ...0205 25 Linux Shell Scripting interview Questions & Answers.md | 0 ...150205 How To Install or Configure VNC Server On CentOS 7.0.md | 0 ... A WordPress Website Security Using WPScan, Nmap, And Nikto.md | 0 ...20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md | 0 ...lashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md | 0 ...x 'fatal error--x264.h--No such file or directory' on Linux.md | 0 .../20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md | 0 ...50211 Simple Steps Migration From MySQL To MariaDB On Linux.md | 0 ...lyze and view Apache web server logs interactively on Linux.md | 0 ...w to share files between computers over network with btsync.md | 0 ... error--lame or lame.h--No such file or directory' on Linux.md | 0 ...s with Answers--How to install a USB webcam in Raspberry Pi.md | 0 ...ple who start writing kernel code get hired really quickly'.md | 0 published/{ => 201504}/20150227 Chess in a Few Bytes.md | 0 ...0150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md | 0 ...4 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md | 0 published/{ => 201504}/20150306 Nmap--Not Just for Evil.md | 0 ...20150309 10 Useful 'ls' Command Interview Questions--Part 2.md | 0 ...50309 15 Interview Questions on Linux 'ls ' Command--Part 1.md | 0 .../20150310 4 Linux Based Mini PC You Can Buy In 2015.md | 0 ...50310 How To Get Email Alerts for SSH Login on Linux Server.md | 0 ...ow to convert between local time and UNIX timestamp in Perl.md | 0 .../{ => 201504}/20150318 Fedora GNOME Keyboard Shortcuts.md | 0 .../20150318 Install And Use 'Go For It!' To Do App In Linux.md | 0 published/{ => 201504}/20150318 The future of Linux storage.md | 0 .../{ => 201504}/20150323 Papyrus--An Open Source Note Manager.md | 0 .../20150323 Red Hat Developer Toolset 3.1 beta arrives.md | 0 ...0324 How to Install Telegram Messenger Application on Linux.md | 0 .../20150324 Prips--Print IP address on a given range.md | 0 .../{ => 201504}/20150326 Mydumper--Mysql Database Backup tool.md | 0 .../{ => 201504}/20150330 Picty--Managing Photos Made Easy.md | 0 .../20150402 The VirtualBox 5.0 beta is finally here.md | 0 .../20150409 How to Run GUI Apps in a Docker Container.md | 0 ...50410 10 Famous IT Skills in Demand That Will Get You Hired.md | 0 ...ntary OS 0.3 Freya Screenshots - Download and Install Guide.md | 0 ... Linux Kernel 4.0 Features Live Kernel Patching PS3 Support.md | 0 ...c Key Pinning Extension HPKP for Apache, NGINX and Lighttpd.md | 0 ... Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md | 0 ... Most Popular Programming Languages in to GitHub Since 2012.md | 0 ...Things to Do After Minimal RHEL or CentOS 7 Installation--1.md | 0 ...Things to Do After Minimal RHEL or CentOS 7 Installation--2.md | 0 ...Things to Do After Minimal RHEL or CentOS 7 Installation--3.md | 0 published/{ => 201504}/Debian 8 Jessie released.md | 0 .../{ => 201504}/GNOME-Pie 0.6 Application Launcher Released.md | 0 ... to create a custom backup plan for Debian with backupninja.md | 0 55 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201504}/20141106 Exaile 3.4.1 Overview--A Feature-Complete GNOME Music Player.md (100%) rename published/{ => 201504}/20141204 Intense Gameplay--Try these 13 Roguelike games.md (100%) rename published/{ => 201504}/20141226 Real-World WordPress Benchmarks with PHP5.5 PHP5.6 PHP-NG and HHVM.md (100%) rename published/{ => 201504}/20150119 How to Install Cherokee Lightweight Web Server on Ubuntu 14.04.md (100%) rename published/{ => 201504}/20150119 How to Remember and Restore Running Applications on Next Logon.md (100%) rename published/{ => 201504}/20150122 How are C data types “supported directly by most computers”.md (100%) rename published/{ => 201504}/20150128 Docker-1 Moving to Docker.md (100%) rename published/{ => 201504}/20150202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md (100%) rename published/{ => 201504}/20150202 tespeed - Python Tool To Test Your Internet Speed.md (100%) rename published/{ => 201504}/20150203 How To Install Linux-dash Web Based Monitoring System In CentOS or RHEL.md (100%) rename published/{ => 201504}/20150205 25 Linux Shell Scripting interview Questions & Answers.md (100%) rename published/{ => 201504}/20150205 How To Install or Configure VNC Server On CentOS 7.0.md (100%) rename published/{ => 201504}/20150205 How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto.md (100%) rename published/{ => 201504}/20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md (100%) rename published/{ => 201504}/20150209 Install the Gnome Flashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md (100%) rename published/{ => 201504}/20150209 Linux FAQs with Answers--How to fix 'fatal error--x264.h--No such file or directory' on Linux.md (100%) rename published/{ => 201504}/20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md (100%) rename published/{ => 201504}/20150211 Simple Steps Migration From MySQL To MariaDB On Linux.md (100%) rename published/{ => 201504}/20150215 How to analyze and view Apache web server logs interactively on Linux.md (100%) rename published/{ => 201504}/20150215 How to share files between computers over network with btsync.md (100%) rename published/{ => 201504}/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md (100%) rename published/{ => 201504}/20150225 Linux FAQs with Answers--How to install a USB webcam in Raspberry Pi.md (100%) rename published/{ => 201504}/20150225 Torvalds--'People who start writing kernel code get hired really quickly'.md (100%) rename published/{ => 201504}/20150227 Chess in a Few Bytes.md (100%) rename published/{ => 201504}/20150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md (100%) rename published/{ => 201504}/20150304 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md (100%) rename published/{ => 201504}/20150306 Nmap--Not Just for Evil.md (100%) rename published/{ => 201504}/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md (100%) rename published/{ => 201504}/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md (100%) rename published/{ => 201504}/20150310 4 Linux Based Mini PC You Can Buy In 2015.md (100%) rename published/{ => 201504}/20150310 How To Get Email Alerts for SSH Login on Linux Server.md (100%) rename published/{ => 201504}/20150316 Linux FAQs with Answers--How to convert between local time and UNIX timestamp in Perl.md (100%) rename published/{ => 201504}/20150318 Fedora GNOME Keyboard Shortcuts.md (100%) rename published/{ => 201504}/20150318 Install And Use 'Go For It!' To Do App In Linux.md (100%) rename published/{ => 201504}/20150318 The future of Linux storage.md (100%) rename published/{ => 201504}/20150323 Papyrus--An Open Source Note Manager.md (100%) rename published/{ => 201504}/20150323 Red Hat Developer Toolset 3.1 beta arrives.md (100%) rename published/{ => 201504}/20150324 How to Install Telegram Messenger Application on Linux.md (100%) rename published/{ => 201504}/20150324 Prips--Print IP address on a given range.md (100%) rename published/{ => 201504}/20150326 Mydumper--Mysql Database Backup tool.md (100%) rename published/{ => 201504}/20150330 Picty--Managing Photos Made Easy.md (100%) rename published/{ => 201504}/20150402 The VirtualBox 5.0 beta is finally here.md (100%) rename published/{ => 201504}/20150409 How to Run GUI Apps in a Docker Container.md (100%) rename published/{ => 201504}/20150410 10 Famous IT Skills in Demand That Will Get You Hired.md (100%) rename published/{ => 201504}/20150413 Elementary OS 0.3 Freya Screenshots - Download and Install Guide.md (100%) rename published/{ => 201504}/20150413 Linux Kernel 4.0 Features Live Kernel Patching PS3 Support.md (100%) rename published/{ => 201504}/20150415 HTTP Public Key Pinning Extension HPKP for Apache, NGINX and Lighttpd.md (100%) rename published/{ => 201504}/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md (100%) rename published/{ => 201504}/20150423 The Most Popular Programming Languages in to GitHub Since 2012.md (100%) rename published/{ => 201504}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md (100%) rename published/{ => 201504}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md (100%) rename published/{ => 201504}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md (100%) rename published/{ => 201504}/Debian 8 Jessie released.md (100%) rename published/{ => 201504}/GNOME-Pie 0.6 Application Launcher Released.md (100%) rename published/{ => 201504}/How to create a custom backup plan for Debian with backupninja.md (100%) diff --git a/published/20141106 Exaile 3.4.1 Overview--A Feature-Complete GNOME Music Player.md b/published/201504/20141106 Exaile 3.4.1 Overview--A Feature-Complete GNOME Music Player.md similarity index 100% rename from published/20141106 Exaile 3.4.1 Overview--A Feature-Complete GNOME Music Player.md rename to published/201504/20141106 Exaile 3.4.1 Overview--A Feature-Complete GNOME Music Player.md diff --git a/published/20141204 Intense Gameplay--Try these 13 Roguelike games.md b/published/201504/20141204 Intense Gameplay--Try these 13 Roguelike games.md similarity index 100% rename from published/20141204 Intense Gameplay--Try these 13 Roguelike games.md rename to published/201504/20141204 Intense Gameplay--Try these 13 Roguelike games.md diff --git a/published/20141226 Real-World WordPress Benchmarks with PHP5.5 PHP5.6 PHP-NG and HHVM.md b/published/201504/20141226 Real-World WordPress Benchmarks with PHP5.5 PHP5.6 PHP-NG and HHVM.md similarity index 100% rename from published/20141226 Real-World WordPress Benchmarks with PHP5.5 PHP5.6 PHP-NG and HHVM.md rename to published/201504/20141226 Real-World WordPress Benchmarks with PHP5.5 PHP5.6 PHP-NG and HHVM.md diff --git a/published/20150119 How to Install Cherokee Lightweight Web Server on Ubuntu 14.04.md b/published/201504/20150119 How to Install Cherokee Lightweight Web Server on Ubuntu 14.04.md similarity index 100% rename from published/20150119 How to Install Cherokee Lightweight Web Server on Ubuntu 14.04.md rename to published/201504/20150119 How to Install Cherokee Lightweight Web Server on Ubuntu 14.04.md diff --git a/published/20150119 How to Remember and Restore Running Applications on Next Logon.md b/published/201504/20150119 How to Remember and Restore Running Applications on Next Logon.md similarity index 100% rename from published/20150119 How to Remember and Restore Running Applications on Next Logon.md rename to published/201504/20150119 How to Remember and Restore Running Applications on Next Logon.md diff --git a/published/20150122 How are C data types “supported directly by most computers”.md b/published/201504/20150122 How are C data types “supported directly by most computers”.md similarity index 100% rename from published/20150122 How are C data types “supported directly by most computers”.md rename to published/201504/20150122 How are C data types “supported directly by most computers”.md diff --git a/published/20150128 Docker-1 Moving to Docker.md b/published/201504/20150128 Docker-1 Moving to Docker.md similarity index 100% rename from published/20150128 Docker-1 Moving to Docker.md rename to published/201504/20150128 Docker-1 Moving to Docker.md diff --git a/published/20150202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md b/published/201504/20150202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md similarity index 100% rename from published/20150202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md rename to published/201504/20150202 How to Bind Apache Tomcat to IPv4 in Centos or Redhat.md diff --git a/published/20150202 tespeed - Python Tool To Test Your Internet Speed.md b/published/201504/20150202 tespeed - Python Tool To Test Your Internet Speed.md similarity index 100% rename from published/20150202 tespeed - Python Tool To Test Your Internet Speed.md rename to published/201504/20150202 tespeed - Python Tool To Test Your Internet Speed.md diff --git a/published/20150203 How To Install Linux-dash Web Based Monitoring System In CentOS or RHEL.md b/published/201504/20150203 How To Install Linux-dash Web Based Monitoring System In CentOS or RHEL.md similarity index 100% rename from published/20150203 How To Install Linux-dash Web Based Monitoring System In CentOS or RHEL.md rename to published/201504/20150203 How To Install Linux-dash Web Based Monitoring System In CentOS or RHEL.md diff --git a/published/20150205 25 Linux Shell Scripting interview Questions & Answers.md b/published/201504/20150205 25 Linux Shell Scripting interview Questions & Answers.md similarity index 100% rename from published/20150205 25 Linux Shell Scripting interview Questions & Answers.md rename to published/201504/20150205 25 Linux Shell Scripting interview Questions & Answers.md diff --git a/published/20150205 How To Install or Configure VNC Server On CentOS 7.0.md b/published/201504/20150205 How To Install or Configure VNC Server On CentOS 7.0.md similarity index 100% rename from published/20150205 How To Install or Configure VNC Server On CentOS 7.0.md rename to published/201504/20150205 How To Install or Configure VNC Server On CentOS 7.0.md diff --git a/published/20150205 How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto.md b/published/201504/20150205 How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto.md similarity index 100% rename from published/20150205 How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto.md rename to published/201504/20150205 How To Scan And Check A WordPress Website Security Using WPScan, Nmap, And Nikto.md diff --git a/published/20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md b/published/201504/20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md similarity index 100% rename from published/20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md rename to published/201504/20150209 Fix Cannot Empty Trash In Ubuntu 14.04 [Quick Tip].md diff --git a/published/20150209 Install the Gnome Flashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md b/published/201504/20150209 Install the Gnome Flashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md similarity index 100% rename from published/20150209 Install the Gnome Flashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md rename to published/201504/20150209 Install the Gnome Flashback classical desktop on Ubuntu 14.10 or Linux Mint 17.md diff --git a/published/20150209 Linux FAQs with Answers--How to fix 'fatal error--x264.h--No such file or directory' on Linux.md b/published/201504/20150209 Linux FAQs with Answers--How to fix 'fatal error--x264.h--No such file or directory' on Linux.md similarity index 100% rename from published/20150209 Linux FAQs with Answers--How to fix 'fatal error--x264.h--No such file or directory' on Linux.md rename to published/201504/20150209 Linux FAQs with Answers--How to fix 'fatal error--x264.h--No such file or directory' on Linux.md diff --git a/published/20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md b/published/201504/20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md similarity index 100% rename from published/20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md rename to published/201504/20150211 Install Mumble in Ubuntu an Opensource VoIP Apps.md diff --git a/published/20150211 Simple Steps Migration From MySQL To MariaDB On Linux.md b/published/201504/20150211 Simple Steps Migration From MySQL To MariaDB On Linux.md similarity index 100% rename from published/20150211 Simple Steps Migration From MySQL To MariaDB On Linux.md rename to published/201504/20150211 Simple Steps Migration From MySQL To MariaDB On Linux.md diff --git a/published/20150215 How to analyze and view Apache web server logs interactively on Linux.md b/published/201504/20150215 How to analyze and view Apache web server logs interactively on Linux.md similarity index 100% rename from published/20150215 How to analyze and view Apache web server logs interactively on Linux.md rename to published/201504/20150215 How to analyze and view Apache web server logs interactively on Linux.md diff --git a/published/20150215 How to share files between computers over network with btsync.md b/published/201504/20150215 How to share files between computers over network with btsync.md similarity index 100% rename from published/20150215 How to share files between computers over network with btsync.md rename to published/201504/20150215 How to share files between computers over network with btsync.md diff --git a/published/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md b/published/201504/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md similarity index 100% rename from published/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md rename to published/201504/20150225 Linux FAQs with Answers--How to fix 'fatal error--lame or lame.h--No such file or directory' on Linux.md diff --git a/published/20150225 Linux FAQs with Answers--How to install a USB webcam in Raspberry Pi.md b/published/201504/20150225 Linux FAQs with Answers--How to install a USB webcam in Raspberry Pi.md similarity index 100% rename from published/20150225 Linux FAQs with Answers--How to install a USB webcam in Raspberry Pi.md rename to published/201504/20150225 Linux FAQs with Answers--How to install a USB webcam in Raspberry Pi.md diff --git a/published/20150225 Torvalds--'People who start writing kernel code get hired really quickly'.md b/published/201504/20150225 Torvalds--'People who start writing kernel code get hired really quickly'.md similarity index 100% rename from published/20150225 Torvalds--'People who start writing kernel code get hired really quickly'.md rename to published/201504/20150225 Torvalds--'People who start writing kernel code get hired really quickly'.md diff --git a/published/20150227 Chess in a Few Bytes.md b/published/201504/20150227 Chess in a Few Bytes.md similarity index 100% rename from published/20150227 Chess in a Few Bytes.md rename to published/201504/20150227 Chess in a Few Bytes.md diff --git a/published/20150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md b/published/201504/20150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md similarity index 100% rename from published/20150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md rename to published/201504/20150302 How to Setup Passwordless SSH Logon to Ubuntu 14.04.md diff --git a/published/20150304 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md b/published/201504/20150304 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md similarity index 100% rename from published/20150304 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md rename to published/201504/20150304 How To Fix 'Not Enough Free Disk Space On boot' In Ubuntu.md diff --git a/published/20150306 Nmap--Not Just for Evil.md b/published/201504/20150306 Nmap--Not Just for Evil.md similarity index 100% rename from published/20150306 Nmap--Not Just for Evil.md rename to published/201504/20150306 Nmap--Not Just for Evil.md diff --git a/published/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md b/published/201504/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md similarity index 100% rename from published/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md rename to published/201504/20150309 10 Useful 'ls' Command Interview Questions--Part 2.md diff --git a/published/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md b/published/201504/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md similarity index 100% rename from published/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md rename to published/201504/20150309 15 Interview Questions on Linux 'ls ' Command--Part 1.md diff --git a/published/20150310 4 Linux Based Mini PC You Can Buy In 2015.md b/published/201504/20150310 4 Linux Based Mini PC You Can Buy In 2015.md similarity index 100% rename from published/20150310 4 Linux Based Mini PC You Can Buy In 2015.md rename to published/201504/20150310 4 Linux Based Mini PC You Can Buy In 2015.md diff --git a/published/20150310 How To Get Email Alerts for SSH Login on Linux Server.md b/published/201504/20150310 How To Get Email Alerts for SSH Login on Linux Server.md similarity index 100% rename from published/20150310 How To Get Email Alerts for SSH Login on Linux Server.md rename to published/201504/20150310 How To Get Email Alerts for SSH Login on Linux Server.md diff --git a/published/20150316 Linux FAQs with Answers--How to convert between local time and UNIX timestamp in Perl.md b/published/201504/20150316 Linux FAQs with Answers--How to convert between local time and UNIX timestamp in Perl.md similarity index 100% rename from published/20150316 Linux FAQs with Answers--How to convert between local time and UNIX timestamp in Perl.md rename to published/201504/20150316 Linux FAQs with Answers--How to convert between local time and UNIX timestamp in Perl.md diff --git a/published/20150318 Fedora GNOME Keyboard Shortcuts.md b/published/201504/20150318 Fedora GNOME Keyboard Shortcuts.md similarity index 100% rename from published/20150318 Fedora GNOME Keyboard Shortcuts.md rename to published/201504/20150318 Fedora GNOME Keyboard Shortcuts.md diff --git a/published/20150318 Install And Use 'Go For It!' To Do App In Linux.md b/published/201504/20150318 Install And Use 'Go For It!' To Do App In Linux.md similarity index 100% rename from published/20150318 Install And Use 'Go For It!' To Do App In Linux.md rename to published/201504/20150318 Install And Use 'Go For It!' To Do App In Linux.md diff --git a/published/20150318 The future of Linux storage.md b/published/201504/20150318 The future of Linux storage.md similarity index 100% rename from published/20150318 The future of Linux storage.md rename to published/201504/20150318 The future of Linux storage.md diff --git a/published/20150323 Papyrus--An Open Source Note Manager.md b/published/201504/20150323 Papyrus--An Open Source Note Manager.md similarity index 100% rename from published/20150323 Papyrus--An Open Source Note Manager.md rename to published/201504/20150323 Papyrus--An Open Source Note Manager.md diff --git a/published/20150323 Red Hat Developer Toolset 3.1 beta arrives.md b/published/201504/20150323 Red Hat Developer Toolset 3.1 beta arrives.md similarity index 100% rename from published/20150323 Red Hat Developer Toolset 3.1 beta arrives.md rename to published/201504/20150323 Red Hat Developer Toolset 3.1 beta arrives.md diff --git a/published/20150324 How to Install Telegram Messenger Application on Linux.md b/published/201504/20150324 How to Install Telegram Messenger Application on Linux.md similarity index 100% rename from published/20150324 How to Install Telegram Messenger Application on Linux.md rename to published/201504/20150324 How to Install Telegram Messenger Application on Linux.md diff --git a/published/20150324 Prips--Print IP address on a given range.md b/published/201504/20150324 Prips--Print IP address on a given range.md similarity index 100% rename from published/20150324 Prips--Print IP address on a given range.md rename to published/201504/20150324 Prips--Print IP address on a given range.md diff --git a/published/20150326 Mydumper--Mysql Database Backup tool.md b/published/201504/20150326 Mydumper--Mysql Database Backup tool.md similarity index 100% rename from published/20150326 Mydumper--Mysql Database Backup tool.md rename to published/201504/20150326 Mydumper--Mysql Database Backup tool.md diff --git a/published/20150330 Picty--Managing Photos Made Easy.md b/published/201504/20150330 Picty--Managing Photos Made Easy.md similarity index 100% rename from published/20150330 Picty--Managing Photos Made Easy.md rename to published/201504/20150330 Picty--Managing Photos Made Easy.md diff --git a/published/20150402 The VirtualBox 5.0 beta is finally here.md b/published/201504/20150402 The VirtualBox 5.0 beta is finally here.md similarity index 100% rename from published/20150402 The VirtualBox 5.0 beta is finally here.md rename to published/201504/20150402 The VirtualBox 5.0 beta is finally here.md diff --git a/published/20150409 How to Run GUI Apps in a Docker Container.md b/published/201504/20150409 How to Run GUI Apps in a Docker Container.md similarity index 100% rename from published/20150409 How to Run GUI Apps in a Docker Container.md rename to published/201504/20150409 How to Run GUI Apps in a Docker Container.md diff --git a/published/20150410 10 Famous IT Skills in Demand That Will Get You Hired.md b/published/201504/20150410 10 Famous IT Skills in Demand That Will Get You Hired.md similarity index 100% rename from published/20150410 10 Famous IT Skills in Demand That Will Get You Hired.md rename to published/201504/20150410 10 Famous IT Skills in Demand That Will Get You Hired.md diff --git a/published/20150413 Elementary OS 0.3 Freya Screenshots - Download and Install Guide.md b/published/201504/20150413 Elementary OS 0.3 Freya Screenshots - Download and Install Guide.md similarity index 100% rename from published/20150413 Elementary OS 0.3 Freya Screenshots - Download and Install Guide.md rename to published/201504/20150413 Elementary OS 0.3 Freya Screenshots - Download and Install Guide.md diff --git a/published/20150413 Linux Kernel 4.0 Features Live Kernel Patching PS3 Support.md b/published/201504/20150413 Linux Kernel 4.0 Features Live Kernel Patching PS3 Support.md similarity index 100% rename from published/20150413 Linux Kernel 4.0 Features Live Kernel Patching PS3 Support.md rename to published/201504/20150413 Linux Kernel 4.0 Features Live Kernel Patching PS3 Support.md diff --git a/published/20150415 HTTP Public Key Pinning Extension HPKP for Apache, NGINX and Lighttpd.md b/published/201504/20150415 HTTP Public Key Pinning Extension HPKP for Apache, NGINX and Lighttpd.md similarity index 100% rename from published/20150415 HTTP Public Key Pinning Extension HPKP for Apache, NGINX and Lighttpd.md rename to published/201504/20150415 HTTP Public Key Pinning Extension HPKP for Apache, NGINX and Lighttpd.md diff --git a/published/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md b/published/201504/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md similarity index 100% rename from published/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md rename to published/201504/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md diff --git a/published/20150423 The Most Popular Programming Languages in to GitHub Since 2012.md b/published/201504/20150423 The Most Popular Programming Languages in to GitHub Since 2012.md similarity index 100% rename from published/20150423 The Most Popular Programming Languages in to GitHub Since 2012.md rename to published/201504/20150423 The Most Popular Programming Languages in to GitHub Since 2012.md diff --git a/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md b/published/201504/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md similarity index 100% rename from published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md rename to published/201504/30 Things to Do After Minimal RHEL or CentOS 7 Installation--1.md diff --git a/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md b/published/201504/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md similarity index 100% rename from published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md rename to published/201504/30 Things to Do After Minimal RHEL or CentOS 7 Installation--2.md diff --git a/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md b/published/201504/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md similarity index 100% rename from published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md rename to published/201504/30 Things to Do After Minimal RHEL or CentOS 7 Installation--3.md diff --git a/published/Debian 8 Jessie released.md b/published/201504/Debian 8 Jessie released.md similarity index 100% rename from published/Debian 8 Jessie released.md rename to published/201504/Debian 8 Jessie released.md diff --git a/published/GNOME-Pie 0.6 Application Launcher Released.md b/published/201504/GNOME-Pie 0.6 Application Launcher Released.md similarity index 100% rename from published/GNOME-Pie 0.6 Application Launcher Released.md rename to published/201504/GNOME-Pie 0.6 Application Launcher Released.md diff --git a/published/How to create a custom backup plan for Debian with backupninja.md b/published/201504/How to create a custom backup plan for Debian with backupninja.md similarity index 100% rename from published/How to create a custom backup plan for Debian with backupninja.md rename to published/201504/How to create a custom backup plan for Debian with backupninja.md From 9b3307eaa89c6aecb2158b79c7847af98f451906 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 1 May 2015 18:27:42 +0800 Subject: [PATCH 041/133] PUB:30 Things to Do After Minimal RHEL or CentOS 7 Installation--4 @ictlyh --- ...inimal RHEL or CentOS 7 Installation--4.md | 92 +++++++++++-------- 1 file changed, 53 insertions(+), 39 deletions(-) rename {translated/tech => published}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md (56%) diff --git a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md similarity index 56% rename from translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md rename to published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md index f73d1e9b3b..b6d7ae7f10 100644 --- a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md +++ b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--4.md @@ -1,55 +1,59 @@ -安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情--4 +安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(四) ================================================================================ ### 17. 安装 Webmin ### -Webmin 是基于 Web 的 Linux 配置工具。它像一个中央系统用于配置各种系统设置,比如用户、磁盘分配、服务以及 HTTP 服务器、Apache、MySQL 等的配置。 +Webmin 是基于 Web 的 Linux 配置工具。它像一个中央系统,用于配置各种系统设置,比如用户、磁盘分配、服务以及 HTTP 服务器、Apache、MySQL 等的配置。 # wget http://prdownloads.sourceforge.net/webadmin/webmin-1.740-1.noarch.rpm # rpm -ivh webmin-*.rpm ![在 CentOS 7 上安装 Webmin](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Webmin.jpeg) -安装 Webmin -安装完 webmin 后,你会在终端上得到一个用你的 root 密码在 端口 10000 登录你的主机(http://ip-address:10000)的信息。 如果运行的是无头服务器(译注:无头服务器是指没有专门用于向其它计算机和它们的用户提供服务的本地接口的计算设备)你可以转发端口然后从有头机器/服务器上访问它。 +*安装 Webmin* + +安装完 webmin 后,你会在终端上得到一个消息,提示你用 root 密码在端口 10000 登录你的主机 (http://ip-address:10000)。 如果运行的是无接口的服务器你可以转发端口然后从有接口的服务器上访问它。(LCTT 译注:无接口[headless]服务器指没有访问接口或界面的服务器,在此次场景,指的是是出于内网的服务器,可采用外网/路由器映射来访问该端口) ### 18. 启用第三方库 ### -添加不受信任的库并不是一个好主意,尤其是在生产环境中,这可能导致致命的问题。但仅作为例子在这里我们会添加一些社区证实可信任的库用于安装第三方工具和软件包。 +添加不受信任的库并不是一个好主意,尤其是在生产环境中,这可能导致致命的问题。但仅作为例子在这里我们会添加一些社区证实可信任的库,以安装第三方工具和软件包。 -为企业版 Linux(EPEL)库添加额外的软件包。 +为企业版 Linux(EPEL)库添加额外的软件包。 # yum install epel-release -添加社区企业版 Linux 库 +添加社区企业版 Linux (Community Enterprise Linux)库: # rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm ![安装 Epel 库](http://www.tecmint.com/wp-content/uploads/2015/04/install-epel-repo.jpeg) -安装 Epel 库 -**注意**! 添加第三方库的时候尤其需要注意。 +*安装 Epel 库* + +**注意!** 添加第三方库的时候尤其需要注意。 ### 19. 安装 7-zip 工具 ### -在最小化安装 CentOS 时你并没有获得类似 unzip 或者 untar 的工具。我们可以选择基于需要安装每个工具或者一个能处理所有格式的工具。7-zip 就是一个能压缩和解压所有已知类型文件的工具。 +在最小化安装 CentOS 时你并没有获得类似 unzip 或者 untar 的工具。我们可以选择根据需要来安装每个工具,或一个能处理所有格式的工具。7-zip 就是一个能压缩和解压所有已知类型文件的工具。 # yum install p7zip ![安装 7zip 工具](http://www.tecmint.com/wp-content/uploads/2015/04/Install-7zip-tool.jpeg) -安装 7zip 工具 + +*安装 7zip 工具* **注意**: 该软件包从 Fedora EPEL 7 的库中下载和安装。 ### 20. 安装 NTFS-3G 驱动 ### -NTFS-3G,一个很小但非常有用的 NTFS 驱动在大部分类 UNIX 发行版上都可用。它对于挂载和访问 Windows NTFS 文件系统很有用。尽管也有其它可用的替代品,比如 Tuxera,但 NTFS-3G 是使用最广泛的。 +NTFS-3G,一个很小但非常有用的 NTFS 驱动,在大部分类 UNIX 发行版上都可用。它对于挂载和访问 Windows NTFS 文件系统很有用。尽管也有其它可用的替代品,比如 Tuxera,但 NTFS-3G 是使用最广泛的。 # yum install ntfs-3g ![在 CentOS 上安装 NTFS-3G](http://www.tecmint.com/wp-content/uploads/2015/04/Install-NTFS-3G.jpeg) -安装 NTFS-3G 用于挂载 Windows 分区 -ntfs-3g 安装完成之后,你可以使用以下命令挂载 Windows NTFS 分区(我的 Windows 分区是 /dev/sda5)。 +*安装 NTFS-3G 用于挂载 Windows 分区* + +ntfs-3g 安装完成之后,你可以使用以下命令挂载 Windows NTFS 分区(我的 Windows 分区是 /dev/sda5)。 # mount -ro ntfs-3g /dev/sda5 /mnt # cd /mnt @@ -62,25 +66,26 @@ VSFTPD 表示 Very Secure File Transfer Protocol Daemon,是用于类 UNIX 系 # yum install vsftpd ![在 CentOS 7 上安装 Vsftpd](http://www.tecmint.com/wp-content/uploads/2015/04/Install-FTP.jpeg) -安装 Vsftpd FTP + +*安装 Vsftpd FTP* 编辑配置文件 ‘/etc/vsftpd/vsftpd.conf’ 用于保护 vsftpd。 # vi /etc/vsftpd/vsftpd.conf -编辑一些值并使其它保留原样,除非你知道自己在做什么。 +编辑一些值并使其它行保留原样,除非你知道自己在做什么。 anonymous_enable=NO local_enable=YES write_enable=YES chroot_local_user=YES -你也可以更改端口号并使 vsftpd 端口通过防火墙。 +你也可以更改端口号,记得让 vsftpd 端口通过防火墙。 # firewall-cmd --add-port=21/tcp # firewall-cmd --reload -下一步重启 vsftpd 并启用随机启动。 +下一步重启 vsftpd 并启用开机自动启动。 # systemctl restart vsftpd # systemctl enable vsftpd @@ -91,32 +96,33 @@ sudo 通常被称为 super do 或者 suitable user do,是一个类 UNIX 操作 # visudo -打开要编辑的文件 /etc/sudoers +这会打开 /etc/sudoers 并进行编辑 ![sudoers 文件](http://www.tecmint.com/wp-content/uploads/2015/04/sudoers-File.jpeg) -sudoers 文件 -给一个已经创建的用户(比如 tecmint)赋予所有权限(等同于 root)。 +*sudoers 文件* - tecmint ALL=(ALL) ALL +1. 给一个已经创建好的用户(比如 tecmint)赋予所有权限(等同于 root)。 -给一个已经创建的用户(比如 tecmint)赋予除重启和关闭服务器以外的所有权限(等同于 root)。 + tecmint ALL=(ALL) ALL -再一次打开文件并用下面的内容编辑文件。 +2. 如果给一个已经创建好的用户(比如 tecmint)赋予除了重启和关闭服务器以外的所有权限(等同于 root)。 - cmnd_Alias nopermit = /sbin/shutdown, /sbin/reboot + 首先,再一次打开文件并编辑如下内容: -用 逻辑操作符(!) 添加别名。 + cmnd_Alias nopermit = /sbin/shutdown, /sbin/reboot - tecmint ALL=(ALL) ALL,!nopermit + 然后,用逻辑操作符(!)添加该别名。 -准许一个组(比如 debian) 运行一些 root 权限命令,比如(增加或删除用户)。 + tecmint ALL=(ALL) ALL,!nopermit - cmnd_Alias permit = /usr/sbin/useradd, /usr/sbin/userdel +3. 如果准许一个组(比如 debian)运行一些 root 权限命令,比如(增加或删除用户)。 -给组 debian 增加权限。 + cmnd_Alias permit = /usr/sbin/useradd, /usr/sbin/userdel - debian ALL=(ALL) permit + 然后,给组 debian 增加权限。 + + debian ALL=(ALL) permit ### 23. 安装并启用 SELinux ### @@ -125,24 +131,28 @@ SELinux 表示 Security-Enhanced Linux,是内核级别的安全模块。 # yum install selinux-policy ![在 CentOS 7 上安装 SElinux](http://www.tecmint.com/wp-content/uploads/2015/04/Install-SElinux.jpeg) -安装 SElinux 策略 -查看 SELinux 模式。 +*安装 SElinux 策略* + +查看 SELinux 当前模式。 # getenforce ![查看 SELinux 模式](http://www.tecmint.com/wp-content/uploads/2015/04/Check-SELinux-Mode.jpeg) -查看 SELinux 模式 + +*查看 SELinux 模式* 输出是 Enforcing,意味着 SELinux 策略已经生效。 -为了调试,可以临时设置 selinux 模式为允许。不需要重启。 +如果需要调试,可以临时设置 selinux 模式为允许。不需要重启。 # setenforce 0 调试完了之后再次设置 selinux 为强制模式,无需重启。 # setenforce 1 + +(LCTT 译注:在生产环境中,SELinux 固然会提升安全,但是也确实会给应用部署和运行带来不少麻烦。具体是否部署,需要根据情况而定。) ### 24. 安装 Rootkit Hunter ### @@ -151,17 +161,21 @@ Rootkit Hunter,简写为 RKhunter,是在 Linux 系统中扫描 rootkits 和 # yum install rkhunter ![安装 Rootkit Hunter](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Rootkit-Hunter.jpeg) -安装 Rootkit Hunter + +*安装 Rootkit Hunter* 在 Linux 中,从脚本文件以计划作业的形式运行 rkhunter 或者手动扫描有害攻击。 # rkhunter --check ![扫描 rootkits](http://www.tecmint.com/wp-content/uploads/2015/04/Scan-for-rootkits.png) -扫描 rootkits + +*扫描 rootkits* ![RootKit 扫描结果](http://www.tecmint.com/wp-content/uploads/2015/04/RootKit-Results.png) -RootKit 扫描结果 + +*RootKit 扫描结果* + -------------------------------------------------------------------------------- @@ -169,7 +183,7 @@ via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installatio 作者:[Avishek Kumar][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From d1656d459bdcde8a82f5f00c3019f42d50ba762b Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 1 May 2015 21:32:36 +0800 Subject: [PATCH 042/133] PUB:30 Things to Do After Minimal RHEL or CentOS 7 Installation--5 @ictlyh --- ...inimal RHEL or CentOS 7 Installation--5.md | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) rename {translated/tech => published}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md (73%) diff --git a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md similarity index 73% rename from translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md rename to published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md index 9845595af0..446d6c663d 100644 --- a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md +++ b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--5.md @@ -1,8 +1,8 @@ -安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情--5 +安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(五) ================================================================================ ### 25. 安装 Linux Malware Detect (LMD) ### -Linux Malware Detect (LMD) 是 GNU GPLv2 协议下发布的开源 Linux 恶意程序扫描器,尤其是为面临威胁的主机环境。LMD 完整的安装、配置以及使用方法可以查看: +Linux Malware Detect (LMD) 是 GNU GPLv2 协议下发布的开源 Linux 恶意程序扫描器,它是特别为面临威胁的主机环境所设计的。LMD 完整的安装、配置以及使用方法可以查看: - [安装 LMD 并和 ClamAV 一起使用作为反病毒引擎][1] @@ -10,9 +10,9 @@ Linux Malware Detect (LMD) 是 GNU GPLv2 协议下发布的开源 Linux 恶意 speedtest-cli 是用 python 写的用于测试网络下载和上传带宽的工具。关于 speedtest-cli 工具的完整安装和使用请阅读我们的文章[用命令行查看 Linux 服务器带宽][2] -### 27. 配置 Cron 作业 ### +### 27. 配置 Cron 任务 ### -这是最广泛使用的软件工具之一。它是一个作业调度器,比如,现在安排一个以后可以自动运行的作业。它对于日志、保存没有实现的记录以及其它日常工作,比如常规备份,非常有用。所有的调度都写在文件 /etc/crontab 中。 +这是最广泛使用的软件工具之一。它是一个任务调度器,比如,现在安排一个以后可以自动运行的作业。它用于未处理记录的日志和维护,以及其它日常工作,比如常规备份。所有的调度都写在文件 /etc/crontab 中。 crontab 文件包含下面的 6 个域: @@ -20,18 +20,19 @@ crontab 文件包含下面的 6 个域: (0-59) (0-23) (1-31) (1/jan-12/dec) (0-6/sun-sat) Command/script ![Crontab 域](http://www.tecmint.com/wp-content/uploads/2015/04/Crontab-Fields.jpeg) -Crontab 域 -在每天 04:30 运行一个 cron 作业(比如运行 /home/$USER/script.sh)。 +*Crontab 域* + +要在每天 04:30 运行一个 cron 任务(比如运行 /home/$USER/script.sh)。 分 时 日期 月份 星期 命令 30 4 * * * speedtest-cli -把下面的条目增加到 crontab 文件 ‘/etc/crontab/’。 +就把下面的条目增加到 crontab 文件 ‘/etc/crontab/’。 30 4 * * * /home/$user/script.sh -把上面一行增加到 crontab 之后,它会在每天的 04:30 am 自动运行,输出取决于脚本文件的内容。另外脚本也可以用命令代替。关于更多 cron 作业的例子,可以阅读[Linux 上的 11 个 Cron 作业例子][3] +把上面一行增加到 crontab 之后,它会在每天的 04:30 am 自动运行,输出取决于脚本文件的内容。另外脚本也可以用命令代替。关于更多 cron 任务的例子,可以阅读[Linux 上的 11 个 Cron 任务例子][3] ### 28. 安装 Owncloud ### @@ -41,12 +42,13 @@ Owncloud 是一个基于 HTTP 的数据同步、文件共享和远程文件存 虚拟化是创建虚拟操作系统、硬件和网络的过程,是当今最热门的技术之一。我们会详细地讨论如何安装和配置虚拟化。 -我们的最小化 CentOS 服务器是一个无头服务器(译注:无头服务器是指没有专门用于向其它计算机和它们的用户提供服务的本地接口的计算设备)。我们通过安装下面的软件包为它承载可通过 HTTP 访问的虚拟机器做准备。 +我们的最小化 CentOS 服务器是一个无用户界面服务器(LCTT 译注:无用户界面[headless]服务器指没有监视器和鼠标键盘等外设的服务器)。我们通过安装下面的软件包,让它可以托管虚拟机,虚拟机可通过 HTTP 访问。 # yum groupinstall 'Development Tools' SDL kernel-devel kernel-headers dkms ![安装开发工具](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Development-Tool.jpeg) -安装开发工具 + +*安装开发工具* 更改工作目录到 ‘/etc/yum.repos.d/’ 并下载 VirtualBox 库。 @@ -66,10 +68,12 @@ Owncloud 是一个基于 HTTP 的数据同步、文件共享和远程文件存 # VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.12-93733.vbox-extpack ![安装 VirtualBox 扩展包](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Virtualbox-Extension-Pack.jpeg) -安装 VirtualBox 扩展包 + +*安装 VirtualBox 扩展包* ![正在安装 VirtualBox 扩展包](http://www.tecmint.com/wp-content/uploads/2015/04/Installing-Virtualbox-Extension-Pack.jpeg) -正在安装 VirtualBox 扩展包 + +*正在安装 VirtualBox 扩展包* 添加用户 ‘vbox’ 用于管理 VirtualBox 并把它添加到组 vboxusers 中。 @@ -81,11 +85,11 @@ Owncloud 是一个基于 HTTP 的数据同步、文件共享和远程文件存 # yum install httpd -安装 PHP (有 soap 扩展)。 +安装 PHP (支持 soap 扩展)。 # yum install php php-devel php-common php-soap php-gd -下载 PHP virtualBox. +下载 phpVirtualBox(一个 PHP 写的开源的 VirtualBox 用户界面)。 # wget http://sourceforge.net/projects/phpvirtualbox/files/phpvirtualbox-4.3-1.zip @@ -107,15 +111,17 @@ Owncloud 是一个基于 HTTP 的数据同步、文件共享和远程文件存 # service vbox-service restart # service httpd restart -转发端口并从一个有头服务器上访问它。 +转发端口并从一个有用户界面的服务器上访问它。 http://192.168.0.15/phpvirtualbox-4.3-1/ ![登录 PHP Virtualbox](http://www.tecmint.com/wp-content/uploads/2015/04/PHP-Virtualbox-Login.png) -登录 PHP Virtualbox + +*登录 PHP Virtualbox* ![PHP Virtualbox 面板](http://www.tecmint.com/wp-content/uploads/2015/04/PHP-Virtualbox.png) -PHP Virtualbox 面板 + +*PHP Virtualbox 面板* -------------------------------------------------------------------------------- @@ -123,12 +129,12 @@ via: http://www.tecmint.com/things-to-do-after-minimal-rhel-centos-7-installatio 作者:[Avishek Kumar][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/install-linux-malware-detect-lmd-in-rhel-centos-and-fedora/ -[2]:http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/ +[1]:https://linux.cn/article-5156-1.html +[2]:https://linux.cn/article-3796-1.html [3]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ -[4]:http://www.tecmint.com/install-owncloud-to-create-personal-storage-in-linux/ \ No newline at end of file +[4]:https://linux.cn/article-2494-1.html \ No newline at end of file From a9040f696dadbf92729f7995631a8984c905ecc7 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 1 May 2015 21:44:52 +0800 Subject: [PATCH 043/133] PUB:30 Things to Do After Minimal RHEL or CentOS 7 Installation--6 @ictlyh --- ...inimal RHEL or CentOS 7 Installation--6.md | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) rename {translated/tech => published}/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md (72%) diff --git a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md similarity index 72% rename from translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md rename to published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md index b9b86ba04a..c2c00c95a6 100644 --- a/translated/tech/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md +++ b/published/30 Things to Do After Minimal RHEL or CentOS 7 Installation--6.md @@ -1,26 +1,27 @@ -安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情--6 +安装完最小化 RHEL/CentOS 7 后需要做的 30 件事情(六) ================================================================================ ### 30. 用密码保护 GRUB ### -用密码保护你的 boot 引导程序这样你就可以在启动时获得额外水平的安全保障。同时你也可以在物理水平获得保护层。通过在引导时给 GRUB 加锁防止任何无授权访问来保护你的服务器。 +用密码保护你的 boot 引导程序这样你就可以在启动时获得额外的安全保障。同时你也可以在实物层面获得保护。通过在引导时给 GRUB 加锁防止任何无授权访问来保护你的服务器。 首先备份两个文件,这样如果有任何错误出现,你可以有回滚的选择。备份 ‘/etc/grub2/grub.cfg’ 为 ‘/etc/grub2/grub.cfg.old’。 # cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.old -同样,备份 ‘/etc/grub.d/10_linux’ 为 ‘/etc/grub.d/10_linux.old’。(这里10_linux下划线不知道怎么弄,请校对的时候注意改正,thx) +同样,备份 ‘/etc/grub.d/10\_linux’ 为 ‘/etc/grub.d/10\_linux.old’。 # cp /etc/grub.d/10_linux /etc/grub.d/10_linux.old -打开文件 ‘/etc/grub.d/10_linux’ 并在文件末尾添加下面一行。 +打开文件 ‘/etc/grub.d/10\_linux’ 并在文件末尾添加下列行。 cat < Date: Fri, 1 May 2015 10:14:17 -0500 Subject: [PATCH 044/133] KevinSJ Translating --- .../share/20150407 10 Truly Amusing Easter Eggs in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md index 6d02c4cfbb..413d50d6d6 100644 --- a/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md +++ b/sources/share/20150407 10 Truly Amusing Easter Eggs in Linux.md @@ -1,3 +1,4 @@ +KevinSJ translating 10 Truly Amusing Easter Eggs in Linux ================================================================================ ![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG) @@ -151,4 +152,4 @@ via: http://www.linux.com/news/software/applications/820944-10-truly-amusing-lin [13]:http://nmap.org/book/output-formats-script-kiddie.html [14]:http://nmap.org/book/output-formats-script-kiddie.html [15]:https://www.youtube.com/watch?v=Ql1uLyuWra8 -[16]:http://en.wikipedia.org/wiki/Neko_%28computer_program%29 \ No newline at end of file +[16]:http://en.wikipedia.org/wiki/Neko_%28computer_program%29 From c7430d4f139defcd6398f200105d04c1e0d6b974 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 2 May 2015 10:32:21 +0800 Subject: [PATCH 045/133] PUB:20150417 14 Useful Examples of Linux 'sort' Command--Part 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @cvsher 翻译的文字组织的很不错,看得出来已经结合自己的 sort 命令使用经验。 --- ...xamples of Linux 'sort' Command--Part 1.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) rename translated/tech/[translated]20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md => published/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md (63%) diff --git a/translated/tech/[translated]20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md b/published/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md similarity index 63% rename from translated/tech/[translated]20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md rename to published/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md index 9653302530..c483c4035f 100644 --- a/translated/tech/[translated]20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md +++ b/published/20150417 14 Useful Examples of Linux 'sort' Command--Part 1.md @@ -1,24 +1,24 @@ -Linux ‘sort’命令的14个有用的范例 -- 第一部分 +Linux 的 ‘sort’命令的14个有用的范例(一) ============================================================= Sort是用于对单个或多个文本文件内容进行排序的Linux程序。Sort命令以空格作为字段分隔符,将一行分割为多个关键字对文件进行排序。需要注意的是除非你将输出重定向到文件中,否则Sort命令并不对文件内容进行实际的排序(即文件内容没有修改),只是将文件内容按有序输出。 本文的目标是通过14个实际的范例让你更深刻的理解如何在Linux中使用sort命令。 -###1. 首先我们将会创建一个用于执行‘sort’命令的文本文件(tecmint.txt)。工作路径是‘/home/$USER/Desktop/tecmint’。### +1、 首先我们将会创建一个用于执行‘sort’命令的文本文件(tecmint.txt)。工作路径是‘/home/$USER/Desktop/tecmint’。 -下面命令中的‘-e’选项将‘/’和‘/n’解析成一个新行 +下面命令中的‘-e’选项将启用‘\\’转义,将‘\n’解析成换行 $ echo -e "computer\nmouse\nLAPTOP\ndata\nRedHat\nlaptop\ndebian\nlaptop" > tecmint.txt ![Split String by Lines in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Split-String-by-Lines.gif) -###2. 在开始学习‘sort’命令前,我们先看看文件的内容及其显示方式。### +2、 在开始学习‘sort’命令前,我们先看看文件的内容及其显示方式。 $ cat tecmint.txt ![Check Content of File](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Content-of-File.gif) -###3. 现在,使用如下命令对文件内容进行排序。### +3、 现在,使用如下命令对文件内容进行排序。 $ sort tecmint.txt @@ -26,30 +26,30 @@ Sort是用于对单个或多个文本文件内容进行排序的Linux程序。So **注意**:上面的命令并不对文件内容进行实际的排序,仅仅是将其内容按有序方式输出。 -###4. 对文件‘tecmint.txt’文件内容排序,并将排序后的内容输出到名为sorted.txt的文件中,然后使用[cat][1]命令查看验证sorted.txt文件的内容。### +4、 对文件‘tecmint.txt’文件内容排序,并将排序后的内容输出到名为sorted.txt的文件中,然后使用[cat][1]命令查看验证sorted.txt文件的内容。 $ sort tecmint.txt > sorted.txt $ cat sorted.txt ![Sort File Content in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-File-Content.gif) -###5. 现在使用‘-r’参数对‘tecmint.txt’文件内容进行逆序排序,并将输出内容重定向到‘reversesorted.txt’文件中,并使用cat命令查看文件的内容。### +5、 现在使用‘-r’参数对‘tecmint.txt’文件内容进行逆序排序,并将输出内容重定向到‘reversesorted.txt’文件中,并使用cat命令查看文件的内容。 $ sort -r tecmint.txt > reversesorted.txt $ cat reversesorted.txt ![Sort Content By Reverse](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-By-Reverse.gif) -###6. 创建一个新文件(lsl.txt),文件内容为在home目录下执行‘ls -l’命令的输出。### +6、 创建一个新文件(lsl.txt),文件内容为在home目录下执行‘ls -l’命令的输出。 $ ls -l /home/$USER > /home/$USER/Desktop/tecmint/lsl.txt $ cat lsl.txt ![Populate Output of Home Directory](http://www.tecmint.com/wp-content/uploads/2015/04/Populate-Output.gif) -我们将会看到对其他基础字段进行排序的例子,而不是对默认的初始字符进行排序。 +我们将会看到对其他字段进行排序的例子,而不是对默认的开始字符进行排序。 -###7. 基于第二列(符号连接的数量)对文件‘lsl.txt’进行排序。### +7、 基于第二列(符号连接的数量)对文件‘lsl.txt’进行排序。 $ sort -nk2 lsl.txt @@ -57,19 +57,19 @@ Sort是用于对单个或多个文本文件内容进行排序的Linux程序。So ![Sort Content by Column](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-by-Column.gif) -###8. 基于第9列(文件和目录的名称,非数值)对文件‘lsl.txt’进行排序。### +8、 基于第9列(文件和目录的名称,非数值)对文件‘lsl.txt’进行排序。 $ sort -k9 lsl.txt ![Sort Content Based on Column](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-Based-on-Column.gif) -###9. sort命令并非仅能对文件进行排序,我们还可以通过管道将命令的输出内容重定向到sort命令中。### +9、 sort命令并非仅能对文件进行排序,我们还可以通过管道将命令的输出内容重定向到sort命令中。 $ ls -l /home/$USER | sort -nk5 ![Sort Content Using Pipe Option](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-By-Pipeline.gif) -###10. 对文件tecmint.txt进行排序,并删除重复的行。然后检查重复的行是否已经删除了。### +10、 对文件tecmint.txt进行排序,并删除重复的行。然后检查重复的行是否已经删除了。 $ cat tecmint.txt $ sort -u tecmint.txt @@ -78,23 +78,23 @@ Sort是用于对单个或多个文本文件内容进行排序的Linux程序。So 目前我们发现的排序规则: - 除非指定了‘-r’参数,否则排序的优先级按下面规则排序 +除非指定了‘-r’参数,否则排序的优先级按下面规则排序 + - 以数字开头的行优先级最高 - 以小写字母开头的行优先级次之 - 待排序内容按字典序进行排序 - - 默认情况下,‘sort’命令将带排序内容的每行关键字当作一个字符串进行字典序排序(数字优先级最高,参看规则 - 1) + - 默认情况下,‘sort’命令将带排序内容的每行关键字当作一个字符串进行字典序排序(数字优先级最高,参看规则 1) - -###11. 创建文件‘lsla.txt’,其内容用‘ls -la’命令的输出内容填充。### +11、 在当前位置创建第三个文件‘lsla.txt’,其内容用‘ls -lA’命令的输出内容填充。 $ ls -lA /home/$USER > /home/$USER/Desktop/tecmint/lsla.txt $ cat lsla.txt ![Populate Output With Hidden Files](http://www.tecmint.com/wp-content/uploads/2015/04/Populate-Output-With-Hidden-Files.gif) -了解ls命令的读者都知道‘ls -la’=‘ls -l’ + 隐藏文件。因此这两个文件的大部分内容都是相同的。 +了解ls命令的读者都知道‘ls -lA’ 等于 ‘ls -l’ + 隐藏文件,所以这两个文件的大部分内容都是相同的。 -###12. 对上面两个文件内容进行排序输出。### +12、 对上面两个文件内容进行排序输出。 $ sort lsl.txt lsla.txt @@ -102,7 +102,7 @@ Sort是用于对单个或多个文本文件内容进行排序的Linux程序。So 注意文件和目录的重复 -###13. 现在我们看看怎样对两个文件进行排序、合并,并且删除重复行。### +13、 现在我们看看怎样对两个文件进行排序、合并,并且删除重复行。 $ sort -u lsl.txt lsla.txt @@ -110,13 +110,13 @@ Sort是用于对单个或多个文本文件内容进行排序的Linux程序。So 此时,我们注意到重复的行已经被删除了,我们可以将输出内容重定向到文件中。 -###14. 我们同样可以基于多列对文件内容进行排序。基于第2,5(数值)和9(非数值)列对‘ls -l’命令的输出进行排序。### +14、 我们同样可以基于多列对文件内容进行排序。基于第2,5(数值)和9(非数值)列对‘ls -l’命令的输出进行排序。 $ ls -l /home/$USER | sort -t "," -nk2,5 -k9 ![Sort Content By Field Column](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-By-Field-Column.gif) -先到此为止了,在接下来的文章中我们将会学习到‘sort’命令更多的详细例子。届时敬请关注Tecmint。保持分享精神。若喜欢本文,敬请将本文分享给你的朋友。 +先到此为止了,在接下来的文章中我们将会学习到‘sort’命令更多的详细例子。届时敬请关注我们。保持分享精神。若喜欢本文,敬请将本文分享给你的朋友。 -------------------------------------------------------------------------------- @@ -124,7 +124,7 @@ via: http://www.tecmint.com/sort-command-linux/ 作者:[Avishek Kumar][a] 译者:[cvsher](https://github.com/cvsher) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 16a662924cb3eb651a1bfcae6f9a7c7fd192cfd2 Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 2 May 2015 10:57:36 +0800 Subject: [PATCH 046/133] PUB:20150420 7 Interesting Linux 'sort' Command Examples--Part 2 @DongShuaike --- ...g Linux 'sort' Command Examples--Part 2.md | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) rename {translated/tech => published}/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md (62%) diff --git a/translated/tech/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md b/published/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md similarity index 62% rename from translated/tech/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md rename to published/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md index 4602424a3a..476274b495 100644 --- a/translated/tech/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md +++ b/published/20150420 7 Interesting Linux 'sort' Command Examples--Part 2.md @@ -1,11 +1,10 @@ - -Linux 'sort'命令的七个有趣实例-第二部分 +Linux 的 'sort'命令的七个有趣实例(二) ================================================================================ -在上一篇文章里,我们已经探讨了关于sort命令的多个例子,如果你错过了这篇文章,可以点击下面的链接进行阅读。今天的这篇文章作为上一篇文章的继续,将讨论关于sort命令的剩余用法,与上一篇一起作为Linux ‘sort’命令的完整指南。 -注:前两天做过这个原文 -- [14 ‘sort’ Command Examples in Linux][1] -- +在[上一篇文章][1]里,我们已经探讨了关于sort命令的多个例子,如果你错过了这篇文章,可以点击下面的链接进行阅读。今天的这篇文章作为上一篇文章的继续,将讨论关于sort命令的剩余用法,与上一篇一起作为Linux ‘sort’命令的完整指南。 + +- [Linux 的 ‘sort’命令的14个有用的范例(一)][1] + 在我们继续深入之前,先创建一个文本文档‘month.txt’,并且将上一次给出的数据填进去。 $ echo -e "mar\ndec\noct\nsep\nfeb\naug" > month.txt @@ -13,7 +12,7 @@ Linux 'sort'命令的七个有趣实例-第二部分 ![Populate Content](http://www.tecmint.com/wp-content/uploads/2015/04/Populate-Content.gif) -### 15. 通过使用’M‘选项,对’month.txt‘文件按照月份顺序进行排序。### +15、 通过使用’M‘选项,对’month.txt‘文件按照月份顺序进行排序。 $ sort -M month.txt @@ -21,14 +20,14 @@ Linux 'sort'命令的七个有趣实例-第二部分 ![Sort File Content by Month in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-by-Month.gif) -### 16. 把数据整理成方便人们阅读的形式,比如1K、2M、3G、2T,这里面的K、G、M、T代表千、兆、吉、梯。 -(译者注:好像这个选项并不是所有Linu版本都有,而且也没有实现按KMGT显示。) +16、 把数据整理成方便人们阅读的形式,比如1K、2M、3G、2T,这里面的K、G、M、T代表千、兆、吉、梯。 +(LCTT 译注:此处命令有误,ls 命令应该增加 -h 参数,径改之) - $ ls -l /home/$USER | sort -h -k5 + $ ls -lh /home/$USER | sort -h -k5 ![Sort Content Human Readable Format](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-Human-Readable-Format.gif) -### 17. 在上一篇文章中,我们在例子4中创建了一个名为‘sorted.txt’的文件,在例子6中创建了一个‘lsl.txt’。‘sorted.txt'已经排好序了而’lsl.txt‘还没有。让我们使用sort命令来检查两个文件是否已经排好序。### +17、 在上一篇文章中,我们在例子4中创建了一个名为‘sorted.txt’的文件,在例子6中创建了一个‘lsl.txt’。‘sorted.txt'已经排好序了而’lsl.txt‘还没有。让我们使用sort命令来检查两个文件是否已经排好序。 $ sort -c sorted.txt @@ -40,14 +39,14 @@ Linux 'sort'命令的七个有趣实例-第二部分 ![Check File Sorted Status](http://www.tecmint.com/wp-content/uploads/2015/04/Check-File-Sorted-Status.gif) -Reports Disorder. Conflict.. 报告无序。存在矛盾…… -### 18. 如果文字之间的分隔符是空格,sort命令自动地将横向空格后的东西当做一个新文字单元,如果分隔符不是空格呢?### +18、 如果文字之间的分隔符是空格,sort命令自动地将空格后的东西当做一个新文字单元,如果分隔符不是空格呢? 考虑这样一个文本文件,里面的内容可以由除了空格之外的任何符号分隔,比如‘|’,‘\’,‘+’,‘.’等…… 创建一个分隔符为+的文本文件。使用‘cat‘命令查看文件内容。 + $ echo -e "21+linux+server+production\n11+debian+RedHat+CentOS\n131+Apache+Mysql+PHP\n7+Shell Scripting+python+perl\n111+postfix+exim+sendmail" > delimiter.txt ---------- @@ -66,9 +65,9 @@ Reports Disorder. Conflict.. ![Sort Content By Non Numeric](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Content-By-Non-Numeric.gif) -如果分隔符是Tab,你需要在’+‘的位置上用$’\t’代替,如上例所示。 +如果分隔符是制表符,你需要在’+‘的位置上用$’\t’代替,如上例所示。 -### 19. 对主用户目录下使用‘ls -l’命令得到的结果基于第五列——‘数据的大小’进行一个乱序排列。 +19、 对主用户目录下使用‘ls -l’命令得到的结果基于第五列(‘文件大小’)进行一个乱序排列。 $ ls -l /home/avi/ | sort -k5 -R @@ -76,28 +75,30 @@ Reports Disorder. Conflict.. 每一次你运行上面的脚本,你得到结果可能都不一样,因为结果是随机生成的。 - 正如我在上一篇文章中提到的规则2所说——相比于大写字母,sort命令更喜欢以小写字母开始的行。看一下上一篇文章的例3,字符串‘laptop’在‘LAPTOP’前出现。 +正如我在上一篇文章中提到的规则2所说——sort命令会将以小写字母开始的行排在大写字母开始的行前面。看一下上一篇文章的例3,字符串‘laptop’在‘LAPTOP’前出现。 -### 20. 如何覆盖默认的排序优先权?在这之前我们需要先将环境变量LC_ALL的值设置为C。在命令行提示栏中运行下面的代码。### +20、 如何覆盖默认的排序优先权?在这之前我们需要先将环境变量LC_ALL的值设置为C。在命令行提示栏中运行下面的代码。 $ export LC_ALL=C -然后以重写默认优先权的方式对‘tecmint.txt’文件重新排序。 +然后以非默认优先权的方式对‘tecmint.txt’文件重新排序。 $ sort tecmint.txt ![Override Sorting Preferences](http://www.tecmint.com/wp-content/uploads/2015/04/Override-Sorting-Preferences.gif) -重写排序优先权 -不要忘记与example 3中得到的输出结果做比较,并且你可以使用‘-f’选项,又叫‘-ignore-case’来获取非常有序的输出。 +*覆盖排序优先权* + +不要忘记与example 3中得到的输出结果做比较,并且你可以使用‘-f’,又叫‘-ignore-case’(忽略大小写)的选项来获取更有序的输出。 $ sort -f tecmint.txt ![Compare Sorting Preferences](http://www.tecmint.com/wp-content/uploads/2015/04/Compare-Sorting-Preferences.gif) -### 21. 给两个输入文件进行‘sort‘,然后一口气把它们连接起来怎么样?### +21、 给两个输入文件进行‘sort‘,然后把它们连接成一行! 我们创建两个文本文档’file1.txt‘以及’file2.txt‘,并用数据填充,如下所示,并用’cat‘命令查看文件的内容。 + $ echo -e “5 Reliable\n2 Fast\n3 Secure\n1 open-source\n4 customizable” > file1.txt $ cat file1.txt @@ -117,7 +118,7 @@ Reports Disorder. Conflict.. ![Sort Join Two Files](http://www.tecmint.com/wp-content/uploads/2015/04/Sort-Join-Two-Files.gif) -我所要讲的全部内容就在这里了,希望与各位保持联系,也希望各位经常来Tecmint逛逛。有反馈就在下面评论吧。 +我所要讲的全部内容就在这里了,希望与各位保持联系,也希望各位经常来逛逛。有反馈就在下面评论吧。 -------------------------------------------------------------------------------- @@ -125,7 +126,7 @@ via: http://www.tecmint.com/linux-sort-command-examples/ 作者:[Avishek Kumar][a] 译者:[DongShuaike](https://github.com/DongShuaike) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From b57b875015d29b94152644d7e5ece309185b8409 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 3 May 2015 18:07:35 +0800 Subject: [PATCH 047/133] PUB:20150415 Strong SSL Security on nginx @wxy --- .../20150415 Strong SSL Security on nginx.md | 290 ++++++++++++++++++ .../20150415 Strong SSL Security on nginx.md | 290 ------------------ 2 files changed, 290 insertions(+), 290 deletions(-) create mode 100644 published/20150415 Strong SSL Security on nginx.md delete mode 100644 sources/tech/20150415 Strong SSL Security on nginx.md diff --git a/published/20150415 Strong SSL Security on nginx.md b/published/20150415 Strong SSL Security on nginx.md new file mode 100644 index 0000000000..094c50bd37 --- /dev/null +++ b/published/20150415 Strong SSL Security on nginx.md @@ -0,0 +1,290 @@ +增强 nginx 的 SSL 安全性 +================================================================================ +[![](https://raymii.org/s/inc/img/ssl-labs-a.png)][1] + +本文向你介绍如何在 nginx 服务器上设置健壮的 SSL 安全机制。我们通过禁用 SSL 压缩来降低 CRIME 攻击威胁;禁用协议上存在安全缺陷的 SSLv3 及更低版本,并设置更健壮的加密套件(cipher suite)来尽可能启用前向安全性(Forward Secrecy);此外,我们还启用了 HSTS 和 HPKP。这样我们就拥有了一个健壮而可经受考验的 SSL 配置,并可以在 Qually Labs 的 SSL 测试中得到 A 级评分。 + +如果不求甚解的话,可以从 [https://cipherli.st][2] 上找到 nginx 、Apache 和 Lighttpd 的安全设置,复制粘帖即可。 + +本教程在 Digital Ocean 的 VPS 上测试通过。如果你喜欢这篇教程,想要支持作者的站点的话,购买 Digital Ocean 的 VPS 时请使用如下链接:[https://www.digitalocean.com/?refcode=7435ae6b8212][3] 。 + +本教程可以通过[发布于 2014/1/21 的][4] SSL 实验室测试的严格要求(我之前就通过了测试,如果你按照本文操作就可以得到一个 A+ 评分)。 + +- [本教程也可用于 Apache ][5] +- [本教程也可用于 Lighttpd ][6] +- [本教程也可用于 FreeBSD, NetBSD 和 OpenBSD 上的 nginx ,放在 BSD Now 播客上][7]: [http://www.bsdnow.tv/tutorials/nginx][8] + +你可以从下列链接中找到这方面的进一步内容: + +- [野兽攻击(BEAST)][9] +- [罪恶攻击(CRIME)][10] +- [怪物攻击(FREAK )][11] +- [心血漏洞(Heartbleed)][12] +- [完备的前向安全性(Perfect Forward Secrecy)][13] +- [RC4 和 BEAST 的处理][14] + +我们需要编辑 nginx 的配置,在 Ubuntu/Debian 上是 `/etc/nginx/sited-enabled/yoursite.com`,在 RHEL/CentOS 上是 `/etc/nginx/conf.d/nginx.conf`。 + +本文中,我们需要编辑443端口(SSL)的 `server` 配置中的部分。在文末你可以看到完整的配置例子。 + +*在编辑之前切记备份一下配置文件!* + +### 野兽攻击(BEAST)和 RC4 ### + +简单的说,野兽攻击(BEAST)就是通过篡改一个加密算法的 CBC(密码块链)的模式,从而可以对部分编码流量悄悄解码。更多信息参照上面的链接。 + +针对野兽攻击(BEAST),较新的浏览器已经启用了客户端缓解方案。推荐方案是禁用 TLS 1.0 的所有加密算法,仅允许 RC4 算法。然而,[针对 RC4 算法的攻击也越来越多](http://www.isg.rhul.ac.uk/tls/) ,很多已经从理论上逐步发展为实际可行的攻击方式。此外,有理由相信 NSA 已经实现了他们所谓的“大突破”——攻破 RC4 。 + +禁用 RC4 会有几个后果。其一,当用户使用老旧的浏览器时,比如 Windows XP 上的 IE 会用 3DES 来替代 RC4。3DES 要比 RC4 更安全,但是它的计算成本更高,你的服务器就需要为这些用户付出更多的处理成本。其二,RC4 算法能减轻 野兽攻击(BEAST)的危害,如果禁用 RC4 会导致 TLS 1.0 用户会换到更容易受攻击的 AES-CBC 算法上(通常服务器端的对野兽攻击(BEAST)的“修复方法”是让 RC4 优先于其它算法)。我认为 RC4 的风险要高于野兽攻击(BEAST)的风险。事实上,有了客户端缓解方案(Chrome 和 Firefox 提供了缓解方案),野兽攻击(BEAST)就不是什么大问题了。而 RC4 的风险却在增长:随着时间推移,对加密算法的破解会越来越多。 + +### 怪物攻击(FREAK) ### + +怪物攻击(FREAK)是一种中间人攻击,它是由来自 [INRIA、微软研究院和 IMDEA][15] 的密码学家们所发现的。怪物攻击(FREAK)的缩写来自“Factoring RSA-EXPORT Keys(RSA 出口密钥因子分解)” + +这个漏洞可上溯到上世纪九十年代,当时美国政府禁止出口加密软件,除非其使用编码密钥长度不超过512位的出口加密套件。 + +这造成了一些现在的 TLS 客户端存在一个缺陷,这些客户端包括: 苹果的 SecureTransport 、OpenSSL。这个缺陷会导致它们会接受出口降级 RSA 密钥,即便客户端并没有要求使用出口降级 RSA 密钥。这个缺陷带来的影响很讨厌:在客户端存在缺陷,且服务器支持出口降级 RSA 密钥时,会发生中间人攻击,从而导致连接的强度降低。 + +攻击分为两个组成部分:首先是服务器必须接受“出口降级 RSA 密钥”。 + +中间人攻击可以按如下流程: + +- 在客户端的 Hello 消息中,要求标准的 RSA 加密套件。 +- 中间人攻击者修改该消息为‘export RSA’(输出级 RSA 密钥)。 +- 服务器回应一个512位的输出级 RSA 密钥,并以其长期密钥签名。 +- 由于 OpenSSL/SecureTransport 的缺陷,客户端会接受这个弱密钥。 +- 攻击者根据 RSA 模数分解因子来恢复相应的 RSA 解密密钥。 +- 当客户端编码‘pre-master secret’(预主密码)给服务器时,攻击者现在就可以解码它并恢复 TLS 的‘master secret’(主密码)。 +- 从这里开始,攻击者就能看到了传输的明文并注入任何东西了。 + +本文所提供的加密套件不启用输出降级加密,请确认你的 OpenSSL 是最新的,也强烈建议你将客户端也升级到新的版本。 + +### 心血漏洞(Heartbleed) ### + +心血漏洞(Heartbleed) 是一个于2014年4月公布的 OpenSSL 加密库的漏洞,它是一个被广泛使用的传输层安全(TLS)协议的实现。无论是服务器端还是客户端在 TLS 中使用了有缺陷的 OpenSSL,都可以被利用该缺陷。由于它是因 DTLS 心跳扩展(RFC 6520)中的输入验证不正确(缺少了边界检查)而导致的,所以该漏洞根据“心跳”而命名。这个漏洞是一种缓存区超读漏洞,它可以读取到本不应该读取的数据。 + +哪个版本的 OpenSSL 受到心血漏洞(Heartbleed)的影响? + +各版本情况如下: + +- OpenSSL 1.0.1 直到 1.0.1f (包括)**存在**该缺陷 +- OpenSSL 1.0.1g **没有**该缺陷 +- OpenSSL 1.0.0 分支**没有**该缺陷 +- OpenSSL 0.9.8 分支**没有**该缺陷 + +这个缺陷是2011年12月引入到 OpenSSL 中的,并随着 2012年3月14日 OpenSSL 发布的 1.0.1 而泛滥。2014年4月7日发布的 OpenSSL 1.0.1g 修复了该漏洞。 + +升级你的 OpenSSL 就可以避免该缺陷。 + +### SSL 压缩(罪恶攻击 CRIME) ### + +罪恶攻击(CRIME)使用 SSL 压缩来完成它的魔法,SSL 压缩在下述版本是默认关闭的: nginx 1.1.6及更高/1.0.9及更高(如果使用了 OpenSSL 1.0.0及更高), nginx 1.3.2及更高/1.2.2及更高(如果使用较旧版本的 OpenSSL)。 + +如果你使用一个早期版本的 nginx 或 OpenSSL,而且你的发行版没有向后移植该选项,那么你需要重新编译没有一个 ZLIB 支持的 OpenSSL。这会禁止 OpenSSL 使用 DEFLATE 压缩方式。如果你禁用了这个,你仍然可以使用常规的 HTML DEFLATE 压缩。 + +### SSLv2 和 SSLv3 ### + +SSLv2 是不安全的,所以我们需要禁用它。我们也禁用 SSLv3,因为 TLS 1.0 在遭受到降级攻击时,会允许攻击者强制连接使用 SSLv3,从而禁用了前向安全性(forward secrecy)。 + +如下编辑配置文件: + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + +### 卷毛狗攻击(POODLE)和 TLS-FALLBACK-SCSV ### + +SSLv3 会受到[卷毛狗漏洞(POODLE)][16]的攻击。这是禁用 SSLv3 的主要原因之一。 + +Google 提出了一个名为 [TLS\_FALLBACK\_SCSV][17] 的SSL/TLS 扩展,它用于防止强制 SSL 降级。如果你升级 到下述的 OpenSSL 版本会自动启用它。 + +- OpenSSL 1.0.1 带有 TLS\_FALLBACK\_SCSV 1.0.1j 及更高。 +- OpenSSL 1.0.0 带有 TLS\_FALLBACK\_SCSV 1.0.0o 及更高。 +- OpenSSL 0.9.8 带有 TLS\_FALLBACK\_SCSV 0.9.8zc 及更高。 + +[更多信息请参照 NGINX 文档][18]。 + +### 加密套件(cipher suite) ### + +前向安全性(Forward Secrecy)用于在长期密钥被破解时确保会话密钥的完整性。PFS(完备的前向安全性)是指强制在每个/每次会话中推导新的密钥。 + +这就是说,泄露的私钥并不能用来解密(之前)记录下来的 SSL 通讯。 + +提供PFS(完备的前向安全性)功能的是那些使用了一种 Diffie-Hellman 密钥交换的短暂形式的加密套件。它们的缺点是系统开销较大,不过可以使用椭圆曲线的变体来改进。 + +以下两个加密套件是我推荐的,之后[Mozilla 基金会][19]也推荐了。 + +推荐的加密套件: + + ssl_ciphers 'AES128+EECDH:AES128+EDH'; + +向后兼容的推荐的加密套件(IE6/WinXP): + + ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"; + +如果你的 OpenSSL 版本比较旧,不可用的加密算法会自动丢弃。应该一直使用上述的完整套件,让 OpenSSL 选择一个它所支持的。 + +加密套件的顺序是非常重要的,因为其决定了优先选择哪个算法。上述优先推荐的算法中提供了PFS(完备的前向安全性)。 + +较旧版本的 OpenSSL 也许不能支持这个算法的完整列表,AES-GCM 和一些 ECDHE 算法是相当新的,在 Ubuntu 和 RHEL 中所带的绝大多数 OpenSSL 版本中不支持。 + +#### 优先顺序的逻辑 #### + +- ECDHE+AESGCM 加密是首选的。它们是 TLS 1.2 加密算法,现在还没有广泛支持。当前还没有对它们的已知攻击。 +- PFS 加密套件好一些,首选 ECDHE,然后是 DHE。 +- AES 128 要好于 AES 256。有一个关于 AES256 带来的安全提升程度是否值回成本的[讨论][20],结果是显而易见的。目前,AES128 要更值一些,因为它提供了不错的安全水准,确实很快,而且看起来对时序攻击更有抵抗力。 +- 在向后兼容的加密套件里面,AES 要优于 3DES。在 TLS 1.1及其以上,减轻了针对 AES 的野兽攻击(BEAST)的威胁,而在 TLS 1.0上则难以实现该攻击。在非向后兼容的加密套件里面,不支持 3DES。 +- RC4 整个不支持了。3DES 用于向后兼容。参看 [#RC4\_weaknesses][21] 中的讨论。 + +#### 强制丢弃的算法 #### + +- aNULL 包含了非验证的 Diffie-Hellman 密钥交换,这会受到中间人(MITM)攻击 +- eNULL 包含了无加密的算法(明文) +- EXPORT 是老旧的弱加密算法,是被美国法律标示为可出口的 +- RC4 包含的加密算法使用了已弃用的 ARCFOUR 算法 +- DES 包含的加密算法使用了弃用的数据加密标准(DES) +- SSLv2 包含了定义在旧版本 SSL 标准中的所有算法,现已弃用 +- MD5 包含了使用已弃用的 MD5 作为哈希算法的所有算法 + +### 更多设置 ### + +确保你也添加了如下行: + + ssl_prefer_server_ciphers on; + ssl_session_cache shared:SSL:10m; + +在一个 SSLv3 或 TLSv1 握手过程中选择一个加密算法时,一般使用客户端的首选算法。如果设置了上述配置,则会替代地使用服务器端的首选算法。 + +- [关于 ssl\_prefer\_server\_ciphers 的更多信息][22] +- [关于 ssl\_ciphers 的更多信息][23] + +### 前向安全性和 Diffie Hellman Ephemeral (DHE)参数 ### + +前向安全性(Forward Secrecy)的概念很简单:客户端和服务器协商一个永不重用的密钥,并在会话结束时销毁它。服务器上的 RSA 私钥用于客户端和服务器之间的 Diffie-Hellman 密钥交换签名。从 Diffie-Hellman 握手中获取的预主密钥会用于之后的编码。因为预主密钥是特定于客户端和服务器之间建立的某个连接,并且只用在一个限定的时间内,所以称作短暂模式(Ephemeral)。 + +使用了前向安全性,如果一个攻击者取得了一个服务器的私钥,他是不能解码之前的通讯信息的。这个私钥仅用于 Diffie Hellman 握手签名,并不会泄露预主密钥。Diffie Hellman 算法会确保预主密钥绝不会离开客户端和服务器,而且不能被中间人攻击所拦截。 + +所有版本的 nginx(如1.4.4)都依赖于 OpenSSL 给 Diffie-Hellman (DH)的输入参数。不幸的是,这意味着 Diffie-Hellman Ephemeral(DHE)将使用 OpenSSL 的默认设置,包括一个用于密钥交换的1024位密钥。因为我们正在使用2048位证书,DHE 客户端就会使用一个要比非 DHE 客户端更弱的密钥交换。 + +我们需要生成一个更强壮的 DHE 参数: + + cd /etc/ssl/certs + openssl dhparam -out dhparam.pem 4096 + +然后告诉 nginx 将其用作 DHE 密钥交换: + + ssl_dhparam /etc/ssl/certs/dhparam.pem; + +### OCSP 装订(Stapling) ### + +当连接到一个服务器时,客户端应该使用证书吊销列表(CRL)或在线证书状态协议(OCSP)记录来校验服务器证书的有效性。CRL 的问题是它已经增长的太大了,永远也下载不完了。 + +OCSP 更轻量级一些,因为我们每次只请求一条记录。但是副作用是当连接到一个服务器时必须对第三方 OCSP 响应器发起 OCSP 请求,这就增加了延迟和带来了潜在隐患。事实上,CA 所运营的 OCSP 响应器非常不可靠,浏览器如果不能及时收到答复,就会静默失败。攻击者通过 DoS 攻击一个 OCSP 响应器可以禁用其校验功能,这样就降低了安全性。 + +解决方法是允许服务器在 TLS 握手中发送缓存的 OCSP 记录,以绕开 OCSP 响应器。这个机制节省了客户端和 OCSP 响应器之间的通讯,称作 OCSP 装订。 + +客户端会在它的 CLIENT HELLO 中告知其支持 status\_request TLS 扩展,服务器仅在客户端请求它的时候才发送缓存的 OCSP 响应。 + +大多数服务器最多会缓存 OCSP 响应48小时。服务器会按照常规的间隔连接到 CA 的 OCSP 响应器来获取刷新的 OCSP 记录。OCSP 响应器的位置可以从签名的证书中的授权信息访问(Authority Information Access)字段中获得。 + +- [阅读我的教程:在 NGINX 中启用 OCSP 装订][24] + +### HTTP 严格传输安全(HSTS) ### + +如有可能,你应该启用 [HTTP 严格传输安全(HSTS)][25],它会引导浏览器和你的站点之间的通讯仅通过 HTTPS。 + +- [阅读我关于 HSTS 的文章,了解如何配置它][26] + +### HTTP 公钥固定扩展(HPKP) ### + +你也应该启用 [HTTP 公钥固定扩展(HPKP)][27]。 + +公钥固定的意思是一个证书链必须包括一个白名单中的公钥。它确保仅有白名单中的 CA 才能够为某个域名签署证书,而不是你的浏览器中存储的任何 CA。 + +我已经写了一篇[关于 HPKP 的背景理论及在 Apache、Lighttpd 和 NGINX 中配置例子的文章][28]。 + +### 配置范例 ### + + server { + + listen [::]:443 default_server; + + ssl on; + ssl_certificate_key /etc/ssl/cert/raymii_org.pem; + ssl_certificate /etc/ssl/cert/ca-bundle.pem; + + ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL'; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_session_cache shared:SSL:10m; + + ssl_stapling on; + ssl_stapling_verify on; + resolver 8.8.4.4 8.8.8.8 valid=300s; + resolver_timeout 10s; + + ssl_prefer_server_ciphers on; + ssl_dhparam /etc/ssl/certs/dhparam.pem; + + add_header Strict-Transport-Security max-age=63072000; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + + root /var/www/; + index index.html index.htm; + server_name raymii.org; + + } + +### 结尾 ### + +如果你使用了上述配置,你需要重启 nginx: + + # 首先检查配置文件是否正确 + /etc/init.d/nginx configtest + # 然后重启 + /etc/init.d/nginx restart + +现在使用 [SSL Labs 测试][29]来看看你是否能得到一个漂亮的“A”。当然了,你也得到了一个安全的、强壮的、经得起考验的 SSL 配置! + +- [参考 Mozilla 关于这方面的内容][30] + +-------------------------------------------------------------------------------- + +via: https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html + +作者:[Remy van Elst][a] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://raymii.org/ +[1]:https://www.ssllabs.com/ssltest/analyze.html?d=raymii.org +[2]:https://cipherli.st/ +[3]:https://www.digitalocean.com/?refcode=7435ae6b8212 +[4]:http://blog.ivanristic.com/2014/01/ssl-labs-stricter-security-requirements-for-2014.html +[5]:https://raymii.org/s/tutorials/Strong_SSL_Security_On_Apache2.html +[6]:https://raymii.org/s/tutorials/Pass_the_SSL_Labs_Test_on_Lighttpd_%28Mitigate_the_CRIME_and_BEAST_attack_-_Disable_SSLv2_-_Enable_PFS%29.html +[7]:http://www.bsdnow.tv/episodes/2014_08_20-engineering_nginx +[8]:http://www.bsdnow.tv/tutorials/nginx +[9]:https://en.wikipedia.org/wiki/Transport_Layer_Security#BEAST_attack +[10]:https://en.wikipedia.org/wiki/CRIME_%28security_exploit%29 +[11]:http://blog.cryptographyengineering.com/2015/03/attack-of-week-freak-or-factoring-nsa.html +[12]:http://heartbleed.com/ +[13]:https://en.wikipedia.org/wiki/Perfect_forward_secrecy +[14]:https://en.wikipedia.org/wiki/Transport_Layer_Security#Dealing_with_RC4_and_BEAST +[15]:https://www.smacktls.com/ +[16]:https://raymii.org/s/articles/Check_servers_for_the_Poodle_bug.html +[17]:https://tools.ietf.org/html/draft-ietf-tls-downgrade-scsv-00 +[18]:http://wiki.nginx.org/HttpSslModule#ssl_protocols +[19]:https://wiki.mozilla.org/Security/Server_Side_TLS +[20]:http://www.mail-archive.com/dev-tech-crypto@lists.mozilla.org/msg11247.html +[21]:https://wiki.mozilla.org/Security/Server_Side_TLS#RC4_weaknesses +[22]:http://wiki.nginx.org/HttpSslModule#ssl_prefer_server_ciphers +[23]:http://wiki.nginx.org/HttpSslModule#ssl_ciphers +[24]:https://raymii.org/s/tutorials/OCSP_Stapling_on_nginx.html +[25]:https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security +[26]:https://linux.cn/article-5266-1.html +[27]:https://wiki.mozilla.org/SecurityEngineering/Public_Key_Pinning +[28]:https://linux.cn/article-5282-1.html +[29]:https://www.ssllabs.com/ssltest/ +[30]:https://wiki.mozilla.org/Security/Server_Side_TLS \ No newline at end of file diff --git a/sources/tech/20150415 Strong SSL Security on nginx.md b/sources/tech/20150415 Strong SSL Security on nginx.md deleted file mode 100644 index 7ee87bc0d7..0000000000 --- a/sources/tech/20150415 Strong SSL Security on nginx.md +++ /dev/null @@ -1,290 +0,0 @@ -增强 nginx 的 SSL 安全性 -================================================================================ -[![](https://raymii.org/s/inc/img/ssl-labs-a.png)][1] - -本文向你介绍如何在 nginx 服务器上设置高安全性的 SSL。我们通过取消 SSL 压缩降低 CRIME 攻击威胁;禁用协议上存在安全缺陷的 SSLv3 及更低版本,并设置更健壮的加密套件来尽可能启用正向保密(Forward Secrecy);我们也启用了 HSTS 和 HPKP。这样我们就拥有了一个健壮而可经受考验的 SSL 配置,并可以在 Qually Labs 的 SSL 测试中得到 A 级评分。 - -不求甚解的话,可以从 [https://cipherli.st][2] 上找到 nginx 、Apache 和 Lighttpd 的安全设置,复制粘帖即可。 - -本教程在 Digital Ocean 的 VPS 上测试通过。如果你喜欢这篇教程,想要支持作者的站点的话,购买 Digital Ocean 的 VPS 时请使用如下链接:[https://www.digitalocean.com/?refcode=7435ae6b8212][3] 。 - -本教程可以通过[发布于 2014/1/21 的][4] SSL 实验室测试的严格要求(之前就通过了测试,如果你按照本文进行的话,可以得到一个 A+ 评分)。 - -- [本教程也有对应 Apache 的][5] -- [本教程也有对应 Lighttpd 的][6] -- [本教程也有对应 FreeBSD, NetBSD 和 OpenBSD 上的 nginx 的,放在 BSD Now 播客][7]: [http://www.bsdnow.tv/tutorials/nginx][8] - -你可以从下列链接中找到这方面的进一步内容: - -- [BEAST 攻击][9] -- [CRIME 攻击][10] -- [FREAK 攻击][11] -- [心血漏洞][12] -- [完美正向保密][13] -- [RC4 和 BEAST 的处理][14] - -我们需要编辑 nginx 的配置,在 Ubuntu/Debian 上是 `/etc/nginx/sited-enabled/yoursite.com`,在 RHEL/CentOS 上是 `/etc/nginx/conf.d/nginx.conf` - -本文中,我们需要编辑443端口(SSL)的 `server` 配置中的部分。在文末我们会给出完整的配置例子。 - -*在编辑之前切记备份一下配置文件!* - -### The BEAST attack and RC4 ### - -In short, by tampering with an encryption algorithm's CBC - cipher block chaining - mode's, portions of the encrypted traffic can be secretly decrypted. More info on the above link. - -Recent browser versions have enabled client side mitigation for the beast attack. The recommendation was to disable all TLS 1.0 ciphers and only offer RC4. However, [RC4 has a growing list of attacks against it],(http://www.isg.rhul.ac.uk/tls/) many of which have crossed the line from theoretical to practical. Moreover, there is reason to believe that the NSA has broken RC4, their so-called "big breakthrough." - -Disabling RC4 has several ramifications. One, users with shitty browsers such as Internet Explorer on Windows XP will use 3DES in lieu. Triple-DES is more secure than RC4, but it is significantly more expensive. Your server will pay the cost for these users. Two, RC4 mitigates BEAST. Thus, disabling RC4 makes TLS 1.0 users susceptible to that attack, by moving them to AES-CBC (the usual server-side BEAST "fix" is to prioritize RC4 above all else). I am confident that the flaws in RC4 significantly outweigh the risks from BEAST. Indeed, with client-side mitigation (which Chrome and Firefox both provide), BEAST is a nonissue. But the risk from RC4 only grows: More cryptanalysis will surface over time. - -### Factoring RSA-EXPORT Keys (FREAK) ### - -FREAK is a man-in-the-middle (MITM) vulnerability discovered by a group of cryptographers at [INRIA, Microsoft Research and IMDEA][15]. FREAK stands for "Factoring RSA-EXPORT Keys." - -The vulnerability dates back to the 1990s, when the US government banned selling crypto software overseas, unless it used export cipher suites which involved encryption keys no longer than 512-bits. - -It turns out that some modern TLS clients - including Apple's SecureTransport and OpenSSL - have a bug in them. This bug causes them to accept RSA export-grade keys even when the client didn't ask for export-grade RSA. The impact of this bug can be quite nasty: it admits a 'man in the middle' attack whereby an active attacker can force down the quality of a connection, provided that the client is vulnerable and the server supports export RSA. - -There are two parts of the attack as the server must also accept "export grade RSA." - -The MITM attack works as follows: - -- In the client's Hello message, it asks for a standard 'RSA' ciphersuite. -- The MITM attacker changes this message to ask for 'export RSA'. -- The server responds with a 512-bit export RSA key, signed with its long-term key. -- The client accepts this weak key due to the OpenSSL/SecureTransport bug. -- The attacker factors the RSA modulus to recover the corresponding RSA decryption key. -- When the client encrypts the 'pre-master secret' to the server, the attacker can now decrypt it to recover the TLS 'master secret'. -- From here on out, the attacker sees plaintext and can inject anything it wants. - -The ciphersuite offered here on this page does not enable EXPORT grade ciphers. Make sure your OpenSSL is updated to the latest available version and urge your clients to also use upgraded software. - -### Heartbleed ### - -Heartbleed is a security bug disclosed in April 2014 in the OpenSSL cryptography library, which is a widely used implementation of the Transport Layer Security (TLS) protocol. Heartbleed may be exploited regardless of whether the party using a vulnerable OpenSSL instance for TLS is a server or a client. It results from improper input validation (due to a missing bounds check) in the implementation of the DTLS heartbeat extension (RFC6520), thus the bug's name derives from "heartbeat". The vulnerability is classified as a buffer over-read, a situation where more data can be read than should be allowed. - -What versions of the OpenSSL are affected by Heartbleed? - -Status of different versions: - -- OpenSSL 1.0.1 through 1.0.1f (inclusive) are vulnerable -- OpenSSL 1.0.1g is NOT vulnerable -- OpenSSL 1.0.0 branch is NOT vulnerable -- OpenSSL 0.9.8 branch is NOT vulnerable - -The bug was introduced to OpenSSL in December 2011 and has been out in the wild since OpenSSL release 1.0.1 on 14th of March 2012. OpenSSL 1.0.1g released on 7th of April 2014 fixes the bug. - -By updating OpenSSL you are not vulnerable to this bug. - -### SSL Compression (CRIME attack) ### - -The CRIME attack uses SSL Compression to do its magic. SSL compression is turned off by default in nginx 1.1.6+/1.0.9+ (if OpenSSL 1.0.0+ used) and nginx 1.3.2+/1.2.2+ (if older versions of OpenSSL are used). - -If you are using al earlier version of nginx or OpenSSL and your distro has not backported this option then you need to recompile OpenSSL without ZLIB support. This will disable the use of OpenSSL using the DEFLATE compression method. If you do this then you can still use regular HTML DEFLATE compression. - -### SSLv2 and SSLv3 ### - -SSL v2 is insecure, so we need to disable it. We also disable SSLv3, as TLS 1.0 suffers a downgrade attack, allowing an attacker to force a connection to use SSLv3 and therefore disable forward secrecy. - -Again edit the config file: - - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - -### Poodle and TLS-FALLBACK-SCSV ### - -SSLv3 allows exploiting of the [POODLE][16] bug. This is one more major reason to disable this. - -Google have proposed an extension to SSL/TLS named [TLSFALLBACKSCSV][17] that seeks to prevent forced SSL downgrades. This is automatically enabled if you upgrade OpenSSL to the following versions: - -- OpenSSL 1.0.1 has TLSFALLBACKSCSV in 1.0.1j and higher. -- OpenSSL 1.0.0 has TLSFALLBACKSCSV in 1.0.0o and higher. -- OpenSSL 0.9.8 has TLSFALLBACKSCSV in 0.9.8zc and higher. - -[More info on the NGINX documentation][18] - -### The Cipher Suite ### - -Forward Secrecy ensures the integrity of a session key in the event that a long-term key is compromised. PFS accomplishes this by enforcing the derivation of a new key for each and every session. - -This means that when the private key gets compromised it cannot be used to decrypt recorded SSL traffic. - -The cipher suites that provide Perfect Forward Secrecy are those that use an ephemeral form of the Diffie-Hellman key exchange. Their disadvantage is their overhead, which can be improved by using the elliptic curve variants. - -The following two ciphersuites are recommended by me, and the latter by [the Mozilla Foundation][19]. - -The recommended cipher suite: - - ssl_ciphers 'AES128+EECDH:AES128+EDH'; - -The recommended cipher suite for backwards compatibility (IE6/WinXP): - - ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"; - -If your version of OpenSSL is old, unavailable ciphers will be discarded automatically. Always use the full ciphersuite above and let OpenSSL pick the ones it supports. - -The ordering of a ciphersuite is very important because it decides which algorithms are going to be selected in priority. The recommendation above prioritizes algorithms that provide perfect forward secrecy. - -Older versions of OpenSSL may not return the full list of algorithms. AES-GCM and some ECDHE are fairly recent, and not present on most versions of OpenSSL shipped with Ubuntu or RHEL. - -#### Prioritization logic #### - -- ECDHE+AESGCM ciphers are selected first. These are TLS 1.2 ciphers and not widely supported at the moment. No known attack currently target these ciphers. -- PFS ciphersuites are preferred, with ECDHE first, then DHE. -- AES 128 is preferred to AES 256. There has been [discussions][20] on whether AES256 extra security was worth the cost, and the result is far from obvious. At the moment, AES128 is preferred, because it provides good security, is really fast, and seems to be more resistant to timing attacks. -- In the backward compatible ciphersuite, AES is preferred to 3DES. BEAST attacks on AES are mitigated in TLS 1.1 and above, and difficult to achieve in TLS 1.0. In the non-backward compatible ciphersuite, 3DES is not present. -- RC4 is removed entirely. 3DES is used for backward compatibility. See discussion in [#RC4_weaknesses][21] - -#### Mandatory discards #### - -- aNULL contains non-authenticated Diffie-Hellman key exchanges, that are subject to Man-In-The-Middle (MITM) attacks -- eNULL contains null-encryption ciphers (cleartext) -- EXPORT are legacy weak ciphers that were marked as exportable by US law -- RC4 contains ciphers that use the deprecated ARCFOUR algorithm -- DES contains ciphers that use the deprecated Data Encryption Standard -- SSLv2 contains all ciphers that were defined in the old version of the SSL standard, now deprecated -- MD5 contains all the ciphers that use the deprecated message digest 5 as the hashing algorithm - -### Extra settings ### - -Make sure you also add these lines: - - ssl_prefer_server_ciphers on; - ssl_session_cache shared:SSL:10m; - -When choosing a cipher during an SSLv3 or TLSv1 handshake, normally the client's preference is used. If this directive is enabled, the server's preference will be used instead. - -- [More info on sslpreferserver_ciphers][22] -- [More info on ssl_ciphers][23] - -### Forward Secrecy & Diffie Hellman Ephemeral Parameters ### - -The concept of forward secrecy is simple: client and server negotiate a key that never hits the wire, and is destroyed at the end of the session. The RSA private from the server is used to sign a Diffie-Hellman key exchange between the client and the server. The pre-master key obtained from the Diffie-Hellman handshake is then used for encryption. Since the pre-master key is specific to a connection between a client and a server, and used only for a limited amount of time, it is called Ephemeral. - -With Forward Secrecy, if an attacker gets a hold of the server's private key, it will not be able to decrypt past communications. The private key is only used to sign the DH handshake, which does not reveal the pre-master key. Diffie-Hellman ensures that the pre-master keys never leave the client and the server, and cannot be intercepted by a MITM. - -All versions of nginx as of 1.4.4 rely on OpenSSL for input parameters to Diffie-Hellman (DH). Unfortunately, this means that Ephemeral Diffie-Hellman (DHE) will use OpenSSL's defaults, which include a 1024-bit key for the key-exchange. Since we're using a 2048-bit certificate, DHE clients will use a weaker key-exchange than non-ephemeral DH clients. - -We need generate a stronger DHE parameter: - - cd /etc/ssl/certs - openssl dhparam -out dhparam.pem 4096 - -And then tell nginx to use it for DHE key-exchange: - - ssl_dhparam /etc/ssl/certs/dhparam.pem; - -### OCSP Stapling ### - -When connecting to a server, clients should verify the validity of the server certificate using either a Certificate Revocation List (CRL), or an Online Certificate Status Protocol (OCSP) record. The problem with CRL is that the lists have grown huge and takes forever to download. - -OCSP is much more lightweight, as only one record is retrieved at a time. But the side effect is that OCSP requests must be made to a 3rd party OCSP responder when connecting to a server, which adds latency and potential failures. In fact, the OCSP responders operated by CAs are often so unreliable that browser will fail silently if no response is received in a timely manner. This reduces security, by allowing an attacker to DoS an OCSP responder to disable the validation. - -The solution is to allow the server to send its cached OCSP record during the TLS handshake, therefore bypassing the OCSP responder. This mechanism saves a roundtrip between the client and the OCSP responder, and is called OCSP Stapling. - -The server will send a cached OCSP response only if the client requests it, by announcing support for the status_request TLS extension in its CLIENT HELLO. - -Most servers will cache OCSP response for up to 48 hours. At regular intervals, the server will connect to the OCSP responder of the CA to retrieve a fresh OCSP record. The location of the OCSP responder is taken from the Authority Information Access field of the signed certificate. - -- [View my tutorial on enabling OCSP stapling on NGINX][24] - -### HTTP Strict Transport Security ### - -When possible, you should enable [HTTP Strict Transport Security (HSTS)][25], which instructs browsers to communicate with your site only over HTTPS. - -- [View my article on HTST to see how to configure it.][26] - -### HTTP Public Key Pinning Extension ### - -You should also enable the [HTTP Public Key Pinning Extension][27]. - -Public Key Pinning means that a certificate chain must include a whitelisted public key. It ensures only whitelisted Certificate Authorities (CA) can sign certificates for `*.example.com`, and not any CA in your browser store. - -I've written an article about it that has background theory and configuration examples for Apache, Lighttpd and NGINX: [https://raymii.org/s/articles/HTTPPublicKeyPinningExtension_HPKP.html][28] - -### Config Example ### - - server { - - listen [::]:443 default_server; - - ssl on; - ssl_certificate_key /etc/ssl/cert/raymii_org.pem; - ssl_certificate /etc/ssl/cert/ca-bundle.pem; - - ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL'; - - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_session_cache shared:SSL:10m; - - ssl_stapling on; - ssl_stapling_verify on; - resolver 8.8.4.4 8.8.8.8 valid=300s; - resolver_timeout 10s; - - ssl_prefer_server_ciphers on; - ssl_dhparam /etc/ssl/certs/dhparam.pem; - - add_header Strict-Transport-Security max-age=63072000; - add_header X-Frame-Options DENY; - add_header X-Content-Type-Options nosniff; - - root /var/www/; - index index.html index.htm; - server_name raymii.org; - - } - -### Conclusion ### - -If you have applied the above config lines you need to restart nginx: - - # Check the config first: - /etc/init.d/nginx configtest - # Then restart: - /etc/init.d/nginx restart - -Now use the [SSL Labs test][29] to see if you get a nice A. And, of course, have a safe, strong and future proof SSL configuration! - -- [Also read the Mozilla page on the subject][30] - --------------------------------------------------------------------------------- - -via: https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html - -作者:[Remy van Elst][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:https://raymii.org/ -[1]:https://www.ssllabs.com/ssltest/analyze.html?d=raymii.org -[2]:https://cipherli.st/ -[3]:https://www.digitalocean.com/?refcode=7435ae6b8212 -[4]:http://blog.ivanristic.com/2014/01/ssl-labs-stricter-security-requirements-for-2014.html -[5]:https://raymii.org/s/tutorials/Strong_SSL_Security_On_Apache2.html -[6]:https://raymii.org/s/tutorials/Pass_the_SSL_Labs_Test_on_Lighttpd_%28Mitigate_the_CRIME_and_BEAST_attack_-_Disable_SSLv2_-_Enable_PFS%29.html -[7]:http://www.bsdnow.tv/episodes/2014_08_20-engineering_nginx -[8]:http://www.bsdnow.tv/tutorials/nginx -[9]:https://en.wikipedia.org/wiki/Transport_Layer_Security#BEAST_attack -[10]:https://en.wikipedia.org/wiki/CRIME_%28security_exploit%29 -[11]:http://blog.cryptographyengineering.com/2015/03/attack-of-week-freak-or-factoring-nsa.html -[12]:http://heartbleed.com/ -[13]:https://en.wikipedia.org/wiki/Perfect_forward_secrecy -[14]:https://en.wikipedia.org/wiki/Transport_Layer_Security#Dealing_with_RC4_and_BEAST -[15]:https://www.smacktls.com/ -[16]:https://raymii.org/s/articles/Check_servers_for_the_Poodle_bug.html -[17]:https://tools.ietf.org/html/draft-ietf-tls-downgrade-scsv-00 -[18]:http://wiki.nginx.org/HttpSslModule#ssl_protocols -[19]:https://wiki.mozilla.org/Security/Server_Side_TLS -[20]:http://www.mail-archive.com/dev-tech-crypto@lists.mozilla.org/msg11247.html -[21]:https://wiki.mozilla.org/Security/Server_Side_TLS#RC4_weaknesses -[22]:http://wiki.nginx.org/HttpSslModule#ssl_prefer_server_ciphers -[23]:http://wiki.nginx.org/HttpSslModule#ssl_ciphers -[24]:https://raymii.org/s/tutorials/OCSP_Stapling_on_nginx.html -[25]:https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security -[26]:https://raymii.org/s/tutorials/HTTP_Strict_Transport_Security_for_Apache_NGINX_and_Lighttpd.html -[27]:https://wiki.mozilla.org/SecurityEngineering/Public_Key_Pinning -[28]:https://raymii.org/s/articles/HTTP_Public_Key_Pinning_Extension_HPKP.html -[29]:https://www.ssllabs.com/ssltest/ -[30]:https://wiki.mozilla.org/Security/Server_Side_TLS \ No newline at end of file From f16a995874e8c53551a46d0c1ec07d686b3c94c9 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 3 May 2015 22:34:12 +0800 Subject: [PATCH 048/133] PUB:20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative @H-mudcup --- ...ys Relaxing Sounds to Keep You Creative.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) rename {translated/share => published}/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md (67%) diff --git a/translated/share/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md b/published/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md similarity index 67% rename from translated/share/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md rename to published/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md index f468b24754..c636b01820 100644 --- a/translated/share/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md +++ b/published/20150407 Ambient Noise Player for Ubuntu Plays Relaxing Sounds to Keep You Creative.md @@ -1,9 +1,8 @@ -Translated by H-mudcup - -适用于Ubuntu的环境音播放器播放让人放松的声音保持你的创造力 +环境音播放器:让人放松的声音,保持你的创造力 ================================================================================ ![Rain is a soothing sound for some](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/raining-1600x900-wallpaper_www.wallpapermay.com_84-1.jpg) -对于某些人来说雨声是个令人安心的声音 + +*对于某些人来说雨声是个令人安心的声音* **如果我想变得非常有效率,我不能听‘正常’的音乐。它会使我分心,我会开始跟着唱或者让我想起另一首歌,结局就是我在自己的音乐库里到处戳并且……反正,你懂的。** @@ -23,11 +22,11 @@ Translated by H-mudcup Google Play和苹果应用商店充满了环境音和白噪声的应用。现在,在Ubuntu里有同样的应用了。 -‘[Ambient Noise][1]‘ ‘[环境音][1]’——人如其名——是一个专门被设计成播放这种声音的音频播放器。他甚至可以同Ubuntu声音菜单整合到一起,给你‘选择,点击即放松’的体验。 +‘[Ambient Noise (环境音)][1] ’——人如其名,这是一个专门被设计成播放这种声音的音频播放器。他甚至可以同Ubuntu声音菜单整合到一起,给你‘选择,点击即放松’的体验。 -这个应用(又被称为‘ANoise播放器’,由Marcos Costales制作)带有**8个高品质声道**。 +这个应用(又被称为‘ANoise播放器’,由Marcos Costales制作)带有**8个高品质音频**。 -这8个预设声道涵盖了多种环境,从下雨时有节奏的声音,到夜晚大自然静谧的旋律,还有下午熙熙攘攘的咖啡店的嗡嗡声。 +这8个预设音频涵盖了多种环境,从下雨时有节奏的声音,到夜晚大自然静谧的旋律,还有下午熙熙攘攘的咖啡店的嗡嗡声。 ### 在Ubuntu上安装ANoise播放器 ### @@ -39,9 +38,9 @@ Google Play和苹果应用商店充满了环境音和白噪声的应用。现在 sudo apt-get update && sudo apt-get install anoise -安装好以后只需从Unity Dash(或DE里等价的地方)里打开它,通过声音菜单选择你喜欢的环境音然后……放松吧!这个应用甚至记得你上次用的环境音。 +安装好以后只需从Unity Dash(或桌面环境里类同的地方)里打开它,通过声音菜单选择你喜欢的环境音然后……放松吧!这个应用甚至记得你上次用的环境音。 -Even so, give it a try out and see if it suits your needs. I would say let me know what you think, but I will be too focused to hear — and so might you!即便如此,你还是要试一试看它是否能满足你的需要。我要说的是让我直到你是怎么想的,但是我将会专心致志到听不到你的声音——你可能也会这样! +即便如此,你还是要试一试看它是否能满足你的需要。我要说的是让我知道你是怎么想的,但是我将会专心致志到听不到你的声音——你可能也会这样! -------------------------------------------------------------------------------- @@ -49,7 +48,7 @@ via: http://www.omgubuntu.co.uk/2015/04/ambient-noise-player-app-for-ubuntu-linu 作者:[Joey-Elijah Sneddon][a] 译者:[H-mudcup](https://github.com/H-mudcup) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 13e714d086ca5179661b0c6e55bd71c5e43f8da9 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 3 May 2015 22:39:54 +0800 Subject: [PATCH 049/133] PUB:20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better @H-mudcup --- ...t Racing Game on Linux Just Got Even Better.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) rename {translated/share => published}/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md (84%) diff --git a/translated/share/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md b/published/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md similarity index 84% rename from translated/share/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md rename to published/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md index 931f51ce92..70355325b6 100644 --- a/translated/share/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md +++ b/published/20150423 uperTuxKart 0.9 Released--The Best Racing Game on Linux Just Got Even Better.md @@ -1,10 +1,10 @@ - -SuperTuxKart 0.9 已发行 —— Linux 中最好的竞速类游戏变得更好了 +SuperTuxKart 0.9 已发行 —— Linux 中最好的竞速类游戏越来越棒了! ================================================================================ **热门竞速类游戏 SuperTuxKart 的新版本已经[打包发行][1]登陆下载服务器** ![Super Tux Kart 0.9 Release Poster](http://1.bp.blogspot.com/-eGXvJu3UVwc/VTVhICZVEtI/AAAAAAAAAf0/iP2bkWDNf_c/s1600/poster-cropped.jpg) -Super Tux Kart 0.9 发行海报 + +*Super Tux Kart 0.9 发行海报* SuperTuxKart 0.9 相较前一版本做了巨大的升级,内部运行着刚出炉的新引擎(有个炫酷的名字叫‘Antarctica(南极洲)’),目的是要呈现更加炫酷的图形环境,从阴影到场景的纵深,外加卡丁车更好的物理效果。 @@ -14,14 +14,11 @@ SuperTuxKart 0.9 相较前一版本做了巨大的升级,内部运行着刚出 SuperTuxKart 0.9 中与图像的改善同样吸引人眼球的是一对**全新赛道**,新的卡丁车,新的在线账户可以记录和分享**全新推出的成就系统**里赢得的徽章,以及大量的改装和涂装的微调。 -点击播放下面的官方发行视频,看看基于调色器的 STK 0.9 所散发的光辉吧。 - -注:youtube 视频 - +点击播放下面的官方发行视频,看看基于调色器的 STK 0.9 所散发的光辉吧。(youtube 视频:https://www.youtube.com/0FEwDH7XU9Q ) Ubuntu 用户可以从项目网站上下载新发行版已编译的二进制文件。 -- [Download SuperTuxKart 0.9][2] +- [下载 SuperTuxKart 0.9][2] -------------------------------------------------------------------------------- @@ -29,7 +26,7 @@ via: http://www.omgubuntu.co.uk/2015/04/supertuxkart-0-9-released 作者:[Joey-Elijah Sneddon][a] 译者:[H-mudcup](https://github.com/H-mudcup) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 07aa6a3079e4df7894eaec79479bfec7a14c950f Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 3 May 2015 23:55:24 +0800 Subject: [PATCH 050/133] PUB:20150128 Docker-2 Setting up a private Docker registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @DongShuaike 翻译的很不错,很用心。 --- ...-2 Setting up a private Docker registry.md | 103 +++++++++--------- 1 file changed, 49 insertions(+), 54 deletions(-) rename {translated/tech => published}/20150128 Docker-2 Setting up a private Docker registry.md (55%) diff --git a/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md b/published/20150128 Docker-2 Setting up a private Docker registry.md similarity index 55% rename from translated/tech/20150128 Docker-2 Setting up a private Docker registry.md rename to published/20150128 Docker-2 Setting up a private Docker registry.md index 6d73b53326..d1c81e1679 100644 --- a/translated/tech/20150128 Docker-2 Setting up a private Docker registry.md +++ b/published/20150128 Docker-2 Setting up a private Docker registry.md @@ -2,58 +2,58 @@ ================================================================================ ![](http://cocoahunter.com/content/images/2015/01/docker2.jpg) -[TL;DR]这是系列的第二篇文章,这系列讲述了我的公司如何把基础服务从PaaS迁移到Docker上 +[TL;DR] 这是系列的第二篇文章,这系列讲述了我的公司如何把基础服务从PaaS迁移到Docker上 -- [First part][1]: 第一篇文章里我谈到了接触Docker之前的经历; -- [Third pard][2]: 第三篇文章里我展示如何使创建images的过程自动化以及如何用Docker部署一个Rails应用。 +- [第一篇文章][1]: 我谈到了接触Docker之前的经历; +- [第三篇文章][2]: 我展示如何使创建镜像的过程自动化以及如何用Docker部署一个Rails应用。 ---------- -为什么需要搭建一个私有的registry呢?嗯,Docker Hub(一个Docker公共仓库)只允许你拥有一个免费的私有版本库(repo)。其他的公司提供类似服务,但是价格可不便宜。另外,如果你需要部署一个基于Docker的应用产品,恐怕你不希望这些images在开放的Docker Hub被公开吧! +为什么需要搭建一个私有的registry呢?嗯,对于新手来说,Docker Hub(一个Docker公共仓库)只允许你拥有一个免费的私有版本库(repo)。其他的公司也开始提供类似服务,但是价格可不便宜。另外,如果你需要用Docker部署一个用于生产环境的应用,恐怕你不希望将这些镜像放在公开的Docker Hub上吧! -这篇文章提供了一个非常务实的方法来处理搭建私有Docke registry时出现的各种错综复杂的情况。我们将会使用一个运行于DigitalOcean(之后简称为DO)的非常小巧的512MB实例。并且我会假定你已经了解了Docker的基本概念,因为我必须集中精力在复杂的事情上! +这篇文章提供了一个非常务实的方法来处理搭建私有Docker registry时出现的各种错综复杂的情况。我们将会使用一个运行于DigitalOcean(之后简称为DO)的非常小巧的512MB VPS 实例。并且我会假定你已经了解了Docker的基本概念,因为我必须集中精力在复杂的事情上! ###本地搭建### 首先你需要安装**boot2docker**以及docker CLI。如果你已经搭建好了基本的Docker环境,你可以直接跳过这一步。 -从终端运行以下命令[1][3]: +从终端运行以下命令(我假设你使用OS X,使用 HomeBrew 来安装相关软件,你可以根据你的环境使用不同的包管理软件来安装): + brew install boot2docker docker -如果一切顺利[2][4],你现在将能够启动VM,在VM当中输入下列命令: +如果一切顺利(想要了解搭建docker环境的完整指南,请参阅 [http://boot2docker.io/][10]) ,你现在就能够通过如下命令启动一个 Docker 运行于其中的虚拟机: + boot2docker up -Follow the instructions, copy and paste the export commands that boot2docker will print in the terminal. If you now run `docker ps` you should be greeted by the following line -按照说明,复制粘贴book2docker打印在终端的export命令(这块翻译不太好)。现在运行`docker ps`命令,终端将有以下显示。 +按照屏幕显示的说明,复制粘贴book2docker在终端输出的命令。如果你现在运行`docker ps`命令,终端将有以下显示。 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -好了,Docker已经准备就绪。我们回过头去搭建registry。 +好了,Docker已经准备就绪,这就够了,我们回过头去搭建registry。 ###创建服务器### -登录进你的DO账号,选择一个提前安装好Docker的映像文件,创建一个新的Drople。[^n] +登录进你的DO账号,选择一个预安装了Docker的镜像文件,创建一个新的Drople。(本文写成时选择的是 Image > Applications > Docker 1.4.1 on 14.04) ![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-18-26-14.png) - 你将会以邮件的方式收到一个根用户凭证。登录进去,然后运行`docker ps`命令来查看系统状态。 ### 搭建AWS S3 ### -我们现在将使用Amazo Simple Storage Service(S3)作为我们registry/repository的存储层。我们讲需要创建一个桶(bucket)以及用户凭证(user credentials)来允许我们的docker容器访问它。 +我们现在将使用Amazo Simple Storage Service(S3)作为我们registry/repository的存储层。我们将需要创建一个桶(bucket)以及用户凭证(user credentials)来允许我们的docker容器访问它。 -登录到我们的AWS账号(如果没有,就申请一个[http://aws.amazon.com/][5]),在控制台选择S3(Simpole Storage Service) +登录到我们的AWS账号(如果没有,就申请一个[http://aws.amazon.com/][5]),在控制台选择S3(Simpole Storage Service)。 ![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-29-21.png) -点击 **Create Bucket**,为你的桶输入一个名字(把它写下来,我们一会需要用到它),然后点击**Create**。 +点击 **Create Bucket**,为你的桶输入一个名字(把它记下来,我们一会需要用到它),然后点击**Create**。 ![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-22-50.png) -OK!我们已经搭建好存储部分了。 +OK!我们已经搭建好存储部分了。 -### 安装AWS访问凭证### +### 设置AWS访问凭证### 我们现在将要创建一个新的用户。退回到AWS控制台然后选择IAM(Identity & Access Management)。 @@ -65,9 +65,9 @@ OK!我们已经搭建好存储部分了。 ![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-31-42.png) -输入你的用户名(例如 docker-registry)然后点击Create。写下(或者下载csv文件)你的Access Key以及Secret Access Key。回到你的用户列表然后选择你刚刚创建的用户。 +输入一个用户名(例如 docker-registry)然后点击Create。写下(或者下载csv文件)你的Access Key以及Secret Access Key。回到你的用户列表然后选择你刚刚创建的用户。 -在Permission section下面,点击Attach User Policy。之后,选择Custom Policy。 +在Permission section下面,点击Attach User Policy。之后在下一屏,选择Custom Policy。 ![](http://cocoahunter.com/content/images/2015/01/Screenshot-2015-01-20-19-41-21.png) @@ -90,11 +90,11 @@ custom policy的内容如下: ] } -这个配置将允许用户(也就是regitstry)来对桶上的内容进行操作(读/写)(确保使用你之前创建AWS S3时使用的桶名)。总结起来:当你想把你的Docker映像从你的本机推送到仓库中时,服务器将能够将他们上传到S3。 +这个配置将允许用户(也就是regitstry)来对桶上的内容进行操作(读/写)(确保使用你之前创建AWS S3时使用的桶名)。总结一下:当你想把你的Docker镜像从你的本机推送到仓库中时,服务器就会将他们上传到S3。 ### 安装registry ### -现在回过头来看我们的DO服务器,SSH登录其上。我们将要使用[^n]一个官方Docker registry映像。[6] +现在回过头来看我们的DO服务器,SSH登录其上。我们将要[使用][11]一个[官方Docker registry镜像][6]。 输入如下命令,开启registry。 @@ -110,25 +110,25 @@ custom policy的内容如下: -d \ registry -Docker将会从Docker Hub上拉取所需的文件系统层(fs layers)并启动守护容器(daemonised container)。 +Docker将会从Docker Hub上拉取所需的文件系统分层(fs layers)并启动守护容器(daemonised container)。 ### 测试registry ### 如果上述操作奏效,你可以通过ping命令,或者查找它的内容来测试registry(虽然这个时候容器还是空的)。 -我们的registry非常基础,而且没有提供任何“验明正身”的方式。因为添加身份验证可不是一件轻松事(至少我认为没有一种部署方法是简单的,像是为了证明你努力过似的),我觉得 查询/拉取/推送 仓库内容的最简单方法就是通过SSH的未加密连接(通过HTTP)。 +我们的registry非常基础,而且没有提供任何“验明正身”的方式。因为添加身份验证可不是一件轻松事(至少我认为没有一种部署方法是简单的,像是为了证明你努力过似的),我觉得“查询/拉取/推送”仓库内容的最简单方法就是通过SSH通道的未加密连接(通过HTTP)。 打开SSH通道的操作非常简单: ssh -N -L 5000:localhost:5000 root@your_registry.com -这条命令建立了一条从registry服务器(前面执行`docker run`命令的时候我们见过它)的5000号端口到本机的5000号端口之间的连接。 +这条命令建立了一条从registry服务器(前面执行`docker run`命令的时候我们见过它)的5000号端口到本机的5000号端口之间的 SSH 管道连接。 -如果你现在登录[http://localhost:5000/v1/_ping][7],将会看到下面这个非常简短的回复。 +如果你现在用浏览器访问 [http://localhost:5000/v1/_ping][7],将会看到下面这个非常简短的回复。 {} -这个意味着registry工作正常。你还可以通过登录[http://localhost:5000/v1/search][8]来查看registry内容,内容相似: +这个意味着registry工作正常。你还可以通过登录 [http://localhost:5000/v1/search][8] 来查看registry内容,内容相似: { "num_results": 2, @@ -145,40 +145,38 @@ Docker将会从Docker Hub上拉取所需的文件系统层(fs layers)并启动 ] } -### 创建一个映像 ### +### 创建一个镜像 ### -我们现在创建一个非常简答的Docker映像,来检验我们新弄好的registry。在我们的本机上,用如下内容创建一个Dockerfile:[^n] +我们现在创建一个非常简单的Docker镜像,来检验我们新弄好的registry。在我们的本机上,用如下内容创建一个Dockerfile(这里只有一点代码,在下一篇文章里我将会展示给你如何将一个Rails应用绑定进Docker容器中。): - - # Base image with ruby 2.2.0 + # ruby 2.2.0 的基础镜像 FROM ruby:2.2.0 MAINTAINER Michelangelo Chasseur -……创建: +并创建它: docker build -t localhost:5000/username/repo-name . -`localhost:5000`非常重要:Docker映像名的最前面一个部分将告知`docker push`命令我们将要把我们的image推送到哪里。在我们这个例子当中,因为我们要通过SSH管道连接远端私有registry,`localhost:5000`精确地表示了对我们的registry的一个引用。 +`localhost:5000`这个部分非常重要:Docker镜像名的最前面一个部分将告知`docker push`命令我们将要把我们的镜像推送到哪里。在我们这个例子当中,因为我们要通过SSH管道连接远程的私有registry,`localhost:5000`精确地指向了我们的registry。 -如果一切顺利,当命令执行完成返回后,你可以输入`docker images`命令来列出新近创建的映像。执行它看看会出现什么现象? +如果一切顺利,当命令执行完成返回后,你可以输入`docker images`命令来列出新近创建的镜像。执行它看看会出现什么现象? ### 推送到仓库 ### -接下来是更好玩的部分。实现我所描述的东西着实花了我一点时间,所以如果你第一次读的话就耐心一点吧,跟着我一起操作。我知道接下来的东西会非常复杂(如果你不自动化进程就一定会这样),但是我保证到最后你一定都能明白。在下一篇文章里我将会使用到一大波shell脚本和Rake任务,通过它们实现自动化并且用简单的命令实现部署Rails应用。 +接下来是更好玩的部分。实现我所描述的东西着实花了我一点时间,所以如果你第一次读的话就耐心一点吧,跟着我一起操作。我知道接下来的东西会非常复杂(如果你不自动化这个过程就一定会这样),但是我保证到最后你一定都能明白。在下一篇文章里我将会使用到一大波shell脚本和Rake任务,通过它们实现自动化并且用简单的命令实现部署Rails应用。 -你运行的docker命令都是实际上都是在boot2docker虚拟机上运行的。所以当你执行像`docker push some_repo`这样的命令时,是boot2docker虚拟机在与registry交互,而不是我们自己的机器。 +你在终端上运行的docker命令实际上都是使用boot2docker虚拟机来运行容器及各种东西。所以当你执行像`docker push some_repo`这样的命令时,是boot2docker虚拟机在与registry交互,而不是我们自己的机器。 -接下来是一个非常重要的点:为了将Docker映像推送到远端的私有仓库,SSH管道需要在boot2docker虚拟机上配置好。 +接下来是一个非常重要的点:为了将Docker镜像推送到远端的私有仓库,SSH管道需要在boot2docker虚拟机上配置好,而不是在你的本地机器上配置。 -由许多种方法实现它。我给你展示最简短的一种(可能不是最容易理解的,但是能够帮助你实现自动化) +有许多种方法实现它。我给你展示最简短的一种(可能不是最容易理解的,但是能够帮助你实现自动化) -First of all though we need to sort one last thing with SSH. -(不太会翻译) +在这之前,我们需要对 SSH 做最后一点工作。 -### Setting up SSH ### +### 设置 SSH ### -我们添加boot2docker SSH key到远端服务器已知的hosts里面。我们可以使用ssh-copy-id工具,通过下面的命令就可以安装上它了: +让我们把boot2docker 的 SSH key添加到远端服务器的“已知主机”里面。我们可以使用ssh-copy-id工具完成,通过下面的命令就可以安装上它了: brew install ssh-copy-id @@ -188,7 +186,7 @@ First of all though we need to sort one last thing with SSH. 用你ssh key的真实路径代替`/Users/username/.ssh/id_boot2docker`。 -这样做能够让我们面密码登录SSH。 +这样做能够让我们免密码登录SSH。 现在我们来测试以下: @@ -196,26 +194,23 @@ First of all though we need to sort one last thing with SSH. 分开阐述: -- `boot2docker ssh`允许你以参数的形式传递给boot2docker虚拟机一条执行命令; +- `boot2docker ssh`允许你以参数的形式传递给boot2docker虚拟机一条执行的命令; - 最后面那个`&`表明这条命令将在后台执行; - `ssh -o 'StrictHostKeyChecking no' -i /Users/michelangelo/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@registry.touchwa.re &`是boot2docker虚拟机实际运行的命令; - -`-o 'StrictHostKeyChecking no'`——不提示安全问题; + - `-o 'StrictHostKeyChecking no'`——不提示安全问题; - `-i /Users/michelangelo/.ssh/id_boot2docker`指出虚拟机使用哪个SSH key来进行身份验证。(注意这里的key应该是你前面添加到远程仓库的那个) - - 最后我们将打开一条端口5000到本地端口5000的SSH通道。 + - 最后我们将打开一条端口5000映射到localhost:5000的SSH通道。 ### 从其他服务器上拉取 ### -你现在将可以通过下面的简单命令将你的映像推送到远端仓库: +你现在将可以通过下面的简单命令将你的镜像推送到远端仓库: docker push localhost:5000/username/repo_name -在下一篇文章[9]中,我们将会了解到如何自动化处理这些事务,并且真正地容器化一个Rails应用。请继续收听! +在下一篇[文章][9]中,我们将会了解到如何自动化处理这些事务,并且真正地容器化一个Rails应用。请继续收听! + 如有错误,请不吝指出。祝你Docker之路顺利! -1. 我假设你使用OS X。 -2. 想要了解搭建docker环境的完整之南,请参阅[http://boot2docker.io/][10]。 -3. 本文写成时选择的是 Image > Applications > Docker 1.4.1 on 14.04。 -4. [https://github.com/docker/docker-registry/][11] -5. 这是一个存根,在下一篇文章里我将会展示给你如何将一个Rails应用绑定进Docker容器中。 + -------------------------------------------------------------------------------- @@ -223,12 +218,12 @@ via: http://cocoahunter.com/2015/01/23/docker-2/ 作者:[Michelangelo Chasseur][a] 译者:[DongShuaike](https://github.com/DongShuaike) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://cocoahunter.com/author/michelangelo/ -[1]:http://cocoahunter.com/2015/01/23/docker-1/ +[1]:https://linux.cn/article-5339-1.html [2]:http://cocoahunter.com/2015/01/23/docker-3/ [3]:http://cocoahunter.com/2015/01/23/docker-2/#fn:1 [4]:http://cocoahunter.com/2015/01/23/docker-2/#fn:2 From 5e5263514ea66413136c4679280462f2beebc147 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 4 May 2015 15:44:14 +0800 Subject: [PATCH 051/133] Translating by ZTinoZ --- ...ape - Open Source Vector Graphic Editor.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md b/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md index f4a957a15f..3deb76c7c0 100644 --- a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md +++ b/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md @@ -15,25 +15,25 @@ Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上但是 - Helps draw various shapes like rectangles, ellipses, circles, arcs, polygons, stars, spirals etc and then resize, rotate and modify (turn sharp edges round) them - Create and embed bitmaps with simple commands -#### 项目控制 #### +#### 对象处理 #### -- 通过交互式操作来扭曲、移动、测量、旋转目标Skewing, moving, scaling, rotating objects through interactive manipulations and pacifying the numeric values -- Performing raising and lowering Z-order operations -- Grouping and ungrouping objects to create a virtual scope for editing or manipulation -- Layers form a hierarchal tree and can be locked or rearranged for various manipulations -- Distribution and alignment commands +- 通过交互式操作和调整数值来扭曲、移动、测量、旋转目标 +- 执行力提升并减少了Z-order操作。 +- 对象组群化或取消组群化可以去创建一个虚拟层阶用来编辑或处理 +- 图层采用层次结构树的结构并且能锁定或以各式各样的处理方式来重新布置 +- 分布与对齐指令 -#### Fill and Stroke #### +#### 填充与边框 #### -- Copy/paste styles -- Pick Color tool +- 复制/粘贴风格 +- 取色器 - Selecting colors on a continuous plot based on vectors of RGB, HSL, CMS, CMYK and color wheel - Gradient editor helps creating and managing multi-stop gradients - Define an image or selection and use it to pattern fill - Dashed Strokes can be used with few predefined dashed patterns - Beginning, middle and ending marks through path markers -#### Operation on Paths #### +#### 路径上的操作 #### - Node Editing: Moving nodes and Bezier handles, node alignment and distribution etc - Boolean operations like yes or no conditions @@ -41,18 +41,18 @@ Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上但是 - Path insetting and outsetting along with link and offset objects - Converting bitmap images into paths (color and monochrome paths) through path tracing -#### Text manipulation #### +#### 文本处理 #### - All installed outlined fonts can be used even for right to left align objects - Formatting text, letter spacing, line spacing or kerning - Text on path and on shapes where both text and path or shapes can be edited or modified -#### Rendering #### +#### 渲染 #### - Inkscape fully support anti-aliased display which is a technique that reduces or eliminates aliasing by shading the pixels along the border. - Support for alpha transparency display and PNG export -### Install Inkscape on Ubuntu 14.04 and 14.10 ### +### 在Ubuntu 14.04和14.10上安装Inkscape ### In order to install Inkscape on Ubuntu, we will need to first [add its stable Personal Package Archive][1] (PPA) to Advanced Package Tool (APT) repository. Launch the terminal and run following command to add its PPA. From ec40816c23729020ab85f3e792afe941c36a099b Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 4 May 2015 16:11:47 +0800 Subject: [PATCH 052/133] =?UTF-8?q?20150504-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...B) and 'PowerAdmin' in RHEL or CentOS 7.md | 423 ++++++++++++++++++ ...erver behind NAT via reverse SSH tunnel.md | 130 ++++++ 2 files changed, 553 insertions(+) create mode 100644 sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md create mode 100644 sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md diff --git a/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md b/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md new file mode 100644 index 0000000000..e8974ba386 --- /dev/null +++ b/sources/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md @@ -0,0 +1,423 @@ +How to Install and Configure ‘PowerDNS’ (with MariaDB) and ‘PowerAdmin’ in RHEL/CentOS 7 +================================================================================ +PowerDNS is a DNS server running on many Linux/Unix derivatives. It can be configured with different backends including BIND style zone files, relational databases or load balancing/failover algorithms. It can also be setup as a DNS recursor running as a separate process on the server. + +The latest version of PowerDNS Authoritative server is 3.4.4, but the one available in the EPEL repository right now is 3.4.3. I would recommend installing the one for the EPEL repository due to the fact that this version is tested in CentOS and Fedora. That way you will also be able to easily update PowerDNS in future. + +This article intends to show you how to install and setup master PowerDNS server with a MariaDB backend and the PowerAdmin – a friendly web interface managing tool for PowerDNS. + +For the purpose of this article I will be using server with: + + Hostname: centos7.localhost + IP Address 192.168.0.102 + +### Step 1: Installing PowerDNS with MariaDB Backend ### + +#### 1. First you need to enable the EPEL repository for your server simply use: #### + + # yum install epel-release.noarch + +![Enable Epel Repository](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Epel-Repository.png) +Enable Epel Repository + +#### 2. The next step is to install the MariaDB server. This can be easily done by running the following command: #### + + # yum -y install mariadb-server mariadb + +![Install MariaDB Server](http://www.tecmint.com/wp-content/uploads/2015/04/Install-MariaDB-Server.png) +Install MariaDB Server + +#### 3. Next we will configure MySQL to enable and start upon system boot: #### + + # systemctl enable mariadb.service + # systemctl start mariadb.service + +![Enable Start MariaDB System Boot](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Start-MariaDB-System-Boot.png) +Enable Start MariaDB System Boot + +#### 4. Now that the MySQL service is running, we will secure and setup a password for MariaDB by running: #### + + # mysql_secure_installation + +#### Follow Instructions #### + + /bin/mysql_secure_installation: line 379: find_mysql_client: command not found + + NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB + SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! + + In order to log into MariaDB to secure it, we'll need the current + password for the root user. If you've just installed MariaDB, and + you haven't set the root password yet, the password will be blank, + so you should just press enter here. + + Enter current password for root (enter for none): Press ENTER + OK, successfully used password, moving on... + + Setting the root password ensures that nobody can log into the MariaDB + root user without the proper authorisation. + + Set root password? [Y/n] y + New password: ← Set New Password + Re-enter new password: ← Repeat Above Password + Password updated successfully! + Reloading privilege tables.. + ... Success! + + + By default, a MariaDB installation has an anonymous user, allowing anyone + to log into MariaDB without having to have a user account created for + them. This is intended only for testing, and to make the installation + go a bit smoother. You should remove them before moving into a + production environment. + + Remove anonymous users? [Y/n] y ← Choose “y” to disable that user + ... Success! + + Normally, root should only be allowed to connect from 'localhost'. This + ensures that someone cannot guess at the root password from the network. + + Disallow root login remotely? [Y/n] n ← Choose “n” for no + ... skipping. + + By default, MariaDB comes with a database named 'test' that anyone can + access. This is also intended only for testing, and should be removed + before moving into a production environment. + + Remove test database and access to it? [Y/n] y ← Choose “y” for yes + - Dropping test database... + ... Success! + - Removing privileges on test database... + ... Success! + + Reloading the privilege tables will ensure that all changes made so far + will take effect immediately. + + Reload privilege tables now? [Y/n] y ← Choose “y” for yes + ... Success! + + Cleaning up... + + All done! If you've completed all of the above steps, your MariaDB + installation should now be secure. + + Thanks for using MariaDB! + +#### 5. Once MariaDB configuration done successfully, we can proceed further with the installation of PowerDNS. This is easily completed by running: #### + + # yum -y install pdns pdns-backend-mysql + +![Install PowerDNS with MariaDB Backend](http://www.tecmint.com/wp-content/uploads/2015/04/Install-PowerDNS-with-MariaDB-Backend.png) +Install PowerDNS with MariaDB Backend + +#### 6. The configuration file for PowerDNS is located in `/etc/pdns/pdns`, but before editing it, we will setup a MySQL database for PowerDNS service. First we will connect to the MySQL server and will create a database with name powerdns: #### + + # mysql -u root -p + MariaDB [(none)]> CREATE DATABASE powerdns; + +![Create PowerDNS Database](http://www.tecmint.com/wp-content/uploads/2015/04/Create-PowerDNS-Database.png) +Create PowerDNS Database + +#### 7. Next, we will create a database user called powerdns: #### + + MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY ‘tecmint123’; + MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'centos7.localdomain' IDENTIFIED BY 'tecmint123'; + MariaDB [(none)]> FLUSH PRIVILEGES; + +![Create PowerDNS User](http://www.tecmint.com/wp-content/uploads/2015/04/Create-PowerDNS-User.png) +Create PowerDNS User + +**Note**: Replace “tecmint123” with the actual password that you want to use for your setup. + +#### 8. We proceed by creating the database tables used by PowerDNS. Execute those block by block: #### + + MariaDB [(none)]> USE powerdns; + MariaDB [(none)]> CREATE TABLE domains ( + id INT auto_increment, + name VARCHAR(255) NOT NULL, + master VARCHAR(128) DEFAULT NULL, + last_check INT DEFAULT NULL, + type VARCHAR(6) NOT NULL, + notified_serial INT DEFAULT NULL, + account VARCHAR(40) DEFAULT NULL, + primary key (id) + ); + +![Create Table Domains for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Table-Domains-for-PowerDNS.png) +Create Table Domains for PowerDNS + + MariaDB [(none)]> CREATE UNIQUE INDEX name_index ON domains(name); + MariaDB [(none)]> CREATE TABLE records ( + id INT auto_increment, + domain_id INT DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + type VARCHAR(6) DEFAULT NULL, + content VARCHAR(255) DEFAULT NULL, + ttl INT DEFAULT NULL, + prio INT DEFAULT NULL, + change_date INT DEFAULT NULL, + primary key(id) + ); + +![Create Index Domains for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Index-Domains-for-PowerDNS.png) +Create Index Domains for PowerDNS + + MariaDB [(none)]> CREATE INDEX rec_name_index ON records(name); + MariaDB [(none)]> CREATE INDEX nametype_index ON records(name,type); + MariaDB [(none)]> CREATE INDEX domain_id ON records(domain_id); + +![Create Index Records](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Records.png) +Create Index Records + + MariaDB [(none)]> CREATE TABLE supermasters ( + ip VARCHAR(25) NOT NULL, + nameserver VARCHAR(255) NOT NULL, + account VARCHAR(40) DEFAULT NULL + ); + +![Create Table Supermaster](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Table-Supermaster.png) +Create Table Supermaster + +You can now exit the MySQL console by typing: + + MariaDB [(none)]> quit; + +#### 9. Finally we can proceed with configuring our PowerDNS in a way that, it will use MySQL as backend. For that purpose open PowerDNS configuration file located at: #### + + # vim /etc/pdns/pdns.conf + +In that file look for the lines looking like this: + + ################################# + # launch Which backends to launch and order to query them in + # + # launch= + +Just after that put the following code: + + launch=gmysql + gmysql-host=localhost + gmysql-user=powerdns + gmysql-password=user-pass + gmysql-dbname=powerdns + +Change “user-pass” with the actual password that you set earlier. Here is how my configuration looks like: + +![Configure PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-PowerDNS.png) +Configure PowerDNS + +Save your change and exit from. + +#### 10. Now we will start and add PowerDNS to the list of services starting at system boot: #### + + # systemctl enable pdns.service + # systemctl start pdns.service + +![Enable and Start PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-and-Start-PowerDNS.png) +Enable and Start PowerDNS + +At this point your PowerDNS server is up and running. For more information about PowerDNS you can refer to the manual available at [http://downloads.powerdns.com/documentation/html/index.html][1] + +### Step 2: Installing PowerAdmin to Manage PowerDNS ### + +#### 11. Now we will install PowerAdmin – a friendly web interface designed to manager PowerDNS servers. Since it is written in PHP, we will need to install PHP and a web server (Apache): #### + + # yum install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext + +![Install Apache PHP](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Apache-PHP.jpeg) +Install Apache PHP + +PowerAdmin also requires two PEAR packages: + + # yum -y install php-pear-DB php-pear-MDB2-Driver-mysql + +![Install Pear](http://www.tecmint.com/wp-content/uploads/2015/04/Install-Pear.jpeg) +Install Pear + +You can also refer to the following article for complete instructions how to install LAMP stack in CentOS 7: + +- [Install LAMP in CentOS 7][2] + +Once the install is complete, we will need to start and set Apache to start at system boot: + + # systemctl enable httpd.service + # systemctl start httpd.service + +![Enable Start Apache System Boot](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Start-Apache-System-Boot.png) +Enable Start Apache System Boot + +#### 12. Now that all system requirements for running PowerAdmn are met, we can proceed and download the package. Since the default web directory for Apache is /var/www/html/, we will download the package in there. #### + + # cd /var/www/html/ + # wget http://downloads.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz + # tar xfv poweradmin-2.1.7.tgz + +![Download PowerAdmin](http://www.tecmint.com/wp-content/uploads/2015/04/Download-PowerAdmin.jpeg) +Download PowerAdmin + +#### 13. Now, we can now start the web installer of PowerAdmin. Simply open: #### + + http://192.168.0.102/poweradmin-2.1.7/install/ + +This should bring the first step of the installation: + +![Select Installation Language](http://www.tecmint.com/wp-content/uploads/2015/04/Select-Installation-Language.png) +Select Installation Language + +The above page will ask you to choose the language for your PowerAdmin. Select the one you wish to use and click the “Go to step 2” button. + +#### 14. The installer will expect you to have a PowerDNS database: #### + +![PowerDNS Database](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Database.png) +PowerDNS Database + +#### 15. Since we already created one, we can proceed to the next step. You will be asked to enter the database details you setup earlier. You will also need to setup Poweradmin administrator password: #### + +![Enter PowerDNS Database Settings](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS.png) +Enter PowerDNS Database Settings + +#### 16. Once you have input those, go to step 4. You will create a new user with a limited rights for Poweradmin. The fields that you need to enter here are: #### + +- Username - username for hte PowerAdmin. +- Password – password for the above user. +- Hostmaster - When creating SOA records and you have not specified hostmaster, this value will be used. +- Secondary nameserver – the value will be used as primary name server when creating new DNS zones. + +![PowerDNS Configuration Settings](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Configuration-Settings.png) +PowerDNS Configuration Settings + +#### 17. On the next step Poweradmin will ask you to create new database user with limited rights on the database tables. It will provide you with the code that you will need to put in a MySQL console: #### + +![Create New Database User](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Database-User.png) +Create New Database User + +#### 18. Now open a terminal and run: #### + + # mysql -u root -p + +Provide your password and execute the code provided by Poweradmin: + + MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE + ON powerdns.* + TO 'powermarin'@'localhost' + IDENTIFIED BY '123qweasd'; + +![Grant Mysql Permissions to User](http://www.tecmint.com/wp-content/uploads/2015/04/Grant-Mysql-Permissions-to-User.png) +Grant Mysql Permissions to User + +#### 19. Now go back to your browser and proceed to the next step. The installer will attempt to create its configuration file in /var/www/html/poweradmin-2.1.7/inc. #### + +The file name is config.inc.php. In case the script is not able to write that file you can create it manually by copying the text and putting it in above mentioned file: + +![Configuration Settings of PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Configuration.png) +Configuration Settings of PowerDNS + +#### 20. Now go to the last page where you will be informed that the installation is complete and will receive information how to access your Poweradmin install: #### + +![PowerDNS Installation Completed](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Installation-Completed.png) +PowerDNS Installation Completed + +You can enable URLs used by other dynamic DNS providers by running: + + # cp install/htaccess.dist .htaccess + +For that purpose you will need to have mod_rewrite enabled in Apache’s configuration. + +#### 21. Now it is important to remove the “install” folder from Poweradmin’s root directory with the following command: #### + + # rm -fr /var/www/html/poweradmin/install/ + +After that you can access your poweradmin at: + + http://192.168.0.102/poweradmin-2.1.7/ + +![PowerDNS Login](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Login.png) +PowerDNS Login + +After logging you should see the Poweradmin main page: + +![PowerDNS Dashboard](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Dashboard.png) +PowerDNS Dashboard + +At this point your installation is complete and you are now ready to start managing your DNS zones. + +### Step 3: How to Add, Edit and Delete DNS Zones in PowerDNS ### + +#### 22. To add new master zone, simply click on the “Add master zone”: #### + +![Add Master Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Add-Master-Zone.png) +Add Master Zone + +On the next page there are few things that you need to fill: + +- Domain – domain for which you will be adding the zone. +- Owner – sets the owner of the DNS zone. +- Template – DNS template – leave to none. +- DNSSEC – Donany Name System Security Extensions (optional -check if you need it). + +Click the “Add zone” button to add the DNS zone. + +![Master DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Master-DNS-Zone.png) +Master DNS Zone + +Now you can go back to the index page of Poweradmin by clicking the “Index” link. To review all existing DNS zones simply go to “List zones”: + +![Check List of Zones](http://www.tecmint.com/wp-content/uploads/2015/04/Check-List-Zones.png) +Check List of Zones + +You should now see a list of available DNS zones: + +![Check List of DNS Zones](http://www.tecmint.com/wp-content/uploads/2015/04/DNS-Zones.png) +Check List of DNS Zones + +#### 23. To edit an existing DNS zone or add new records click the edit icon: #### + +![Edit DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Edit-DNS-Zone.png) +Edit DNS Zone + +On the next page you will see the entries for the DNS zone you have chosen: + +![Domain DNS Zone Entries](http://www.tecmint.com/wp-content/uploads/2015/04/Domain-DNS.png) +Domain DNS Zone Entries + +#### 24. In here to add new DNS zone you will need to set the following information: #### + +- Name – name for the entry. Only add the first part of the domain/subdomain, the rest will be added by Poweradmin. +- Type – choose the record type. +- Priority – priority of the record. +- TTL – Time To Live in seconds. + +For the purpose of this article, I will add an A record for subdomain new.example.com that will resolve on IP address 192.168.0.102 with time to live 14400 seconds: + +![Add New DNS Record](http://www.tecmint.com/wp-content/uploads/2015/04/Add-New-DNS-Record.png) +Add New DNS Record + +Finally click the “Add record” button. + +#### 25. If you wish to delete a DNS zone you can go back to the “List zone” page and click on the “Trash” icon next to the DNS zone which you wish to delete: #### + +![Delete DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Delete-DNS-Zone.png) +Delete DNS Zone + +Poweradmin will ask you if you are sure you want to delete the DNS zone. Simply click “Yes” to finish the deletion. + +For more detailed instructions how to create, edit and delete zones you can refer to Poweradmin’s documentation at: + +[https://github.com/poweradmin/poweradmin/wiki/Documentation][3] + +I hope you have find this article interesting and useful. As always if you have any questions or comments please do not hesitate to submit them in the comment section below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-powerdns-poweradmin-mariadb-in-centos-rhel/ + +作者:[Marin Todorov][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/marintodorov89/ +[1]:http://downloads.powerdns.com/documentation/html/index.html +[2]:http://www.tecmint.com/install-lamp-in-centos-7/ +[3]:https://github.com/poweradmin/poweradmin/wiki/Documentation \ No newline at end of file diff --git a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md new file mode 100644 index 0000000000..44a4110203 --- /dev/null +++ b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md @@ -0,0 +1,130 @@ +How to access a Linux server behind NAT via reverse SSH tunnel +================================================================================ +You are running a Linux server at home, which is behind a NAT router or restrictive firewall. Now you want to SSH to the home server while you are away from home. How would you set that up? SSH port forwarding will certainly be an option. However, port forwarding can become tricky if you are dealing with multiple nested NAT environment. Besides, it can be interfered with under various ISP-specific conditions, such as restrictive ISP firewalls which block forwarded ports, or carrier-grade NAT which shares IPv4 addresses among users. + +### What is Reverse SSH Tunneling? ### + +One alternative to SSH port forwarding is **reverse SSH tunneling**. The concept of reverse SSH tunneling is simple. For this, you will need another host (so-called "relay host") outside your restrictive home network, which you can connect to via SSH from where you are. You could set up a relay host using a [VPS instance][1] with a public IP address. What you do then is to set up a persistent SSH tunnel from the server in your home network to the public relay host. With that, you can connect "back" to the home server from the relay host (which is why it's called a "reverse" tunnel). As long as the relay host is reachable to you, you can connect to your home server wherever you are, or however restrictive your NAT or firewall is in your home network. + +![](https://farm8.staticflickr.com/7742/17162647378_c7d9f10de8_b.jpg) + +### Set up a Reverse SSH Tunnel on Linux ### + +Let's see how we can create and use a reverse SSH tunnel. We assume the following. We will be setting up a reverse SSH tunnel from homeserver to relayserver, so that we can SSH to homeserver via relayserver from another computer called clientcomputer. The public IP address of **relayserver** is 1.1.1.1. + +On homeserver, open an SSH connection to relayserver as follows. + + homeserver~$ ssh -fN -R 10022:localhost:22 relayserver_user@1.1.1.1 + +Here the port 10022 is any arbitrary port number you can choose. Just make sure that this port is not used by other programs on relayserver. + +The "-R 10022:localhost:22" option defines a reverse tunnel. It forwards traffic on port 10022 of relayserver to port 22 of homeserver. + +With "-fN" option, SSH will go right into the background once you successfully authenticate with an SSH server. This option is useful when you do not want to execute any command on a remote SSH server, and just want to forward ports, like in our case. + +After running the above command, you will be right back to the command prompt of homeserver. + +Log in to relayserver, and verify that 127.0.0.1:10022 is bound to sshd. If so, that means a reverse tunnel is set up correctly. + + relayserver~$ sudo netstat -nap | grep 10022 + +---------- + + tcp 0 0 127.0.0.1:10022 0.0.0.0:* LISTEN 8493/sshd + +Now from any other computer (e.g., clientcomputer), log in to relayserver. Then access homeserver as follows. + + relayserver~$ ssh -p 10022 homeserver_user@localhost + +One thing to take note is that the SSH login/password you type for localhost should be for homeserver, not for relayserver, since you are logging in to homeserver via the tunnel's local endpoint. So do not type login/password for relayserver. After successful login, you will be on homeserver. + +### Connect Directly to a NATed Server via a Reverse SSH Tunnel ### + +While the above method allows you to reach **homeserver** behind NAT, you need to log in twice: first to **relayserver**, and then to **homeserver**. This is because the end point of an SSH tunnel on relayserver is binding to loopback address (127.0.0.1). + +But in fact, there is a way to reach NATed homeserver directly with a single login to relayserver. For this, you will need to let sshd on relayserver forward a port not only from loopback address, but also from an external host. This is achieved by specifying **GatewayPorts** option in sshd running on relayserver. + +Open /etc/ssh/sshd_conf of **relayserver** and add the following line. + + relayserver~$ vi /etc/ssh/sshd_conf + +---------- + + GatewayPorts clientspecified + +Restart sshd. + +Debian-based system: + + relayserver~$ sudo /etc/init.d/ssh restart + +Red Hat-based system: + + relayserver~$ sudo systemctl restart sshd + +Now let's initiate a reverse SSH tunnel from homeserver as follows. +homeserver~$ ssh -fN -R 1.1.1.1:10022:localhost:22 relayserver_user@1.1.1.1 + +Log in to relayserver and confirm with netstat command that a reverse SSH tunnel is established successfully. + + relayserver~$ sudo netstat -nap | grep 10022 + +---------- + + tcp 0 0 1.1.1.1:10022 0.0.0.0:* LISTEN 1538/sshd: dev + +Unlike a previous case, the end point of a tunnel is now at 1.1.1.1:10022 (relayserver's public IP address), not 127.0.0.1:10022. This means that the end point of the tunnel is reachable from an external host. + +Now from any other computer (e.g., clientcomputer), type the following command to gain access to NATed homeserver. + + clientcomputer~$ ssh -p 10022 homeserver_user@1.1.1.1 + +In the above command, while 1.1.1.1 is the public IP address of relayserver, homeserver_user must be the user account associated with homeserver. This is because the real host you are logging in to is homeserver, not relayserver. The latter simply relays your SSH traffic to homeserver. + +### Set up a Persistent Reverse SSH Tunnel on Linux ### + +Now that you understand how to create a reverse SSH tunnel, let's make the tunnel "persistent", so that the tunnel is up and running all the time (regardless of temporary network congestion, SSH timeout, relay host rebooting, etc.). After all, if the tunnel is not always up, you won't be able to connect to your home server reliably. + +For a persistent tunnel, I am going to use a tool called autossh. As the name implies, this program allows you to automatically restart an SSH session should it breaks for any reason. So it is useful to keep a reverse SSH tunnel active. + +As the first step, let's set up [passwordless SSH login][2] from homeserver to relayserver. That way, autossh can restart a broken reverse SSH tunnel without user's involvement. + +Next, [install autossh][3] on homeserver where a tunnel is initiated. + +From homeserver, run autossh with the following arguments to create a persistent SSH tunnel destined to relayserver. + + homeserver~$ autossh -M 10900 -fN -o "PubkeyAuthentication=yes" -o "StrictHostKeyChecking=false" -o "PasswordAuthentication=no" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 1.1.1.1:10022:localhost:22 relayserver_user@1.1.1.1 + +The "-M 10900" option specifies a monitoring port on relayserver which will be used to exchange test data to monitor an SSH session. This port should not be used by any program on relayserver. + +The "-fN" option is passed to ssh command, which will let the SSH tunnel run in the background. + +The "-o XXXX" options tell ssh to: + +- Use key authentication, not password authentication. +- Automatically accept (unknown) SSH host keys. +- Exchange keep-alive messages every 60 seconds. +- Send up to 3 keep-alive messages without receiving any response back. + +The rest of reverse SSH tunneling related options remain the same as before. + +If you want an SSH tunnel to be automatically up upon boot, you can add the above autossh command in /etc/rc.local. + +### Conclusion ### + +In this post, I talked about how you can use a reverse SSH tunnel to access a Linux server behind a restrictive firewall or NAT gateway from outside world. While I demonstrated its use case for a home network, you must be careful when applying it for corporate networks. Such a tunnel can be considered as a breach of a corporate policy, as it circumvents corporate firewalls and can expose corporate networks to outside attacks. There is a great chance it can be misused or abused. So always remember its implication before setting it up. + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/access-linux-server-behind-nat-reverse-ssh-tunnel.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/go/digitalocean +[2]:http://xmodulo.com/how-to-enable-ssh-login-without.html +[3]:http://ask.xmodulo.com/install-autossh-linux.html \ No newline at end of file From 26093a4a658d6c542a0f80aa1b8af582de1bfcbd Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 4 May 2015 16:24:04 +0800 Subject: [PATCH 053/133] =?UTF-8?q?20150504-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...To Install Visual Studio Code On Ubuntu.md | 61 ++++++ ...r and Remove Unwanted Packages in Linux.md | 183 ++++++++++++++++++ 2 files changed, 244 insertions(+) create mode 100644 sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md create mode 100644 sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md diff --git a/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md b/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md new file mode 100644 index 0000000000..4b5d2eeae6 --- /dev/null +++ b/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md @@ -0,0 +1,61 @@ +How To Install Visual Studio Code On Ubuntu +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Install-Visual-Studio-Code-in-Ubuntu.jpeg) + +Microsoft has done the unexpected by [releasing Visual Studio Code][1] for all major desktop platforms that includes Linux as well. If you are a web developer who happens to be using Ubuntu, you can **easily install Visual Studio Code in Ubuntu**. + +We will be using [Ubuntu Make][2] for installing Visual Studio Code in Ubuntu. Ubuntu Make, previously known as Ubuntu Developer Tools Center, is a command line utility that allows you to easily install various development tools, languages and IDEs. You can easily [install Android Studio][3] and other popular IDEs such as Eclipse with Ubuntu Make. In this tutorial we shall see **how to install Visual Studio Code in Ubuntu with Ubuntu Make**. + +### Install Microsoft Visual Studio Code in Ubuntu ### + +Before installing Visual Studio Code, we need to install Ubuntu Make first. Though Ubuntu Make is available in Ubuntu 15.04 repository, **you’ll need Ubuntu Make 0.7 for Visual Studio**. You can get the latest Ubuntu Make by using the official PPA. The PPA is available for Ubuntu 14.04, 14.10 and 15.04. Also, it **is only available for 64 bit platform**. + +Open a terminal and use the following commands to install Ubuntu Make via official PPA: + + sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make + sudo apt-get update + sudo apt-get install ubuntu-make + +Once you have installed Ubuntu Make, use the command below to install Visual Studio Code: + + umake web visual-studio-code + +You’ll be asked to provide a path where it will be installed: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Visual_Studio_Code_Ubuntu_1.jpeg) + +After throwing a whole lot of terms and conditions, it will ask for your permission to install Visual Studio Code. Press ‘a’ at this screen: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Visual_Studio_Code_Ubuntu_2.jpeg) + +Once you do that it will start downloading and installing it. Once it is installed, you can see that Visual Studio Code icon has already been locked to the Unity Launcher. Just click on it to run it. This is how Visual Studio Code looks like in Ubuntu 15.04 Unity: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Visual_Studio_Code_Ubuntu.jpeg) + +### Uninstall Visual Studio Code from Ubuntu ### + +To uninstall Visual Studio Code, we’ll use the same command line tool umake. Just use the following command in terminal: + + umake web visual-studio-code --remove + +If you do not want to use Ubuntu Make, you can install Visual Studio Code by downloading the files from Microsoft: + +- [Download Visual Studio Code for Linux][4] + +See, how easy it is to install Visual Studio Code in Ubuntu, all thanks to Ubuntu Make. I hope this tutorial helped you. Feel free to drop a comment if you have any questions or suggestions. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/install-visual-studio-code-ubuntu/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://www.geekwire.com/2015/microsofts-visual-studio-expands-to-mac-and-linux-with-new-code-development-tool/ +[2]:https://wiki.ubuntu.com/ubuntu-make +[3]:http://itsfoss.com/install-android-studio-ubuntu-linux/ +[4]:https://code.visualstudio.com/Download \ No newline at end of file diff --git a/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md b/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md new file mode 100644 index 0000000000..990e621e5b --- /dev/null +++ b/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md @@ -0,0 +1,183 @@ +Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux +================================================================================ +Here we are with the next part of Linux Command Line Tips and Tricks. If you missed our previous post on Linux Tricks you may find it here. + +- [5 Linux Command Line Tricks][1] + +In this post we will be introducing 6 command Line tips namely create Linux Command line chat using Netcat command, perform addition of a column on the fly from the output of a command, remove orphan packages from Debian and CentOS, get local and remote IP from command Line, get colored output in terminal and decode various color code and last but not the least hash tags implementation in Linux command Line. Lets check them one by one. + +![Linux Commandline Chat Server](http://www.tecmint.com/wp-content/uploads/2015/04/linux-commandline-chat-server.jpg) +6 Useful Commandline Tricks and Tips + +### 1. Create Linux Commandline Chat Server ### + +We all have been using chat service since a long time. We are familiar with Google chat, Hangout, Facebook chat, Whatsapp, Hike and several other application and integrated chat services. Do you know Linux nc command can make your Linux box a chat server with just one line of command. +What is nc command in Linux and what it does? + +nc is the depreciation of Linux netcat command. The nc utility is often referred as Swiss army knife based upon the number of its built-in capabilities. It is used as debugging tool, investigation tool, reading and writing to network connection using TCP/UDP, DNS forward/reverse checking. + +It is prominently used for port scanning, file transferring, backdoor and port listening. nc has the ability to use any local unused port and any local network source address. + +Use nc command (On Server with IP address: 192.168.0.7) to create a command line messaging server instantly. + + $ nc -l -vv -p 11119 + +Explanation of the above command switches. + +- -v : means Verbose +- -vv : more verbose +- -p : The local port Number + +You may replace 11119 with any other local port number. + +Next on the client machine (IP address: 192.168.0.15) run the following command to initialize chat session to machine (where messaging server is running). + + $ nc 192.168.0.7 11119 + +![Linux Commandline Chat with nc Command](http://www.tecmint.com/wp-content/uploads/2015/04/Chat-on-Linux-Commandline.gif) + +**Note**: You can terminate chat session by hitting ctrl+c key and also nc chat is one-to-one service. + +### 2. How to Sum Values in a Column in Linux ### + +How to sum the numerical values of a column, generated as an output of a command, on the fly in the terminal. + +The output of the ‘ls -l‘ command. + + $ ls -l + +![Sum Numerical Values](http://www.tecmint.com/wp-content/uploads/2015/04/Sum-Values.gif) + +Notice that the second column is numerical which represents number of symbolic links and the 5th column is numerical which represents the size of he file. Say we need to sum the values of fifth column on the fly. + +List the content of 5th column without printing anything else. We will be using ‘awk‘ command to do this. ‘$5‘ represents 5th column. + + $ ls -l | awk '{print $5}' + +![List Content Column](http://www.tecmint.com/wp-content/uploads/2015/04/List-Content-Column.gif) + +Now use awk to print the sum of the output of 5th column by pipelining it. + + $ ls -l | awk '{print $5}' | awk '{total = total + $1}END{print total}' + +![Sum and Print Columns](http://www.tecmint.com/wp-content/uploads/2015/04/Sum-Columns.gif) + +### How to Remove Orphan Packages in Linux? ### + +Orphan packages are those packages that are installed as a dependency of another package and no longer required when the original package is removed. + +Say we installed a package gtprogram which was dependent of gtdependency. We can’t install gtprogram unless gtdependency is installed. + +When we remove gtprogram it won’t remove gtdependency by default. And if we don’t remove gtdependency, it will remain as Orpahn Package with no connection to any other package. + + # yum autoremove [On RedHat Systems] + +![Remove Orphan Packages in CentOS](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Orphan-Packages-in-CentOS1.gif) + + # apt-get autoremove [On Debian Systems] + +![Remove Orphan Packages in Debian](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Orphan-Packages-in-Debian.gif) + +You should always remove Orphan Packages to keep the Linux box loaded with just necessary stuff and nothing else. + +### 4. How to Get Local and Public IP Address of Linux Server ### + +To get you local IP address run the below one liner script. + + $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: + +You must have installed ifconfig, if not, apt or yum the required packages. Here we will be pipelining the output of ifconfig with grep command to find the string “intel addr:”. + +We know ifconfig command is sufficient to output local IP Address. But ifconfig generate lots of other outputs and our concern here is to generate only local IP address and nothing else. + + # ifconfig | grep "inet addr:" + +![Check Local IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Local-IP-Address.gif) + +Although the output is more custom now, but we need to filter our local IP address only and nothing else. For this we will use awk to print the second column only by pipelining it with the above script. + + # ifconfig | grep “inet addr:” | awk '{print $2}' + +![Filter Only IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Filter-IP-Address.gif) + +Clear from the above image that we have customised the output very much but still not what we want. The loopback address 127.0.0.1 is still there in the result. + +We use use -v flag with grep that will print only those lines that don’t match the one provided in argument. Every machine have the same loopback address 127.0.0.1, so use grep -v to print those lines that don’t have this string, by pipelining it with above output. + + # ifconfig | grep "inet addr" | awk '{print $2}' | grep -v '127.0.0.1' + +![Print IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Print-IP-Address.gif) + +We have almost generated desired output, just replace the string `(addr:)` from the beginning. We will use cut command to print only column two. The column 1 and column 2 are not separated by tab but by `(:)`, so we need to use delimiter `(-d)` by pipelining the above output. + + # ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: + +![Customized IP Address](http://www.tecmint.com/wp-content/uploads/2015/04/Custome-IP-Address.gif) + +Finally! The desired result has been generated. + +### 5. How to Color Linux Terminal ### + +You might have seen colored output in terminal. Also you would be knowing to enable/disable colored output in terminal. If not you may follow the below steps. + +In Linux every user has `'.bashrc'` file, this file is used to handle your terminal output. Open and edit this file with your choice of editor. Note that, this file is hidden (dot beginning of file means hidden). + + $ vi /home/$USER/.bashrc + +Make sure that the following lines below are uncommented. ie., it don’t start with a #. + + if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dirc$ + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' + fi + +![User .bashrc File](http://www.tecmint.com/wp-content/uploads/2015/04/bashrc-file.gif) + +Once done! Save and exit. To make the changes taken into effect logout and again login. + +Now you will see files and folders are listed in various colors based upon type of file. To decode the color code run the below command. + + $ dircolors -p + +Since the output is too long, lets pipeline the output with less command so that we get output one screen at a time. + + $ dircolors -p | less + +![Linux Color Output](http://www.tecmint.com/wp-content/uploads/2015/04/Linux-Color-Output.gif) + +### 6. How to Hash Tag Linux Commands and Scripts ### + +We are using hash tags on Twitter, Facebook and Google Plus (may be some other places, I have not noticed). These hash tags make it easier for others to search for a hash tag. Very few know that we can use hash tag in Linux command Line. + +We already know that `#` in configuration files and most of the programming languages is treated as comment line and is excluded from execution. + +Run a command and then create a hash tag of the command so that we can find it later. Say we have a long script that was executed in point 4 above. Now create a hash tag for this. We know ifconfig can be run by sudo or root user hence acting as root. + + # ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: #myip + +The script above has been hash tagged with ‘myip‘. Now search for the hash tag in reverse-i-serach (press ctrl+r), in the terminal and type ‘myip‘. You may execute it from there, as well. + +![Create Command Hash Tags](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Command-Hash-Tags.gif) + +You may create as many hash tags for every command and find it later using reverse-i-search. + +That’s all for now. We have been working hard to produce interesting and knowledgeable contents for you. What do you think how we are doing? Any suggestion is welcome. You may comment in the box below. Keep connected! Kudos. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-commandline-chat-server-and-remove-unwanted-packages/ + +作者:[Avishek Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/5-linux-command-line-tricks/ \ No newline at end of file From bd46afe9ce4116061a6f5902222a521527135f95 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 4 May 2015 16:37:22 +0800 Subject: [PATCH 054/133] PUB:20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04 @johnhoow --- ...Lightweight Budgie v8 Desktop in Ubuntu 14.04.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md (72%) diff --git a/translated/tech/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md b/published/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md similarity index 72% rename from translated/tech/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md rename to published/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md index 10bb779e71..ccaff360e5 100644 --- a/translated/tech/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md +++ b/published/20150227 How to Install Lightweight Budgie v8 Desktop in Ubuntu 14.04.md @@ -53,11 +53,11 @@ Budgie是为Linux发行版定制的旗舰桌面,也是一个定制工程。为 ![安装 Budgie Desktop](http://blog.linoxide.com/wp-content/uploads/2015/02/install-budgie-desktop.png) -**注意点** +**注意** -这是一个活跃的开发版本,一些主要的特点可能还不是特别的完善,如:网络管理器,为数不多的控制组件,无通知系统斌并且无法将app锁定到任务栏。 +这是一个活跃的开发版本,一些主要的功能可能还不是特别的完善,如:没有网络管理器,没有音量控制组件(可以使用键盘控制),无通知系统并且无法将app锁定到任务栏。 -作为工作区你能够禁用滚动栏,通过设置一个默认的主题并且通过下面的命令退出当前的会话 +有一个临时解决方案可以禁用叠加滚动栏:设置另外一个默认主题,然后从终端退出当前会话: $ gnome-session-quit @@ -65,7 +65,7 @@ Budgie是为Linux发行版定制的旗舰桌面,也是一个定制工程。为 ### 登录Budgie会话 ### -安装完成之后,我们能在登录时选择机进入budgie桌面。 +安装完成之后,我们能在登录时选择进入budgie桌面。 ![选择桌面会话](http://blog.linoxide.com/wp-content/uploads/2015/02/session-select.png) @@ -79,8 +79,7 @@ Budgie是为Linux发行版定制的旗舰桌面,也是一个定制工程。为 ### 结论 ### -Hurray! We have successfully installed our Lightweight Budgie Desktop Environment in our Ubuntu 14.04 LTS "Trusty" box. As we know, Budgie Desktop is still underdevelopment which makes it a lot of stuffs missing. Though it’s based on Gnome’s GTK3, it’s not a fork. The desktop is written completely from scratch, and the design is elegant and well thought out. If you have any questions, comments, feedback please do write on the comment box below and let us know what stuffs needs to be added or improved. Thank You! Enjoy Budgie Desktop 0.8 :-) -Budgie桌面当前正在开发过程中,因此有目前有很多功能的缺失。虽然它是基于Gnome,但不是完全的复制。Budgie是完全从零开始实现,它的设计是优雅的并且正在不断的完善。 +嗨,现在我们已经成功的在 Ubuntu 14.04 LTS 上安装了轻量级 Budgie 桌面环境。Budgie桌面当前正在开发过程中,因此有目前有很多功能的缺失。虽然它是基于Gnome 的 GTK3,但不是完全的复制。Budgie是完全从零开始实现,它的设计是优雅的并且正在不断的完善。如果你有任何问题、评论,请在下面的评论框发表。愿你喜欢 Budgie 桌面 0.8 。 -------------------------------------------------------------------------------- @@ -88,7 +87,7 @@ via: http://linoxide.com/ubuntu-how-to/install-lightweight-budgie-v8-desktop-ubu 作者:[Arun Pyasi][a] 译者:[johnhoow](https://github.com/johnhoow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 32996ca88c5f62b7fdcc8c9be6fde6e32071cedd Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Mon, 4 May 2015 20:24:04 +0800 Subject: [PATCH 055/133] translated wi-cuckoo --- ...sed--How to Upgrade on Fedora or CentOS.md | 168 ------------------ ...sed--How to Upgrade on Fedora or CentOS.md | 167 +++++++++++++++++ 2 files changed, 167 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md create mode 100644 translated/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md diff --git a/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md b/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md deleted file mode 100644 index c3b1a737ce..0000000000 --- a/sources/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md +++ /dev/null @@ -1,168 +0,0 @@ -translating wi-cuckoo -Docker 1.6 Released - How to Upgrade on Fedora / CentOS -================================================================================ -Docker, a popular open source container platform for packaging applications, has a new release 1.6 with lot of new features in it. This version has updates to Docker Registry, Engine, Swarm, Compose and Machine. The release aims at improvements in performance, developer and system administrator experiences. Let us take a quick look at the new features available. - -**Docker Registry (2.0)** which is a service for pushing Docker images for storing and sharing, has undergone architectural changes as it was facing performance issues when under load. It is still backward compatible. The language in which Docker Registry is written is now changed from Python to Google's Go to improve performance. In combination with Docker Engine 1.6, it is capable of pulling the images faster. Earlier the images were delivered sequentially, but now in parallel. - -**Docker Engine (1.6)** is greatly improved from its previous version. It supports containers and image labels. With labels you can attach user-defined metadata to images and containers which in turn can be used by other tools. Labels will not be visible to the running applications and can be used to speed up the searching of containers and images. - -There is a Windows version of the Docker client which can connect to a remote Docker engine that runs Linux. - -Docker now supports logging driver API that allows us to send container logs to systems like Syslog or to a third-party. It is going to be benefitting the system administrators. - -**Swarm (0.2)** is a clustering tool for Docker which turns a pool of Docker hosts into one virtual host. In the new feature, containers are evenly placed on the available nodes. Effort is made towards supporting the complete Docker API by adding more Docker commands. In the future, it will be possible to use third-party drivers for clustering. - -**Compose (1.2)** which is a tool for defining and running complex applications in Docker has also got an upgrade. In the new version, one can create multiple sub-files instead of one flat file to describe a multi-container application. - -With **Machine (0.2)**, we can easily create Docker hosts on local computers, clouds and data centers. The new release provides a cleaner driver interface to write drivers for providers. Provisioning is handled centrally by Machine instead of each individual driver. New command added to regenerate host's TLS certificates which increases security. - -### Upgrade instructions on Fedora / CentOS ### - -In this section, let us learn how to upgrade the existing docker version to the latest on Fedora and CentOS. Please note that currently Docker runs only on 64-bit architecture. As both Fedora and CentOS are from RedHat, commands used are pretty much identical except that the Docker package in Fedora20 and CentOS6.5 is called “docker-io”. - -If you do not already have Docker installed on the system, install it using: - - "yum install docker-io" – on Fedora20 / CentOS6.5 - - "yum install docker" - on Fedora21 / CentOS7 - -Before upgrading, it is good to have a backup of the docker images and container volumes. - -Refer [filesystem to a tar archive][1] and [volumes backups, restores or migrations options][2] for more details. - -Currently the test system has Docker version 1.5 installed. Output shown in the examples are from a Fedora 20 system. - -Verify the current version of Docker installed on the system - - [root@TestNode1 ~]#sudo docker -v - - Docker version 1.5.0, build a8a31ef/1.5.0 - -If the Docker service is running, first stop it. - - [root@TestNode1 ~]# sudo systemctl stop docker - -Upgrade to the latest version using yum update. But at the time of writing this article, the repositories were not yet updated with the latest version(1.6). Hence you need to use the binary method of upgradation. - - [root@TestNode1 ~]#sudo yum -y update docker-io - - No packages marked for update - - [root@TestNode1 ~]#sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker - - --2015-04-19 13:40:48-- https://get.docker.com/builds/Linux/x86_64/docker-latest - - Resolving get.docker.com (get.docker.com)... 162.242.195.82 - - Connecting to get.docker.com (get.docker.com)|162.242.195.82|:443... connected. - - HTTP request sent, awaiting response... 200 OK - - Length: 15443598 (15M) [binary/octet-stream] - - Saving to: /usr/bin/docker - - 100%[======================================>] 15,443,598 8.72MB/s in 1.7s - - 2015-04-19 13:40:50 (8.72 MB/s) - /usr/bin/docker saved - -Check the updated version - - [root@TestNode1 ~]#sudo docker -v - - Docker version 1.6.0, build 4749651 - -Restart the docker service - - [root@TestNode1 ~]# sudo systemctl start docker - -Verify that Docker is working - - [root@TestNode1 ~]# docker images - - REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE - - fedora latest 834629358fe2 3 months ago 241.3 MB - - [root@TestNode1 ~]# docker run fedora /bin/echo Hello World - - Hello World - -**Note** on CentOS installation , after installing Docker on CentOS, you might get error messages like the following while trying to start the Docker service - - docker.service - Docker Application Container Engine - - Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled) - - Active: failed (Result: exit-code) since Mon 2015-04-20 03:24:24 EDT; 6h ago - - Docs: http://docs.docker.com - - Process: 21069 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=127) - - Main PID: 21069 (code=exited, status=127) - - Apr 20 03:24:24 centos7 systemd[1]: Starting Docker Application Container E..... - - Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)" - - Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)" - - Apr 20 03:24:24 centos7 docker[21069]: /usr/bin/docker: relocation error: /...ce - - Apr 20 03:24:24 centos7 systemd[1]: docker.service: main process exited, co.../a - - Apr 20 03:24:24 centos7 systemd[1]: Failed to start Docker Application Cont...e. - - Apr 20 03:24:24 centos7 systemd[1]: Unit docker.service entered failed state. - -This is a known bug ( [https://bugzilla.redhat.com/show_bug.cgi?id=1207839][3] ) and needs an upgrade of the device mapper to the latest level. - - [root@centos7 ~]# rpm -qa device-mapper - - device-mapper-1.02.84-14.el7.x86_64 - - [root@centos7 ~]# yum update device-mapper - - [root@centos7 ~]# rpm -qa device-mapper - - device-mapper-1.02.93-3.el7.x86_64 - - [root@centos7 ~]# systemctl start docker - -### Summary ### - -Though the docker technology is quite recent one, it is quickly gaining popularity. It has made life easy for developers and ops teams to quickly create and deploy applications respectively. With the company releasing quick updates to Docker in order to improve the product and address customer requirements, the future is definitely bright for Docker. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/docker-1-6-features-upgrade-fedora-centos/ - -作者:[B N Poornima][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/bnpoornima/ -[1]:http://docs.docker.com/reference/commandline/cli/#export -[2]:http://docs.docker.com/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes -[3]:https://bugzilla.redhat.com/show_bug.cgi?id=1207839 -[4]: -[5]: -[6]: -[7]: -[8]: -[9]: -[10]: -[11]: -[12]: -[13]: -[14]: -[15]: -[16]: -[17]: -[18]: -[19]: -[20]: diff --git a/translated/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md b/translated/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md new file mode 100644 index 0000000000..a07ecad986 --- /dev/null +++ b/translated/tech/20150429 Docker 1.6 Released--How to Upgrade on Fedora or CentOS.md @@ -0,0 +1,167 @@ +Docker 1.6 发布 - 如何在Fedora / CentOS上面升级 +============================================================================= +Docker,一个为软件打包的流行开源容器平台,有了新的发行版1.6,增加了许多新的特性。该版本在Docker注册,引擎,云集,组合和机器方面都有更新。这次发行旨在提升体验,开发者和系统管理员的经验(这里不太确定)。让我们来快速看看有哪些新特性吧。 + +**Docker Registry (2.0)**是一项推送Docker镜像用于存储和分享的服务,经历过架构的改变,因为面临加载下的体验问题。它仍然向下兼容。Docker Registry的编写语言现在从Python改为Google的Go语言了,为了提升表现力。与Docker引擎1.6结合后,拉取镜像的能力更快了。早先的镜像被队列式地输送,而现在是并行的啦。 + +**Docker Engine (1.6)**相比之前的版本有很大的提高。目前支持容器与镜像标签。通过标签,你可以附加用户自定义的元数据到镜像和容器上,而镜像和容器反过来可以被其他工具使用。标签对正在运行的应用是不可见的,可以用来加速搜索容器和镜像。 + +Windows版本的Docker客户端可以连接一个远程的运行linux的Docker引擎。 + +Docker目前支持日志驱动API,这允许我们发送容器日志给系统如Syslog,或者第三方。这将会使得系统管理员受益。 + +**Swarm (0.2)**是一个Docker集群工具,将一个Docker主机池转换为一个虚拟主机。在新特性里,容器甚至被放在了可用的节点上。通过添加更多的Docker命令,所有的努力都朝着支持完整的Docker API。将来,使用第三方驱动来集群会成为可能。 + +**Compose (1.2)** 是一个Docker里定义和运行复杂应用的工具, 也得到了升级。在新版本里,一个可以创建多个子文件,而不是一个没有结构的文件描述一个多容器应用。 + +通过**Machine (0.2)**,我们可以很容易地在本地计算机,云和数据中心上搭建Docker主机。新的发行版为开发者提供了一个相对干净地驱动界面来写驱动。供应被Machine牢牢地掌握,而不是每个独立的驱动。新的命令被添加,可以用来生成主机的TLS证书,以提高安全性。 + +### 在Fedora / CentOS 上升级架构 ### + +在这一部分里,我们将会学习如何在Fedora和CentOS上升级已有的docker到最新版本。请注意,目前的Docker仅运行在64位的架构上,Fedora和CentOS都源于RedHat,命令的使用是差不多相同的,除了在Fedora20和CentOS6.5里Docker包被叫做“docker-io”。 + +如果你系统之前没有安装Docker,使用下面命令安装: + + "yum install docker-io" – on Fedora20 / CentOS6.5 + + "yum install docker" - on Fedora21 / CentOS7 + +在升级之前,备份一下docker镜像和容器卷是个不错的主意。 + +参考[filesystem to a tar archive][1]与[volumes backups, restores or migrations options][2],获取更多信息。 + +目前,测试系统安装了Docker1.5。样例输出显示是来自一个Fedora20的系统。 + +验证当前系统安装的Docker版本 + + [root@TestNode1 ~]#sudo docker -v + + Docker version 1.5.0, build a8a31ef/1.5.0 + +如果Docker正在运行,先停掉。 + + [root@TestNode1 ~]# sudo systemctl stop docker + +升级到最新版使用yum update。但是写这篇文章的时候,仓库并不是最新版本(1.6)。因此你需要使用二进制的升级方法。 + + [root@TestNode1 ~]#sudo yum -y update docker-io + + No packages marked for update + + [root@TestNode1 ~]#sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker + + --2015-04-19 13:40:48-- https://get.docker.com/builds/Linux/x86_64/docker-latest + + Resolving get.docker.com (get.docker.com)... 162.242.195.82 + + Connecting to get.docker.com (get.docker.com)|162.242.195.82|:443... connected. + + HTTP request sent, awaiting response... 200 OK + + Length: 15443598 (15M) [binary/octet-stream] + + Saving to: /usr/bin/docker + + 100%[======================================>] 15,443,598 8.72MB/s in 1.7s + + 2015-04-19 13:40:50 (8.72 MB/s) - /usr/bin/docker saved + +检查更新版本 + + [root@TestNode1 ~]#sudo docker -v + + Docker version 1.6.0, build 4749651 + +重启docker服务 + + [root@TestNode1 ~]# sudo systemctl start docker + +确认Docker在运行 + + [root@TestNode1 ~]# docker images + + REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE + + fedora latest 834629358fe2 3 months ago 241.3 MB + + [root@TestNode1 ~]# docker run fedora /bin/echo Hello World + + Hello World + +CentOS安装时需要**注意**,在CentOS上安装完Docker后,当你试图启动Docker服务的时候,你可能会得到错误的信息,如下所示 + + docker.service - Docker Application Container Engine + + Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled) + + Active: failed (Result: exit-code) since Mon 2015-04-20 03:24:24 EDT; 6h ago + + Docs: http://docs.docker.com + + Process: 21069 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY (code=exited, status=127) + + Main PID: 21069 (code=exited, status=127) + + Apr 20 03:24:24 centos7 systemd[1]: Starting Docker Application Container E..... + + Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)" + + Apr 20 03:24:24 centos7 docker[21069]: time="2015-04-20T03:24:24-04:00" lev...)" + + Apr 20 03:24:24 centos7 docker[21069]: /usr/bin/docker: relocation error: /...ce + + Apr 20 03:24:24 centos7 systemd[1]: docker.service: main process exited, co.../a + + Apr 20 03:24:24 centos7 systemd[1]: Failed to start Docker Application Cont...e. + + Apr 20 03:24:24 centos7 systemd[1]: Unit docker.service entered failed state. + +这是一个熟知的bug([https://bugzilla.redhat.com/show_bug.cgi?id=1207839][3]),需要一个设备映射的升级,到最新的水平。 + + [root@centos7 ~]# rpm -qa device-mapper + + device-mapper-1.02.84-14.el7.x86_64 + + [root@centos7 ~]# yum update device-mapper + + [root@centos7 ~]# rpm -qa device-mapper + + device-mapper-1.02.93-3.el7.x86_64 + + [root@centos7 ~]# systemctl start docker + +### 总结 ### + +尽管docker技术出现时间不长,当很快获得了流行。它使得开发者的生活变得容易,运维团队可以快速独立地创建和部署应用。通过公司发布快速的Docker更新,来提升产品质量,满足用户需求,未来对于Docker来说一片光明。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/docker-1-6-features-upgrade-fedora-centos/ + +作者:[B N Poornima][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/bnpoornima/ +[1]:http://docs.docker.com/reference/commandline/cli/#export +[2]:http://docs.docker.com/userguide/dockervolumes/#backup-restore-or-migrate-data-volumes +[3]:https://bugzilla.redhat.com/show_bug.cgi?id=1207839 +[4]: +[5]: +[6]: +[7]: +[8]: +[9]: +[10]: +[11]: +[12]: +[13]: +[14]: +[15]: +[16]: +[17]: +[18]: +[19]: +[20]: From 6113b6009f1ed44787131af0516cc5a09573d54f Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 4 May 2015 21:59:14 +0800 Subject: [PATCH 056/133] PUB:20150108 Interface (NICs) Bonding in Linux using nmcli @ictlyh --- ...nterface (NICs) Bonding in Linux using nmcli.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150108 Interface (NICs) Bonding in Linux using nmcli.md (82%) diff --git a/translated/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md b/published/20150108 Interface (NICs) Bonding in Linux using nmcli.md similarity index 82% rename from translated/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md rename to published/20150108 Interface (NICs) Bonding in Linux using nmcli.md index 0b5bf2cd8e..fa8297599b 100644 --- a/translated/tech/20150108 Interface (NICs) Bonding in Linux using nmcli.md +++ b/published/20150108 Interface (NICs) Bonding in Linux using nmcli.md @@ -1,15 +1,15 @@ -在 Linux 中用 nmcli 命令绑定网卡(NICs) +在 Linux 中用 nmcli 命令绑定多块网卡 ================================================================================ -今天,我们来学习一下在 CentOS 7.x 中如何用 nmcli(Network Manager Command Line Interface:网络管理命令行接口) 进行网卡(NICs 译者注:Netword Interface Card,网卡或网络适配器)绑定(译者注:bond 是指把多个物理网卡绑定成一个逻辑上的网卡,这样多个网卡可以使用同一个 IP 从而可以避免单点故障)。 +今天,我们来学习一下在 CentOS 7.x 中如何用 nmcli(Network Manager Command Line Interface:网络管理命令行接口)进行网卡绑定。 -网卡绑定是将 **网卡** 逻辑地连接到一起从而允许故障转移或者提高吞吐率的方法。提高服务器网络可用性的一个方式是使用多个网卡。Linux 绑定驱动提供了一个将多个网卡聚合到一个逻辑绑定接口的方法。这是个并不影响 linux 内核中旧绑定驱动的新的实现;它提供了另一种实现方法。 +网卡(接口)绑定是将多块 **网卡** 逻辑地连接到一起从而允许故障转移或者提高吞吐率的方法。提高服务器网络可用性的一个方式是使用多个网卡。Linux 绑定驱动程序提供了一种将多个网卡聚合到一个逻辑的绑定接口的方法。这是个新的实现绑定的方法,并不影响 linux 内核中旧绑定驱动。 **网卡绑定为我们提供了两个主要的好处:** 1. **高带宽** 1. **冗余/弹性** -现在让我们在 CentOS 7 上配置网卡绑定吧。我们需要决定选取哪些接口配置成一个组接口。 +现在让我们在 CentOS 7 上配置网卡绑定吧。我们需要决定选取哪些接口配置成一个组接口(Team interface)。 运行 **ip link** 命令查看系统中可用的接口。 @@ -45,7 +45,7 @@ ### 2. 添加从设备 ### -现在让我们天际从设备到主设备 team0。这是添加从设备的语法。 +现在让我们添加从设备到主设备 team0。这是添加从设备的语法: # nmcli con add type team-slave con-name CNAME ifname INAME master TEAM @@ -89,7 +89,7 @@ ![teamdctl 检查主动备份](http://blog.linoxide.com/wp-content/uploads/2015/01/teamdctl-activebackup-check.png) -现在让我们和激活的端口断开连接并再次检查状态来确认主动备份配置是否像希望的那样工作。 +现在让我们把激活的端口断开连接并再次检查状态来确认主动备份配置是否像希望的那样工作。 # nmcli dev dis eno33554960 @@ -129,7 +129,7 @@ via: http://linoxide.com/linux-command/interface-nics-bonding-linux/ 作者:[Arun Pyasi][a] 译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 48388fdc8158cbd6617de24b9008da9b128d9d54 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 4 May 2015 22:05:33 +0800 Subject: [PATCH 057/133] PUB:20150316 Install Mate desktop in FreeBSD 10.1 @geekpi --- .../20150316 Install Mate desktop in FreeBSD 10.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/tech => published}/20150316 Install Mate desktop in FreeBSD 10.1.md (97%) diff --git a/translated/tech/20150316 Install Mate desktop in FreeBSD 10.1.md b/published/20150316 Install Mate desktop in FreeBSD 10.1.md similarity index 97% rename from translated/tech/20150316 Install Mate desktop in FreeBSD 10.1.md rename to published/20150316 Install Mate desktop in FreeBSD 10.1.md index 76d05da5ab..ed4aa9d18b 100644 --- a/translated/tech/20150316 Install Mate desktop in FreeBSD 10.1.md +++ b/published/20150316 Install Mate desktop in FreeBSD 10.1.md @@ -54,7 +54,7 @@ via: http://www.unixmen.com/install-mate-desktop-freebsd-10-1/ 作者:[M.el Khamlichi][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 31714d8239ac6918a9771bb0bad6ebaa02507ae7 Mon Sep 17 00:00:00 2001 From: chenjt Date: Tue, 5 May 2015 09:09:37 +0800 Subject: [PATCH 058/133] translated 5 rows --- ...set up networking between Docker containers.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename {sources => translated}/tech/20150323 How to set up networking between Docker containers.md (79%) diff --git a/sources/tech/20150323 How to set up networking between Docker containers.md b/translated/tech/20150323 How to set up networking between Docker containers.md similarity index 79% rename from sources/tech/20150323 How to set up networking between Docker containers.md rename to translated/tech/20150323 How to set up networking between Docker containers.md index dca3457c4e..41a67c6b70 100644 --- a/sources/tech/20150323 How to set up networking between Docker containers.md +++ b/translated/tech/20150323 How to set up networking between Docker containers.md @@ -1,19 +1,18 @@ -[bazz222] -How to set up networking between Docker containers +如何在 Docker 容器之间设置网络 ================================================================================ -As you may be aware, Docker container technology has emerged as a viable lightweight alternative to full-blown virtualization. There are a growing number of use cases of Docker that the industry adopted in different contexts, for example, enabling rapid build environment, simplifying configuration of your infrastructure, isolating applications in multi-tenant environment, and so on. While you can certainly deploy an application sandbox in a standalone Docker container, many real-world use cases of Docker in production environments may involve deploying a complex multi-tier application in an ensemble of multiple containers, where each container plays a specific role (e.g., load balancer, LAMP stack, database, UI). +你也许已经知道了,Docker 容器技术是现有的成熟虚拟化技术的一个替代方案。它被企业应用在越来越多的领域中,比如快速部署环境、简化基础设施的配置流程、多客户环境间的互相隔离等等。当你开始在真实的生产环境使用 Docker 容器去部署应用沙箱时,你可能需要用到多个容器部署一套复杂的多层应用系统,其中每个容器负责一个特定的功能(例如负载均衡、LAMP 栈、数据库、UI 等)。 -There comes the problem of **Docker container networking**: How can we interconnect different Docker containers spawned potentially across different hosts when we do not know beforehand on which host each container will be created? +那么问题来了:有多台宿主机,我们事先不知道会在哪台宿主机上创建容器,如果保证在这些宿主机上创建的容器们可以互相联网? -One pretty neat open-source solution for this is [weave][1]. This tool makes interconnecting multiple Docker containers pretty much hassle-free. When I say this, I really mean it. +联网技术哪家强?开源方案找 [weave][1]。这个工具可以为你省下不少烦恼。听我的准没错,谁用谁知道。 -In this tutorial, I am going to demonstrate **how to set up Docker networking across different hosts using weave**. +于是本教程的主题就变成了“**如何使用 weave 在不同主机上的 Docker 容器之间设置网络**”。 -### How Weave Works ### +### Weave 是如何工作的 ### ![](https://farm8.staticflickr.com/7288/16662287067_27888684a7_b.jpg) -Let's first see how weave works. Weave creates a network of "peers", where each peer is a virtual router container called "weave router" residing on a distinct host. The weave routers on different hosts maintain TCP connections among themselves to exchange topology information. They also establish UDP connections among themselves to carry inter-container traffic. A weave router on each host is then connected via a bridge to all other Docker containers created on the host. When two containers on different hosts want to exchange traffic, a weave router on each host captures their traffic via a bridge, encapsulates the traffic with UDP, and forwards it to the other router over a UDP connection. +让我们先来看看 weave 怎么工作:先创建一个由多个 peer 组成的对等网络,每个 peer 是一个虚拟路由器容器,叫做“weave 路由器”,它们分布在不同的宿主机上。这个对等网络的每个 peer 之间会维持一个 TCP 链接,用于互相交换拓扑信息,它们也会建立 UDP 链接用于容器间通信。一个 weave 路由器通过桥接技术连接到其他本宿主机上的其他容器。当处于不同宿主机上的两个容器想要通信,一台宿主机上的 weave 路由器用网桥截获数据包,使用 UDP 协议封装后发给另一台宿主机上的 weave 路由器。 Each weave router maintains up-to-date weave router topology information, as well as container's MAC address information (similar to switch's MAC learning), so that it can make forwarding decision on container traffic. Weave is able to route traffic between containers created on hosts which are not directly reachable, as long as two hosts are interconnected via an intermediate weave router on weave topology. Optionally, weave routers can be set to encrypt both TCP control data and UDP data traffic based on public key cryptography. From 641402750c9225c15d29ccfcbe5cda7db5ac9a19 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Tue, 5 May 2015 16:00:16 +0800 Subject: [PATCH 059/133] transalting wi-cuckoo --- .../share/20150429 What are good command line HTTP clients.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/share/20150429 What are good command line HTTP clients.md b/sources/share/20150429 What are good command line HTTP clients.md index d809be1a06..a06e4e34db 100644 --- a/sources/share/20150429 What are good command line HTTP clients.md +++ b/sources/share/20150429 What are good command line HTTP clients.md @@ -1,3 +1,4 @@ +translating wi-cuckoo What are good command line HTTP clients? ================================================================================ The whole is greater than the sum of its parts is a very famous quote from Aristotle, a Greek philosopher and scientist. This quote is particularly pertinent to Linux. In my view, one of Linux's biggest strengths is its synergy. The usefulness of Linux doesn't derive only from the huge raft of open source (command line) utilities. Instead, it's the synergy generated by using them together, sometimes in conjunction with larger applications. @@ -107,4 +108,4 @@ via: http://www.linuxlinks.com/article/20150425174537249/HTTPclients.html [1]:http://httpie.org/ [2]:http://curl.haxx.se/ -[3]:https://www.gnu.org/software/wget/ \ No newline at end of file +[3]:https://www.gnu.org/software/wget/ From c3a9eb6992da60207765ffb3901bd1dd8ee7ad5c Mon Sep 17 00:00:00 2001 From: DeadFire Date: Tue, 5 May 2015 16:43:45 +0800 Subject: [PATCH 060/133] =?UTF-8?q?20150505-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...5 Bodhi Linux Introduces Moksha Desktop.md | 40 ++ ...es and Units Using 'Systemctl' in Linux.md | 579 ++++++++++++++++++ 2 files changed, 619 insertions(+) create mode 100644 sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md create mode 100644 sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md diff --git a/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md b/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md new file mode 100644 index 0000000000..0b4d61993d --- /dev/null +++ b/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md @@ -0,0 +1,40 @@ +Bodhi Linux Introduces Moksha Desktop +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Bodhi_Linux.jpg) + +Ubuntu based lightweight Linux distribution [Bodhi Linux][1] is working on a desktop environment of its own. This new desktop environment will be called Moksha (Sanskrit for ‘complete freedom’). Moksha will be replacing the usual [Enlightenment desktop environment][2]. + +### Why Moksha instead of Enlightenment? ### + +Jeff Hoogland of Bodhi Linux [says][3] that he had been unhappy with the newer versions of Enlightenment in the recent past. Until E17, Enlightenment was very stable and complemented well to the need of a lightweight Linux OS, but the E18 was so full of bugs that Bodhi Linux skipped it altogether. + +While the latest [Bodhi Linux 3.0.0 release][4] uses E19 (except the legacy mode, meant for older hardware, still uses E17), Jeff is not happy with E19 as well. He quotes: + +> On top of the performance issues, E19 did not allow for me personally to have the same workflow I enjoyed under E17 due to features it no longer had. Because of this I had changed to using the E17 on all of my Bodhi 3 computers – even my high end ones. This got me to thinking how many of our existing Bodhi users felt the same way, so I [opened a discussion about it on our user forums][5]. + +### Moksha is continuation of the E17 desktop ### + +Moksha will be a continuation of Bodhi’s favorite E17 desktop. Jeff further mentions: + +> We will start by integrating all of the Bodhi changes we have simply been patching into the source code over the years and fixing the few issues the desktop has. Once this is done we will begin back porting a few of the more useful features E18 and E19 introduced to the Enlightenment desktop and finally, we will introduce a few new things we think will improve the end user experience. + +### When will Moksha release? ### + +The next update to Bodhi will be Bodhi 3.1.0 in August this year. This new release will bring Moksha on all of its default ISOs. Let’s wait and watch to see if Moksha turns out to be a good decision or not. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/bodhi-linux-introduces-moksha-desktop/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://www.bodhilinux.com/ +[2]:https://www.enlightenment.org/ +[3]:http://www.bodhilinux.com/2015/04/28/introducing-the-moksha-desktop/ +[4]:http://itsfoss.com/bodhi-linux-3/ +[5]:http://forums.bodhilinux.com/index.php?/topic/12322-e17-vs-e19-which-are-you-using-and-why/ \ No newline at end of file diff --git a/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md b/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md new file mode 100644 index 0000000000..60e41c57ab --- /dev/null +++ b/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md @@ -0,0 +1,579 @@ +How to Manage ‘Systemd’ Services and Units Using ‘Systemctl’ in Linux +================================================================================ +Systemctl is a systemd utility which is responsible for Controlling the systemd system and service manager. + +Systemd is a collection of system management daemons, utilities and libraries which serves as a replacement of System V init daemon. Systemd functions as central management and configuration platform for UNIX like system. + +In the Linux Ecosystem Systemd has been implemented on most of the standard Linux Distribution with a few exception. Systemd is the parent Process of all other daemons oftenly but not always. + +![Manage Linux Services Using Systemctl](http://www.tecmint.com/wp-content/uploads/2015/04/Manage-Linux-Services-Using-Systemctl.jpg) +Manage Linux Services Using Systemctl + +This article aims at throwing light on “How to control System and Services” on a system running systemd. + +### Starting with Systemtd and Systemctl Basics ### + +#### 1. First check if systemd is installed on your system or not and what is the version of currently installed Systemd? #### + + # systemd --version + + systemd 215 + +PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR + +It’s clear from the above example, that we have systemd 215 version Installed. + +#### 2. Check where the binaries and libraries of systemd and systemctl are installed. #### + + # whereis systemd + systemd: /usr/lib/systemd /etc/systemd /usr/share/systemd /usr/share/man/man1/systemd.1.gz + + + # whereis systemctl + systemctl: /usr/bin/systemctl /usr/share/man/man1/systemctl.1.gz + +#### 3. Check whether systemd is running or not. #### + + # ps -eaf | grep [s]ystemd + + root 1 0 0 16:27 ? 00:00:00 /usr/lib/systemd/systemd --switched-root --system --deserialize 23 + root 444 1 0 16:27 ? 00:00:00 /usr/lib/systemd/systemd-journald + root 469 1 0 16:27 ? 00:00:00 /usr/lib/systemd/systemd-udevd + root 555 1 0 16:27 ? 00:00:00 /usr/lib/systemd/systemd-logind + dbus 556 1 0 16:27 ? 00:00:00 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation + +**Notice**: systemd is running as parent daemon (PID=1). In the above command ps with (-e) select all Processes, (- + +a) select all processes except session leaders and (-f) for full format listing (i.e. -eaf). + +Also note the square brackets in the above example and rest of the examples to follow. Square Bracket expression is part of grep’s character class pattern matching. + +#### 4. Analyze systemd boot process. #### + + # systemd-analyze + Startup finished in 487ms (kernel) + 2.776s (initrd) + 20.229s (userspace) = 23.493s + +#### 5. Analyze time taken by each process at boot. #### + + # systemd-analyze blame + + 8.565s mariadb.service + 7.991s webmin.service + 6.095s postfix.service + 4.311s httpd.service + 3.926s firewalld.service + 3.780s kdump.service + 3.238s tuned.service + 1.712s network.service + 1.394s lvm2-monitor.service + 1.126s systemd-logind.service + .... + +#### 6. Analyze critical chain at boot. #### + + # systemd-analyze critical-chain + + The time after the unit is active or started is printed after the "@" character. + The time the unit takes to start is printed after the "+" character. + + multi-user.target @20.222s + └─mariadb.service @11.657s +8.565s + └─network.target @11.168s + └─network.service @9.456s +1.712s + └─NetworkManager.service @8.858s +596ms + └─firewalld.service @4.931s +3.926s + └─basic.target @4.916s + └─sockets.target @4.916s + └─dbus.socket @4.916s + └─sysinit.target @4.905s + └─systemd-update-utmp.service @4.864s +39ms + └─auditd.service @4.563s +301ms + └─systemd-tmpfiles-setup.service @4.485s +69ms + └─rhel-import-state.service @4.342s +142ms + └─local-fs.target @4.324s + └─boot.mount @4.286s +31ms + └─systemd-fsck@dev-disk-by\x2duuid-79f594ad\x2da332\x2d4730\x2dbb5f\x2d85d19608096 + └─dev-disk-by\x2duuid-79f594ad\x2da332\x2d4730\x2dbb5f\x2d85d196080964.device @4 + +**Important**: Systemctl accepts services (.service), mount point (.mount), sockets (.socket) and devices (.device) as units. + +#### 7. List all the available units. #### + + # systemctl list-unit-files + + UNIT FILE STATE + proc-sys-fs-binfmt_misc.automount static + dev-hugepages.mount static + dev-mqueue.mount static + proc-sys-fs-binfmt_misc.mount static + sys-fs-fuse-connections.mount static + sys-kernel-config.mount static + sys-kernel-debug.mount static + tmp.mount disabled + brandbot.path disabled + ..... + +#### 8. List all running units. #### + + # systemctl list-units + + UNIT LOAD ACTIVE SUB DESCRIPTION + proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File Syste + sys-devices-pc...0-1:0:0:0-block-sr0.device loaded active plugged VBOX_CD-ROM + sys-devices-pc...:00:03.0-net-enp0s3.device loaded active plugged PRO/1000 MT Desktop Adapter + sys-devices-pc...00:05.0-sound-card0.device loaded active plugged 82801AA AC'97 Audio Controller + sys-devices-pc...:0:0-block-sda-sda1.device loaded active plugged VBOX_HARDDISK + sys-devices-pc...:0:0-block-sda-sda2.device loaded active plugged LVM PV Qzyo3l-qYaL-uRUa-Cjuk-pljo-qKtX-VgBQ8 + sys-devices-pc...0-2:0:0:0-block-sda.device loaded active plugged VBOX_HARDDISK + sys-devices-pl...erial8250-tty-ttyS0.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS0 + sys-devices-pl...erial8250-tty-ttyS1.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS1 + sys-devices-pl...erial8250-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS2 + sys-devices-pl...erial8250-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/tty/ttyS3 + sys-devices-virtual-block-dm\x2d0.device loaded active plugged /sys/devices/virtual/block/dm-0 + sys-devices-virtual-block-dm\x2d1.device loaded active plugged /sys/devices/virtual/block/dm-1 + sys-module-configfs.device loaded active plugged /sys/module/configfs + ... + +#### 9. List all failed units. #### + + # systemctl --failed + + UNIT LOAD ACTIVE SUB DESCRIPTION + kdump.service loaded failed failed Crash recovery kernel arming + + LOAD = Reflects whether the unit definition was properly loaded. + ACTIVE = The high-level unit activation state, i.e. generalization of SUB. + SUB = The low-level unit activation state, values depend on unit type. + + 1 loaded units listed. Pass --all to see loaded but inactive units, too. + To show all installed unit files use 'systemctl list-unit-files'. + +#### 10. Check if a Unit (cron.service) is enabled or not?. #### + + # systemctl is-enabled crond.service + + enabled + +#### 11. Check whether a Unit or Service is running or not?. #### + + # systemctl status firewalld.service + + firewalld.service - firewalld - dynamic firewall daemon + Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled) + Active: active (running) since Tue 2015-04-28 16:27:55 IST; 34min ago + Main PID: 549 (firewalld) + CGroup: /system.slice/firewalld.service + └─549 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid + + Apr 28 16:27:51 tecmint systemd[1]: Starting firewalld - dynamic firewall daemon... + Apr 28 16:27:55 tecmint systemd[1]: Started firewalld - dynamic firewall daemon. + +### Control and Manage Services Using Systemctl ### + +#### 12. List all services (including enabled and disabled). #### + + # systemctl list-unit-files --type=service + + UNIT FILE STATE + arp-ethers.service disabled + auditd.service enabled + autovt@.service disabled + blk-availability.service disabled + brandbot.service static + collectd.service disabled + console-getty.service disabled + console-shell.service disabled + cpupower.service disabled + crond.service enabled + dbus-org.fedoraproject.FirewallD1.service enabled + .... + +#### 13. How do I start, restart, stop, reload and check the status of a service (httpd.service) in Linux. #### + + # systemctl start httpd.service + # systemctl restart httpd.service + # systemctl stop httpd.service + # systemctl reload httpd.service + # systemctl status httpd.service + + httpd.service - The Apache HTTP Server + Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled) + Active: active (running) since Tue 2015-04-28 17:21:30 IST; 6s ago + Process: 2876 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS) + Main PID: 2881 (httpd) + Status: "Processing requests..." + CGroup: /system.slice/httpd.service + ├─2881 /usr/sbin/httpd -DFOREGROUND + ├─2884 /usr/sbin/httpd -DFOREGROUND + ├─2885 /usr/sbin/httpd -DFOREGROUND + ├─2886 /usr/sbin/httpd -DFOREGROUND + ├─2887 /usr/sbin/httpd -DFOREGROUND + └─2888 /usr/sbin/httpd -DFOREGROUND + + Apr 28 17:21:30 tecmint systemd[1]: Starting The Apache HTTP Server... + Apr 28 17:21:30 tecmint httpd[2881]: AH00558: httpd: Could not reliably determine the server's fully q...ssage + Apr 28 17:21:30 tecmint systemd[1]: Started The Apache HTTP Server. + Hint: Some lines were ellipsized, use -l to show in full. + +**Note**: When we use commands like start, restart, stop and reload with systemctl, we will not get any output on the terminal, only status command will print the output. + +#### 14. How to active a service and enable or disable a service at boot time (auto start service at system boot). #### + + # systemctl is-active httpd.service + # systemctl enable httpd.service + # systemctl disable httpd.service + +#### 15. How to mask (making it impossible to start) or unmask a service (httpd.service). #### + + # systemctl mask httpd.service + ln -s '/dev/null' '/etc/systemd/system/httpd.service' + + # systemctl unmask httpd.service + rm '/etc/systemd/system/httpd.service' + +#### 16. How to a Kill a service using systemctl command. #### + + # systemctl kill httpd + # systemctl status httpd + + httpd.service - The Apache HTTP Server + Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled) + Active: failed (Result: exit-code) since Tue 2015-04-28 18:01:42 IST; 28min ago + Main PID: 2881 (code=exited, status=0/SUCCESS) + Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec" + + Apr 28 17:37:29 tecmint systemd[1]: httpd.service: Got notification message from PID 2881, but recepti...bled. + Apr 28 17:37:29 tecmint systemd[1]: httpd.service: Got notification message from PID 2881, but recepti...bled. + Apr 28 17:37:39 tecmint systemd[1]: httpd.service: Got notification message from PID 2881, but recepti...bled. + Apr 28 17:37:39 tecmint systemd[1]: httpd.service: Got notification message from PID 2881, but recepti...bled. + Apr 28 17:37:49 tecmint systemd[1]: httpd.service: Got notification message from PID 2881, but recepti...bled. + Apr 28 17:37:49 tecmint systemd[1]: httpd.service: Got notification message from PID 2881, but recepti...bled. + Apr 28 17:37:59 tecmint systemd[1]: httpd.service: Got notification message from PID 2881, but recepti...bled. + Apr 28 17:37:59 tecmint systemd[1]: httpd.service: Got notification message from PID 2881, but recepti...bled. + Apr 28 18:01:42 tecmint systemd[1]: httpd.service: control process exited, code=exited status=226 + Apr 28 18:01:42 tecmint systemd[1]: Unit httpd.service entered failed state. + Hint: Some lines were ellipsized, use -l to show in full. + +### Control and Manage Mount Points using Systemctl ### + +#### 17. List all system mount points. #### + + # systemctl list-unit-files --type=mount + + UNIT FILE STATE + dev-hugepages.mount static + dev-mqueue.mount static + proc-sys-fs-binfmt_misc.mount static + sys-fs-fuse-connections.mount static + sys-kernel-config.mount static + sys-kernel-debug.mount static + tmp.mount disabled + +#### 18. How do I mount, unmount, remount, reload system mount points and also check the status of mount points on the system. #### + + # systemctl start tmp.mount + # systemctl stop tmp.mount + # systemctl restart tmp.mount + # systemctl reload tmp.mount + # systemctl status tmp.mount + + tmp.mount - Temporary Directory + Loaded: loaded (/usr/lib/systemd/system/tmp.mount; disabled) + Active: active (mounted) since Tue 2015-04-28 17:46:06 IST; 2min 48s ago + Where: /tmp + What: tmpfs + Docs: man:hier(7) + + http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems + + Process: 3908 ExecMount=/bin/mount tmpfs /tmp -t tmpfs -o mode=1777,strictatime (code=exited, status=0/SUCCESS) + + Apr 28 17:46:06 tecmint systemd[1]: Mounting Temporary Directory... + Apr 28 17:46:06 tecmint systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting anyway. + Apr 28 17:46:06 tecmint systemd[1]: Mounted Temporary Directory. + +#### 19. How to active, enable or disable a mount point at boot time (auto mount at system boot). #### + + # systemctl is-active tmp.mount + # systemctl enable tmp.mount + # systemctl disable tmp.mount + +#### 20. How to mask (making it impossible to start) or unmask a mount points in Linux. #### + + # systemctl mask tmp.mount + + ln -s '/dev/null' '/etc/systemd/system/tmp.mount' + + # systemctl unmask tmp.mount + + rm '/etc/systemd/system/tmp.mount' + +### Control and Manage Sockets using Systemctl ### + +#### 21. List all available system sockets. #### + + # systemctl list-unit-files --type=socket + + UNIT FILE STATE + dbus.socket static + dm-event.socket enabled + lvm2-lvmetad.socket enabled + rsyncd.socket disabled + sshd.socket disabled + syslog.socket static + systemd-initctl.socket static + systemd-journald.socket static + systemd-shutdownd.socket static + systemd-udevd-control.socket static + systemd-udevd-kernel.socket static + + 11 unit files listed. + +#### 22. How do I start, restart, stop, reload and check the status of a socket (example: cups.socket) in Linux. #### + + # systemctl start cups.socket + # systemctl restart cups.socket + # systemctl stop cups.socket + # systemctl reload cups.socket + # systemctl status cups.socket + + cups.socket - CUPS Printing Service Sockets + Loaded: loaded (/usr/lib/systemd/system/cups.socket; enabled) + Active: active (listening) since Tue 2015-04-28 18:10:59 IST; 8s ago + Listen: /var/run/cups/cups.sock (Stream) + + Apr 28 18:10:59 tecmint systemd[1]: Starting CUPS Printing Service Sockets. + Apr 28 18:10:59 tecmint systemd[1]: Listening on CUPS Printing Service Sockets. + +#### 23. How to active a socket and enable or disable at boot time (auto start socket at system boot). #### + + # systemctl is-active cups.socket + # systemctl enable cups.socket + # systemctl disable cups.socket + +#### 24. How to mask (making it impossible to start) or unmask a socket (cups.socket). #### + + # systemctl mask cups.socket + ln -s '/dev/null' '/etc/systemd/system/cups.socket' + + # systemctl unmask cups.socket + rm '/etc/systemd/system/cups.socket' + +### CPU Utilization (Shares) of a Service ### + +#### 25. Get the current CPU Shares of a Service (say httpd). #### + + # systemctl show -p CPUShares httpd.service + + CPUShares=1024 + +**Note**: The default each service has a CPUShare = 1024. You may increase/decrease CPU share of a process. + +#### 26. Limit the CPU Share of a service (httpd.service) to 2000 CPUShares/ #### + + # systemctl set-property httpd.service CPUShares=2000 + # systemctl show -p CPUShares httpd.service + + CPUShares=2000 + +**Note**: When you set CPUShare for a service, a directory with the name of service is created (httpd.service.d) which contains a file 90-CPUShares.conf which contains the CPUShare Limit information. You may view the file as: + + # vi /etc/systemd/system/httpd.service.d/90-CPUShares.conf + + [Service] + CPUShares=2000 + +#### 27. Check all the configuration details of a service. #### + + # systemctl show httpd + + Id=httpd.service + Names=httpd.service + Requires=basic.target + Wants=system.slice + WantedBy=multi-user.target + Conflicts=shutdown.target + Before=shutdown.target multi-user.target + After=network.target remote-fs.target nss-lookup.target systemd-journald.socket basic.target system.slice + Description=The Apache HTTP Server + LoadState=loaded + ActiveState=active + SubState=running + FragmentPath=/usr/lib/systemd/system/httpd.service + .... + +#### 28. Analyze critical chain for a services(httpd). #### + + # systemd-analyze critical-chain httpd.service + + The time after the unit is active or started is printed after the "@" character. + The time the unit takes to start is printed after the "+" character. + + httpd.service +142ms + └─network.target @11.168s + └─network.service @9.456s +1.712s + └─NetworkManager.service @8.858s +596ms + └─firewalld.service @4.931s +3.926s + └─basic.target @4.916s + └─sockets.target @4.916s + └─dbus.socket @4.916s + └─sysinit.target @4.905s + └─systemd-update-utmp.service @4.864s +39ms + └─auditd.service @4.563s +301ms + └─systemd-tmpfiles-setup.service @4.485s +69ms + └─rhel-import-state.service @4.342s +142ms + └─local-fs.target @4.324s + └─boot.mount @4.286s +31ms + └─systemd-fsck@dev-disk-by\x2duuid-79f594ad\x2da332\x2d4730\x2dbb5f\x2d85d196080964.service @4.092s +149ms + └─dev-disk-by\x2duuid-79f594ad\x2da332\x2d4730\x2dbb5f\x2d85d196080964.device @4.092s + +#### 29. Get a list of dependencies for a services (httpd). #### + + # systemctl list-dependencies httpd.service + + httpd.service + ├─system.slice + └─basic.target + ├─firewalld.service + ├─microcode.service + ├─rhel-autorelabel-mark.service + ├─rhel-autorelabel.service + ├─rhel-configure.service + ├─rhel-dmesg.service + ├─rhel-loadmodules.service + ├─paths.target + ├─slices.target + │ ├─-.slice + │ └─system.slice + ├─sockets.target + │ ├─dbus.socket + .... + +#### 30. List control groups hierarchically. #### + + # systemd-cgls + + ├─1 /usr/lib/systemd/systemd --switched-root --system --deserialize 23 + ├─user.slice + │ └─user-0.slice + │ └─session-1.scope + │ ├─2498 sshd: root@pts/0 + │ ├─2500 -bash + │ ├─4521 systemd-cgls + │ └─4522 systemd-cgls + └─system.slice + ├─httpd.service + │ ├─4440 /usr/sbin/httpd -DFOREGROUND + │ ├─4442 /usr/sbin/httpd -DFOREGROUND + │ ├─4443 /usr/sbin/httpd -DFOREGROUND + │ ├─4444 /usr/sbin/httpd -DFOREGROUND + │ ├─4445 /usr/sbin/httpd -DFOREGROUND + │ └─4446 /usr/sbin/httpd -DFOREGROUND + ├─polkit.service + │ └─721 /usr/lib/polkit-1/polkitd --no-debug + .... + +#### 31. List control group according to CPU, memory, Input and Output. #### + + # systemd-cgtop + + Path Tasks %CPU Memory Input/s Output/s + + / 83 1.0 437.8M - - + /system.slice - 0.1 - - - + /system.slice/mariadb.service 2 0.1 - - - + /system.slice/tuned.service 1 0.0 - - - + /system.slice/httpd.service 6 0.0 - - - + /system.slice/NetworkManager.service 1 - - - - + /system.slice/atop.service 1 - - - - + /system.slice/atopacct.service 1 - - - - + /system.slice/auditd.service 1 - - - - + /system.slice/crond.service 1 - - - - + /system.slice/dbus.service 1 - - - - + /system.slice/firewalld.service 1 - - - - + /system.slice/lvm2-lvmetad.service 1 - - - - + /system.slice/polkit.service 1 - - - - + /system.slice/postfix.service 3 - - - - + /system.slice/rsyslog.service 1 - - - - + /system.slice/system-getty.slice/getty@tty1.service 1 - - - - + /system.slice/systemd-journald.service 1 - - - - + /system.slice/systemd-logind.service 1 - - - - + /system.slice/systemd-udevd.service 1 - - - - + /system.slice/webmin.service 1 - - - - + /user.slice/user-0.slice/session-1.scope 3 - - - - + +### Control System Runlevels ### + +#### 32. How to start system rescue mode. #### + + # systemctl rescue + + Broadcast message from root@tecmint on pts/0 (Wed 2015-04-29 11:31:18 IST): + + The system is going down to rescue mode NOW! + +#### 33. How to enter into emergency mode. #### + + # systemctl emergency + + Welcome to emergency mode! After logging in, type "journalctl -xb" to view + system logs, "systemctl reboot" to reboot, "systemctl default" to try again + to boot into default mode. + +#### 34. List current run levels in use. #### + + # systemctl get-default + + multi-user.target + +#### 35. How to start Runlevel 5 aka graphical mode. #### + + # systemctl isolate runlevel5.target + OR + # systemctl isolate graphical.target + +#### 36. How to start Runlevel 3 aka multiuser mode (commandline). #### + + # systemctl isolate runlevel3.target + OR + # systemctl isolate multiuser.target + +#### 36. How to set multiusermode or graphical mode as default runlevel. #### + + # systemctl set-default runlevel3.target + + # systemctl set-default runlevel5.target + +#### 37. How to reboot, halt, suspend, hibernate or put system in hybrid-sleep. #### + + # systemctl reboot + + # systemctl halt + + # systemctl suspend + + # systemctl hibernate + + # systemctl hybrid-sleep + +For those who may not be aware of runlevels and what it does. + +- Runlevel 0 : Shut down and Power off the system. +- Runlevel 1 : Rescue?Maintainance Mode. +- Runlevel 3 : multiuser, no-graphic system. +- Runlevel 4 : multiuser, no-graphic system. +- Runlevel 5 : multiuser, graphical system. +- Runlevel 6 : Shutdown and Reboot the machine. + +That’s all for now. Keep connected! Keep commenting. Don’t forget to provide us with your valuable feedback in the comments below. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ + +作者:[Avishek Kumar][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/avishek/ \ No newline at end of file From 84547c330fd38dff45032c8016adf78be4a44738 Mon Sep 17 00:00:00 2001 From: robot-0 Date: Tue, 5 May 2015 19:06:44 +0800 Subject: [PATCH 061/133] [translating by createyuan] --- ...access a Linux server behind NAT via reverse SSH tunnel.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md index 44a4110203..d6a1df43c5 100644 --- a/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md +++ b/sources/tech/20150504 How to access a Linux server behind NAT via reverse SSH tunnel.md @@ -1,3 +1,5 @@ +translating by createyuan + How to access a Linux server behind NAT via reverse SSH tunnel ================================================================================ You are running a Linux server at home, which is behind a NAT router or restrictive firewall. Now you want to SSH to the home server while you are away from home. How would you set that up? SSH port forwarding will certainly be an option. However, port forwarding can become tricky if you are dealing with multiple nested NAT environment. Besides, it can be interfered with under various ISP-specific conditions, such as restrictive ISP firewalls which block forwarded ports, or carrier-grade NAT which shares IPv4 addresses among users. @@ -127,4 +129,4 @@ via: http://xmodulo.com/access-linux-server-behind-nat-reverse-ssh-tunnel.html [a]:http://xmodulo.com/author/nanni [1]:http://xmodulo.com/go/digitalocean [2]:http://xmodulo.com/how-to-enable-ssh-login-without.html -[3]:http://ask.xmodulo.com/install-autossh-linux.html \ No newline at end of file +[3]:http://ask.xmodulo.com/install-autossh-linux.html From d04d0f349342db72c1b698c1434fc41144e15614 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Tue, 5 May 2015 23:56:26 +0800 Subject: [PATCH 062/133] =?UTF-8?q?=E8=A1=A5=E5=85=85=E9=81=97=E6=BC=8F?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...inux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/published/201504/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md b/published/201504/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md index 1921514d8e..a725043f67 100644 --- a/published/201504/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md +++ b/published/201504/20150417 How to Install Linux Kernel 4.0 from Elrepo or Source on Ubuntu or CentOs.md @@ -10,12 +10,14 @@ #### 在 64位 Ubuntu 15.04 #### + $ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-image-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb $ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb $ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb #### 在 32位 Ubuntu 15.04 #### + $ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-image-4.0.0-040000-generic_4.0.0-040000.201504121935_i386.deb $ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_i386.deb $ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb From 8b062b9b4de7a4b412106144017aa15bc1b06f90 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 6 May 2015 09:39:24 +0800 Subject: [PATCH 063/133] =?UTF-8?q?20150506-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...x bridge with Network Manager on Ubuntu.md | 96 ++++++++++ ...ult keyring to unlock on Ubuntu desktop.md | 55 ++++++ ...ll Shrew Soft IPsec VPN client on Linux.md | 97 ++++++++++ ...nswers--How to install autossh on Linux.md | 76 ++++++++ ...grep command with 14 different examples.md | 175 ++++++++++++++++++ 5 files changed, 499 insertions(+) create mode 100644 sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md create mode 100644 sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md create mode 100644 sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md create mode 100644 sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md create mode 100644 sources/tech/20150506 Linux grep command with 14 different examples.md diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md b/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md new file mode 100644 index 0000000000..8eac3a212d --- /dev/null +++ b/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md @@ -0,0 +1,96 @@ +Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu +================================================================================ +> **Question**: I need to set up a Linux bridge on my Ubuntu box to share a NIC with several other virtual machines or containers created on the box. I am currently using Network Manager on my Ubuntu, so preferrably I would like to configure a bridge using Network Manager. How can I do that? + +Network bridge is a hardware equipment used to interconnect two or more Layer-2 network segments, so that network devices on different segments can talk to each other. A similar bridging concept is needed within a Linux host, when you want to interconnect multiple VMs or Ethernet interfaces within a host. That is one use case of a software Linux bridge. + +There are several different ways to configure a Linux bridge. For example, in a headless server environment, you can use [brctl][1] to manually configure a bridge. In desktop environment, bridge support is available in Network Manager. Let's examine how to configure a bridge with Network Manager. + +### Requirement ### + +To avoid [any issue][2], it is recommended that you have Network Manager 0.9.9 and higher, which is the case for Ubuntu 15.04 and later. + + $ apt-cache show network-manager | grep Version + +---------- + + Version: 0.9.10.0-4ubuntu15.1 + Version: 0.9.10.0-4ubuntu15 + +### Create a Bridge ### + +The easiest way to create a bridge with Network Manager is via nm-connection-editor. This GUI tool allows you to configure a bridge in easy-to-follow steps. + +To start, invoke nm-connection-editor. + + $ nm-connection-editor + +The editor window will show you a list of currently configured network connections. Click on "Add" button in the top right to create a bridge. + +![](https://farm9.staticflickr.com/8781/17139502730_c3ca920f7f.jpg) + +Next, choose "Bridge" as a connection type. + +![](https://farm9.staticflickr.com/8873/17301102406_4f75133391_z.jpg) + +Now it's time to configure a bridge, including its name and bridged connection(s). With no other bridges created, the default bridge interface will be named bridge0. + +Recall that the goal of creating a bridge is to share your Ethernet interface via the bridge. So you need to add the Ethernet interface to the bridge. This is achieved by adding a new "bridged connection" in the GUI. Click on "Add" button. + +![](https://farm9.staticflickr.com/8876/17327069755_52f1d81f37_z.jpg) + +Choose "Ethernet" as a connection type. + +![](https://farm9.staticflickr.com/8832/17326664591_632a9001da_z.jpg) + +In "Device MAC address" field, choose the interface that you want to enslave into the bridge. In this example, assume that this interface is eth0. + +![](https://farm9.staticflickr.com/8842/17140820559_07a661f30c_z.jpg) + +Click on "General" tab, and enable both checkboxes that say "Automatically connect to this network when it is available" and "All users may connect to this network". + +![](https://farm8.staticflickr.com/7776/17325199982_801290e172_z.jpg) + +Save the change. + +Now you will see a new slave connection created in the bridge. + +![](https://farm8.staticflickr.com/7674/17119624667_6966b1147e_z.jpg) + +Click on "General" tab of the bridge, and make sure that top-most two checkboxes are enabled. + +![](https://farm8.staticflickr.com/7715/17301102276_4266a1e41d_z.jpg) + +Go to "IPv4 Settings" tab, and configure either DHCP or static IP address for the bridge. Note that you should use the same IPv4 settings as the enslaved Ethernet interface eth0. In this example, we assume that eth0 is configured via DHCP. Thus choose "Automatic (DHCP)" here. If eth0 is assigned a static IP address, you should assign the same IP address to the bridge. + +![](https://farm8.staticflickr.com/7737/17140820469_99955cf916_z.jpg) + +Finally, save the bridge settings. + +Now you will see an additional bridge connection created in "Network Connections" window. You no longer need a previously-configured wired connection for the enslaved interface eth0. So go ahead and delete the original wired connection. + +![](https://farm9.staticflickr.com/8700/17140820439_272a6d5c4e.jpg) + +At this point, the bridge connection will automatically be activated. You will momentarily lose a connection, since the IP address assigned to eth0 is taken over by the bridge. Once an IP address is assigned to the bridge, you will be connected back to your Ethernet interface via the bridge. You can confirm that by checking "Network" settings. + +![](https://farm8.staticflickr.com/7742/17325199902_9ceb67ddc1_c.jpg) + +Also, check the list of available interfaces. As mentioned, the bridge interface must have taken over whatever IP address was possessed by your Ethernet interface. + +![](https://farm8.staticflickr.com/7717/17327069605_6143f1bd6a_b.jpg) + +That's it, and now the bridge is ready to use! + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/configure-linux-bridge-network-manager-ubuntu.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/how-to-configure-linux-bridge-interface.html +[2]:https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1273201 \ No newline at end of file diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md b/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md new file mode 100644 index 0000000000..2034bdca7b --- /dev/null +++ b/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md @@ -0,0 +1,55 @@ +Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop +================================================================================ +> **Question**: When I boot up my Ubuntu desktop, a pop up dialog appears, asking me to enter a password to unlock default keyring. How can I disable this "unlock default keyring" pop up window, and automatically unlock my keyring? + +A keyring is thought of as a local database that stores your login information in encrypted forms. Various desktop applications (e.g., browsers, email clients) use a keyring to store and manage your login credentials, secrets, passwords, certificates, or keys securely. For those applications to retrieve the information stored in a keyring, the keyring needs to be unlocked. + +GNOME keyring used by Ubuntu desktop is integrated with desktop login, and the keyring is automatically unlocked when you authenticate into your desktop. But your default keyring can remain "locked" if you set up automatic desktop login or wake up from hibernation. In this case, you will be prompted: + +> "Enter password for keyring 'Default keyring' to unlock. An application wants to access to the keyring 'Default keyring,' but it is locked." + +![](https://farm9.staticflickr.com/8787/16716456754_309c39513c_o.png) + +If you want to avoid typing a password to unlock your default keyring every time such a pop-up dialog appears, here is how you can do it. + +Before doing that, understand the implication of disabling the password prompt. By automatically unlocking the default keyring, you will make your keyring (and any information stored in the keyring) accessible to anyone who uses your desktop, without them having to know your password. + +### Disable Password for Unlocking Default Keyring ### + +Open up Dash, and type "password" to launch "Passwords and Keys" app. + +![](https://farm8.staticflickr.com/7709/17312949416_ed9c4fbe2d_b.jpg) + +Alternatively, use the seahorse command to launch the GUI from the command line. + + $ seahorse + +On the left side panel, right-click on the "Default keyring," and choose "Change Password." + +![](https://farm8.staticflickr.com/7740/17159959750_ba5b675b00_b.jpg) + +Type your current login password. + +![](https://farm8.staticflickr.com/7775/17347551135_ce09260818_b.jpg) + +Leave a new password for the "Default" keyring as blank. + +![](https://farm8.staticflickr.com/7669/17345663222_c9334c738b_c.jpg) + +Click on "Continue" button to confirm to store passwords unencrypted. + +![](https://farm8.staticflickr.com/7761/17152692309_ce3891a0d9_c.jpg) + +That's it. From now on, you won't be prompted to unlock the default keyring. + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/disable-entering-password-unlock-default-keyring.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md b/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md new file mode 100644 index 0000000000..24c09c85bd --- /dev/null +++ b/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md @@ -0,0 +1,97 @@ +Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux +================================================================================ +> **Question**: I need to connect to an IPSec VPN gateway. For that, I'm trying to use Shrew Soft VPN client, which is available for free. How can I install Shrew Soft VPN client on [insert your Linux distro]? + +There are many commercial VPN gateways available, which come with their own proprietary VPN client software. While there are also open-source VPN server/client alternatives, they are typically lacking in sophisticated IPsec support, such as Internet Key Exchange (IKE) which is a standard IPsec protocol used to secure VPN key exchange and authentication. Shrew Soft VPN is a free IPsec VPN client supporting a number of authentication methods, key exchange, encryption and firewall traversal options. + +Here is how you can install Shrew Soft VPN client on Linux platforms. + +First, download its source code from the [official website][1]. + +### Install Shrew VPN Client on Debian, Ubuntu or Linux Mint ### + +Shrew Soft VPN client GUI requires Qt 4.x. So you will need to install its development files as part of dependencies. + + $ sudo apt-get install cmake libqt4-core libqt4-dev libqt4-gui libedit-dev libssl-dev checkinstall flex bison + $ wget https://www.shrew.net/download/ike/ike-2.2.1-release.tbz2 + $ tar xvfvj ike-2.2.1-release.tbz2 + $ cd ike + $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DQTGUI=YES -DETCDIR=/etc -DNATT=YES . + $ make + $ sudo make install + $ cd /etc/ + $ sudo mv iked.conf.sample iked.conf + +### Install Shrew VPN Client on CentOS, Fedora or RHEL ### + +Similar to Debian based systems, you will need to install a number of dependencies including Qt4 before compiling it. + + $ sudo yum install qt-devel cmake gcc-c++ openssl-devel libedit-devel flex bison + $ wget https://www.shrew.net/download/ike/ike-2.2.1-release.tbz2 + $ tar xvfvj ike-2.2.1-release.tbz2 + $ cd ike + $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DQTGUI=YES -DETCDIR=/etc -DNATT=YES . + $ make + $ sudo make install + $ cd /etc/ + $ sudo mv iked.conf.sample iked.conf + +On Red Hat based systems, one last step is to open /etc/ld.so.conf with a text editor, and add the following line. + + $ sudo vi /etc/ld.so.conf + +---------- + + include /usr/lib/ + +Reload run-time bindings of shared libraries to incorporate newly installed shared libraries: + + $ sudo ldconfig + +### Launch Shrew VPN Client ### + +First launch IKE daemon (iked). This daemon speaks the IKE protocol to communicate with a remote host over IPSec as a VPN client. + + $ sudo iked + +![](https://farm9.staticflickr.com/8685/17175688940_59c2db64c9_b.jpg) + +Now start qikea which is an IPsec VPN client front end. This GUI application allows you to manage remote site configurations and to initiate VPN connections. + +![](https://farm8.staticflickr.com/7750/16742992713_eed7f97939_b.jpg) + +To create a new VPN configuration, click on "Add" button, and fill out VPN site configuration. Once you create a configuration, you can initiate a VPN connection simply by clicking on the configuration. + +![](https://farm8.staticflickr.com/7725/17337297056_3d38dc2180_b.jpg) + +### Troubleshooting ### + +1. I am getting the following error while running iked. + + iked: error while loading shared libraries: libss_ike.so.2.2.1: cannot open shared object file: No such file or directory + +To solve this problem, you need to update the dynamic linker to incorporate libss_ike library. For that, add to /etc/ld.so.conf the path where the library is located (e.g., /usr/lib), and then run ldconfig command. + + $ sudo ldconfig + +Verify that libss_ike is added to the library path: + + $ ldconfig -p | grep ike + +---------- + + libss_ike.so.2.2.1 (libc6,x86-64) => /lib/libss_ike.so.2.2.1 + libss_ike.so (libc6,x86-64) => /lib/libss_ike.so + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-shrew-soft-ipsec-vpn-client-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:https://www.shrew.net/download/ike \ No newline at end of file diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md b/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md new file mode 100644 index 0000000000..0660b8d621 --- /dev/null +++ b/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md @@ -0,0 +1,76 @@ +Linux FAQs with Answers--How to install autossh on Linux +================================================================================ +> **Question**: I would like to install autossh on [insert your Linux distro]. How can I do that? + +[autossh][1] is an open-source tool that allows you to monitor an SSH session and restart it automatically should it gets disconnected or stops forwarding traffic. autossh assumes that [passwordless SSH login][2] for a destination host is already setup, so that it can restart a broken SSH session without user's involvement. + +autossh comes in handy when you want to set up [reverse SSH tunnels][3] or [mount remote folders over SSH][4]. Essentially in any situation where persistent SSH sessions are required, autossh can be useful. + +![](https://farm8.staticflickr.com/7786/17150854870_63966e78bc_c.jpg) + +Here is how to install autossh on various Linux distributions. + +### Install Autossh on Debian or Ubuntu ### + +autossh is available in base repositories of Debian based systems, so installation is easy. + + $ sudo apt-get install autossh + +### Install Autossh on Fedora ### + +Fedora repositories also carry autossh package. So simply use yum command. + + $ sudo yum install autossh + +### Install Autossh on CentOS or RHEL ### + +For CentOS/RHEL 6 or earlier, enable [Repoforge repository][5] first, and then use yum command. + + $ sudo yum install autossh + +For CentOS/RHEL 7, autossh is no longer available in Repoforge repository. You will need to build it from the source (explained below). + +### Install Autossh on Arch Linux ### + + $ sudo pacman -S autossh + +### Compile Autossh from the Source on Debian or Ubuntu ### + +If you would like to try the latest version of autossh, you can build it from the source as follows. + + $ sudo apt-get install gcc make + $ wget http://www.harding.motd.ca/autossh/autossh-1.4e.tgz + $ tar -xf autossh-1.4e.tgz + $ cd autossh-1.4e + $ ./configure + $ make + $ sudo make install + +### Compile Autossh from the Source on CentOS, Fedora or RHEL ### + +On CentOS/RHEL 7, autossh is not available as a pre-built package. So you'll need to compile it from the source as follows. + + $ sudo yum install wget gcc make + $ wget http://www.harding.motd.ca/autossh/autossh-1.4e.tgz + $ tar -xf autossh-1.4e.tgz + $ cd autossh-1.4e + $ ./configure + $ make + $ sudo make install + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-autossh-linux.html + +作者:[Dan Nanni][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://www.harding.motd.ca/autossh/ +[2]:http://xmodulo.com/how-to-enable-ssh-login-without.html +[3]:http://xmodulo.com/access-linux-server-behind-nat-reverse-ssh-tunnel.html +[4]:http://xmodulo.com/how-to-mount-remote-directory-over-ssh-on-linux.html +[5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html \ No newline at end of file diff --git a/sources/tech/20150506 Linux grep command with 14 different examples.md b/sources/tech/20150506 Linux grep command with 14 different examples.md new file mode 100644 index 0000000000..006a042bc5 --- /dev/null +++ b/sources/tech/20150506 Linux grep command with 14 different examples.md @@ -0,0 +1,175 @@ +Linux grep command with 14 different examples +================================================================================ +### Overview : ### + +Linux like operating system provides a searching tool known as **grep (global regular expression print)**. grep command is useful for searching the content of one more files based on the pattern. A pattern may be a single character, bunch of characters, single word or a sentence. + +When we execute the grep command with specified pattern, if its is matched, then it will display the line of file containing the pattern without modifying the contents of existing file. + +In this tutorial we will discuss 14 different examples of grep command + +### Example:1 Search the pattern (word) in a file ### + +Search the “linuxtechi” word in the file /etc/passwd file + + root@Linux-world:~# grep linuxtechi /etc/passwd + linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash + root@Linux-world:~# + +### Example:2 Search the pattern in the multiple files. ### + + root@Linux-world:~# grep linuxtechi /etc/passwd /etc/shadow /etc/gshadow + /etc/passwd:linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash + /etc/shadow:linuxtechi:$6$DdgXjxlM$4flz4JRvefvKp0DG6re:16550:0:99999:7:::/etc/gshadow:adm:*::syslog,linuxtechi + /etc/gshadow:cdrom:*::linuxtechi + /etc/gshadow:sudo:*::linuxtechi + /etc/gshadow:dip:*::linuxtechi + /etc/gshadow:plugdev:*::linuxtechi + /etc/gshadow:lpadmin:!::linuxtechi + /etc/gshadow:linuxtechi:!:: + /etc/gshadow:sambashare:!::linuxtechi + root@Linux-world:~# + +### Example:3 List the name of those files which contain a specified pattern using -l option. ### + + root@Linux-world:~# grep -l linuxtechi /etc/passwd /etc/shadow /etc/fstab /etc/mtab + /etc/passwd + /etc/shadow + root@Linux-world:~# + +### Example:4 Search the pattern in the file along with associated line number(s) using the -n option ### + + root@Linux-world:~# grep -n linuxtechi /etc/passwd + 39:linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash + root@Linux-world:~# + +root@Linux-world:~# grep -n root /etc/passwd /etc/shadow + +![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-n-root.jpg) + +### Example:5 Print the line excluding the pattern using -v option ### + +List all the lines of the file /etc/passwd that does not contain specific word “linuxtechi”. + + root@Linux-world:~# grep -v linuxtechi /etc/passwd + +![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-v-option.jpg) + +### Example:6 Display all the lines that starts with specified pattern using ^ symbol ### + +Bash shell treats carrot symbol (^) as a special character which marks the beginning of line or a word. Let’s display the lines which starts with “root” word in the file /etc/passwd. + + root@Linux-world:~# grep ^root /etc/passwd + root:x:0:0:root:/root:/bin/bash + root@Linux-world:~# + +### Example: 7 Display all the lines that ends with specified pattern using $ symbol. ### + +List all the lines of /etc/passwd that ends with “bash” word. + + root@Linux-world:~# grep bash$ /etc/passwd + root:x:0:0:root:/root:/bin/bash + linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash + root@Linux-world:~# + +Bash shell treats dollar ($) symbol as a special character which marks the end of line or word. + +### Example:8 Search the pattern recursively using -r option ### + + root@Linux-world:~# grep -r linuxtechi /etc/ + /etc/subuid:linuxtechi:100000:65536 + /etc/group:adm:x:4:syslog,linuxtechi + /etc/group:cdrom:x:24:linuxtechi + /etc/group:sudo:x:27:linuxtechi + /etc/group:dip:x:30:linuxtechi + /etc/group:plugdev:x:46:linuxtechi + /etc/group:lpadmin:x:115:linuxtechi + /etc/group:linuxtechi:x:1000: + /etc/group:sambashare:x:131:linuxtechi + /etc/passwd-:linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash + /etc/passwd:linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash + ............................................................................ + +Above command will search linuxtechi in the “/etc” directory recursively. + +### Example:9 Search all the empty or blank lines of a file using grep ### + + root@Linux-world:~# grep ^$ /etc/shadow + root@Linux-world:~# + +As there is no empty line in /etc/shadow file , so nothing is displayed. + +### Example:10 Search the pattern using ‘grep -i’ option. ### + +-i option in the grep command ignores the letter case i.e it will ignore upper case or lower case letters while searching + +Lets take an example , i want to search “LinuxTechi” word in the passwd file. + + nextstep4it@localhost:~$ grep -i LinuxTechi /etc/passwd + linuxtechi:x:1001:1001::/home/linuxtechi:/bin/bash + nextstep4it@localhost:~$ + +### Example:11 Search multiple patterns using -e option ### + +For example i want to search ‘linuxtechi’ and ‘root’ word in a single grep command , then using -e option we can search multiple patterns . + + root@Linux-world:~# grep -e "linuxtechi" -e "root" /etc/passwd + root:x:0:0:root:/root:/bin/bash + linuxtechi:x:1000:1000:linuxtechi,,,:/home/linuxtechi:/bin/bash + root@Linux-world:~# + +### Example:12 Getting Search pattern from a file using “grep -f” ### + +First create a search pattern file “grep_pattern” in your current working directory. In my case i have put the below contents. + + root@Linux-world:~# cat grep_pattern + ^linuxtechi + root + false$ + root@Linux-world:~# + +Now try to search using grep_pattern file. + + root@Linux-world:~# grep -f grep_pattern /etc/passwd + +![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-f-option.jpg) + +### Example:13 Count the number of matching patterns using -c option ### + +Let take the above example , we can count the number of matching patterns using -c option in grep command. + + root@Linux-world:~# grep -c -f grep_pattern /etc/passwd + 22 + root@Linux-world:~# + +### Example:14 Display N number of lines before & after pattern matching ### + +a) Display Four lines before patten matching using -B option + + root@Linux-world:~# grep -B 4 "games" /etc/passwd + +![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-B-option.jpg) + +b) Display Four lines after pattern matching using -A option + + root@Linux-world:~# grep -A 4 "games" /etc/passwd + +![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-A-option.jpg) + +c) Display Four lines around the pattern matching using -C option + + root@Linux-world:~# grep -C 4 "games" /etc/passwd + +![](http://www.linuxtechi.com/wp-content/uploads/2015/05/grep-C-option.jpg) + +-------------------------------------------------------------------------------- + +via: http://www.linuxtechi.com/linux-grep-command-with-14-different-examples/ + +作者:[Pradeep Kumar][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxtechi.com/author/pradeep/ \ No newline at end of file From 55f34d60eb2b23fa70201c30e9f958d930628a01 Mon Sep 17 00:00:00 2001 From: VicYu Date: Wed, 6 May 2015 10:14:06 +0800 Subject: [PATCH 064/133] Translated --- ...nfigure PCI-passthrough on virt-manager.md | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md b/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md index 4703e96d38..0344095bc2 100644 --- a/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md +++ b/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md @@ -1,38 +1,37 @@ -Vic020 - -Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager +Linux有问必答:如何在虚拟机上配置PCI-passthrough ================================================================================ -> **Question**: I would like to dedicate a physical network interface card to one of my guest VMs created by KVM. For that, I am trying to enable PCI passthrough of the NIC for the VM. How can I add a PCI device to a guest VM with PCI passthrough on virt-manager? +> **提问**:我想要设置一块物理网卡到用KVM创建的虚拟机上。我打算开启网卡的PCI passthrough给这台虚拟机。请问,我如何才能增加一个PCI设备通过PCI直通到虚拟机上? -Modern hypervisors enable efficient resource sharing among multiple guest operating systems by virtualizing and emulating hardware resources. However, such virtualized resource sharing may not always be desirable, or even should be avoided when VM performance is a great concern, or when a VM requires full DMA control of a hardware device. One technique used in this case is so-called "PCI passthrough," where a guest VM is granted an exclusive access to a PCI device (e.g., network/sound/video card). Essentially, PCI passthrough bypasses the virtualization layer, and directly exposes a PCI device to a VM. No other VM can access the PCI device. +如今的hypervisor能够高效地在多个虚拟操作系统分享和模拟硬件资源。然而,虚拟资源分享,虚拟机的性能,或者是虚拟机需要硬件DMA的完全控制,不是总能使人满意。一项名叫“PCI passthrough”的技术可以用在一个虚拟机需要独享PCI设备时(例如:network/sound/video card)。本质上,PCI passthrough越过了虚拟层,直接扩展PCI设备到虚拟机。但是其他虚拟机不能同时共享。 -### Requirement for Enabling PCI Passthrough ### -If you want to enable PCI passthrough for an HVM guest (e.g., a fully-virtualized VM created by KVM), your system (both CPU and motherboard) must meet the following requirement. If your VM is paravirtualized (created by Xen), you can skip this step. +### 开启“PCI Passthrough”的准备 ### -In order to enable PCI passthrough for an HVM guest VM, your system must support **VT-d** (for Intel processors) or **AMD-Vi** (for AMD processors). Intel's VT-d ("Intel Virtualization Technology for Directed I/O") is available on most high-end Nehalem processors and its successors (e.g., Westmere, Sandy Bridge, Ivy Bridge). Note that VT-d and VT-x are two independent features. A list of Intel/AMD processors with VT-d/AMD-Vi capability can be found [here][1]. +如果你想要为一台HVM实例开启PCI passthrough(例如,一台KVM创建的full虚拟机),你的母系统(包括CPU和主板)必须满足以下条件。但是如果你的虚拟机是para-V(由Xen创建),你可以挑过这步。 -After you verify that your host hardware supports VT-d/AMD-Vi, you then need to do two things on your system. First, make sure that VT-d/AMD-Vi is enabled in system BIOS. Second, enable IOMMU on your kernel during booting. The IOMMU service, which is provided by VT-d,/AMD-Vi, protects host memory access by a guest VM, and is a requirement for PCI passthrough for fully-virtualized guest VMs. +为了开启PCI passthrough,系统需要支持**VT-d** (Intel处理器)或者**AMD-Vi** (AMD处理器)。Intel的VT-D(“英特尔虚拟化技术支持直接I/ O”)是适用于最高端的Nehalem处理器和它的后继者(例如,Westmere、Sandy Bridge的,Ivy Bridge)。注意:VT-d和VT-x是两个独立功能。intel/AMD处理器支持VT-D/AMD-VI功能的列表可以[点击这里][1]。 -To enable IOMMU on the kernel for Intel processors, pass "**intel_iommu=on**" boot parameter on your Linux. Follow [this tutorial][2] to find out how to add a kernel boot parameter via GRUB. +完成验证你的设备支持VT-d/AMD-Vi后,还有两件事情需要做。首先,确保VT-d/AMD-Vi已经在BIOS中开启。然后,在内核启动过程中开启IOMMU。IOMMU服务,是VT-d,/AMD-Vi提供,可以保护虚拟机访问的主机内存,同时它也是full虚拟机支持PCI passthrough的前提。 -After configuring the boot parameter, reboot your host. +Intel处理器中,内核开启IOMMU通过在启动参数中修改“**intel_iommu=on**”。参看[这篇教程][2]获得如何通过GRUB修改内核启动参数。 -### Add a PCI Device to a VM on Virt-Manager ### +配置完成启动参数后,重启电脑。 -Now we are ready to enable PCI passthrough. In fact, assigning a PCI device to a guest VM is straightforward on virt-manager. +### 添加PCI设备到虚拟机 ### -Open the VM's settings on virt-manager, and click on "Add Hardware" button on the left sidebar. +我们已经完成了开启PCI Passthrough的准备。事实上,只需通过虚拟机管理就可以给虚拟机分配一个PCI设备。 -Choose a PCI device to assign from a PCI device list, and click on "Finish" button. +打开虚拟机设置,在左边工具栏点击‘增加硬件’按钮。 + +选择从PCI设备表一个PCI设备来分配,点击“完成”按钮 ![](https://farm8.staticflickr.com/7587/17015584385_db49e96372_c.jpg) -Finally, power on the guest. At this point, the host PCI device should be directly visible inside the guest VM. +最后,开启实例。目前为止,主机的PCI设备已经可以由虚拟机直接访问了。 -### Troubleshooting ### +### 常见问题 ### -If you see either of the following errors while powering on a guest VM, the error may be because VT-d (or IOMMU) is not enabled on your host. +在虚拟机启动时,如果你看见下列任何一个错误,这个错误有可能由于母机VT-d (或 IOMMU)未开启导致。 Error starting domain: unsupported configuration: host doesn't support passthrough of host PCI devices @@ -40,14 +39,14 @@ If you see either of the following errors while powering on a guest VM, the erro Error starting domain: Unable to read from monitor: Connection reset by peer -Make sure that "**intel_iommu=on**" boot parameter is passed to the kernel during boot as described above. +请确保"**intel_iommu=on**"启动参数已经按上文叙述开启。 -------------------------------------------------------------------------------- via: http://ask.xmodulo.com/pci-passthrough-virt-manager.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Vic020/VicYu](http://vicyu.net) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From b8da2cfdd5c405834ede5aa2d28fdb080219d878 Mon Sep 17 00:00:00 2001 From: VicYu Date: Wed, 6 May 2015 10:18:36 +0800 Subject: [PATCH 065/133] Moved --- ...h Answers--How to configure PCI-passthrough on virt-manager.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md (100%) diff --git a/sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md b/translated/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md similarity index 100% rename from sources/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md rename to translated/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md From 644da85fd450329f50b3433aeb8aeb31bf317e6b Mon Sep 17 00:00:00 2001 From: VicYu Date: Wed, 6 May 2015 10:22:13 +0800 Subject: [PATCH 066/133] Update 20150506 Linux FAQs with Answers--How to install autossh on Linux.md --- ...inux FAQs with Answers--How to install autossh on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md b/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md index 0660b8d621..97814b2288 100644 --- a/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md +++ b/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md @@ -1,3 +1,5 @@ + Vic020 + Linux FAQs with Answers--How to install autossh on Linux ================================================================================ > **Question**: I would like to install autossh on [insert your Linux distro]. How can I do that? @@ -73,4 +75,4 @@ via: http://ask.xmodulo.com/install-autossh-linux.html [2]:http://xmodulo.com/how-to-enable-ssh-login-without.html [3]:http://xmodulo.com/access-linux-server-behind-nat-reverse-ssh-tunnel.html [4]:http://xmodulo.com/how-to-mount-remote-directory-over-ssh-on-linux.html -[5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html \ No newline at end of file +[5]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html From 0baeff71655a6108456f1e9c5a0c8f8841b60025 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Wed, 6 May 2015 10:28:32 +0800 Subject: [PATCH 067/133] =?UTF-8?q?20150506-2=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Step Guide for Learning Shell Scripting.md | 459 ++++++++++++++++++ ...tore Passwords and Api Keys Using Vault.md | 167 +++++++ ...w to Setup OpenERP (Odoo) on CentOS 7.x.md | 112 +++++ 3 files changed, 738 insertions(+) create mode 100644 sources/tech/20150506 First Step Guide for Learning Shell Scripting.md create mode 100644 sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md create mode 100644 sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md diff --git a/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md b/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md new file mode 100644 index 0000000000..8af4ef03e8 --- /dev/null +++ b/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md @@ -0,0 +1,459 @@ +First Step Guide for Learning Shell Scripting +================================================================================ +![](http://blog.linoxide.com/wp-content/uploads/2015/04/myfirstshellscript.jpg) + +Usually when people say "shell scripting" they have on mind bash, ksh, sh, ash or similar linux/unix scripting language. Scripting is another way to communicate with computer. Using graphic windows interface (not matter windows or linux) user can move mouse and clicking on the various objects like, buttons, lists, check boxes and so on. But it is very inconvenient way witch requires user participation and accuracy each time he would like to ask computer / server to do the same tasks (lets say to convert photos or download new movies, mp3 etc). To make all these things easy accessible and automated we could use shell scripts. + +Some programming languages like pascal, foxpro, C, java needs to be compiled before they could be executed. They needs appropriate compiler to make our code to do some job. + +Another programming languages like php, javascript, visualbasic do not needs compiler. So they need interpretersand we could run our program without compiling the code. + +The shell scripts is also like interpreters, but it is usually used to call external compiled programs. Then captures the outputs, exit codes and act accordingly. + +One of the most popular shell scripting language in the linux world is the bash. And i think (this is my own opinion) this is because bash shell allows user easily navigate through the history commands (previously executed) by default, in opposite ksh which requires some tuning in .profile or remember some "magic" key combination to walk through history and amend commands. + +Ok, i think this is enough for introduction and i leaving for your judge which environment is most comfortable for you. Since now i will speak only about bash and scripting. In the following examples i will use the CentOS 6.6 and bash-4.1.2. Just make sure you have the same or greater version. + +### Shell Script Streams ### + +The shell scripting it is something similar to conversation of several persons. Just imagine that all command like the persons who able to do something if you properly ask them. Lets say you would like to write the document. First of all you need the paper, then you need to say the content to someone to write it, and finally you would like to store it somewhere. Or you would like build a house, so you will ask appropriate persons to cleanup the space. After they say "its done" then other engineers could build for you the walls. And finally, when engineers also tell "Its done" you can ask the painters to color your house. And what would happen if you ask the painters coloring your walls before they are built? I think they will start to complain. Almost all commands like the persons could speak and if they did its job without any issues they speaks to "standard output". If they can't to what you asking - they speaking to the "standard error". So finally all commands listening for you through "standard input". + +Quick example- when you opening linux terminal and writing some text - you speaking to bash through "standard input". So ask the bash shell **who am i** + + root@localhost ~]# who am i <--- you speaking through the standard input to bash shell + root pts/0 2015-04-22 20:17 (192.168.1.123) <--- bash shell answering to you through the standard output + +Now lets ask something that bash will not understand us: + + [root@localhost ~]# blablabla <--- and again, you speaking through standard input + -bash: blablabla: command not found <--- bash complaining through standard error + +The first word before ":" usually is the command which complaining to you. Actually each of these streams has their own index number: + +- standard input (**stdin**) - 0 +- standard output (**stdout**) - 1 +- standard error (**stderr**) - 2 + +If you really would like to know to witch output command said something - you need to redirect (to use "greater than ">" symbol after command and stream index) that speech to file: + + [root@localhost ~]# blablabla 1> output.txt + -bash: blablabla: command not found + +In this example we tried to redirect 1 (**stdout**) stream to file named output.txt. Lets look does to the content of that file. We use the command cat for that: + + [root@localhost ~]# cat output.txt + [root@localhost ~]# + +Seams that is empty. Ok now lets try to redirect 2 (**stderr**) streem: + + [root@localhost ~]# blablabla 2> error.txt + [root@localhost ~]# + +Ok, we see that complains gone. Lets chec the file: + + [root@localhost ~]# cat error.txt + -bash: blablabla: command not found + [root@localhost ~]# + +Exactly! We see that all complains was recorded to the errors.txt file. + +Sometimes commands produces **stdout** and **stderr** simultaniously. To redirect them to separate files we can use the following syntax: + + command 1>out.txt 2>err.txt + +To shorten this syntax a bit we can skip the "1" as by default the **stdout** stream will be redirected: + + command >out.txt 2>err.txt + +Ok, lets try to do something "bad". lets remove the file1 and folder1 with the rm command: + + [root@localhost ~]# rm -vf folder1 file1 > out.txt 2>err.txt + +Now check our output files: + + [root@localhost ~]# cat out.txt + removed `file1' + [root@localhost ~]# cat err.txt + rm: cannot remove `folder1': Is a directory + [root@localhost ~]# + +As we see the streams was separated to different files. Sometimes it is not handy as usually we want to see the sequence when the errors appeared - before or after some actions. For that we can redirect both streams to the same file: + + command >>out_err.txt 2>>out_err.txt + +Note : Please notice that i use ">>" instead of ">". It allows us to append file instead of overwrite. + +We can redirect one stream to another: + + command >out_err.txt 2>&1 + +Let me explain. All stdout of the command will be redirected to the out_err.txt. The errout will be redirected to the 1-st stream which (as i already explained above) will be redirected to the same file. Let see the example: + + [root@localhost ~]# rm -fv folder2 file2 >out_err.txt 2>&1 + [root@localhost ~]# cat out_err.txt + rm: cannot remove `folder2': Is a directory + removed `file2' + [root@localhost ~]# + +Looking at the combined output we can state that first of all **rm** command tried to remove the folder2 and it was not success as linux require the **-r** key for **rm** command to allow remove folders. At the second the file2 was removed. By providing the **-v** (verbose) key for the **rm** command we asking rm command to inform as about each removed file or folder. + +This is almost all you need to know about redirection. I say almost, because there is one more very important redirection which called "piping". By using | (pipe) symbol we usually redirecting **stdout** streem. + +Lets say we have the text file: + + [root@localhost ~]# cat text_file.txt + This line does not contain H e l l o word + This lilne contains Hello + This also containd Hello + This one no due to HELLO all capital + Hello bash world! + +and we need to find the lines in it with the words "Hello". Linux has the **grep** command for that: + + [root@localhost ~]# grep Hello text_file.txt + This lilne contains Hello + This also containd Hello + Hello bash world! + [root@localhost ~]# + +This is ok when we have file and would like to sech in it. But what to do if we need to find something in the output of another command? Yes, of course we can redirect the output to the file and then look in it: + + [root@localhost ~]# fdisk -l>fdisk.out + [root@localhost ~]# grep "Disk /dev" fdisk.out + Disk /dev/sda: 8589 MB, 8589934592 bytes + Disk /dev/mapper/VolGroup-lv_root: 7205 MB, 7205814272 bytes + Disk /dev/mapper/VolGroup-lv_swap: 855 MB, 855638016 bytes + [root@localhost ~]# + +If you going to grep something with white spaces embrace that with " quotes! + +Note : fdisk command shows information about Linux OS disk drives + +As we see this way is not very handy as soon we will mess the space with temporary files. For that we can use the pipes. They allow us redirect one command **stdout** to another command **stdin** streams: + + [root@localhost ~]# fdisk -l | grep "Disk /dev" + Disk /dev/sda: 8589 MB, 8589934592 bytes + Disk /dev/mapper/VolGroup-lv_root: 7205 MB, 7205814272 bytes + Disk /dev/mapper/VolGroup-lv_swap: 855 MB, 855638016 bytes + [root@localhost ~]# + +As we see, we get the same result without any temporary files. We have redirected **frisk stdout** to the **grep stdin**. + +**Note** : Pipe redirection is always from left to right. + +There are several other redirections but we will speak about them later. + +### Displaying custom messages in the shell ### + +As we already know usually communication with and within shell is going as dialog. So lets create some real script which also will speak with us. It will allow you to learn some simple commands and better understand the scripting concept. + +Imagine we are working in some company as help desk manager and we would like to create some shell script to register the call information: phone number, User name and brief description about issue. We going to store it in the plain text file data.txt for future statistics. Script it self should work in dialog way to make live easy for help desk workers. So first of all we need to display the questions. For displaying any messages there is echo and printf commands. Both of them displaying messages, but printf is more powerful as we can nicely form output to align it to the right, left or leave dedicated space for message. Lets start from simple one. For file creation please use your favorite text editor (kate, nano, vi, ...) and create the file named note.sh with the command inside: + + echo "Phone number ?" + +### Script execution ### + +After you have saved the file we can run it with bash command by providing our file as an argument: + + [root@localhost ~]# bash note.sh + Phone number ? + +Actually to use this way for script execution is not handy. It would be more comfortable just execute the script without any **bash** command as a prefix. To make it executable we can use **chmod** command: + + [root@localhost ~]# ls -la note.sh + -rw-r--r--. 1 root root 22 Apr 23 20:52 note.sh + [root@localhost ~]# chmod +x note.sh + [root@localhost ~]# ls -la note.sh + -rwxr-xr-x. 1 root root 22 Apr 23 20:52 note.sh + [root@localhost ~]# + +![set permission script file](http://blog.linoxide.com/wp-content/uploads/2015/04/Capture.png) + +**Note** : ls command displays the files in the current folder. By adding the keys -la it will display a bit more information about files. + +As we see, before **chmod** command execution, script has only read (r) and write (w) permissions. After **chmod +x** it got execute (x) permissions. (More details about permissions i am going to describe in next article.) Now we can simply run it: + + [root@localhost ~]# ./note.sh + Phone number ? + +Before script name i have added ./ combination. . (dot) in the unix world means current position (current folder), the / (slash) is the folder separator. (In Windows OS we use \ (backslash) for the same). So whole this combination means: "from the current folder execute the note.sh script". I think it will be more clear for you if i run this script with full path: + + [root@localhost ~]# /root/note.sh + Phone number ? + [root@localhost ~]# + +It also works. + +Everything would be ok if all linux users would have the same default shell. If we simply execute this script default user shell will be used to parse script content and run the commands. Different shells have a bit different syntax, internal commands, etc. So to guarantee the **bash** will be used for our script we should add **#!/bin/bash** as the first line. In this way default user shell will call **/bin/bash** and only then will execute following shell commands in the script: + + [root@localhost ~]# cat note.sh + #!/bin/bash + echo "Phone number ?" + +Only now we will be 100% sure that **bash** will be used to parse our script content. Lets move on. + +### Reading the inputs ### + +After we have displayed the message script should wait for answer from user. There is the command **read**: + + #!/bin/bash + echo "Phone number ?" + read phone + +After execution script will wait for the user input until he press the [ENTER] key: + + [root@localhost ~]# ./note.sh + Phone number ? + 12345 <--- here is my input + [root@localhost ~]# + +Everything you have input will be stored to the variable **phone**. To display the value of variable we can use the same **echo** command: + + [root@localhost ~]# cat note.sh + #!/bin/bash + echo "Phone number ?" + read phone + echo "You have entered $phone as a phone number" + [root@localhost ~]# ./note.sh + Phone number ? + 123456 + You have entered 123456 as a phone number + [root@localhost ~]# + +In **bash** shell we using **$** (dollar) sign as variable indication, except when reading into variable and few other moments (will describe later). + +Ok, now we are ready to add the rest questions: + + #!/bin/bash + echo "Phone number?" + read phone + echo "Name?" + read name + echo "Issue?" + read issue + [root@localhost ~]# ./note.sh + Phone number? + 123 + Name? + Jim + Issue? + script is not working. + [root@localhost ~]# + +### Using stream redirection ### + +Perfect! There is left to redirect everything to the file data.txt. As a field separator we going to use / (slash) symbol. + +**Note** : You can chose any which you think is the best, bat be sure that content will not have thes symbols inside. It will cause extra fields in the line. + +Do not forget to use ">>" instead of ">" as we would like to append the output to the end of file! + + [root@localhost ~]# tail -2 note.sh + read issue + echo "$phone/$name/$issue">>data.txt + [root@localhost ~]# ./note.sh + Phone number? + 987 + Name? + Jimmy + Issue? + Keybord issue. + [root@localhost ~]# cat data.txt + 987/Jimmy/Keybord issue. + [root@localhost ~]# + +**Note** : The command **tail** displays the last **-n** lines of the file. + +Bingo. Lets run once again: + + [root@localhost ~]# ./note.sh + Phone number? + 556 + Name? + Janine + Issue? + Mouse was broken. + [root@localhost ~]# cat data.txt + 987/Jimmy/Keybord issue. + 556/Janine/Mouse was broken. + [root@localhost ~]# + +Our file is growing. Lets add the date in the front of each line. This will be useful later when playing with data while calculating statistic. For that we can use command date and give it some format as i do not like default one: + + [root@localhost ~]# date + Thu Apr 23 21:33:14 EEST 2015 <---- default output of dta command + [root@localhost ~]# date "+%Y.%m.%d %H:%M:%S" + 2015.04.23 21:33:18 <---- formated output + +There are several ways to read the command output to the variable. In this simple situation we will use ` (back quotes): + + [root@localhost ~]# cat note.sh + #!/bin/bash + now=`date "+%Y.%m.%d %H:%M:%S"` + echo "Phone number?" + read phone + echo "Name?" + read name + echo "Issue?" + read issue + echo "$now/$phone/$name/$issue">>data.txt + [root@localhost ~]# ./note.sh + Phone number? + 123 + Name? + Jim + Issue? + Script hanging. + [root@localhost ~]# cat data.txt + 2015.04.23 21:38:56/123/Jim/Script hanging. + [root@localhost ~]# + +Hmmm... Our script looks a bit ugly. Lets prettify it a bit. If you would read manual about **read** command you would find that read command also could display some messages. For this we should use -p key and message: + + [root@localhost ~]# cat note.sh + #!/bin/bash + now=`date "+%Y.%m.%d %H:%M:%S"` + read -p "Phone number: " phone + read -p "Name: " name + read -p "Issue: " issue + echo "$now/$phone/$name/$issue">>data.txt + +You can fine a lots of interesting about each command directly from the console. Just type: **man read, man echo, man date, man ....** + +Agree it looks much better! + + [root@localhost ~]# ./note.sh + Phone number: 321 + Name: Susane + Issue: Mouse was stolen + [root@localhost ~]# cat data.txt + 2015.04.23 21:38:56/123/Jim/Script hanging. + 2015.04.23 21:43:50/321/Susane/Mouse was stolen + [root@localhost ~]# + +And the cursor is right after the message (not in new line) what makes a bit sense. +Loop + +Time to improve our script. If user works all day with the calls it is not very handy to run it each time. Lets add all these actions in the never-ending loop: + + [root@localhost ~]# cat note.sh + #!/bin/bash + while true + do + read -p "Phone number: " phone + now=`date "+%Y.%m.%d %H:%M:%S"` + read -p "Name: " name + read -p "Issue: " issue + echo "$now/$phone/$name/$issue">>data.txt + done + +I have swapped **read phone** and **now=`date** lines. This is because i would like to get the time right after the phone number will be entered. If i would left it as the first line in the loop **- the** now variable will get the time right after the data was stored in the file. And it is not good as the next call could be after 20 mins or so. + + [root@localhost ~]# ./note.sh + Phone number: 123 + Name: Jim + Issue: Script still not works. + Phone number: 777 + Name: Daniel + Issue: I broke my monitor + Phone number: ^C + [root@localhost ~]# cat data.txt + 2015.04.23 21:38:56/123/Jim/Script hanging. + 2015.04.23 21:43:50/321/Susane/Mouse was stolen + 2015.04.23 21:47:55/123/Jim/Script still not works. + 2015.04.23 21:48:16/777/Daniel/I broke my monitor + [root@localhost ~]# + +NOTE: To exit from the never-ending loop you can by pressing [Ctrl]+[C] keys. Shell will display ^ as the Ctrl key. + +### Using pipe redirection ### + +Lets add more functionality to our "Frankenstein" I would like the script will display some statistic after each call. Lets say we want to see the how many times each number called us. For that we should cat the data.txt file: + + [root@localhost ~]# cat data.txt + 2015.04.23 21:38:56/123/Jim/Script hanging. + 2015.04.23 21:43:50/321/Susane/Mouse was stolen + 2015.04.23 21:47:55/123/Jim/Script still not works. + 2015.04.23 21:48:16/777/Daniel/I broke my monitor + 2015.04.23 22:02:14/123/Jimmy/New script also not working!!! + [root@localhost ~]# + +Now all this output we can redirect to the **cut** command to **cut** each line into the chunks (our delimiter "/") and print the second field: + + [root@localhost ~]# cat data.txt | cut -d"/" -f2 + 123 + 321 + 123 + 777 + 123 + [root@localhost ~]# + +Now this output we can redirect to another command to **sort**: + + [root@localhost ~]# cat data.txt | cut -d"/" -f2|sort + 123 + 123 + 123 + 321 + 777 + [root@localhost ~]# + +and leave only unique lines. To count unique entries just add **-c** key for **uniq** command: + + [root@localhost ~]# cat data.txt | cut -d"/" -f2 | sort | uniq -c + 3 123 + 1 321 + 1 777 + [root@localhost ~]# + +Just add this to end of our loop: + + #!/bin/bash + while true + do + read -p "Phone number: " phone + now=`date "+%Y.%m.%d %H:%M:%S"` + read -p "Name: " name + read -p "Issue: " issue + echo "$now/$phone/$name/$issue">>data.txt + echo "===== We got calls from =====" + cat data.txt | cut -d"/" -f2 | sort | uniq -c + echo "--------------------------------" + done + +Run it: + + [root@localhost ~]# ./note.sh + Phone number: 454 + Name: Malini + Issue: Windows license expired. + ===== We got calls from ===== + 3 123 + 1 321 + 1 454 + 1 777 + -------------------------------- + Phone number: ^C + +![running script](http://blog.linoxide.com/wp-content/uploads/2015/04/Capture11.png) + +Current scenario is going through well-known steps like: + +- Display message +- Get user input +- Store values to the file +- Do something with stored data + +But what if user has several responsibilities and he needs sometimes to input data, sometimes to do statistic calculations, or might be to find something in stored data? For that we need to implement switches / cases. In next article i will show you how to use them and how to nicely form the output. It is useful while "drawing" the tables in the shell. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-shell-script/guide-start-learning-shell-scripting-scratch/ + +作者:[Petras Liumparas][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/petrasl/ \ No newline at end of file diff --git a/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md b/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md new file mode 100644 index 0000000000..4a1020f6f2 --- /dev/null +++ b/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md @@ -0,0 +1,167 @@ +How to Securely Store Passwords and Api Keys Using Vault +================================================================================ +Vault is a tool that is used to access secret information securely, it may be password, API key, certificate or anything else. Vault provides a unified interface to secret information through strong access control mechanism and extensive logging of events. + +Granting access to critical information is quite a difficult problem when we have multiple roles and individuals across different roles requiring various critical information like, login details to databases with different privileges, API keys for external services, credentials for service oriented architecture communication etc. Situation gets even worse when access to secret information is managed across different platforms with custom settings, so rolling, secure storage and managing the audit logs is almost impossible. But Vault provides a solution to such a complex situation. + +### Salient Features ### + +Data Encryption: Vault can encrypt and decrypt data with no requirement to store it. Developers can now store encrypted data without developing their own encryption techniques and it allows security teams to define security parameters. + +**Secure Secret Storage**: Vault encrypts the secret information (API keys, passwords or certificates) before storing it on to the persistent (secondary) storage. So even if somebody gets access to the stored information by chance, it will be of no use until it is decrypted. + +**Dynamic Secrets**: On demand secrets are generated for systems like AWS and SQL databases. If an application needs to access S3 bucket, for instance, it requests AWS keypair from Vault, which grants the required secret information along with a lease time. The secret information won’t work once the lease time is expired. + +**Leasing and Renewal**: Vault grants secrets with a lease limit, it revokes the secrets as soon as lease expires which can further be renewed through APIs if required. + +**Revocation**: Upon expiring the lease period Vault can revoke a single secret or a tree of secrets. + +### Installing Vault ### + +There are two ways to use Vault. + +**1. Pre-compiled Vault Binary** can be downloaded for all Linux flavors from the following source, once done, unzip it and place it on a system PATH where other binaries are kept so that it can be accessed/invoked easily. + +- [Download Precompiled Vault Binary (32-bit)][1] +- [Download Precompiled Vault Binary (64-bit)][2] +- [Download Precompiled Vault Binary (ARM)][3] + +Download the desired precompiled Vault binary. + +![wget binary](http://blog.linoxide.com/wp-content/uploads/2015/04/wget-binary.png) + +Unzip the downloaded binary. + +![vault](http://blog.linoxide.com/wp-content/uploads/2015/04/unzip.png) + +unzipCongratulations! Vault is ready to be used. + +![](http://blog.linoxide.com/wp-content/uploads/2015/04/vault.png) + +**2. Compiling from source** is another way of installing Vault on the system. GO and GIT are required to be installed and configured properly on the system before we start the installation process. + +To **install GO on Redhat systems** use the following command. + + sudo yum install go + +To **install GO on Debian systems** use the following commands. + + sudo apt-get install golang + +OR + + sudo add-apt-repository ppa:gophers/go + + sudo apt-get update + + sudo apt-get install golang-stable + +To **install GIT on Redhat systems** use the following command. + + sudo yum install git + +To **install GIT on Debian systems** use the following commands. + + sudo apt-get install git + +Once both GO and GIT are installed we start the Vault installation process by compiling from the source. + +> Clone following Vault repository into the GOPATH + + https://github.com/hashicorp/vault + +> Verify if the following clone file exist, if it doesn’t then Vault wasn’t cloned to the proper path. + + $GOPATH/src/github.com/hashicorp/vault/main.go + +> Run following command to build Vault in the current system and put binary in the bin directory. + + make dev + +![path](http://blog.linoxide.com/wp-content/uploads/2015/04/installation4.png) + +### An introductory tutorial of Vault ### + +We have compiled Vault’s official interactive tutorial along with its output on SSH. + +**Overview** + +This tutorial will cover the following steps: + +- Initializing and unsealing your Vault +- Authorizing your requests to Vault +- Reading and writing secrets +- Sealing your Vault + +**Initialize your Vault** + +To get started, we need to initialize an instance of Vault for you to work with. +While initializing, you can configure the seal behavior of Vault. +Initialize Vault now, with 1 unseal key for simplicity, using the command: + + vault init -key-shares=1 -key-threshold=1 + +You'll notice Vault prints out several keys here. Don't clear your terminal, as these are needed in the next few steps. + +![Initializing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Initializing-SSH.png) + +**Unsealing your Vault** + +When a Vault server is started, it starts in a sealed state. In this state, Vault is configured to know where and how to access the physical storage, but doesn't know how to decrypt any of it. +Vault encrypts data with an encryption key. This key is encrypted with the "master key", which isn't stored. Decrypting the master key requires a threshold of shards. In this example, we use one shard to decrypt this master key. + + vault unseal + +![Unsealing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Unsealing-SSH.png) + +**Authorize your requests** + +Before performing any operation with Vault, the connecting client must be authenticated. Authentication is the process of verifying a person or machine is who they say they are and assigning an identity to them. This identity is then used when making requests with Vault. +For simplicity, we'll use the root token we generated on init in Step 2. This output should be available in the scrollback. +Authorize with a client token: + + vault auth + +![Authorize SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Authorize-SSH.png) + +**Read and write secrets** + +Now that Vault has been set-up, we can start reading and writing secrets with the default mounted secret backend. Secrets written to Vault are encrypted and then written to the backend storage. The backend storage mechanism never sees the unencrypted value and doesn't have the means necessary to decrypt it without Vault. + + vault write secret/hello value=world + +Of course, you can then read this data too: + + vault read secret/hello + +![RW_SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/RW_SSH.png) + +**Seal your Vault** + +There is also an API to seal the Vault. This will throw away the encryption key and require another unseal process to restore it. Sealing only requires a single operator with root privileges. This is typically part of a rare "break glass procedure". +This way, if there is a detected intrusion, the Vault data can be locked quickly to try to minimize damages. It can't be accessed again without access to the master key shards. + + vault seal + +![Seal Vault SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Seal-Vault-SSH.png) + +That is the end of introductory tutorial. + +### Summary ### + +Vault is a very useful application mainly because of providing a reliable and secure way of storing critical information. Furthermore it encrypts the critical information before storing, maintains audit logs, grants secret information for limited lease time and revokes it once lease is expired. It is platform independent and freely available to download and install. To discover more about Vault, readers are encouraged to visit the official website. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/how-tos/secure-secret-store-vault/ + +作者:[Aun Raza][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunrz/ +[1]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_386.zip +[2]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_amd64.zip +[3]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_arm.zip \ No newline at end of file diff --git a/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md new file mode 100644 index 0000000000..a8c58b82af --- /dev/null +++ b/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md @@ -0,0 +1,112 @@ +How to Setup OpenERP (Odoo) on CentOS 7.x +================================================================================ +Hi everyone, this tutorial is all about how we can setup Odoo (formerly known as OpenERP) on our CentOS 7 Server. Are you thinking to get an awesome ERP (Enterprise Resource Planning) app for your business ?. Then, OpenERP is the best app you are searching as it is a Free and Open Source Software which provides an outstanding features for your business or company. + +[OpenERP][1] is a free and open source traditional OpenERP (Enterprise Resource Planning) app which includes Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management and many more modules included for a better way to boost the productivity and sales. Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps. + +So, here are some quick and easy steps to get your copy of OpenERP installed on your CentOS machine. + +### 1. Installing PostgreSQL ### + +First of all, we'll want to update the packages installed in our CentOS 7 machine to ensure that the latest packages, patches and security are up to date. To update our sytem, we should run the following command in a shell or terminal. + + # yum clean all + # yum update + +Now, we'll want to install PostgreSQL Database System as OpenERP uses PostgreSQL for its database system. To install it, we'll need to run the following command. + + # yum install postgresql postgresql-server postgresql-libs + +![Installing postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-postgresql.png) + +After it is installed, we'll need to initialize the database with the following command + + # postgresql-setup initdb + +![Intializating postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/intializating-postgresql.png) + +We'll then set PostgreSQL to start on every boot and start the PostgreSQL Database server. + + # systemctl enable postgresql + # systemctl start postgresql + +As we haven't set a password for the user "postgresql", we'll want to set it now. + + # su - postgres + $ psql + postgres=# \password postgres + postgres=# \q + # exit + +![setting password postgres](http://blog.linoxide.com/wp-content/uploads/2015/03/setting-password-postgres.png) + +### 2. Configuring Odoo Repository ### + +After our Database Server has been installed correctly, we'll want add EPEL (Extra Packages for Enterprise Linux) to our CentOS server. Odoo (or OpenERP) depends on Python run-time and many other packages that are not included in default standard repository. As such, we'll want to add the Extra Packages for Enterprise Linux (or EPEL) repository support so that Odoo can get the required dependencies. To install, we'll need to run the following command. + + # yum install epel-release + +![Installing EPEL Release](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-epel-release.png) + +Now, after we install EPEL, we'll now add repository of Odoo (OpenERP) using yum-config-manager. + + # yum install yum-utils + + # yum-config-manager --add-repo=https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo + +![Adding OpenERP (Odoo) Repo](http://blog.linoxide.com/wp-content/uploads/2015/03/added-odoo-repo.png) + +### 3. Installing Odoo 8 (OpenERP) ### + +Finally after adding repository of Odoo 8 (OpenERP) in our CentOS 7 machine. We'll can install Odoo 8 (OpenERP) using the following command. + + # yum install -y odoo + +The above command will install odoo along with the necessary dependency packages. + +![Installing odoo or OpenERP](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-odoo.png) + +Now, we'll enable automatic startup of Odoo in every boot and will start our Odoo service using the command below. + + # systemctl enable odoo + # systemctl start odoo + +![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) + +### 4. Allowing Firewall ### + +As Odoo uses port 8069, we'll need to allow firewall for remote access. We can allow firewall to port 8069 by running the following command. + + # firewall-cmd --zone=public --add-port=8069/tcp --permanent + # firewall-cmd --reload + +![Allowing firewall Port](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-firewall-port.png) + +**Note: By default, only connections from localhost are allowed. If we want to allow remote access to PostgreSQL databases, we'll need to add the line shown in the below image to pg_hba.conf configuration file:** + + # nano /var/lib/pgsql/data/pg_hba.conf + +![Allowing Remote Access pgsql](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-remote-access-pgsql.png) + +### 5. Web Interface ### + +Finally, as we have successfully installed our latest Odoo 8 (OpenERP) on our CentOS 7 Server, we can now access our Odoo by browsing to http://ip-address:8069 http://my-site.com:8069 using our favorite web browser. Then, first thing we'll gonna do is we'll create a new database and create a new password for it. Note, the master password is admin by default. Then, we can login to our panel with that username and password. + +![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) + +### Conclusion ### + +Odoo 8 (formerly OpenERP) is the best ERP app available in the world of Open Source. We did an excellent work on installing it because OpenERP is a set of many modules which are essential for a complete ERP app for business and company. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy OpenERP (Odoo 8) :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://www.odoo.com/ \ No newline at end of file From aa632d12a58aee1090616fe8505609a70d080a13 Mon Sep 17 00:00:00 2001 From: cvsher <478990879@qq.com> Date: Wed, 6 May 2015 11:49:26 +0800 Subject: [PATCH 068/133] Update and rename 20150506 Linux grep command with 14 different examples.md to [translating]20150506 Linux grep command with 14 different examples.md --- ...]20150506 Linux grep command with 14 different examples.md} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename sources/tech/{20150506 Linux grep command with 14 different examples.md => [translating]20150506 Linux grep command with 14 different examples.md} (99%) diff --git a/sources/tech/20150506 Linux grep command with 14 different examples.md b/sources/tech/[translating]20150506 Linux grep command with 14 different examples.md similarity index 99% rename from sources/tech/20150506 Linux grep command with 14 different examples.md rename to sources/tech/[translating]20150506 Linux grep command with 14 different examples.md index 006a042bc5..7731e2fa0c 100644 --- a/sources/tech/20150506 Linux grep command with 14 different examples.md +++ b/sources/tech/[translating]20150506 Linux grep command with 14 different examples.md @@ -1,3 +1,4 @@ +translating by cvsher Linux grep command with 14 different examples ================================================================================ ### Overview : ### @@ -172,4 +173,4 @@ via: http://www.linuxtechi.com/linux-grep-command-with-14-different-examples/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.linuxtechi.com/author/pradeep/ \ No newline at end of file +[a]:http://www.linuxtechi.com/author/pradeep/ From e79626b8f8024474511e71eded14231c203a4e1b Mon Sep 17 00:00:00 2001 From: chenjt Date: Wed, 6 May 2015 14:24:47 +0800 Subject: [PATCH 069/133] [translated]How to set up networking between Docker containers.md --- ...up networking between Docker containers.md | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/translated/tech/20150323 How to set up networking between Docker containers.md b/translated/tech/20150323 How to set up networking between Docker containers.md index 41a67c6b70..3481dd8faa 100644 --- a/translated/tech/20150323 How to set up networking between Docker containers.md +++ b/translated/tech/20150323 How to set up networking between Docker containers.md @@ -12,142 +12,142 @@ ![](https://farm8.staticflickr.com/7288/16662287067_27888684a7_b.jpg) -让我们先来看看 weave 怎么工作:先创建一个由多个 peer 组成的对等网络,每个 peer 是一个虚拟路由器容器,叫做“weave 路由器”,它们分布在不同的宿主机上。这个对等网络的每个 peer 之间会维持一个 TCP 链接,用于互相交换拓扑信息,它们也会建立 UDP 链接用于容器间通信。一个 weave 路由器通过桥接技术连接到其他本宿主机上的其他容器。当处于不同宿主机上的两个容器想要通信,一台宿主机上的 weave 路由器用网桥截获数据包,使用 UDP 协议封装后发给另一台宿主机上的 weave 路由器。 +让我们先来看看 weave 怎么工作:先创建一个由多个 peer 组成的对等网络,每个 peer 是一个虚拟路由器容器,叫做“weave 路由器”,它们分布在不同的宿主机上。这个对等网络的每个 peer 之间会维持一个 TCP 链接,用于互相交换拓扑信息,它们也会建立 UDP 链接用于容器间通信。一个 weave 路由器通过桥接技术连接到其他本宿主机上的其他容器。当处于不同宿主机上的两个容器想要通信,一台宿主机上的 weave 路由器通过网桥截获数据包,使用 UDP 协议封装后发给另一台宿主机上的 weave 路由器。 -Each weave router maintains up-to-date weave router topology information, as well as container's MAC address information (similar to switch's MAC learning), so that it can make forwarding decision on container traffic. Weave is able to route traffic between containers created on hosts which are not directly reachable, as long as two hosts are interconnected via an intermediate weave router on weave topology. Optionally, weave routers can be set to encrypt both TCP control data and UDP data traffic based on public key cryptography. +每个 weave 路由器会刷新整个对等网络的拓扑信息,像容器的 MAC 地址(就像交换机的 MAC 地址学习一样获取其他容器的 MAC 地址),因此它可以决定数据包的下一跳是往哪个容器的。weave 能让两个处于不同宿主机的容器进行通信,只要这两台宿主机在 weave 拓扑结构内连到同一个 weave 路由器。另外,weave 路由器还能使用公钥加密技术将 TCP 和 UDP 数据包进行加密。 -### Prerequisite ### +### 准备工作 ### -Before using weave on Linux, of course you need to set up Docker environment on each host where you want to run [Docker][2] containers. Check out [these][3] [tutorials][4] on how to create Docker containers on Ubuntu or CentOS/Fedora. +在使用 weave 之前,你需要在所有宿主机上安装 Docker[2] 环境,参考[这些][3][教程][4],在 Ubuntu 或 CentOS/Fedora 发行版中安装 Docker。 -Once Docker environment is set up, install weave on Linux as follows. +Docker 环境部署完成后,使用下面的命令安装 weave: $ wget https://github.com/zettio/weave/releases/download/latest_release/weave $ chmod a+x weave $ sudo cp weave /usr/local/bin -Make sure that /usr/local/bin is include in your PATH variable by appending the following in /etc/profile. +注意你的 PATH 环境变量要包含 /usr/local/bin 这个路径,请在 /etc/profile 文件中加入一行(LCTT 注:要使环境变量生效,你需要执行这个命令: src /etc/profile): export PATH="$PATH:/usr/local/bin" -Repeat weave installation on every host where Docker containers will be deployed. +在每台宿主机上重复上面的操作。 -Weave uses TCP/UDP 6783 port. If you are using firewall, make sure that these port numbers are not blocked by the firewall. +Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防火墙,请确保这两个端口不会被防火墙挡住。 -### Launch Weave Router on Each Host ### +### 在每台宿主机上开启 Weave 路由器 ### -When you want to interconnect Docker containers across multiple hosts, the first step is to launch a weave router on every host. +当你想要让处于在不同宿主机上的容器能够互相通信,第一步要做的就是在每台宿主机上开启 weave 路由器。 -On the first host, run the following command, which will create and start a weave router container. +第一台宿主机,运行下面的命令,就会创建并开启一个 weave 路由器容器(LCTT 注:前面说过了,weave 路由器也是一个容器): $ sudo weave launch -The first time you run this command, it will take a couple of minutes to download a weave image before launching a router container. On successful launch, it will print the ID of a launched weave router. +第一次运行这个命令的时候,它会下载一个 weave 镜像,这会花一些时间。下载完成后就会自动运行这个镜像。成功启动后,终端会打印这个 weave 路由器的 ID 号。 -To check the status of the router, use this command: +下面的命令用于查看路由器状态: $ sudo weave status ![](https://farm9.staticflickr.com/8632/16249607573_4514790cf5_c.jpg) -Since this is the first weave router launched, there will be only one peer in the peer list. +第一个 weave 路由器就绪了,目前为止整个 peer 对等网络中只有一个 peer 成员。 -You can also verify the launch of a weave router by using docker command. +你也可以使用 doceker 的命令来查看 weave 路由器的状态: $ docker ps ![](https://farm8.staticflickr.com/7655/16681964438_51d8b18809_c.jpg) -On the second host, run the following command, where we specify the IP address of the first host as a peer to join. +第二台宿主机部署步骤稍微有点不同,我们需要为这台宿主机的 weave 路由器指定第一台宿主机的 IP 地址,命令如下: $ sudo weave launch -When you check the status of the router, you will see two peers: the current host and the first host. +当你查看路由器状态,你会看到两个 peer 成员:当前宿主机和第一个宿主机。 ![](https://farm8.staticflickr.com/7608/16868571891_e66d4b8841_c.jpg) -As you launch more routers on subsequent hosts, the peer list will grow accordingly. When launching a router, just make sure that you specify any previously launched peer's IP address. +当你开启更多路由器,这个 peer 成员列表会更长。当你新开一个路由器时,要指定前一个宿主机的 IP 地址,请注意不是第一个宿主机的 IP 地址。 -At this point, you should have a weave network up and running, which consists of multiple weave routers across different hosts. +现在你已经有了一个 weave 网络了,它由位于不同宿主机的 weave 路由器组成。 -### Interconnect Docker Containers across Multiple Hosts ### +### 把不同宿主机上的容器互联起来 ### -Now it is time to launch Docker containers on different hosts, and interconnect them on a virtual network. +接下来要做的就是在不同宿主机上开启 Docker 容器,并使用虚拟网络将它们互联起来。 -Let's say we want to create a private network 10.0.0.0/24, to interconnect two Docker containers. We will assign random IP addressses from this subnet to the containers. +假设我们创建一个私有网络 10.0.0.0/24 来互联 Docker 容器,并为这些容器随机分配 IP 地址。 -When you create a Docker container to deploy on a weave network, you need to use weave command, not docker command. Internally, the weave command uses docker command to create a container, and then sets up Docker networking on it. +如果你想新建一个能加入 weave 网络的容器,你就需要使用 weave 命令来创建,而不是 docker 命令。原因是 weave 命令内部会调用 docker 命令来新建容器然后为它设置网络。 -Here is how to create a Ubuntu container on hostA, and attach the container to 10.0.0.0/24 subnet with an IP addresss 10.0.0.1. +下面的命令是在宿主机 hostA 上建立一个 Ubuntu 容器,然后将它放到 10.0.0.0/24 网络中,分配的 IP 地址为 10.0.0.1: hostA:~$ sudo weave run 10.0.0.1/24 -t -i ubuntu -On successful run, it will print the ID of a created container. You can use this ID to attach to the running container and access its console as follows. +成功运行后,终端会打印出容器的 ID 号。你可以使用这个 ID 来访问这个容器: hostA:~$ docker attach -Move to hostB, and let's create another container. Attach it to the same subnet (10.0.0.0/24) with a different IP address 10.0.0.2. +在宿主机 hostB 上,也创建一个 Ubuntu 容器,IP 地址为 10.0.0.2: hostB:~$ sudo weave run 10.0.0.2/24 -t -i ubuntu -Let's attach to the second container's console as well: +访问下这个容器的控制台: hostB:~$ docker attach -At this point, those two containers should be able to ping each other via the other's IP address. Verify that from each container's console. +这两个容器能够互相 ping 通,你可以通过容器的控制台检查一下。 ![](https://farm9.staticflickr.com/8566/16868571981_d73c8e401b_c.jpg) -If you check the interfaces of each container, you will see an interface named "ethwe" which is assigned an IP address (e.g., 10.0.0.1 and 10.0.0.2) you specified. +如果你检查一下每个容器的网络配置,你会发现有一块名为“ethwe”的网卡,你分配给容器的 IP 地址出现在它们那里(比如这里分别是 10.0.0.1 和 10.0.0.2)。 ![](https://farm8.staticflickr.com/7286/16681964648_013f9594b1_b.jpg) -### Other Advanced Usages of Weave ### +### Weave 的其他高级用法 ### -Weave offers a number of pretty neat features. Let me briefly cover a few here. +weave 提供了一些非常巧妙的特性,我在这里作下简单的介绍。 -#### Application Isolation #### +#### 应用分离 #### -Using weave, you can create multiple virtual networks and dedicate each network to a distinct application. For example, create 10.0.0.0/24 for one group of containers, and 10.10.0.0/24 for another group of containers, and so on. Weave automatically takes care of provisioning these networks, and isolating container traffic on each network. Going further, you can flexibly detach a container from one network, and attach it to another network without restarting containers. For example: +使用 weave,你可以创建多个虚拟网络,并为每个网络设置不同的应用。比如你可以为一群容器创建 10.0.0.0/24 网络,为另一群容器创建 10.10.0.0/24 网络,weave 会自动帮你维护这些网络,并将这两个网络互相隔离。另外,你可以灵活地将一个容器从一个网络移到另一个网络而不需要重启容器。举个例子: -First launch a container on 10.0.0.0/24: +首先开启一个容器,运行在 10.0.0.0/24 网络上: $ sudo weave run 10.0.0.2/24 -t -i ubuntu -Detach the container from 10.0.0.0/24: +然后让它脱离这个网络: $ sudo weave detach 10.0.0.2/24 -Re-attach the container to another network 10.10.0.0/24: +最后将它加入到 10.10.0.0/24 网络中: $ sudo weave attach 10.10.0.2/24 ![](https://farm8.staticflickr.com/7639/16247212144_c31a49714d_c.jpg) -Now this container should be able to communicate with other containers on 10.10.0.0/24. This is a pretty useful feature when network information is not available at the time you create a container. +现在这个容器可以与 10.10.0.0/24 网络上的其它容器进行通信了。当你要把容器加入一个网络,而这个网络暂时不可用时,上面的步骤就很有帮助了。 -#### Integrate Weave Networks with Host Network #### +#### 将 weave 网络与宿主机网络整合起来 #### -Sometimes you may need to allow containers on a virtual weave network to access physical host network. Conversely, hosts may want to access containers on a weave network. To support this requirement, weave allows weave networks to be integrated with host network. +有时候你想让虚拟网络中的容器能访问物理主机的网络。或者相反,宿主机需要访问容器。为满足这个功能,weave 允许虚拟网络与宿主机网络整合。 -For example, on hostA where a container is running on network 10.0.0.0/24, run the following command. +举个例子,在宿主机 hostA 上一个容器运行在 10.0.0.0/24 中,运行使用下面的命令: hostA:~$ sudo weave expose 10.0.0.100/24 -This will assign IP address 10.0.0.100 to hostA, so that hostA itself is also connected to 10.0.0.0/24 network. Obviously, you need to choose an IP address which is not used by any other containers on the network. +这个命令把 IP 地址 10.0.0.100 分配给宿主机 hostA,这样一来 hostA 也连到了 10.0.0.0/24 网络上了。很明显,你在为宿主机选择 IP 地址的时候,需要选一个没有被其他容器使用的地址。 -At this point, hostA should be able to access any containers on 10.0.0.0/24, whether or not the containers are residing on hostA. Pretty neat! +现在 hostA 就可以访问 10.0.0.0/24 上的所有容器了,不管这些容器是否位于 hostA 上。好巧妙的设定啊,32 个赞! -### Conclusion ### +### 总结 ### -As you can see, weave is a pretty useful Docker networking tool. This tutorial only covers a glimpse of [its powerful features][5]. If you are more ambitious, you can try its multi-hop routing, which can be pretty useful in multi-cloud environment, dynamic re-routing, which is a neat fault-tolerance feature, or even its distributed DNS service which allows you to name containers on weave networks. If you decide to use this gem in your environment, feel free to share your use case! +如你所见,weave 是一个很有用的 docker 网络配置工具。这个教程只是[它强悍功能][5]的冰山一角。如果你想进一步玩玩,你可以试试它的以下功能:多跳路由功能,这个在 multi-cloud 环境(LCTT 注:多云,企业使用多个不同的云服务提供商的产品,比如 IaaS 和 SaaS,来承载不同的业务)下还是很有用的;动态重路由功能是一个很巧妙的容错技术;或者它的分布式 DNS 服务,它允许你为你的容器命名。如果你决定使用这个好东西,欢迎分享你的使用心得。 -------------------------------------------------------------------------------- via: http://xmodulo.com/networking-between-docker-containers.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From fbf3019fac431b97f1c050a170489e66e6fd20e7 Mon Sep 17 00:00:00 2001 From: wwy Date: Wed, 6 May 2015 22:40:30 +0800 Subject: [PATCH 070/133] first translate request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tech 的文章应该比较适合我这种新人吧。 --- ...w to Securely Store Passwords and Api Keys Using Vault.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md b/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md index 4a1020f6f2..858197989d 100644 --- a/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md +++ b/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md @@ -1,3 +1,6 @@ +Translating by wwy-hust + + How to Securely Store Passwords and Api Keys Using Vault ================================================================================ Vault is a tool that is used to access secret information securely, it may be password, API key, certificate or anything else. Vault provides a unified interface to secret information through strong access control mechanism and extensive logging of events. @@ -164,4 +167,4 @@ via: http://linoxide.com/how-tos/secure-secret-store-vault/ [a]:http://linoxide.com/author/arunrz/ [1]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_386.zip [2]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_amd64.zip -[3]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_arm.zip \ No newline at end of file +[3]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_arm.zip From 7c497f33f9aca7def04c787dfc0e2573d093c593 Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 7 May 2015 09:55:03 +0800 Subject: [PATCH 071/133] Update 20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md --- ...password for default keyring to unlock on Ubuntu desktop.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md b/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md index 2034bdca7b..9040bae6eb 100644 --- a/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md +++ b/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop ================================================================================ > **Question**: When I boot up my Ubuntu desktop, a pop up dialog appears, asking me to enter a password to unlock default keyring. How can I disable this "unlock default keyring" pop up window, and automatically unlock my keyring? @@ -52,4 +53,4 @@ via: http://ask.xmodulo.com/disable-entering-password-unlock-default-keyring.htm 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://ask.xmodulo.com/author/nanni \ No newline at end of file +[a]:http://ask.xmodulo.com/author/nanni From 498f3dc0d7a4276bdf283fa2c795e1608299e1eb Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 7 May 2015 10:26:38 +0800 Subject: [PATCH 072/133] [Translated]20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md --- ...ult keyring to unlock on Ubuntu desktop.md | 56 ------------------- ...ult keyring to unlock on Ubuntu desktop.md | 54 ++++++++++++++++++ 2 files changed, 54 insertions(+), 56 deletions(-) delete mode 100644 sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md create mode 100644 translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md b/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md deleted file mode 100644 index 9040bae6eb..0000000000 --- a/sources/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md +++ /dev/null @@ -1,56 +0,0 @@ -Translating by GOLinux! -Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop -================================================================================ -> **Question**: When I boot up my Ubuntu desktop, a pop up dialog appears, asking me to enter a password to unlock default keyring. How can I disable this "unlock default keyring" pop up window, and automatically unlock my keyring? - -A keyring is thought of as a local database that stores your login information in encrypted forms. Various desktop applications (e.g., browsers, email clients) use a keyring to store and manage your login credentials, secrets, passwords, certificates, or keys securely. For those applications to retrieve the information stored in a keyring, the keyring needs to be unlocked. - -GNOME keyring used by Ubuntu desktop is integrated with desktop login, and the keyring is automatically unlocked when you authenticate into your desktop. But your default keyring can remain "locked" if you set up automatic desktop login or wake up from hibernation. In this case, you will be prompted: - -> "Enter password for keyring 'Default keyring' to unlock. An application wants to access to the keyring 'Default keyring,' but it is locked." - -![](https://farm9.staticflickr.com/8787/16716456754_309c39513c_o.png) - -If you want to avoid typing a password to unlock your default keyring every time such a pop-up dialog appears, here is how you can do it. - -Before doing that, understand the implication of disabling the password prompt. By automatically unlocking the default keyring, you will make your keyring (and any information stored in the keyring) accessible to anyone who uses your desktop, without them having to know your password. - -### Disable Password for Unlocking Default Keyring ### - -Open up Dash, and type "password" to launch "Passwords and Keys" app. - -![](https://farm8.staticflickr.com/7709/17312949416_ed9c4fbe2d_b.jpg) - -Alternatively, use the seahorse command to launch the GUI from the command line. - - $ seahorse - -On the left side panel, right-click on the "Default keyring," and choose "Change Password." - -![](https://farm8.staticflickr.com/7740/17159959750_ba5b675b00_b.jpg) - -Type your current login password. - -![](https://farm8.staticflickr.com/7775/17347551135_ce09260818_b.jpg) - -Leave a new password for the "Default" keyring as blank. - -![](https://farm8.staticflickr.com/7669/17345663222_c9334c738b_c.jpg) - -Click on "Continue" button to confirm to store passwords unencrypted. - -![](https://farm8.staticflickr.com/7761/17152692309_ce3891a0d9_c.jpg) - -That's it. From now on, you won't be prompted to unlock the default keyring. - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/disable-entering-password-unlock-default-keyring.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni diff --git a/translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md b/translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md new file mode 100644 index 0000000000..2871298396 --- /dev/null +++ b/translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md @@ -0,0 +1,54 @@ +Linux有问必答——Ubuntu桌面上如何禁用默认的密钥环解锁密码输入 +================================================================================ +>**问题**:当我启动我的Ubuntu桌面时,出现了一个弹出对话框,要求我输入密码来解锁默认的密钥环。我怎样才能禁用这个“解锁默认密钥环”弹出窗口,并自动解锁我的密钥环? + +密钥环被认为是用来以加密方式存储你的登录信息的本地数据库。各种桌面应用(如浏览器、电子邮件客户端)使用密钥环来安全地存储并管理你的登录凭证、机密、密码、证书或密钥。对于那些需要检索存储在密钥环中的信息的应用程序,需要解锁该密钥环。 + +Ubuntu桌面所使用的GNOME密钥环被整合到了桌面登录中,该密钥环会在你验证进入桌面后自动解锁。但是,如果你设置了自动登录桌面或者是从休眠中唤醒,你默认的密钥环仍然可能“被锁定”的。在这种情况下,你会碰到这一提示: + +>“为密钥环‘默认密钥环’输入密码来解锁。某个应用想要访问密钥环‘默认密钥环’,但它被锁定了。” +> +![](https://farm9.staticflickr.com/8787/16716456754_309c39513c_o.png) + +如果你想要避免在每次弹出对话框出现时输入密码来解锁默认密钥环,那么你可以这样做。 + +在做之前,请先了解禁用密码提示后可能出现的结果。通过自动解锁默认密钥环,你可以让任何使用你桌面的人无需知道你的密码而能获取你的密钥环(以及存储在密钥环中的任何信息)。 + +### 禁用默认密钥环解锁密码 ### + +打开Dash,然后输入“密码”来启动“密码和密钥”应用。 + +![](https://farm8.staticflickr.com/7709/17312949416_ed9c4fbe2d_b.jpg) + +或者,使用seahorse命令从命令行启动图形界面。 + + $ seahorse + +在左侧面板中,右击“默认密钥环”,并选择“修改密码”。 + +![](https://farm8.staticflickr.com/7740/17159959750_ba5b675b00_b.jpg) + +输入你的当前登录密码。 + +![](https://farm8.staticflickr.com/7775/17347551135_ce09260818_b.jpg) +在设置“默认”密钥环新密码的密码框中留空。 + +![](https://farm8.staticflickr.com/7669/17345663222_c9334c738b_c.jpg) + +在询问是否不加密存储密码对话框中点击“继续”。 + +![](https://farm8.staticflickr.com/7761/17152692309_ce3891a0d9_c.jpg) + +搞定。从今往后,那个该死的解锁密钥环提示对话框再也不会来烦你了。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/disable-entering-password-unlock-default-keyring.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni From d32977decb9f54a892f8790927bf4415b6a3ff57 Mon Sep 17 00:00:00 2001 From: joeren Date: Thu, 7 May 2015 10:32:20 +0800 Subject: [PATCH 073/133] Update 20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md --- ... 'Systemd' Services and Units Using 'Systemctl' in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md b/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md index 60e41c57ab..563eb2cd0f 100644 --- a/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md +++ b/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! How to Manage ‘Systemd’ Services and Units Using ‘Systemctl’ in Linux ================================================================================ Systemctl is a systemd utility which is responsible for Controlling the systemd system and service manager. @@ -576,4 +577,4 @@ via: http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://www.tecmint.com/author/avishek/ \ No newline at end of file +[a]:http://www.tecmint.com/author/avishek/ From 0bc424587ea89ffdc72d6b08522b39761b4404e0 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Thu, 7 May 2015 12:48:48 +0800 Subject: [PATCH 074/133] [Translated]20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md --- ...es and Units Using 'Systemctl' in Linux.md | 135 +++++++++--------- 1 file changed, 67 insertions(+), 68 deletions(-) rename {sources => translated}/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md (78%) diff --git a/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md b/translated/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md similarity index 78% rename from sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md rename to translated/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md index 563eb2cd0f..a78dc01820 100644 --- a/sources/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md +++ b/translated/tech/20150505 How to Manage 'Systemd' Services and Units Using 'Systemctl' in Linux.md @@ -1,29 +1,28 @@ -Translating by GOLinux! -How to Manage ‘Systemd’ Services and Units Using ‘Systemctl’ in Linux +在Linux中使用‘Systemctl’管理‘Systemd’服务和单元 ================================================================================ -Systemctl is a systemd utility which is responsible for Controlling the systemd system and service manager. +Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器。 -Systemd is a collection of system management daemons, utilities and libraries which serves as a replacement of System V init daemon. Systemd functions as central management and configuration platform for UNIX like system. +Systemd是一个系统管理守护进程、工具和库的集合,用于取代System V初始进程。Systemd的功能是用于集中管理和配置类UNIX系统。 -In the Linux Ecosystem Systemd has been implemented on most of the standard Linux Distribution with a few exception. Systemd is the parent Process of all other daemons oftenly but not always. +在Linux生态系统中,Systemd被部署到了大多数的标准Linux发行版中,只有位数不多的几个尚未部署。Systemd通常是所有其它守护进程的父进程,但并非总是如此。 ![Manage Linux Services Using Systemctl](http://www.tecmint.com/wp-content/uploads/2015/04/Manage-Linux-Services-Using-Systemctl.jpg) -Manage Linux Services Using Systemctl +使用Systemctl管理Linux服务 -This article aims at throwing light on “How to control System and Services” on a system running systemd. +本文旨在阐明在运行systemd的系统上“如何控制系统和服务”。 -### Starting with Systemtd and Systemctl Basics ### +### Systemd初体验和Systemctl基础 ### -#### 1. First check if systemd is installed on your system or not and what is the version of currently installed Systemd? #### +#### 1. 首先检查你的系统中是否安装有systemd并确定当前安装的版本 #### # systemd --version systemd 215 +PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR -It’s clear from the above example, that we have systemd 215 version Installed. +上例中很清楚地表明,我们安装了215版本的systemd。 -#### 2. Check where the binaries and libraries of systemd and systemctl are installed. #### +#### 2. 检查systemd和systemctl的二进制文件和库文件的安装位置 #### # whereis systemd systemd: /usr/lib/systemd /etc/systemd /usr/share/systemd /usr/share/man/man1/systemd.1.gz @@ -32,7 +31,7 @@ It’s clear from the above example, that we have systemd 215 version Installed. # whereis systemctl systemctl: /usr/bin/systemctl /usr/share/man/man1/systemctl.1.gz -#### 3. Check whether systemd is running or not. #### +#### 3. 检查systemd是否运行 #### # ps -eaf | grep [s]ystemd @@ -42,18 +41,18 @@ It’s clear from the above example, that we have systemd 215 version Installed. root 555 1 0 16:27 ? 00:00:00 /usr/lib/systemd/systemd-logind dbus 556 1 0 16:27 ? 00:00:00 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation -**Notice**: systemd is running as parent daemon (PID=1). In the above command ps with (-e) select all Processes, (- +**注意**:systemd是作为父进程(PID=1)运行的。在上面带(-e)参数的ps命令输出中,选择所有进程,(- -a) select all processes except session leaders and (-f) for full format listing (i.e. -eaf). +a)选择除会话前导外的所有进程,并使用(-f)参数输出完整格式列表(如 -eaf)。 -Also note the square brackets in the above example and rest of the examples to follow. Square Bracket expression is part of grep’s character class pattern matching. +也请注意上例中后随的方括号和样例剩余部分。方括号表达式是grep的字符类表达式的一部分。 -#### 4. Analyze systemd boot process. #### +#### 4. 分析systemd启动进程 #### # systemd-analyze Startup finished in 487ms (kernel) + 2.776s (initrd) + 20.229s (userspace) = 23.493s -#### 5. Analyze time taken by each process at boot. #### +#### 5. 分析启动时各个进程花费的时间 #### # systemd-analyze blame @@ -69,7 +68,7 @@ Also note the square brackets in the above example and rest of the examples to f 1.126s systemd-logind.service .... -#### 6. Analyze critical chain at boot. #### +#### 6. 分析启动时的关键链 #### # systemd-analyze critical-chain @@ -95,9 +94,9 @@ Also note the square brackets in the above example and rest of the examples to f └─systemd-fsck@dev-disk-by\x2duuid-79f594ad\x2da332\x2d4730\x2dbb5f\x2d85d19608096 └─dev-disk-by\x2duuid-79f594ad\x2da332\x2d4730\x2dbb5f\x2d85d196080964.device @4 -**Important**: Systemctl accepts services (.service), mount point (.mount), sockets (.socket) and devices (.device) as units. +**重要**:Systemctl接受服务(.service),挂载点(.mount),套接口(.socket)和设备(.device)作为单元。 -#### 7. List all the available units. #### +#### 7. 列出所有可用单元 #### # systemctl list-unit-files @@ -113,7 +112,7 @@ Also note the square brackets in the above example and rest of the examples to f brandbot.path disabled ..... -#### 8. List all running units. #### +#### 8. 列出所有运行中单元 #### # systemctl list-units @@ -134,7 +133,7 @@ Also note the square brackets in the above example and rest of the examples to f sys-module-configfs.device loaded active plugged /sys/module/configfs ... -#### 9. List all failed units. #### +#### 9. 列出所有失败单元 #### # systemctl --failed @@ -148,13 +147,13 @@ Also note the square brackets in the above example and rest of the examples to f 1 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'. -#### 10. Check if a Unit (cron.service) is enabled or not?. #### +#### 10. 检查某个单元(cron.service)是否启用 #### # systemctl is-enabled crond.service enabled -#### 11. Check whether a Unit or Service is running or not?. #### +#### 11. 检查某个单元或服务是否运行 #### # systemctl status firewalld.service @@ -168,9 +167,9 @@ Also note the square brackets in the above example and rest of the examples to f Apr 28 16:27:51 tecmint systemd[1]: Starting firewalld - dynamic firewall daemon... Apr 28 16:27:55 tecmint systemd[1]: Started firewalld - dynamic firewall daemon. -### Control and Manage Services Using Systemctl ### +### 使用Systemctl控制并管理服务 ### -#### 12. List all services (including enabled and disabled). #### +#### 12. 列出所有服务(包括启用的和禁用的) #### # systemctl list-unit-files --type=service @@ -188,7 +187,7 @@ Also note the square brackets in the above example and rest of the examples to f dbus-org.fedoraproject.FirewallD1.service enabled .... -#### 13. How do I start, restart, stop, reload and check the status of a service (httpd.service) in Linux. #### +#### 13. Linux中如何启动、重启、停止、重载服务以及检查服务(httpd.service)状态 #### # systemctl start httpd.service # systemctl restart httpd.service @@ -215,15 +214,15 @@ Also note the square brackets in the above example and rest of the examples to f Apr 28 17:21:30 tecmint systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full. -**Note**: When we use commands like start, restart, stop and reload with systemctl, we will not get any output on the terminal, only status command will print the output. +**注意**:当我们使用systemctl的start,restart,stop和reload命令时,我们不会不会从终端获取到任何输出内容,只有status命令可以打印输出。 -#### 14. How to active a service and enable or disable a service at boot time (auto start service at system boot). #### +#### 14. 如何激活服务并在启动时启用或禁用服务(系统启动时自动启动服务) #### # systemctl is-active httpd.service # systemctl enable httpd.service # systemctl disable httpd.service -#### 15. How to mask (making it impossible to start) or unmask a service (httpd.service). #### +#### 15. 如何屏蔽(让它不能启动)或显示服务(httpd.service) #### # systemctl mask httpd.service ln -s '/dev/null' '/etc/systemd/system/httpd.service' @@ -231,7 +230,7 @@ Also note the square brackets in the above example and rest of the examples to f # systemctl unmask httpd.service rm '/etc/systemd/system/httpd.service' -#### 16. How to a Kill a service using systemctl command. #### +#### 16. 使用systemctl命令杀死服务 #### # systemctl kill httpd # systemctl status httpd @@ -254,9 +253,9 @@ Also note the square brackets in the above example and rest of the examples to f Apr 28 18:01:42 tecmint systemd[1]: Unit httpd.service entered failed state. Hint: Some lines were ellipsized, use -l to show in full. -### Control and Manage Mount Points using Systemctl ### +### 使用Systemctl控制并管理挂载点 ### -#### 17. List all system mount points. #### +#### 17. 列出所有系统挂载点 #### # systemctl list-unit-files --type=mount @@ -269,7 +268,7 @@ Also note the square brackets in the above example and rest of the examples to f sys-kernel-debug.mount static tmp.mount disabled -#### 18. How do I mount, unmount, remount, reload system mount points and also check the status of mount points on the system. #### +#### 18. 挂载、卸载、重新挂载、重载系统挂载点并检查系统中挂载点状态 #### # systemctl start tmp.mount # systemctl stop tmp.mount @@ -292,13 +291,13 @@ Also note the square brackets in the above example and rest of the examples to f Apr 28 17:46:06 tecmint systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting anyway. Apr 28 17:46:06 tecmint systemd[1]: Mounted Temporary Directory. -#### 19. How to active, enable or disable a mount point at boot time (auto mount at system boot). #### +#### 19. 在启动时激活、启用或禁用挂载点(系统启动时自动挂载) #### # systemctl is-active tmp.mount # systemctl enable tmp.mount # systemctl disable tmp.mount -#### 20. How to mask (making it impossible to start) or unmask a mount points in Linux. #### +#### 20. 在Linux中屏蔽(让它不能启动)或显示挂载点 #### # systemctl mask tmp.mount @@ -308,9 +307,9 @@ Also note the square brackets in the above example and rest of the examples to f rm '/etc/systemd/system/tmp.mount' -### Control and Manage Sockets using Systemctl ### +### 使用Systemctl控制并管理套接口 ### -#### 21. List all available system sockets. #### +#### 21. 列出所有可用系统套接口 #### # systemctl list-unit-files --type=socket @@ -329,7 +328,7 @@ Also note the square brackets in the above example and rest of the examples to f 11 unit files listed. -#### 22. How do I start, restart, stop, reload and check the status of a socket (example: cups.socket) in Linux. #### +#### 22. 在Linux中启动、重启、停止、重载套接口并检查其状态#### # systemctl start cups.socket # systemctl restart cups.socket @@ -345,13 +344,13 @@ Also note the square brackets in the above example and rest of the examples to f Apr 28 18:10:59 tecmint systemd[1]: Starting CUPS Printing Service Sockets. Apr 28 18:10:59 tecmint systemd[1]: Listening on CUPS Printing Service Sockets. -#### 23. How to active a socket and enable or disable at boot time (auto start socket at system boot). #### +#### 23. 在启动时激活套接口,并启用或禁用它(系统启动时自启动) #### # systemctl is-active cups.socket # systemctl enable cups.socket # systemctl disable cups.socket -#### 24. How to mask (making it impossible to start) or unmask a socket (cups.socket). #### +#### 24. 屏蔽(使它不能启动)或显示套接口 #### # systemctl mask cups.socket ln -s '/dev/null' '/etc/systemd/system/cups.socket' @@ -359,31 +358,31 @@ Also note the square brackets in the above example and rest of the examples to f # systemctl unmask cups.socket rm '/etc/systemd/system/cups.socket' -### CPU Utilization (Shares) of a Service ### +### 服务的CPU利用率(分配额) ### -#### 25. Get the current CPU Shares of a Service (say httpd). #### +#### 25. 获取当前某个服务的CPU分配额(如httpd) #### # systemctl show -p CPUShares httpd.service CPUShares=1024 -**Note**: The default each service has a CPUShare = 1024. You may increase/decrease CPU share of a process. +**注意**:各个服务的默认CPU分配份额=1024,你可以增加/减少某个进程的CPU分配份额。 -#### 26. Limit the CPU Share of a service (httpd.service) to 2000 CPUShares/ #### +#### 26. 将某个服务(httpd.service)的CPU分配份额限制为2000 CPUShares/ #### # systemctl set-property httpd.service CPUShares=2000 # systemctl show -p CPUShares httpd.service CPUShares=2000 -**Note**: When you set CPUShare for a service, a directory with the name of service is created (httpd.service.d) which contains a file 90-CPUShares.conf which contains the CPUShare Limit information. You may view the file as: +**注意**:当你为某个服务设置CPUShares,会自动创建一个以服务名命名的目录(httpd.service),里面包含了一个名为90-CPUShares.conf的文件,该文件含有CPUShare限制信息,你可以通过以下方式查看该文件: # vi /etc/systemd/system/httpd.service.d/90-CPUShares.conf [Service] CPUShares=2000 -#### 27. Check all the configuration details of a service. #### +#### 27. 检查某个服务的所有配置细节 #### # systemctl show httpd @@ -402,7 +401,7 @@ Also note the square brackets in the above example and rest of the examples to f FragmentPath=/usr/lib/systemd/system/httpd.service .... -#### 28. Analyze critical chain for a services(httpd). #### +#### 28. 分析某个服务(httpd)的关键链 #### # systemd-analyze critical-chain httpd.service @@ -427,7 +426,7 @@ Also note the square brackets in the above example and rest of the examples to f └─systemd-fsck@dev-disk-by\x2duuid-79f594ad\x2da332\x2d4730\x2dbb5f\x2d85d196080964.service @4.092s +149ms └─dev-disk-by\x2duuid-79f594ad\x2da332\x2d4730\x2dbb5f\x2d85d196080964.device @4.092s -#### 29. Get a list of dependencies for a services (httpd). #### +#### 29. 获取某个服务(httpd)的依赖性列表 #### # systemctl list-dependencies httpd.service @@ -449,7 +448,7 @@ Also note the square brackets in the above example and rest of the examples to f │ ├─dbus.socket .... -#### 30. List control groups hierarchically. #### +#### 30. 按等级列出控制组 #### # systemd-cgls @@ -473,7 +472,7 @@ Also note the square brackets in the above example and rest of the examples to f │ └─721 /usr/lib/polkit-1/polkitd --no-debug .... -#### 31. List control group according to CPU, memory, Input and Output. #### +#### 31. 按CPU、内存、输入和输出列出控制组 #### # systemd-cgtop @@ -502,9 +501,9 @@ Also note the square brackets in the above example and rest of the examples to f /system.slice/webmin.service 1 - - - - /user.slice/user-0.slice/session-1.scope 3 - - - - -### Control System Runlevels ### +### 控制系统运行等级 ### -#### 32. How to start system rescue mode. #### +#### 32. 启动系统救援模式 #### # systemctl rescue @@ -512,7 +511,7 @@ Also note the square brackets in the above example and rest of the examples to f The system is going down to rescue mode NOW! -#### 33. How to enter into emergency mode. #### +#### 33. 进入紧急模式 #### # systemctl emergency @@ -520,31 +519,31 @@ Also note the square brackets in the above example and rest of the examples to f system logs, "systemctl reboot" to reboot, "systemctl default" to try again to boot into default mode. -#### 34. List current run levels in use. #### +#### 34. 列出当前使用的运行等级 #### # systemctl get-default multi-user.target -#### 35. How to start Runlevel 5 aka graphical mode. #### +#### 35. 启动运行等级5,即图形模式 #### # systemctl isolate runlevel5.target OR # systemctl isolate graphical.target -#### 36. How to start Runlevel 3 aka multiuser mode (commandline). #### +#### 36. 启动运行等级3,即多用户模式(命令行) #### # systemctl isolate runlevel3.target OR # systemctl isolate multiuser.target -#### 36. How to set multiusermode or graphical mode as default runlevel. #### +#### 36. 设置多用户模式或图形模式为默认运行等级 #### # systemctl set-default runlevel3.target # systemctl set-default runlevel5.target -#### 37. How to reboot, halt, suspend, hibernate or put system in hybrid-sleep. #### +#### 37. 重启、停止、挂起、休眠系统或使系统进入混合睡眠 #### # systemctl reboot @@ -556,23 +555,23 @@ Also note the square brackets in the above example and rest of the examples to f # systemctl hybrid-sleep -For those who may not be aware of runlevels and what it does. +对于不知运行等级为何物的人,说明如下。 -- Runlevel 0 : Shut down and Power off the system. -- Runlevel 1 : Rescue?Maintainance Mode. -- Runlevel 3 : multiuser, no-graphic system. -- Runlevel 4 : multiuser, no-graphic system. -- Runlevel 5 : multiuser, graphical system. -- Runlevel 6 : Shutdown and Reboot the machine. +- Runlevel 0 : 关闭系统 +- Runlevel 1 : 救援?维护模式 +- Runlevel 3 : 多用户,无图形系统 +- Runlevel 4 : 多用户,无图形系统 +- Runlevel 5 : 多用户,图形化系统 +- Runlevel 6 : 关闭并重启机器 -That’s all for now. Keep connected! Keep commenting. Don’t forget to provide us with your valuable feedback in the comments below. Like and share us and help us get spread. +到此为止吧。保持连线,进行评论。别忘了在下面的评论中为我们提供一些有价值的反馈哦。喜欢我们、与我们分享,求扩散。 -------------------------------------------------------------------------------- via: http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ 作者:[Avishek Kumar][a] -译者:[译者ID](https://github.com/译者ID) +译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 9585447a391a2c8d43f1f68d8a49969610edc70d Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Thu, 7 May 2015 13:20:34 +0800 Subject: [PATCH 075/133] Translating by ZTinoZ --- ... Install Inkscape - Open Source Vector Graphic Editor.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md b/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md index 3deb76c7c0..35a36183e7 100644 --- a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md +++ b/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md @@ -10,9 +10,9 @@ Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上但是 #### 创建对象 #### -- Drawing different colored sized and shaped freehand lines through pencil tool, straight lines and curves through Bezier (pen) tool, applying freehand calligraphic strokes through calligraphic tool etc -- Creating, selecting, editing and formatting text through text tool. Manipulating text in plain text boxes, on paths or in shapes -- Helps draw various shapes like rectangles, ellipses, circles, arcs, polygons, stars, spirals etc and then resize, rotate and modify (turn sharp edges round) them +- 用铅笔工具来画出不同颜色、大小和形状的手绘线,用贝塞尔曲线(笔式)工具来画出直线和曲线,通过书法工具来应用到手写的书法笔画上等等 +- 用文本工具来创建、选择、编辑和格式化文本。Manipulating text in plain text boxes, on paths or in shapes +- 有效绘制各种形状,像矩形、椭圆形、圆形、弧线、多边形、星形和螺旋形等等并调整其大小、旋转并修改它们 and then resize, rotate and modify (turn sharp edges round) them - Create and embed bitmaps with simple commands #### 对象处理 #### From 70b29b6d59701ab226adc365cb3ccf8c7ae5a2f6 Mon Sep 17 00:00:00 2001 From: KayGuoWhu Date: Thu, 7 May 2015 15:10:47 +0800 Subject: [PATCH 076/133] translating again --- ...20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md b/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md index f85b2cf725..0f7a2d20aa 100644 --- a/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md +++ b/sources/tech/20150227 Enjoy Android Apps on Ubuntu using ARChon Runtime.md @@ -1,3 +1,4 @@ +[translating by KayGuoWhu] Enjoy Android Apps on Ubuntu using ARChon Runtime ================================================================================ Before, we gave try to many android app emulating tools like Genymotion, Virtualbox, Android SDK, etc to try to run android apps on it. But, with this new Chrome Android Runtime, we are able to run Android Apps on our Chrome Browser. So, here are the steps we'll need to follow to install Android Apps on Ubuntu using ARChon Runtime. From f7d1200cd5d63383b6faf0636f57289e6ffcbe58 Mon Sep 17 00:00:00 2001 From: DeadFire Date: Thu, 7 May 2015 16:15:40 +0800 Subject: [PATCH 077/133] =?UTF-8?q?20150507-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...to Monitor Linux Containers Performance.md | 192 ++++++++++++++++++ ... in Debian Ubuntu Linux Mint and Fedora.md | 134 ++++++++++++ 2 files changed, 326 insertions(+) create mode 100644 sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md create mode 100644 sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md diff --git a/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md b/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md new file mode 100644 index 0000000000..a9b1d4cd30 --- /dev/null +++ b/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md @@ -0,0 +1,192 @@ +Command Line Tool to Monitor Linux Containers Performance +================================================================================ +ctop is a new command line based tool available to monitor the processes at the container level. Containers provide operating system level virtualization environment by making use of the cgroups resource management functionality. This tool collects data related to memory, cpu, block IO and metadata like owner, uptime etc from cgroups and presents it in a user readable format so that one can quickly asses the overall health of the system. Based on the data collected, it tries to guess the underlying container technology. ctop is useful in detecting who is using large amounts of memory under low memory situations. + +### Capabilities ### + +Some of the capabilities of ctop are: + +- Collect metrics for cpu, memory and blkio +- Gather information regarding owner, container technology, task count +- Sort the information using any column +- Display the information using tree view +- Fold/unfold cgroup tree +- Select and follow a cgroup/container +- Select a timeframe for refreshing the displayed data +- Pause the refreshing of data +- Detect containers that are based on systemd, Docker and LXC +- Advance features for Docker and LXC based containers + - open / attach a shell for further diagnosis + - stop / kill container types + +### Installation ### + +**ctop** is written using Python and there are no other external dependencies other than having to use Python version 2.6 or greater (with built-in cursor support). Installation using Python's pip is the recommended method. Install pip if not already done and install ctop using pip. + +*Note: The examples shown in this article are from an Ubuntu (14.10) system* + + $ sudo apt-get install python-pip + +Installing ctop using pip: + + poornima@poornima-Lenovo:~$ sudo pip install ctop + + [sudo] password for poornima: + + Downloading/unpacking ctop + + Downloading ctop-0.4.0.tar.gz + + Running setup.py (path:/tmp/pip_build_root/ctop/setup.py) egg_info for package ctop + + Installing collected packages: ctop + + Running setup.py install for ctop + + changing mode of build/scripts-2.7/ctop from 644 to 755 + + changing mode of /usr/local/bin/ctop to 755 + + Successfully installed ctop + + Cleaning up... + +If using pip is not an option, you can also install it directly from the github using wget: + + poornima@poornima-Lenovo:~$ wget https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py -O ctop + + --2015-04-29 19:32:53-- https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py + + Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.27.78.133 + + Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.27.78.133|:443... connected. + + HTTP request sent, awaiting response... 200 OK Length: 27314 (27K) [text/plain] + + Saving to: ctop + + 100%[======================================>] 27,314 --.-K/s in 0s + + 2015-04-29 19:32:59 (61.0 MB/s) - ctop saved [27314/27314] + +---------- + + poornima@poornima-Lenovo:~$ chmod +x ctop + +You might get an error message while launching ctop if cgroup-bin package is not installed. It can be resolved by installing the required package. + + poornima@poornima-Lenovo:~$ ./ctop + + [ERROR] Failed to locate cgroup mountpoints. + + poornima@poornima-Lenovo:~$ sudo apt-get install cgroup-bin + +Here is a sample output screen of ctop: + +![ctop screen](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop.png) +ctop screen + +### Usage options ### + + ctop [--tree] [--refresh=] [--columns=] [--sort-col=] [--follow=] [--fold=, ...] ctop (-h | --help) + +Once you are inside the ctop screen, use the up (↑) and down(↓) arrow keys to navigate between containers. Clicking on any container will select that particular container. Pressing q or Ctrl+C quits the container. + +Let us now take a look at how to use each of the options listed above. + + -h / --help - Show the help screen + +---------- + + poornima@poornima-Lenovo:~$ ctop -h + Usage: ctop [options] + + Options: + -h, --help show this help message and exit + --tree show tree view by default + --refresh=REFRESH Refresh display every + --follow=FOLLOW Follow cgroup path + --columns=COLUMNS List of optional columns to display. Always includes + 'name' + --sort-col=SORT_COL Select column to sort by initially. Can be changed + dynamically. + +---------- + + --tree - Display tree view of the containers + +By default, list view is displayed + +Once you are inside the ctop window, you can use the F5 button to toggle tree / list view. + + --fold= - Fold the cgroup path in the tree view. + + This option needs to be used in combination with --tree. + +---------- + + Eg: ctop --tree --fold=/user.slice + +![Output of 'ctop --fold'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-fold.png) +Output of 'ctop --fold' + +Inside the ctop window, use the + / - keys to toggle child cgroup folding. + +Note: At the time of writing this article, pip repository did not have the latest version of ctop which supports '--fold' option via command line. + + --follow= - Follow/Highlight the cgroup path. + +---------- + + Eg: ctop --follow=/user.slice/user-1000.slice + +As you can see in the screen below, the cgroup with the given path "/user.slice/user-1000.slice" gets highlighted and makes it easier for the user to follow it even when the display position gets changed. + +![Output of 'ctop --follow'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-follow.png) +Output of 'ctop --follow' + +You can also use the 'f' button to allow the highlighted line to follow the selected container. By default, follow is off. + + --refresh= - Refresh the display at the given rate. Default 1 sec + +This is useful in changing the refresh rate of the display as per user requirement. Use the 'p' button to pause the refresh and select the text. + + --columns= - Can limit the display to selected . 'name' should be the first entry followed by other columns. By default, the columns include owner, processes,memory, cpu-sys, cpu-user, blkio, cpu-time. + +---------- + + Eg: ctop --columns=name,owner,type,memory + +![Output of 'ctop --column'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-column.png) +Output of 'ctop --column' + + -sort-col= - column using which the displayed data should be sorted. By default it is sorted using cpu-user + +---------- + + Eg: ctop --sort-col=blkio + +If there are additional containers supported like Docker and LXC, following options will also be available: + + press 'a' - attach to console output + + press 'e' - open a shell in the container context + + press 's' – stop the container (SIGTERM) + + press 'k' - kill the container (SIGKILL) + +[ctop][1] is currently in active development by Jean-Tiare Le Bigot. Hopefully we would see more features in this tool like our native top command :-). + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/how-tos/monitor-linux-containers-performance/ + +作者:[B N Poornima][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/bnpoornima/ +[1]:https://github.com/yadutaf/ctop \ No newline at end of file diff --git a/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md b/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md new file mode 100644 index 0000000000..611fdea333 --- /dev/null +++ b/sources/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md @@ -0,0 +1,134 @@ +Install uGet Download Manager 2.0 in Debian, Ubuntu, Linux Mint and Fedora +================================================================================ +After a long development period, which includes more than 11 developement releases, finally uGet project team pleased to announce the immediate availability of the latest stable version of uGet 2.0. The latest version includes numerous attractive features, such as a new setting dialog, improved BitTorrent and Metalink support added in the aria2 plugin, as well as better support for uGet RSS messages in the banner, other features include: + +- A new “Check for Updates” button informs you about new released versions. +- Added new languages & updated existing languages. +- Added a new “Message Banner” that allows developers to easily provide uGet related information to all users. +- Enhanced the Help Menu by including links to the Documentation, to submit Feedback & Bug Reports and more. +- Integrated uGet download manager into the two major browsers on the Linux platform, Firefox and Google Chrome. +- Improved support for Firefox Addon ‘FlashGot’. + +### What is uGet ### + +uGet (formerly known ad UrlGfe) is an open source, free and very powerful multi-platform GTK based download manager application was written in C language, that released and licensed under GPL. It offers large collection of features such as resuming downloads, multiple download support, categories support with an independent configuration, clipboard monitoring, download scheduler, import URLs from HTML files, integrated Flashgot plugin with Firefox and download torrent and metalink files using aria2 (a command-line download manager) that integrated with uGet. + +I have listed down all the key features of uGet Download Manager in detailed explanation. + +#### Key Features of uGet Download Manager #### + +- Downloads Queue: Place all your downloads into a Queue. As downloads finishes, the remaining queue files will automatically start downloading. +- Resume Downloads: If in case, your network connection disconnected, don’t worry you can start or resume download where it was left. +- Download Categories: Support for unlimited categories to manage downloads. +- Clipboard Monitor: Add the types of files to clipboard that automatically prompt you to download copied files. +- Batch Downloads: Allows you to easily add unlimited number of files at once for downloading. +- Multi-Protocol: Allows you to easily download files through HTTP, HTTPS, FTP, BitTorrent and Metalink using arial2 command-line plugin. +- Multi-Connection: Support for up to 20 simultaneous connections per download using aria2 plugin. +- FTP Login & Anonymous FTP: Added support for FTP login using username and password, as well as anonymous FTP. +- Scheduler: Added support for scheduled downloads, now you can schedule all your downloads. +- FireFox Integration via FlashGot: Integrated FlashGot as an independent supported Firefox extension that handles single or massive selection of files for downloading. +- CLI / Terminal Support: Offers command line or terminal option to download files. +- Folder Auto-Creation: If you have provided the save path for the download, but the save path doesn’t exist, uget will automatically create them. +- Download History Management: Keeps a track of finished download and recycled entries, per list 9,999 files. Entries which are older than the custom limit will be deleted automatically. +- Multi-Language Support: By default uGet uses English, but it support more than 23 languages. +- Aria2 Plugin: uGet integrated with Aria2 plugin to give more user friendly GUI. + +If you want to know a complete list of available features, see the official uGet [features page][1]. + +### Install uGet in Debian, Ubuntu, Linux Mint and Fedora ### + +The uGet developers added latest version in various repos throughout the Linux platform, so you can able to install or upgrade uGet using supported repository under your Linux distribution. + +Currently, a few Linux distributions are not up-to-date, but you can get the status of your distribution by going to the [uGet Download page][2] and selecting your preferred distro from there for more details. + +#### On Debian #### + +In Debian Testing (Jessie) and Debian Unstable (Sid), you can easily install and update using the official repository on a fairly reliable basis. + + $ sudo apt-get update + $ sudo apt-get install uget + +#### On Ubuntu & Linux Mint #### + +In Ubuntu and Linux Mint, you can install and update uGet using official PPA repository ‘ppa:plushuang-tw/uget-stable‘. By using this PPA, you automatically be kept up-to-date with the latest versions. + + $ sudo add-apt-repository ppa:plushuang-tw/uget-stable + $ sudo apt-get update + $ sudo apt-get install uget + +#### On Fedora #### + +In Fedora 20 – 21, latest version of uGet (2.0) available from the official repositories, installing from these repo is fairly reliable. + + $ sudo yum install uget + +**Note**: On older versions of Debian, Ubuntu, Linux Mint and Fedora, users can also install uGet. but the available version is 1.10.4. If you are looking for updated version (i.e. 2.0) you need to upgrade your system and add uGet PPA to get latest stable version. + +### Installing aria2 plugin ### + +[aria2][3] is a excellent command-line download utility, that is used by uGet as a aria2 plugin to add even more great functionality such as downloading torrent files, metalinks, multi-protocol & multi-source download. + +By default uGet uses CURL as backend in most of the today’s Linux systems, but the aria2 Plugin replaces CURL with aria2 as the backend. + +aria2 is a separate package that needs to be installed separately. You can easily install latest version of aria2 using supported repository under your Linux distribution or you can also use [downloads-aria2][4] that explains how to install aria2 on each distro. + +#### On Debian, Ubuntu and Linux Mint #### + +Use the official aria2 PPA repository to install latest version of aria2 using the following commands. + + $ sudo add-apt-repository ppa:t-tujikawa/ppa + $ sudo apt-get update + $ sudo apt-get install aria2 + +#### On Fedora #### + +Fedora’s official repositories already added aria2 package, so you can easily install it using the following yum command. + + $ sudo yum install aria2 + +#### Starting uGet #### + +To start uGet application, from the desktop “Menu” on search bar type “uget“. Refer below screenshot. + +![Start uGet Download Manager](http://www.tecmint.com/wp-content/uploads/2014/03/Start-uGet.gif) +Start uGet Download Manager + +![uGet Version: 2.0](http://www.tecmint.com/wp-content/uploads/2014/03/uGet-Version.gif) +uGet Version: 2.0 + +#### Activate aria2 Plugin in uGet #### + +To active the aria2 plugin, from the uGet menu go to Edit –> Settings –> Plug-in tab, from the drop-down select “arial2“. + +![Enable Aria2 Plugin for uGet](http://www.tecmint.com/wp-content/uploads/2014/03/Enable-Aria2-Plugin.gif) +Enable Aria2 Plugin for uGet + +### uGet 2.0 Screenshot Tour ### + +![Download Files Using Aria2](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Files-Using-Aria2.gif) +Download Files Using Aria2 + +![Download Torrent File Using uGet](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Torrent-File.gif) +Download Torrent File Using uGet + +![Batch Downloads Using uGet](http://www.tecmint.com/wp-content/uploads/2014/03/Batch-Download-Files.gif) +Batch Downloads Using uGet + +uGet source files and RPM packages also available for other Linux distributions and Windows at [download page][5]. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-uget-download-manager-in-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://uget.visuex.com/features +[2]:http://ugetdm.com/downloads +[3]:http://www.tecmint.com/install-aria2-a-multi-protocol-command-line-download-manager-in-rhel-centos-fedora/ +[4]:http://ugetdm.com/downloads-aria2 +[5]:http://ugetdm.com/downloads \ No newline at end of file From 9eebc0398e2b1a472b31b6398f5790e5823fd3a5 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 8 May 2015 00:39:26 +0800 Subject: [PATCH 078/133] PUB:20150410 This tool can alert you about evil twin access points in the area @wi-cuckoo --- ...out evil twin access points in the area.md | 41 +++++++++++++++++++ ...out evil twin access points in the area.md | 40 ------------------ 2 files changed, 41 insertions(+), 40 deletions(-) create mode 100644 published/20150410 This tool can alert you about evil twin access points in the area.md delete mode 100644 translated/share/20150410 This tool can alert you about evil twin access points in the area.md diff --git a/published/20150410 This tool can alert you about evil twin access points in the area.md b/published/20150410 This tool can alert you about evil twin access points in the area.md new file mode 100644 index 0000000000..a43aa8206f --- /dev/null +++ b/published/20150410 This tool can alert you about evil twin access points in the area.md @@ -0,0 +1,41 @@ +EvilAP_Defender:可以警示和攻击 WIFI 热点陷阱的工具 +=============================================================================== + +**开发人员称,EvilAP_Defender甚至可以攻击流氓Wi-Fi接入点** + +这是一个新的开源工具,可以定期扫描一个区域,以防出现恶意 Wi-Fi 接入点,同时如果发现情况会提醒网络管理员。 + +这个工具叫做 EvilAP_Defender,是为监测攻击者所配置的恶意接入点而专门设计的,这些接入点冒用合法的名字诱导用户连接上。 + +这类接入点被称做假面猎手(evil twin),使得黑客们可以从所接入的设备上监听互联网信息流。这可以被用来窃取证书、钓鱼网站等等。 + +大多数用户设置他们的计算机和设备可以自动连接一些无线网络,比如家里的或者工作地方的网络。通常,当面对两个同名的无线网络时,即SSID相同,有时候甚至连MAC地址(BSSID)也相同,这时候大多数设备会自动连接信号较强的一个。 + +这使得假面猎手攻击容易实现,因为SSID和BSSID都可以伪造。 + +[EvilAP_Defender][1]是一个叫Mohamed Idris的人用Python语言编写,公布在GitHub上面。它可以使用一个计算机的无线网卡来发现流氓接入点,这些坏蛋们复制了一个真实接入点的SSID,BSSID,甚至是其他的参数如通道,密码,隐私协议和认证信息等等。 + +该工具首先以学习模式运行,以便发现合法的接入点[AP],并且将其加入白名单。然后可以切换到正常模式,开始扫描未认证的接入点。 + +如果一个恶意[AP]被发现了,该工具会用电子邮件提醒网络管理员,但是开发者也打算在未来加入短信提醒功能。 + +该工具还有一个保护模式,在这种模式下,应用会发起一个denial-of-service [DoS]攻击反抗恶意接入点,为管理员采取防卫措施赢得一些时间。 + +“DoS 将仅仅针对有着相同SSID的而BSSID(AP的MAC地址)不同或者不同信道的流氓 AP,”Idris在这款工具的文档中说道。“这是为了避免攻击到你的正常网络。” + +尽管如此,用户应该切记在许多国家,攻击别人的接入点很多时候都是非法的,甚至是一个看起来像是攻击者操控的恶意接入点。 + +要能够运行这款工具,需要Aircrack-ng无线网套装,一个支持Aircrack-ng的无线网卡,MySQL和Python运行环境。 + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2905725/security0/this-tool-can-alert-you-about-evil-twin-access-points-in-the-area.html + +作者:[Lucian Constantin][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Lucian-Constantin/ +[1]:https://github.com/moha99sa/EvilAP_Defender/blob/master/README.TXT diff --git a/translated/share/20150410 This tool can alert you about evil twin access points in the area.md b/translated/share/20150410 This tool can alert you about evil twin access points in the area.md deleted file mode 100644 index 963460501d..0000000000 --- a/translated/share/20150410 This tool can alert you about evil twin access points in the area.md +++ /dev/null @@ -1,40 +0,0 @@ -这个工具可以提醒你一个区域内的假面猎手接入点 (注:evil twin暂无相关翻译) -=============================================================================== -**开发人员称,EvilAP_Defender甚至可以攻击流氓Wi-Fi接入点** - -一个新的开源工具可以定期扫描一个区域,以防流氓Wi-Fi接入点,同时如果发现情况会提醒网络管理员。 - -这个工具叫做EvilAP_Defender,是为监测攻击者配置的恶意接入点而专门设计的,这些接入点冒用合法的名字诱导用户连接上。 - -这类接入点被称做假面猎手,使得黑客们从接入的设备上监听互联网信息流。这可以被用来窃取证书,破坏网站等等。 - -大多数用户设置他们的计算机和设备可以自动连接一些无线网络,比如家里的或者工作地方的网络。尽管如此,当面对两个同名的无线网络时,即SSID相同,有时候甚至时MAC地址也相同,这时候大多数设备会自动连接信号较强的一个。 - -这使得假面猎手的攻击容易实现,因为SSID和BSSID都可以伪造。 - -[EvilAP_Defender][1]是一个叫Mohamed Idris的人用Python语言编写,公布在GitHub上面。它可以使用一个计算机的无线网卡来发现流氓接入点,这些接入点复制了一个真实接入点的SSID,BSSID,甚至是其他的参数如通道,密码,隐私协议和认证信息。 - -该工具首先以学习模式运行,为了发现合法的接入点[AP],并且加入白名单。然后切换到正常模式,开始扫描未认证的接入点。 - -如果一个恶意[AP]被发现了,该工具会用电子邮件提醒网络管理员,但是开发者也打算在未来加入短信提醒功能。 - -该工具还有一个保护模式,在这种模式下,应用会发起一个denial-of-service [DoS]攻击反抗恶意接入点,为管理员采取防卫措施赢得一些时间。 - -“DoS不仅针对有着相同SSID的恶意AP,也针对BSSID(AP的MAC地址)不同或者不同信道的,”Idris在这款工具的文档中说道。“这是避免攻击你的合法网络。” - -尽管如此,用户应该切记在许多国家,攻击别人的接入点,甚至一个可能一个攻击者操控的恶意的接入点,很多时候都是非法的。 - -为了能够运行这款工具,需要Aircrack-ng无线网套装,一个支持Aircrack-ng的无线网卡,MySQL和Python运行环境。 - --------------------------------------------------------------------------------- - -via: http://www.infoworld.com/article/2905725/security0/this-tool-can-alert-you-about-evil-twin-access-points-in-the-area.html - -作者:[Lucian Constantin][a] -译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.infoworld.com/author/Lucian-Constantin/ -[1] https://github.com/moha99sa/EvilAP_Defender/blob/master/README.TXT From 8e0a658c104c7b1b5e4096cba1679630be380940 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 8 May 2015 01:17:45 +0800 Subject: [PATCH 079/133] PUB:20150128 Docker-3 Automated Docker-based Rails deployments @DongShuaike --- ...utomated Docker-based Rails deployments.md | 90 +++++++++---------- 1 file changed, 41 insertions(+), 49 deletions(-) rename {translated/tech => published}/20150128 Docker-3 Automated Docker-based Rails deployments.md (68%) diff --git a/translated/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md b/published/20150128 Docker-3 Automated Docker-based Rails deployments.md similarity index 68% rename from translated/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md rename to published/20150128 Docker-3 Automated Docker-based Rails deployments.md index cd3917dfcf..be256ff1da 100644 --- a/translated/tech/20150128 Docker-3 Automated Docker-based Rails deployments.md +++ b/published/20150128 Docker-3 Automated Docker-based Rails deployments.md @@ -1,12 +1,14 @@ - 自动化部署基于Docker的Rails应用 ================================================================================ ![](http://cocoahunter.com/content/images/2015/01/docker3.jpeg) [TL;DR] 这是系列文章的第三篇,讲述了我的公司是如何将基础设施从PaaS移植到Docker上的。 + - [第一部分][1]:谈论了我接触Docker之前的经历; - [第二部分][2]:一步步搭建一个安全而又私有的registry。 + ---------- + 在系列文章的最后一篇里,我们将用一个实例来学习如何自动化整个部署过程。 ### 基本的Rails应用程序### @@ -18,99 +20,97 @@ $ rvm use 2.2.0 $ rails new && cd docker-test -创建一个基础控制器: +创建一个基本的控制器: $ rails g controller welcome index -……然后编辑 `routes.rb` ,以便让工程的根指向我们新创建的welcome#index方法:(这句话理解不太理解) +……,然后编辑 `routes.rb` ,以便让该项目的根指向我们新创建的welcome#index方法: root 'welcome#index' -在终端运行 `rails s` ,然后打开浏览器,登录[http://localhost:3000][3],你会进入到索引界面当中。我们不准备给应用加上多么神奇的东西,这只是一个基础实例,用来验证当我们将要创建并部署容器的时候,一切运行正常。 +在终端运行 `rails s` ,然后打开浏览器,登录[http://localhost:3000][3],你会进入到索引界面当中。我们不准备给应用加上多么神奇的东西,这只是一个基础的实例,当我们将要创建并部署容器的时候,用它来验证一切是否运行正常。 ### 安装webserver ### 我们打算使用Unicorn当做我们的webserver。在Gemfile中添加 `gem 'unicorn'`和 `gem 'foreman'`然后将它bundle起来(运行 `bundle install`命令)。 -在Rails应用启动的伺候,需要配置Unicorn,所以我们将一个**unicorn.rb**文件放在**config**目录下。[这里有一个Unicorn配置文件的例子][4]你可以直接复制粘贴Gist的内容。 +启动Rails应用时,需要先配置好Unicorn,所以我们将一个**unicorn.rb**文件放在**config**目录下。[这里有一个Unicorn配置文件的例子][4],你可以直接复制粘贴Gist的内容。 -Let's also add a Procfile with the following content inside the root of the project so that we will be able to start the app with foreman: -接下来,在工程的根目录下添加一个Procfile,以便可以使用foreman启动应用,内容为下: +接下来,在项目的根目录下添加一个Procfile,以便可以使用foreman启动应用,内容为下: web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb 现在运行**foreman start**命令启动应用,一切都将正常运行,并且你将能够在[http://localhost:5000][5]上看到一个正在运行的应用。 -### 创建一个Docker映像 ### +### 构建一个Docker镜像 ### -现在我们创建一个映像来运行我们的应用。在Rails工程的跟目录下,创建一个名为**Dockerfile**的文件,然后粘贴进以下内容: +现在我们构建一个镜像来运行我们的应用。在这个Rails项目的根目录下,创建一个名为**Dockerfile**的文件,然后粘贴进以下内容: - # Base image with ruby 2.2.0 + # 基于镜像 ruby 2.2.0 FROM ruby:2.2.0 - # Install required libraries and dependencies + # 安装所需的库和依赖 RUN apt-get update && apt-get install -qy nodejs postgresql-client sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/* - # Set Rails version + # 设置 Rails 版本 ENV RAILS_VERSION 4.1.1 - # Install Rails + # 安装 Rails RUN gem install rails --version "$RAILS_VERSION" - # Create directory from where the code will run + # 创建代码所运行的目录 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app - # Make webserver reachable to the outside world + # 使 webserver 可以在容器外面访问 EXPOSE 3000 - # Set ENV variables + # 设置环境变量 ENV PORT=3000 - # Start the web app + # 启动 web 应用 CMD ["foreman","start"] - # Install the necessary gems + # 安装所需的 gems ADD Gemfile /usr/src/app/Gemfile ADD Gemfile.lock /usr/src/app/Gemfile.lock RUN bundle install --without development test - # Add rails project (from same dir as Dockerfile) to project directory + # 将 rails 项目(和 Dockerfile 同一个目录)添加到项目目录 ADD ./ /usr/src/app - # Run rake tasks + # 运行 rake 任务 RUN RAILS_ENV=production rake db:create db:migrate -使用提供的Dockerfile,执行下列命令创建一个映像[1][7]: +使用上述Dockerfile,执行下列命令创建一个镜像(确保**boot2docker**已经启动并在运行当中): $ docker build -t localhost:5000/your_username/docker-test . -然后,如果一切正常,长日志输出的最后一行应该类似于: +然后,如果一切正常,长长的日志输出的最后一行应该类似于: Successfully built 82e48769506c $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE localhost:5000/your_username/docker-test latest 82e48769506c About a minute ago 884.2 MB -来运行容器吧! +让我们运行一下容器试试! $ docker run -d -p 3000:3000 --name docker-test localhost:5000/your_username/docker-test -You should be able to reach your Rails app running inside the Docker container at port 3000 of your boot2docker VM[2][8] (in my case [http://192.168.59.103:3000][6]). -通过你的boot2docker虚拟机[2][8]的3000号端口(我的是[http://192.168.59.103:3000][6]),你可以观察你的Rails应用。 +通过你的boot2docker虚拟机的3000号端口(我的是[http://192.168.59.103:3000][6]),你可以观察你的Rails应用。(如果不清楚你的boot2docker虚拟地址,输入` $ boot2docker ip`命令查看。) ### 使用shell脚本进行自动化部署 ### -前面的文章(指文章1和文章2)已经告诉了你如何将新创建的映像推送到私有registry中,并将其部署在服务器上,所以我们跳过这一部分直接开始自动化进程。 +前面的文章(指文章1和文章2)已经告诉了你如何将新创建的镜像推送到私有registry中,并将其部署在服务器上,所以我们跳过这一部分直接开始自动化进程。 我们将要定义3个shell脚本,然后最后使用rake将它们捆绑在一起。 ### 清除 ### -每当我们创建映像的时候, +每当我们创建镜像的时候, - 停止并重启boot2docker; -- 去除Docker孤儿映像(那些没有标签,并且不再被容器所使用的映像们)。 +- 去除Docker孤儿镜像(那些没有标签,并且不再被容器所使用的镜像们)。 在你的工程根目录下的**clean.sh**文件中输入下列命令。 @@ -132,22 +132,22 @@ You should be able to reach your Rails app running inside the Docker container a $ chmod +x clean.sh -### 创建 ### +### 构建 ### -创建的过程基本上和之前我们所做的(docker build)内容相似。在工程的根目录下创建一个**build.sh**脚本,填写如下内容: +构建的过程基本上和之前我们所做的(docker build)内容相似。在工程的根目录下创建一个**build.sh**脚本,填写如下内容: docker build -t localhost:5000/your_username/docker-test . -给脚本执行权限。 +记得给脚本执行权限。 ### 部署 ### 最后,创建一个**deploy.sh**脚本,在里面填进如下内容: - # Open SSH connection from boot2docker to private registry + # 打开 boot2docker 到私有注册库的 SSH 连接 boot2docker ssh "ssh -o 'StrictHostKeyChecking no' -i /Users/username/.ssh/id_boot2docker -N -L 5000:localhost:5000 root@your-registry.com &" & - # Wait to make sure the SSH tunnel is open before pushing... + # 在推送前先确认该 SSH 通道是开放的。 echo Waiting 5 seconds before pushing image. echo 5... @@ -165,7 +165,7 @@ You should be able to reach your Rails app running inside the Docker container a echo Starting push! docker push localhost:5000/username/docker-test -如果你不理解这其中的含义,请先仔细阅读这部分[part 2][9]。 +如果你不理解这其中的含义,请先仔细阅读这部分[第二部分][2]。 给脚本加上执行权限。 @@ -179,10 +179,9 @@ You should be able to reach your Rails app running inside the Docker container a 这一点都不费工夫,可是事实上开发者比你想象的要懒得多!那么咱们就索性再懒一点! -我们最后再把工作好好整理一番,我们现在要将三个脚本捆绑在一起,通过rake。 - -为了更简单一点,你可以在工程根目录下已经存在的Rakefile中添加几行代码,打开Rakefile文件——pun intended——把下列内容粘贴进去。 +我们最后再把工作好好整理一番,我们现在要将三个脚本通过rake捆绑在一起。 +为了更简单一点,你可以在工程根目录下已经存在的Rakefile中添加几行代码,打开Rakefile文件,把下列内容粘贴进去。 namespace :docker do desc "Remove docker container" @@ -221,34 +220,27 @@ Deploy独立于build,build独立于clean。所以每次我们输入命令运 $ rake docker:deploy -接下来就是见证奇迹的时刻了。一旦映像文件被上传(第一次可能花费较长的时间),你就可以ssh登录产品服务器,并且(通过SSH管道)把docker映像拉取到服务器并运行了。多么简单! +接下来就是见证奇迹的时刻了。一旦镜像文件被上传(第一次可能花费较长的时间),你就可以ssh登录产品服务器,并且(通过SSH管道)把docker镜像拉取到服务器并运行了。多么简单! 也许你需要一段时间来习惯,但是一旦成功,它几乎与用Heroku部署一样简单。 备注:像往常一样,请让我了解到你的意见。我不敢保证这种方法是最好,最快,或者最安全的Docker开发的方法,但是这东西对我们确实奏效。 -- 确保**boot2docker**已经启动并在运行当中。 -- 如果你不了解你的boot2docker虚拟地址,输入` $ boot2docker ip`命令查看。 -- 点击[here][10],教你怎样搭建私有的registry。 - -------------------------------------------------------------------------------- via: http://cocoahunter.com/2015/01/23/docker-3/ 作者:[Michelangelo Chasseur][a] 译者:[DongShuaike](https://github.com/DongShuaike) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://cocoahunter.com/author/michelangelo/ -[1]:http://cocoahunter.com/docker-1 -[2]:http://cocoahunter.com/2015/01/23/docker-2/ +[1]:https://linux.cn/article-5339-1.html +[2]:https://linux.cn/article-5379-1.html [3]:http://localhost:3000/ [4]:https://gist.github.com/chasseurmic/0dad4d692ff499761b20 [5]:http://localhost:5000/ [6]:http://192.168.59.103:3000/ -[7]:http://cocoahunter.com/2015/01/23/docker-3/#fn:1 -[8]:http://cocoahunter.com/2015/01/23/docker-3/#fn:2 -[9]:http://cocoahunter.com/2015/01/23/docker-2/ -[10]:http://cocoahunter.com/2015/01/23/docker-2/ + From 9ee552897f51ea8de0b5a796d9ebd1eccf6b6a33 Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 8 May 2015 08:04:13 +0800 Subject: [PATCH 080/133] Update 20150507 Command Line Tool to Monitor Linux Containers Performance.md --- ...ommand Line Tool to Monitor Linux Containers Performance.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md b/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md index a9b1d4cd30..508741669f 100644 --- a/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md +++ b/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Command Line Tool to Monitor Linux Containers Performance ================================================================================ ctop is a new command line based tool available to monitor the processes at the container level. Containers provide operating system level virtualization environment by making use of the cgroups resource management functionality. This tool collects data related to memory, cpu, block IO and metadata like owner, uptime etc from cgroups and presents it in a user readable format so that one can quickly asses the overall health of the system. Based on the data collected, it tries to guess the underlying container technology. ctop is useful in detecting who is using large amounts of memory under low memory situations. @@ -189,4 +190,4 @@ via: http://linoxide.com/how-tos/monitor-linux-containers-performance/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/bnpoornima/ -[1]:https://github.com/yadutaf/ctop \ No newline at end of file +[1]:https://github.com/yadutaf/ctop From 548d100d014f85569a38aaafeb8a88ac87c52bbf Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 8 May 2015 09:35:39 +0800 Subject: [PATCH 081/133] [Translated]20150507 Command Line Tool to Monitor Linux Containers Performance.md --- ...to Monitor Linux Containers Performance.md | 81 +++++++++---------- 1 file changed, 40 insertions(+), 41 deletions(-) rename {sources => translated}/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md (52%) diff --git a/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md b/translated/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md similarity index 52% rename from sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md rename to translated/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md index 508741669f..d33e68ffd9 100644 --- a/sources/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md +++ b/translated/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md @@ -1,34 +1,33 @@ -Translating by GOLinux! -Command Line Tool to Monitor Linux Containers Performance +监控Linux容器性能的命令行神器 ================================================================================ -ctop is a new command line based tool available to monitor the processes at the container level. Containers provide operating system level virtualization environment by making use of the cgroups resource management functionality. This tool collects data related to memory, cpu, block IO and metadata like owner, uptime etc from cgroups and presents it in a user readable format so that one can quickly asses the overall health of the system. Based on the data collected, it tries to guess the underlying container technology. ctop is useful in detecting who is using large amounts of memory under low memory situations. +ctop是一个新的基于命令行的工具,它可用于在容器层级监控进程。容器通过利用控制器组(cgroup)的资源管理功能,提供了操作系统层级的虚拟化环境。该工具收集来自cgroup的与内存、CPU、块输入输出和诸如拥有者、开机时间等相关的元数据,并以人性化的格式呈现给用户,这样就可以快速对系统健康状况进行评估。基于所获得的数据,它可以尝试推测潜在的容器技术。ctop也有助于在低内存环境中检测出谁在消耗大量的内存。 -### Capabilities ### +### 功能 ### -Some of the capabilities of ctop are: +ctop的一些功能如下: -- Collect metrics for cpu, memory and blkio -- Gather information regarding owner, container technology, task count -- Sort the information using any column -- Display the information using tree view -- Fold/unfold cgroup tree -- Select and follow a cgroup/container -- Select a timeframe for refreshing the displayed data -- Pause the refreshing of data -- Detect containers that are based on systemd, Docker and LXC -- Advance features for Docker and LXC based containers - - open / attach a shell for further diagnosis - - stop / kill container types +- 收集CPU、内存和块输入输出的度量值 +- 收集与拥有者、容器技术和任务统计相关的信息 +- 使用任何栏目对信息排序 +- 以树状视图显示信息 +- 折叠/展开cgroup树 +- 选择并跟踪cgroup/容器 +- 选择显示数据刷新时间框架 +- 暂停刷新数据 +- 检测基于systemd、Docker和LXC的容器 +- 基于Docker和LXC的容器的高级特性 + - 打开/连接shell以进行深度诊断 + - 停止/杀死容器类型 -### Installation ### +### 安装 ### -**ctop** is written using Python and there are no other external dependencies other than having to use Python version 2.6 or greater (with built-in cursor support). Installation using Python's pip is the recommended method. Install pip if not already done and install ctop using pip. +**ctop**是由Python写成的,因此,除了需要Python 2.6或其更高版本外(支持内建光标),别无其它外部依赖。推荐使用Python的pip进行安装,如果还没有安装pip,请先安装,然后使用pip安装ctop。 -*Note: The examples shown in this article are from an Ubuntu (14.10) system* +*注意:本文样例来自Ubuntu(14.10)系统* $ sudo apt-get install python-pip -Installing ctop using pip: +使用pip安装ctop: poornima@poornima-Lenovo:~$ sudo pip install ctop @@ -52,7 +51,7 @@ Installing ctop using pip: Cleaning up... -If using pip is not an option, you can also install it directly from the github using wget: +如果不选择使用pip安装,你也可以使用wget直接从github安装: poornima@poornima-Lenovo:~$ wget https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py -O ctop @@ -74,7 +73,7 @@ If using pip is not an option, you can also install it directly from the github poornima@poornima-Lenovo:~$ chmod +x ctop -You might get an error message while launching ctop if cgroup-bin package is not installed. It can be resolved by installing the required package. +如果cgroup-bin包没有安装,你可能会碰到一个错误消息,你可以通过安装需要的包来解决。 poornima@poornima-Lenovo:~$ ./ctop @@ -82,18 +81,18 @@ You might get an error message while launching ctop if cgroup-bin package is not poornima@poornima-Lenovo:~$ sudo apt-get install cgroup-bin -Here is a sample output screen of ctop: +下面是ctop的输出样例: ![ctop screen](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop.png) -ctop screen +ctop屏幕 -### Usage options ### +### 用法选项 ### ctop [--tree] [--refresh=] [--columns=] [--sort-col=] [--follow=] [--fold=, ...] ctop (-h | --help) -Once you are inside the ctop screen, use the up (↑) and down(↓) arrow keys to navigate between containers. Clicking on any container will select that particular container. Pressing q or Ctrl+C quits the container. +一旦你进入ctop屏幕,使用上(↑)和下(↓)箭头键在容器间导航。点击某个容器就选定了该容器,按q或Ctrl+C退出容器。 -Let us now take a look at how to use each of the options listed above. +现在,让我们来看看上面列出的那一堆选项究竟是怎么用的吧。 -h / --help - Show the help screen @@ -116,9 +115,9 @@ Let us now take a look at how to use each of the options listed above. --tree - Display tree view of the containers -By default, list view is displayed +默认情况下,会显示列表视图 -Once you are inside the ctop window, you can use the F5 button to toggle tree / list view. +一旦你进入ctop窗口,你可以使用F5按钮在树状/列表视图间切换。 --fold= - Fold the cgroup path in the tree view. @@ -129,11 +128,11 @@ Once you are inside the ctop window, you can use the F5 button to toggle tree / Eg: ctop --tree --fold=/user.slice ![Output of 'ctop --fold'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-fold.png) -Output of 'ctop --fold' +‘ctop --fold’的输出 -Inside the ctop window, use the + / - keys to toggle child cgroup folding. +在ctop窗口中,使用+/-键来展开或折叠子cgroup。 -Note: At the time of writing this article, pip repository did not have the latest version of ctop which supports '--fold' option via command line. +注意:在写本文时,pip仓库中还没有最新版的ctop,还不支持命令行的‘--fold’选项 --follow= - Follow/Highlight the cgroup path. @@ -141,16 +140,16 @@ Note: At the time of writing this article, pip repository did not have the lates Eg: ctop --follow=/user.slice/user-1000.slice -As you can see in the screen below, the cgroup with the given path "/user.slice/user-1000.slice" gets highlighted and makes it easier for the user to follow it even when the display position gets changed. +正如你在下面屏幕中所见到的那样,带有“/user.slice/user-1000.slice”路径的cgroup被高亮显示,这让用户易于跟踪,就算显示位置变了也一样。 ![Output of 'ctop --follow'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-follow.png) -Output of 'ctop --follow' +‘ctop --follow’的输出 -You can also use the 'f' button to allow the highlighted line to follow the selected container. By default, follow is off. +你也可以使用‘f’按钮来让高亮的行跟踪选定的容器。默认情况下,跟踪是关闭的。 --refresh= - Refresh the display at the given rate. Default 1 sec -This is useful in changing the refresh rate of the display as per user requirement. Use the 'p' button to pause the refresh and select the text. +这对于按每用户需求来显示改变刷新率时很有用。使用‘p’按钮可以暂停刷新并选择文本。 --columns= - Can limit the display to selected . 'name' should be the first entry followed by other columns. By default, the columns include owner, processes,memory, cpu-sys, cpu-user, blkio, cpu-time. @@ -159,7 +158,7 @@ This is useful in changing the refresh rate of the display as per user requireme Eg: ctop --columns=name,owner,type,memory ![Output of 'ctop --column'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-column.png) -Output of 'ctop --column' +‘ctop --column’的输出 -sort-col= - column using which the displayed data should be sorted. By default it is sorted using cpu-user @@ -167,7 +166,7 @@ Output of 'ctop --column' Eg: ctop --sort-col=blkio -If there are additional containers supported like Docker and LXC, following options will also be available: +如果有Docker和LXC支持的额外容器,跟踪选项也是可用的: press 'a' - attach to console output @@ -177,14 +176,14 @@ If there are additional containers supported like Docker and LXC, following opti press 'k' - kill the container (SIGKILL) -[ctop][1] is currently in active development by Jean-Tiare Le Bigot. Hopefully we would see more features in this tool like our native top command :-). +[ctop][1]当前还处于Jean-Tiare Le Bigot的开发中,希望我们能在该工具中见到像本地top命令一样的特性 :-) -------------------------------------------------------------------------------- via: http://linoxide.com/how-tos/monitor-linux-containers-performance/ 作者:[B N Poornima][a] -译者:[译者ID](https://github.com/译者ID) +译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 0335bf82df2ba80117c723716878f66274b9b4ff Mon Sep 17 00:00:00 2001 From: joeren Date: Fri, 8 May 2015 09:38:17 +0800 Subject: [PATCH 082/133] Update 20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md --- ...ers--How to install Shrew Soft IPsec VPN client on Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md b/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md index 24c09c85bd..2ef0ba111d 100644 --- a/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md +++ b/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux ================================================================================ > **Question**: I need to connect to an IPSec VPN gateway. For that, I'm trying to use Shrew Soft VPN client, which is available for free. How can I install Shrew Soft VPN client on [insert your Linux distro]? @@ -94,4 +95,4 @@ via: http://ask.xmodulo.com/install-shrew-soft-ipsec-vpn-client-linux.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://ask.xmodulo.com/author/nanni -[1]:https://www.shrew.net/download/ike \ No newline at end of file +[1]:https://www.shrew.net/download/ike From d481015932d2236cab9f762cfd390ac19a7d9c24 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Fri, 8 May 2015 10:18:40 +0800 Subject: [PATCH 083/133] [Translated]20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md --- ...ll Shrew Soft IPsec VPN client on Linux.md | 98 ------------------- ...ll Shrew Soft IPsec VPN client on Linux.md | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+), 98 deletions(-) delete mode 100644 sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md create mode 100644 translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md b/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md deleted file mode 100644 index 2ef0ba111d..0000000000 --- a/sources/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md +++ /dev/null @@ -1,98 +0,0 @@ -Translating by GOLinux! -Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux -================================================================================ -> **Question**: I need to connect to an IPSec VPN gateway. For that, I'm trying to use Shrew Soft VPN client, which is available for free. How can I install Shrew Soft VPN client on [insert your Linux distro]? - -There are many commercial VPN gateways available, which come with their own proprietary VPN client software. While there are also open-source VPN server/client alternatives, they are typically lacking in sophisticated IPsec support, such as Internet Key Exchange (IKE) which is a standard IPsec protocol used to secure VPN key exchange and authentication. Shrew Soft VPN is a free IPsec VPN client supporting a number of authentication methods, key exchange, encryption and firewall traversal options. - -Here is how you can install Shrew Soft VPN client on Linux platforms. - -First, download its source code from the [official website][1]. - -### Install Shrew VPN Client on Debian, Ubuntu or Linux Mint ### - -Shrew Soft VPN client GUI requires Qt 4.x. So you will need to install its development files as part of dependencies. - - $ sudo apt-get install cmake libqt4-core libqt4-dev libqt4-gui libedit-dev libssl-dev checkinstall flex bison - $ wget https://www.shrew.net/download/ike/ike-2.2.1-release.tbz2 - $ tar xvfvj ike-2.2.1-release.tbz2 - $ cd ike - $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DQTGUI=YES -DETCDIR=/etc -DNATT=YES . - $ make - $ sudo make install - $ cd /etc/ - $ sudo mv iked.conf.sample iked.conf - -### Install Shrew VPN Client on CentOS, Fedora or RHEL ### - -Similar to Debian based systems, you will need to install a number of dependencies including Qt4 before compiling it. - - $ sudo yum install qt-devel cmake gcc-c++ openssl-devel libedit-devel flex bison - $ wget https://www.shrew.net/download/ike/ike-2.2.1-release.tbz2 - $ tar xvfvj ike-2.2.1-release.tbz2 - $ cd ike - $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DQTGUI=YES -DETCDIR=/etc -DNATT=YES . - $ make - $ sudo make install - $ cd /etc/ - $ sudo mv iked.conf.sample iked.conf - -On Red Hat based systems, one last step is to open /etc/ld.so.conf with a text editor, and add the following line. - - $ sudo vi /etc/ld.so.conf - ----------- - - include /usr/lib/ - -Reload run-time bindings of shared libraries to incorporate newly installed shared libraries: - - $ sudo ldconfig - -### Launch Shrew VPN Client ### - -First launch IKE daemon (iked). This daemon speaks the IKE protocol to communicate with a remote host over IPSec as a VPN client. - - $ sudo iked - -![](https://farm9.staticflickr.com/8685/17175688940_59c2db64c9_b.jpg) - -Now start qikea which is an IPsec VPN client front end. This GUI application allows you to manage remote site configurations and to initiate VPN connections. - -![](https://farm8.staticflickr.com/7750/16742992713_eed7f97939_b.jpg) - -To create a new VPN configuration, click on "Add" button, and fill out VPN site configuration. Once you create a configuration, you can initiate a VPN connection simply by clicking on the configuration. - -![](https://farm8.staticflickr.com/7725/17337297056_3d38dc2180_b.jpg) - -### Troubleshooting ### - -1. I am getting the following error while running iked. - - iked: error while loading shared libraries: libss_ike.so.2.2.1: cannot open shared object file: No such file or directory - -To solve this problem, you need to update the dynamic linker to incorporate libss_ike library. For that, add to /etc/ld.so.conf the path where the library is located (e.g., /usr/lib), and then run ldconfig command. - - $ sudo ldconfig - -Verify that libss_ike is added to the library path: - - $ ldconfig -p | grep ike - ----------- - - libss_ike.so.2.2.1 (libc6,x86-64) => /lib/libss_ike.so.2.2.1 - libss_ike.so (libc6,x86-64) => /lib/libss_ike.so - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/install-shrew-soft-ipsec-vpn-client-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:https://www.shrew.net/download/ike diff --git a/translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md b/translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md new file mode 100644 index 0000000000..abe1d3943d --- /dev/null +++ b/translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md @@ -0,0 +1,98 @@ +Linux有问必答——Linux上如何安装Shrew Soft IPsec VPN +================================================================================ +> **Question**: I need to connect to an IPSec VPN gateway. For that, I'm trying to use Shrew Soft VPN client, which is available for free. How can I install Shrew Soft VPN client on [insert your Linux distro]? +> **问题**:我需要连接到一个IPSec VPN网关,鉴于此,我尝试使用Shrew Soft VPN客户端,它是一个免费版本。我怎样才能安装Shrew Soft VPN客户端到[插入你的Linux发行版]? + +市面上有许多商业VPN网关,同时附带有他们自己的专有VPN客户端软件。虽然也有许多开源的VPN服务器/客户端备选方案,但它们通常缺乏复杂的IPsec支持,比如互联网密钥交换(IKE),这是一个标准的IPsec协议,用于加固VPN密钥交换和验证安全。Shrew Soft VPN是一个免费的IPsec VPN客户端,它支持多种验证方法、密钥交换、加密以及防火墙穿越选项。 + +下面介绍如何安装Shrew Soft VPN客户端到Linux平台。 + +首先,从[官方站点][1]下载它的源代码。 + +### 安装Shrew VPN客户端到Debian, Ubuntu或者Linux Mint ### + +Shrew Soft VPN客户端图形界面要求使用Qt 4.x。所以,作为依赖,你需要安装其开发文件。 + + $ sudo apt-get install cmake libqt4-core libqt4-dev libqt4-gui libedit-dev libssl-dev checkinstall flex bison + $ wget https://www.shrew.net/download/ike/ike-2.2.1-release.tbz2 + $ tar xvfvj ike-2.2.1-release.tbz2 + $ cd ike + $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DQTGUI=YES -DETCDIR=/etc -DNATT=YES . + $ make + $ sudo make install + $ cd /etc/ + $ sudo mv iked.conf.sample iked.conf + +### 安装Shrew VPN客户端到CentOS, Fedora或者RHEL ### + +与基于Debian的系统类似,在编译前你需要安装一堆依赖包,包括Qt4。 + + $ sudo yum install qt-devel cmake gcc-c++ openssl-devel libedit-devel flex bison + $ wget https://www.shrew.net/download/ike/ike-2.2.1-release.tbz2 + $ tar xvfvj ike-2.2.1-release.tbz2 + $ cd ike + $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DQTGUI=YES -DETCDIR=/etc -DNATT=YES . + $ make + $ sudo make install + $ cd /etc/ + $ sudo mv iked.conf.sample iked.conf + +在基于Red Hat的系统中,最后一步需要用文本编辑器打开/etc/ld.so.conf文件,并添加以下行。 + + $ sudo vi /etc/ld.so.conf + +---------- + + include /usr/lib/ + +重新加载运行时绑定的共享库文件,以容纳新安装的共享库: + + $ sudo ldconfig + +### 启动Shrew VPN客户端 ### + +首先,启动IKE守护进程(iked)。该守护进作为VPN客户端程通过IKE协议与远程主机经由IPSec通信。 + + $ sudo iked + +![](https://farm9.staticflickr.com/8685/17175688940_59c2db64c9_b.jpg) + +现在,启动qikea,它是一个IPsec VPN客户端前端。该GUI应用允许你管理远程站点配置并初始化VPN连接。 + +![](https://farm8.staticflickr.com/7750/16742992713_eed7f97939_b.jpg) + +要创建一个新的VPN配置,点击“添加”按钮,然后填入VPN站点配置。创建配置后,你可以通过点击配置来初始化VPN连接。 + +![](https://farm8.staticflickr.com/7725/17337297056_3d38dc2180_b.jpg) + +### 故障排除 ### + +1. 我在运行iked时碰到了如下错误。 + + iked: error while loading shared libraries: libss_ike.so.2.2.1: cannot open shared object file: No such file or directory + +要解决该问题,你需要更新动态链接器来容纳libss_ike库。对于此,请添加库文件的位置路径到/etc/ld.so.conf文件中,然后运行ldconfig命令。 + + $ sudo ldconfig + +验证libss_ike是否添加到了库路径: + + $ ldconfig -p | grep ike + +---------- + + libss_ike.so.2.2.1 (libc6,x86-64) => /lib/libss_ike.so.2.2.1 + libss_ike.so (libc6,x86-64) => /lib/libss_ike.so + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/install-shrew-soft-ipsec-vpn-client-linux.html + +作者:[Dan Nanni][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:https://www.shrew.net/download/ike From f5ddd886cba8abf11d80d9ab3dcb8ae8169ccc1e Mon Sep 17 00:00:00 2001 From: robot-0 Date: Fri, 8 May 2015 10:28:20 +0800 Subject: [PATCH 084/133] Update 20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md --- ...ectionally from Command Line Using 'Speedtest-CLI' Tool.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md index a2e5ebc1d8..ee125e70a6 100644 --- a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md +++ b/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md @@ -1,3 +1,5 @@ +translating by createyuan + How to Test Your Internet Speed Bidirectionally from Command Line Using ‘Speedtest-CLI’ Tool ================================================================================ We always need to check the speed of the Internet connection at home and office. What we do for this? Go to websites like Speedtest.net and begin test. It loads JavaScript in the web browser and then select best server based upon ping and output the result. It also uses a Flash player to produce graphical results. @@ -129,4 +131,4 @@ via: http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/speedtest-mini-server-to-test-bandwidth-speed/ \ No newline at end of file +[1]:http://www.tecmint.com/speedtest-mini-server-to-test-bandwidth-speed/ From 4afb5741d4fcd01eed23bbab2effd2298c19fda4 Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 8 May 2015 10:30:35 +0800 Subject: [PATCH 085/133] PUB:20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs @geekpi --- ...drom apt-get update cannot be used to add new CD-ROMs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md (96%) diff --git a/translated/tech/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md b/published/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md similarity index 96% rename from translated/tech/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md rename to published/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md index 77c4c05d63..e6ced67ef0 100644 --- a/translated/tech/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md +++ b/published/20150227 How To Fix--Failed to fetch cdrom apt-get update cannot be used to add new CD-ROMs.md @@ -1,4 +1,4 @@ -如何修复:apt-get update无法添加新的CD-ROM +如何修复 apt-get update 无法添加新的 CD-ROM 的错误 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/elementary_OS_Freya.jpg) @@ -63,8 +63,8 @@ via: http://itsfoss.com/fix-failed-fetch-cdrom-aptget-update-add-cdroms/ 作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From eaaf54c661d0ef7a714bd8b9d99bb09b9a59102d Mon Sep 17 00:00:00 2001 From: wxy Date: Fri, 8 May 2015 10:49:15 +0800 Subject: [PATCH 086/133] PUB:How to Manage Network using nmcli Tool in RedHat CentOS 7.x @SPccman --- ...k using nmcli Tool in RedHat CentOS 7.x.md | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) rename {translated/tech => published}/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md (74%) diff --git a/translated/tech/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md b/published/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md similarity index 74% rename from translated/tech/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md rename to published/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md index febebc89ca..bb4a3a5568 100644 --- a/translated/tech/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md +++ b/published/How to Manage Network using nmcli Tool in RedHat CentOS 7.x.md @@ -1,8 +1,8 @@ -在 RedHat/CentOS 7.x 中使用 cmcli 命令管理网络 +在 RedHat/CentOS 7.x 中使用 nmcli 命令管理网络 =============== [**Red Hat Enterprise Linux 7** 与 **CentOS 7**][1] 中默认的网络服务由 **NetworkManager** 提供,这是动态控制及配置网络的守护进程,它用于保持当前网络设备及连接处于工作状态,同时也支持传统的 ifcfg 类型的配置文件。 -NetworkManager 可以用于以下类型的连接: -Ethernet,VLANS,Bridges,Bonds,Teams,Wi-Fi,mobile boradband(如移动3G)以及 IP-over-InfiniBand。针对与这些网络类型,NetworkManager 可以配置他们的网络别名,IP 地址,静态路由,DNS,VPN连接以及很多其它的特殊参数。 + +NetworkManager 可以用于以下类型的连接:Ethernet,VLANS,Bridges,Bonds,Teams,Wi-Fi,mobile boradband(如移动3G)以及 IP-over-InfiniBand。针对与这些网络类型,NetworkManager 可以配置他们的网络别名,IP 地址,静态路由,DNS,VPN连接以及很多其它的特殊参数。 可以用命令行工具 nmcli 来控制 NetworkManager。 @@ -24,19 +24,21 @@ Ethernet,VLANS,Bridges,Bonds,Teams,Wi-Fi,mobile boradband(如移 显示所有连接。 - # nmcli connection show -a + # nmcli connection show -a 仅显示当前活动的连接。 # nmcli device status -列出通过 NetworkManager 验证的设备列表及他们的状态。 +列出 NetworkManager 识别出的设备列表及他们的状态。 ![nmcli general](http://blog.linoxide.com/wp-content/uploads/2014/12/nmcli-gneral.jpg) ### 启动/停止 网络接口### -使用 nmcli 工具启动或停止网络接口,与 ifconfig 的 up/down 是一样的。使用下列命令停止某个接口: +使用 nmcli 工具启动或停止网络接口,与 ifconfig 的 up/down 是一样的。 + +使用下列命令停止某个接口: # nmcli device disconnect eno16777736 @@ -50,7 +52,7 @@ Ethernet,VLANS,Bridges,Bonds,Teams,Wi-Fi,mobile boradband(如移 # nmcli connection add type ethernet con-name NAME_OF_CONNECTION ifname interface-name ip4 IP_ADDRESS gw4 GW_ADDRESS -根据你需要的配置更改 NAME_OF_CONNECTION,IP_ADDRESS, GW_ADDRESS参数(如果不需要网关的话可以省略最后一部分)。 +根据你需要的配置更改 NAME\_OF\_CONNECTION,IP\_ADDRESS, GW\_ADDRESS参数(如果不需要网关的话可以省略最后一部分)。 # nmcli connection add type ethernet con-name NEW ifname eno16777736 ip4 192.168.1.141 gw4 192.168.1.1 @@ -68,9 +70,11 @@ Ethernet,VLANS,Bridges,Bonds,Teams,Wi-Fi,mobile boradband(如移 ![nmcli add static](http://blog.linoxide.com/wp-content/uploads/2014/12/nmcli-add-static.jpg) +###增加一个使用 DHCP 的新连接 + 增加新的连接,使用DHCP自动分配IP地址,网关,DNS等,你要做的就是将命令行后 ip/gw 地址部分去掉就行了,DHCP会自动分配这些参数。 -例,在 eno 16777736 设备上配置一个 名为 NEW_DHCP 的 DHCP 连接 +例,在 eno 16777736 设备上配置一个 名为 NEW\_DHCP 的 DHCP 连接 # nmcli connection add type ethernet con-name NEW_DHCP ifname eno16777736 @@ -79,8 +83,8 @@ Ethernet,VLANS,Bridges,Bonds,Teams,Wi-Fi,mobile boradband(如移 via: http://linoxide.com/linux-command/nmcli-tool-red-hat-centos-7/ 作者:[Adrian Dinu][a] -译者:[SPccman](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[SPccman](https://github.com/SPccman) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 847dc6f61ce217f3a46ff4920880eb5129f90468 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Fri, 8 May 2015 10:56:30 +0800 Subject: [PATCH 087/133] translated wi-cuckoo --- ...What are good command line HTTP clients.md | 111 ------------------ ...What are good command line HTTP clients.md | 110 +++++++++++++++++ 2 files changed, 110 insertions(+), 111 deletions(-) delete mode 100644 sources/share/20150429 What are good command line HTTP clients.md create mode 100644 translated/share/20150429 What are good command line HTTP clients.md diff --git a/sources/share/20150429 What are good command line HTTP clients.md b/sources/share/20150429 What are good command line HTTP clients.md deleted file mode 100644 index a06e4e34db..0000000000 --- a/sources/share/20150429 What are good command line HTTP clients.md +++ /dev/null @@ -1,111 +0,0 @@ -translating wi-cuckoo -What are good command line HTTP clients? -================================================================================ -The whole is greater than the sum of its parts is a very famous quote from Aristotle, a Greek philosopher and scientist. This quote is particularly pertinent to Linux. In my view, one of Linux's biggest strengths is its synergy. The usefulness of Linux doesn't derive only from the huge raft of open source (command line) utilities. Instead, it's the synergy generated by using them together, sometimes in conjunction with larger applications. - -The Unix philosophy spawned a "software tools" movement which focused on developing concise, basic, clear, modular and extensible code that can be used for other projects. This philosophy remains an important element for many Linux projects. - -Good open source developers writing utilities seek to make sure the utility does its job as well as possible, and work well with other utilities. The goal is that users have a handful of tools, each of which seeks to excel at one thing. Some utilities work well independently. - -This article looks at 3 open source command line HTTP clients. These clients let you download files off the internet from a command line. But they can also be used for many more interesting purposes such as testing, debugging and interacting with HTTP servers and web applications. Working with HTTP from the command-line is a worthwhile skill for HTTP architects and API designers. If you need to play around with an API, HTTPie and cURL will be invaluable. - ----------- - -![HTTPie](http://www.linuxlinks.com/portal/content2/png/HTTPie.png) - -![HTTPie in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-httpie.png) - -HTTPie (pronounced aych-tee-tee-pie) is an open source command line HTTP client. It is a a command line interface, cURL-like tool for humans. - -The goal of this software is to make CLI interaction with web services as human-friendly as possible. It provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output. HTTPie can be used for testing, debugging, and generally interacting with HTTP servers. - -#### Features include: #### - -- Expressive and intuitive syntax -- Formatted and colorized terminal output -- Built-in JSON support -- Forms and file uploads -- HTTPS, proxies, and authentication -- Arbitrary request data -- Custom headers -- Persistent sessions -- Wget-like downloads -- Python 2.6, 2.7 and 3.x support -- Linux, Mac OS X and Windows support -- Plugins -- Documentation -- Test coverage - -- Website: [httpie.org][1] -- Developer: Jakub Roztočil -- License: Open Source -- Version Number: 0.9.2 - ----------- - -![cURL](http://www.linuxlinks.com/portal/content2/png/cURL1.png) - -![cURL in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-cURL.png) - -cURL is an open source command line tool for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP. - -curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks. - -#### Features include: #### - -- Config file support -- Multiple URLs in a single command line -- Range "globbing" support: [0-13], {one,two,three} -- Multiple file upload on a single command line -- Custom maximum transfer rate -- Redirectable stderr -- Metalink support - -- Website: [curl.haxx.se][2] -- Developer: Daniel Stenberg -- License: MIT/X derivate license -- Version Number: 7.42.0 - ----------- - -![Wget](http://www.linuxlinks.com/portal/content2/png/Wget1.png) - -![Wget in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Wget.png) - -Wget is open source software that retrieves content from web servers. Its name is derived from World Wide Web and get. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. - -Wget can follow links in HTML pages and create local versions of remote web sites, fully recreating the directory structure of the original site. This is known as "recursive downloading." - -Wget has been designed for robustness over slow or unstable network connections. - -Features include: - -- Resume aborted downloads, using REST and RANGE -- Use filename wild cards and recursively mirror directories -- NLS-based message files for many different languages -- Optionally converts absolute links in downloaded documents to relative, so that downloaded documents may link to each other locally -- Runs on most UNIX-like operating systems as well as Microsoft Windows -- Supports HTTP proxies -- Supports HTTP cookies -- Supports persistent HTTP connections -- Unattended / background operation -- Uses local file timestamps to determine whether documents need to be re-downloaded when mirroring - -- Website: [www.gnu.org/software/wget/][3] -- Developer: Hrvoje Niksic, Gordon Matzigkeit, Junio Hamano, Dan Harkless, and many others -- License: GNU GPL v3 -- Version Number: 1.16.3 - --------------------------------------------------------------------------------- - -via: http://www.linuxlinks.com/article/20150425174537249/HTTPclients.html - -作者:Frazer Kline -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://httpie.org/ -[2]:http://curl.haxx.se/ -[3]:https://www.gnu.org/software/wget/ diff --git a/translated/share/20150429 What are good command line HTTP clients.md b/translated/share/20150429 What are good command line HTTP clients.md new file mode 100644 index 0000000000..fa9ef01c54 --- /dev/null +++ b/translated/share/20150429 What are good command line HTTP clients.md @@ -0,0 +1,110 @@ +什么是好的命令行HTTP客户端? +============================================================================== +整体大于各部分之和,这是引自希腊哲学家和科学家的亚里士多德的名言。这句话特别切中Linux。在我看来,Linux最强大的地方之一就是它的协作性。Linux的实用性并不仅仅源自大量的开源程序(命令行)。相反,其协作性来自于这些程序的综合利用,有时是结合更大型的应用。 + +Unix哲学引发了一场“软件工具”的运动,关注开发简洁,基础,干净,模块化和扩展性好的代码,并可以运用于其他的项目。这种哲学为许多的Linux项目留下了一个重要的元素。 + +好的开源开发者写程序为了确保该程序尽可能运行正确,同时能与其他程序很好地协作。目标就是使用者拥有一堆方便的工具,每一个力求干不止一件事。许多程序能独立工作得很好。 + +这篇文章讨论3个开源命令行HTTP客户端。这些客户端可以让你使用命令行从互联网上下载文件。但同时,他们也可以用于许多有意思的地方,如测试,调式和与HTTP服务器或网络应用互动。对于HTTP架构师和API设计人员来说,使用命令行操作HTTP是一个值得花时间学习的技能。如果你需要来回使用API,HTTPie和cURL,这没什么价值。 + +------------- + +![HTTPie](http://www.linuxlinks.com/portal/content2/png/HTTPie.png) + +![HTTPie in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-httpie.png) + +HTTPie(发音 aych-tee-tee-pie)是一款开源命令行HTTP客户端。它是一个命令行界面,类cURL的工具。 + +该软件的目标是使得与网络服务器的交互尽可能的人性化。其提供了一个简单的http命令,允许使用简单且自然的语句发送任意的HTTP请求,并显示不同颜色的输出。HTTPie可以用于测试,调式和与HTTP服务器的一般交互。 + +#### 功能包括:#### + +- 可表达,直观的语句 +- 格式化,颜色区分的终端输出 +- 内建JSON支持 +- 表单和文件上传 +- HTTPS,代理和认证 +- 任意数据请求 +- 自定义标题 (此处header不确定是否特别意义) +- 持久会话 +- 类Wget下载 +- Python 2.6,2.7和3.x支持 +- Linux,Mac OS X 和 Windows支持 +- 支持插件 +- 帮助文档 +- 测试覆盖 (直译有点别扭) + +- 网站:[httpie.org][1] +- 开发者: Jakub Roztočil +- 证书: 开源 +- 版本号: 0.9.2 + +---------- + +![cURL](http://www.linuxlinks.com/portal/content2/png/cURL1.png) + +![cURL in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-cURL.png) + +cURL是一个开源命令行工具,用于使用URL语句传输数据,支持DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS,IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET和TFTP。 + +cURL支持SSL证书,HTTP POST,HTTP PUT,FTP上传,HTTP基于表单上传,代理,缓存,用户名+密码认证(Basic, Digest, NTLM, Negotiate, kerberos...),文件传输恢复, 代理通道和一些其他实用窍门的总线负载。(这里的名词我不明白其专业意思) + +#### 功能包括:#### + +- 配置文件支持 +- 一个单独命令行多个URL +- “globbing”漫游支持: [0-13],{one, two, three} +- 一个命令上传多个文件 +- 自定义最大传输速度 +- 重定向标准错误输出 +- Metalink支持 + +- 网站: [curl.haxx.se][2] +- 开发者: Daniel Stenberg +- 证书: MIT/X derivate license +- 版本号: 7.42.0 + +---------- + +![Wget](http://www.linuxlinks.com/portal/content2/png/Wget1.png) + +![Wget in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Wget.png) + +Wget是一个从网络服务器获取信息的开源软件。其名字源于World Wide Web 和 get。Wget支持HTTP,HTTPS和FTP协议,同时也通过HTTP代理获取信息。 + +Wget可以根据HTML页面的链接,创建远程网络站点的本地版本,是完全重造源站点的目录结构。这种方式被冠名“recursive downloading。” + +Wget已经设计可以加快低速或者不稳定的网络连接。 + +功能包括: + +- 使用REST和RANGE恢复中断的下载 +- 使用文件名 +- 多语言的基于NLS的消息文件 +- 选择性地转换下载文档里地绝对链接为相对链接,使得下载文档可以本地相互链接 +- 在大多数类UNIX操作系统和微软Windows上运行 +- 支持HTTP代理 +- 支持HTTP数据缓存 +- 支持持续地HTTP连接 +- 无人照管/后台操作 +- 当远程对比时,使用本地文件时间戳来决定是否需要重新下载文档 (mirroring没想出合适的表达) + +- 站点: [www.gnu.org/software/wget/][3] +- 开发者: Hrvoje Niksic, Gordon Matzigkeit, Junio Hamano, Dan Harkless, and many others +- 证书: GNU GPL v3 +- 版本号: 1.16.3 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20150425174537249/HTTPclients.html + +作者:Frazer Kline +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://httpie.org/ +[2]:http://curl.haxx.se/ +[3]:https://www.gnu.org/software/wget/ From 23ae12c5842073dad2c441bd8a2d85194118b49f Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Fri, 8 May 2015 15:58:28 +0800 Subject: [PATCH 088/133] translating wi-cuckoo --- ... configure a Linux bridge with Network Manager on Ubuntu.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md b/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md index 8eac3a212d..a557ee9244 100644 --- a/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md +++ b/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md @@ -1,3 +1,4 @@ +translating wi-cuckoo Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu ================================================================================ > **Question**: I need to set up a Linux bridge on my Ubuntu box to share a NIC with several other virtual machines or containers created on the box. I am currently using Network Manager on my Ubuntu, so preferrably I would like to configure a bridge using Network Manager. How can I do that? @@ -93,4 +94,4 @@ via: http://ask.xmodulo.com/configure-linux-bridge-network-manager-ubuntu.html [a]:http://ask.xmodulo.com/author/nanni [1]:http://xmodulo.com/how-to-configure-linux-bridge-interface.html -[2]:https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1273201 \ No newline at end of file +[2]:https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1273201 From 59e4843ad8a161bf4385477cbafcc90facaa3cbb Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Fri, 8 May 2015 17:01:26 +0800 Subject: [PATCH 089/133] Finish the translation by ZTinoZ --- ...ape - Open Source Vector Graphic Editor.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) rename {sources => translated}/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md (54%) diff --git a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md b/translated/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md similarity index 54% rename from sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md rename to translated/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md index 35a36183e7..f18b10315e 100644 --- a/sources/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md +++ b/translated/tech/20150409 Install Inkscape - Open Source Vector Graphic Editor.md @@ -11,74 +11,74 @@ Inkscape始于2003年,起初它的bug跟踪系统托管于Sourceforge上但是 #### 创建对象 #### - 用铅笔工具来画出不同颜色、大小和形状的手绘线,用贝塞尔曲线(笔式)工具来画出直线和曲线,通过书法工具来应用到手写的书法笔画上等等 -- 用文本工具来创建、选择、编辑和格式化文本。Manipulating text in plain text boxes, on paths or in shapes -- 有效绘制各种形状,像矩形、椭圆形、圆形、弧线、多边形、星形和螺旋形等等并调整其大小、旋转并修改它们 and then resize, rotate and modify (turn sharp edges round) them -- Create and embed bitmaps with simple commands +- 用文本工具来创建、选择、编辑和格式化文本。在纯文本框、在路径上或在形状里操作文本 +- 有效绘制各种形状,像矩形、椭圆形、圆形、弧线、多边形、星形和螺旋形等等并调整其大小、旋转并修改(圆角化)它们 +- 用简单地命令创建并嵌入位图 #### 对象处理 #### - 通过交互式操作和调整数值来扭曲、移动、测量、旋转目标 - 执行力提升并减少了Z-order操作。 -- 对象组群化或取消组群化可以去创建一个虚拟层阶用来编辑或处理 +- 对象群组化或取消群组化可以去创建一个虚拟层阶用来编辑或处理 - 图层采用层次结构树的结构并且能锁定或以各式各样的处理方式来重新布置 - 分布与对齐指令 #### 填充与边框 #### - 复制/粘贴风格 -- 取色器 -- Selecting colors on a continuous plot based on vectors of RGB, HSL, CMS, CMYK and color wheel -- Gradient editor helps creating and managing multi-stop gradients -- Define an image or selection and use it to pattern fill -- Dashed Strokes can be used with few predefined dashed patterns -- Beginning, middle and ending marks through path markers +- 取色工具 +- 用RGB, HSL, CMS, CMYK和色盘这四种不同的方式选色 +- 渐层编辑器能创建和管理多停点渐层 +- 定义一个图像或其它选择用来进行花纹填充 +- 用一些预定义泼洒花纹可对边框进行花纹泼洒 +- 通过路径标示器来开始、对折和结束标示 #### 路径上的操作 #### -- Node Editing: Moving nodes and Bezier handles, node alignment and distribution etc -- Boolean operations like yes or no conditions -- Simplifying paths with variable levels or thresholds -- Path insetting and outsetting along with link and offset objects -- Converting bitmap images into paths (color and monochrome paths) through path tracing +- 节点编辑:移动节点和贝塞尔曲线掌控,节点的对齐和分布等等 +- 布尔运算(是或否) +- 运用可变的路径起迄点可简化路径 +- 路径插入和增设连同动态和链接偏移对象 +- 通过路径追踪把位图图像转换成路径(彩色或单色路径) #### 文本处理 #### -- All installed outlined fonts can be used even for right to left align objects -- Formatting text, letter spacing, line spacing or kerning -- Text on path and on shapes where both text and path or shapes can be edited or modified +- 所有安装好的外框字体都能用甚至可以从右至左对齐对象 +- 格式化文本、调整字母间距、行间距或列间距 +- 路径上的文本和形状上的文本和路径或形状都可以被编辑和修改 #### 渲染 #### -- Inkscape fully support anti-aliased display which is a technique that reduces or eliminates aliasing by shading the pixels along the border. -- Support for alpha transparency display and PNG export +- Inkscape完全支持抗锯齿显示,这是一种通过柔化边界上的像素从而减少或消除凹凸锯齿的技术。 +- 支持alpha透明显示和PNG格式图片的导出 ### 在Ubuntu 14.04和14.10上安装Inkscape ### -In order to install Inkscape on Ubuntu, we will need to first [add its stable Personal Package Archive][1] (PPA) to Advanced Package Tool (APT) repository. Launch the terminal and run following command to add its PPA. +为了在Ubuntu上安装Inkscape,我们首先需要 [添加它的稳定版Personal Package Archive][1] (PPA) 至Advanced Package Tool (APT) 库中。打开终端并运行一下命令来添加它的PPA: sudo add-apt-repository ppa:inkscape.dev/stable ![PPA Inkscape](http://blog.linoxide.com/wp-content/uploads/2015/03/PPA-Inkscape.png) -Once the PPA has been added to the APT repository we need to update it using following command. +PPA添加到APT库中后,我们要用以下命令进行更新: sudo apt-get update ![Update APT](http://blog.linoxide.com/wp-content/uploads/2015/03/Update-APT2.png) -After updating the repository we are ready to install inkscape which is accomplished using the following command. +更新好库之后,我们准备用以下命令来完成安装: sudo apt-get install inkscape ![Install Inkscape](http://blog.linoxide.com/wp-content/uploads/2015/03/Install-Inkscape.png) -Congratulation, Inkscape has been installed now and all set for image editing and making full use of feature rich application. +恭喜,现在Inkscape已经被安装好了,我们可以充分利用它的丰富功能特点来编辑制作图像了。 ![Inkscape Main](http://blog.linoxide.com/wp-content/uploads/2015/03/Inkscape-Main1.png) ### 结论 ### -Inkscape is a feature rich graphic editing tool which empowers its user with state of the art capabilities. It is an open source application which is freely available for installation and customizations and supports wide range of file formats including but not limited to JPEG, PNG, GIF and PDF. Visit its [official website][2] for more news and updates regarding this application. +Inkscape是一款特点鲜明的图形编辑工具,它给予用户充分发挥自己艺术力的权利。它还是一款自由安装和自定义开源应用并且支持大范围文件类型包括JPEG, PNG, GIF和PDF且不仅这些。访问它的 [官方网站][2] 来获取更多新闻和应用更新。 -------------------------------------------------------------------------------- From 34af26ac4090b7f3eb8048d0c3ea4468a6d4ceeb Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Fri, 8 May 2015 17:41:40 +0800 Subject: [PATCH 090/133] finish first translate, need more modification --- ...tore Passwords and Api Keys Using Vault.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md diff --git a/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md b/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md new file mode 100644 index 0000000000..4fdfb4c9e6 --- /dev/null +++ b/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md @@ -0,0 +1,166 @@ +ʹVaultȫĴ洢APIԿ +======================================================================= +VaultڰȫĻȡϢĹߡԱ롢APIԿ֤ϢVaultͨǿʿƻƺ͸չԵ¼־ṩһͳһĽӿʱϢ + +ԹؼϢ׼һѵ⣬ǵûɫûͬĹؼϢʹòͬȨ޵¼ݿϸڣAPIԿļܹ֤ͨȡϢɲͬƽ̨йʹһЩԶʱø㣬ˣȫĴ洢־DzܵġVaultΪָṩһ + +### ͻص ### + +ݼܣVaultܹ֤ڲ洢ݵ¶ݽмܡܡڱԴ洢ܺݶ迪ԼļܼVaultȫŶԶ尲ȫ + +**ȫ洢**VaultڽϢAPIԿ롢֤飩洢־û洢֮ǰݽмܡˣżõ˻ȡ洢ݵȨޣҲûκ壬ݱܡ + +**̬**VaultΪAWSSQLݿϵͳ롣ӦҪAWS S3Ͱ磬VaultAWSԿԣҪıϢһڡϢʱں󽫱òá + +**޺͸**VaultΪ豣ϢһڹڣջرϢӦҪϢͨAPIڡ + +****ڵ֮ǰVaultԳһϢһϢ + +### װVault ### + +ַʽװʹVault + +**1. ԤVault** еLinuxа棬صַ£һɣѹϵͳPATH·£Ա㷽ĵá + +- [Download Precompiled Vault Binary (32-bit)][1] +- [Download Precompiled Vault Binary (64-bit)][2] +- [Download Precompiled Vault Binary (ARM)][3] + +ӦԤVaultư汾 + +![wget binary](http://blog.linoxide.com/wp-content/uploads/2015/04/wget-binary.png) + +ѹصĶư汾 + +![vault](http://blog.linoxide.com/wp-content/uploads/2015/04/unzip.png) + +ףأڿʹVaultˡ + +![](http://blog.linoxide.com/wp-content/uploads/2015/04/vault.png) + +**2. Դ** һϵͳаװVaultķʽڰװVault֮ǰҪװGOGIT + + **RedhatϵͳаװGO** ʹָ + + sudo yum install go + + **DebinϵͳаװGO** ʹָ + + sudo apt-get install golang + + + + sudo add-apt-repository ppa:gophers/go + + sudo apt-get update + + sudo apt-get install golang-stable + + **RedhatϵͳаװGIT** ʹ + + sudo yum install git + + **DebianϵͳаװGIT** ʹ + + sudo apt-get install git + +һGOGITѱװãDZԿʼԴ밲װVault + +> еVaultֿ⿽GOPATH + + https://github.com/hashicorp/vault + +> ļǷڣڣôVaultûб¡ʵ· + + $GOPATH/src/github.com/hashicorp/vault/main.go + +> ִָVaultļŵϵͳbinĿ¼¡ + + make dev + +![path](http://blog.linoxide.com/wp-content/uploads/2015/04/installation4.png) + +### һVaultŽ̳ ### + +ѾVaultĹٷʽ̳̣ԼSSHϵ + +**** + +ݽ̳̰в裺 + +- ʼVault +- VaultжȨ +- дϢ +- ܷVault + +**ʼVault** + +ȣҪΪʼһVaultĹʵ +ڳʼУVaultܷΪ +ڳʼVaultʹһܷԿ + + vault init -key-shares=1 -key-threshold=1 + +ע⵽VaultӡԿҪնˣЩԿںIJлʹõ + +![Initializing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Initializing-SSH.png) + +**Vault** + +һVaultʱܷ״̬״̬£VaultΪ֪δȡ洢֪ζнܡ +VaultʹüԿݡԿ"Կ"ܣԿ档ԿҪһƬֵУʹһƬԿ + + vault unseal + +![Unsealing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Unsealing-SSH.png) + +**ΪȨ** + +ִκβ֮ǰӵĿͻӦñȨȨĹǼһ˻߻Dz˵ݡVaultʱʹá +Ϊǽʹڲ2ɵrootơӦԹģʽ֡ + + vault auth + +![Authorize SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Authorize-SSH.png) + +**дϢ** + +VaultѾ׵ǿԿʼʹĬϵ˶дϢˡдVaultеıϢܲд˵Ĵ洢˴洢Ʋ鿴δֵܵûκVaultɽܵıҪϢ + + vault write secret/hello value=world + +ȻԶϢˣ + + vault read secret/hello + +![RW_SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/RW_SSH.png) + +**ܷVault** + +һAPIܷVaultԿҪָܹܷҪһӵrootȨ޵ĵͨһֺ"Ʋ"һ֡ +ַʽУһ⵽֣Vaultݽ̱סԱСʧûлȡԿƬᱻٴλȡ + + vault seal + +![Seal Vault SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Seal-Vault-SSH.png) + +Ž̵̳Ľβ + +### ܽ ### + +VaultһdzõӦãṩһɿҰȫĴ洢ؼϢķʽ⣬ڴ洢ǰܹؼϢά־ڵķʽȡϢһڹڣջرϢVaultƽ̨ģҿغͰװҪVaultĸϢʹٷվ + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/how-tos/secure-secret-store-vault/ + +ߣ[Aun Raza][a] +ߣ[ID](https://github.com/ID) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ + +[a]:http://linoxide.com/author/arunrz/ +[1]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_386.zip +[2]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_amd64.zip +[3]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_arm.zip From 1820aabc37070d92dca55e0bd55cdbcc4793e93f Mon Sep 17 00:00:00 2001 From: VicYu Date: Fri, 8 May 2015 20:08:08 +0800 Subject: [PATCH 091/133] Translated --- ...nswers--How to install autossh on Linux.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md b/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md index 97814b2288..e83c23e9f3 100644 --- a/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md +++ b/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md @@ -1,44 +1,44 @@ - Vic020 - -Linux FAQs with Answers--How to install autossh on Linux +Linux有问必答--如何安装autossh ================================================================================ -> **Question**: I would like to install autossh on [insert your Linux distro]. How can I do that? +> **提问**: 我打算在linux上安装autossh,我应该怎么做呢? -[autossh][1] is an open-source tool that allows you to monitor an SSH session and restart it automatically should it gets disconnected or stops forwarding traffic. autossh assumes that [passwordless SSH login][2] for a destination host is already setup, so that it can restart a broken SSH session without user's involvement. +[autossh][1] 是一款开源工具,可以帮助管理SSH会话,自动重连和停止转发流量。autossh会假定目标主机已经设定[无密码SSH登陆][2],以便autossh可以重连断开的SSH会话而不用用户操作。 + +只要你建立[反向SSH隧道][3]或者[挂载基于SSH的远程文件夹][4],autossh迟早会派上用场。基本上只要需要维持SSH会话,autossh肯定是有用的。 -autossh comes in handy when you want to set up [reverse SSH tunnels][3] or [mount remote folders over SSH][4]. Essentially in any situation where persistent SSH sessions are required, autossh can be useful. ![](https://farm8.staticflickr.com/7786/17150854870_63966e78bc_c.jpg) -Here is how to install autossh on various Linux distributions. +下面有许多linux发行版autossh的安装方法。 -### Install Autossh on Debian or Ubuntu ### +### Debian 或 Ubuntu 系统 ### -autossh is available in base repositories of Debian based systems, so installation is easy. +autossh已经加入基于Debian系统的基础库,所以可以很方便的安装。 $ sudo apt-get install autossh -### Install Autossh on Fedora ### +### Fedora 系统 ### -Fedora repositories also carry autossh package. So simply use yum command. +Fedora库同样包含autossh包,使用yum安装。 $ sudo yum install autossh -### Install Autossh on CentOS or RHEL ### +### CentOS 或 RHEL 系统 ### -For CentOS/RHEL 6 or earlier, enable [Repoforge repository][5] first, and then use yum command. +CentOS/RHEL 6 或早期版本, 需要开启第三库[Repoforge库][5], 然后才能使用yum安装. $ sudo yum install autossh -For CentOS/RHEL 7, autossh is no longer available in Repoforge repository. You will need to build it from the source (explained below). +CentOS/RHEL 7以后,autossh 已经不在Repoforge库中. 你需要从源码编译安装(例子在下面). -### Install Autossh on Arch Linux ### + +### Arch Linux 系统 ### $ sudo pacman -S autossh -### Compile Autossh from the Source on Debian or Ubuntu ### +### Debian 或 Ubuntu 系统中从源码编译安装### -If you would like to try the latest version of autossh, you can build it from the source as follows. +如果你想要使用最新版本的autossh,你可以自己编译源码安装 $ sudo apt-get install gcc make $ wget http://www.harding.motd.ca/autossh/autossh-1.4e.tgz @@ -48,9 +48,9 @@ If you would like to try the latest version of autossh, you can build it from th $ make $ sudo make install -### Compile Autossh from the Source on CentOS, Fedora or RHEL ### +### CentOS, Fedora 或 RHEL 系统中从源码编译安装### -On CentOS/RHEL 7, autossh is not available as a pre-built package. So you'll need to compile it from the source as follows. +在CentOS/RHEL 7以后,autossh不在是预编译包。所以你不得不从源码编译安装。 $ sudo yum install wget gcc make $ wget http://www.harding.motd.ca/autossh/autossh-1.4e.tgz @@ -65,7 +65,7 @@ On CentOS/RHEL 7, autossh is not available as a pre-built package. So you'll nee via: http://ask.xmodulo.com/install-autossh-linux.html 作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Vic020/VicYu](http://vicyu.net) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From 80f74d6f79d8e31a5f8cbc07e8512ef0898a5d9f Mon Sep 17 00:00:00 2001 From: VicYu Date: Fri, 8 May 2015 20:10:19 +0800 Subject: [PATCH 092/133] Moved --- ...06 Linux FAQs with Answers--How to install autossh on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md (100%) diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md b/translated/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md similarity index 100% rename from sources/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md rename to translated/tech/20150506 Linux FAQs with Answers--How to install autossh on Linux.md From adec7006040adf445e6a64c3e176540ac3d75e70 Mon Sep 17 00:00:00 2001 From: wwy Date: Sat, 9 May 2015 09:34:28 +0800 Subject: [PATCH 093/133] Update 20150506 How to Securely Store Passwords and Api Keys Using Vault.md reviewed the translation, do some modification. --- ...tore Passwords and Api Keys Using Vault.md | 109 +++++++++--------- 1 file changed, 52 insertions(+), 57 deletions(-) diff --git a/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md b/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md index 4fdfb4c9e6..e9e54ac43d 100644 --- a/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md +++ b/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md @@ -1,54 +1,54 @@ -ʹVaultȫĴ洢APIԿ +如何使用Vault安全的存储密码和API密钥 ======================================================================= -VaultڰȫĻȡϢĹߡԱ롢APIԿ֤ϢVaultͨǿʿƻƺ͸չԵ¼־ṩһͳһĽӿʱϢ +Vault是用来安全的获取秘密信息的工具。他可以保存密码、API密钥、证书等信息。Vault通过强访问控制机制和高扩展性的事件日志提供了一个统一的接口来访问秘密信息。 -ԹؼϢ׼һѵ⣬ǵûɫûͬĹؼϢʹòͬȨ޵¼ݿϸڣAPIԿļܹ֤ͨȡϢɲͬƽ̨йʹһЩԶʱø㣬ˣȫĴ洢־DzܵġVaultΪָṩһ +对关键信息的授权访问是一个困难的问题,尤其是当有许多用户角色和用户请求不同的关键信息,例如用不同权限登录数据库的细节,对外服务的API密钥,面向服务架构通信的证书等。当保密信息由不同的平台进行管理,并使用一些自定义的配置时,情况变得更糟,因此,安全的存储、管理审计日志几乎是不可能的。但Vault为这种复杂情况提供了一个解决方案。 -### ͻص ### +### 突出特点 ### -ݼܣVaultܹ֤ڲ洢ݵ¶ݽмܡܡڱԴ洢ܺݶ迪ԼļܼVaultȫŶԶ尲ȫ +数据加密:Vault能够在不存储数据的情况下对数据进行加密、解密。开发者们便可以存储加密后的数据而无需开发自己的加密技术,Vault还允许安全团队自定义安全参数。 -**ȫ洢**VaultڽϢAPIԿ롢֤飩洢־û洢֮ǰݽмܡˣżõ˻ȡ洢ݵȨޣҲûκ壬ݱܡ +**安全密码存储**:Vault在将秘密信息(API密钥、密码、证书)存储到持久化存储之前对数据进行加密。因此,如果有人偶尔拿到了获取存储的数据的权限,这也没有任何意义,除非加密后的信息被解密。 -**̬**VaultΪAWSSQLݿϵͳ롣ӦҪAWS S3Ͱ磬VaultAWSԿԣҪıϢһڡϢʱں󽫱òá +**动态密码**:Vault为AWS、SQL数据库类似的系统按需产生密码。如果应用需要获得AWS S3的桶,比如,它向Vault请求AWS密钥对,Vault将授予需要的秘密信息一段租用期时间。一旦租用期过期,这个秘密信息将变得不可用。 -**޺͸**VaultΪ豣ϢһڹڣջرϢӦҪϢͨAPIڡ +**租赁和更新**:Vault以租用期为限制授予秘密信息,一旦租用期过期,它便立刻收回保密信息,如果应用仍需要保密信息,则可以通过API更新租用期。 -****ڵ֮ǰVaultԳһϢһϢ +**撤销**:在租用期到期之前,Vault可以撤销一个秘密信息或者一个秘密信息树。 -### װVault ### +### 安装Vault ### -ַʽװʹVault +有两种方式来安装使用Vault。 -**1. ԤVault** еLinuxа棬صַ£һɣѹϵͳPATH·£Ա㷽ĵá +**1. 预编译的Vault二进制** 能用于所有的Linux发行版,下载地址如下,一旦下载完成,解压并将它放在系统PATH路径下,以方便调用。 - [Download Precompiled Vault Binary (32-bit)][1] - [Download Precompiled Vault Binary (64-bit)][2] - [Download Precompiled Vault Binary (ARM)][3] -ӦԤVaultư汾 +下载相应的预编译的Vault二进制版本。 ![wget binary](http://blog.linoxide.com/wp-content/uploads/2015/04/wget-binary.png) -ѹصĶư汾 +解压下载到本地的二进制版本。 ![vault](http://blog.linoxide.com/wp-content/uploads/2015/04/unzip.png) -ףأڿʹVaultˡ +祝贺!您现在可以使用Vault了。 ![](http://blog.linoxide.com/wp-content/uploads/2015/04/vault.png) -**2. Դ** һϵͳаװVaultķʽڰװVault֮ǰҪװGOGIT +**2. 从源代码编译** 是另一种在系统中安装Vault的方式。在安装Vault之前需要安装GO和GIT。 - **RedhatϵͳаװGO** ʹָ +在 **Redhat系统中安装GO** 使用下面的指令。 sudo yum install go - **DebinϵͳаװGO** ʹָ +在 **Debin系统中安装GO** 使用下面的指令。 sudo apt-get install golang - +或者 sudo add-apt-repository ppa:gophers/go @@ -56,109 +56,104 @@ Vault sudo apt-get install golang-stable - **RedhatϵͳаװGIT** ʹ +在 **Redhat系统中安装GIT** 使用下面的命令。 sudo yum install git - **DebianϵͳаװGIT** ʹ +在 **Debian系统中安装GIT** 使用下面的命令。 sudo apt-get install git -һGOGITѱװãDZԿʼԴ밲װVault +一旦GO和GIT都已被安装好,我们便可以开始从源码编译安装Vault。 -> еVaultֿ⿽GOPATH +> 将下列的Vault仓库拷贝至GOPATH https://github.com/hashicorp/vault -> ļǷڣڣôVaultûб¡ʵ· +> 测试下面的文件是否存在,如果它不存在,那么Vault没有被克隆到合适的路径。 $GOPATH/src/github.com/hashicorp/vault/main.go -> ִָVaultļŵϵͳbinĿ¼¡ +> 执行下面的指令来编译Vault,并将二进制文件放到系统bin目录下。 make dev ![path](http://blog.linoxide.com/wp-content/uploads/2015/04/installation4.png) -### һVaultŽ̳ ### +### 一份Vault入门教程 ### -ѾVaultĹٷʽ̳̣ԼSSHϵ +我们已经编译了Vault的官方交互式教程,并将它输出到SSH。 -**** +**概述** -ݽ̳̰в裺 +这份教程包括下列步骤: -- ʼVault -- VaultжȨ -- дϢ -- ܷVault +- 初始化,开启您的Vault +- 在Vault中对您的请求授权 +- 读写秘密信息 +- 密封您的Vault -**ʼVault** +**初始化您的Vault** -ȣҪΪʼһVaultĹʵ -ڳʼУVaultܷΪ -ڳʼVaultʹһܷԿ +首先,我们需要为您初始化一个Vault的工作实例。在初始化过程中,您可以配置Vault的密封行为。简单起见,现在使用一个非密封密钥来初始化Vault。 vault init -key-shares=1 -key-threshold=1 -ע⵽VaultӡԿҪնˣЩԿںIJлʹõ +您会注意到Vault在这里打印出了许多的密钥。不要清除您的终端,这些密钥在后面的步骤中会使用到。 ![Initializing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Initializing-SSH.png) -**Vault** +**开启您的Vault** -һVaultʱܷ״̬״̬£VaultΪ֪δȡ洢֪ζнܡ -VaultʹüԿݡԿ"Կ"ܣԿ档ԿҪһƬֵУʹһƬԿ +当一个Vault服务器启动时,它是密封的状态。在这种状态下,Vault被配置为知道在哪里和如何存取物理存储,但不知道如何对其进行解密。Vault使用加密密钥来加密数据。这个密钥由"主密钥"加密,主密钥不保存。解密主密钥需要一个碎片的阈值。在这个例子中,我们使用一个碎片来解密这个主密钥。 vault unseal ![Unsealing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Unsealing-SSH.png) -**ΪȨ** +**为您的请求授权** -ִκβ֮ǰӵĿͻӦñȨȨĹǼһ˻߻Dz˵ݡVaultʱʹá -Ϊǽʹڲ2ɵrootơӦԹģʽ֡ +在执行任何操作之前,连接的客户端应该被授权。授权的过程是检验一个人或者机器是不是像他们描述的那样,被赋予了身份。这个身份在向Vault发送请求时被使用。为简单起见,我们将使用在步骤2中生成的root令牌。这个输出会以滚动模式出现。使用一个客户端令牌进行授权: vault auth ![Authorize SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Authorize-SSH.png) -**дϢ** +**读写保密信息** -VaultѾ׵ǿԿʼʹĬϵ˶дϢˡдVaultеıϢܲд˵Ĵ洢˴洢Ʋ鿴δֵܵûκVaultɽܵıҪϢ +现在Vault已经被设置妥当,我们可以开始使用默认的密码后端读写秘密信息了。写在Vault中的秘密信息首先被加密,然后被写入后端的存储。后端存储机制不会查看未加密的值,并且没有无需Vault即可解密的方法。 vault write secret/hello value=world -ȻԶϢˣ +当然,您接下来便可以读这个保密信息了: vault read secret/hello ![RW_SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/RW_SSH.png) -**ܷVault** +**密封您的Vault** -һAPIܷVaultԿҪָܹܷҪһӵrootȨ޵ĵͨһֺ"Ʋ"һ֡ -ַʽУһ⵽֣Vaultݽ̱סԱСʧûлȡԿƬᱻٴλȡ +有一个API来密封Vault。它将丢掉加密密钥并需要其他未密封的过程来恢复它。密封仅需要一个拥有root权限的操作者。这通常是一种罕见的"打破玻璃过程"的一部分。这种方式中,如果有一个检测到的入侵,Vault数据将会立刻被锁住,以便最小化损失。如果没有获取到主密钥碎片,数据不会被再次获取。 vault seal ![Seal Vault SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Seal-Vault-SSH.png) -Ž̵̳Ľβ +这便是入门教程的结尾。 -### ܽ ### +### 总结 ### -VaultһdzõӦãṩһɿҰȫĴ洢ؼϢķʽ⣬ڴ洢ǰܹؼϢά־ڵķʽȡϢһڹڣջرϢVaultƽ̨ģҿغͰװҪVaultĸϢʹٷվ +Vault是一个非常有用的应用,它提供了一个可靠且安全的存储关键信息的方式。另外,它在存储前加密关键信息,维护他的审计日志,并以租用期的方式获取秘密信息,且一旦租用期过期,它将立刻收回秘密信息。Vault是平台独立的,并且可以免费下载和安装。要发掘Vault的更多信息,请访问官方网站。 -------------------------------------------------------------------------------- via: http://linoxide.com/how-tos/secure-secret-store-vault/ -ߣ[Aun Raza][a] -ߣ[ID](https://github.com/ID) -Уԣ[УID](https://github.com/УID) +作者:[Aun Raza][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[校对者ID](https://github.com/校对者ID) - [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](https://linux.cn/) Ƴ +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/arunrz/ [1]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_386.zip From 5013e0e3c814990a079b3cda0e487e0ea9c18402 Mon Sep 17 00:00:00 2001 From: wwy Date: Sat, 9 May 2015 09:36:42 +0800 Subject: [PATCH 094/133] Delete 20150506 How to Securely Store Passwords and Api Keys Using Vault.md remove the source of translation --- ...tore Passwords and Api Keys Using Vault.md | 170 ------------------ 1 file changed, 170 deletions(-) delete mode 100644 sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md diff --git a/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md b/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md deleted file mode 100644 index 858197989d..0000000000 --- a/sources/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md +++ /dev/null @@ -1,170 +0,0 @@ -Translating by wwy-hust - - -How to Securely Store Passwords and Api Keys Using Vault -================================================================================ -Vault is a tool that is used to access secret information securely, it may be password, API key, certificate or anything else. Vault provides a unified interface to secret information through strong access control mechanism and extensive logging of events. - -Granting access to critical information is quite a difficult problem when we have multiple roles and individuals across different roles requiring various critical information like, login details to databases with different privileges, API keys for external services, credentials for service oriented architecture communication etc. Situation gets even worse when access to secret information is managed across different platforms with custom settings, so rolling, secure storage and managing the audit logs is almost impossible. But Vault provides a solution to such a complex situation. - -### Salient Features ### - -Data Encryption: Vault can encrypt and decrypt data with no requirement to store it. Developers can now store encrypted data without developing their own encryption techniques and it allows security teams to define security parameters. - -**Secure Secret Storage**: Vault encrypts the secret information (API keys, passwords or certificates) before storing it on to the persistent (secondary) storage. So even if somebody gets access to the stored information by chance, it will be of no use until it is decrypted. - -**Dynamic Secrets**: On demand secrets are generated for systems like AWS and SQL databases. If an application needs to access S3 bucket, for instance, it requests AWS keypair from Vault, which grants the required secret information along with a lease time. The secret information won’t work once the lease time is expired. - -**Leasing and Renewal**: Vault grants secrets with a lease limit, it revokes the secrets as soon as lease expires which can further be renewed through APIs if required. - -**Revocation**: Upon expiring the lease period Vault can revoke a single secret or a tree of secrets. - -### Installing Vault ### - -There are two ways to use Vault. - -**1. Pre-compiled Vault Binary** can be downloaded for all Linux flavors from the following source, once done, unzip it and place it on a system PATH where other binaries are kept so that it can be accessed/invoked easily. - -- [Download Precompiled Vault Binary (32-bit)][1] -- [Download Precompiled Vault Binary (64-bit)][2] -- [Download Precompiled Vault Binary (ARM)][3] - -Download the desired precompiled Vault binary. - -![wget binary](http://blog.linoxide.com/wp-content/uploads/2015/04/wget-binary.png) - -Unzip the downloaded binary. - -![vault](http://blog.linoxide.com/wp-content/uploads/2015/04/unzip.png) - -unzipCongratulations! Vault is ready to be used. - -![](http://blog.linoxide.com/wp-content/uploads/2015/04/vault.png) - -**2. Compiling from source** is another way of installing Vault on the system. GO and GIT are required to be installed and configured properly on the system before we start the installation process. - -To **install GO on Redhat systems** use the following command. - - sudo yum install go - -To **install GO on Debian systems** use the following commands. - - sudo apt-get install golang - -OR - - sudo add-apt-repository ppa:gophers/go - - sudo apt-get update - - sudo apt-get install golang-stable - -To **install GIT on Redhat systems** use the following command. - - sudo yum install git - -To **install GIT on Debian systems** use the following commands. - - sudo apt-get install git - -Once both GO and GIT are installed we start the Vault installation process by compiling from the source. - -> Clone following Vault repository into the GOPATH - - https://github.com/hashicorp/vault - -> Verify if the following clone file exist, if it doesn’t then Vault wasn’t cloned to the proper path. - - $GOPATH/src/github.com/hashicorp/vault/main.go - -> Run following command to build Vault in the current system and put binary in the bin directory. - - make dev - -![path](http://blog.linoxide.com/wp-content/uploads/2015/04/installation4.png) - -### An introductory tutorial of Vault ### - -We have compiled Vault’s official interactive tutorial along with its output on SSH. - -**Overview** - -This tutorial will cover the following steps: - -- Initializing and unsealing your Vault -- Authorizing your requests to Vault -- Reading and writing secrets -- Sealing your Vault - -**Initialize your Vault** - -To get started, we need to initialize an instance of Vault for you to work with. -While initializing, you can configure the seal behavior of Vault. -Initialize Vault now, with 1 unseal key for simplicity, using the command: - - vault init -key-shares=1 -key-threshold=1 - -You'll notice Vault prints out several keys here. Don't clear your terminal, as these are needed in the next few steps. - -![Initializing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Initializing-SSH.png) - -**Unsealing your Vault** - -When a Vault server is started, it starts in a sealed state. In this state, Vault is configured to know where and how to access the physical storage, but doesn't know how to decrypt any of it. -Vault encrypts data with an encryption key. This key is encrypted with the "master key", which isn't stored. Decrypting the master key requires a threshold of shards. In this example, we use one shard to decrypt this master key. - - vault unseal - -![Unsealing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Unsealing-SSH.png) - -**Authorize your requests** - -Before performing any operation with Vault, the connecting client must be authenticated. Authentication is the process of verifying a person or machine is who they say they are and assigning an identity to them. This identity is then used when making requests with Vault. -For simplicity, we'll use the root token we generated on init in Step 2. This output should be available in the scrollback. -Authorize with a client token: - - vault auth - -![Authorize SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Authorize-SSH.png) - -**Read and write secrets** - -Now that Vault has been set-up, we can start reading and writing secrets with the default mounted secret backend. Secrets written to Vault are encrypted and then written to the backend storage. The backend storage mechanism never sees the unencrypted value and doesn't have the means necessary to decrypt it without Vault. - - vault write secret/hello value=world - -Of course, you can then read this data too: - - vault read secret/hello - -![RW_SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/RW_SSH.png) - -**Seal your Vault** - -There is also an API to seal the Vault. This will throw away the encryption key and require another unseal process to restore it. Sealing only requires a single operator with root privileges. This is typically part of a rare "break glass procedure". -This way, if there is a detected intrusion, the Vault data can be locked quickly to try to minimize damages. It can't be accessed again without access to the master key shards. - - vault seal - -![Seal Vault SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Seal-Vault-SSH.png) - -That is the end of introductory tutorial. - -### Summary ### - -Vault is a very useful application mainly because of providing a reliable and secure way of storing critical information. Furthermore it encrypts the critical information before storing, maintains audit logs, grants secret information for limited lease time and revokes it once lease is expired. It is platform independent and freely available to download and install. To discover more about Vault, readers are encouraged to visit the official website. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/how-tos/secure-secret-store-vault/ - -作者:[Aun Raza][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunrz/ -[1]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_386.zip -[2]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_amd64.zip -[3]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_arm.zip From 7b2669efd0a8127804583b702f2e464d70706bb4 Mon Sep 17 00:00:00 2001 From: wwy Date: Sat, 9 May 2015 09:58:29 +0800 Subject: [PATCH 095/133] [Translating] What are useful command-line network monitors on Linux --- ... What are useful command-line network monitors on Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150112 What are useful command-line network monitors on Linux.md b/sources/tech/20150112 What are useful command-line network monitors on Linux.md index f17e45cbf4..8f6b9596d1 100644 --- a/sources/tech/20150112 What are useful command-line network monitors on Linux.md +++ b/sources/tech/20150112 What are useful command-line network monitors on Linux.md @@ -1,3 +1,5 @@ +translating by wwy-hust + What are useful command-line network monitors on Linux ================================================================================ Network monitoring is a critical IT function for businesses of all sizes. The goal of network monitoring can vary. For example, the monitoring activity can be part of long-term network provisioning, security protection, performance troubleshooting, network usage accounting, and so on. Depending on its goal, network monitoring is done in many different ways, such as performing packet-level sniffing, collecting flow-level statistics, actively injecting probes into the network, parsing server logs, etc. @@ -132,4 +134,4 @@ via: http://xmodulo.com/useful-command-line-network-monitors-linux.html [19]:http://xmodulo.com/better-alternatives-basic-command-line-utilities.html#mtr_link [20]:http://goaccess.io/ [21]:http://mtop.sourceforge.net/ -[22]:http://xmodulo.com/monitor-nginx-web-server-command-line-real-time.html \ No newline at end of file +[22]:http://xmodulo.com/monitor-nginx-web-server-command-line-real-time.html From 64bfbe62a6b0701a60b765876fc9ee6f28b7c3ca Mon Sep 17 00:00:00 2001 From: VicYu Date: Sat, 9 May 2015 15:39:32 +0800 Subject: [PATCH 096/133] =?UTF-8?q?=20=E6=8A=A2=E5=9C=B0=E4=B8=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20150504 How To Install Visual Studio Code On Ubuntu.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md b/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md index 4b5d2eeae6..8912e3c06c 100644 --- a/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md +++ b/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md @@ -1,3 +1,5 @@ + Vic020 + How To Install Visual Studio Code On Ubuntu ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Install-Visual-Studio-Code-in-Ubuntu.jpeg) @@ -58,4 +60,4 @@ via: http://itsfoss.com/install-visual-studio-code-ubuntu/ [1]:http://www.geekwire.com/2015/microsofts-visual-studio-expands-to-mac-and-linux-with-new-code-development-tool/ [2]:https://wiki.ubuntu.com/ubuntu-make [3]:http://itsfoss.com/install-android-studio-ubuntu-linux/ -[4]:https://code.visualstudio.com/Download \ No newline at end of file +[4]:https://code.visualstudio.com/Download From 06be2e6b47d010f36894bdacf97a97f63a21deae Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 9 May 2015 20:44:08 +0800 Subject: [PATCH 097/133] PUB:20150225 Linux FAQs with Answers--How to disable IPv6 on Linux @ZTinoZ --- ...h Answers--How to disable IPv6 on Linux.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/tech => published}/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md (69%) diff --git a/translated/tech/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md b/published/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md similarity index 69% rename from translated/tech/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md rename to published/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md index 30ad533adc..17c6ccefaa 100644 --- a/translated/tech/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md +++ b/published/20150225 Linux FAQs with Answers--How to disable IPv6 on Linux.md @@ -1,14 +1,14 @@ -Linux有问必答时间--如何在Linux下禁用IPv6 +Linux有问必答:如何在Linux下禁用IPv6 ================================================================================ -> **问题**:我发现我的一个应用程序在尝试通过IPv6建立连接,但是由于我们本地网络不允许分配IPv6的流量,IPv6连接会超时,应用程序的连接会退回到IPv4,这样就会造成不必要的延迟。由于我目前对IPv6没有任何需求,所以我想在我的Linux主机上禁用IPv6。有什么比较合适的方法呢? +> **问题**:我发现我的一个应用程序在尝试通过IPv6建立连接,但是由于我们本地网络不允许分配IPv6的流量,IPv6连接会超时,应用程序的连接会回退到IPv4,这样就会造成不必要的延迟。由于我目前对IPv6没有任何需求,所以我想在我的Linux主机上禁用IPv6。有什么比较合适的方法呢? -IPv6被认为是IPv4——互联网上的传统32位地址空间的替代产品,它为了解决现有IPv4地址空间即将耗尽的问题。然而,由于IPv4已经被每台主机或设备连接到了互联网上,所以想在一夜之间将它们全部切换到IPv6几乎是不可能的。许多IPv4到IPv6的转换机制(例如:双协议栈、网络隧道、代理) 已经被提出来用来促进IPv6能被采用,并且很多应用也正在进行重写,就像我们所说的,来增加对IPv6的支持。有一件事情能确定,就是在可预见的未来里IPv4和IPv6势必将共存。 +IPv6被认为是IPv4——互联网上的传统32位地址空间——的替代产品,它用来解决现有IPv4地址空间即将耗尽的问题。然而,由于已经有大量主机、设备用IPv4连接到了互联网上,所以想在一夜之间将它们全部切换到IPv6几乎是不可能的。许多IPv4到IPv6的转换机制(例如:双协议栈、网络隧道、代理) 已经被提出来用来促进IPv6能被采用,并且很多应用也正在进行重写,如我们所提倡的,来增加对IPv6的支持。有一件事情可以确定,就是在可预见的未来里IPv4和IPv6势必将共存。 -理想情况下,[向IPv6过渡的进程][1]不应该被最终的用户所看见,但是IPv4/IPv6混合环境有时会让你碰到各种源于IPv4和IPv6之间不经意间的相互作用的问题。举个例子,你会碰到应用程序超时的问题比如apt-get或ssh尝试通过IPv6连接失败、DNS服务器意外清空了IPv6的AAAA记录、或者你支持IPv6的设备不兼容你的互联网服务提供商遗留下的IPv4网络等等等等。 +理想情况下,[向IPv6过渡的进程][1]不应该被最终的用户所看见,但是IPv4/IPv6混合环境有时会让你碰到各种源于IPv4和IPv6之间不经意间的相互碰撞的问题。举个例子,你会碰到应用程序超时的问题,比如apt-get或ssh尝试通过IPv6连接失败、DNS服务器意外清空了IPv6的AAAA记录、或者你支持IPv6的设备不兼容你的互联网服务提供商遗留下的IPv4网络,等等等等。 -当然这不意味着你应该盲目地在你的Linux机器上禁用IPv6。鉴于IPv6许诺的种种好处,作为社会的一份子我们最终还是要充分拥抱它的,但是作为给最终用户进行故障排除过程的一部分,如果IPv6确实是罪魁祸首那你可以尝试去关闭它。 +当然这不意味着你应该盲目地在你的Linux机器上禁用IPv6。鉴于IPv6许诺的种种好处,作为社会的一份子我们最终还是要充分拥抱它的,但是作为给最终用户进行故障排除过程的一部分,如果IPv6确实是罪魁祸首,那你可以尝试去关闭它。 -这里有一些让你在Linux中部分或全部禁用IPv6的小技巧(例如:为一个已经确定的网络接口)。这些小贴士应该适用于所有主流的Linux发行版包括Ubuntu、Debian、Linux Mint、CentOS、Fedora、RHEL以及Arch Linux。 +这里有一些让你在Linux中部分(例如:对于某个特定的网络接口)或全部禁用IPv6的小技巧。这些小贴士应该适用于所有主流的Linux发行版包括Ubuntu、Debian、Linux Mint、CentOS、Fedora、RHEL以及Arch Linux。 ### 查看IPv6在Linux中是否被启用 ### @@ -24,7 +24,7 @@ IPv6被认为是IPv4——互联网上的传统32位地址空间的替代产品 ### 临时禁用IPv6 ### -如果你想要在你的Linux系统上临时关闭IPv6,你可以用 /proc 文件系统。"临时",意思是我们所做的禁用IPv6的更改在系统重启后将不被保存。IPv6会在你的Linux机器重启后再次被启用。 +如果你想要在你的Linux系统上临时关闭IPv6,你可以用 /proc 文件系统。"临时"的意思是我们所做的禁用IPv6的更改在系统重启后将不被保存。IPv6会在你的Linux机器重启后再次被启用。 要将一个特定的网络接口禁用IPv6,使用以下命令: @@ -50,7 +50,7 @@ IPv6被认为是IPv4——互联网上的传统32位地址空间的替代产品 #### 方法一 #### -第一种方法是请求以上提到的 /proc 对 /etc/sysctl.conf 文件进行修改。 +第一种方法是通过 /etc/sysctl.conf 文件对 /proc 进行永久修改。 换句话说,就是用文本编辑器打开 /etc/sysctl.conf 然后添加以下内容: @@ -69,7 +69,7 @@ IPv6被认为是IPv4——互联网上的传统32位地址空间的替代产品 #### 方法二 #### -另一个永久禁用IPv6的方法是在开机的时候执行一个必要的内核参数。 +另一个永久禁用IPv6的方法是在开机的时候传递一个必要的内核参数。 用文本编辑器打开 /etc/default/grub 并给GRUB_CMDLINE_LINUX变量添加"ipv6.disable=1"。 @@ -79,7 +79,7 @@ IPv6被认为是IPv4——互联网上的传统32位地址空间的替代产品 GRUB_CMDLINE_LINUX="xxxxx ipv6.disable=1" -上面的"xxxxx"代表任意存在着的内核参数,在它后面添加"ipv6.disable=1"。 +上面的"xxxxx"代表任何已有的内核参数,在它后面添加"ipv6.disable=1"。 ![](https://farm8.staticflickr.com/7286/15982512103_ec5d940e58_b.jpg) @@ -97,7 +97,7 @@ Fedora、CentOS/RHEL系统: ### 禁用IPv6之后的其它可选步骤 ### -这里有一些可选步骤在你禁用IPv6后需要考虑,这是因为当你在内核里禁用IPv6后,其它程序仍然会尝试使用IPv6。在大多数情况下,例如应用程序的运转状态不太会遭到破坏,但是出于效率或安全方面的原因,你要为他们禁用IPv6。 +这里有一些在你禁用IPv6后需要考虑的可选步骤,这是因为当你在内核里禁用IPv6后,其它程序也许仍然会尝试使用IPv6。在大多数情况下,应用程序的这种行为不太会影响到什么,但是出于效率或安全方面的原因,你可以为他们禁用IPv6。 #### /etc/hosts #### @@ -124,7 +124,7 @@ Fedora、CentOS/RHEL系统: 默认情况下,OpenSSH服务(sshd)会去尝试捆绑IPv4和IPv6的地址。 -要强制sshd只捆绑IPv4地址,用文本编辑器打开 /etc/ssh/sshd_config 并添加以下脚本行。inet只适用于IPv4,而inet6是适用于IPv6的。 +要强制sshd只捆绑IPv4地址,用文本编辑器打开 /etc/ssh/sshd_config 并添加以下行。inet只适用于IPv4,而inet6是适用于IPv6的。 $ sudo vi /etc/ssh/sshd_config @@ -140,7 +140,7 @@ via: http://ask.xmodulo.com/disable-ipv6-linux.html 作者:[Dan Nanni][a] 译者:[ZTinoZ](https://github.com/ZTinoZ) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From e28011b47eeda4dc8f4d9f410aabe1b1519b41aa Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 9 May 2015 22:03:33 +0800 Subject: [PATCH 098/133] PUB:20150211 25 Tips for Intermediate Git Users @zpl1025 --- ...0211 25 Tips for Intermediate Git Users.md | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) rename {translated/tech => published}/20150211 25 Tips for Intermediate Git Users.md (82%) diff --git a/translated/tech/20150211 25 Tips for Intermediate Git Users.md b/published/20150211 25 Tips for Intermediate Git Users.md similarity index 82% rename from translated/tech/20150211 25 Tips for Intermediate Git Users.md rename to published/20150211 25 Tips for Intermediate Git Users.md index a1c1dd8328..205c83aaef 100644 --- a/translated/tech/20150211 25 Tips for Intermediate Git Users.md +++ b/published/20150211 25 Tips for Intermediate Git Users.md @@ -1,6 +1,6 @@ -25个给git熟手的技巧 +25个 Git 进阶技巧 ================================================================================ -我已经使用git差不多18个月了,觉得自己对它应该已经非常了解。然后来自GitHub的[Scott Chacon][1]过来给LVS做培训,[LVS是一个赌博软件供应商和开发商][2](从2013年开始的合同),而我在第一天里就学到了很多。 +我已经使用git差不多18个月了,觉得自己对它应该已经非常了解。然后来自GitHub的[Scott Chacon][1]过来给LVS做培训([LVS是一个赌博软件供应商和开发商][2],从2013年开始的合同),而我在第一天里就学到了很多。 作为一个对git感觉良好的人,我觉得分享从社区里掌握的一些有价值的信息,也许能帮某人解决问题而不用做太深入研究。 @@ -15,21 +15,21 @@ #### 2. Git是基于指针的 #### -保存在git里的一切都是文件。当你创建一个提交的时候,会建立一个包含你的提交信息和相关数据(名字,邮件地址,日期/时间,前一个提交,等等)的文件,并把它链接到一个文件树中。文件树中包含了对象或其他树的列表。对象或容器是和本次提交相关的实际内容(也是一个文件,你想了解的话,尽管文件名并没有包含在对象里,而是在树中)。所有这些文件都使用对象的SHA-1哈希值作为文件名。 +保存在git里的一切都是文件。当你创建一个提交的时候,会建立一个包含你的提交信息和相关数据(名字,邮件地址,日期/时间,前一个提交,等等)的文件,并把它链接到一个树文件中。这个树文件中包含了对象或其他树的列表。这里的提到的对象(或二进制大对象)是和本次提交相关的实际内容(它也是一个文件,另外,尽管文件名并没有包含在对象里,但是存储在树中)。所有这些文件都使用对象的SHA-1哈希值作为文件名。 -用这种方式,分支和标签就是简单的文件(基本上是这样),包含指向实际提交的SHA-1哈希值。使用这些索引会带来优秀的灵活性和速度,比如创建一个新分支就只要简单地创建一个包含分支名字和所分出的那个提交的SHA-1索引的文件。当然,你不需要自己做这些,而只要使用Git命令行工具(或者GUI),但是实际上就是这么简单。 +用这种方式,分支和标签就是简单的文件(基本上是这样),包含指向该提交的SHA-1哈希值。使用这些索引会带来优秀的灵活性和速度,比如创建一个新分支就是简单地用分支名字和所分出的那个提交的SHA-1索引来创建一个文件。当然,你不需要自己做这些,而只要使用Git命令行工具(或者GUI),但是实际上就是这么简单。 -你也许听说过叫HEAD的索引。这只是简单的一个文件,包含了你当前指向的那个提交的SHA-1索引值。如果你正在解决一次合并冲突然后看到了HEAD,这并不是一个特别的分支或分值上一个必须的特殊点,只是标明你当前所在位置。 +你也许听说过叫HEAD的索引。这只是简单的一个文件,包含了你当前指向的那个提交的SHA-1索引值。如果你正在解决一次合并冲突然后看到了HEAD,这并不是一个特别的分支或分支上的一个必需的特殊位置,只是标明你当前所在位置。 -所有的分支指针都保存在.git/refs/heads里,HEAD在.git/HEAD里,而标签保存在.git/refs/tags里 - 自己可以放心地进去看看。 +所有的分支指针都保存在.git/refs/heads里,HEAD在.git/HEAD里,而标签保存在.git/refs/tags里 - 自己可以随便进去看看。 -#### 3. 两个父节点 - 当然! #### +#### 3. 两个爸爸(父节点) - 你没看错! #### -在历史中查看一个合并提交的信息时,你将看到有两个父节点(相对于一般工作上的常规提交的情况)。第一个父节点是你所在的分支,第二个是你合并过来的分支。 +在历史中查看一个合并提交的信息时,你将看到有两个父节点(不同于工作副本上的常规提交的情况)。第一个父节点是你所在的分支,第二个是你合并过来的分支。 #### 4. 合并冲突 #### -目前我相信你碰到过合并冲突并且解决过。通常是编辑一下文件,去掉<<<<,====,>>>>标志,保留需要留下的代码。有时能够看到这两个修改之前的代码会很不错,比如,在这两个分支上有冲突的改动之前。下面是一种方式: +目前我相信你碰到过合并冲突并且解决过。通常是编辑一下文件,去掉<<<<,====,>>>>标志,保留需要留下的代码。有时能够看到这两个修改之前的代码会很不错,比如,在这两个现在冲突的分支之前的改动。下面是一种方式: $ git diff --merge diff --cc dummy.rb @@ -45,14 +45,14 @@ end end -如果是二进制文件,比较差异就没那么简单了...通常你要做的就是测试这个二进制文件的两个版本来决定保留哪个(或者在二进制文件编辑器里手工复制冲突部分)。从一个特定分支获取文件拷贝(比如说你在合并master和feature123): +如果是二进制文件,比较差异就没那么简单了...通常你要做的就是测试这个二进制文件的两个版本来决定保留哪个(或者在二进制文件编辑器里手工复制冲突部分)。从一个特定分支获取文件拷贝(比如说你在合并master和feature123两个分支): $ git checkout master flash/foo.fla # 或者... $ git checkout feature132 flash/foo.fla $ # 然后... $ git add flash/foo.fla -另一种方式是通过git输出文件 - 你可以输出到另外的文件名,然后再重命名正确的文件(当你决定了要用哪个)为正常的文件名: +另一种方式是通过git输出文件 - 你可以输出到另外的文件名,然后当你决定了要用哪个后,再将选定的正确文件复制为正常的文件名: $ git show master:flash/foo.fla > master-foo.fla $ git show feature132:flash/foo.fla > feature132-foo.fla @@ -71,7 +71,7 @@ #### 5. 远端服务器 #### -git的一个超强大的功能就是可以有不止一个远端服务器(实际上你一直都在一个本地仓库上工作)。你并不是一定都要有写权限,你可以有多个可以读取的服务器(用来合并他们的工作)然后写入其他仓库。添加一个新的远端服务器很简单: +git的一个超强大的功能就是可以有不止一个远端服务器(实际上你一直都在一个本地仓库上工作)。你并不是一定都要有这些服务器的写权限,你可以有多个可以读取的服务器(用来合并他们的工作)然后写入到另外一个仓库。添加一个新的远端服务器很简单: $ git remote add john git@github.com:johnsomeone/someproject.git @@ -87,10 +87,10 @@ git的一个超强大的功能就是可以有不止一个远端服务器(实 $ git diff master..john/master -你也可以查看不在远端分支的HEAD的改动: +你也可以查看没有在远端分支上的HEAD的改动: $ git log remote/branch.. - # 注意:..后面没有结束的refspec + # 注意:..后面没有结束的特定引用 #### 6. 标签 #### @@ -99,7 +99,7 @@ git的一个超强大的功能就是可以有不止一个远端服务器(实 建立这两种类型的标签都很简单(只有一个命令行开关的差异) $ git tag to-be-tested - $ git tag -a v1.1.0 # 会提示输入标签信息 + $ git tag -a v1.1.0 # 会提示输入标签的信息 #### 7. 建立分支 #### @@ -108,7 +108,7 @@ git的一个超强大的功能就是可以有不止一个远端服务器(实 $ git branch feature132 $ git checkout feature132 -当然,如果你确定自己要新建分支并直接切换过去,可以用一个命令实现: +当然,如果你确定自己直接切换到新建的分支,可以用一个命令实现: $ git checkout -b feature132 @@ -117,20 +117,20 @@ git的一个超强大的功能就是可以有不止一个远端服务器(实 $ git checkout -b twitter-experiment feature132 $ git branch -d feature132 -更新:你也可以(像Brian Palmer在原博客文章的评论里提出的)只用“git branch”的-m开关在一个命令里实现(像Mike提出的,如果你只有一个分支参数,就会重命名当前分支): +更新:你也可以(像Brian Palmer在原博客文章的评论里提出的)只用“git branch”的-m开关在一个命令里实现(像Mike提出的,如果你只指定了一个分支参数,就会重命名当前分支): $ git branch -m twitter-experiment $ git branch -m feature132 twitter-experiment #### 8. 合并分支 #### -在将来什么时候,你希望合并改动。有两种方式: +也许在将来的某个时候,你希望将改动合并。有两种方式: $ git checkout master $ git merge feature83 # 或者... $ git rebase feature83 -merge和rebase之间的差别是merge会尝试处理改动并建立一个新的混合了两者的提交。rebase会尝试把你从一个分支最后一次分离后的所有改动,一个个加到该分支的HEAD上。不过,在已经将分支推到远端服务器后不要再rebase了 - 这回引起冲突/问题。 +merge和rebase之间的差别是merge会尝试处理改动并建立一个新的混合了两者的提交。rebase会尝试把你从一个分支最后一次分离后的所有改动,一个个加到该分支的HEAD上。不过,在已经将分支推到远端服务器后不要再rebase了 - 这会引起冲突/问题。 如果你不确定在哪些分支上还有独有的工作 - 所以你也不知道哪些分支需要合并而哪些可以删除,git branch有两个开关可以帮你: @@ -147,7 +147,7 @@ merge和rebase之间的差别是merge会尝试处理改动并建立一个新的 $ git push origin twitter-experiment:refs/heads/twitter-experiment # origin是我们服务器的名字,而twitter-experiment是分支名字 -更新:感谢Erlend在原博客文章上的评论 - 这个实际上和`git push origin twitter-experiment`效果一样,不过使用完整的语法,你可以在两者之间使用不同的分知名(这样本地分支可以是`add-ssl-support`而远端是`issue-1723`)。 +更新:感谢Erlend在原博客文章上的评论 - 这个实际上和`git push origin twitter-experiment`效果一样,不过使用完整的语法,你可以在两者之间使用不同的分支名(这样本地分支可以是`add-ssl-support`而远端是`issue-1723`)。 如果你想在远端服务器上删除一个分支(注意分支名前面的冒号): @@ -210,7 +210,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 这会让你进入一个基于菜单的交互式提示。你可以使用命令中的数字或高亮的字母(如果你在终端里打开了高亮的话)来进入相应的模式。然后就只是输入你希望操作的文件的数字了(你可以使用这样的格式,1或者1-4或2,4,7)。 -如果你想进入补丁模式(交互式模式下的‘p’或‘5’),你也可以直接进入: +如果你想进入补丁模式(交互式模式下按‘p’或‘5’),你也可以直接进入: $ git add -p diff --git a/dummy.rb b/dummy.rb @@ -226,11 +226,11 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 end Stage this hunk [y,n,q,a,d,/,e,?]? -你可以看到下方会有一些选项供选择用来添加该文件的这个改动,该文件的所有改动,等等。使用‘?’命令可以详细解释这些选项。 +你可以看到下方会有一些选项供选择用来添加该文件的这个改动、该文件的所有改动,等等。使用‘?’命令可以详细解释这些选项。 #### 12. 从文件系统里保存/取回改动 #### -有些项目(比如git项目本身)在git文件系统中直接保存额外文件而并没有将它们加入到版本控制中。 +有些项目(比如Git项目本身)在git文件系统中直接保存额外文件而并没有将它们加入到版本控制中。 让我们从在git中存储一个随机文件开始: @@ -251,7 +251,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 #### 13. 查看日志 #### -如果不用‘git log’来查看最近的提交你git用不了多久。不过,有一些技巧来更好地应用。比如,你可以使用下面的命令来查看每次提交的具体改动: +长时间使用 Git 的话,不会没用过‘git log’来查看最近的提交。不过,有一些技巧来更好地应用。比如,你可以使用下面的命令来查看每次提交的具体改动: $ git log -p @@ -268,7 +268,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 #### 14. 搜索日志 #### -如果你想找特定作者可以这样做: +如果你想找特定提交者可以这样做: $ git log --author=Andy @@ -278,7 +278,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 $ git log --grep="Something in the message" -也有一个更强大的叫做pickaxe的命令用来查找删除或添加某个特定内容的提交(比如,该文件第一次出现或被删除)。这可以告诉你什么时候增加了一行(但这一行里的某个字符后面被改动过就不行了): +也有一个更强大的叫做pickaxe的命令用来查找包含了删除或添加的某个特定内容的提交(比如,该内容第一次出现或被删除)。这可以告诉你什么时候增加了一行(但这一行里的某个字符后面被改动过就不行了): $ git log -S "TODO: Check for admin status" @@ -294,7 +294,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 $ git log --since=2.months.ago --until=1.day.ago -默认情况下会用OR来组合查询,但你可以轻易地改为AND(如果你有超过一条的标准) +默认情况下会用OR来组合查询,但你可以轻易地改为AND(如果你有超过一条的查询标准) $ git log --since=2.months.ago --until=1.day.ago --author=andy -S "something" --all-match @@ -310,7 +310,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 $ git show feature132@{yesterday} # 时间相关 $ git show feature132@{2.hours.ago} # 时间相关 -注意和之前部分有些不同,末尾的插入符号意思是该提交的父节点 - 开始位置的插入符号意思是不在这个分支。 +注意和之前部分有些不同,末尾的^的意思是该提交的父节点 - 开始位置的^的意思是不在这个分支。 #### 16. 选择范围 #### @@ -321,7 +321,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 你也可以省略[new],将使用当前的HEAD。 -### Rewinding Time & Fixing Mistakes ### +### 时光回溯和后悔药 ### #### 17. 重置改动 #### @@ -329,7 +329,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 $ git reset HEAD lib/foo.rb -通常会使用‘unstage’的别名,因为看上去有些不直观。 +通常会使用‘unstage’的别名,因为上面的看上去有些不直观。 $ git config --global alias.unstage "reset HEAD" $ git unstage lib/foo.rb @@ -369,11 +369,11 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 #### 19. 交互式切换基础 #### -这是一个我之前看过展示却没真正理解过的很赞的功能,现在很简单。假如说你提交了3次但是你希望更改顺序或编辑(或者合并): +这是一个我之前看过展示却没真正理解过的很赞的功能,现在觉得它就很简单了。假如说你提交了3次但是你希望更改顺序或编辑(或者合并): $ git rebase -i master~3 -然后会启动你的编辑器并带有一些指令。你所要做的就是修改这些指令来选择/插入/编辑(或者删除)提交和保存/退出。然后在编辑完后你可以用`git rebase --continue`命令来让每一条指令生效。 +然后这会启动你的编辑器并带有一些指令。你所要做的就是修改这些指令来选择/插入/编辑(或者删除)提交和保存/退出。然后在编辑完后你可以用`git rebase --continue`命令来让每一条指令生效。 如果你有修改,将会切换到你提交时所处的状态,之后你需要使用命令git commit --amend来编辑。 @@ -446,7 +446,7 @@ git会基于当前的提交信息自动创建评论。如果你更希望有自 $ git branch experimental SHA1_OF_HASH -如果你访问过的话,你通常可以用git reflog来找到SHA1哈希值。 +如果你最近访问过的话,你通常可以用git reflog来找到SHA1哈希值。 另一种方式是使用`git fsck —lost-found`。其中一个dangling的提交就是丢失的HEAD(它只是已删除分支的HEAD,而HEAD^被引用为当前的HEAD所以它并不处于dangling状态) @@ -460,7 +460,7 @@ via: https://www.andyjeffries.co.uk/25-tips-for-intermediate-git-users/ 作者:[Andy Jeffries][a] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 20e5eff6a3f092f96c01d642c4df7bd5cdf25a4f Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 9 May 2015 22:07:37 +0800 Subject: [PATCH 099/133] PUB:20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu @geekpi --- ...l script returned error exit status 1' In Ubuntu.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md (71%) diff --git a/translated/tech/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md b/published/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md similarity index 71% rename from translated/tech/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md rename to published/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md index b086684614..09cb220cd2 100644 --- a/translated/tech/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md +++ b/published/20150304 Linux Basics--How To Fix 'E-- var cache apt archives subprocess new pre-removal script returned error exit status 1' In Ubuntu.md @@ -1,4 +1,4 @@ -Linux 基础:如何修复Ubuntu上“E: /var/cache/apt/archives/ subprocess new pre-removal script returned error exit status 1 ”的错误 +如何修复 Ubuntu 上“...script returned error exit status 1”的错误 ================================================================================ ![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2014/04/ubuntu-790x558.png) @@ -6,11 +6,11 @@ Linux 基础:如何修复Ubuntu上“E: /var/cache/apt/archives/ subprocess ne > E: /var/cache/apt/archives/ subprocess new pre-removal script returned error exit status 1 -![](https://www.unixmen.com/wp-content/uploads/2015/03/Update-Manager_0011.png) +![](http://www.unixmen.com/wp-content/uploads/2015/03/Update-Manager_0011.png) ### 解决: ### -我google了以下并找到了方法。下面是我解决的方法。 +我google了一下并找到了方法。下面是我解决的方法。 sudo apt-get clean sudo apt-get update && sudo apt-get upgrade @@ -33,11 +33,11 @@ Linux 基础:如何修复Ubuntu上“E: /var/cache/apt/archives/ subprocess ne -------------------------------------------------------------------------------- -via: https://www.unixmen.com/linux-basics-how-to-fix-e-varcacheaptarchives-subprocess-new-pre-removal-script-returned-error-exit-status-1-in-ubuntu/ +via: http://www.unixmen.com/linux-basics-how-to-fix-e-varcacheaptarchives-subprocess-new-pre-removal-script-returned-error-exit-status-1-in-ubuntu/ 作者:[SK][a] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From b6a841abc5a9ef014fd74da3396770bb58bb0bca Mon Sep 17 00:00:00 2001 From: wxy Date: Sat, 9 May 2015 22:46:49 +0800 Subject: [PATCH 100/133] PUB:20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu @wi-cuckoo --- ... and Smart phones Using Prey Tool in Ubuntu.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename {translated/tech => published}/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md (84%) diff --git a/translated/tech/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md b/published/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md similarity index 84% rename from translated/tech/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md rename to published/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md index 2d9a5e4485..168032e2a4 100644 --- a/translated/tech/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md +++ b/published/20150320 Locate Stolen laptops and Smart phones Using Prey Tool in Ubuntu.md @@ -1,14 +1,14 @@ -Ubuntu中,使用Prey定位被盗的笔记本与手机 +使用Prey定位被盗的Ubuntu笔记本与智能电话 =============================================================================== -Prey是一款跨平台的开源工具,可以帮助你找回被盗的笔记本,台式机,平板和智能手机。它已经获得了广泛的流行,声称帮助召回了成百上千台丢失的笔记本和智能手机。Prey的使用特别简单,首先安装在你的笔记本或者手机上,当你的设备不见了,用你的账号登入Prey网站,并且标记你的设备为“丢失”。只要小偷将设备接入网络,Prey就会马上发送设备的地理位置给你。如果你的笔记本有摄像头,它还会拍下小偷。 +Prey是一款跨平台的开源工具,可以帮助你找回被盗的笔记本,台式机,平板和智能手机。它已经获得了广泛的流行,声称帮助找回了成百上千台丢失的笔记本和智能手机。Prey的使用特别简单,首先安装在你的笔记本或者手机上,当你的设备不见了,用你的账号登入Prey网站,并且标记你的设备为“丢失”。只要小偷将设备接入网络,Prey就会马上发送设备的地理位置给你。如果你的笔记本有摄像头,它还会拍下该死的贼。 -Prey占用很小的系统资源;你不会对你的设备运行有任何影响。你也可以配合其他你已经在设备上安装的防盗软件使用。Prey采用安全加密的通道,在你的设备与Prey服务器之间进行数据传输。 +Prey占用很小的系统资源;你不会对你的设备运行有任何影响。你也可以配合其他你已经在设备上安装的防盗软件使用。Prey在你的设备与Prey服务器之间采用安全加密的通道进行数据传输。 ### 在Ubuntu上安装并配置Prey ### -让我们来看看如何在Ubuntu上安装和配置Prey,需要提醒的是,在配置过程中,我们必须到Prey官网进行账号注册。一旦完成上述工作,Prey将会开始监视的设备了。免费的账号最多可以监视三个设备,如果你需要添加更多的设备,你就需要购买合适的的套餐了。 +让我们来看看如何在Ubuntu上安装和配置Prey,需要提醒的是,在配置过程中,我们必须到Prey官网进行账号注册。一旦完成上述工作,Prey将会开始监视你的设备了。免费的账号最多可以监视三个设备,如果你需要添加更多的设备,你就需要购买合适的的套餐了。 -想象一下Prey多么流行与被广泛使用,它现在已经被添加到了官方的软件库中了。这意味着你不要往软件包管理器添加任何PPA。很简单地,登录你的终端,运行以下的命令来安装它: +可以想象Prey多么流行与被广泛使用,它现在已经被添加到了官方的软件库中了。这意味着你不要往软件包管理器添加任何PPA。很简单,登录你的终端,运行以下的命令来安装它: sudo apt-get install prey @@ -54,7 +54,7 @@ Prey有一个明显的不足。它需要你的设备接入互联网才会发送 ### 结论 ### -这是一款小巧,非常有用的安全保护应用,可以让你在一个地方追踪你所有的设备,尽管不完美,但是仍然提供了找回被盗设备的机会。它在Linux,Windows和Mac平台上无缝运行。以上就是Prey完整使用的所有细节。 +这是一款小巧,非常有用的安全保护应用,可以让你在一个地方追踪你所有的设备,尽管不完美,但是仍然提供了找回被盗设备的机会。它在Linux,Windows和Mac平台上无缝运行。以上就是[Prey][2]完整使用的所有细节。 ------------------------------------------------------------------------------- @@ -62,9 +62,10 @@ via: http://linoxide.com/ubuntu-how-to/anti-theft-application-prey-ubuntu/ 作者:[Aun Raza][a] 译者:[wi-cuckoo](https://github.com/wi-cuckoo) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/arunrz/ [1]:https://preyproject.com/ +[2]:https://preyproject.com/plans From e27aefb0c653cdd00e9bc1bc5d78b2079dfb504f Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sun, 10 May 2015 09:04:51 +0800 Subject: [PATCH 101/133] Translating by DongShuaike --- .../tech/20150126 Installing Cisco Packet tracer in Linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md b/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md index edac7a7490..539a624e1f 100644 --- a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md +++ b/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md @@ -1,3 +1,5 @@ +[Translating by DongShuaike] + Installing Cisco Packet tracer in Linux ================================================================================ ![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Main_picture.png) @@ -194,4 +196,4 @@ via: http://www.unixmen.com/installing-cisco-packet-tracer-linux/ [1]:https://www.netacad.com/ [2]:https://www.dropbox.com/s/5evz8gyqqvq3o3v/Cisco%20Packet%20Tracer%206.1.1%20Linux.tar.gz?dl=0 [3]:http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html -[4]:https://www.netacad.com/ \ No newline at end of file +[4]:https://www.netacad.com/ From 44f65f05f0e3d4a34ac869cd0b238639c2b04fd1 Mon Sep 17 00:00:00 2001 From: wwy Date: Sun, 10 May 2015 11:21:41 +0800 Subject: [PATCH 102/133] translated half of the article --- ... command-line network monitors on Linux.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 translated/tech/20150112 What are useful command-line network monitors on Linux.md diff --git a/translated/tech/20150112 What are useful command-line network monitors on Linux.md b/translated/tech/20150112 What are useful command-line network monitors on Linux.md new file mode 100644 index 0000000000..1019173a65 --- /dev/null +++ b/translated/tech/20150112 What are useful command-line network monitors on Linux.md @@ -0,0 +1,65 @@ +ʲôLinuxʵõ +=============================================================================== +κιģҵ˵һҪĹܡĹܿǧ𡣱磬ӻdz繩Ӧһ֣ȫܻŴʹͳƵȡĿ겻ͬʹúܶ಻ͬķʽ񡣱ʹð̽⣬ռͳݣע̽־ȡ + +רõϵͳ36524СʱӣɿضʹʽijЩʽijϵͳԱӦʹһЩ֪ʽʵһ**Linuxʵõ**б + +### ̽ ### + +£·ϲ׽İǵݣչʾݻ߰ͳݡЩ͵IJмӡͬҲܽϸȵļӣDzI/OͷĹ̡ + +1. **dhcpdump**һʽDHCP̽ߣ׽DHCP/ظͨţûѺõķʽʾDHCPЭϢһŲDHCPعϵʵùߡ + +2. **[dsniff][1]**һе̽ߵļϣӵƭͽٳֹܣƺ͸ԡֲ̽ͬϢ롢NSFemailϢַȡ + +3. **[httpry][2]**һHTTP̽ڲ񡢽HTTPͻظģûѺõķʽʾЩϢ + +4. **IPTraf**еͳݲ鿴ʵʱʾ桢Ӳ桢ӿڲ桢Эı/ֽץЭƣҲȫDz˵ġ + +![](https://farm8.staticflickr.com/7519/16055246118_8ea182b413_c.jpg) + +5. **[mysql-sniffer][3]**һץȡMySQLصݰĹߡԿɶķʽʾƵȫ + +6. **[ngrep][4]**籨ִgrepʵʱץȡģʹʽʮƱʽķʽƥ䱨ġһԶ쳣м⡢洢߶ʵʱرģʽĽץȡʵùߡ + +7. **[p0f][5]**һĻڰָ̽ƲɼߣԿɿʶϵͳNATߴá·ԼTCPصԡ + +8. **pktstat**һʽĹߣͨģʾʵʱӴʹԼصЭ飨磬HTTP GET/POSTFTPX11Ϣ + +![](https://farm8.staticflickr.com/7477/16048970999_be60f74952_b.jpg + +9. **Snort**һּԤߣͨЭƥ䣬/ԤԾиָĺšʬ硢㡢 + +10. **tcpdump**һе̽ߣԻڹ˱ʽץȡеıģģڰݡصĴŲ顢debug[ȫ][6]ⷽӦù㷺 + +11. **tshark**һWiresharkڳһʹõʽ̽ߡܲ׽ϵʵʱģûѺõķʽʾݡ + +### //ӿڲļ ### + +УͨΪӦĽ̻ӿռÿÿ̡ÿӿڵͳݡϢԴlibpcapץsysfsںļϵͳЩߵļӳɱܵͣȱļ + +12. **bmon**һеĴ⹤ߣʾֽӿصϢ/͵ֵ/ƽֵͳݣӵʷʹͼ + +![](https://farm9.staticflickr.com/8580/16234265932_87f20c5d17_b.jpg) + +13. **[iftop][7]**һʹü⹤ߣʵʱʾijӵĴʹдʹ򲢻ncursesĽӿпӻԷļǸʹĴ + +14. **nethogs**һ̼ӹߣṩصʵʱ/дʹϢncursesʾԼռôĽ̺á + +15. **netstat**һʾTCP/UDPջӿڷ/ա·ɱЭ/׽ֵͳϢԵйߡջصܡԴʹʱá + +16. **[speedometer][8]**һӻijӿʷ/մʹƣһncurses״ͼʾĹߡ + +![](https://farm8.staticflickr.com/7485/16048971069_31dd573a4f_c.jpg) + +17. **[sysdig][9]**һLinuxϵͳӵͳһԽӿڵϵͳۺdebugߡģԼ/ߡ/صͳݣ/ȡ + +18. **tcptrack**һTCPӼӹߣʾTCPӣԴ/ĿĵIPַ/˿ڡTCP״̬ʹõȡ + +![](https://farm8.staticflickr.com/7507/16047703080_5fdda2e811_b.jpg) + +19. **vnStat**һά˻ڽӿڵʷ/ʹʹͼ磬ǰÿաÿ£Ϊһ̨ػ̣ռ洢ͳݣӿڴʹʺʹֽ + +###  ### + + From 965bc4332b94b6b0ebfb493e3b6101c406e3b3ac Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 10 May 2015 11:38:58 +0800 Subject: [PATCH 103/133] translating --- .../20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md index a8c58b82af..f2ba21d1eb 100644 --- a/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md +++ b/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md @@ -1,3 +1,5 @@ +translating---geekpi + How to Setup OpenERP (Odoo) on CentOS 7.x ================================================================================ Hi everyone, this tutorial is all about how we can setup Odoo (formerly known as OpenERP) on our CentOS 7 Server. Are you thinking to get an awesome ERP (Enterprise Resource Planning) app for your business ?. Then, OpenERP is the best app you are searching as it is a Free and Open Source Software which provides an outstanding features for your business or company. @@ -109,4 +111,4 @@ via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 [a]:http://linoxide.com/author/arunp/ -[1]:https://www.odoo.com/ \ No newline at end of file +[1]:https://www.odoo.com/ From b248e4a27b0ed03ff2af39a326287dd6beb317af Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Sun, 10 May 2015 12:10:56 +0800 Subject: [PATCH 104/133] Update 20150331 Conky--The Ultimate X Based System Monitor Application.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 准备翻译该篇。 --- ... Conky--The Ultimate X Based System Monitor Application.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md b/sources/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md index fdb2648a36..b54d6763d3 100644 --- a/sources/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md +++ b/sources/tech/20150331 Conky--The Ultimate X Based System Monitor Application.md @@ -1,3 +1,5 @@ +FSSlc translating + Conky – The Ultimate X Based System Monitor Application ================================================================================ Conky is a system monitor application written in ‘C’ Programming Language and released under GNU General Public License and BSD License. It is available for Linux and BSD Operating System. The application is X (GUI) based that was originally forked from [Torsmo][1]. @@ -144,4 +146,4 @@ via: http://www.tecmint.com/install-conky-in-ubuntu-debian-fedora/ [3]:http://ubuntuforums.org/showthread.php?t=281865 [4]:http://conky.sourceforge.net/screenshots.html [5]:http://ubuntuforums.org/showthread.php?t=281865/ -[6]:http://conky.sourceforge.net/ \ No newline at end of file +[6]:http://conky.sourceforge.net/ From 154dd4aef9ab91e5a1976bc11676e431368e8294 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 10 May 2015 13:14:50 +0800 Subject: [PATCH 105/133] translated --- ...w to Setup OpenERP (Odoo) on CentOS 7.x.md | 114 ------------------ ...w to Setup OpenERP (Odoo) on CentOS 7.x.md | 112 +++++++++++++++++ 2 files changed, 112 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md create mode 100644 translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md diff --git a/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md deleted file mode 100644 index f2ba21d1eb..0000000000 --- a/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md +++ /dev/null @@ -1,114 +0,0 @@ -translating---geekpi - -How to Setup OpenERP (Odoo) on CentOS 7.x -================================================================================ -Hi everyone, this tutorial is all about how we can setup Odoo (formerly known as OpenERP) on our CentOS 7 Server. Are you thinking to get an awesome ERP (Enterprise Resource Planning) app for your business ?. Then, OpenERP is the best app you are searching as it is a Free and Open Source Software which provides an outstanding features for your business or company. - -[OpenERP][1] is a free and open source traditional OpenERP (Enterprise Resource Planning) app which includes Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management and many more modules included for a better way to boost the productivity and sales. Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps. - -So, here are some quick and easy steps to get your copy of OpenERP installed on your CentOS machine. - -### 1. Installing PostgreSQL ### - -First of all, we'll want to update the packages installed in our CentOS 7 machine to ensure that the latest packages, patches and security are up to date. To update our sytem, we should run the following command in a shell or terminal. - - # yum clean all - # yum update - -Now, we'll want to install PostgreSQL Database System as OpenERP uses PostgreSQL for its database system. To install it, we'll need to run the following command. - - # yum install postgresql postgresql-server postgresql-libs - -![Installing postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-postgresql.png) - -After it is installed, we'll need to initialize the database with the following command - - # postgresql-setup initdb - -![Intializating postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/intializating-postgresql.png) - -We'll then set PostgreSQL to start on every boot and start the PostgreSQL Database server. - - # systemctl enable postgresql - # systemctl start postgresql - -As we haven't set a password for the user "postgresql", we'll want to set it now. - - # su - postgres - $ psql - postgres=# \password postgres - postgres=# \q - # exit - -![setting password postgres](http://blog.linoxide.com/wp-content/uploads/2015/03/setting-password-postgres.png) - -### 2. Configuring Odoo Repository ### - -After our Database Server has been installed correctly, we'll want add EPEL (Extra Packages for Enterprise Linux) to our CentOS server. Odoo (or OpenERP) depends on Python run-time and many other packages that are not included in default standard repository. As such, we'll want to add the Extra Packages for Enterprise Linux (or EPEL) repository support so that Odoo can get the required dependencies. To install, we'll need to run the following command. - - # yum install epel-release - -![Installing EPEL Release](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-epel-release.png) - -Now, after we install EPEL, we'll now add repository of Odoo (OpenERP) using yum-config-manager. - - # yum install yum-utils - - # yum-config-manager --add-repo=https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo - -![Adding OpenERP (Odoo) Repo](http://blog.linoxide.com/wp-content/uploads/2015/03/added-odoo-repo.png) - -### 3. Installing Odoo 8 (OpenERP) ### - -Finally after adding repository of Odoo 8 (OpenERP) in our CentOS 7 machine. We'll can install Odoo 8 (OpenERP) using the following command. - - # yum install -y odoo - -The above command will install odoo along with the necessary dependency packages. - -![Installing odoo or OpenERP](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-odoo.png) - -Now, we'll enable automatic startup of Odoo in every boot and will start our Odoo service using the command below. - - # systemctl enable odoo - # systemctl start odoo - -![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) - -### 4. Allowing Firewall ### - -As Odoo uses port 8069, we'll need to allow firewall for remote access. We can allow firewall to port 8069 by running the following command. - - # firewall-cmd --zone=public --add-port=8069/tcp --permanent - # firewall-cmd --reload - -![Allowing firewall Port](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-firewall-port.png) - -**Note: By default, only connections from localhost are allowed. If we want to allow remote access to PostgreSQL databases, we'll need to add the line shown in the below image to pg_hba.conf configuration file:** - - # nano /var/lib/pgsql/data/pg_hba.conf - -![Allowing Remote Access pgsql](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-remote-access-pgsql.png) - -### 5. Web Interface ### - -Finally, as we have successfully installed our latest Odoo 8 (OpenERP) on our CentOS 7 Server, we can now access our Odoo by browsing to http://ip-address:8069 http://my-site.com:8069 using our favorite web browser. Then, first thing we'll gonna do is we'll create a new database and create a new password for it. Note, the master password is admin by default. Then, we can login to our panel with that username and password. - -![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) - -### Conclusion ### - -Odoo 8 (formerly OpenERP) is the best ERP app available in the world of Open Source. We did an excellent work on installing it because OpenERP is a set of many modules which are essential for a complete ERP app for business and company. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy OpenERP (Odoo 8) :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://www.odoo.com/ diff --git a/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md new file mode 100644 index 0000000000..0cd972b425 --- /dev/null +++ b/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md @@ -0,0 +1,112 @@ +如何在CentOS 7.x中安装OpenERP(Odoo) +================================================================================ +各位好,这篇教程关于的是如何在CentOS 7中安装Odoo(就是我们所知的OpenERP)。你是不是在考虑为你的业务安装一个不错的ERP(企业资源规划)软件?那么OpenERP就是你寻找的最好的程序,因为它是一款为你的商务提供杰出特性的自由开源软件。 + +[OpenERP][1]是一款自由开源的传统的OpenERP(企业资源规划),它包含了开源CRM、网站构建、电子商务、项目管理、计费账务、销售点、人力资源、市场、生产、采购管理以及其他模块用于提高效率及销售。Odoo可以作为独立程序,但是它可以无缝集成因此你可以在安装数个程序后得到一个全功能的开源ERP。 + +因此,下面是在你的CentOS上安装OpenERP的步骤。 + +### 1. 安装 PostgreSQL ### + +首先,首先我们需要更新CentOS 7的软件包来确保是最新的包,补丁和安全更新。要更新我们的系统,我们要在shell下运行下面的命令。 + + # yum clean all + # yum update + +现在我们要安装PostgreSQL,因为OpenERP使用PostgreSQL作为他的数据库。要安装它,我们需要运行下面的命令。 + + # yum install postgresql postgresql-server postgresql-libs + +![Installing postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-postgresql.png) + +、安装完成后,我们需要用下面的命令初始化数据库。 + + # postgresql-setup initdb + +![Intializating postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/intializating-postgresql.png) + +我们接着设置PostgreSQL来使它每次开机启动。 + + # systemctl enable postgresql + # systemctl start postgresql + +因为我们还没有为用户“postgresql”设置密码,我们现在设置。 + + # su - postgres + $ psql + postgres=# \password postgres + postgres=# \q + # exit + +![setting password postgres](http://blog.linoxide.com/wp-content/uploads/2015/03/setting-password-postgres.png) + +### 2. 设置Odoo仓库 ### + +在初始化数据库初始化完成后,我们要添加EPEL(企业版Linux的额外包)到我们的CentOS中。Odoo(或者OpenERP)依赖于Python运行时以及其他包没有包含在标准仓库中。这样我们要位企业版Linux添加额外的包仓库支持来解决Odoo所需要的依赖。要安装完成,我们需要运行下面的命令。 + + # yum install epel-release + +![Installing EPEL Release](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-epel-release.png) + +现在,安装EPEL后,我们现在使用yum-config-manager添加Odoo(OpenERp)的仓库。 + + # yum install yum-utils + + # yum-config-manager --add-repo=https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo + +![Adding OpenERP (Odoo) Repo](http://blog.linoxide.com/wp-content/uploads/2015/03/added-odoo-repo.png) + +### 3. 安装Odoo 8 (OpenERP) ### + +在CentOS 7中添加Odoo 8(OpenERP)的仓库后。我们使用下面的命令来安装Odoo 8(OpenERP)。 + + # yum install -y odoo + +上面的命令会安装odoo以及必须的依赖的包。 + +![Installing odoo or OpenERP](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-odoo.png) + +现在我们使用下面的命令在每次启动后启动Odoo服务。 + + # systemctl enable odoo + # systemctl start odoo + +![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) + +### 4. 防火墙允许 ### + +因为Odoo使用8069端口,我们需要在防火墙中允许远程访问。我们使用下面的命令来在防火墙中允许8069防火墙。 + + # firewall-cmd --zone=public --add-port=8069/tcp --permanent + # firewall-cmd --reload + +![Allowing firewall Port](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-firewall-port.png) + +**注意:默认上,只有本地的连接才允许。如果我们要允许PostgreSQL的远程访问,我们需要在pg_hba.conf添加下面图片中一行** + + # nano /var/lib/pgsql/data/pg_hba.conf + +![Allowing Remote Access pgsql](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-remote-access-pgsql.png) + +### 5. Web接口 ### + +我们已经在CentOS 7中安装了最新的Odoo 8(OpenERP),我们可以在浏览器中输入http://ip-address:8069来访问Odoo。 接着,我们要做的第一件事就是创建一个新的数据库和新的密码。注意,主密码默认是管理员密码。接着,我们可以在面板中输入用户名和密码。 + +![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) + +### 总结 ### + +Odoo 8(OpenERP)是世界上最好的开源ERP程序。我们做了一件出色的工作来安装它因为OpenERP是由许多模块组成的针对商务和公司的完整ERP程序。因此,如果你有任何问题、建议、反馈请在下面的评论栏写下。谢谢你!享受OpenERP(Odoo 8)吧 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ + +作者:[Arun Pyasi][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://www.odoo.com/ From d8c1f6f0a999ab65d2a7461f37e135be5b02bd11 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 10 May 2015 13:16:26 +0800 Subject: [PATCH 106/133] Revert "translated" This reverts commit 154dd4aef9ab91e5a1976bc11676e431368e8294. --- ...w to Setup OpenERP (Odoo) on CentOS 7.x.md | 114 ++++++++++++++++++ ...w to Setup OpenERP (Odoo) on CentOS 7.x.md | 112 ----------------- 2 files changed, 114 insertions(+), 112 deletions(-) create mode 100644 sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md delete mode 100644 translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md diff --git a/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md new file mode 100644 index 0000000000..f2ba21d1eb --- /dev/null +++ b/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md @@ -0,0 +1,114 @@ +translating---geekpi + +How to Setup OpenERP (Odoo) on CentOS 7.x +================================================================================ +Hi everyone, this tutorial is all about how we can setup Odoo (formerly known as OpenERP) on our CentOS 7 Server. Are you thinking to get an awesome ERP (Enterprise Resource Planning) app for your business ?. Then, OpenERP is the best app you are searching as it is a Free and Open Source Software which provides an outstanding features for your business or company. + +[OpenERP][1] is a free and open source traditional OpenERP (Enterprise Resource Planning) app which includes Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management and many more modules included for a better way to boost the productivity and sales. Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps. + +So, here are some quick and easy steps to get your copy of OpenERP installed on your CentOS machine. + +### 1. Installing PostgreSQL ### + +First of all, we'll want to update the packages installed in our CentOS 7 machine to ensure that the latest packages, patches and security are up to date. To update our sytem, we should run the following command in a shell or terminal. + + # yum clean all + # yum update + +Now, we'll want to install PostgreSQL Database System as OpenERP uses PostgreSQL for its database system. To install it, we'll need to run the following command. + + # yum install postgresql postgresql-server postgresql-libs + +![Installing postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-postgresql.png) + +After it is installed, we'll need to initialize the database with the following command + + # postgresql-setup initdb + +![Intializating postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/intializating-postgresql.png) + +We'll then set PostgreSQL to start on every boot and start the PostgreSQL Database server. + + # systemctl enable postgresql + # systemctl start postgresql + +As we haven't set a password for the user "postgresql", we'll want to set it now. + + # su - postgres + $ psql + postgres=# \password postgres + postgres=# \q + # exit + +![setting password postgres](http://blog.linoxide.com/wp-content/uploads/2015/03/setting-password-postgres.png) + +### 2. Configuring Odoo Repository ### + +After our Database Server has been installed correctly, we'll want add EPEL (Extra Packages for Enterprise Linux) to our CentOS server. Odoo (or OpenERP) depends on Python run-time and many other packages that are not included in default standard repository. As such, we'll want to add the Extra Packages for Enterprise Linux (or EPEL) repository support so that Odoo can get the required dependencies. To install, we'll need to run the following command. + + # yum install epel-release + +![Installing EPEL Release](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-epel-release.png) + +Now, after we install EPEL, we'll now add repository of Odoo (OpenERP) using yum-config-manager. + + # yum install yum-utils + + # yum-config-manager --add-repo=https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo + +![Adding OpenERP (Odoo) Repo](http://blog.linoxide.com/wp-content/uploads/2015/03/added-odoo-repo.png) + +### 3. Installing Odoo 8 (OpenERP) ### + +Finally after adding repository of Odoo 8 (OpenERP) in our CentOS 7 machine. We'll can install Odoo 8 (OpenERP) using the following command. + + # yum install -y odoo + +The above command will install odoo along with the necessary dependency packages. + +![Installing odoo or OpenERP](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-odoo.png) + +Now, we'll enable automatic startup of Odoo in every boot and will start our Odoo service using the command below. + + # systemctl enable odoo + # systemctl start odoo + +![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) + +### 4. Allowing Firewall ### + +As Odoo uses port 8069, we'll need to allow firewall for remote access. We can allow firewall to port 8069 by running the following command. + + # firewall-cmd --zone=public --add-port=8069/tcp --permanent + # firewall-cmd --reload + +![Allowing firewall Port](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-firewall-port.png) + +**Note: By default, only connections from localhost are allowed. If we want to allow remote access to PostgreSQL databases, we'll need to add the line shown in the below image to pg_hba.conf configuration file:** + + # nano /var/lib/pgsql/data/pg_hba.conf + +![Allowing Remote Access pgsql](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-remote-access-pgsql.png) + +### 5. Web Interface ### + +Finally, as we have successfully installed our latest Odoo 8 (OpenERP) on our CentOS 7 Server, we can now access our Odoo by browsing to http://ip-address:8069 http://my-site.com:8069 using our favorite web browser. Then, first thing we'll gonna do is we'll create a new database and create a new password for it. Note, the master password is admin by default. Then, we can login to our panel with that username and password. + +![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) + +### Conclusion ### + +Odoo 8 (formerly OpenERP) is the best ERP app available in the world of Open Source. We did an excellent work on installing it because OpenERP is a set of many modules which are essential for a complete ERP app for business and company. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy OpenERP (Odoo 8) :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ + +作者:[Arun Pyasi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://www.odoo.com/ diff --git a/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md deleted file mode 100644 index 0cd972b425..0000000000 --- a/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md +++ /dev/null @@ -1,112 +0,0 @@ -如何在CentOS 7.x中安装OpenERP(Odoo) -================================================================================ -各位好,这篇教程关于的是如何在CentOS 7中安装Odoo(就是我们所知的OpenERP)。你是不是在考虑为你的业务安装一个不错的ERP(企业资源规划)软件?那么OpenERP就是你寻找的最好的程序,因为它是一款为你的商务提供杰出特性的自由开源软件。 - -[OpenERP][1]是一款自由开源的传统的OpenERP(企业资源规划),它包含了开源CRM、网站构建、电子商务、项目管理、计费账务、销售点、人力资源、市场、生产、采购管理以及其他模块用于提高效率及销售。Odoo可以作为独立程序,但是它可以无缝集成因此你可以在安装数个程序后得到一个全功能的开源ERP。 - -因此,下面是在你的CentOS上安装OpenERP的步骤。 - -### 1. 安装 PostgreSQL ### - -首先,首先我们需要更新CentOS 7的软件包来确保是最新的包,补丁和安全更新。要更新我们的系统,我们要在shell下运行下面的命令。 - - # yum clean all - # yum update - -现在我们要安装PostgreSQL,因为OpenERP使用PostgreSQL作为他的数据库。要安装它,我们需要运行下面的命令。 - - # yum install postgresql postgresql-server postgresql-libs - -![Installing postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-postgresql.png) - -、安装完成后,我们需要用下面的命令初始化数据库。 - - # postgresql-setup initdb - -![Intializating postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/intializating-postgresql.png) - -我们接着设置PostgreSQL来使它每次开机启动。 - - # systemctl enable postgresql - # systemctl start postgresql - -因为我们还没有为用户“postgresql”设置密码,我们现在设置。 - - # su - postgres - $ psql - postgres=# \password postgres - postgres=# \q - # exit - -![setting password postgres](http://blog.linoxide.com/wp-content/uploads/2015/03/setting-password-postgres.png) - -### 2. 设置Odoo仓库 ### - -在初始化数据库初始化完成后,我们要添加EPEL(企业版Linux的额外包)到我们的CentOS中。Odoo(或者OpenERP)依赖于Python运行时以及其他包没有包含在标准仓库中。这样我们要位企业版Linux添加额外的包仓库支持来解决Odoo所需要的依赖。要安装完成,我们需要运行下面的命令。 - - # yum install epel-release - -![Installing EPEL Release](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-epel-release.png) - -现在,安装EPEL后,我们现在使用yum-config-manager添加Odoo(OpenERp)的仓库。 - - # yum install yum-utils - - # yum-config-manager --add-repo=https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo - -![Adding OpenERP (Odoo) Repo](http://blog.linoxide.com/wp-content/uploads/2015/03/added-odoo-repo.png) - -### 3. 安装Odoo 8 (OpenERP) ### - -在CentOS 7中添加Odoo 8(OpenERP)的仓库后。我们使用下面的命令来安装Odoo 8(OpenERP)。 - - # yum install -y odoo - -上面的命令会安装odoo以及必须的依赖的包。 - -![Installing odoo or OpenERP](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-odoo.png) - -现在我们使用下面的命令在每次启动后启动Odoo服务。 - - # systemctl enable odoo - # systemctl start odoo - -![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) - -### 4. 防火墙允许 ### - -因为Odoo使用8069端口,我们需要在防火墙中允许远程访问。我们使用下面的命令来在防火墙中允许8069防火墙。 - - # firewall-cmd --zone=public --add-port=8069/tcp --permanent - # firewall-cmd --reload - -![Allowing firewall Port](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-firewall-port.png) - -**注意:默认上,只有本地的连接才允许。如果我们要允许PostgreSQL的远程访问,我们需要在pg_hba.conf添加下面图片中一行** - - # nano /var/lib/pgsql/data/pg_hba.conf - -![Allowing Remote Access pgsql](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-remote-access-pgsql.png) - -### 5. Web接口 ### - -我们已经在CentOS 7中安装了最新的Odoo 8(OpenERP),我们可以在浏览器中输入http://ip-address:8069来访问Odoo。 接着,我们要做的第一件事就是创建一个新的数据库和新的密码。注意,主密码默认是管理员密码。接着,我们可以在面板中输入用户名和密码。 - -![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) - -### 总结 ### - -Odoo 8(OpenERP)是世界上最好的开源ERP程序。我们做了一件出色的工作来安装它因为OpenERP是由许多模块组成的针对商务和公司的完整ERP程序。因此,如果你有任何问题、建议、反馈请在下面的评论栏写下。谢谢你!享受OpenERP(Odoo 8)吧 :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ - -作者:[Arun Pyasi][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://www.odoo.com/ From c25eab63b6a16a414f6926bce1d566e83f14ec28 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 10 May 2015 13:19:28 +0800 Subject: [PATCH 107/133] translated --- ...w to Setup OpenERP (Odoo) on CentOS 7.x.md | 114 ------------------ ...w to Setup OpenERP (Odoo) on CentOS 7.x.md | 112 +++++++++++++++++ 2 files changed, 112 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md create mode 100644 translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md diff --git a/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md deleted file mode 100644 index f2ba21d1eb..0000000000 --- a/sources/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md +++ /dev/null @@ -1,114 +0,0 @@ -translating---geekpi - -How to Setup OpenERP (Odoo) on CentOS 7.x -================================================================================ -Hi everyone, this tutorial is all about how we can setup Odoo (formerly known as OpenERP) on our CentOS 7 Server. Are you thinking to get an awesome ERP (Enterprise Resource Planning) app for your business ?. Then, OpenERP is the best app you are searching as it is a Free and Open Source Software which provides an outstanding features for your business or company. - -[OpenERP][1] is a free and open source traditional OpenERP (Enterprise Resource Planning) app which includes Open Source CRM, Website Builder, eCommerce, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management and many more modules included for a better way to boost the productivity and sales. Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps. - -So, here are some quick and easy steps to get your copy of OpenERP installed on your CentOS machine. - -### 1. Installing PostgreSQL ### - -First of all, we'll want to update the packages installed in our CentOS 7 machine to ensure that the latest packages, patches and security are up to date. To update our sytem, we should run the following command in a shell or terminal. - - # yum clean all - # yum update - -Now, we'll want to install PostgreSQL Database System as OpenERP uses PostgreSQL for its database system. To install it, we'll need to run the following command. - - # yum install postgresql postgresql-server postgresql-libs - -![Installing postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-postgresql.png) - -After it is installed, we'll need to initialize the database with the following command - - # postgresql-setup initdb - -![Intializating postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/intializating-postgresql.png) - -We'll then set PostgreSQL to start on every boot and start the PostgreSQL Database server. - - # systemctl enable postgresql - # systemctl start postgresql - -As we haven't set a password for the user "postgresql", we'll want to set it now. - - # su - postgres - $ psql - postgres=# \password postgres - postgres=# \q - # exit - -![setting password postgres](http://blog.linoxide.com/wp-content/uploads/2015/03/setting-password-postgres.png) - -### 2. Configuring Odoo Repository ### - -After our Database Server has been installed correctly, we'll want add EPEL (Extra Packages for Enterprise Linux) to our CentOS server. Odoo (or OpenERP) depends on Python run-time and many other packages that are not included in default standard repository. As such, we'll want to add the Extra Packages for Enterprise Linux (or EPEL) repository support so that Odoo can get the required dependencies. To install, we'll need to run the following command. - - # yum install epel-release - -![Installing EPEL Release](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-epel-release.png) - -Now, after we install EPEL, we'll now add repository of Odoo (OpenERP) using yum-config-manager. - - # yum install yum-utils - - # yum-config-manager --add-repo=https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo - -![Adding OpenERP (Odoo) Repo](http://blog.linoxide.com/wp-content/uploads/2015/03/added-odoo-repo.png) - -### 3. Installing Odoo 8 (OpenERP) ### - -Finally after adding repository of Odoo 8 (OpenERP) in our CentOS 7 machine. We'll can install Odoo 8 (OpenERP) using the following command. - - # yum install -y odoo - -The above command will install odoo along with the necessary dependency packages. - -![Installing odoo or OpenERP](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-odoo.png) - -Now, we'll enable automatic startup of Odoo in every boot and will start our Odoo service using the command below. - - # systemctl enable odoo - # systemctl start odoo - -![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) - -### 4. Allowing Firewall ### - -As Odoo uses port 8069, we'll need to allow firewall for remote access. We can allow firewall to port 8069 by running the following command. - - # firewall-cmd --zone=public --add-port=8069/tcp --permanent - # firewall-cmd --reload - -![Allowing firewall Port](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-firewall-port.png) - -**Note: By default, only connections from localhost are allowed. If we want to allow remote access to PostgreSQL databases, we'll need to add the line shown in the below image to pg_hba.conf configuration file:** - - # nano /var/lib/pgsql/data/pg_hba.conf - -![Allowing Remote Access pgsql](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-remote-access-pgsql.png) - -### 5. Web Interface ### - -Finally, as we have successfully installed our latest Odoo 8 (OpenERP) on our CentOS 7 Server, we can now access our Odoo by browsing to http://ip-address:8069 http://my-site.com:8069 using our favorite web browser. Then, first thing we'll gonna do is we'll create a new database and create a new password for it. Note, the master password is admin by default. Then, we can login to our panel with that username and password. - -![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) - -### Conclusion ### - -Odoo 8 (formerly OpenERP) is the best ERP app available in the world of Open Source. We did an excellent work on installing it because OpenERP is a set of many modules which are essential for a complete ERP app for business and company. So, if you have any questions, suggestions, feedback please write them in the comment box below. Thank you ! Enjoy OpenERP (Odoo 8) :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ - -作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://www.odoo.com/ diff --git a/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md new file mode 100644 index 0000000000..0cd972b425 --- /dev/null +++ b/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md @@ -0,0 +1,112 @@ +如何在CentOS 7.x中安装OpenERP(Odoo) +================================================================================ +各位好,这篇教程关于的是如何在CentOS 7中安装Odoo(就是我们所知的OpenERP)。你是不是在考虑为你的业务安装一个不错的ERP(企业资源规划)软件?那么OpenERP就是你寻找的最好的程序,因为它是一款为你的商务提供杰出特性的自由开源软件。 + +[OpenERP][1]是一款自由开源的传统的OpenERP(企业资源规划),它包含了开源CRM、网站构建、电子商务、项目管理、计费账务、销售点、人力资源、市场、生产、采购管理以及其他模块用于提高效率及销售。Odoo可以作为独立程序,但是它可以无缝集成因此你可以在安装数个程序后得到一个全功能的开源ERP。 + +因此,下面是在你的CentOS上安装OpenERP的步骤。 + +### 1. 安装 PostgreSQL ### + +首先,首先我们需要更新CentOS 7的软件包来确保是最新的包,补丁和安全更新。要更新我们的系统,我们要在shell下运行下面的命令。 + + # yum clean all + # yum update + +现在我们要安装PostgreSQL,因为OpenERP使用PostgreSQL作为他的数据库。要安装它,我们需要运行下面的命令。 + + # yum install postgresql postgresql-server postgresql-libs + +![Installing postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-postgresql.png) + +、安装完成后,我们需要用下面的命令初始化数据库。 + + # postgresql-setup initdb + +![Intializating postgresql](http://blog.linoxide.com/wp-content/uploads/2015/03/intializating-postgresql.png) + +我们接着设置PostgreSQL来使它每次开机启动。 + + # systemctl enable postgresql + # systemctl start postgresql + +因为我们还没有为用户“postgresql”设置密码,我们现在设置。 + + # su - postgres + $ psql + postgres=# \password postgres + postgres=# \q + # exit + +![setting password postgres](http://blog.linoxide.com/wp-content/uploads/2015/03/setting-password-postgres.png) + +### 2. 设置Odoo仓库 ### + +在初始化数据库初始化完成后,我们要添加EPEL(企业版Linux的额外包)到我们的CentOS中。Odoo(或者OpenERP)依赖于Python运行时以及其他包没有包含在标准仓库中。这样我们要位企业版Linux添加额外的包仓库支持来解决Odoo所需要的依赖。要安装完成,我们需要运行下面的命令。 + + # yum install epel-release + +![Installing EPEL Release](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-epel-release.png) + +现在,安装EPEL后,我们现在使用yum-config-manager添加Odoo(OpenERp)的仓库。 + + # yum install yum-utils + + # yum-config-manager --add-repo=https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo + +![Adding OpenERP (Odoo) Repo](http://blog.linoxide.com/wp-content/uploads/2015/03/added-odoo-repo.png) + +### 3. 安装Odoo 8 (OpenERP) ### + +在CentOS 7中添加Odoo 8(OpenERP)的仓库后。我们使用下面的命令来安装Odoo 8(OpenERP)。 + + # yum install -y odoo + +上面的命令会安装odoo以及必须的依赖的包。 + +![Installing odoo or OpenERP](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-odoo.png) + +现在我们使用下面的命令在每次启动后启动Odoo服务。 + + # systemctl enable odoo + # systemctl start odoo + +![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) + +### 4. 防火墙允许 ### + +因为Odoo使用8069端口,我们需要在防火墙中允许远程访问。我们使用下面的命令来在防火墙中允许8069防火墙。 + + # firewall-cmd --zone=public --add-port=8069/tcp --permanent + # firewall-cmd --reload + +![Allowing firewall Port](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-firewall-port.png) + +**注意:默认上,只有本地的连接才允许。如果我们要允许PostgreSQL的远程访问,我们需要在pg_hba.conf添加下面图片中一行** + + # nano /var/lib/pgsql/data/pg_hba.conf + +![Allowing Remote Access pgsql](http://blog.linoxide.com/wp-content/uploads/2015/03/allowing-remote-access-pgsql.png) + +### 5. Web接口 ### + +我们已经在CentOS 7中安装了最新的Odoo 8(OpenERP),我们可以在浏览器中输入http://ip-address:8069来访问Odoo。 接着,我们要做的第一件事就是创建一个新的数据库和新的密码。注意,主密码默认是管理员密码。接着,我们可以在面板中输入用户名和密码。 + +![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) + +### 总结 ### + +Odoo 8(OpenERP)是世界上最好的开源ERP程序。我们做了一件出色的工作来安装它因为OpenERP是由许多模块组成的针对商务和公司的完整ERP程序。因此,如果你有任何问题、建议、反馈请在下面的评论栏写下。谢谢你!享受OpenERP(Odoo 8)吧 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/ + +作者:[Arun Pyasi][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://www.odoo.com/ From 0041c53ea229e643551fadb067dc0df6b9f8f6f3 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Sun, 10 May 2015 14:47:59 +0800 Subject: [PATCH 108/133] translated wi-cuckoo --- ...x bridge with Network Manager on Ubuntu.md | 97 ------------------ ...x bridge with Network Manager on Ubuntu.md | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md create mode 100644 translated/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md diff --git a/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md b/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md deleted file mode 100644 index a557ee9244..0000000000 --- a/sources/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md +++ /dev/null @@ -1,97 +0,0 @@ -translating wi-cuckoo -Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu -================================================================================ -> **Question**: I need to set up a Linux bridge on my Ubuntu box to share a NIC with several other virtual machines or containers created on the box. I am currently using Network Manager on my Ubuntu, so preferrably I would like to configure a bridge using Network Manager. How can I do that? - -Network bridge is a hardware equipment used to interconnect two or more Layer-2 network segments, so that network devices on different segments can talk to each other. A similar bridging concept is needed within a Linux host, when you want to interconnect multiple VMs or Ethernet interfaces within a host. That is one use case of a software Linux bridge. - -There are several different ways to configure a Linux bridge. For example, in a headless server environment, you can use [brctl][1] to manually configure a bridge. In desktop environment, bridge support is available in Network Manager. Let's examine how to configure a bridge with Network Manager. - -### Requirement ### - -To avoid [any issue][2], it is recommended that you have Network Manager 0.9.9 and higher, which is the case for Ubuntu 15.04 and later. - - $ apt-cache show network-manager | grep Version - ----------- - - Version: 0.9.10.0-4ubuntu15.1 - Version: 0.9.10.0-4ubuntu15 - -### Create a Bridge ### - -The easiest way to create a bridge with Network Manager is via nm-connection-editor. This GUI tool allows you to configure a bridge in easy-to-follow steps. - -To start, invoke nm-connection-editor. - - $ nm-connection-editor - -The editor window will show you a list of currently configured network connections. Click on "Add" button in the top right to create a bridge. - -![](https://farm9.staticflickr.com/8781/17139502730_c3ca920f7f.jpg) - -Next, choose "Bridge" as a connection type. - -![](https://farm9.staticflickr.com/8873/17301102406_4f75133391_z.jpg) - -Now it's time to configure a bridge, including its name and bridged connection(s). With no other bridges created, the default bridge interface will be named bridge0. - -Recall that the goal of creating a bridge is to share your Ethernet interface via the bridge. So you need to add the Ethernet interface to the bridge. This is achieved by adding a new "bridged connection" in the GUI. Click on "Add" button. - -![](https://farm9.staticflickr.com/8876/17327069755_52f1d81f37_z.jpg) - -Choose "Ethernet" as a connection type. - -![](https://farm9.staticflickr.com/8832/17326664591_632a9001da_z.jpg) - -In "Device MAC address" field, choose the interface that you want to enslave into the bridge. In this example, assume that this interface is eth0. - -![](https://farm9.staticflickr.com/8842/17140820559_07a661f30c_z.jpg) - -Click on "General" tab, and enable both checkboxes that say "Automatically connect to this network when it is available" and "All users may connect to this network". - -![](https://farm8.staticflickr.com/7776/17325199982_801290e172_z.jpg) - -Save the change. - -Now you will see a new slave connection created in the bridge. - -![](https://farm8.staticflickr.com/7674/17119624667_6966b1147e_z.jpg) - -Click on "General" tab of the bridge, and make sure that top-most two checkboxes are enabled. - -![](https://farm8.staticflickr.com/7715/17301102276_4266a1e41d_z.jpg) - -Go to "IPv4 Settings" tab, and configure either DHCP or static IP address for the bridge. Note that you should use the same IPv4 settings as the enslaved Ethernet interface eth0. In this example, we assume that eth0 is configured via DHCP. Thus choose "Automatic (DHCP)" here. If eth0 is assigned a static IP address, you should assign the same IP address to the bridge. - -![](https://farm8.staticflickr.com/7737/17140820469_99955cf916_z.jpg) - -Finally, save the bridge settings. - -Now you will see an additional bridge connection created in "Network Connections" window. You no longer need a previously-configured wired connection for the enslaved interface eth0. So go ahead and delete the original wired connection. - -![](https://farm9.staticflickr.com/8700/17140820439_272a6d5c4e.jpg) - -At this point, the bridge connection will automatically be activated. You will momentarily lose a connection, since the IP address assigned to eth0 is taken over by the bridge. Once an IP address is assigned to the bridge, you will be connected back to your Ethernet interface via the bridge. You can confirm that by checking "Network" settings. - -![](https://farm8.staticflickr.com/7742/17325199902_9ceb67ddc1_c.jpg) - -Also, check the list of available interfaces. As mentioned, the bridge interface must have taken over whatever IP address was possessed by your Ethernet interface. - -![](https://farm8.staticflickr.com/7717/17327069605_6143f1bd6a_b.jpg) - -That's it, and now the bridge is ready to use! - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/configure-linux-bridge-network-manager-ubuntu.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://ask.xmodulo.com/author/nanni -[1]:http://xmodulo.com/how-to-configure-linux-bridge-interface.html -[2]:https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1273201 diff --git a/translated/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md b/translated/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md new file mode 100644 index 0000000000..ae99e20261 --- /dev/null +++ b/translated/tech/20150506 Linux FAQs with Answers--How to configure a Linux bridge with Network Manager on Ubuntu.md @@ -0,0 +1,98 @@ +nux常见问题解答--如何在Ubuntu上使用网络管理配置一个Linux网桥 +=============================================================================== +> **Question**: 我需要在我的Ubuntu主机上建立一个Linux网桥,共享一个NIC给其他一些虚拟主机或者主机上创建的容器。我目前正在Ubunut上使用网络管理,所以最好>能使用网络管理来配置一个网桥。我该怎么做? + + +网桥是一个硬件装备,用来内部连接两个或多个数据链路层(OSI七层模型中第二层),所以使得不同段上的网络设备可以互相访问。当你想要内连多个虚拟机器或者一个>主机里的以太接口时,就需要在Linux主机里有一个类似桥接的概念。 + +有很多的方法来配置一个Linux网桥。举个例子,在一个无中心的服务器环境里,你可以使用[brct][1]手动地配置一个网桥。在桌面环境下,在网络管理里有建立网桥支持 +。那就让我们测试一下如何用网络管理配置一个网桥吧。 + +### 要求 ### + +为了避免[任何问题][2],建议你的网络管理版本为0.9.9或者更高,这主要为了配合Ubuntu15.05或者更新的版本。 + + $ apt-cache show network-manager | grep Version + +---------- + + Version: 0.9.10.0-4ubuntu15.1 + Version: 0.9.10.0-4ubuntu15 + +### 创建一个网桥 ### + +使用网络管理创建网桥最简单的方式就是通过nm-connection-editor。这款GUI(图形用户界面)的工具允许你傻瓜式地配置一个网桥。 + +首先,启动nm-connection-editor。 + + $ nm-connection-editor + +该编辑器的窗口会显示给你一个列表,关于目前配置好的网络连接。点击右上角的“Click”按钮,创建一个网桥。 + +![](https://farm9.staticflickr.com/8781/17139502730_c3ca920f7f.jpg) + +接下来,选择“Bridge”作为连接类型。 + +![](https://farm9.staticflickr.com/8873/17301102406_4f75133391_z.jpg) + +现在,开始配置网桥,包括它的名字和桥接。如果没有其他网桥被创建,那么默认的网桥接口会被命名为bridge0。 + +回顾一下,创建网桥的目的是为了通过网桥共享你的以太网卡接口。所以你需要添加以太网卡接口到网桥。在图形界面添加一个新的“bridged connection”可以实现上述目的。点击“Add”按钮。 + +![](https://farm9.staticflickr.com/8876/17327069755_52f1d81f37_z.jpg) + +选择“Ethernet”作为连接类型。 + +![](https://farm9.staticflickr.com/8832/17326664591_632a9001da_z.jpg) + +在“Device MAC address”区域,选择你想要控制的接口到bridge里。本例中,假设接口是eth0。 + +![](https://farm9.staticflickr.com/8842/17140820559_07a661f30c_z.jpg) + +点击“General”标签,并且选中两个复选框,分别是“Automatically connect to this network when it is available”和“All users may connect to this network”。 + +![](https://farm8.staticflickr.com/7776/17325199982_801290e172_z.jpg) + +保存更改。 + +现在,你会在网桥里看见一个新的从属连接被建立。 + +![](https://farm8.staticflickr.com/7674/17119624667_6966b1147e_z.jpg) + +点击网桥的“General”标签,并且确保最上面的两个复选框被选中了。 + +![](https://farm8.staticflickr.com/7715/17301102276_4266a1e41d_z.jpg) + +切换到“IPv4 Setting”标签,为网桥配置DHCP或者是静态IP地址。注意,你应该使用相同的IPv4设定作为从属的以太网卡接口eth0。本例中,我们假设eth0是用过DHCP配置的。因此,此处选择“Automatic(DHCP)”。如果eth0被指定了一个静态IP地址,那么你应该指定相同的IP地址给网桥。 + +![](https://farm8.staticflickr.com/7737/17140820469_99955cf916_z.jpg) + +最后,保存网桥的设置。 + +现在,你会看见一个额外的网桥连接被创建在“Network Connection”窗口里。你不再需要一个预先配置的有线连接,为着从属的eth0接口。所以去删除原来的有线连接吧。 + +![](https://farm9.staticflickr.com/8700/17140820439_272a6d5c4e.jpg) + +这时候,网桥连接会被自动激活。你将会暂时失去一个连接,从指定给eth0的IP地址被网桥接管。一旦IP地址指定给了网桥,你将会连接回你的以太网卡接口,通过网桥。你可以通过“Network”设置确认一下。 + +![](https://farm8.staticflickr.com/7742/17325199902_9ceb67ddc1_c.jpg) + +同时,检查可用的接口。提醒一下,网桥接口必须已经取代了任何通过你的以太网卡接口的IP地址。 + +![](https://farm8.staticflickr.com/7717/17327069605_6143f1bd6a_b.jpg) + +就这么多了,现在,网桥已经可以用了。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/configure-linux-bridge-network-manager-ubuntu.html + +作者:[Dan Nanni][a] +译者:[wi-cuckoo](https://github.com/wi-cuckoo) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://ask.xmodulo.com/author/nanni +[1]:http://xmodulo.com/how-to-configure-linux-bridge-interface.html +[2]:https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1273201 From db7cb7fd6a5693800e47951c8ac66679157c1595 Mon Sep 17 00:00:00 2001 From: Vic020 Date: Sun, 10 May 2015 21:05:26 +0800 Subject: [PATCH 109/133] Translated --- ...To Install Visual Studio Code On Ubuntu.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md b/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md index 8912e3c06c..afc8a267f4 100644 --- a/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md +++ b/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md @@ -1,57 +1,56 @@ - Vic020 - -How To Install Visual Studio Code On Ubuntu +在Ubuntu中安装Visual Studio Code ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Install-Visual-Studio-Code-in-Ubuntu.jpeg) -Microsoft has done the unexpected by [releasing Visual Studio Code][1] for all major desktop platforms that includes Linux as well. If you are a web developer who happens to be using Ubuntu, you can **easily install Visual Studio Code in Ubuntu**. +微软意外地[发布了Visual Studio Code][1],并支持主要的桌面平台,当然包括linux。如果你是一名需要在ubuntu工作的web开发人员,你可以**非常轻松的安装Visual Studio Code**。 -We will be using [Ubuntu Make][2] for installing Visual Studio Code in Ubuntu. Ubuntu Make, previously known as Ubuntu Developer Tools Center, is a command line utility that allows you to easily install various development tools, languages and IDEs. You can easily [install Android Studio][3] and other popular IDEs such as Eclipse with Ubuntu Make. In this tutorial we shall see **how to install Visual Studio Code in Ubuntu with Ubuntu Make**. +我将要使用[Ubuntu Make][2]来安装Visual Studio Code。Ubuntu Make,就是以前的Ubuntu开发者工具中心,是一个命令行工具,帮助用户快速安装各种开发工具、语言和IDE。也可以使用Ubuntu Make轻松[安装Android Studio][3] 和其他IDE,如Eclipse。本文将展示**如何在Ubuntu中使用Ubuntu Make安装Visual Studio Code**。(译注:也可以直接去微软官网下载安装包) -### Install Microsoft Visual Studio Code in Ubuntu ### +### 安装微软Visual Studio Code ### -Before installing Visual Studio Code, we need to install Ubuntu Make first. Though Ubuntu Make is available in Ubuntu 15.04 repository, **you’ll need Ubuntu Make 0.7 for Visual Studio**. You can get the latest Ubuntu Make by using the official PPA. The PPA is available for Ubuntu 14.04, 14.10 and 15.04. Also, it **is only available for 64 bit platform**. +开始之前,首先需要安装Ubuntu Make。虽然Ubuntu Make存在Ubuntu15.04官方库中,**但是需要Ubuntu Make 0.7以上版本才能安装Visual Studio**。所以,需要通过官方PPA更新到最新的Ubuntu Make。此PPA支持Ubuntu 14.04, 14.10 和 15.04。 +注意,**仅支持64位版本**。 -Open a terminal and use the following commands to install Ubuntu Make via official PPA: +打开终端,使用下列命令,通过官方PPA来安装Ubuntu Make: sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make sudo apt-get update sudo apt-get install ubuntu-make -Once you have installed Ubuntu Make, use the command below to install Visual Studio Code: +安装Ubuntu Make完后,接着使用下列命令安装Visual Studio Code: umake web visual-studio-code -You’ll be asked to provide a path where it will be installed: +安装过程中,将会询问安装路径,如下图: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Visual_Studio_Code_Ubuntu_1.jpeg) -After throwing a whole lot of terms and conditions, it will ask for your permission to install Visual Studio Code. Press ‘a’ at this screen: +在抛出一堆状态和条件后,它会询问你是否确认安装Visual Studio Code。输入‘a’来确定: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Visual_Studio_Code_Ubuntu_2.jpeg) -Once you do that it will start downloading and installing it. Once it is installed, you can see that Visual Studio Code icon has already been locked to the Unity Launcher. Just click on it to run it. This is how Visual Studio Code looks like in Ubuntu 15.04 Unity: +确定之后,安装程序会开始下载并安装。安装完成后,你可以发现Visual Studio Code 图标已经出现在了Unity启动器上。点击图标开始运行!下图是Ubuntu 15.04 Unity的截图: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Visual_Studio_Code_Ubuntu.jpeg) -### Uninstall Visual Studio Code from Ubuntu ### +### 卸载Visual Studio Code### -To uninstall Visual Studio Code, we’ll use the same command line tool umake. Just use the following command in terminal: +卸载Visual Studio Code,同样使用Ubuntu Make命令。如下: umake web visual-studio-code --remove -If you do not want to use Ubuntu Make, you can install Visual Studio Code by downloading the files from Microsoft: +如果你不打算使用Ubuntu Make,也可以通过微软官方下载安装文件。 -- [Download Visual Studio Code for Linux][4] +- [下载Visual Studio Code Linux版][4] -See, how easy it is to install Visual Studio Code in Ubuntu, all thanks to Ubuntu Make. I hope this tutorial helped you. Feel free to drop a comment if you have any questions or suggestions. +怎样!是不是超级简单就可以安装Visual Studio Code,这都归功于Ubuntu Make。我希望这篇文章能帮助到你。如果您有任何问题或建议,欢迎给我留言。 -------------------------------------------------------------------------------- via: http://itsfoss.com/install-visual-studio-code-ubuntu/ 作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) +译者:[Vic020/VicYu](http://vicyu.net) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 05faf18bdca12b05e83894584a62a77d5193cf70 Mon Sep 17 00:00:00 2001 From: Vic020 Date: Sun, 10 May 2015 21:09:11 +0800 Subject: [PATCH 110/133] Moved --- .../tech/20150504 How To Install Visual Studio Code On Ubuntu.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20150504 How To Install Visual Studio Code On Ubuntu.md (100%) diff --git a/sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md b/translated/tech/20150504 How To Install Visual Studio Code On Ubuntu.md similarity index 100% rename from sources/tech/20150504 How To Install Visual Studio Code On Ubuntu.md rename to translated/tech/20150504 How To Install Visual Studio Code On Ubuntu.md From 47c5f5111210d0a646c2d37c97014c278c535194 Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 10 May 2015 21:22:24 +0800 Subject: [PATCH 111/133] PUB:20150504 How To Install Visual Studio Code On Ubuntu @Vic020 --- ...150504 How To Install Visual Studio Code On Ubuntu.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename {translated/tech => published}/20150504 How To Install Visual Studio Code On Ubuntu.md (86%) diff --git a/translated/tech/20150504 How To Install Visual Studio Code On Ubuntu.md b/published/20150504 How To Install Visual Studio Code On Ubuntu.md similarity index 86% rename from translated/tech/20150504 How To Install Visual Studio Code On Ubuntu.md rename to published/20150504 How To Install Visual Studio Code On Ubuntu.md index afc8a267f4..b3bb071dc5 100644 --- a/translated/tech/20150504 How To Install Visual Studio Code On Ubuntu.md +++ b/published/20150504 How To Install Visual Studio Code On Ubuntu.md @@ -2,13 +2,14 @@ ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Install-Visual-Studio-Code-in-Ubuntu.jpeg) -微软意外地[发布了Visual Studio Code][1],并支持主要的桌面平台,当然包括linux。如果你是一名需要在ubuntu工作的web开发人员,你可以**非常轻松的安装Visual Studio Code**。 +微软令人意外地[发布了Visual Studio Code][1],并支持主要的桌面平台,当然包括linux。如果你是一名需要在ubuntu工作的web开发人员,你可以**非常轻松的安装Visual Studio Code**。 我将要使用[Ubuntu Make][2]来安装Visual Studio Code。Ubuntu Make,就是以前的Ubuntu开发者工具中心,是一个命令行工具,帮助用户快速安装各种开发工具、语言和IDE。也可以使用Ubuntu Make轻松[安装Android Studio][3] 和其他IDE,如Eclipse。本文将展示**如何在Ubuntu中使用Ubuntu Make安装Visual Studio Code**。(译注:也可以直接去微软官网下载安装包) ### 安装微软Visual Studio Code ### 开始之前,首先需要安装Ubuntu Make。虽然Ubuntu Make存在Ubuntu15.04官方库中,**但是需要Ubuntu Make 0.7以上版本才能安装Visual Studio**。所以,需要通过官方PPA更新到最新的Ubuntu Make。此PPA支持Ubuntu 14.04, 14.10 和 15.04。 + 注意,**仅支持64位版本**。 打开终端,使用下列命令,通过官方PPA来安装Ubuntu Make: @@ -25,7 +26,7 @@ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Visual_Studio_Code_Ubuntu_1.jpeg) -在抛出一堆状态和条件后,它会询问你是否确认安装Visual Studio Code。输入‘a’来确定: +在抛出一堆要求和条件后,它会询问你是否确认安装Visual Studio Code。输入‘a’来确定: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Visual_Studio_Code_Ubuntu_2.jpeg) @@ -51,12 +52,12 @@ via: http://itsfoss.com/install-visual-studio-code-ubuntu/ 作者:[Abhishek][a] 译者:[Vic020/VicYu](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://itsfoss.com/author/abhishek/ -[1]:http://www.geekwire.com/2015/microsofts-visual-studio-expands-to-mac-and-linux-with-new-code-development-tool/ +[1]:https://linux.cn/article-5376-1.html [2]:https://wiki.ubuntu.com/ubuntu-make [3]:http://itsfoss.com/install-android-studio-ubuntu-linux/ [4]:https://code.visualstudio.com/Download From b4d3a5f7b559401c4b69772760d1fd514f25cea3 Mon Sep 17 00:00:00 2001 From: wwy Date: Sun, 10 May 2015 22:06:24 +0800 Subject: [PATCH 112/133] finished translation, need review by myself --- ... command-line network monitors on Linux.md | 200 ++++++++++++------ 1 file changed, 135 insertions(+), 65 deletions(-) diff --git a/translated/tech/20150112 What are useful command-line network monitors on Linux.md b/translated/tech/20150112 What are useful command-line network monitors on Linux.md index 1019173a65..72beed7eb1 100644 --- a/translated/tech/20150112 What are useful command-line network monitors on Linux.md +++ b/translated/tech/20150112 What are useful command-line network monitors on Linux.md @@ -1,65 +1,135 @@ -ʲôLinuxʵõ -=============================================================================== -κιģҵ˵һҪĹܡĹܿǧ𡣱磬ӻdz繩Ӧһ֣ȫܻŴʹͳƵȡĿ겻ͬʹúܶ಻ͬķʽ񡣱ʹð̽⣬ռͳݣע̽־ȡ - -רõϵͳ36524СʱӣɿضʹʽijЩʽijϵͳԱӦʹһЩ֪ʽʵһ**Linuxʵõ**б - -### ̽ ### - -£·ϲ׽İǵݣչʾݻ߰ͳݡЩ͵IJмӡͬҲܽϸȵļӣDzI/OͷĹ̡ - -1. **dhcpdump**һʽDHCP̽ߣ׽DHCP/ظͨţûѺõķʽʾDHCPЭϢһŲDHCPعϵʵùߡ - -2. **[dsniff][1]**һе̽ߵļϣӵƭͽٳֹܣƺ͸ԡֲ̽ͬϢ롢NSFemailϢַȡ - -3. **[httpry][2]**һHTTP̽ڲ񡢽HTTPͻظģûѺõķʽʾЩϢ - -4. **IPTraf**еͳݲ鿴ʵʱʾ桢Ӳ桢ӿڲ桢Эı/ֽץЭƣҲȫDz˵ġ - -![](https://farm8.staticflickr.com/7519/16055246118_8ea182b413_c.jpg) - -5. **[mysql-sniffer][3]**һץȡMySQLصݰĹߡԿɶķʽʾƵȫ - -6. **[ngrep][4]**籨ִgrepʵʱץȡģʹʽʮƱʽķʽƥ䱨ġһԶ쳣м⡢洢߶ʵʱرģʽĽץȡʵùߡ - -7. **[p0f][5]**һĻڰָ̽ƲɼߣԿɿʶϵͳNATߴá·ԼTCPصԡ - -8. **pktstat**һʽĹߣͨģʾʵʱӴʹԼصЭ飨磬HTTP GET/POSTFTPX11Ϣ - -![](https://farm8.staticflickr.com/7477/16048970999_be60f74952_b.jpg - -9. **Snort**һּԤߣͨЭƥ䣬/ԤԾиָĺšʬ硢㡢 - -10. **tcpdump**һе̽ߣԻڹ˱ʽץȡеıģģڰݡصĴŲ顢debug[ȫ][6]ⷽӦù㷺 - -11. **tshark**һWiresharkڳһʹõʽ̽ߡܲ׽ϵʵʱģûѺõķʽʾݡ - -### //ӿڲļ ### - -УͨΪӦĽ̻ӿռÿÿ̡ÿӿڵͳݡϢԴlibpcapץsysfsںļϵͳЩߵļӳɱܵͣȱļ - -12. **bmon**һеĴ⹤ߣʾֽӿصϢ/͵ֵ/ƽֵͳݣӵʷʹͼ - -![](https://farm9.staticflickr.com/8580/16234265932_87f20c5d17_b.jpg) - -13. **[iftop][7]**һʹü⹤ߣʵʱʾijӵĴʹдʹ򲢻ncursesĽӿпӻԷļǸʹĴ - -14. **nethogs**һ̼ӹߣṩصʵʱ/дʹϢncursesʾԼռôĽ̺á - -15. **netstat**һʾTCP/UDPջӿڷ/ա·ɱЭ/׽ֵͳϢԵйߡջصܡԴʹʱá - -16. **[speedometer][8]**һӻijӿʷ/մʹƣһncurses״ͼʾĹߡ - -![](https://farm8.staticflickr.com/7485/16048971069_31dd573a4f_c.jpg) - -17. **[sysdig][9]**һLinuxϵͳӵͳһԽӿڵϵͳۺdebugߡģԼ/ߡ/صͳݣ/ȡ - -18. **tcptrack**һTCPӼӹߣʾTCPӣԴ/ĿĵIPַ/˿ڡTCP״̬ʹõȡ - -![](https://farm8.staticflickr.com/7507/16047703080_5fdda2e811_b.jpg) - -19. **vnStat**һά˻ڽӿڵʷ/ʹʹͼ磬ǰÿաÿ£Ϊһ̨ػ̣ռ洢ͳݣӿڴʹʺʹֽ - -###  ### - - +ʲôLinuxʵõ +=============================================================================== +κιģҵ˵һҪĹܡĹܿǧ𡣱磬ӻdz繩Ӧһ֣ȫܻŴʹͳƵȡĿ겻ͬʹúܶ಻ͬķʽ񡣱ʹð̽⣬ռͳݣע̽־ȡ + +רõϵͳ36524СʱӣɿضʹʽijЩʽijϵͳԱӦʹһЩ֪ʽʵһ**Linuxʵõ**б + +### ̽ ### + +£·ϲ׽İǵݣչʾݻ߰ͳݡЩ͵IJмӡͬҲܽϸȵļӣDzI/OͷĹ̡ + +1. **dhcpdump**һʽDHCP̽ߣ׽DHCP/ظͨţûѺõķʽʾDHCPЭϢһŲDHCPعϵʵùߡ + +2. **[dsniff][1]**һе̽ߵļϣӵƭͽٳֹܣƺ͸ԡֲ̽ͬϢ롢NSFemailϢַȡ + +3. **[httpry][2]**һHTTP̽ڲ񡢽HTTPͻظģûѺõķʽʾЩϢ + +4. **IPTraf**еͳݲ鿴ʵʱʾ桢Ӳ桢ӿڲ桢Эı/ֽץЭƣҲȫDz˵ġ + +![](https://farm8.staticflickr.com/7519/16055246118_8ea182b413_c.jpg) + +5. **[mysql-sniffer][3]**һץȡMySQLصݰĹߡԿɶķʽʾƵȫ + +6. **[ngrep][4]**籨ִgrepʵʱץȡģʹʽʮƱʽķʽƥ䱨ġһԶ쳣м⡢洢߶ʵʱرģʽĽץȡʵùߡ + +7. **[p0f][5]**һĻڰָ̽ƲɼߣԿɿʶϵͳNATߴá·ԼTCPصԡ + +8. **pktstat**һʽĹߣͨģʾʵʱӴʹԼصЭ飨磬HTTP GET/POSTFTPX11Ϣ + +![](https://farm8.staticflickr.com/7477/16048970999_be60f74952_b.jpg + +9. **Snort**һּԤߣͨЭƥ䣬/ԤԾиָĺšʬ硢㡢 + +10. **tcpdump**һе̽ߣԻڹ˱ʽץȡеıģģڰݡصĴŲ顢debug[ȫ][6]ⷽӦù㷺 + +11. **tshark**һWiresharkڳһʹõʽ̽ߡܲ׽ϵʵʱģûѺõķʽʾݡ + +### //ӿڲļ ### + +УͨΪӦĽ̻ӿռÿÿ̡ÿӿڵͳݡϢԴlibpcapץsysfsںļϵͳЩߵļӳɱܵͣȱļ + +12. **bmon**һеĴ⹤ߣʾֽӿصϢ/͵ֵ/ƽֵͳݣӵʷʹͼ + +![](https://farm9.staticflickr.com/8580/16234265932_87f20c5d17_b.jpg) + +13. **[iftop][7]**һʹü⹤ߣʵʱʾijӵĴʹдʹ򲢻ncursesĽӿпӻԷļǸʹĴ + +14. **nethogs**һ̼ӹߣṩصʵʱ/дʹϢncursesʾԼռôĽ̺á + +15. **netstat**һʾTCP/UDPջӿڷ/ա·ɱЭ/׽ֵͳϢԵйߡջصܡԴʹʱá + +16. **[speedometer][8]**һӻijӿʷ/մʹƣһncurses״ͼʾĹߡ + +![](https://farm8.staticflickr.com/7485/16048971069_31dd573a4f_c.jpg) + +17. **[sysdig][9]**һLinuxϵͳӵͳһԽӿڵϵͳۺdebugߡģԼ/ߡ/صͳݣ/ȡ + +18. **tcptrack**һTCPӼӹߣʾTCPӣԴ/ĿĵIPַ/˿ڡTCP״̬ʹõȡ + +![](https://farm8.staticflickr.com/7507/16047703080_5fdda2e811_b.jpg) + +19. **vnStat**һά˻ڽӿڵʷ/ʹʹͼ磬ǰÿաÿ£Ϊһ̨ػ̣ռ洢ͳݣӿڴʹʺʹֽ + +###  ### + +ͬǰᵽıļߣĹڼʱġע롱̽ݵУһռӦķӦĿ··ɹʹõĴʡʱϵͳûȱݵȡ + +20. **[dnsyo][10]**һDNS⹤ߣܹ1500ͬĿŽȺDNSѯDNSֳ߼DNSõʱá + +21. **[iperf][11]**һTCP/UDPߣܹôͨ䵥˫TCP/UDP̽õĴڼгЭջʱáһֽ[netperf][12]ӵиĹܼõͳݡ + +22. **[netcat][13]/socat**ͨõdebugߣԶTCP/UDP׽ֽждͨijűں˶紫˿ڽм + +23. **nmap**һж˿ɨ緢ֹߡһTCP/UDPɨ輼ҿŵĶ˿ڡڱڵIJϵͳ鱾©Ϊάӳʱá[zmap][14]һƵƷһڻΧɨ蹤ߡ + +24. pingһõԹߡͨICMPechoreplyĽǿʵ书ܡڲ·ɵRTTԼԶϵͳǽʱápingıиƯĽ棨磬[noping][15]Э֧֣磬[hping][16]߲̽磬[fping][17] + +![](https://farm8.staticflickr.com/7466/15612665344_a4bb665a5b_c.jpg) + +25. **[sprobe][18]**һʽƶϱԶIPַƿйߡʹTCPֻƿڼΧܺ·صʱá + +26. **traceroute**һִܷӱصԶĵ·/ת·緢ֹߡͨTTL̽ⱨģռм·ɵICMPϢŲӻ·صʱátracerouteıиõRTTͳƹܣ磬[mtr][19] + +### Ӧ־ ### + +£ضķӦΪĿ꣨磬webݿɷĵͨ־ͼ⡣ǰᵽļĹܹòͼ + +27. **[GoAccess][20]**һApacheNginxĽʽ鿴ڻȡ־չʾշ󡢿ͻ˲ϵͳͻλáͻڵĶʵʱͳϢԹʽʾ + +![](https://farm8.staticflickr.com/7518/16209185266_da6c5c56eb_c.jpg) + +28. **[mtop][21]**һMySQL/MariaDBмԽǰݿдIJѯпӻŻMySQLܡгʱá + +![](https://farm8.staticflickr.com/7472/16047570248_bc996795f2_c.jpg) + +29. **[ngxtop][22]**һNginxApache⹤ߣܹtopָĽӻWebͨwebIJѯ־ļռijĿĵػͳϢ + +### Conclusion ### + +ƪУչʾʽ⹤ߣײİļ߲Ӧó֪Ǹʲôһ£ѡĸʹһ¡һһ߲ΪÿʹõͨõĽһõϵͳԱӦܹǸ߸ʺϵǰĻϣбԴ + +ӭͨظĽбݣ + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/useful-command-line-network-monitors-linux.html + +ߣ[Dan Nanni][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[a]:http://xmodulo.com/author/nanni +[1]:http://www.monkey.org/~dugsong/dsniff/ +[2]:http://xmodulo.com/monitor-http-traffic-command-line-linux.html +[3]:https://github.com/zorkian/mysql-sniffer +[4]:http://ngrep.sourceforge.net/ +[5]:http://lcamtuf.coredump.cx/p0f3/ +[6]:http://xmodulo.com/recommend/firewallbook +[7]:http://xmodulo.com/how-to-install-iftop-on-linux.html +[8]:https://excess.org/speedometer/ +[9]:http://xmodulo.com/monitor-troubleshoot-linux-server-sysdig.html +[10]:http://xmodulo.com/check-dns-propagation-linux.html +[11]:https://iperf.fr/ +[12]:http://www.netperf.org/netperf/ +[13]:http://xmodulo.com/useful-netcat-examples-linux.html +[14]:https://zmap.io/ +[15]:http://noping.cc/ +[16]:http://www.hping.org/ +[17]:http://fping.org/ +[18]:http://sprobe.cs.washington.edu/ +[19]:http://xmodulo.com/better-alternatives-basic-command-line-utilities.html#mtr_link +[20]:http://goaccess.io/ +[21]:http://mtop.sourceforge.net/ +[22]:http://xmodulo.com/monitor-nginx-web-server-command-line-real-time.html From d8fc58edf937ce84afa7e284a11bed16e9a9ead5 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Sun, 10 May 2015 22:13:08 +0800 Subject: [PATCH 113/133] Update 20150126 iptraf--A TCP or UDP Network Monitoring Utility.md --- .../20150126 iptraf--A TCP or UDP Network Monitoring Utility.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md index 1d5d3cd0d9..01a9dc18f9 100644 --- a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md +++ b/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md @@ -1,3 +1,5 @@ +[Trnslating by DongShuaike] + iptraf: A TCP/UDP Network Monitoring Utility ================================================================================ [iptraf][1] is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others. From f464725c8776afef3f85bf774fab5a7ffde1ff7c Mon Sep 17 00:00:00 2001 From: wxy Date: Sun, 10 May 2015 22:55:09 +0800 Subject: [PATCH 114/133] PUB:20150506 How to Securely Store Passwords and Api Keys Using Vault MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wwy-hust 翻译的基本不错,不过有些英语习惯的倒装语句,应该根据中文习惯和理解修改过来。:>加油~ --- ...tore Passwords and Api Keys Using Vault.md | 164 ++++++++++++++++++ ...tore Passwords and Api Keys Using Vault.md | 161 ----------------- 2 files changed, 164 insertions(+), 161 deletions(-) create mode 100644 published/20150506 How to Securely Store Passwords and Api Keys Using Vault.md delete mode 100644 translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md diff --git a/published/20150506 How to Securely Store Passwords and Api Keys Using Vault.md b/published/20150506 How to Securely Store Passwords and Api Keys Using Vault.md new file mode 100644 index 0000000000..e2073d0b18 --- /dev/null +++ b/published/20150506 How to Securely Store Passwords and Api Keys Using Vault.md @@ -0,0 +1,164 @@ +如何使用Vault安全的存储密码和API密钥 +======================================================================= +Vault是用来安全的获取秘密信息的工具,它可以保存密码、API密钥、证书等信息。Vault提供了一个统一的接口来访问秘密信息,其具有健壮的访问控制机制和丰富的事件日志。 + +对关键信息的授权访问是一个困难的问题,尤其是当有许多用户角色,并且用户请求不同的关键信息时,例如用不同权限登录数据库的登录配置,用于外部服务的API密钥,SOA通信的证书等。当保密信息由不同的平台进行管理,并使用一些自定义的配置时,情况变得更糟,因此,安全的存储、管理审计日志几乎是不可能的。但Vault为这种复杂情况提供了一个解决方案。 + +### 突出特点 ### + +**数据加密**:Vault能够在不存储数据的情况下对数据进行加密、解密。开发者们便可以存储加密后的数据而无需开发自己的加密技术,Vault还允许安全团队自定义安全参数。 + +**安全密码存储**:Vault在将秘密信息(API密钥、密码、证书)存储到持久化存储之前对数据进行加密。因此,如果有人偶尔拿到了存储的数据,这也没有任何意义,除非加密后的信息能被解密。 + +**动态密码**:Vault可以随时为AWS、SQL数据库等类似的系统产生密码。比如,如果应用需要访问AWS S3 桶,它向Vault请求AWS密钥对,Vault将给出带有租期的所需秘密信息。一旦租用期过期,这个秘密信息就不再存储。 + +**租赁和更新**:Vault给出的秘密信息带有租期,一旦租用期过期,它便立刻收回秘密信息,如果应用仍需要该秘密信息,则可以通过API更新租用期。 + +**撤销**:在租用期到期之前,Vault可以撤销一个秘密信息或者一个秘密信息树。 + +### 安装Vault ### + +有两种方式来安装使用Vault。 + +**1. 预编译的Vault二进制** 能用于所有的Linux发行版,下载地址如下,下载之后,解压并将它放在系统PATH路径下,以方便调用。 + +- [下载预编译的二进制 Vault (32-bit)][1] +- [下载预编译的二进制 Vault (64-bit)][2] +- [下载预编译的二进制 Vault (ARM)][3] + +![wget binary](http://blog.linoxide.com/wp-content/uploads/2015/04/wget-binary.png) + +*下载相应的预编译的Vault二进制版本。* + +![vault](http://blog.linoxide.com/wp-content/uploads/2015/04/unzip.png) + +*解压下载到本地的二进制版本。* + +祝贺你!您现在可以使用Vault了。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/04/vault.png) + +**2. 从源代码编译**是另一种在系统中安装Vault的方式。在安装Vault之前需要安装GO和GIT。 + +在 **Redhat系统中安装GO** 使用下面的指令: + + sudo yum install go + +在 **Debin系统中安装GO** 使用下面的指令: + + sudo apt-get install golang + +或者 + + sudo add-apt-repository ppa:gophers/go + + sudo apt-get update + + sudo apt-get install golang-stable + +在 **Redhat系统中安装GIT** 使用下面的命令: + + sudo yum install git + +在 **Debian系统中安装GIT** 使用下面的命令: + + sudo apt-get install git + +一旦GO和GIT都已被安装好,我们便可以开始从源码编译安装Vault。 + +> 将下列的Vault仓库拷贝至GOPATH + + https://github.com/hashicorp/vault + +> 测试下面的文件是否存在,如果它不存在,那么Vault没有被克隆到合适的路径。 + + $GOPATH/src/github.com/hashicorp/vault/main.go + +> 执行下面的指令来编译Vault,并将二进制文件放到系统bin目录下。 + + make dev + +![path](http://blog.linoxide.com/wp-content/uploads/2015/04/installation4.png) + +### 一份Vault入门教程 ### + +我们已经编制了一份Vault的官方交互式教程,并带有它在SSH上的输出信息。 + +**概述** + +这份教程包括下列步骤: + +- 初始化并启封您的Vault +- 在Vault中对您的请求授权 +- 读写秘密信息 +- 密封您的Vault + +#### **初始化您的Vault** + +首先,我们需要为您初始化一个Vault的工作实例。在初始化过程中,您可以配置Vault的密封行为。简单起见,现在使用一个启封密钥来初始化Vault,命令如下: + + vault init -key-shares=1 -key-threshold=1 + +您会注意到Vault在这里输出了几个密钥。不要清除您的终端,这些密钥在后面的步骤中会使用到。 + +![Initializing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Initializing-SSH.png) + +#### **启封您的Vault** + +当一个Vault服务器启动时,它是密封的状态。在这种状态下,Vault被配置为知道物理存储在哪里及如何存取它,但不知道如何对其进行解密。Vault使用加密密钥来加密数据。这个密钥由"主密钥"加密,主密钥不保存。解密主密钥需要入口密钥。在这个例子中,我们使用了一个入口密钥来解密这个主密钥。 + + vault unseal + +![Unsealing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Unsealing-SSH.png) + +####**为您的请求授权** + +在执行任何操作之前,连接的客户端必须是被授权的。授权的过程是检验一个人或者机器是否如其所申明的那样具有正确的身份。这个身份用在向Vault发送请求时。为简单起见,我们将使用在步骤2中生成的root令牌,这个信息可以回滚终端屏幕看到。使用一个客户端令牌进行授权: + + vault auth + +![Authorize SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Authorize-SSH.png) + +####**读写保密信息** + +现在Vault已经被设置妥当,我们可以开始读写默认挂载的秘密后端里面的秘密信息了。写在Vault中的秘密信息首先被加密,然后被写入后端存储中。后端存储机制绝不会看到未加密的信息,并且也没有在Vault之外解密的需要。 + + vault write secret/hello value=world + +当然,您接下来便可以读这个保密信息了: + + vault read secret/hello + +![RW_SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/RW_SSH.png) + +####**密封您的Vault** + +还有一个用I来密封Vault的API。它将丢掉现在的加密密钥并需要另一个启封过程来恢复它。密封仅需要一个拥有root权限的操作者。这是一种罕见的"打破玻璃过程"的典型部分。 + +这种方式中,如果检测到一个入侵,Vault数据将会立刻被锁住,以便最小化损失。如果不能访问到主密钥碎片的话,就不能再次获取数据。 + + vault seal + +![Seal Vault SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Seal-Vault-SSH.png) + +这便是入门教程的结尾。 + +### 总结 ### + +Vault是一个非常有用的应用,它提供了一个可靠且安全的存储关键信息的方式。另外,它在存储前加密关键信息、审计日志维护、以租期的方式获取秘密信息,且一旦租用期过期它将立刻收回秘密信息。Vault是平台无关的,并且可以免费下载和安装。要发掘Vault的更多信息,请访问其[官方网站][4]。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/how-tos/secure-secret-store-vault/ + +作者:[Aun Raza][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunrz/ +[1]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_386.zip +[2]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_amd64.zip +[3]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_arm.zip +[4]:https://vaultproject.io/ diff --git a/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md b/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md deleted file mode 100644 index e9e54ac43d..0000000000 --- a/translated/tech/20150506 How to Securely Store Passwords and Api Keys Using Vault.md +++ /dev/null @@ -1,161 +0,0 @@ -如何使用Vault安全的存储密码和API密钥 -======================================================================= -Vault是用来安全的获取秘密信息的工具。他可以保存密码、API密钥、证书等信息。Vault通过强访问控制机制和高扩展性的事件日志提供了一个统一的接口来访问秘密信息。 - -对关键信息的授权访问是一个困难的问题,尤其是当有许多用户角色和用户请求不同的关键信息,例如用不同权限登录数据库的细节,对外服务的API密钥,面向服务架构通信的证书等。当保密信息由不同的平台进行管理,并使用一些自定义的配置时,情况变得更糟,因此,安全的存储、管理审计日志几乎是不可能的。但Vault为这种复杂情况提供了一个解决方案。 - -### 突出特点 ### - -数据加密:Vault能够在不存储数据的情况下对数据进行加密、解密。开发者们便可以存储加密后的数据而无需开发自己的加密技术,Vault还允许安全团队自定义安全参数。 - -**安全密码存储**:Vault在将秘密信息(API密钥、密码、证书)存储到持久化存储之前对数据进行加密。因此,如果有人偶尔拿到了获取存储的数据的权限,这也没有任何意义,除非加密后的信息被解密。 - -**动态密码**:Vault为AWS、SQL数据库类似的系统按需产生密码。如果应用需要获得AWS S3的桶,比如,它向Vault请求AWS密钥对,Vault将授予需要的秘密信息一段租用期时间。一旦租用期过期,这个秘密信息将变得不可用。 - -**租赁和更新**:Vault以租用期为限制授予秘密信息,一旦租用期过期,它便立刻收回保密信息,如果应用仍需要保密信息,则可以通过API更新租用期。 - -**撤销**:在租用期到期之前,Vault可以撤销一个秘密信息或者一个秘密信息树。 - -### 安装Vault ### - -有两种方式来安装使用Vault。 - -**1. 预编译的Vault二进制** 能用于所有的Linux发行版,下载地址如下,一旦下载完成,解压并将它放在系统PATH路径下,以方便调用。 - -- [Download Precompiled Vault Binary (32-bit)][1] -- [Download Precompiled Vault Binary (64-bit)][2] -- [Download Precompiled Vault Binary (ARM)][3] - -下载相应的预编译的Vault二进制版本。 - -![wget binary](http://blog.linoxide.com/wp-content/uploads/2015/04/wget-binary.png) - -解压下载到本地的二进制版本。 - -![vault](http://blog.linoxide.com/wp-content/uploads/2015/04/unzip.png) - -祝贺!您现在可以使用Vault了。 - -![](http://blog.linoxide.com/wp-content/uploads/2015/04/vault.png) - -**2. 从源代码编译** 是另一种在系统中安装Vault的方式。在安装Vault之前需要安装GO和GIT。 - -在 **Redhat系统中安装GO** 使用下面的指令。 - - sudo yum install go - -在 **Debin系统中安装GO** 使用下面的指令。 - - sudo apt-get install golang - -或者 - - sudo add-apt-repository ppa:gophers/go - - sudo apt-get update - - sudo apt-get install golang-stable - -在 **Redhat系统中安装GIT** 使用下面的命令。 - - sudo yum install git - -在 **Debian系统中安装GIT** 使用下面的命令。 - - sudo apt-get install git - -一旦GO和GIT都已被安装好,我们便可以开始从源码编译安装Vault。 - -> 将下列的Vault仓库拷贝至GOPATH - - https://github.com/hashicorp/vault - -> 测试下面的文件是否存在,如果它不存在,那么Vault没有被克隆到合适的路径。 - - $GOPATH/src/github.com/hashicorp/vault/main.go - -> 执行下面的指令来编译Vault,并将二进制文件放到系统bin目录下。 - - make dev - -![path](http://blog.linoxide.com/wp-content/uploads/2015/04/installation4.png) - -### 一份Vault入门教程 ### - -我们已经编译了Vault的官方交互式教程,并将它输出到SSH。 - -**概述** - -这份教程包括下列步骤: - -- 初始化,开启您的Vault -- 在Vault中对您的请求授权 -- 读写秘密信息 -- 密封您的Vault - -**初始化您的Vault** - -首先,我们需要为您初始化一个Vault的工作实例。在初始化过程中,您可以配置Vault的密封行为。简单起见,现在使用一个非密封密钥来初始化Vault。 - - vault init -key-shares=1 -key-threshold=1 - -您会注意到Vault在这里打印出了许多的密钥。不要清除您的终端,这些密钥在后面的步骤中会使用到。 - -![Initializing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Initializing-SSH.png) - -**开启您的Vault** - -当一个Vault服务器启动时,它是密封的状态。在这种状态下,Vault被配置为知道在哪里和如何存取物理存储,但不知道如何对其进行解密。Vault使用加密密钥来加密数据。这个密钥由"主密钥"加密,主密钥不保存。解密主密钥需要一个碎片的阈值。在这个例子中,我们使用一个碎片来解密这个主密钥。 - - vault unseal - -![Unsealing SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Unsealing-SSH.png) - -**为您的请求授权** - -在执行任何操作之前,连接的客户端应该被授权。授权的过程是检验一个人或者机器是不是像他们描述的那样,被赋予了身份。这个身份在向Vault发送请求时被使用。为简单起见,我们将使用在步骤2中生成的root令牌。这个输出会以滚动模式出现。使用一个客户端令牌进行授权: - - vault auth - -![Authorize SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Authorize-SSH.png) - -**读写保密信息** - -现在Vault已经被设置妥当,我们可以开始使用默认的密码后端读写秘密信息了。写在Vault中的秘密信息首先被加密,然后被写入后端的存储。后端存储机制不会查看未加密的值,并且没有无需Vault即可解密的方法。 - - vault write secret/hello value=world - -当然,您接下来便可以读这个保密信息了: - - vault read secret/hello - -![RW_SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/RW_SSH.png) - -**密封您的Vault** - -有一个API来密封Vault。它将丢掉加密密钥并需要其他未密封的过程来恢复它。密封仅需要一个拥有root权限的操作者。这通常是一种罕见的"打破玻璃过程"的一部分。这种方式中,如果有一个检测到的入侵,Vault数据将会立刻被锁住,以便最小化损失。如果没有获取到主密钥碎片,数据不会被再次获取。 - - vault seal - -![Seal Vault SSH](http://blog.linoxide.com/wp-content/uploads/2015/04/Seal-Vault-SSH.png) - -这便是入门教程的结尾。 - -### 总结 ### - -Vault是一个非常有用的应用,它提供了一个可靠且安全的存储关键信息的方式。另外,它在存储前加密关键信息,维护他的审计日志,并以租用期的方式获取秘密信息,且一旦租用期过期,它将立刻收回秘密信息。Vault是平台独立的,并且可以免费下载和安装。要发掘Vault的更多信息,请访问官方网站。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/how-tos/secure-secret-store-vault/ - -作者:[Aun Raza][a] -译者:[wwy-hust](https://github.com/wwy-hust) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunrz/ -[1]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_386.zip -[2]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_amd64.zip -[3]:https://dl.bintray.com/mitchellh/vault/vault_0.1.0_linux_arm.zip From 0528ca534d5df96518e18fce7899e464f96649f8 Mon Sep 17 00:00:00 2001 From: wwy Date: Sun, 10 May 2015 23:03:45 +0800 Subject: [PATCH 115/133] finish review, need merge into LCTT master --- ... command-line network monitors on Linux.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/translated/tech/20150112 What are useful command-line network monitors on Linux.md b/translated/tech/20150112 What are useful command-line network monitors on Linux.md index 72beed7eb1..37eea5a91b 100644 --- a/translated/tech/20150112 What are useful command-line network monitors on Linux.md +++ b/translated/tech/20150112 What are useful command-line network monitors on Linux.md @@ -1,16 +1,16 @@ -ʲôLinuxʵõ +ʲôLinuxʵõʽӹ =============================================================================== -κιģҵ˵һҪĹܡĹܿǧ𡣱磬ӻdz繩Ӧһ֣ȫܻŴʹͳƵȡĿ겻ͬʹúܶ಻ͬķʽ񡣱ʹð̽⣬ռͳݣע̽־ȡ +κιģҵ˵һҪĹܡӵĿǧ𡣱磬ӻĿDZ֤ڵ繩ӦȫܽŲ顢ʹͳƵȡĿ겻ͬʹúܶ಻ͬķʽ񡣱ʹð̽ʹͳݣע̽־ȡ -רõϵͳ36524СʱӣɿضʹʽijЩʽijϵͳԱӦʹһЩ֪ʽʵһ**Linuxʵõ**б +רõϵͳ36524СʱӣɿضʹʽijЩʽijáϵͳԱӦʹһЩ֪ʽľһ**Linuxʵõ**б ### ̽ ### -£·ϲ׽İǵݣչʾݻ߰ͳݡЩ͵IJмӡͬҲܽϸȵļӣDzI/OͷĹ̡ +£ӹ·ϲ׽İǵݣչʾݻ߰ͳݡЩײмӡͬҲܽϸȵļӣDzI/OͷĹ̡ -1. **dhcpdump**һʽDHCP̽ߣ׽DHCP/ظͨţûѺõķʽʾDHCPЭϢһŲDHCPعϵʵùߡ +1. **dhcpdump**һʽDHCP̽ߣ׽DHCP/ظûѺõķʽʾDHCPЭϢһŲDHCPعϵʵùߡ -2. **[dsniff][1]**һе̽ߵļϣӵƭͽٳֹܣƺ͸ԡֲ̽ͬϢ롢NSFemailϢַȡ +2. **[dsniff][1]**һе̽߼ϣӵƭͽٳֹܣ͸ԡ̽Ϣ롢NSFemailϢַȡ 3. **[httpry][2]**һHTTP̽ڲ񡢽HTTPͻظģûѺõķʽʾЩϢ @@ -20,57 +20,57 @@ 5. **[mysql-sniffer][3]**һץȡMySQLصݰĹߡԿɶķʽʾƵȫ -6. **[ngrep][4]**籨ִgrepʵʱץȡģʹʽʮƱʽķʽƥ䱨ġһԶ쳣м⡢洢߶ʵʱرģʽĽץȡʵùߡ +6. **[ngrep][4]**籨ִgrepʵʱץȡģʽʮƱʽķʽƥ䱨ġһԶ쳣м⡢洢߶ʵʱضģʽĽץȡʵùߡ -7. **[p0f][5]**һĻڰָ̽ƲɼߣԿɿʶϵͳNATߴá·ԼTCPصԡ +7. **[p0f][5]**һĻڰָ̽ƲɼߣԿɿʶϵͳNATߴá·ԼTCPصԡ -8. **pktstat**һʽĹߣͨģʾʵʱӴʹԼصЭ飨磬HTTP GET/POSTFTPX11Ϣ +8. **pktstat**һʽĹߣͨʵʱģʾӴʹԼصЭ飨磬HTTP GET/POSTFTPX11Ϣ ![](https://farm8.staticflickr.com/7477/16048970999_be60f74952_b.jpg 9. **Snort**һּԤߣͨЭƥ䣬/ԤԾиָĺšʬ硢㡢 -10. **tcpdump**һе̽ߣԻڹ˱ʽץȡеıģģڰݡصĴŲ顢debug[ȫ][6]ⷽӦù㷺 +10. **tcpdump**һе̽ߣԻڹ˱ʽץȡеıģģڰԱڰķصĴŲ顢debug[ȫ][6]ⷽӦù㷺 11. **tshark**һWiresharkڳһʹõʽ̽ߡܲ׽ϵʵʱģûѺõķʽʾݡ ### //ӿڲļ ### -УͨΪӦĽ̻ӿռÿÿ̡ÿӿڵͳݡϢԴlibpcapץsysfsںļϵͳЩߵļӳɱܵͣȱļ +УͨΪ̻ӿռÿÿ̡ÿӿڵͳݡϢԴlibpcapץsysfsںļϵͳЩߵļӳɱܵͣȱļ 12. **bmon**һеĴ⹤ߣʾֽӿصϢ/͵ֵ/ƽֵͳݣӵʷʹͼ ![](https://farm9.staticflickr.com/8580/16234265932_87f20c5d17_b.jpg) -13. **[iftop][7]**һʹü⹤ߣʵʱʾijӵĴʹдʹ򲢻ncursesĽӿпӻԷļǸʹĴ +13. **[iftop][7]**һʹü⹤ߣʵʱʾijӵĴʹдʹͨncursesĽӿпӻԷļĸĴ 14. **nethogs**һ̼ӹߣṩصʵʱ/дʹϢncursesʾԼռôĽ̺á -15. **netstat**һʾTCP/UDPջӿڷ/ա·ɱЭ/׽ֵͳϢԵйߡջصܡԴʹʱá +15. **netstat**һʾTCP/UDPջͳϢĹߡӿڷ/ա·ɱЭ/׽ֵͳϢԡջصܡԴʹʱá -16. **[speedometer][8]**һӻijӿʷ/մʹƣһncurses״ͼʾĹߡ +16. **[speedometer][8]**һӻijӿڷ/յĴʹõʷƣһncurses״ͼʾĹߡ ![](https://farm8.staticflickr.com/7485/16048971069_31dd573a4f_c.jpg) -17. **[sysdig][9]**һLinuxϵͳӵͳһԽӿڵϵͳۺdebugߡģԼ/ߡ/صͳݣ/ȡ +17. **[sysdig][9]**һLinuxϵͳӵͳһԽӿڵϵͳۺdebugߡģԼ߻ߡ/صͳݣ/ȡ -18. **tcptrack**һTCPӼӹߣʾTCPӣԴ/ĿĵIPַ/˿ڡTCP״̬ʹõȡ +18. **tcptrack**һTCPӼӹߣʾTCPӣԴ/ĿIPַ/˿ڡTCP״̬ʹõȡ ![](https://farm8.staticflickr.com/7507/16047703080_5fdda2e811_b.jpg) -19. **vnStat**һά˻ڽӿڵʷ/ʹʹͼ磬ǰÿաÿ£Ϊһ̨ػ̣ռ洢ͳݣӿڴʹʺʹֽ +19. **vnStat**һά˻ڽӿڵʷ/ʹͼ磬ǰÿաÿ£Ϊһ̨ػ̣ռ洢ͳݣӿڴʹʺʹֽ -###  ### +### ### ͬǰᵽıļߣĹڼʱġע롱̽ݵУһռӦķӦĿ··ɹʹõĴʡʱϵͳûȱݵȡ -20. **[dnsyo][10]**һDNS⹤ߣܹ1500ͬĿŽȺDNSѯDNSֳ߼DNSõʱá +20. **[dnsyo][10]**һDNS⹤ߣܹ1500ͬĿŽȺDNSѯDNSŲDNSõʱá -21. **[iperf][11]**һTCP/UDPߣܹôͨ䵥˫TCP/UDP̽õĴڼгЭջʱáһֽ[netperf][12]ӵиĹܼõͳݡ +21. **[iperf][11]**һTCP/UDPߣܹôͨ䵥˫TCP/UDP̽õĴڼгЭջʱáһ[netperf][12]ıӵиĹܼõͳݡ 22. **[netcat][13]/socat**ͨõdebugߣԶTCP/UDP׽ֽждͨijűں˶紫˿ڽм -23. **nmap**һж˿ɨ緢ֹߡһTCP/UDPɨ輼ҿŵĶ˿ڡڱڵIJϵͳ鱾©Ϊάӳʱá[zmap][14]һƵƷһڻΧɨ蹤ߡ +23. **nmap**һж˿ɨ緢ֹߡɻTCP/UDPɨ輼ҿŵĶ˿ڡڱڵIJϵͳ鱾©߽ӳʱá[zmap][14]һƵƷһڻΧɨ蹤ߡ 24. pingһõԹߡͨICMPechoreplyĽǿʵ书ܡڲ·ɵRTTԼԶϵͳǽʱápingıиƯĽ棨磬[noping][15]Э֧֣磬[hping][16]߲̽磬[fping][17] @@ -78,25 +78,25 @@ 25. **[sprobe][18]**һʽƶϱԶIPַƿйߡʹTCPֻƿڼΧܺ·صʱá -26. **traceroute**һִܷӱصԶĵ·/ת·緢ֹߡͨTTL̽ⱨģռм·ɵICMPϢŲӻ·صʱátracerouteıиõRTTͳƹܣ磬[mtr][19] +26. **traceroute**һִܷӱصԶĵ·/ת·緢ֹߡTTL̽ⱨģռм·ɵICMPϢŲӻ·صʱátracerouteıиõRTTͳƹܣ磬[mtr][19] -### Ӧ־ ### +### Ӧ־ ### -£ضķӦΪĿ꣨磬webݿɷĵͨ־ͼ⡣ǰᵽļĹܹòͼ +£ضķӦóΪĿ꣨磬webݿɷĵͨ־ͼ⡣ǰᵽļĹܹӦòͼ -27. **[GoAccess][20]**һApacheNginxĽʽ鿴ڻȡ־չʾշ󡢿ͻ˲ϵͳͻλáͻڵĶʵʱͳϢԹʽʾ +27. **[GoAccess][20]**һApacheNginxĽʽ鿴ڶԻȡ־ķչʾշ󡢿ͻ˲ϵͳͻλáͻڵĶʵʱͳϢԹʽʾ ![](https://farm8.staticflickr.com/7518/16209185266_da6c5c56eb_c.jpg) -28. **[mtop][21]**һMySQL/MariaDBмԽǰݿдIJѯпӻŻMySQLܡгʱá +28. **[mtop][21]**һMySQL/MariaDBмԽǰݿдIJѯԿӻķʽʾŻMySQLܡгʱá ![](https://farm8.staticflickr.com/7472/16047570248_bc996795f2_c.jpg) -29. **[ngxtop][22]**һNginxApache⹤ߣܹtopָĽӻWebͨwebIJѯ־ļռijĿĵػͳϢ +29. **[ngxtop][22]**һNginxApache⹤ߣܹtopָķʽӻʾWebwebIJѯ־ļռijĿĵػͳϢ ### Conclusion ### -ƪУչʾʽ⹤ߣײİļ߲Ӧó֪Ǹʲôһ£ѡĸʹһ¡һһ߲ΪÿʹõͨõĽһõϵͳԱӦܹǸ߸ʺϵǰĻϣбԴ +ƪУչʾʽ⹤ߣײİļ߲Ӧó֪Ǹߵһ£ѡĸʹһ¡һһ߲ΪÿʹõͨõĽһõϵͳԱӦܾĸ߸ʺϵǰĻϣбԴ ӭͨظĽбݣ From cba0d0e294be62733c5822bc1e46576f3da8636e Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Sun, 10 May 2015 23:21:41 +0800 Subject: [PATCH 116/133] remote the origin english article --- ... command-line network monitors on Linux.md | 137 ------------------ 1 file changed, 137 deletions(-) delete mode 100644 sources/tech/20150112 What are useful command-line network monitors on Linux.md diff --git a/sources/tech/20150112 What are useful command-line network monitors on Linux.md b/sources/tech/20150112 What are useful command-line network monitors on Linux.md deleted file mode 100644 index 8f6b9596d1..0000000000 --- a/sources/tech/20150112 What are useful command-line network monitors on Linux.md +++ /dev/null @@ -1,137 +0,0 @@ -translating by wwy-hust - -What are useful command-line network monitors on Linux -================================================================================ -Network monitoring is a critical IT function for businesses of all sizes. The goal of network monitoring can vary. For example, the monitoring activity can be part of long-term network provisioning, security protection, performance troubleshooting, network usage accounting, and so on. Depending on its goal, network monitoring is done in many different ways, such as performing packet-level sniffing, collecting flow-level statistics, actively injecting probes into the network, parsing server logs, etc. - -While there are many dedicated network monitoring systems capable of 24/7/365 monitoring, you can also leverage command-line network monitors in certain situations, where a dedicated monitor is an overkill. If you are a system admin, you are expected to have hands-on experience with some of well known CLI network monitors. Here is a list of **popular and useful command-line network monitors on Linux**. - -### Packet-Level Sniffing ### - -In this category, monitoring tools capture individual packets on the wire, dissect their content, and display decoded packet content or packet-level statistics. These tools conduct network monitoring from the lowest level, and as such, can possibly do the most fine-grained monitoring at the cost of network I/O and analysis efforts. - -1. **dhcpdump**: a comman-line DHCP traffic sniffer capturing DHCP request/response traffic, and displays dissected DHCP protocol messages in a human-friendly format. It is useful when you are troubleshooting DHCP related issues. - -2. **[dsniff][1]**: a collection of command-line based sniffing, spoofing and hijacking tools designed for network auditing and penetration testing. They can sniff various information such as passwords, NSF traffic, email messages, website URLs, and so on. - -3. **[httpry][2]**: an HTTP packet sniffer which captures and decode HTTP requests and response packets, and display them in a human-readable format. - -4. **IPTraf**: a console-based network statistics viewer. It displays packet-level, connection-level, interface-level, protocol-level packet/byte counters in real-time. Packet capturing can be controlled by protocol filters, and its operation is full menu-driven. - -![](https://farm8.staticflickr.com/7519/16055246118_8ea182b413_c.jpg) - -5. **[mysql-sniffer][3]**: a packet sniffer which captures and decodes packets associated with MySQL queries. It displays the most frequent or all queries in a human-readable format. - -6. **[ngrep][4]**: grep over network packets. It can capture live packets, and match (filtered) packets against regular expressions or hexadecimal expressions. It is useful for detecting and storing any anomalous traffic, or for sniffing particular patterns of information from live traffic. - -7. **[p0f][5]**: a passive fingerprinting tool which, based on packet sniffing, reliably identifies operating systems, NAT or proxy settings, network link types and various other properites associated with an active TCP connection. - -8. **pktstat**: a command-line tool which analyzes live packets to display connection-level bandwidth usages as well as descriptive information of protocols involved (e.g., HTTP GET/POST, FTP, X11). - -![](https://farm8.staticflickr.com/7477/16048970999_be60f74952_b.jpg) - -9. **Snort**: an intrusion detection and prevention tool which can detect/prevent a variety of backdoor, botnets, phishing, spyware attacks from live traffic based on rule-driven protocol analysis and content matching. - -10. **tcpdump**: a command-line packet sniffer which is capable of capturing nework packets on the wire based on filter expressions, dissect the packets, and dump the packet content for packet-level analysis. It is widely used for any kinds of networking related troubleshooting, network application debugging, or [security][6] monitoring. - -11. **tshark**: a command-line packet sniffing tool that comes with Wireshark GUI program. It can capture and decode live packets on the wire, and show decoded packet content in a human-friendly fashion. - -### Flow-/Process-/Interface-Level Monitoring ### - -In this category, network monitoring is done by classifying network traffic into flows, associated processes or interfaces, and collecting per-flow, per-process or per-interface statistics. Source of information can be libpcap packet capture library or sysfs kernel virtual filesystem. Monitoring overhead of these tools is low, but packet-level inspection capabilities are missing. - -12. **bmon**: a console-based bandwidth monitoring tool which shows various per-interface information, including not-only aggregate/average RX/TX statistics, but also a historical view of bandwidth usage. - -![](https://farm9.staticflickr.com/8580/16234265932_87f20c5d17_b.jpg) - -13. **[iftop][7]**: a bandwidth usage monitoring tool that can shows bandwidth usage for individual network connections in real time. It comes with ncurses-based interface to visualize bandwidth usage of all connections in a sorted order. It is useful for monitoring which connections are consuming the most bandwidth. - -14. **nethogs**: a process monitoring tool which offers a real-time view of upload/download bandwidth usage of individual processes or programs in an ncurses-based interface. This is useful for detecting bandwidth hogging processes. - -15. **netstat**: a command-line tool that shows various statistics and properties of the networking stack, such as open TCP/UDP connections, network interface RX/TX statistics, routing tables, protocol/socket statistics. It is useful when you diagnose performance and resource usage related problems of the networking stack. - -16. **[speedometer][8]**: a console-based traffic monitor which visualizes the historical trend of an interface's RX/TX bandwidth usage with ncurses-drawn bar charts. - -![](https://farm8.staticflickr.com/7485/16048971069_31dd573a4f_c.jpg) - -17. **[sysdig][9]**: a comprehensive system-level debugging tool with a unified interface for investigating different Linux subsystems. Its network monitoring module is capable of monitoring, either online or offline, various per-process/per-host networking statistics such as bandwidth usage, number of connections/requests, etc. - -18. **tcptrack**: a TCP connection monitoring tool which displays information of active TCP connections, including source/destination IP addresses/ports, TCP state, and bandwidth usage. - -![](https://farm8.staticflickr.com/7507/16047703080_5fdda2e811_b.jpg) - -19. **vnStat**: a command-line traffic monitor which maintains a historical view of RX/TX bandwidh usage (e.g., current, daily, monthly) on a per-interface basis. Running as a background daemon, it collects and stores interface statistics on bandwidth rate and total bytes transferred. - -### Active Network Monitoring ### - -Unlike passive monitoring tools presented so far, tools in this category perform network monitoring by actively "injecting" probes into the network and collecting corresponding responses. Monitoring targets include routing path, available bandwidth, loss rates, delay, jitter, system settings or vulnerabilities, and so on. - -20. **[dnsyo][10]**: a DNS monitoring tool which can conduct DNS lookup from open resolvers scattered across more than 1,500 different networks. It is useful when you check DNS propagation or troubleshoot DNS configuration. - -21. **[iperf][11]**: a TCP/UDP bandwidth measurement utility which can measure maximum available bandwidth between two end points. It measures available bandwidth by having two hosts pump out TCP/UDP probe traffic between them either unidirectionally or bi-directionally. It is useful when you test the network capacity, or tune the parameters of network stack. A variant called [netperf][12] exists with more features and better statistics. - -22. **[netcat][13]/socat**: versatile network debugging tools capable of reading from, writing to, or listen on TCP/UDP sockets. They are often used alongside with other programs or scripts for backend network transfer or port listening. - -23. **nmap**: a command-line port scanning and network discovery utility. It relies on a number of TCP/UDP based scanning techniques to detect open ports, live hosts, or existing operating systems on the local network. It is useful when you audit local hosts for vulnerabilities or build a host map for maintenance purpose. [zmap][14] is an alernative scanning tool with Internet-wide scanning capability. - -24. ping: a network testing tool which works by exchaning ICMP echo and reply packets with a remote host. It is useful when you measure round-trip-time (RTT) delay and loss rate of a routing path, as well as test the status or firewall rules of a remote system. Variations of ping exist with fancier interface (e.g., [noping][15]), multi-protocol support (e.g., [hping][16]) or parallel probing capability (e.g., [fping][17]). - -![](https://farm8.staticflickr.com/7466/15612665344_a4bb665a5b_c.jpg) - -25. **[sprobe][18]**: a command-line tool that heuristically infers the bottleneck bandwidth between a local host and any arbitrary remote IP address. It uses TCP three-way handshake tricks to estimate the bottleneck bandwidth. It is useful when troubleshooting wide-area network performance and routing related problems. - -26. **traceroute**: a network discovery tool which reveals a layer-3 routing/forwarding path from a local host to a remote host. It works by sending TTL-limited probe packets and collecting ICMP responses from intermediate routers. It is useful when troubleshooting slow network connections or routing related problems. Variations of traceroute exist with better RTT statistics (e.g., [mtr][19]). - -### Application Log Parsing ### - -In this category, network monitoring is targeted at a specific server application (e.g., web server or database server). Network traffic generated or consumed by a server application is monitored by analyzing its log file. Unlike network-level monitors presented in earlier categories, tools in this category can analyze and monitor network traffic from application-level. - -27. **[GoAccess][20]**: a console-based interactive viewer for Apache and Nginx web server traffic. Based on access log analysis, it presents a real-time statistics of a number of metrics including daily visits, top requests, client operating systems, client locations, client browsers, in a scrollable view. - -![](https://farm8.staticflickr.com/7518/16209185266_da6c5c56eb_c.jpg) - -28. **[mtop][21]**: a command-line MySQL/MariaDB server moniter which visualizes the most expensive queries and current database server load. It is useful when you optimize MySQL server performance and tune server configurations. - -![](https://farm8.staticflickr.com/7472/16047570248_bc996795f2_c.jpg) - -29. **[ngxtop][22]**: a traffic monitoring tool for Nginx and Apache web server, which visualizes web server traffic in a top-like interface. It works by parsing a web server's access log file and collecting traffic statistics for individual destinations or requests. - -### Conclusion ### - -In this article, I presented a wide variety of command-line network monitoring tools, ranging from the lowest packet-level monitors to the highest application-level network monitors. Knowing which tool does what is one thing, and choosing which tool to use is another, as any single tool cannot be a universal solution for your every need. A good system admin should be able to decide which tool is right for the circumstance at hand. Hopefully the list helps with that. - -You are always welcome to improve the list with your comment! - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/useful-command-line-network-monitors-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://www.monkey.org/~dugsong/dsniff/ -[2]:http://xmodulo.com/monitor-http-traffic-command-line-linux.html -[3]:https://github.com/zorkian/mysql-sniffer -[4]:http://ngrep.sourceforge.net/ -[5]:http://lcamtuf.coredump.cx/p0f3/ -[6]:http://xmodulo.com/recommend/firewallbook -[7]:http://xmodulo.com/how-to-install-iftop-on-linux.html -[8]:https://excess.org/speedometer/ -[9]:http://xmodulo.com/monitor-troubleshoot-linux-server-sysdig.html -[10]:http://xmodulo.com/check-dns-propagation-linux.html -[11]:https://iperf.fr/ -[12]:http://www.netperf.org/netperf/ -[13]:http://xmodulo.com/useful-netcat-examples-linux.html -[14]:https://zmap.io/ -[15]:http://noping.cc/ -[16]:http://www.hping.org/ -[17]:http://fping.org/ -[18]:http://sprobe.cs.washington.edu/ -[19]:http://xmodulo.com/better-alternatives-basic-command-line-utilities.html#mtr_link -[20]:http://goaccess.io/ -[21]:http://mtop.sourceforge.net/ -[22]:http://xmodulo.com/monitor-nginx-web-server-command-line-real-time.html From b14b922f2f05ddb8ea7f9b44564ca61916a22845 Mon Sep 17 00:00:00 2001 From: wwy-hust Date: Sun, 10 May 2015 23:21:41 +0800 Subject: [PATCH 117/133] remove the origin english article --- ... command-line network monitors on Linux.md | 137 ------------------ 1 file changed, 137 deletions(-) delete mode 100644 sources/tech/20150112 What are useful command-line network monitors on Linux.md diff --git a/sources/tech/20150112 What are useful command-line network monitors on Linux.md b/sources/tech/20150112 What are useful command-line network monitors on Linux.md deleted file mode 100644 index 8f6b9596d1..0000000000 --- a/sources/tech/20150112 What are useful command-line network monitors on Linux.md +++ /dev/null @@ -1,137 +0,0 @@ -translating by wwy-hust - -What are useful command-line network monitors on Linux -================================================================================ -Network monitoring is a critical IT function for businesses of all sizes. The goal of network monitoring can vary. For example, the monitoring activity can be part of long-term network provisioning, security protection, performance troubleshooting, network usage accounting, and so on. Depending on its goal, network monitoring is done in many different ways, such as performing packet-level sniffing, collecting flow-level statistics, actively injecting probes into the network, parsing server logs, etc. - -While there are many dedicated network monitoring systems capable of 24/7/365 monitoring, you can also leverage command-line network monitors in certain situations, where a dedicated monitor is an overkill. If you are a system admin, you are expected to have hands-on experience with some of well known CLI network monitors. Here is a list of **popular and useful command-line network monitors on Linux**. - -### Packet-Level Sniffing ### - -In this category, monitoring tools capture individual packets on the wire, dissect their content, and display decoded packet content or packet-level statistics. These tools conduct network monitoring from the lowest level, and as such, can possibly do the most fine-grained monitoring at the cost of network I/O and analysis efforts. - -1. **dhcpdump**: a comman-line DHCP traffic sniffer capturing DHCP request/response traffic, and displays dissected DHCP protocol messages in a human-friendly format. It is useful when you are troubleshooting DHCP related issues. - -2. **[dsniff][1]**: a collection of command-line based sniffing, spoofing and hijacking tools designed for network auditing and penetration testing. They can sniff various information such as passwords, NSF traffic, email messages, website URLs, and so on. - -3. **[httpry][2]**: an HTTP packet sniffer which captures and decode HTTP requests and response packets, and display them in a human-readable format. - -4. **IPTraf**: a console-based network statistics viewer. It displays packet-level, connection-level, interface-level, protocol-level packet/byte counters in real-time. Packet capturing can be controlled by protocol filters, and its operation is full menu-driven. - -![](https://farm8.staticflickr.com/7519/16055246118_8ea182b413_c.jpg) - -5. **[mysql-sniffer][3]**: a packet sniffer which captures and decodes packets associated with MySQL queries. It displays the most frequent or all queries in a human-readable format. - -6. **[ngrep][4]**: grep over network packets. It can capture live packets, and match (filtered) packets against regular expressions or hexadecimal expressions. It is useful for detecting and storing any anomalous traffic, or for sniffing particular patterns of information from live traffic. - -7. **[p0f][5]**: a passive fingerprinting tool which, based on packet sniffing, reliably identifies operating systems, NAT or proxy settings, network link types and various other properites associated with an active TCP connection. - -8. **pktstat**: a command-line tool which analyzes live packets to display connection-level bandwidth usages as well as descriptive information of protocols involved (e.g., HTTP GET/POST, FTP, X11). - -![](https://farm8.staticflickr.com/7477/16048970999_be60f74952_b.jpg) - -9. **Snort**: an intrusion detection and prevention tool which can detect/prevent a variety of backdoor, botnets, phishing, spyware attacks from live traffic based on rule-driven protocol analysis and content matching. - -10. **tcpdump**: a command-line packet sniffer which is capable of capturing nework packets on the wire based on filter expressions, dissect the packets, and dump the packet content for packet-level analysis. It is widely used for any kinds of networking related troubleshooting, network application debugging, or [security][6] monitoring. - -11. **tshark**: a command-line packet sniffing tool that comes with Wireshark GUI program. It can capture and decode live packets on the wire, and show decoded packet content in a human-friendly fashion. - -### Flow-/Process-/Interface-Level Monitoring ### - -In this category, network monitoring is done by classifying network traffic into flows, associated processes or interfaces, and collecting per-flow, per-process or per-interface statistics. Source of information can be libpcap packet capture library or sysfs kernel virtual filesystem. Monitoring overhead of these tools is low, but packet-level inspection capabilities are missing. - -12. **bmon**: a console-based bandwidth monitoring tool which shows various per-interface information, including not-only aggregate/average RX/TX statistics, but also a historical view of bandwidth usage. - -![](https://farm9.staticflickr.com/8580/16234265932_87f20c5d17_b.jpg) - -13. **[iftop][7]**: a bandwidth usage monitoring tool that can shows bandwidth usage for individual network connections in real time. It comes with ncurses-based interface to visualize bandwidth usage of all connections in a sorted order. It is useful for monitoring which connections are consuming the most bandwidth. - -14. **nethogs**: a process monitoring tool which offers a real-time view of upload/download bandwidth usage of individual processes or programs in an ncurses-based interface. This is useful for detecting bandwidth hogging processes. - -15. **netstat**: a command-line tool that shows various statistics and properties of the networking stack, such as open TCP/UDP connections, network interface RX/TX statistics, routing tables, protocol/socket statistics. It is useful when you diagnose performance and resource usage related problems of the networking stack. - -16. **[speedometer][8]**: a console-based traffic monitor which visualizes the historical trend of an interface's RX/TX bandwidth usage with ncurses-drawn bar charts. - -![](https://farm8.staticflickr.com/7485/16048971069_31dd573a4f_c.jpg) - -17. **[sysdig][9]**: a comprehensive system-level debugging tool with a unified interface for investigating different Linux subsystems. Its network monitoring module is capable of monitoring, either online or offline, various per-process/per-host networking statistics such as bandwidth usage, number of connections/requests, etc. - -18. **tcptrack**: a TCP connection monitoring tool which displays information of active TCP connections, including source/destination IP addresses/ports, TCP state, and bandwidth usage. - -![](https://farm8.staticflickr.com/7507/16047703080_5fdda2e811_b.jpg) - -19. **vnStat**: a command-line traffic monitor which maintains a historical view of RX/TX bandwidh usage (e.g., current, daily, monthly) on a per-interface basis. Running as a background daemon, it collects and stores interface statistics on bandwidth rate and total bytes transferred. - -### Active Network Monitoring ### - -Unlike passive monitoring tools presented so far, tools in this category perform network monitoring by actively "injecting" probes into the network and collecting corresponding responses. Monitoring targets include routing path, available bandwidth, loss rates, delay, jitter, system settings or vulnerabilities, and so on. - -20. **[dnsyo][10]**: a DNS monitoring tool which can conduct DNS lookup from open resolvers scattered across more than 1,500 different networks. It is useful when you check DNS propagation or troubleshoot DNS configuration. - -21. **[iperf][11]**: a TCP/UDP bandwidth measurement utility which can measure maximum available bandwidth between two end points. It measures available bandwidth by having two hosts pump out TCP/UDP probe traffic between them either unidirectionally or bi-directionally. It is useful when you test the network capacity, or tune the parameters of network stack. A variant called [netperf][12] exists with more features and better statistics. - -22. **[netcat][13]/socat**: versatile network debugging tools capable of reading from, writing to, or listen on TCP/UDP sockets. They are often used alongside with other programs or scripts for backend network transfer or port listening. - -23. **nmap**: a command-line port scanning and network discovery utility. It relies on a number of TCP/UDP based scanning techniques to detect open ports, live hosts, or existing operating systems on the local network. It is useful when you audit local hosts for vulnerabilities or build a host map for maintenance purpose. [zmap][14] is an alernative scanning tool with Internet-wide scanning capability. - -24. ping: a network testing tool which works by exchaning ICMP echo and reply packets with a remote host. It is useful when you measure round-trip-time (RTT) delay and loss rate of a routing path, as well as test the status or firewall rules of a remote system. Variations of ping exist with fancier interface (e.g., [noping][15]), multi-protocol support (e.g., [hping][16]) or parallel probing capability (e.g., [fping][17]). - -![](https://farm8.staticflickr.com/7466/15612665344_a4bb665a5b_c.jpg) - -25. **[sprobe][18]**: a command-line tool that heuristically infers the bottleneck bandwidth between a local host and any arbitrary remote IP address. It uses TCP three-way handshake tricks to estimate the bottleneck bandwidth. It is useful when troubleshooting wide-area network performance and routing related problems. - -26. **traceroute**: a network discovery tool which reveals a layer-3 routing/forwarding path from a local host to a remote host. It works by sending TTL-limited probe packets and collecting ICMP responses from intermediate routers. It is useful when troubleshooting slow network connections or routing related problems. Variations of traceroute exist with better RTT statistics (e.g., [mtr][19]). - -### Application Log Parsing ### - -In this category, network monitoring is targeted at a specific server application (e.g., web server or database server). Network traffic generated or consumed by a server application is monitored by analyzing its log file. Unlike network-level monitors presented in earlier categories, tools in this category can analyze and monitor network traffic from application-level. - -27. **[GoAccess][20]**: a console-based interactive viewer for Apache and Nginx web server traffic. Based on access log analysis, it presents a real-time statistics of a number of metrics including daily visits, top requests, client operating systems, client locations, client browsers, in a scrollable view. - -![](https://farm8.staticflickr.com/7518/16209185266_da6c5c56eb_c.jpg) - -28. **[mtop][21]**: a command-line MySQL/MariaDB server moniter which visualizes the most expensive queries and current database server load. It is useful when you optimize MySQL server performance and tune server configurations. - -![](https://farm8.staticflickr.com/7472/16047570248_bc996795f2_c.jpg) - -29. **[ngxtop][22]**: a traffic monitoring tool for Nginx and Apache web server, which visualizes web server traffic in a top-like interface. It works by parsing a web server's access log file and collecting traffic statistics for individual destinations or requests. - -### Conclusion ### - -In this article, I presented a wide variety of command-line network monitoring tools, ranging from the lowest packet-level monitors to the highest application-level network monitors. Knowing which tool does what is one thing, and choosing which tool to use is another, as any single tool cannot be a universal solution for your every need. A good system admin should be able to decide which tool is right for the circumstance at hand. Hopefully the list helps with that. - -You are always welcome to improve the list with your comment! - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/useful-command-line-network-monitors-linux.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/nanni -[1]:http://www.monkey.org/~dugsong/dsniff/ -[2]:http://xmodulo.com/monitor-http-traffic-command-line-linux.html -[3]:https://github.com/zorkian/mysql-sniffer -[4]:http://ngrep.sourceforge.net/ -[5]:http://lcamtuf.coredump.cx/p0f3/ -[6]:http://xmodulo.com/recommend/firewallbook -[7]:http://xmodulo.com/how-to-install-iftop-on-linux.html -[8]:https://excess.org/speedometer/ -[9]:http://xmodulo.com/monitor-troubleshoot-linux-server-sysdig.html -[10]:http://xmodulo.com/check-dns-propagation-linux.html -[11]:https://iperf.fr/ -[12]:http://www.netperf.org/netperf/ -[13]:http://xmodulo.com/useful-netcat-examples-linux.html -[14]:https://zmap.io/ -[15]:http://noping.cc/ -[16]:http://www.hping.org/ -[17]:http://fping.org/ -[18]:http://sprobe.cs.washington.edu/ -[19]:http://xmodulo.com/better-alternatives-basic-command-line-utilities.html#mtr_link -[20]:http://goaccess.io/ -[21]:http://mtop.sourceforge.net/ -[22]:http://xmodulo.com/monitor-nginx-web-server-command-line-real-time.html From ad5f645ef0457b3ce906d384495bd340a58ce131 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 11 May 2015 07:59:20 +0800 Subject: [PATCH 118/133] Update 20150505 Bodhi Linux Introduces Moksha Desktop.md --- sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md b/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md index 0b4d61993d..cdc649666d 100644 --- a/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md +++ b/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md @@ -1,3 +1,4 @@ +Translating by GOLinux! Bodhi Linux Introduces Moksha Desktop ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Bodhi_Linux.jpg) @@ -37,4 +38,4 @@ via: http://itsfoss.com/bodhi-linux-introduces-moksha-desktop/ [2]:https://www.enlightenment.org/ [3]:http://www.bodhilinux.com/2015/04/28/introducing-the-moksha-desktop/ [4]:http://itsfoss.com/bodhi-linux-3/ -[5]:http://forums.bodhilinux.com/index.php?/topic/12322-e17-vs-e19-which-are-you-using-and-why/ \ No newline at end of file +[5]:http://forums.bodhilinux.com/index.php?/topic/12322-e17-vs-e19-which-are-you-using-and-why/ From 8862bda9a78c7888d6584a12ffde6d9ec8ed9329 Mon Sep 17 00:00:00 2001 From: DongShuaike Date: Mon, 11 May 2015 08:35:30 +0800 Subject: [PATCH 119/133] Translated by DongShuaike --- ...A TCP or UDP Network Monitoring Utility.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md diff --git a/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md new file mode 100644 index 0000000000..98bea48f41 --- /dev/null +++ b/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md @@ -0,0 +1,77 @@ + +iptraf:一个实用的TCP/UDP网络监控工具 +================================================================================ + +[iptraf][1]是一个基于ncurses(ncurses-based)的IP局域网监控器,用来生成包括TCP信息,UDP计数,ICMP和OSPF信息,以太网加载信息,结点状态信息,IP校验和错误等等统计数据。 + +它基于ncurses的用户界面帮助用户免于记忆繁琐的命令行开关。 + +### 特征 ### + +- 拥有一个IP流量监控器,用来显示你的网络中的流量变化信息。包括TCP标识信息,包以及字节计数,ICMP细节,OSPF包类型。 + +- 拥有普通和详细的交互统计数据显示了IP,TCP,UDP,ICMP,非IP以及其他的IP包计数,IP校验和错误,交互活动,包尺寸计数。(这里一些专业术语拿不定) + +- 拥有一个TCP和UDP服务监控器,能够显示普通TCP和UDP应用端口上发送的和接收的包的数量。 + +- 拥有一个局域网数据统计模块,能够检查到(discover)处于活动状态的主机,并显示其上正在运行的数据活动的统计信息。 + +- 拥有TCP,UDP,以及其他协议的显示过滤器(display filters),允许你只查看感兴趣的流量。 + +- 日志功能。 + +- 支持以太网,FDDI,ISDN,SLIP,PPP以及loopback接口类型(interface types)。 + +- 利用Linux内核内置的(built-in)原始套接字接口,允许它(指iptraf)能够用于许多种网卡上(这句话翻译不好) + +- 全屏,菜单式驱动的操作。 + +安装方法 + +### Ubuntu以及其衍生版本 ### + + sudo apt-get install iptraf + +### Arch Linux以及其衍生版本 ### + + sudo pacman -S iptra + +### Fedora以及其衍生版本 ### + + sudo yum install iptraf + +### 用法 ### + + +如果不加任何命令行选项地运行**iptraf**命令,程序将进入一种交互模式,通过主菜单可以访问多种设备(various facilities) + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_1.png) + + +简易的上手导航菜单。 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_2.png) + +为monitor选择界面(接口)? + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_3.png) + +接口 **pp0** 处的流量。 + +![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_4.png) + +开始吧! + + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/iptraf-tcpudp-network-monitoring-utility/ + +作者:[Enock Seth Nyamador][a] +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/seth/ +[1]:http://iptraf.seul.org/about.html From 190dbcbb5dc048edf02072877517a9b8ceb9a829 Mon Sep 17 00:00:00 2001 From: GOLinux Date: Mon, 11 May 2015 08:43:47 +0800 Subject: [PATCH 120/133] [Translated]20150505 Bodhi Linux Introduces Moksha Desktop.md --- ...5 Bodhi Linux Introduces Moksha Desktop.md | 41 ------------------- ...5 Bodhi Linux Introduces Moksha Desktop.md | 39 ++++++++++++++++++ 2 files changed, 39 insertions(+), 41 deletions(-) delete mode 100644 sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md create mode 100644 translated/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md diff --git a/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md b/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md deleted file mode 100644 index cdc649666d..0000000000 --- a/sources/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md +++ /dev/null @@ -1,41 +0,0 @@ -Translating by GOLinux! -Bodhi Linux Introduces Moksha Desktop -================================================================================ -![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Bodhi_Linux.jpg) - -Ubuntu based lightweight Linux distribution [Bodhi Linux][1] is working on a desktop environment of its own. This new desktop environment will be called Moksha (Sanskrit for ‘complete freedom’). Moksha will be replacing the usual [Enlightenment desktop environment][2]. - -### Why Moksha instead of Enlightenment? ### - -Jeff Hoogland of Bodhi Linux [says][3] that he had been unhappy with the newer versions of Enlightenment in the recent past. Until E17, Enlightenment was very stable and complemented well to the need of a lightweight Linux OS, but the E18 was so full of bugs that Bodhi Linux skipped it altogether. - -While the latest [Bodhi Linux 3.0.0 release][4] uses E19 (except the legacy mode, meant for older hardware, still uses E17), Jeff is not happy with E19 as well. He quotes: - -> On top of the performance issues, E19 did not allow for me personally to have the same workflow I enjoyed under E17 due to features it no longer had. Because of this I had changed to using the E17 on all of my Bodhi 3 computers – even my high end ones. This got me to thinking how many of our existing Bodhi users felt the same way, so I [opened a discussion about it on our user forums][5]. - -### Moksha is continuation of the E17 desktop ### - -Moksha will be a continuation of Bodhi’s favorite E17 desktop. Jeff further mentions: - -> We will start by integrating all of the Bodhi changes we have simply been patching into the source code over the years and fixing the few issues the desktop has. Once this is done we will begin back porting a few of the more useful features E18 and E19 introduced to the Enlightenment desktop and finally, we will introduce a few new things we think will improve the end user experience. - -### When will Moksha release? ### - -The next update to Bodhi will be Bodhi 3.1.0 in August this year. This new release will bring Moksha on all of its default ISOs. Let’s wait and watch to see if Moksha turns out to be a good decision or not. - --------------------------------------------------------------------------------- - -via: http://itsfoss.com/bodhi-linux-introduces-moksha-desktop/ - -作者:[Abhishek][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://itsfoss.com/author/abhishek/ -[1]:http://www.bodhilinux.com/ -[2]:https://www.enlightenment.org/ -[3]:http://www.bodhilinux.com/2015/04/28/introducing-the-moksha-desktop/ -[4]:http://itsfoss.com/bodhi-linux-3/ -[5]:http://forums.bodhilinux.com/index.php?/topic/12322-e17-vs-e19-which-are-you-using-and-why/ diff --git a/translated/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md b/translated/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md new file mode 100644 index 0000000000..6ad0d04567 --- /dev/null +++ b/translated/tech/20150505 Bodhi Linux Introduces Moksha Desktop.md @@ -0,0 +1,39 @@ +Bodhi Linux引入Moksha桌面 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Bodhi_Linux.jpg) + +基于Ubuntu的轻量级Linux发行版[Bodhi Linux][1]致力于构建其自家的桌面环境,这个全新桌面环境被称之为Moksha(梵文意为‘完全自由’)。Moksha将替换常用的[Enlightenment桌面环境][2]。 + +### 为何用Moksha替换Englightenment? ### + +Bodhi Linux的Jeff Hoogland最近[表示][3]了他对新版Enlightenment的不满。直到E17,Enlightenment都十分稳定,并且能满足轻量级Linux的部署需求。而E18则到处都充满了问题,Bodhi Linux只好弃之不用了。 + +虽然最新的[Bodhi Linux 3.0发行版][4]仍然使用了E19作为其桌面(除传统模式外,这意味着,对于旧的硬件,仍然会使用E17),Jeff对E19也十分不满。他说道: + +>除了性能问题外,对于我个人而言,E19并没有给我带来与E17下相同的工作流程,因为它移除了很多E17的特性。鉴于此,我不得不将我所有的3台Bodhi计算机桌面改成E17——这3台机器都是我高端的了。这不由得让我想到,我们还有多少现存的Bodhi用户也怀着和我同样的感受,所以,我[在我们的用户论坛上开启一个与此相关的讨论][5]。 + +### Moksha是E17桌面的延续 ### + +Moksha将会是Bodhi所热衷的E17桌面的延续。Jeff进一步提到: +>我们将从整合所有Bodhi修改开始。多年来我们一直都只是给源代码打补丁,并修复桌面所具有的问题。如果该工作完成,我们将开始移植一些E18和E19引入的更为有用的特性,最后,我们将引入一些我们认为会改善最终用户体验的东西。 + +### Moksha何时发布? ### + +下一个Bodhi更新将会是Bodhi 3.1.0,就在今年八月。这个新版本将为所有其缺省ISO带来Moksha。让我们拭目以待,看看Moksha是否是一个好的决定。 + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/bodhi-linux-introduces-moksha-desktop/ + +作者:[Abhishek][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://www.bodhilinux.com/ +[2]:https://www.enlightenment.org/ +[3]:http://www.bodhilinux.com/2015/04/28/introducing-the-moksha-desktop/ +[4]:http://itsfoss.com/bodhi-linux-3/ +[5]:http://forums.bodhilinux.com/index.php?/topic/12322-e17-vs-e19-which-are-you-using-and-why/ From cc1bf0365c6066f54678603d6e2b134e8f207abf Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 11 May 2015 09:27:48 +0800 Subject: [PATCH 121/133] [Translating] tech/20150331 How to Install WordPress with Nginx in a Docker Container --- ... How to Install WordPress with Nginx in a Docker Container.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md b/sources/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md index 9f74c672f4..3d8f77e1cb 100644 --- a/sources/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md +++ b/sources/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md @@ -1,3 +1,4 @@ +Translating by ictlyh How to Install WordPress with Nginx in a Docker Container ================================================================================ Hi all, today we'll learn how to install WordPress running Nginx Web Server in a Docker Container. WordPress is an awesome free and open source Content Management System running thousands of websites throughout the globe. [Docker][1] is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. From 23eb73123a00080e337d1162b24d4805b6c1cc16 Mon Sep 17 00:00:00 2001 From: ZTinoZ Date: Mon, 11 May 2015 10:05:04 +0800 Subject: [PATCH 122/133] Translating by ZTinoZ --- ...27 15 Things to Do After Installing Ubuntu 15.04 Desktop.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index 6f1114b9bb..179aa139bd 100644 --- a/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/sources/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -1,3 +1,4 @@ +Translating by ZTinoZ 15 Things to Do After Installing Ubuntu 15.04 Desktop ================================================================================ This tutorial is intended for beginners and covers some basic steps on what to do after you have installed Ubuntu 15.04 “Vivid Vervet” Desktop version on your computer in order to customize the system and install basic programs for daily usage. @@ -295,4 +296,4 @@ via: http://www.tecmint.com/things-to-do-after-installing-ubuntu-15-04-desktop/ [a]:http://www.tecmint.com/author/cezarmatei/ [1]:http://www.viber.com/en/products/linux -[2]:http://ubuntu-tweak.com/ \ No newline at end of file +[2]:http://ubuntu-tweak.com/ From ce207cac56c5bf969b06956e58b26708c3e4c7c6 Mon Sep 17 00:00:00 2001 From: wwy Date: Mon, 11 May 2015 10:26:22 +0800 Subject: [PATCH 123/133] Update 2015-04-29 web caching basics terminology http headers and caching strategies.md --- ...ng basics terminology http headers and caching strategies.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md b/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md index df0eb8b723..07fd4fcd42 100644 --- a/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md +++ b/sources/tech/2015-04-29 web caching basics terminology http headers and caching strategies.md @@ -1,3 +1,5 @@ +translating by wwy-hust + Web Caching Basics: Terminology, HTTP Headers, and Caching Strategies ===================================================================== From 7dd2df260d645592ec053e877c02791d824f0e72 Mon Sep 17 00:00:00 2001 From: wi-cuckoo Date: Mon, 11 May 2015 12:39:51 +0800 Subject: [PATCH 124/133] translating wi-cuckoo --- ...ndline Chat Server and Remove Unwanted Packages in Linux.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md b/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md index 990e621e5b..cbcd668b14 100644 --- a/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md +++ b/sources/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md @@ -1,3 +1,4 @@ +translating wi-cuckoo Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux ================================================================================ Here we are with the next part of Linux Command Line Tips and Tricks. If you missed our previous post on Linux Tricks you may find it here. @@ -180,4 +181,4 @@ via: http://www.tecmint.com/linux-commandline-chat-server-and-remove-unwanted-pa 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [a]:http://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/5-linux-command-line-tricks/ \ No newline at end of file +[1]:http://www.tecmint.com/5-linux-command-line-tricks/ From ce485dc2362849ce1e5678f6f74b3ce9923978a2 Mon Sep 17 00:00:00 2001 From: ictlyh Date: Mon, 11 May 2015 12:55:51 +0800 Subject: [PATCH 125/133] [Translated] tech/20150331 How to Install WordPress with Nginx in a Docker Container --- ...dPress with Nginx in a Docker Container.md | 103 +++++++++--------- 1 file changed, 51 insertions(+), 52 deletions(-) rename {sources => translated}/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md (57%) diff --git a/sources/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md b/translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md similarity index 57% rename from sources/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md rename to translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md index 3d8f77e1cb..849dd4a853 100644 --- a/sources/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md +++ b/translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md @@ -1,27 +1,26 @@ -Translating by ictlyh -How to Install WordPress with Nginx in a Docker Container +如何在 Docker 容器里的 Nginx 中安装 WordPress ================================================================================ -Hi all, today we'll learn how to install WordPress running Nginx Web Server in a Docker Container. WordPress is an awesome free and open source Content Management System running thousands of websites throughout the globe. [Docker][1] is an Open Source project that provides an open platform to pack, ship and run any application as a lightweight container. It has no boundaries of Language support, Frameworks or packaging system and can be run anywhere, anytime from a small home computers to high-end servers. It makes them great building blocks for deploying and scaling web apps, databases, and back-end services without depending on a particular stack or provider. +大家好,今天我们来学习一下如何在 Docker 容器上运行的 Nginx Web 服务器中安装 WordPress。WordPress 是一个很好的免费开源的内容管理系统,全球成千上万的网站都在使用它。[Docker][1] 是一个提供开放平台来打包,分发和运行任何应用的开源轻量级容器项目。它没有语言支持,框架或打包系统的限制,可以在从小的家用电脑到高端服务器的任何地方任何时间运行。这让它们成为可以用于部署和扩展网络应用,数据库和后端服务而不必依赖于特定的栈或者提供商的很好的构建块。 -Today, we'll deploy a docker container with the latest WordPress package with necessary prerequisites ie Nginx Web Server, PHP5, MariaDB Server, etc. Here are some short and sweet steps to successfully install a WordPress running Nginx in a Docker Container. +今天,我们会在 docker 容器上部署最新的 WordPress 软件包,包括需要的前提条件,例如 Nginx Web 服务器、PHP5、MariaDB 服务器等。下面是在运行在 Docker 容器上成功安装 WordPress 的简单步骤。 -### 1. Installing Docker ### +### 1. 安装 Docker ### -Before we really start, we'll need to make sure that we have Docker installed in our Linux machine. Here, we are running CentOS 7 as host so, we'll be running yum manager to install docker using the below command. +在我们真正开始之前,我们需要确保在我们的 Linux 机器上已经安装了 Docker。我们使用的主机是 CentOS 7,因此我们用下面的命令使用 yum 管理器安装 docker。 # yum install docker -![Installing Docker](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-docker.png) +![安装 Docker](http://blog.linoxide.com/wp-content/uploads/2015/03/installing-docker.png) # systemctl restart docker.service -### 2. Creating WordPress Dockerfile ### +### 2. 创建 WordPress Docker 文件 ### -We'll need to create a Dockerfile which will automate the installation of the wordpress and its necessary pre-requisites. This Dockerfile will be used to build the image of WordPress installation we created. This WordPress Dockerfile fetches a CentOS 7 image from the Docker Registry Hub and updates the system with the latest available packages. It then installs the necessary softwares like Nginx Web Server, PHP, MariaDB, Open SSH Server and more which are essential for the Docker Container to work. It then executes a script which will initialize the installation of WordPress out of the box. +我们需要创建用于自动安装 wordpress 以及前提条件的 docker 文件。这个 docker 文件将用于构建 WordPress 的安装镜像。这个 WordPress docker 文件会从 Docker 库中心获取 CentOS 7 镜像并用最新的可用更新升级系统。然后它会安装必要的软件,例如 Nginx Web 服务器、PHP、MariaDB、Open SSH 服务器以及其它保证 Docker 容器正常运行不可缺少的组件。最后它会执行一个初始化 WordPress 安装的脚本。 # nano Dockerfile -Then, we'll need to add the following lines of configuration inside that Dockerfile. +然后,我们需要将下面的配置行添加到 Docker 文件中。 FROM centos:centos7 MAINTAINER The CentOS Project @@ -49,15 +48,15 @@ Then, we'll need to add the following lines of configuration inside that Dockerf CMD ["/bin/bash", "/start.sh"] -![Wordpress Dockerfile](http://blog.linoxide.com/wp-content/uploads/2015/03/Dockerfile-wordpress.png) +![Wordpress Docker 文件](http://blog.linoxide.com/wp-content/uploads/2015/03/Dockerfile-wordpress.png) -### 3. Creating Start script ### +### 3. 创建启动 script ### -After we create our Dockerfile, we'll need to create a script named start.sh which will run and configure our WordPress installation. It will create and configure database, passwords for wordpress. To create it, we'll need to open start.sh with our favorite text editor. +我们创建了 docker 文件之后,我们需要创建用于运行和配置 WordPress 安装的脚本,名称为 start.sh。它会为 WordPress 创建并配置数据库和密码。用我们喜欢的文本编辑器打开 start.sh。 # nano start.sh -After opening start.sh, we'll need to add the following lines of configuration into it. +打开 start.sh 之后,我们要添加下面的配置行到文件中。 #!/bin/bash @@ -68,7 +67,7 @@ After opening start.sh, we'll need to add the following lines of configuration i } __create_user() { - # Create a user to SSH into as. + # 创建用于 SSH 登录的用户 SSH_USERPASS=`pwgen -c -n -1 8` useradd -G wheel user echo user:$SSH_USERPASS | chpasswd @@ -76,7 +75,7 @@ After opening start.sh, we'll need to add the following lines of configuration i } __mysql_config() { - # Hack to get MySQL up and running... I need to look into it more. + # 启用并运行 MySQL yum -y erase mariadb mariadb-server rm -rf /var/lib/mysql/ /etc/my.cnf yum -y install mariadb mariadb-server @@ -87,18 +86,18 @@ After opening start.sh, we'll need to add the following lines of configuration i } __handle_passwords() { - # Here we generate random passwords (thank you pwgen!). The first two are for mysql users, the last batch for random keys in wp-config.php + # 在这里我们生成随机密码(感谢 pwgen)。前面两个用于 mysql 用户,最后一个用于 wp-config.php 的随机密钥。 WORDPRESS_DB="wordpress" MYSQL_PASSWORD=`pwgen -c -n -1 12` WORDPRESS_PASSWORD=`pwgen -c -n -1 12` - # This is so the passwords show up in logs. + # 这是在日志中显示的密码。 echo mysql root password: $MYSQL_PASSWORD echo wordpress password: $WORDPRESS_PASSWORD echo $MYSQL_PASSWORD > /mysql-root-pw.txt echo $WORDPRESS_PASSWORD > /wordpress-db-pw.txt - # There used to be a huge ugly line of sed and cat and pipe and stuff below, - # but thanks to @djfiander's thing at https://gist.github.com/djfiander/6141138 - # there isn't now. + # 这里原来是一个包括 sed、cat、pipe 和 stuff 的很长的行,但多亏了 + # @djfiander 的 https://gist.github.com/djfiander/6141138 + # 现在没有了 sed -e "s/database_name_here/$WORDPRESS_DB/ s/username_here/$WORDPRESS_DB/ s/password_here/$WORDPRESS_PASSWORD/ @@ -117,7 +116,7 @@ After opening start.sh, we'll need to add the following lines of configuration i } __start_mysql() { - # systemctl start mysqld.service + # systemctl 启动 mysqld 服务 mysqladmin -u root password $MYSQL_PASSWORD mysql -uroot -p$MYSQL_PASSWORD -e "CREATE DATABASE wordpress; GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY '$WORDPRESS_PASSWORD'; FLUSH PRIVILEGES;" killall mysqld @@ -128,7 +127,7 @@ After opening start.sh, we'll need to add the following lines of configuration i supervisord -n } - # Call all functions + # 调用所有函数 __check __create_user __mysql_config @@ -137,17 +136,17 @@ After opening start.sh, we'll need to add the following lines of configuration i __start_mysql __run_supervisor -![Start Script](http://blog.linoxide.com/wp-content/uploads/2015/03/start-script.png) +![启动脚本](http://blog.linoxide.com/wp-content/uploads/2015/03/start-script.png) -After adding the above configuration, we'll need to save it and then exit. +增加完上面的配置之后,保存并关闭文件。 -### 4. Creating Configuration files ### +### 4. 创建配置文件 ### -Now, we'll need to create configuration file for Nginx Web Server named nginx-site.conf . +现在,我们需要创建 Nginx Web 服务器的配置文件,命名为 nginx-site.conf。 # nano nginx-site.conf -Then, we'll add the following configuration to the config file. +然后,增加下面的配置信息到配置文件。 user nginx; worker_processes 1; @@ -231,13 +230,13 @@ Then, we'll add the following configuration to the config file. } } -![Nginx configuration](http://blog.linoxide.com/wp-content/uploads/2015/03/nginx-conf.png) +![Nginx 配置](http://blog.linoxide.com/wp-content/uploads/2015/03/nginx-conf.png) -Now, we'll create supervisord.conf file and add the following lines as shown below. +现在,创建 supervisor.conf 文件并添加下面的行。 # nano supervisord.conf -Then, add the following lines. +然后,添加以下行。 [unix_http_server] file=/tmp/supervisor.sock ; (the path to the socket file) @@ -287,60 +286,60 @@ Then, add the following lines. events = PROCESS_LOG result_handler = supervisor_stdout:event_handler -![Supervisord Configuration](http://blog.linoxide.com/wp-content/uploads/2015/03/supervisord.png) +![Supervisord 配置](http://blog.linoxide.com/wp-content/uploads/2015/03/supervisord.png) -After adding, we'll save and exit the file. +添加完后,保存并关闭文件。 -### 5. Building WordPress Container ### +### 5. 构建 WordPress 容器 ### -Now, after done with creating configurations and scripts, we'll now finally use the Dockerfile to build our desired container with the latest WordPress CMS installed and configured according to the configuration. To do so, we'll run the following command in that directory. +现在,完成了创建配置文件和脚本之后,我们终于要使用 docker 文件来创建安装最新的 WordPress CMS(译者注:Content Management System,内容管理系统)所需要的容器,并根据配置文件进行配置。做到这点,我们需要在对应的目录中运行以下命令。 # docker build --rm -t wordpress:centos7 . -![Building WordPress Container](http://blog.linoxide.com/wp-content/uploads/2015/03/building-wordpress-container.png) +![构建 WordPress 容器](http://blog.linoxide.com/wp-content/uploads/2015/03/building-wordpress-container.png) -### 6. Running WordPress Container ### +### 6. 运行 WordPress 容器 ### -Now, to run our newly built container and open port 80 and 22 for Nginx Web Server and SSH access respectively, we'll run the following command. +现在,执行以下命令运行新构建的容器,并为 Nginx Web 服务器和 SSH 访问打开88 和 22号相应端口 。 # CID=$(docker run -d -p 80:80 wordpress:centos7) -![Run WordPress Docker](http://blog.linoxide.com/wp-content/uploads/2015/03/run-wordpress-docker.png) +![运行 WordPress Docker](http://blog.linoxide.com/wp-content/uploads/2015/03/run-wordpress-docker.png) -To check the process and commands executed inside the container, we'll run the following command. +运行以下命令检查进程以及容器内部执行的命令。 # echo "$(docker logs $CID )" -TO check if the port mapping is correct or not, run the following command. +运行以下命令检查端口映射是否正确。 # docker ps -![docker state](http://blog.linoxide.com/wp-content/uploads/2015/03/docker-state.png) +![docker 状态](http://blog.linoxide.com/wp-content/uploads/2015/03/docker-state.png) -### 7. Web Interface ### +### 7. Web 界面 ### -Finally if everything went accordingly, we'll be welcomed with WordPress when pointing the browser to http://ip-address/ or http://mywebsite.com/ . +最后如果一切正常的话,当我们用浏览器打开 http://ip-address/ 或者 http://mywebsite.com/ 的时候会看到 WordPress 的欢迎界面。 -![Wordpress Start](http://blog.linoxide.com/wp-content/uploads/2015/03/wordpress-start.png) +![启动Wordpress](http://blog.linoxide.com/wp-content/uploads/2015/03/wordpress-start.png) -Now, we'll go step wise through the web interface and setup wordpress configuration, username and password for the WordPress Panel. +现在,我们将通过 Web 界面为 WordPress 面板设置 WordPress 的配置、用户名和密码。 -![Wordpress Welcome](http://blog.linoxide.com/wp-content/uploads/2015/03/wordpress-welcome.png) +![Wordpress 欢迎界面](http://blog.linoxide.com/wp-content/uploads/2015/03/wordpress-welcome.png) -Then, use the username and password entered above into the WordPress Login page. +然后,用上面用户名和密码输入到 WordPress 登录界面。 -![wordpress login](http://blog.linoxide.com/wp-content/uploads/2015/03/wordpress-login.png) +![wordpress 登录](http://blog.linoxide.com/wp-content/uploads/2015/03/wordpress-login.png) -### Conclusion ### +### 总结 ### -We successfully built and run WordPress CMS under LEMP Stack running in CentOS 7 Operating System as the docker OS. Running WordPress inside a container makes a lot safe and secure to the host system from the security perspective. This article enables one to completely configure WordPress to run under Docker Container with Nginx Web Server. If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you ! Enjoy :-) +我们已经成功地在以 CentOS 7 作为 docker OS 的 LEMP 栈上构建并运行了 WordPress CMS。从安全层面来说,在容器中运行 WordPress 对于宿主系统更加安全可靠。这篇文章介绍了在 Docker 容器中运行的 Nginx Web 服务器上使用 WordPress 的完整配置。如果你有任何问题、建议、反馈,请在下面的评论框中写下来,让我们可以改进和更新我们的内容。非常感谢!Enjoy :-) -------------------------------------------------------------------------------- via: http://linoxide.com/linux-how-to/install-wordpress-nginx-docker-container/ 作者:[Arun Pyasi][a] -译者:[译者ID](https://github.com/译者ID) +译者:[ictlyh](https://github.com/ictlyh) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From b0b40b3b7bcaaeebf8555fd53f52a9ddbd2e1d32 Mon Sep 17 00:00:00 2001 From: joeren Date: Mon, 11 May 2015 14:43:00 +0800 Subject: [PATCH 126/133] Update 20150506 First Step Guide for Learning Shell Scripting.md --- .../20150506 First Step Guide for Learning Shell Scripting.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md b/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md index 8af4ef03e8..270177a3de 100644 --- a/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md +++ b/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md @@ -1,3 +1,4 @@ +Translating by GOLinux! First Step Guide for Learning Shell Scripting ================================================================================ ![](http://blog.linoxide.com/wp-content/uploads/2015/04/myfirstshellscript.jpg) @@ -456,4 +457,4 @@ via: http://linoxide.com/linux-shell-script/guide-start-learning-shell-scripting 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]:http://linoxide.com/author/petrasl/ \ No newline at end of file +[a]:http://linoxide.com/author/petrasl/ From 73cd54b1c0a8032880866fdbe939d4ce78131a52 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 11 May 2015 14:46:59 +0800 Subject: [PATCH 127/133] PUB:20150330 2 Ways to Create Your Own Docker Base Image @ictlyh --- ...ys to Create Your Own Docker Base Image.md | 57 +++++++++++++++++++ ...ys to Create Your Own Docker Base Image.md | 57 ------------------- 2 files changed, 57 insertions(+), 57 deletions(-) create mode 100644 published/20150330 2 Ways to Create Your Own Docker Base Image.md delete mode 100644 translated/tech/20150330 2 Ways to Create Your Own Docker Base Image.md diff --git a/published/20150330 2 Ways to Create Your Own Docker Base Image.md b/published/20150330 2 Ways to Create Your Own Docker Base Image.md new file mode 100644 index 0000000000..4c0030b191 --- /dev/null +++ b/published/20150330 2 Ways to Create Your Own Docker Base Image.md @@ -0,0 +1,57 @@ +两种方式创建你自己的 Docker 基本映像 +================================================================================ + +欢迎大家,今天我们学习一下 docker 基本映像以及如何构建我们自己的 docker 基本映像。[Docker][1] 是一个开源项目,提供了一个可以打包、装载和运行任何应用的轻量级容器的开放平台。它没有语言支持、框架和打包系统的限制,从小型的家用电脑到高端服务器,在何时何地都可以运行。这使它们可以不依赖于特定软件栈和供应商,像一块块积木一样部署和扩展网络应用、数据库和后端服务。 + +Docker 映像是不可更改的只读层。Docker 使用 **Union File System** 在只读文件系统上增加可读写的文件系统,但所有更改都发生在最顶层的可写层,而其下的只读映像上的原始文件仍然不会改变。由于映像不会改变,也就没有状态。基本映像是没有父类的那些映像。Docker 基本映像主要的好处是它允许我们有一个独立运行的 Linux 操作系统。 + +下面是我们如何可以创建自定义的基本映像的方式。 + +### 1. 使用 Tar 创建 Docker 基本映像 ### + +我们可以使用 tar 构建我们自己的基本映像,我们从一个运行中的 Linux 发行版开始,将其打包为基本映像。这过程可能会有些不同,它取决于我们打算构建的发行版。在 Debian 发行版中,已经预带了 debootstrap。在开始下面的步骤之前,我们需要安装 debootstrap。debootstrap 用来获取构建基本系统需要的包。这里,我们构建基于 Ubuntu 14.04 "Trusty" 的映像。要完成这些,我们需要在终端或者 shell 中运行以下命令。 + + $ sudo debootstrap trusty trusty > /dev/null + $ sudo tar -C trusty -c . | sudo docker import - trusty + +![使用debootstrap构建docker基本映像](http://blog.linoxide.com/wp-content/uploads/2015/03/creating-base-image-debootstrap.png) + +上面的命令为当前文件夹创建了一个 tar 文件并输出到标准输出中,"docker import - trusty" 通过管道从标准输入中获取这个 tar 文件并根据它创建一个名为 trusty 的基本映像。然后,如下所示,我们将运行映像内部的一条测试命令。 + + $ docker run trusty cat /etc/lsb-release + +[Docker GitHub Repo][2] 中有一些允许我们快速构建基本映像的事例脚本. + +### 2. 使用Scratch构建基本映像 ### + +在 Docker registry 中,有一个被称为 Scratch 的使用空 tar 文件构建的特殊库: + + $ tar cv --files-from /dev/null | docker import - scratch + +![使用scratch构建docker基本映像](http://blog.linoxide.com/wp-content/uploads/2015/03/creating-base-image-using-scratch.png) + +我们可以使用这个映像构建新的小容器: + + FROM scratch + ADD script.sh /usr/local/bin/run.sh + CMD ["/usr/local/bin/run.sh"] + +上面的 Dockerfile 文件来自一个很小的映像。这里,它首先从一个完全空的文件系统开始,然后它复制新建的 /usr/local/bin/run.sh 为 script.sh ,然后运行脚本 /usr/local/bin/run.sh。 + +### 结尾 ### + +这这个教程中,我们学习了如何构建一个开箱即用的自定义 Docker 基本映像。构建一个 docker 基本映像是一个很简单的任务,因为这里有很多已经可用的包和脚本。如果我们想要在里面安装想要的东西,构建 docker 基本映像非常有用。如果有任何疑问,建议或者反馈,请在下面的评论框中写下来。非常感谢!享受吧 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/2-ways-create-docker-base-image/ + +作者:[Arun Pyasi][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/arunp/ +[1]:https://www.docker.com/ +[2]:https://github.com/docker/docker/blob/master/contrib/mkimage-busybox.sh \ No newline at end of file diff --git a/translated/tech/20150330 2 Ways to Create Your Own Docker Base Image.md b/translated/tech/20150330 2 Ways to Create Your Own Docker Base Image.md deleted file mode 100644 index 63188ebc5b..0000000000 --- a/translated/tech/20150330 2 Ways to Create Your Own Docker Base Image.md +++ /dev/null @@ -1,57 +0,0 @@ -创建你自己的Docker基本映像的2中方式 -================================================================================ -欢迎大家,今天我们学习一下docker基本映像以及如何构建我们自己的docker基本映像。[Docker][1]是一个开源项目,为打包,装载和运行任何应用提供开发平台的轻量级容器。它没有语言支持,框架和打包系统的限制,从小型的家用电脑到高端的服务器,在何时何地都可以运行。这使它们成为不依赖于特定栈和供应商,很好的部署和扩展网络应用,数据库和后端服务的构建块。 - -Docker映像是不可更改的只读层。Docker使用**Union File System**在只读文件系统上增加读写文件系统。但所有更改都发生在最顶层的可写层,最底部,在只读映像上的原始文件仍然不会改变。由于映像不会改变,也就没有状态。基本映像是没有父类的那些映像。Docker基本映像主要的好处是它允许我们有一个独立允许的Linux操作系统。 - -下面是我们如何可以创建自定义基本映像的方式。 - -### 1. 使用Tar创建Docker基本映像 ### - -我们可以使用tar构建我们自己的基本映像,我们从将要打包为基本映像的运行中的Linux发行版开始构建。这过程可以会有些不同,它取决于我们打算构建的发行版。在Linux的发行版Debian中,已经预装了debootstrap。在开始下面的步骤之前,我们需要安装debootstrap。debootstrap用来获取构建基本系统需要的包。这里,我们构建基于Ubuntu 14.04 "Trusty" 的映像。做这些,我们需要在终端或者shell中运行以下命令。 - - $ sudo debootstrap trusty trusty > /dev/null - $ sudo tar -C trusty -c . | sudo docker import - trusty - -![使用debootstrap构建docker基本映像](http://blog.linoxide.com/wp-content/uploads/2015/03/creating-base-image-debootstrap.png) - -上面的命令为当前文件夹创建了一个tar文件并输出到STDOUT中,"docker import - trusty"从STDIN中获取这个tar文件并根据它创建一个名为trusty的基本映像。然后,如下所示,我们将运行映像内部的一条测试命令。 - - $ docker run trusty cat /etc/lsb-release - -[Docker GitHub Repo][2] 中有一些允许我们快速构建基本映像的事例脚本. - -### 2. 使用Scratch构建基本映像 ### - -在Docker的注册表中,有一个被称为Scratch的使用空tar文件构建的特殊库: - - $ tar cv --files-from /dev/null | docker import - scratch - -![使用scratch构建docker基本映像](http://blog.linoxide.com/wp-content/uploads/2015/03/creating-base-image-using-scratch.png) - - -我们可以使用这个映像构建新的小容器: - -FROM scratch -ADD script.sh /usr/local/bin/run.sh -CMD ["/usr/local/bin/run.sh"] - -上面的Docker文件来自一个很小的映像。这里,它首先从一个完全空的文件系统开始,然后它复制新建的/usr/local/bin/run.sh为script.sh,然后运行脚本/usr/local/bin/run.sh。 - -### 结尾 ### - -这这个教程中,我们学习了如果构建一个自定义的Docker基本映像。构建一个docker基本映像是一个很简单的任务,因为这里有很多已经可用的包和脚本。如果我们想要在里面安装想要的东西,构建docker基本映像非常有用。如果有任何疑问,建议或者反馈,请在下面的评论框中写下来。非常感谢!享受吧 :-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/2-ways-create-docker-base-image/ - -作者:[Arun Pyasi][a] -译者:[ictlyh](https://github.com/ictlyh) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/arunp/ -[1]:https://www.docker.com/ -[2]:https://github.com/docker/docker/blob/master/contrib/mkimage-busybox.sh \ No newline at end of file From 400a03f7e05d36d485370a2c4d4562100923f9ac Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Mon, 11 May 2015 15:01:53 +0800 Subject: [PATCH 128/133] =?UTF-8?q?20150511-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...k Interface Names for Ubuntu and Debian.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sources/news/20150511 Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian.md diff --git a/sources/news/20150511 Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian.md b/sources/news/20150511 Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian.md new file mode 100644 index 0000000000..d3d8014817 --- /dev/null +++ b/sources/news/20150511 Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian.md @@ -0,0 +1,31 @@ +Ubuntu Devs Propose Stateless Persistent Network Interface Names for Ubuntu and Debian +====================================================================================== +*Networks are detected in an unpredictable and unstable order* + +**Martin Pitt, a renown Ubuntu and Debian developer, came with the proposal of enabling stateless persistent network interface names in the upcoming versions of the Ubuntu Linux and Debian GNU/Linux operating systems.** + +According to Mr. Pitt, it appears that the problem lies in the automatic detection of network interfaces within the Linux kernel. As such, network interfaces are detected in an unstable and unpredictable order. However, it order to connect to a certain network interface in ifupdown or networkd users will need to identify it first using a stable name. + +"The general schema for this is to have an udev rule which does some matches to identify a particular interface, and assings a NAME="foo" to it," says Martin Pitt in an email to the Ubuntu mailinglist. "Interfaces with an explicit NAME= get called just like this, and others just get a kernel driver default, usually ethN, wlanN, or sometimes others (some wifi drivers have their own naming schemas)." + +**Sever solutions appeared over the years: mac, biosdevname, and ifnames** + +Apparently, several solutions are available for this problem, including an installation of an udev rule in /lib/udev/rules.d/75-persistent-net-generator.rules that creates a MAC address at first boot and writes it to /etc/udev/rules.d/70-persistent-net.rules, which is currently used by default in Ubuntu and applies to most hardware components. + +Other solutions include biosdevname, a package that reads port or index numbers, and slot names from the BIOS and writes them to /lib/udev/rules.d/71-biosdevname.rules, and ifnames, a persistent name generator that automatically checks the BIOS and/or firmware for index numbers or slot names, similar to biosdevname. + +However, the difference between ifnames and biosdevname is that the latter falls back to slot names, such as PCI numbers, and then to the MAC address and writes to /lib/udev/rules.d/80-net-setup-link.rules. All of these solutions can be combined, and Martin Pitt proposes to replace the first solution that is now used by default with the ifnames one. + +If a new solution is implemented, a lot of networking issues will be resolved in Ubuntu, especially the cloud version. In addition, it will provide for stable network interface names for all new Ubuntu installations, and resolve many other problems related to system-image, etc. + +-------------------------------------------------------------------------------- + +via: http://news.softpedia.com/news/Ubuntu-Devs-Propose-Stateless-Persistent-Network-Interface-Names-for-Ubuntu-and-Debian-480730.shtml + +作者:[Marius Nestor][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://news.softpedia.com/editors/browse/marius-nestor From 1db7909202c1f8f153b267b5a608bfd4e12fa9b8 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 11 May 2015 15:12:22 +0800 Subject: [PATCH 129/133] PUB:20150124 Why does C++ promote an int to a float when a float cannot represent all int values @KayGuoWhu --- ...oat when a float cannot represent all int values.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/talk => published}/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md (93%) diff --git a/translated/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md b/published/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md similarity index 93% rename from translated/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md rename to published/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md index e9dd6e997c..8d0d835ad5 100644 --- a/translated/talk/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md +++ b/published/20150124 Why does C++ promote an int to a float when a float cannot represent all int values.md @@ -1,7 +1,7 @@ 既然float不能表示所有的int,那为什么在类型转换时C++将int转换成float? ---------- +============= -#问题: +###问题: 代码如下: @@ -13,7 +13,7 @@ if (i == f) // 执行某段代码 编译器会将i转换成float类型,然后比较这两个float的大小,但是float能够表示所有的int吗?为什么没有将int和float转换成double类型进行比较呢? -#回答: +###回答: 在整型数的演变中,当`int`变成`unsigned`时,会丢掉负数部分(有趣的是,这样的话,`0u < -1`就是对的了)。 @@ -32,11 +32,11 @@ if((double) i < (double) f) 顺便提一下,在这个问题中有趣的是,`unsigned`的优先级高于`int`,所以把`int`和`unsigned`进行比较时,最终进行的是unsigned类型的比较(开头提到的`0u < -1`就是这个道理)。我猜测这可能是在早些时候(计算机发展初期),当时的人们认为`unsigned`比`int`在所表示的数值范围上受到的限制更小:现在还不需要符号位,所以可以使用额外的位来表示更大的数值范围。如果你觉得`int`可能会溢出,那么就使用unsigned好了——在使用16位表示的ints时这个担心会更明显。 ---- -via:[stackoverflow](http://stackoverflow.com/questions/28010565/why-does-c-promote-an-int-to-a-float-when-a-float-cannot-represent-all-int-val/28011249#28011249) +via: [stackoverflow](http://stackoverflow.com/questions/28010565/why-does-c-promote-an-int-to-a-float-when-a-float-cannot-represent-all-int-val/28011249#28011249) 作者:[wintermute][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 From 4d48e67c8ac4f3e452c06c3278fae584d57c7e66 Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 11 May 2015 15:59:40 +0800 Subject: [PATCH 130/133] PUB:20150507 Command Line Tool to Monitor Linux Containers Performance @GOLinux --- ...to Monitor Linux Containers Performance.md | 71 +++++++++---------- 1 file changed, 32 insertions(+), 39 deletions(-) rename {translated/tech => published}/20150507 Command Line Tool to Monitor Linux Containers Performance.md (70%) diff --git a/translated/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md b/published/20150507 Command Line Tool to Monitor Linux Containers Performance.md similarity index 70% rename from translated/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md rename to published/20150507 Command Line Tool to Monitor Linux Containers Performance.md index d33e68ffd9..161e030c11 100644 --- a/translated/tech/20150507 Command Line Tool to Monitor Linux Containers Performance.md +++ b/published/20150507 Command Line Tool to Monitor Linux Containers Performance.md @@ -1,6 +1,6 @@ -监控Linux容器性能的命令行神器 +监控 Linux 容器性能的命令行神器 ================================================================================ -ctop是一个新的基于命令行的工具,它可用于在容器层级监控进程。容器通过利用控制器组(cgroup)的资源管理功能,提供了操作系统层级的虚拟化环境。该工具收集来自cgroup的与内存、CPU、块输入输出和诸如拥有者、开机时间等相关的元数据,并以人性化的格式呈现给用户,这样就可以快速对系统健康状况进行评估。基于所获得的数据,它可以尝试推测潜在的容器技术。ctop也有助于在低内存环境中检测出谁在消耗大量的内存。 +ctop是一个新的基于命令行的工具,它可用于在容器层级监控进程。容器通过利用控制器组(cgroup)的资源管理功能,提供了操作系统层级的虚拟化环境。该工具从cgroup收集与内存、CPU、块输入输出的相关数据,以及拥有者、开机时间等元数据,并以人性化的格式呈现给用户,这样就可以快速对系统健康状况进行评估。基于所获得的数据,它可以尝试推测下层的容器技术。ctop也有助于在低内存环境中检测出谁在消耗大量的内存。 ### 功能 ### @@ -8,11 +8,11 @@ ctop的一些功能如下: - 收集CPU、内存和块输入输出的度量值 - 收集与拥有者、容器技术和任务统计相关的信息 -- 使用任何栏目对信息排序 +- 通过任意栏对信息排序 - 以树状视图显示信息 - 折叠/展开cgroup树 - 选择并跟踪cgroup/容器 -- 选择显示数据刷新时间框架 +- 选择显示数据刷新的时间窗口 - 暂停刷新数据 - 检测基于systemd、Docker和LXC的容器 - 基于Docker和LXC的容器的高级特性 @@ -21,7 +21,7 @@ ctop的一些功能如下: ### 安装 ### -**ctop**是由Python写成的,因此,除了需要Python 2.6或其更高版本外(支持内建光标),别无其它外部依赖。推荐使用Python的pip进行安装,如果还没有安装pip,请先安装,然后使用pip安装ctop。 +**ctop**是由Python写成的,因此,除了需要Python 2.6或其更高版本外(带有内建的光标支持),别无其它外部依赖。推荐使用Python的pip进行安装,如果还没有安装pip,请先安装,然后使用pip安装ctop。 *注意:本文样例来自Ubuntu(14.10)系统* @@ -84,19 +84,18 @@ ctop的一些功能如下: 下面是ctop的输出样例: ![ctop screen](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop.png) -ctop屏幕 + +*ctop屏幕* ### 用法选项 ### ctop [--tree] [--refresh=] [--columns=] [--sort-col=] [--follow=] [--fold=, ...] ctop (-h | --help) -一旦你进入ctop屏幕,使用上(↑)和下(↓)箭头键在容器间导航。点击某个容器就选定了该容器,按q或Ctrl+C退出容器。 +当你进入ctop屏幕,可使用上(↑)和下(↓)箭头键在容器间导航。点击某个容器就选定了该容器,按q或Ctrl+C退出该容器。 现在,让我们来看看上面列出的那一堆选项究竟是怎么用的吧。 - -h / --help - Show the help screen - ----------- +**-h / --help - 显示帮助信息** poornima@poornima-Lenovo:~$ ctop -h Usage: ctop [options] @@ -111,72 +110,66 @@ ctop屏幕 --sort-col=SORT_COL Select column to sort by initially. Can be changed dynamically. ----------- - --tree - Display tree view of the containers +**--tree - 显示容器的树形视图** 默认情况下,会显示列表视图 -一旦你进入ctop窗口,你可以使用F5按钮在树状/列表视图间切换。 +当你进入ctop窗口,你可以使用F5按钮在树状/列表视图间切换。 - --fold= - Fold the cgroup path in the tree view. +**--fold= - 在树形视图中折叠名为 \ 的 cgroup 路径** - This option needs to be used in combination with --tree. +该选项需要与 --tree 选项组合使用。 ----------- - - Eg: ctop --tree --fold=/user.slice +例子: ctop --tree --fold=/user.slice ![Output of 'ctop --fold'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-fold.png) -‘ctop --fold’的输出 + +*'ctop --fold'的输出* 在ctop窗口中,使用+/-键来展开或折叠子cgroup。 注意:在写本文时,pip仓库中还没有最新版的ctop,还不支持命令行的‘--fold’选项 - --follow= - Follow/Highlight the cgroup path. +**--follow= - 跟踪/高亮 cgroup 路径** ----------- - - Eg: ctop --follow=/user.slice/user-1000.slice +例子: ctop --follow=/user.slice/user-1000.slice 正如你在下面屏幕中所见到的那样,带有“/user.slice/user-1000.slice”路径的cgroup被高亮显示,这让用户易于跟踪,就算显示位置变了也一样。 ![Output of 'ctop --follow'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-follow.png) -‘ctop --follow’的输出 + +*'ctop --follow'的输出* 你也可以使用‘f’按钮来让高亮的行跟踪选定的容器。默认情况下,跟踪是关闭的。 - --refresh= - Refresh the display at the given rate. Default 1 sec +**--refresh= - 按指定频率刷新显示,默认1秒** 这对于按每用户需求来显示改变刷新率时很有用。使用‘p’按钮可以暂停刷新并选择文本。 - --columns= - Can limit the display to selected . 'name' should be the first entry followed by other columns. By default, the columns include owner, processes,memory, cpu-sys, cpu-user, blkio, cpu-time. +**--columns= - 限定只显示选定的列。'name' 需要是第一个字段,其后跟着其它字段。默认情况下,字段包括:owner, processes,memory, cpu-sys, cpu-user, blkio, cpu-time** ----------- - - Eg: ctop --columns=name,owner,type,memory +例子: ctop --columns=name,owner,type,memory ![Output of 'ctop --column'](http://blog.linoxide.com/wp-content/uploads/2015/05/ctop-column.png) -‘ctop --column’的输出 - -sort-col= - column using which the displayed data should be sorted. By default it is sorted using cpu-user +*'ctop --column'的输出* ----------- +**-sort-col= - 按指定的列排序。默认使用 cpu-user 排序** - Eg: ctop --sort-col=blkio +例子: ctop --sort-col=blkio 如果有Docker和LXC支持的额外容器,跟踪选项也是可用的: - press 'a' - attach to console output + press 'a' - 接驳到终端输出 - press 'e' - open a shell in the container context + press 'e' - 打开容器中的一个 shell - press 's' – stop the container (SIGTERM) + press 's' - 停止容器 (SIGTERM) - press 'k' - kill the container (SIGKILL) + press 'k' - 杀死容器 (SIGKILL) -[ctop][1]当前还处于Jean-Tiare Le Bigot的开发中,希望我们能在该工具中见到像本地top命令一样的特性 :-) +目前 Jean-Tiare Le Bigot 还在积极开发 [ctop][1] 中,希望我们能在该工具中见到像本地 top 命令一样的特性 :-) -------------------------------------------------------------------------------- @@ -184,7 +177,7 @@ via: http://linoxide.com/how-tos/monitor-linux-containers-performance/ 作者:[B N Poornima][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 From b4beba8cae2467ab9bdfd66bb3111d70707b98df Mon Sep 17 00:00:00 2001 From: DeadFire Date: Mon, 11 May 2015 16:53:16 +0800 Subject: [PATCH 131/133] =?UTF-8?q?20150511-1=20=E9=80=89=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...n Source History--Why Did Linux Succeed.md | 73 ++++ ...x Various Update Errors In Ubuntu 14.04.md | 151 +++++++ ...e CA including OCSP, CRL and revocation.md | 405 ++++++++++++++++++ 3 files changed, 629 insertions(+) create mode 100644 sources/talk/20150511 Open Source History--Why Did Linux Succeed.md create mode 100644 sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md create mode 100644 sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md diff --git a/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md b/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md new file mode 100644 index 0000000000..9a5a19686a --- /dev/null +++ b/sources/talk/20150511 Open Source History--Why Did Linux Succeed.md @@ -0,0 +1,73 @@ +Open Source History: Why Did Linux Succeed? +================================================================================ +> Why did Linux, the Unix-like operating system kernel started by Linus Torvalds in 1991 that became central to the open source world, succeed where so many similar projects, including GNU HURD and the BSDs, fail? + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/linux.jpg) + +One of the most puzzling questions about the history of free and open source is this: Why did Linux succeed so spectacularly, whereas similar attempts to build a free or open source, Unix-like operating system kernel met with considerably less success? I don't know the answer to that question. But I have rounded up some theories, which I'd like to lay out here. + +First, though, let me make clear what I mean when I write that Linux was a great success. I am defining it in opposition primarily to the variety of other Unix-like operating system kernels, some of them open and some not, that proliferated around the time Linux was born. [GNU][1] HURD, the free-as-in-freedom kernel whose development began in [May 1991][2], is one of them. Others include Unices that most people today have never heard of, such as various derivatives of the Unix variant developed at the University of California at Berkeley, BSD; Xenix, Microsoft's take on Unix; academic Unix clones including Minix; and the original Unix developed under the auspices of AT&T, which was vitally important in academic and commercial computing circles during earlier decades, but virtually disappeared from the scene by the 1990s. + +#### Related #### + +- [Open Source History: Tracing the Origins of Hacker Culture and the Hacker Ethic][3] +- [Unix and Personal Computers: Reinterpreting the Origins of Linux][4] + +I'd also like to make clear that I'm writing here about kernels, not complete operating systems. To a great extent, the Linux kernel owes its success to the GNU project as a whole, which produced the crucial tools, including compilers, a debugger and a BASH shell implementation, that are necessary to build a Unix-like operating system. But GNU developers never created a viable version of the the HURD kernel (although they are [still trying][5]). Instead, Linux ended up as the kernel that glued the rest of the GNU pieces together, even though that had never been in the GNU plans. + +So it's worth asking why Linux, a kernel launched by Linus Torvalds, an obscure programmer in Finland, in 1991—the same year as HURD—endured and thrived within a niche where so many other Unix-like kernels, many of which enjoyed strong commercial backing and association with the leading Unix hackers of the day, failed to take off. To that end, here are a few theories pertaining to that question that I've come across as I've researched the history of the free and open source software worlds, along with the respective strengths and weaknesses of these various explanations. + +### Linux Adopted a Decentralized Development Approach ### + +This is the argument that comes out of Eric S. Raymond's essay, "[The Cathedral and the Bazaar][6]," and related works, which make the case that software develops best when a large number of contributors collaborate continuously within a relatively decentralized organizational structure. That was generally true of Linux, in contrast to, for instance, GNU HURD, which took a more centrally directed approach to code development—and, as a result, "had been evidently failing" to build a complete operating system for a decade, in Raymond's view. + +To an extent, this explanation makes sense, but it has some significant flaws. For one, Torvalds arguably assumed a more authoritative role in directing Linux code development—deciding which contributions to include and reject—than Raymond and others have wanted to recognize. For another, this reasoning does not explain why GNU succeeded in producing so much software besides a working kernel. If only decentralized development works well in the free/open source software world, then all of GNU's programming efforts should have been a bust—which they most certainly were not. + +### Linux is Pragmatic; GNU is Ideological ### + +Personally, I find this explanation—which supposes that Linux grew so rapidly because its founder was a pragmatist who initially wrote the kernel just to be able to run a tailored Unix OS on his computer at home, not as part of a crusade to change the world through free software, as the GNU project aimed to do—the most compelling. + +Still, it has some weaknesses that make it less than completely satisfying. In particular, while Torvalds himself adopted pragmatic principles, not all members of the community that coalesced around his project, then or today, have done the same. Yet, Linux has succeeded all the same. + +Moreover, if pragmatism was the key to Linux's endurance, then why, again, was GNU successful in building so many other tools besides a kernel? If having strong political beliefs about software prevents you from pursuing successful projects, GNU should have been an outright failure, not an endeavor that produced a number of software packages that remain foundational to the IT world today. + +Last but not least, many of the other Unix variants of the late 1980s and early 1990s, especially several BSD off-shoots, were the products of pragmatism. Their developers aimed to build Unix variants that could be more freely shared than those restricted by expensive commercial licenses, but they were not deeply ideological about programming or sharing code. Neither was Torvalds, and it is therefore difficult to explain Linux's success, and the failure of other Unix projects, in terms of ideological zeal. + +### Operating System Design ### + +There are technical differences between Linux and some other Unix variants that are important to keep in mind when considering the success of Linux. Richard Stallman, the founder of the GNU project, pointed to these in explaining, in an email to me, why HURD development had lagged: "It is true that the GNU Hurd is not a practical success. Part of the reason is that its basic design made it somewhat of a research project. (I chose that design thinking it was a shortcut to get a working kernel in a hurry.)" + +Linux is also different from other Unix variants in the sense that Torvalds wrote all of the Linux code himself. Having a Unix of his own, free of other people's code, was one of his stated intentions when he [first announced Linux][7] in August 1991. This characteristic sets Linux apart from most of the other Unix variants that existed at that time, which derived their code bases from either AT&T Unix or Berkeley's BSD. + +I'm not a computer scientist, so I'm not qualified to decide whether the Linux code was simply superior to that of the other Unices, explaining why Linux succeeded. But that's an argument someone might make—although it does not account for the disparity in culture and personnel between Linux and other Unix kernels, which, to me, seem more important than code in understanding Linux's success. + +### The "Community" Put Its Support Behind Linux ### + +Stallman also wrote that "mainly the reason" for Linux's success was that "Torvalds made Linux free software, and since then more of the community's effort has gone into Linux than into the Hurd." That's not exactly a complete explanation for Linux's trajectory, since it does not account for why the community of free software developers followed Torvalds instead of HURD or another Unix. But it nonetheless highlights this shift as a large part of how Linux prevailed. + +A fuller account of the free software community's decision to endorse Linux would have to explain why developers did so even though, at first, Linux was a very obscure project—much more so, by any measure, than some of the other attempts at the time to create a freer Unix, such as NET BSD and 386/BSD—as well as one whose affinity with the goals of the free software movement was not at first clear. Originally, Torvalds released Linux under a license that simply prevented its commercial use. It was considerably later that he switched to the GNU General Public License, which protects the openness of source code. + +So, those are the explanations I've found for Linux's success as an open source operating system kernel—a success which, to be sure, has been measured in some respects (desktop Linux never became what its proponents hoped, for instance). But Linux has also become foundational to the computing world in ways that no other Unix-like OS has. Maybe Apple OS X and iOS, which derive from BSD, come close, but they don't play such a central role as Linux in powering the Internet, among other things. + +Have other ideas on why Linux became what it did, or why its counterparts in the Unix world have now almost all sunk into obscurity? (I know: BSD variants still have a following today, and some commercial Unices remain important enough for [Red Hat][8] (RHT) to be [courting their users][9]. But none of these Unix holdouts have conquered everything from Web servers to smartphones in the way Linux has.) I'd be delighted to hear them. + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/050415/open-source-history-why-did-linux-succeed + +作者:[hristopher Tozzi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://thevarguy.com/author/christopher-tozzi +[1]:http://gnu.org/ +[2]:http://www.gnu.org/software/hurd/history/hurd-announce +[3]:http://thevarguy.com/open-source-application-software-companies/042915/open-source-history-tracing-origins-hacker-culture-and-ha +[4]:http://thevarguy.com/open-source-application-software-companies/042715/unix-and-personal-computers-reinterpreting-origins-linux +[5]:http://thevarguy.com/open-source-application-software-companies/042015/30-years-hurd-lives-gnu-updates-open-source- +[6]:http://www.catb.org/esr/writings/cathedral-bazaar/cathedral-bazaar/ +[7]:https://groups.google.com/forum/#!topic/comp.os.minix/dlNtH7RRrGA[1-25] +[8]:http://www.redhat.com/ +[9]:http://thevarguy.com/open-source-application-software-companies/032614/red-hat-grants-certification-award-unix-linux-migration-a \ No newline at end of file diff --git a/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md b/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md new file mode 100644 index 0000000000..a84fc1b061 --- /dev/null +++ b/sources/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md @@ -0,0 +1,151 @@ +Fix Various Update Errors In Ubuntu 14.04 +================================================================================ +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Fix_Ubuntu_Update_Error.jpeg) + +Who hasn’t come across an error while doing an update in Ubuntu? Update errors are common and plenty in Ubuntu and other Linux distributions based on Ubuntu. These errors occur for various reasons and can be fixed easily. In this article, we shall see various types of frequently occurring update errors in Ubuntu and how to fix them. + +### Problem With MergeList ### + +When you run update in terminal, you may encounter an error “[problem with MergeList][1]” like below: + +> E:Encountered a section with no Package: header, +> +> E:Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_precise_universe_binary-i386_Packages, +> +> E:The package lists or status file could not be parsed or opened.’ + +To fix this error, use the following commands: + + sudo rm -r /var/lib/apt/lists/* + sudo apt-get clean && sudo apt-get update + +### Failed to download repository information -1 ### + +There are actually two types of [failed to download repository information errors][2]. If your error read like this: + +> W:Failed to fetch bzip2:/var/lib/apt/lists/partial/in.archive.ubuntu.com_ubuntu_dists_oneiric_restricted_binary-i386_Packages Hash Sum mismatch, +> +> W:Failed to fetch bzip2:/var/lib/apt/lists/partial/in.archive.ubuntu.com_ubuntu_dists_oneiric_multiverse_binary-i386_Packages Hash Sum mismatch, +> +> E:Some index files failed to download. They have been ignored, or old ones used instead + +Then you can use the following commands to fix it: + + sudo rm -rf /var/lib/apt/lists/* + sudo apt-get update + +### Failed to download repository information -2 ### + +Th other type of failed to download repository information error is because of outdated PPA. Usually, when you run Update Manager and see an error like this: + +![](Th other type of failed to download repository information error is because of outdated PPA. Usually, when you run Update Manager and see an error like this:) + +You can run sudo apt-get update to see what PPAs are failing. And you can remove it from the sources list. You can follow this screenshot guide to [fix failed to download repository information error][3]. + +### Failed to download package files error ### + +A similar error is [failed to download package files error][4] like this: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Ubuntu_Update_error.jpeg) + +This can be easily fixed by changing the software sources to Main server. Go to Software & Updates and in there changed the download server to Main server: + +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Change_server_Ubuntu.jpeg) + +### Partial upgrade error ### + +Running updates in terminal may throw this [partial upgrade error][5]: + +> Not all updates can be installed +> +> Run a partial upgrade, to install as many updates as possible + +Run the following command in terminal to fix this error: + + sudo apt-get install -f + +### error while loading shared libraries ### + +This is more of an installation error than update error. If you try to install a program from source code, you may encounter this error: + +> error while loading shared libraries: +> +> cannot open shared object file: No such file or directory + +This error can be fixed by running the following command in terminal: + + sudo /sbin/ldconfig -v + +You can find more details on this [error while loading shared libraries][6]. + +### Could not get lock /var/cache/apt/archives/lock ### + +This error happens when another program is using APT. Suppose you are installing some thing in Ubuntu Software Center and trying to run apt in terminal. + +> E: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable) +> +> E: Unable to lock directory /var/cache/apt/archives/ + +Normally, this should be fine if you close all other programs using apt but if the problem persists, use the following command: + + sudo rm /var/lib/apt/lists/lock + +If the above command doesn’t work, try this command: + + sudo killall apt-get + +More details about this error can be found [here][7]. + +### GPG error: The following signatures couldn’t be verified ### + +Adding a PPA may result in the following [GPG error: The following signatures couldn’t be verified][8] when you try to run an update in terminal: + +> W: GPG error: http://repo.mate-desktop.org saucy InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 68980A0EA10B4DE8 + +All we need to do is to fetch this public key in the system. Get the key number from the message. In the above message, the key is 68980A0EA10B4DE8. This key can be used in the following manner: + + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68980A0EA10B4DE8 + +Once the key has been added, run an update again and it will be fine. + +### BADSIG error ### + +Another signature related Ubuntu update error is [BADSIG error][9] which looks something like this: + +> W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com precise Release: The following signatures were invalid: BADSIG 16126D3A3E5C1192 Ubuntu Extras Archive Automatic Signing Key +> +> W: GPG error: http://ppa.launchpad.net precise Release: +> +> The following signatures were invalid: BADSIG 4C1CBC1B69B0E2F4 Launchpad PPA for Jonathan French W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release + +To fix this BADSIG error, use the following commands in terminal: + + sudo apt-get clean + cd /var/lib/apt + sudo mv lists oldlist + sudo mkdir -p lists/partial + sudo apt-get clean + sudo apt-get update + +That compiles the list of frequent **Ubuntu update errors** you may encounter. I hope this helps you to get rid of these errors. Have you encountered any other update error in Ubuntu as well? Do mention it in comments and I’ll try to do a quick tutorial on it. + +-------------------------------------------------------------------------------- + +via: http://itsfoss.com/fix-update-errors-ubuntu-1404/ + +作者:[Abhishek][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://itsfoss.com/author/abhishek/ +[1]:http://itsfoss.com/how-to-fix-problem-with-mergelist/ +[2]:http://itsfoss.com/solve-ubuntu-error-failed-to-download-repository-information-check-your-internet-connection/ +[3]:http://itsfoss.com/failed-to-download-repository-information-ubuntu-13-04/ +[4]:http://itsfoss.com/fix-failed-download-package-files-error-ubuntu/ +[5]:http://itsfoss.com/fix-partial-upgrade-error-elementary-os-luna-quick-tip/ +[6]:http://itsfoss.com/solve-open-shared-object-file-quick-tip/ +[7]:http://itsfoss.com/fix-ubuntu-install-error/ +[8]:http://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/ +[9]:http://itsfoss.com/solve-badsig-error-quick-tip/ \ No newline at end of file diff --git a/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md b/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md new file mode 100644 index 0000000000..f584e31f11 --- /dev/null +++ b/sources/tech/20150511 OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation.md @@ -0,0 +1,405 @@ +OpenSSL command line Root and Intermediate CA including OCSP, CRL and revocation +================================================================================ +These are quick and dirty notes on generating a certificate authority (CA), intermediate certificate authorities and end certificates using OpenSSL. It includes OCSP, CRL and CA Issuer information and specific issue and expiry dates. + +We'll set up our own root CA. We'll use the root CA to generate an example intermediate CA. We'll use the intermediate CA to sign end user certificates. + +### Root CA ### + +Create and move in to a folder for the root ca: + + mkdir ~/SSLCA/root/ + cd ~/SSLCA/root/ + +Generate a 8192-bit long SHA-256 RSA key for our root CA: + + openssl genrsa -aes256 -out rootca.key 8192 + +Example output: + + Generating RSA private key, 8192 bit long modulus + .........++ + ....................................................................................................................++ + e is 65537 (0x10001) + +If you want to password-protect this key, add the option `-aes256`. + +Create the self-signed root CA certificate `ca.crt`; you'll need to provide an identity for your root CA: + + openssl req -sha256 -new -x509 -days 1826 -key rootca.key -out rootca.crt + +Example output: + + You are about to be asked to enter information that will be incorporated + into your certificate request. + What you are about to enter is what is called a Distinguished Name or a DN. + There are quite a few fields but you can leave some blank + For some fields there will be a default value, + If you enter '.', the field will be left blank. + ----- + Country Name (2 letter code) [AU]:NL + State or Province Name (full name) [Some-State]:Zuid Holland + Locality Name (eg, city) []:Rotterdam + Organization Name (eg, company) [Internet Widgits Pty Ltd]:Sparkling Network + Organizational Unit Name (eg, section) []:Sparkling CA + Common Name (e.g. server FQDN or YOUR name) []:Sparkling Root CA + Email Address []: + +Create a few files where the CA will store it's serials: + + touch certindex + echo 1000 > certserial + echo 1000 > crlnumber + +Place the CA config file. This file has stubs for CRL and OCSP endpoints. + + # vim ca.conf + [ ca ] + default_ca = myca + + [ crl_ext ] + issuerAltName=issuer:copy + authorityKeyIdentifier=keyid:always + + [ myca ] + dir = ./ + new_certs_dir = $dir + unique_subject = no + certificate = $dir/rootca.crt + database = $dir/certindex + private_key = $dir/rootca.key + serial = $dir/certserial + default_days = 730 + default_md = sha1 + policy = myca_policy + x509_extensions = myca_extensions + crlnumber = $dir/crlnumber + default_crl_days = 730 + + [ myca_policy ] + commonName = supplied + stateOrProvinceName = supplied + countryName = optional + emailAddress = optional + organizationName = supplied + organizationalUnitName = optional + + [ myca_extensions ] + basicConstraints = critical,CA:TRUE + keyUsage = critical,any + subjectKeyIdentifier = hash + authorityKeyIdentifier = keyid:always,issuer + keyUsage = digitalSignature,keyEncipherment,cRLSign,keyCertSign + extendedKeyUsage = serverAuth + crlDistributionPoints = @crl_section + subjectAltName = @alt_names + authorityInfoAccess = @ocsp_section + + [ v3_ca ] + basicConstraints = critical,CA:TRUE,pathlen:0 + keyUsage = critical,any + subjectKeyIdentifier = hash + authorityKeyIdentifier = keyid:always,issuer + keyUsage = digitalSignature,keyEncipherment,cRLSign,keyCertSign + extendedKeyUsage = serverAuth + crlDistributionPoints = @crl_section + subjectAltName = @alt_names + authorityInfoAccess = @ocsp_section + + [alt_names] + DNS.0 = Sparkling Intermidiate CA 1 + DNS.1 = Sparkling CA Intermidiate 1 + + [crl_section] + URI.0 = http://pki.sparklingca.com/SparklingRoot.crl + URI.1 = http://pki.backup.com/SparklingRoot.crl + + [ocsp_section] + caIssuers;URI.0 = http://pki.sparklingca.com/SparklingRoot.crt + caIssuers;URI.1 = http://pki.backup.com/SparklingRoot.crt + OCSP;URI.0 = http://pki.sparklingca.com/ocsp/ + OCSP;URI.1 = http://pki.backup.com/ocsp/ + +If you need to set a specific certificate start / expiry date, add the following to `[myca]` + + # format: YYYYMMDDHHMMSS + default_enddate = 20191222035911 + default_startdate = 20181222035911 + +### Creating Intermediate 1 CA ### + +Generate the intermediate CA's private key: + + openssl genrsa -out intermediate1.key 4096 + +Generate the intermediate1 CA's CSR: + + openssl req -new -sha256 -key intermediate1.key -out intermediate1.csr + +Example output: + + You are about to be asked to enter information that will be incorporated + into your certificate request. + What you are about to enter is what is called a Distinguished Name or a DN. + There are quite a few fields but you can leave some blank + For some fields there will be a default value, + If you enter '.', the field will be left blank. + ----- + Country Name (2 letter code) [AU]:NL + State or Province Name (full name) [Some-State]:Zuid Holland + Locality Name (eg, city) []:Rotterdam + Organization Name (eg, company) [Internet Widgits Pty Ltd]:Sparkling Network + Organizational Unit Name (eg, section) []:Sparkling CA + Common Name (e.g. server FQDN or YOUR name) []:Sparkling Intermediate CA + Email Address []: + + Please enter the following 'extra' attributes + to be sent with your certificate request + A challenge password []: + An optional company name []: + +Make sure the subject (CN) of the intermediate is different from the root. + +Sign the intermediate1 CSR with the Root CA: + + openssl ca -batch -config ca.conf -notext -in intermediate1.csr -out intermediate1.crt + +Example Output: + + Using configuration from ca.conf + Check that the request matches the signature + Signature ok + The Subject's Distinguished Name is as follows + countryName :PRINTABLE:'NL' + stateOrProvinceName :ASN.1 12:'Zuid Holland' + localityName :ASN.1 12:'Rotterdam' + organizationName :ASN.1 12:'Sparkling Network' + organizationalUnitName:ASN.1 12:'Sparkling CA' + commonName :ASN.1 12:'Sparkling Intermediate CA' + Certificate is to be certified until Mar 30 15:07:43 2017 GMT (730 days) + + Write out database with 1 new entries + Data Base Updated + +Generate the CRL (both in PEM and DER): + + openssl ca -config ca.conf -gencrl -keyfile rootca.key -cert rootca.crt -out rootca.crl.pem + + openssl crl -inform PEM -in rootca.crl.pem -outform DER -out rootca.crl + +Generate the CRL after every certificate you sign with the CA. + +If you ever need to revoke the this intermediate cert: + + openssl ca -config ca.conf -revoke intermediate1.crt -keyfile rootca.key -cert rootca.crt + +### Configuring the Intermediate CA 1 ### + +Create a new folder for this intermediate and move in to it: + + mkdir ~/SSLCA/intermediate1/ + cd ~/SSLCA/intermediate1/ + +Copy the Intermediate cert and key from the Root CA: + + cp ~/SSLCA/root/intermediate1.key ./ + cp ~/SSLCA/root/intermediate1.crt ./ + +Create the index files: + + touch certindex + echo 1000 > certserial + echo 1000 > crlnumber + +Create a new `ca.conf` file: + + # vim ca.conf + [ ca ] + default_ca = myca + + [ crl_ext ] + issuerAltName=issuer:copy + authorityKeyIdentifier=keyid:always + + [ myca ] + dir = ./ + new_certs_dir = $dir + unique_subject = no + certificate = $dir/intermediate1.crt + database = $dir/certindex + private_key = $dir/intermediate1.key + serial = $dir/certserial + default_days = 365 + default_md = sha1 + policy = myca_policy + x509_extensions = myca_extensions + crlnumber = $dir/crlnumber + default_crl_days = 365 + + [ myca_policy ] + commonName = supplied + stateOrProvinceName = supplied + countryName = optional + emailAddress = optional + organizationName = supplied + organizationalUnitName = optional + + [ myca_extensions ] + basicConstraints = critical,CA:FALSE + keyUsage = critical,any + subjectKeyIdentifier = hash + authorityKeyIdentifier = keyid:always,issuer + keyUsage = digitalSignature,keyEncipherment + extendedKeyUsage = serverAuth + crlDistributionPoints = @crl_section + subjectAltName = @alt_names + authorityInfoAccess = @ocsp_section + + [alt_names] + DNS.0 = example.com + DNS.1 = example.org + + [crl_section] + URI.0 = http://pki.sparklingca.com/SparklingIntermidiate1.crl + URI.1 = http://pki.backup.com/SparklingIntermidiate1.crl + + [ocsp_section] + caIssuers;URI.0 = http://pki.sparklingca.com/SparklingIntermediate1.crt + caIssuers;URI.1 = http://pki.backup.com/SparklingIntermediate1.crt + OCSP;URI.0 = http://pki.sparklingca.com/ocsp/ + OCSP;URI.1 = http://pki.backup.com/ocsp/ + +Change the `[alt_names]` section to whatever you need as Subject Alternative names. Remove it including the `subjectAltName = @alt_names` line if you don't want a Subject Alternative Name. + +If you need to set a specific certificate start / expiry date, add the following to `[myca]` + + # format: YYYYMMDDHHMMSS + default_enddate = 20191222035911 + default_startdate = 20181222035911 + +Generate an empty CRL (both in PEM and DER): + + openssl ca -config ca.conf -gencrl -keyfile rootca.key -cert rootca.crt -out rootca.crl.pem + + openssl crl -inform PEM -in rootca.crl.pem -outform DER -out rootca.crl + +### Creating end user certificates ### + +We use this new intermediate CA to generate an end user certificate. Repeat these steps for every end user certificate you want to sign with this CA. + + mkdir enduser-certs + +Generate the end user's private key: + + openssl genrsa -out enduser-certs/enduser-example.com.key 4096 + +Generate the end user's CSR: + + openssl req -new -sha256 -key enduser-certs/enduser-example.com.key -out enduser-certs/enduser-example.com.csr + +Example output: + + You are about to be asked to enter information that will be incorporated + into your certificate request. + What you are about to enter is what is called a Distinguished Name or a DN. + There are quite a few fields but you can leave some blank + For some fields there will be a default value, + If you enter '.', the field will be left blank. + ----- + Country Name (2 letter code) [AU]:NL + State or Province Name (full name) [Some-State]:Noord Holland + Locality Name (eg, city) []:Amsterdam + Organization Name (eg, company) [Internet Widgits Pty Ltd]:Example Inc + Organizational Unit Name (eg, section) []:IT Dept + Common Name (e.g. server FQDN or YOUR name) []:example.com + Email Address []: + + Please enter the following 'extra' attributes + to be sent with your certificate request + A challenge password []: + An optional company name []: + +Sign the end user's CSR with the Intermediate 1 CA: + + openssl ca -batch -config ca.conf -notext -in enduser-certs/enduser-example.com.csr -out enduser-certs/enduser-example.com.crt + +Example output: + + Using configuration from ca.conf + Check that the request matches the signature + Signature ok + The Subject's Distinguished Name is as follows + countryName :PRINTABLE:'NL' + stateOrProvinceName :ASN.1 12:'Noord Holland' + localityName :ASN.1 12:'Amsterdam' + organizationName :ASN.1 12:'Example Inc' + organizationalUnitName:ASN.1 12:'IT Dept' + commonName :ASN.1 12:'example.com' + Certificate is to be certified until Mar 30 15:18:26 2016 GMT (365 days) + + Write out database with 1 new entries + Data Base Updated + +Generate the CRL (both in PEM and DER): + + openssl ca -config ca.conf -gencrl -keyfile intermediate1.key -cert intermediate1.crt -out intermediate1.crl.pem + + openssl crl -inform PEM -in intermediate1.crl.pem -outform DER -out intermediate1.crl + +Generate the CRL after every certificate you sign with the CA. + +If you ever need to revoke the this end users cert: + + openssl ca -config ca.conf -revoke enduser-certs/enduser-example.com.crt -keyfile intermediate1.key -cert intermediate1.crt + +Example output: + + Using configuration from ca.conf + Revoking Certificate 1000. + Data Base Updated + +Create the certificate chain file by concatenating the Root and intermediate 1 certificates together. + + cat ../root/rootca.crt intermediate1.crt > enduser-certs/enduser-example.com.chain + +Send the following files to the end user: + + enduser-example.com.crt + enduser-example.com.key + enduser-example.com.chain + +You can also let the end user supply their own CSR and just send them the .crt file. Do not delete that from the server, otherwise you cannot revoke it. + +### Validating the certificate ### + +You can validate the end user certificate against the chain using the following command: + + openssl verify -CAfile enduser-certs/enduser-example.com.chain enduser-certs/enduser-example.com.crt + enduser-certs/enduser-example.com.crt: OK + +You can also validate it against the CRL. Concatenate the PEM CRL and the chain together first: + + cat ../root/rootca.crt intermediate1.crt intermediate1.crl.pem > enduser-certs/enduser-example.com.crl.chain + +Verify the certificate: + + openssl verify -crl_check -CAfile enduser-certs/enduser-example.com.crl.chain enduser-certs/enduser-example.com.crt + +Output when not revoked: + + enduser-certs/enduser-example.com.crt: OK + +Output when revoked: + + enduser-certs/enduser-example.com.crt: CN = example.com, ST = Noord Holland, C = NL, O = Example Inc, OU = IT Dept + error 23 at 0 depth lookup:certificate revoked + +-------------------------------------------------------------------------------- + +via: https://raymii.org/s/tutorials/OpenSSL_command_line_Root_and_Intermediate_CA_including_OCSP_CRL%20and_revocation.html + +作者:Remy van Elst +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 \ No newline at end of file From 5a72731082a5f197dabb0d287da4c6173fac20db Mon Sep 17 00:00:00 2001 From: wxy Date: Mon, 11 May 2015 22:35:05 +0800 Subject: [PATCH 132/133] PUB:20150126 iptraf--A TCP or UDP Network Monitoring Utility @DongShuaike --- ...A TCP or UDP Network Monitoring Utility.md | 65 ++++++++++++++++ ...A TCP or UDP Network Monitoring Utility.md | 77 ------------------- 2 files changed, 65 insertions(+), 77 deletions(-) create mode 100644 published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md delete mode 100644 translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md diff --git a/published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md new file mode 100644 index 0000000000..1fa38d9079 --- /dev/null +++ b/published/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md @@ -0,0 +1,65 @@ +iptraf:一个实用的TCP/UDP网络监控工具 +================================================================================ + +[iptraf][1]是一个基于ncurses的IP局域网监控器,用来生成包括TCP信息、UDP计数、ICMP和OSPF信息、以太网负载信息、节点状态信息、IP校验和错误等等统计数据。 + +它基于ncurses的用户界面可以使用户免于记忆繁琐的命令行开关。 + +### 特征 ### + +- IP流量监控器,用来显示你的网络中的IP流量变化信息。包括TCP标识信息、包以及字节计数,ICMP细节,OSPF包类型。 +- 简单的和详细的接口统计数据,包括IP、TCP、UDP、ICMP、非IP以及其他的IP包计数、IP校验和错误,接口活动、包大小计数。 +- TCP和UDP服务监控器,能够显示常见的TCP和UDP应用端口上发送的和接收的包的数量。 +- 局域网数据统计模块,能够发现在线的主机,并显示其上的数据活动统计信息。 +- TCP、UDP、及其他协议的显示过滤器,允许你只查看感兴趣的流量。 +- 日志功能。 +- 支持以太网、FDDI、ISDN、SLIP、PPP以及本地回环接口类型。 +- 利用Linux内核内置的原始套接字接口,允许它(指iptraf)能够用于各种支持的网卡上 +- 全屏,菜单式驱动的操作。 + +###安装方法### + +**Ubuntu以及其衍生版本** + + sudo apt-get install iptraf + +**Arch Linux以及其衍生版本** + + sudo pacman -S iptra + +**Fedora以及其衍生版本** + + sudo yum install iptraf + +### 用法 ### + +如果不加任何命令行选项地运行**iptraf**命令,程序将进入一种交互模式,通过主菜单可以访问多种功能。 + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/iptraf_1.png) + +简易的上手导航菜单。 + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/iptraf_2.png) + +选择要监控的接口。 + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/iptraf_3.png) + +接口**ppp0**处的流量。 + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/iptraf_4.png) + +试试吧! + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/iptraf-tcpudp-network-monitoring-utility/ + +作者:[Enock Seth Nyamador][a] +译者:[DongShuaike](https://github.com/DongShuaike) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/seth/ +[1]:http://iptraf.seul.org/about.html diff --git a/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md deleted file mode 100644 index 98bea48f41..0000000000 --- a/translated/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md +++ /dev/null @@ -1,77 +0,0 @@ - -iptraf:一个实用的TCP/UDP网络监控工具 -================================================================================ - -[iptraf][1]是一个基于ncurses(ncurses-based)的IP局域网监控器,用来生成包括TCP信息,UDP计数,ICMP和OSPF信息,以太网加载信息,结点状态信息,IP校验和错误等等统计数据。 - -它基于ncurses的用户界面帮助用户免于记忆繁琐的命令行开关。 - -### 特征 ### - -- 拥有一个IP流量监控器,用来显示你的网络中的流量变化信息。包括TCP标识信息,包以及字节计数,ICMP细节,OSPF包类型。 - -- 拥有普通和详细的交互统计数据显示了IP,TCP,UDP,ICMP,非IP以及其他的IP包计数,IP校验和错误,交互活动,包尺寸计数。(这里一些专业术语拿不定) - -- 拥有一个TCP和UDP服务监控器,能够显示普通TCP和UDP应用端口上发送的和接收的包的数量。 - -- 拥有一个局域网数据统计模块,能够检查到(discover)处于活动状态的主机,并显示其上正在运行的数据活动的统计信息。 - -- 拥有TCP,UDP,以及其他协议的显示过滤器(display filters),允许你只查看感兴趣的流量。 - -- 日志功能。 - -- 支持以太网,FDDI,ISDN,SLIP,PPP以及loopback接口类型(interface types)。 - -- 利用Linux内核内置的(built-in)原始套接字接口,允许它(指iptraf)能够用于许多种网卡上(这句话翻译不好) - -- 全屏,菜单式驱动的操作。 - -安装方法 - -### Ubuntu以及其衍生版本 ### - - sudo apt-get install iptraf - -### Arch Linux以及其衍生版本 ### - - sudo pacman -S iptra - -### Fedora以及其衍生版本 ### - - sudo yum install iptraf - -### 用法 ### - - -如果不加任何命令行选项地运行**iptraf**命令,程序将进入一种交互模式,通过主菜单可以访问多种设备(various facilities) - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_1.png) - - -简易的上手导航菜单。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_2.png) - -为monitor选择界面(接口)? - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_3.png) - -接口 **pp0** 处的流量。 - -![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_4.png) - -开始吧! - - --------------------------------------------------------------------------------- - -via: http://www.unixmen.com/iptraf-tcpudp-network-monitoring-utility/ - -作者:[Enock Seth Nyamador][a] -译者:[DongShuaike](https://github.com/DongShuaike) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.unixmen.com/author/seth/ -[1]:http://iptraf.seul.org/about.html From a55240b2ead04fc4a88f36896ad4708dd01c058f Mon Sep 17 00:00:00 2001 From: GOLinux Date: Tue, 12 May 2015 09:35:11 +0800 Subject: [PATCH 133/133] [Translated]20150506 First Step Guide for Learning Shell Scripting.md --- ...Step Guide for Learning Shell Scripting.md | 460 ------------------ ...Step Guide for Learning Shell Scripting.md | 460 ++++++++++++++++++ 2 files changed, 460 insertions(+), 460 deletions(-) delete mode 100644 sources/tech/20150506 First Step Guide for Learning Shell Scripting.md create mode 100644 translated/tech/20150506 First Step Guide for Learning Shell Scripting.md diff --git a/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md b/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md deleted file mode 100644 index 270177a3de..0000000000 --- a/sources/tech/20150506 First Step Guide for Learning Shell Scripting.md +++ /dev/null @@ -1,460 +0,0 @@ -Translating by GOLinux! -First Step Guide for Learning Shell Scripting -================================================================================ -![](http://blog.linoxide.com/wp-content/uploads/2015/04/myfirstshellscript.jpg) - -Usually when people say "shell scripting" they have on mind bash, ksh, sh, ash or similar linux/unix scripting language. Scripting is another way to communicate with computer. Using graphic windows interface (not matter windows or linux) user can move mouse and clicking on the various objects like, buttons, lists, check boxes and so on. But it is very inconvenient way witch requires user participation and accuracy each time he would like to ask computer / server to do the same tasks (lets say to convert photos or download new movies, mp3 etc). To make all these things easy accessible and automated we could use shell scripts. - -Some programming languages like pascal, foxpro, C, java needs to be compiled before they could be executed. They needs appropriate compiler to make our code to do some job. - -Another programming languages like php, javascript, visualbasic do not needs compiler. So they need interpretersand we could run our program without compiling the code. - -The shell scripts is also like interpreters, but it is usually used to call external compiled programs. Then captures the outputs, exit codes and act accordingly. - -One of the most popular shell scripting language in the linux world is the bash. And i think (this is my own opinion) this is because bash shell allows user easily navigate through the history commands (previously executed) by default, in opposite ksh which requires some tuning in .profile or remember some "magic" key combination to walk through history and amend commands. - -Ok, i think this is enough for introduction and i leaving for your judge which environment is most comfortable for you. Since now i will speak only about bash and scripting. In the following examples i will use the CentOS 6.6 and bash-4.1.2. Just make sure you have the same or greater version. - -### Shell Script Streams ### - -The shell scripting it is something similar to conversation of several persons. Just imagine that all command like the persons who able to do something if you properly ask them. Lets say you would like to write the document. First of all you need the paper, then you need to say the content to someone to write it, and finally you would like to store it somewhere. Or you would like build a house, so you will ask appropriate persons to cleanup the space. After they say "its done" then other engineers could build for you the walls. And finally, when engineers also tell "Its done" you can ask the painters to color your house. And what would happen if you ask the painters coloring your walls before they are built? I think they will start to complain. Almost all commands like the persons could speak and if they did its job without any issues they speaks to "standard output". If they can't to what you asking - they speaking to the "standard error". So finally all commands listening for you through "standard input". - -Quick example- when you opening linux terminal and writing some text - you speaking to bash through "standard input". So ask the bash shell **who am i** - - root@localhost ~]# who am i <--- you speaking through the standard input to bash shell - root pts/0 2015-04-22 20:17 (192.168.1.123) <--- bash shell answering to you through the standard output - -Now lets ask something that bash will not understand us: - - [root@localhost ~]# blablabla <--- and again, you speaking through standard input - -bash: blablabla: command not found <--- bash complaining through standard error - -The first word before ":" usually is the command which complaining to you. Actually each of these streams has their own index number: - -- standard input (**stdin**) - 0 -- standard output (**stdout**) - 1 -- standard error (**stderr**) - 2 - -If you really would like to know to witch output command said something - you need to redirect (to use "greater than ">" symbol after command and stream index) that speech to file: - - [root@localhost ~]# blablabla 1> output.txt - -bash: blablabla: command not found - -In this example we tried to redirect 1 (**stdout**) stream to file named output.txt. Lets look does to the content of that file. We use the command cat for that: - - [root@localhost ~]# cat output.txt - [root@localhost ~]# - -Seams that is empty. Ok now lets try to redirect 2 (**stderr**) streem: - - [root@localhost ~]# blablabla 2> error.txt - [root@localhost ~]# - -Ok, we see that complains gone. Lets chec the file: - - [root@localhost ~]# cat error.txt - -bash: blablabla: command not found - [root@localhost ~]# - -Exactly! We see that all complains was recorded to the errors.txt file. - -Sometimes commands produces **stdout** and **stderr** simultaniously. To redirect them to separate files we can use the following syntax: - - command 1>out.txt 2>err.txt - -To shorten this syntax a bit we can skip the "1" as by default the **stdout** stream will be redirected: - - command >out.txt 2>err.txt - -Ok, lets try to do something "bad". lets remove the file1 and folder1 with the rm command: - - [root@localhost ~]# rm -vf folder1 file1 > out.txt 2>err.txt - -Now check our output files: - - [root@localhost ~]# cat out.txt - removed `file1' - [root@localhost ~]# cat err.txt - rm: cannot remove `folder1': Is a directory - [root@localhost ~]# - -As we see the streams was separated to different files. Sometimes it is not handy as usually we want to see the sequence when the errors appeared - before or after some actions. For that we can redirect both streams to the same file: - - command >>out_err.txt 2>>out_err.txt - -Note : Please notice that i use ">>" instead of ">". It allows us to append file instead of overwrite. - -We can redirect one stream to another: - - command >out_err.txt 2>&1 - -Let me explain. All stdout of the command will be redirected to the out_err.txt. The errout will be redirected to the 1-st stream which (as i already explained above) will be redirected to the same file. Let see the example: - - [root@localhost ~]# rm -fv folder2 file2 >out_err.txt 2>&1 - [root@localhost ~]# cat out_err.txt - rm: cannot remove `folder2': Is a directory - removed `file2' - [root@localhost ~]# - -Looking at the combined output we can state that first of all **rm** command tried to remove the folder2 and it was not success as linux require the **-r** key for **rm** command to allow remove folders. At the second the file2 was removed. By providing the **-v** (verbose) key for the **rm** command we asking rm command to inform as about each removed file or folder. - -This is almost all you need to know about redirection. I say almost, because there is one more very important redirection which called "piping". By using | (pipe) symbol we usually redirecting **stdout** streem. - -Lets say we have the text file: - - [root@localhost ~]# cat text_file.txt - This line does not contain H e l l o word - This lilne contains Hello - This also containd Hello - This one no due to HELLO all capital - Hello bash world! - -and we need to find the lines in it with the words "Hello". Linux has the **grep** command for that: - - [root@localhost ~]# grep Hello text_file.txt - This lilne contains Hello - This also containd Hello - Hello bash world! - [root@localhost ~]# - -This is ok when we have file and would like to sech in it. But what to do if we need to find something in the output of another command? Yes, of course we can redirect the output to the file and then look in it: - - [root@localhost ~]# fdisk -l>fdisk.out - [root@localhost ~]# grep "Disk /dev" fdisk.out - Disk /dev/sda: 8589 MB, 8589934592 bytes - Disk /dev/mapper/VolGroup-lv_root: 7205 MB, 7205814272 bytes - Disk /dev/mapper/VolGroup-lv_swap: 855 MB, 855638016 bytes - [root@localhost ~]# - -If you going to grep something with white spaces embrace that with " quotes! - -Note : fdisk command shows information about Linux OS disk drives - -As we see this way is not very handy as soon we will mess the space with temporary files. For that we can use the pipes. They allow us redirect one command **stdout** to another command **stdin** streams: - - [root@localhost ~]# fdisk -l | grep "Disk /dev" - Disk /dev/sda: 8589 MB, 8589934592 bytes - Disk /dev/mapper/VolGroup-lv_root: 7205 MB, 7205814272 bytes - Disk /dev/mapper/VolGroup-lv_swap: 855 MB, 855638016 bytes - [root@localhost ~]# - -As we see, we get the same result without any temporary files. We have redirected **frisk stdout** to the **grep stdin**. - -**Note** : Pipe redirection is always from left to right. - -There are several other redirections but we will speak about them later. - -### Displaying custom messages in the shell ### - -As we already know usually communication with and within shell is going as dialog. So lets create some real script which also will speak with us. It will allow you to learn some simple commands and better understand the scripting concept. - -Imagine we are working in some company as help desk manager and we would like to create some shell script to register the call information: phone number, User name and brief description about issue. We going to store it in the plain text file data.txt for future statistics. Script it self should work in dialog way to make live easy for help desk workers. So first of all we need to display the questions. For displaying any messages there is echo and printf commands. Both of them displaying messages, but printf is more powerful as we can nicely form output to align it to the right, left or leave dedicated space for message. Lets start from simple one. For file creation please use your favorite text editor (kate, nano, vi, ...) and create the file named note.sh with the command inside: - - echo "Phone number ?" - -### Script execution ### - -After you have saved the file we can run it with bash command by providing our file as an argument: - - [root@localhost ~]# bash note.sh - Phone number ? - -Actually to use this way for script execution is not handy. It would be more comfortable just execute the script without any **bash** command as a prefix. To make it executable we can use **chmod** command: - - [root@localhost ~]# ls -la note.sh - -rw-r--r--. 1 root root 22 Apr 23 20:52 note.sh - [root@localhost ~]# chmod +x note.sh - [root@localhost ~]# ls -la note.sh - -rwxr-xr-x. 1 root root 22 Apr 23 20:52 note.sh - [root@localhost ~]# - -![set permission script file](http://blog.linoxide.com/wp-content/uploads/2015/04/Capture.png) - -**Note** : ls command displays the files in the current folder. By adding the keys -la it will display a bit more information about files. - -As we see, before **chmod** command execution, script has only read (r) and write (w) permissions. After **chmod +x** it got execute (x) permissions. (More details about permissions i am going to describe in next article.) Now we can simply run it: - - [root@localhost ~]# ./note.sh - Phone number ? - -Before script name i have added ./ combination. . (dot) in the unix world means current position (current folder), the / (slash) is the folder separator. (In Windows OS we use \ (backslash) for the same). So whole this combination means: "from the current folder execute the note.sh script". I think it will be more clear for you if i run this script with full path: - - [root@localhost ~]# /root/note.sh - Phone number ? - [root@localhost ~]# - -It also works. - -Everything would be ok if all linux users would have the same default shell. If we simply execute this script default user shell will be used to parse script content and run the commands. Different shells have a bit different syntax, internal commands, etc. So to guarantee the **bash** will be used for our script we should add **#!/bin/bash** as the first line. In this way default user shell will call **/bin/bash** and only then will execute following shell commands in the script: - - [root@localhost ~]# cat note.sh - #!/bin/bash - echo "Phone number ?" - -Only now we will be 100% sure that **bash** will be used to parse our script content. Lets move on. - -### Reading the inputs ### - -After we have displayed the message script should wait for answer from user. There is the command **read**: - - #!/bin/bash - echo "Phone number ?" - read phone - -After execution script will wait for the user input until he press the [ENTER] key: - - [root@localhost ~]# ./note.sh - Phone number ? - 12345 <--- here is my input - [root@localhost ~]# - -Everything you have input will be stored to the variable **phone**. To display the value of variable we can use the same **echo** command: - - [root@localhost ~]# cat note.sh - #!/bin/bash - echo "Phone number ?" - read phone - echo "You have entered $phone as a phone number" - [root@localhost ~]# ./note.sh - Phone number ? - 123456 - You have entered 123456 as a phone number - [root@localhost ~]# - -In **bash** shell we using **$** (dollar) sign as variable indication, except when reading into variable and few other moments (will describe later). - -Ok, now we are ready to add the rest questions: - - #!/bin/bash - echo "Phone number?" - read phone - echo "Name?" - read name - echo "Issue?" - read issue - [root@localhost ~]# ./note.sh - Phone number? - 123 - Name? - Jim - Issue? - script is not working. - [root@localhost ~]# - -### Using stream redirection ### - -Perfect! There is left to redirect everything to the file data.txt. As a field separator we going to use / (slash) symbol. - -**Note** : You can chose any which you think is the best, bat be sure that content will not have thes symbols inside. It will cause extra fields in the line. - -Do not forget to use ">>" instead of ">" as we would like to append the output to the end of file! - - [root@localhost ~]# tail -2 note.sh - read issue - echo "$phone/$name/$issue">>data.txt - [root@localhost ~]# ./note.sh - Phone number? - 987 - Name? - Jimmy - Issue? - Keybord issue. - [root@localhost ~]# cat data.txt - 987/Jimmy/Keybord issue. - [root@localhost ~]# - -**Note** : The command **tail** displays the last **-n** lines of the file. - -Bingo. Lets run once again: - - [root@localhost ~]# ./note.sh - Phone number? - 556 - Name? - Janine - Issue? - Mouse was broken. - [root@localhost ~]# cat data.txt - 987/Jimmy/Keybord issue. - 556/Janine/Mouse was broken. - [root@localhost ~]# - -Our file is growing. Lets add the date in the front of each line. This will be useful later when playing with data while calculating statistic. For that we can use command date and give it some format as i do not like default one: - - [root@localhost ~]# date - Thu Apr 23 21:33:14 EEST 2015 <---- default output of dta command - [root@localhost ~]# date "+%Y.%m.%d %H:%M:%S" - 2015.04.23 21:33:18 <---- formated output - -There are several ways to read the command output to the variable. In this simple situation we will use ` (back quotes): - - [root@localhost ~]# cat note.sh - #!/bin/bash - now=`date "+%Y.%m.%d %H:%M:%S"` - echo "Phone number?" - read phone - echo "Name?" - read name - echo "Issue?" - read issue - echo "$now/$phone/$name/$issue">>data.txt - [root@localhost ~]# ./note.sh - Phone number? - 123 - Name? - Jim - Issue? - Script hanging. - [root@localhost ~]# cat data.txt - 2015.04.23 21:38:56/123/Jim/Script hanging. - [root@localhost ~]# - -Hmmm... Our script looks a bit ugly. Lets prettify it a bit. If you would read manual about **read** command you would find that read command also could display some messages. For this we should use -p key and message: - - [root@localhost ~]# cat note.sh - #!/bin/bash - now=`date "+%Y.%m.%d %H:%M:%S"` - read -p "Phone number: " phone - read -p "Name: " name - read -p "Issue: " issue - echo "$now/$phone/$name/$issue">>data.txt - -You can fine a lots of interesting about each command directly from the console. Just type: **man read, man echo, man date, man ....** - -Agree it looks much better! - - [root@localhost ~]# ./note.sh - Phone number: 321 - Name: Susane - Issue: Mouse was stolen - [root@localhost ~]# cat data.txt - 2015.04.23 21:38:56/123/Jim/Script hanging. - 2015.04.23 21:43:50/321/Susane/Mouse was stolen - [root@localhost ~]# - -And the cursor is right after the message (not in new line) what makes a bit sense. -Loop - -Time to improve our script. If user works all day with the calls it is not very handy to run it each time. Lets add all these actions in the never-ending loop: - - [root@localhost ~]# cat note.sh - #!/bin/bash - while true - do - read -p "Phone number: " phone - now=`date "+%Y.%m.%d %H:%M:%S"` - read -p "Name: " name - read -p "Issue: " issue - echo "$now/$phone/$name/$issue">>data.txt - done - -I have swapped **read phone** and **now=`date** lines. This is because i would like to get the time right after the phone number will be entered. If i would left it as the first line in the loop **- the** now variable will get the time right after the data was stored in the file. And it is not good as the next call could be after 20 mins or so. - - [root@localhost ~]# ./note.sh - Phone number: 123 - Name: Jim - Issue: Script still not works. - Phone number: 777 - Name: Daniel - Issue: I broke my monitor - Phone number: ^C - [root@localhost ~]# cat data.txt - 2015.04.23 21:38:56/123/Jim/Script hanging. - 2015.04.23 21:43:50/321/Susane/Mouse was stolen - 2015.04.23 21:47:55/123/Jim/Script still not works. - 2015.04.23 21:48:16/777/Daniel/I broke my monitor - [root@localhost ~]# - -NOTE: To exit from the never-ending loop you can by pressing [Ctrl]+[C] keys. Shell will display ^ as the Ctrl key. - -### Using pipe redirection ### - -Lets add more functionality to our "Frankenstein" I would like the script will display some statistic after each call. Lets say we want to see the how many times each number called us. For that we should cat the data.txt file: - - [root@localhost ~]# cat data.txt - 2015.04.23 21:38:56/123/Jim/Script hanging. - 2015.04.23 21:43:50/321/Susane/Mouse was stolen - 2015.04.23 21:47:55/123/Jim/Script still not works. - 2015.04.23 21:48:16/777/Daniel/I broke my monitor - 2015.04.23 22:02:14/123/Jimmy/New script also not working!!! - [root@localhost ~]# - -Now all this output we can redirect to the **cut** command to **cut** each line into the chunks (our delimiter "/") and print the second field: - - [root@localhost ~]# cat data.txt | cut -d"/" -f2 - 123 - 321 - 123 - 777 - 123 - [root@localhost ~]# - -Now this output we can redirect to another command to **sort**: - - [root@localhost ~]# cat data.txt | cut -d"/" -f2|sort - 123 - 123 - 123 - 321 - 777 - [root@localhost ~]# - -and leave only unique lines. To count unique entries just add **-c** key for **uniq** command: - - [root@localhost ~]# cat data.txt | cut -d"/" -f2 | sort | uniq -c - 3 123 - 1 321 - 1 777 - [root@localhost ~]# - -Just add this to end of our loop: - - #!/bin/bash - while true - do - read -p "Phone number: " phone - now=`date "+%Y.%m.%d %H:%M:%S"` - read -p "Name: " name - read -p "Issue: " issue - echo "$now/$phone/$name/$issue">>data.txt - echo "===== We got calls from =====" - cat data.txt | cut -d"/" -f2 | sort | uniq -c - echo "--------------------------------" - done - -Run it: - - [root@localhost ~]# ./note.sh - Phone number: 454 - Name: Malini - Issue: Windows license expired. - ===== We got calls from ===== - 3 123 - 1 321 - 1 454 - 1 777 - -------------------------------- - Phone number: ^C - -![running script](http://blog.linoxide.com/wp-content/uploads/2015/04/Capture11.png) - -Current scenario is going through well-known steps like: - -- Display message -- Get user input -- Store values to the file -- Do something with stored data - -But what if user has several responsibilities and he needs sometimes to input data, sometimes to do statistic calculations, or might be to find something in stored data? For that we need to implement switches / cases. In next article i will show you how to use them and how to nicely form the output. It is useful while "drawing" the tables in the shell. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-shell-script/guide-start-learning-shell-scripting-scratch/ - -作者:[Petras Liumparas][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://linoxide.com/author/petrasl/ diff --git a/translated/tech/20150506 First Step Guide for Learning Shell Scripting.md b/translated/tech/20150506 First Step Guide for Learning Shell Scripting.md new file mode 100644 index 0000000000..af71b8f4ca --- /dev/null +++ b/translated/tech/20150506 First Step Guide for Learning Shell Scripting.md @@ -0,0 +1,460 @@ +Shell脚本学习初次操作指南 +================================================================================ +![](http://blog.linoxide.com/wp-content/uploads/2015/04/myfirstshellscript.jpg) + +通常,当人们提到“shell脚本语言”时,浮现在他们脑海中是bash,ksh,sh或者其它相类似的linux/unix脚本语言。脚本语言是与计算机交流的另外一种途径。使用图形化窗口界面(不管是windows还是linux都无所谓)用户可以移动鼠标并点击各种对象,比如按钮、列表、选框等等。但这种方式在每次用户想要计算机/服务器完成相同任务时(比如说批量转换照片,或者下载新的电影、mp3等)却是十分不方便。要想让所有这些事情变得简单并且自动化,我们可以使用shell脚本。 + +某些编程语言,像pascal、foxpro、C、java之类,在执行前需要先进行编译。它们需要合适的编译器来让我们的代码完成某个任务。 + +而其它一些编程语言,像php、javascript、visualbasic之类,则不需要编译器,因此它们需要解释器,而我们不需要编译代码就可以运行程序。 + +shell脚本也像解释器一样,但它通常用于调用外部已编译的程序。然后,它会捕获输出结果、退出代码并根据情况进行处理。 + +Linux世界中最为流行的shell脚本语言之一,就是bash。而我认为(这是我自己的看法)原因在于,默认情况下bash shell可以让用户便捷地通过历史命令(先前执行过的)导航,与之相反的是,ksh则要求对.profile进行一些调整,或者记住一些“魔术”组合键来查阅历史并修正命令。 + +好了,我想这些介绍已经足够了,剩下来哪个环境最适合你,就留给你自己去判断吧。从现在开始,我将只讲bash及其脚本。在下面的例子中,我将使用CentOS 6.6和bash-4.1.2。请确保你有相同版本,或者更高版本。 + +### Shell脚本流 ### + +shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象成能帮你做事的那些人,只要你用正确的方式来请求他们去做。比如说,你想要写文档。首先,你需要纸。然后,你需要把内容说给某个人听,让他帮你写。最后,你想要把它存放到某个地方。或者说,你想要造一所房子,因而你需要请合适的人来清空场地。在他们说“事情干完了”,那么另外一些工程师就可以帮你来砌墙。最后,当这些工程师们也告诉你“事情干完了”的时候,你就可以叫油漆工来给房子粉饰了。如果你让油漆工在墙砌好前就来粉饰,会发生什么呢?我想,他们会开始发牢骚了。几乎所有这些像人一样的命令都会说话,如果它们完成了工作而没有发生什么问题,那么它们就会告诉“标准输出”。如果它们不能做你叫它们做的事——它们会告诉“标准错误”。这样,最后,所有的命令都通过“标准输入”来听你的话。 + +快速实例——当你打开linux终端并写一些文本时——你正通过“标准输入”和bash说话。那么,让我们来问问bash shell **who am i**吧。 + + root@localhost ~]# who am i <--- you speaking through the standard input to bash shell + root pts/0 2015-04-22 20:17 (192.168.1.123) <--- bash shell answering to you through the standard output + +现在,让我们说一些bash听不懂的问题: + + [root@localhost ~]# blablabla <--- 哈,你又在和标准输入说话了 + -bash: blablabla: command not found <--- bash通过标准错误在发牢骚了 + +“:”之前的第一个单词通常是向你发牢骚的命令。实际上,这些流中的每一个都有它们自己的索引号: + +- 标准输入(**stdin**) - 0 +- 标准输出(**stdout**) - 1 +- 标准错误(**stderr**) - 2 + +如果你真的想要知道哪个输出命令说了些什么——你需要重定向(在命令后使用大于号“>”和流索引)那次发言到文件: + + [root@localhost ~]# blablabla 1> output.txt + -bash: blablabla: command not found + +在本例中,我们试着重定向1(**stdout**)流到名为output.txt的文件。让我们来看对该文件内容所做的事情吧,使用cat命令可以做这事: + + [root@localhost ~]# cat output.txt + [root@localhost ~]# + +看起来似乎是空的。好吧,现在让我们来重定向2(**stderr**)流: + + [root@localhost ~]# blablabla 2> error.txt + [root@localhost ~]# + +好吧,我们看到牢骚话没了。让我们检查一下那个文件: + + [root@localhost ~]# cat error.txt + -bash: blablabla: command not found + [root@localhost ~]# + +果然如此!我们看到,所有牢骚话都被记录到errors.txt文件里头去了。 + +有时候,命令会同时产生**stdout**和**stderr**。要重定向它们到不同的文件,我们可以使用以下语句: + + command 1>out.txt 2>err.txt + +要缩短一点语句,我们可以忽略“1”,因为默认情况下**stdout**会被重定向: + + command >out.txt 2>err.txt + +好吧,让我们试试做些“坏事”。让我们用rm命令把file1和folder1给删了吧: + + [root@localhost ~]# rm -vf folder1 file1 > out.txt 2>err.txt + +现在来检查以下输出文件: + + [root@localhost ~]# cat out.txt + removed `file1' + [root@localhost ~]# cat err.txt + rm: cannot remove `folder1': Is a directory + [root@localhost ~]# + +正如我们所看到的,不同的流被分离到了不同的文件。有时候,这也不似很方便,因为我们想要查看出现错误时,在某些操作前面或后面所连续发生的事情。要实现这一目的,我们可以重定向两个流到同一个文件: + + command >>out_err.txt 2>>out_err.txt + +注意:请注意,我使用“>>”替代了“>”。它允许我们附加到文件,而不是覆盖文件。 + +我们可以重定向一个流到另一个: + + command >out_err.txt 2>&1 + +让我来解释一下吧。所有命令的标准输出将被重定向到out_err.txt,错误输出将被重定向到1-st流(上面已经解释过了),而该流会被重定向到同一个文件。让我们看这个实例: + + [root@localhost ~]# rm -fv folder2 file2 >out_err.txt 2>&1 + [root@localhost ~]# cat out_err.txt + rm: cannot remove `folder2': Is a directory + removed `file2' + [root@localhost ~]# + +看着这些组合的输出,我们可以将其说明为:首先,**rm**命令试着将folder2删除,而它不会成功,因为linux要求**-r**键来允许**rm**命令删除文件夹,而第二个file2会被删除。通过为**rm**提供**-v**(详情)键,我们让rm命令告诉我们每个被删除的文件或文件夹。 + +这些就是你需要知道的,关于重定向的几乎所有内容了。我是说几乎,因为还有一个更为重要的重定向工具,它称之为“管道”。通过使用|(管道)符号,我们通常重定向**stdout**流。 + +比如说,我们有这样一个文本文件: + + [root@localhost ~]# cat text_file.txt + This line does not contain H e l l o word + This lilne contains Hello + This also containd Hello + This one no due to HELLO all capital + Hello bash world! + +而我们需要找到其中某些带有“Hello”的行,Linux中有个**grep**命令可以完成该工作: + + [root@localhost ~]# grep Hello text_file.txt + This lilne contains Hello + This also containd Hello + Hello bash world! + [root@localhost ~]# + +当我们有个文件,想要在里头搜索的时候,这用起来很不错。当如果我们需要在另一个命令的输出中查找某些东西,这又该怎么办呢?是的,当然,我们可以重定向输出到文件,然后再在文件里头查找: + + [root@localhost ~]# fdisk -l>fdisk.out + [root@localhost ~]# grep "Disk /dev" fdisk.out + Disk /dev/sda: 8589 MB, 8589934592 bytes + Disk /dev/mapper/VolGroup-lv_root: 7205 MB, 7205814272 bytes + Disk /dev/mapper/VolGroup-lv_swap: 855 MB, 855638016 bytes + [root@localhost ~]# + +如果你打算grep一些双引号引起来带有空格的内容呢! + +注意: fdisk命令显示关于Linux操作系统磁盘驱动器的信息 + +就像我们看到的,这种方式很不方便,因为我们不一会儿就把临时文件空间给搞乱了。要完成该任务,我们可以使用管道。它们允许我们重定向一个命令的**stdout**到另一个命令的**stdin**流: + + [root@localhost ~]# fdisk -l | grep "Disk /dev" + Disk /dev/sda: 8589 MB, 8589934592 bytes + Disk /dev/mapper/VolGroup-lv_root: 7205 MB, 7205814272 bytes + Disk /dev/mapper/VolGroup-lv_swap: 855 MB, 855638016 bytes + [root@localhost ~]# + +如你所见,我们不需要任何临时文件就获得了相同的结果。我们把**fdisk stdout**重定向到了**grep stdin**。 + +**注意** : 管道重定向总是从左至右的。 + +还有几个其它重定向,但是我们将把它们放在后面讲。 + +### 在shell中显示自定义信息 ### + +正如我们所知道的,通常,与shell的交流以及shell内的交流是以对话的方式进行的。因此,让我们创建一些真正的脚本吧,这些脚本也会和我们讲话。这会让你学到一些简单的命令,并对脚本的概念有一个更好的理解。 + +假设我们是某个公司的总服务台经理,我们想要创建某个shell脚本来注册呼叫信息:电话号码、用户名以及问题的简要描述。我们打算把这些信息存储到普通文本文件data.txt中,以便今后统计。脚本它自己就是以对话的方式工作,这会让总服务台的工作人员的小日子过得轻松点。那么,首先我们需要显示问题。对于现实信息,我们可以用echo和printf命令。这两个都是用来显示信息的,但是printf更为强大,因为我们可以通过它很好地格式化输出,我们可以让它右对齐、左对齐或者为信息留出专门的空间。让我们从一个简单的例子开始吧。要创建文件,请使用你喜欢的文本编辑器(kate,nano,vi,……),然后创建名为note.sh的文件,里面写入这些命令: + + echo "Phone number ?" + +### Script执行 ### + +在保存文件后,我们可以使用bash命令来运行,把我们的文件作为它的参数: + + [root@localhost ~]# bash note.sh + Phone number ? + +实际上,这样来执行脚本是很不方便的。如果不使用**bash**命令作为前缀来执行,会更舒服一些。要让脚本可执行,我们可以使用**chmod**命令: + + [root@localhost ~]# ls -la note.sh + -rw-r--r--. 1 root root 22 Apr 23 20:52 note.sh + [root@localhost ~]# chmod +x note.sh + [root@localhost ~]# ls -la note.sh + -rwxr-xr-x. 1 root root 22 Apr 23 20:52 note.sh + [root@localhost ~]# + +![set permission script file](http://blog.linoxide.com/wp-content/uploads/2015/04/Capture.png) + +**注意** : ls命令显示了当前文件夹内的文件。通过添加-la键,它会显示更多文件信息。 + +如我们所见,在**chmod**命令执行前,脚本只有读(r)和写(w)权限。在执行**chmod +x**后,它就获得了执行(x)权限。(关于权限的更多细节,我会在下一篇文章中讲述。)现在,我们只需这么来运行: + + [root@localhost ~]# ./note.sh + Phone number ? + +在脚本名前,我添加了./组合。.(点)在unix世界中意味着当前位置(当前文件夹),/(斜线)是文件夹分隔符。(在Windows系统中,我们使用\(反斜线)实现同样功能)所以,这整个组合的意思是说:“从当前文件夹执行note.sh脚本”。我想,如果我用完整路径来运行这个脚本的话,你会更加清楚一些: + + [root@localhost ~]# /root/note.sh + Phone number ? + [root@localhost ~]# + +它也能工作。 + +如果所有linux用户都有相同的默认shell,那就万事OK。如果我们只是执行该脚本,默认的用户shell就会用于解析脚本内容并运行命令。不同的shell有着一丁点不同的语法、内部命令等等,所以,为了保证我们的脚本会使用**bash**,我们应该添加**#!/bin/bash**到文件首行。这样,默认的用户shell将调用**/bin/bash**,而只有在那时候,脚本中的命令才会被执行: + + [root@localhost ~]# cat note.sh + #!/bin/bash + echo "Phone number ?" + +直到现在,我们才100%确信**bash**会用来解析我们的脚本内容。让我们继续。 + +### 读取输入 ### + +在现实信息后,脚本会等待用户回答。那儿有个**read**命令用来接收用户的回答: + + #!/bin/bash + echo "Phone number ?" + read phone + +在执行后,脚本会等待用户输入,直到用户按[ENTER]键: + + [root@localhost ~]# ./note.sh + Phone number ? + 12345 <--- 这儿是我输入的内容 + [root@localhost ~]# + +你输入的所有东西都会被存储到变量**phone**中,要显示变量的值,我们同样可以使用**echo**命令: + + [root@localhost ~]# cat note.sh + #!/bin/bash + echo "Phone number ?" + read phone + echo "You have entered $phone as a phone number" + [root@localhost ~]# ./note.sh + Phone number ? + 123456 + You have entered 123456 as a phone number + [root@localhost ~]# + +在**bash** shell中,我们使用**$**(美元)符号作为变量标示,除了读入到变量和其它为数不多的时候(将在今后说明)。 + +好了,现在我们准备添加剩下的问题了: + + #!/bin/bash + echo "Phone number?" + read phone + echo "Name?" + read name + echo "Issue?" + read issue + [root@localhost ~]# ./note.sh + Phone number? + 123 + Name? + Jim + Issue? + script is not working. + [root@localhost ~]# + +### 使用流重定向 ### + +太完美了!剩下来就是重定向所有东西到文件data.txt了。作为字段分隔符,我们将使用/(斜线)符号。 + +**注意** : 你可以选择任何你认为是最好,但是确保文件内容不会包含这些符号在内。它会导致在文本行中产生额外字段。 + +别忘了使用“>>”来代替“>”,因为我们想要将输出内容附加到文件末! + + [root@localhost ~]# tail -2 note.sh + read issue + echo "$phone/$name/$issue">>data.txt + [root@localhost ~]# ./note.sh + Phone number? + 987 + Name? + Jimmy + Issue? + Keybord issue. + [root@localhost ~]# cat data.txt + 987/Jimmy/Keybord issue. + [root@localhost ~]# + +**注意** : **tail**命令显示了文件的最后**-n**行。 + +搞定。让我们再来运行一次看看: + + [root@localhost ~]# ./note.sh + Phone number? + 556 + Name? + Janine + Issue? + Mouse was broken. + [root@localhost ~]# cat data.txt + 987/Jimmy/Keybord issue. + 556/Janine/Mouse was broken. + [root@localhost ~]# + +我们的文件在增长,让我们在每行前面加个日期吧,这对于今后摆弄这些统计数据时会很有用。要实现这功能,我们可以使用date命令,并指定某种格式,因为我不喜欢默认格式: + + [root@localhost ~]# date + Thu Apr 23 21:33:14 EEST 2015 <---- date命令的默认输出 + [root@localhost ~]# date "+%Y.%m.%d %H:%M:%S" + 2015.04.23 21:33:18 <---- 格式化后的输出 + +有几种方式可以读取命令输出到变脸,在这种简单的情况下,我们将使用`(反引号): + + [root@localhost ~]# cat note.sh + #!/bin/bash + now=`date "+%Y.%m.%d %H:%M:%S"` + echo "Phone number?" + read phone + echo "Name?" + read name + echo "Issue?" + read issue + echo "$now/$phone/$name/$issue">>data.txt + [root@localhost ~]# ./note.sh + Phone number? + 123 + Name? + Jim + Issue? + Script hanging. + [root@localhost ~]# cat data.txt + 2015.04.23 21:38:56/123/Jim/Script hanging. + [root@localhost ~]# + +嗯…… 我们的脚本看起来有点丑啊,让我们来美化一下。如果你要手动读取**read**命令,你会发现read命令也可以显示一些信息。要实现该功能,我们应该使用-p键加上信息: + + [root@localhost ~]# cat note.sh + #!/bin/bash + now=`date "+%Y.%m.%d %H:%M:%S"` + read -p "Phone number: " phone + read -p "Name: " name + read -p "Issue: " issue + echo "$now/$phone/$name/$issue">>data.txt + +你可以直接从控制台查找到各个命令的大量有趣的信息,只需输入:**man read, man echo, man date, man ……** + +同意吗?它看上去是好多了! + + [root@localhost ~]# ./note.sh + Phone number: 321 + Name: Susane + Issue: Mouse was stolen + [root@localhost ~]# cat data.txt + 2015.04.23 21:38:56/123/Jim/Script hanging. + 2015.04.23 21:43:50/321/Susane/Mouse was stolen + [root@localhost ~]# + +光标在消息的后面(不是在新的一行中),这有点意思。 + +循环 + +是时候来改进我们的脚本了。如果用户一整天都在接电话,如果每次都要去运行,这岂不是很麻烦?让我们让这些活动都永无止境地循环去吧: + + [root@localhost ~]# cat note.sh + #!/bin/bash + while true + do + read -p "Phone number: " phone + now=`date "+%Y.%m.%d %H:%M:%S"` + read -p "Name: " name + read -p "Issue: " issue + echo "$now/$phone/$name/$issue">>data.txt + done + +我已经交换了**read phone**和**now=`date`**行。这是因为我想要在输入电话号码后再获得时间。如果我把它放在循环**- the**的首行,变量就会在数据存储到文件中后获得时间。而这并不好,因为下一次呼叫可能在20分钟后,甚至更晚。 + + [root@localhost ~]# ./note.sh + Phone number: 123 + Name: Jim + Issue: Script still not works. + Phone number: 777 + Name: Daniel + Issue: I broke my monitor + Phone number: ^C + [root@localhost ~]# cat data.txt + 2015.04.23 21:38:56/123/Jim/Script hanging. + 2015.04.23 21:43:50/321/Susane/Mouse was stolen + 2015.04.23 21:47:55/123/Jim/Script still not works. + 2015.04.23 21:48:16/777/Daniel/I broke my monitor + [root@localhost ~]# + +注意: 要从无限循环中退出,你可以按[Ctrl]+[C]键。Shell会显示^表示Ctrl键。 + +### 使用管道重定向 ### + +让我们添加更多功能到我们的“弗兰肯斯坦”,我想要脚本在每次呼叫后显示某个统计数据。比如说,我想要查看各个号码呼叫了我几次。对于这个,我们应该cat文件data.txt: + + [root@localhost ~]# cat data.txt + 2015.04.23 21:38:56/123/Jim/Script hanging. + 2015.04.23 21:43:50/321/Susane/Mouse was stolen + 2015.04.23 21:47:55/123/Jim/Script still not works. + 2015.04.23 21:48:16/777/Daniel/I broke my monitor + 2015.04.23 22:02:14/123/Jimmy/New script also not working!!! + [root@localhost ~]# + +现在,所有输出我们都可以重定向到**cut**命令,让**cut**来把每行切成一块一块(我们使用分隔符“/”),然后打印第二个字段: + + [root@localhost ~]# cat data.txt | cut -d"/" -f2 + 123 + 321 + 123 + 777 + 123 + [root@localhost ~]# + +现在,我们可以把这个输出重定向打另外一个命令**sort**: + + [root@localhost ~]# cat data.txt | cut -d"/" -f2|sort + 123 + 123 + 123 + 321 + 777 + [root@localhost ~]# + +然后只留下唯一的行。要统计唯一条目,只需添加**-c**键到**uniq**命令: + + [root@localhost ~]# cat data.txt | cut -d"/" -f2 | sort | uniq -c + 3 123 + 1 321 + 1 777 + [root@localhost ~]# + +只要把这个添加到我们的循环的最后: + + #!/bin/bash + while true + do + read -p "Phone number: " phone + now=`date "+%Y.%m.%d %H:%M:%S"` + read -p "Name: " name + read -p "Issue: " issue + echo "$now/$phone/$name/$issue">>data.txt + echo "===== We got calls from =====" + cat data.txt | cut -d"/" -f2 | sort | uniq -c + echo "--------------------------------" + done + +运行: + + [root@localhost ~]# ./note.sh + Phone number: 454 + Name: Malini + Issue: Windows license expired. + ===== We got calls from ===== + 3 123 + 1 321 + 1 454 + 1 777 + -------------------------------- + Phone number: ^C + +![running script](http://blog.linoxide.com/wp-content/uploads/2015/04/Capture11.png) + +当前场景贯穿了几个熟知的步骤: + +- 显示消息 +- 获取用户输入 +- 存储值到文件 +- 处理存储的数据 + +但是,如果用户有点责任心,他有时候需要输入数据,有时候需要统计,或者可能要在存储的数据中查找一些东西呢?对于这些事情,我们需要使用switches/cases,并知道怎样来很好地格式化输出。这对于在shell中“画”表格的时候很有用。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-shell-script/guide-start-learning-shell-scripting-scratch/ + +作者:[Petras Liumparas][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://linoxide.com/author/petrasl/