diff --git a/README.md b/README.md index 26ea32fd81..968c8434a1 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ LCTT的组成 * 2014/11/04 提升zpl1025为Core Translators成员。 * 2014/12/25 提升runningwater为Core Translators成员。 * 2015/04/19 发起 LFS-BOOK-7.7-systemd 项目。 +* 2015/06/09 提升ictlyh和dongfengweixiao为Core Translators成员。 活跃成员 ------------------------------- @@ -63,6 +64,8 @@ LCTT的组成 - CORE @reinoir, - CORE @bazz2, - CORE @zpl1025, +- CORE @ictlyh, +- CORE @dongfengweixiao - Senior @tinyeyeser, - Senior @vito-L, - Senior @jasminepeng, @@ -76,7 +79,6 @@ LCTT的组成 - @alim0x, - @2q1w2007, - @theo-l, -- @ictlyh, - @FSSlc, - @su-kaiyao, - @blueabysm, @@ -167,7 +169,7 @@ LFS 项目活跃成员有: - @KevinSJ - @Yuking-net -(更新于2015/05/31,以Github contributors列表排名) +(更新于2015/06/09,以Github contributors列表排名) 谢谢大家的支持! diff --git a/published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md new file mode 100644 index 0000000000..7f3747721f --- /dev/null +++ b/published/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md @@ -0,0 +1,423 @@ +25 个有用 Apache ‘.htaccess’ 技巧 +================================================================================ +网站是我们生活中重要的一部分。它们是实现扩大业务、分享知识以及其它更多功能的方式。早期受制于只能提供静态内容,随着动态客户端和服务器端脚本语言的引入和现有静态语言的持续改进,例如从 html 到 html5,动态网站成为可能,剩下的也许在不久的将来也会实现。 + +对于网站,随之而来的是需要一个能向全球大规模用户显示站点的某个东西。这个需求可以通过托管网站的服务器实现。这包括一系列的服务器,例如:Apache HTTP Server、Joomla 以及 允许个人拥有自己网站的 WordPress。 + +![Apache htaccess 小技巧](http://www.tecmint.com/wp-content/uploads/2015/01/htaccess-tricks.jpg) + +*25 个 htaccess 小技巧* + +想要拥有一个网站,可以创建一个自己的本地服务器,或者联系任何上面提到的或其它服务器管理员来托管他的网站。但实际问题也从这点开始。网站的性能主要取决于以下因素: + +- 网站消耗的带宽。 +- 面对黑客,网站有多安全。 +- 对数据库进行数据检索时的优化。 +- 显示导航菜单和提供更多 UI 功能时的用户友好性。 + +除此之外,保证托管网站服务器成功的多种因素还包括: + +- 对于一个流行站点的数据压缩量。 +- 同时为多个对请求同一或不同站点的用户服务的能力。 +- 保证网站上输入的机密数据安全,例如:Email、信用卡信息等等。 +- 允许更多的选项用于增强站点的动态性。 + +这篇文章讨论一个服务器提供的用于增强网站性能和提高针对坏机器人、热链等的安全性的功能:‘.htaccess’ 文件。 + +### .htaccess 是什么? ### + +htaccess (hypertext access,超文本访问) 是为网站所有者提供用于控制服务器环境变量以及其它参数的选项,从而增强他们网站的功能的文件。这些文件可以在网站目录树的任何一个目录中,并向该目录以及目录中的文件和子目录提供功能。 + +这些功能是什么呢?其实这些是服务器的指令,例如命令服务器执行特定任务的行,这些命令只对该文件所在目录中的文件和子目录有效。这些文件默认是隐藏的,因为所有操作系统和网站服务器默认配置为忽略它们,但如果查看隐藏文件的话,你就可以看到这些特殊文件。后续章节的话题将讨论能控制什么类型的参数。 + +注意:如果 .htaccess 文件保存在 /apache/home/www/Gunjit/ 目录,那么它会向该目录中的所有文件和子目录提供命令,但如果该目录包含一个名为 /Gunjit/images/ 子目录,且该子目录中也有一个 .htaccess 文件,那么这个子目录中的命令会覆盖父目录中 .htaccess 文件(或者目录层次结构中更上层的文件)提供的命令。 + +### Apache Server 和 .htaccess 文件 ### + +Apache HTTP Server 俗称为 Apache,是为了表示对一个有卓越战争策略技能的美洲土著部落的尊敬而命名。它基于 [NCSA HTTPd 服务器][1] ,是用 C/C++ 和 XML 建立的跨平台 Web 服务器,它在万维网的成长和发展中起到了关键作用。 + +它最常用于 UNIX,但 Apache 也能用于多种平台,包括 FreeBSD、Linux、Windows、Mac OS、Novel Netware 等。在 2009 年,Apache 成为第一个为超过一亿站点提供服务的服务器。 + +Apache 服务器可以让 www/ 目录中的每个用户有一个单独的 .htaccess 文件。尽管这些文件是隐藏的,但如果需要的话可以使它们可见。在 www/ 目录中可以有很多子目录,每个子目录通过用户名或所有者名称命名,包含了一个站点。除此之外你可以在每个子目录中有一个 .htaccess 文件,像之前所述用于配置子目录中的文件。 + +下面介绍如果配置 Apache 服务器上的 htaccess 文件。 + +### Apache 服务器上的配置 ### + +这里有两种情况: + +#### 在自己的服务器上托管网站 #### + +在这种情况下,如果没有启用 .htaccess 文件,你可以通过在 http.conf(Apache HTTP 守护进程的默认配置文件) 中找到 部分启用。 + + + +定位如下行 + + AllowOverride None + +更改为 + + AllowOverride All + +现在,重启 Apache 后就启用了 .htaccess。 + +#### 在不同的托管服务提供商的服务器上托管网站 #### + +在这种情况下最好咨询托管管理员,如果他们允许访问 .htaccess 文件的话。 + +### 用于网站的 25 个 Apache Web 服务器 ‘.htaccess’ 小技巧 ### + +#### 1. 如何在 .htaccess 文件中启用 mod_rewrite #### + +mod_rewrite 选项允许你使用重定向并通过重定向到其它 URL 来隐藏你真实的 URL。这个选项非常有用,允许你用短的容易记忆的 URL 替换长 URL。 + +要允许 mod_rewrite,只需要在你的 .htaccess 文件的第一行添加如下一行。 + + Options +FollowSymLinks + +该选项允许你跟踪符号链接从而在站点中启用 mod_rewrite。后面会介绍用短 URL 替换。(LCTT 译注:+FollowSymLinks 只是启用 mod_rewrite 的前提之一,还需要在全局和虚拟机中设置 `RewriteEngine on` 才能启用重写模块。) + +#### 2. 如何允许或禁止对站点的访问 #### + +通过使用 order、allow 和 deny 关键字,htaccess 文件可以允许或者禁止对站点或目录中子目录或文件的访问。 + +**只允许 IP 192.168.3.1 的访问** + + Order Allow, Deny + Deny from All + Allow from 192.168.3.1 + + 或 + + Order Allow, Deny + Allow from 192.168.3.1 + +这里的 Order 关键字指定处理 allow 和 deny 访问的顺序。对于上面的 ‘Order’ 语句,首先会处理 Allow 语句,然后是 deny 语句。 + +**只禁止某个 IP 的访问** + +下面一行的意思是除了 IP 地址 192.168.3.1,允许所有用户访问网站。 + + Order Allow, Deny + Deny from 192.168.3.1 + Allow from All + + 或 + + Order Deny, Allow + Deny from 192.168.3.1 + +#### 3. 为不同错误码生成 Apache 错误文档 #### + +用简单几行,我们可以解决当用户/客户端请求一个站点上不可用的网页时服务器产生的错误码的错误文档,例如我们大部分人见过的浏览器中显示的 ‘404 Page not found’。‘.htaccess’ 文件指定了发生这些错误情况时采取何种操作。 + +要做到这点,需要添加下面的行到 ‘.htaccess’ 文件: + + ErrorDocument + +‘ErrorDocument’ 是一个关键字,error-code 可以是 401、403、404、500 或任何有效的表示错误的代码,最后 ‘path-of-document’ 表示本地机器上的路径(如果你使用的是你自己的本地服务器) 或服务器上的路径(如果你使用任何其它服务器来托管网站)。 + +**例子:** + + ErrorDocument 404 /error-docs/error-404.html + +上面一行设置客户请求任何无效页面,服务器报告 404 错误时显示 error-docs 目录下的 ‘error-404.html’ 文档。 + + ErrorDocument 404 "404 Page not found

The page you request is not present. Check the URL you have typed

" + +上面的表示也正确,其中字符串相当于一个普通的 html 文件。 + +#### 4. 设置/取消 Apache 服务器环境变量 #### + +在 .htaccess 文件中你可以设置或者取消站点所有者可以更改的全局环境变量。要设置或取消环境变量,你需要在你的 .htaccess 文件中添加下面的行。 + +**设置环境变量** + + SetEnv OWNER “Gunjit Khera” + +**取消环境变量** + + UnsetEnv OWNER + +#### 5. 为文件定义不同 MIME 类型 #### + +MIME(多用途 Internet 多媒体扩展)是浏览器运行任何页面所默认识别的类型。你可以在 .htaccess 文件中为你的站点定义 MIME 类型,然后服务器就可以识别你定义类型的文件并运行。 + + + AddType application/javascript js + AddType application/x-font-ttf ttf ttc + + +这里,mod_mime.c 是用于控制定义不同 MIME 类型的模块,如果在你的系统中已经安装了这个模块,那么你就可以用该模块去为你站点中不同的扩展名定义不同的 MIME 类型,从而让服务器可以理解这些文件。 + +#### 6. 如何在 Apache 中限制上传和下载的大小 #### + +.htaccess 文件允许你能够控制某个用户从你的站点(通过 PHP)单次上传数据量的大小(LCTT 译注:原文有误,修改)。要做到这点你只需要添加下面的行到你的 .htaccess 文件: + + php_value upload_max_filesize 20M + php_value post_max_size 20M + php_value max_execution_time 200 + php_value max_input_time 200 + +上面的行设置最大上传大小、最大POST 提交数据大小、最长执行时间(例如,允许用户在他的本地机器上单次执行一个请求的最大时间)、限制的最大输入时间。 + +#### 7. 让用户不能在你的站点上在线播放 .mp3 和其它文件 #### + +大部分情况下,人们在下载检查音乐质量之前会在网站上播放等等。作为一个聪明的销售者,你可以添加一个简单的功能,不允许任何用户在线播放音乐或视频,而是必须下载完成后才能播放。这非常有用,因为(无缓冲的)在线播放音乐和视频会消耗很多带宽。 + +要添加下面的行到你的 .htaccess 文件: + + AddType application/octet-stream .mp3 .zip + +#### 8. 为站点设置目录索引 #### + +大部分网站开发者都知道第一个显示的页面是哪个,例如一个站点的首页,被命名为 ‘index.html’。我们大部分也见过这个。但是如何设置呢? + +.htaccess 文件提供了一种方式用于列出一个客户端请求访问网站的主页面时会顺序扫描的一些网页集合,相应地如果找到了列出的页面中的任何一个就会作为站点的主页面并显示给用户。 + +需要添加下面的行产生所需的效果。 + + DirectoryIndex index.html index.php yourpage.php + +上面一行指定如果有任何访问首页的请求到来,首先会在目录中顺序搜索上面列出的网页:如果发现了 index.html 则显示为主页面,否则会找下一个页面,例如 index.php,如此直到你在列表中输入的最后一个页面。 + +#### 9. 如何为文件启用 GZip 压缩以节省网站带宽 #### + +繁忙的站点通常比只占少量空间的轻量级站点运行更慢,这是常见的现象。因为对于繁忙的站点需要时间加载巨大的脚本文件和图片以在客户端的 Web 浏览器上显示。 + +通常的机制是这样的,当浏览器请求一个 web 页面时,服务器提供给浏览器该页面,并在浏览器端显示该 web 页面,浏览器需要下载该页面并运行页面内的脚本。 + +这里 GZip 压缩所做的就是节省单个用户的服务时间而不用增加带宽。服务器上站点的源文件以压缩形式保存,当用户请求到来的时候,这些文件以压缩形式传送,然后在客户端上解压(LCTT 译注:原文此处有误)。这改善了带宽限制。 + +下面的行允许你压缩站点的源文件,但要求在你的服务器上安装 mod_deflate.c 模块。 + + + AddOutputFilterByType DEFLATE text/plain + AddOutputFilterByType DEFLATE text/html + AddOutputFilterByType DEFLATE text/xml + AddOutputFilterByType DEFLATE application/html + AddOutputFilterByType DEFLATE application/javascript + AddOutputFilterByType DEFLATE application/x-javascript + + +#### 10. 处理文件类型 #### + +服务器默认的有一些特定情况。例如:在服务器上运行 .php 文件,显示 .txt 文件。像这些我们可以以源代码形式只显示一些可执行 cgi 脚本或文件而不是执行它们(LCTT 译注:这是为了避免攻击者通过上传恶意脚本,进而在服务器上执行恶意脚本进行破坏和窃取)。 + +要做到这点在 .htaccess 文件中有如下行。 + + RemoveHandler cgi-script .php .pl .py + AddType text/plain .php .pl .py + +这些行告诉服务器只显示而不执行 .pl (perl 脚本)、.php (PHP 文件) 和 .py (Python 文件) 。 + +#### 11. 为 Apache 服务器设置时区 #### + +从 .htaccess 文件可用于为服务器设置时区可以看出它的能力和重要性。这可以通过设置一个服务器为每个托管站点提供的一系列全局环境变量中的 ‘TZ’ 完成。 + +由于这个原因,我们可以在网站上看到根据我们的时区显示的时间。也许服务器上其他拥有网站的人会根据他居住地点的位置设置时区。 + +下面的一行为服务器设置时区。 + + SetEnv TZ India/Kolkata + +#### 12. 如果在站点上启用缓存控制 #### + +浏览器很有趣的一个功能是,很多时间你可以看到,当多次同时打开一个网站和第一次打开相比前者会更快。但为什么会这样呢?事实上,浏览器在它的缓存中保存了一些通常访问的页面用于加快后面的访问。 + +但保存多长时间呢?这取决于你自己。例如,你的 .htaccess 文件中设置的缓存控制时间。.htaccess 文件指定了站点的网页可以在浏览器缓存中保存的时间,时间到期后需要重新验证缓存,页面可能会从缓存中删除然后在下次用户访问站点的时候重建。 + +下面的行为你的站点实现缓存控制。 + + + Header Set Cache-Control "max-age=3600, public" + + + Header Set Cache-Control "public" + Header Set Expires "Sat, 24 Jan 2015 16:00:00 GMT" + + +上面的行允许缓存 .htaccess 文件所在目录中的页面一小时。 + +#### 13. 配置单个文件 #### + +通常 .htaccess 文件中的内容会对该文件所在目录中的所有文件和子目录起作用,但是你也可以对特殊文件设置一些特殊权限,例如只禁止对某个文件的访问等等。 + +要做到这点,你需要在文件中以类似方式添加 \ 标记: + + + Order allow, deny + Deny from 188.100.100.0 + + +这是一个禁止 IP 188.100.100.0 访问 ‘conf.html’ 的简单例子,但是你也可以添加介绍过的 .htaccess 文件的任何功能,包括将要介绍的功能,例如:缓存控制、GZip 压缩。 + +大部分服务器会用这个功能增强 .htaccess 文件的安全,这也是我们在浏览器上看不到 .htaccess 文件的原因。在后面的章节中会介绍如何给文件授权。 + +#### 14. 启用在 cgi-bin 目录以外运行 CGI 脚本 #### + +通常服务器运行的 CGI 脚本都保存在 cgi-bin 目录中,但是你可以在你需要的目录运行 CGI 脚本,只需要在所需的目录中的 .htaccess 文件添加下面的行,如果没有该文件就创建一个,并添加下面的行: + + AddHandler cgi-script .cgi + Options +ExecCGI + +#### 15.如何用 .htaccess 在站点上启用 SSI #### + +服务器端包括(SSI)顾名思义是和服务器部分相关的东西。这是什么呢?通常当我们在站点上有很多页面的时候,我们在主页上会有一个显示到其它页面链接的导航菜单,我们可以启用 SSI 选项允许导航菜单中显示的所有页面完全包含在主页面中。 + +SSI 允许多个页面包含同样的内容,因此只需要编辑一个文件就行,从而可以节省很多磁盘空间。对于 .shtml 文件,服务器默认启用了该选项。 + +如果你想要对 .html 启用该选项,你需要添加下面的行: + + AddHandler server-parsed .html + +这样 html 文件中如下部分会被替换为 SSI。 + + + +#### 16. 如何防止网站列出目录列表 #### + +为防止任何客户端在本地机器罗列服务器上的网站目录列表,添加下面的行到你不想列出的目录的文件中。 + + Options -Indexes + +#### 17. 更改默认字符集和语言头 #### + +.htaccess 文件允许你更改网站使用的字符集,例如 ASCII 或 UNICODE,UTF-8 等,以及用于显示内容的默认语言。 + +在服务器的全局环境变量之后添加下面语句可以实现上述功能。 + + AddDefaultCharset UTF-8 + DefaultLanguage en-US + +#### 18. 重定向一个非 www URL 到 www URL #### + +在开始解释之前,首先看看如何启用该功能,添加下列行到 .htaccess 文件。 + + RewriteEngine ON + RewriteCond %{HTTP_HOST} ^abc\.net$ + RewriteRule (.*) http://www.abc.net/$1 [R=301,L] + +上面的行启用重写引擎,然后在第二行检查所有涉及到主机 abc.net 或 环境变量 HTTP_HOST 为 “abc.net” 的 URL。 + +对于所有这样的 URL,代码永久重定向它们(如果启用了 R=301 规则)到新 URL http://www.abc.net/$1,其中 $1 是主机为 abc.net 的非 www URL。非 www URL 是大括号内的内容,并通过 $1 引用。 + +**重写 URL 的重定向规则** + +重写功能简单的说,就是用短而易记的 URL 替换长而难以记忆的 URL。但是,在开始这个话题之前,这里有一些本文后面会使用的特殊字符的规则和约定。 + +**特殊符号:** + + 符号 含义 + ^ - 字符串开头 + $ - 字符串结尾 + | - 或 [a|b] : a 或 b + [a-z] - a 到 z 的任意字母 + + - 之前字母的一次或多次出现 + * - 之前字母的零次或多次出现 + ? - 之前字母的零次或一次出现 + +**常量和它们的含义:** + + 常量 含义 + NC - 区分大小写 + L - 最后的规则 – 停止处理后面规则 + R - 临时重定向到新 URL + R=301 - 永久重定向到新 URL + F - 禁止发送 403 头给用户 + P - 代理 - 获取远程内容代替部分并返回 + G - Gone, 不再存在 + S=x - 跳过后面的 x 条规则 + T=mime-type - 强制指定 MIME 类型 + E=var:value - 设置环境变量 var 的值为 value + H=handler - 设置处理器 + PT - Pass through - 用于 URL 还有额外的头 + QSA - 将查询字符串追加到替换 URL + + +#### 19. 重定向整个站点到 https #### + +下面的行会帮助你转换整个网站到 https: + + RewriteEngine ON + RewriteCond %{HTTPS} !on + RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} + +上面的行启用重写引擎,然后检查环境变量 HTTPS 的值。如果设置了那么重写所有网站页面到 https。 + +#### 20.一个自定义重写例子 #### + +例如,重定向 url ‘http://www.abc.net?p=100&q=20’ 到 ‘http://www.abc.net/10020pq’。 + + RewriteEngine ON + RewriteRule ^http://www.abc.net/([0-9]+)([0-9]+)pq$ ^http://www.abc.net?p=$1&q=$2 + +在上面的行中,$1 表示第一个括号,$2 表示第二个括号。 + +#### 21. 重命名 htaccess 文件 #### + +为了防止入侵者和其他人查看 .htaccess 文件,你可以重命名该文件,这样就不能通过客户端浏览器访问。实现该目标的语句是: + + AccessFileName htac.cess + +#### 22. 如何为你的网站禁用图片盗链 #### + +网站带宽消耗比较大的另外一个重要问题是盗链问题,这是其它站点用于显示你网站的图片而链接到你的网站的链接,这会消耗你的带宽。这问题也被成为 ‘带宽盗窃’。 + +一个常见现象是当一个网站要显示其它网站所包含的图片时,由于该链接需要从你的网站加载内容,消耗你站点的带宽而为其它站点显示图片。为了防止出现这种情况,比如对于 .gif、.jpeg 图片等,下面的代码行会有所帮助: + + RewriteEngine ON + RewriteCond %{HTTP_REFERER} !^$ + RewriteCond %{HTTP_REFERERER} !^http://(www\.)?mydomain.com/.*$ [NC] + RewriteRule \.(gif|jpeg|png)$ - [F]. + +上面的行检查 HTTP_REFERER 是否没有设为空或没有设为你站点上的任何链接。如果是这样的话,你网页上的所有图片会用 403 禁止访问代替。 + +#### 23. 如何将用户重定向到维护页面 #### + +如果你的网站需要进行维护并且你想向所有需要访问该网站的你的所有客户通知这个消息,对于这种情况,你可以添加下面的行到你的 .htaccess 文件,从而只允许管理员访问并替换所有访问 .jpg、.css、.gif、.js 等的页面内容。 + + RewriteCond %{REQUEST_URI} !^/admin/ [NC] + RewriteCond %{REQUEST_URI} !^((.*).css|(.*).js|(.*).png|(.*).jpg) [NC] + RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html [NC,L,U,QSA] + +这些行检查请求 URL 是否包含任何例如以 ‘/admin/’ 开头的管理页面的请求,或任何到 ‘.png, .jpg, .js, .css’ 页面的请求,对于任何这样的请求,用 ‘ErrorDocs/Maintainence_Page.html’ 替换那个页面。 + +#### 24. 映射 IP 地址到域名 #### + +名称服务器是将特定 IP 地址转换为域名的服务器。这种映射也可以在 .htaccess 文件中用以下形式指定。 + + # 为了将IP地址 L.M.N.O 映射到域名 www.hellovisit.com + RewriteCond %{HTTP_HOST} ^L\.M\.N\.O$ [NC] + RewriteRule ^(.*)$ http://www.hellovisit.com/$1 [L,R=301] + +上面的行检查任何页面的主机是否包含类似 L.M.N.O 的 IP 地址,如果是的话第三行会通过永久重定向将页面映射到域名 http://www.hellovisit.com。 + +#### 25. FilesMatch 标签 #### + +类似用于应用条件到单个文件的 标签, 能用于匹配一组文件并对该组文件应用一些条件,如下: + + + Order Allow, Deny + Deny from All + + +### 结论 ### + +.htaccess 文件能实现的小技巧还有很多。这告诉了我们这个文件有多么强大,通过该文件能给你的站点添加多少安全性、动态性以及其它功能。 + +我们已经在这篇文章中尽最大努力覆盖尽可能多的 htaccess 小技巧,但如果我们缺少了任何重要的技巧,或者你愿意告诉我们你的 htaccess 想法和技巧,你可以在下面的评论框中提交,我们也会在文章中进行介绍。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/apache-htaccess-tricks/ + +作者:[Gunjit Khera][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gunjitk94/ +[1]:https://en.wikipedia.org/wiki/NCSA_HTTPd \ No newline at end of file diff --git a/published/20150526 20 Useful Terminal Emulators for Linux.md b/published/20150526 20 Useful Terminal Emulators for Linux.md new file mode 100644 index 0000000000..318b686aca --- /dev/null +++ b/published/20150526 20 Useful Terminal Emulators for Linux.md @@ -0,0 +1,301 @@ +20 款优秀的 Linux 终端仿真器 +================================================================================ + +终端仿真器是一款用其它显示架构重现可视终端的计算机程序。换句话说就是终端仿真器能使哑终端看似像一台连接上了服务器的客户机。终端仿真器允许最终用户用文本用户界面和命令行来访问控制台和应用程序。(LCTT 译注:终端仿真器原意指对大型机-哑终端方式的模拟,不过在当今的 Linux 环境中,通常指通过远程或本地方式连接的伪终端,俗称“终端”。) + +![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg) + +*20款Linux终端仿真器* + +你能从开源世界中找到大量的终端仿真器,它们有些拥有大量的特性而有些则反之。为了能更好地了解它们的特性,我们收集了一份优秀的Linux终端仿真器清单。每一款都列出了它们各自的描述和特性以及软件界面截图和下载链接。 + +### 1. Terminator ### + +Terminator是一款先进且强大的终端仿真器,它支持多终端窗口。这款仿真器可以完全自定义。你可以更改它的界面尺寸、颜色,给它设置不同的形状。拥有高用户友好性且使用起来很有乐趣。 + +#### Terminator的特性 #### + +- 自定义配置和配色方案,根据你的需要设置尺寸。 +- 使用插件来提供更多功能。 +- 快捷键可以加快普通操作。 +- 可以把终端窗口分割成几个虚拟终端并把它们根据需要重新调整尺寸。 + +![Terminator Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Terminator-Emulator.jpeg) + +*Terminator 终端* + +- [Terminator 主页][1] +- [下载和安装指引][2] + +### 2. Tilda ### + +Tilda是一款漂亮的下拉式终端,基于GTK+,一键单击你就可以呼出一个新的或隐藏着的Tilda窗口。你也可以用你所选择的颜色来更改文本颜色和终端背景颜色。 + +#### Tilda的特性 #### + +- 高度定制的选项界面设置。 +- 你可以给Tilda设置透明度。 +- 优秀的嵌入式配色方案。 + +![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg) + +*Tilda 终端* + +- [Tilda 主页][3] + +### 3. Guake ### + +Guake是一款基于python的下拉式终端,诞生于GNOME桌面环境。一键调出,再按一下就能隐藏。它的设计构思来源于FPS (第一人称射击) 游戏 Quake,其主要目标是容易访问。 + +Guake与Yakuaka和Tilda非常相似,不过它是一个集上述二者的优点于一体的基于GTK的程序。Guake完全是用Python和C的片段写成的(全局热键部分)。 + +![Guake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Guake-Terminal.jpeg) + +*Guake 终端* + +- [Guake 主页][4] + +### 4. Yakuake ### + +Yakuake (Yet Another Kuake) 是一款基于KDE的下拉式终端仿真器,它与Guake在功能上非常相似。它的设计构思也是受FPS游戏Quake的启发。 + +Yakuake从根本上说是一款KDE应用程序,它能非常轻松地安装在KDE桌面上,但是如果你试着将它安装在GNOME桌面上,你将会安装大量的依赖包。 + +#### Yakuake的特性 #### + +- 顺畅地从屏幕顶端弹出 +- 标签式界面 +- 可配置的尺寸和动画速度 +- 可定制 + +![Yakuake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Yakuake-Terminal.jpeg) + +*Yakuake 终端* + +- [Yakuake 主页][5] + +### 5. ROXTerm ### + +ROXterm是又一款轻量级终端仿真器,旨在提供与“GNOME终端”相似的特性。它原本创造出来是为了避免使用Gnome库从而更少占用空间和更快启动,并使用独立的小程序来显示配置界面(GUI), 但是随着时间的流逝,它的角色就转变为给那些高级用户带来更高层次的特性。 + +然而,它比GNOME终端更加具有可制定性,并且对于那些经常使用终端的高级用户更令人期望。它能和GNOME桌面环境完美结合并在终端中提供像拖拽项目那样的特性。 + +![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg) + +*Roxterm 终端* + +- [ROXTerm 主页][6] + +### 6. Eterm ### + +Eterm是最轻量级的一款彩色终端仿真器,是作为xterm的替代品而被设计出来。它是以一种自由选择的理念设计的,带来了更强大、灵活、用户自主把控的终端。 + +![Eterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Eterm-Terminal.jpeg) + +*Eterm 终端* + +- [Eterm 主页][7] + +### 7. Rxvt ### + +Rxvt 的意思是扩展虚拟终端,它是一款彩色终端仿真器,是为那些不需要一些诸如Tektronix 4014仿真和toolkit-style可配置性等特性的高级用户而生的xterm替代品。 + +![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg) + +*Rxvt 终端* + +- [Rxvt 主页][8] + +### 8. Wterm ### + +Wterm是另一款以rxvt项目为基础的轻量级彩色终端仿真器。它所包含的特性包括设置背景图片、透明度、反向透明度和大量的设置或运行环境选项让它成为一款可高度自定义的终端仿真器。 + +![wterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/wterm-Terminal-.jpeg) + +*wterm 终端* + +- [Wterm 主页][9] + +### 9. LXTerminal ### + +LXTerminal是一款基于VTE的终端仿真器,默认运行于没有任何多余依赖的LXDE(轻量级X桌面环境)下。这款终端有很多很棒的特性。 + +#### LXTerminal的特性 #### + +- 多标签式支持 +- 支持常规命令如cp, cd, dir, mkdir, mvdir +- 隐藏菜单栏以保证足够界面空间 +- 更改配色方案 + +![lxterminal Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/lxterminal-Terminal.jpeg) + +*lxterminal 终端* + +- [LXTerminal 主页][10] + +### 10. Konsole ### + +Konsole是另一款强大的基于KDE的免费终端仿真器,最初由Lars Doelle创造。 + +#### Konsole的特性 #### + +- 多标签式终端 +- 半透明背景 +- 支持拆分视图模式 +- 目录和SSH书签化 +- 可定制的配色方案 +- 可定制的按键绑定 +- 终端中的活动通知警告 +- 增量搜索 +- 支持Dolphin文件管理器 +- 支持导出显示为普通文本和HTML格式 + +![Konsole Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Konsole-Terminal.jpeg) + +*Konsole 终端* + +- [Konsole 主页][11] + +### 11. TermKit ### + +TermKit是一款漂亮简洁的终端,其目标是用WebKit渲染引擎在基于应用程序的命令行中构建出GUI视图(LCTT 译注:这个描述比较模糊,请参考截图,或安装一个体验下),WebKit渲染引擎在Google Chrome和Chromium中广泛使用。TermKit起初是为Mac和Windows设计的,但是由于Floby对TermKit 构建了分支,现在你可以将它安装在Linux发行版上并感受TermKit带来的魅力。 + +![TermKit Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/TermKit-Terminal.jpeg) + +*TermKit 终端* + +- [TermKit 主页][12] + +### 12. st ### + +st是一款简单的X Window终端。 + +![st terminal](http://www.tecmint.com/wp-content/uploads/2014/01/st-terminal.png) + +*st 终端* + +- [st 主页][13] + +### 13. Gnome 终端 ### + +GNOME终端是一款在GNOME桌面环境下自带的终端仿真器,由Havoc Pennington和其他一些人共同开发。它允许用户在GNOME环境下可以使用一个真实的Linux shell来运行命令。GNOME终端是模仿了xterm终端仿真器,并有一些相似的特性。 + +Gnome终端支持多配置文件,用户可以为他们的账户创建多个配置文件,每个配置文件能自定义配置选项,如字体、颜色、背景图片、行为习惯等等,并能分别给每个配置文件取名。它也支持鼠标事件、url探测、多标签等。 + +![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Gnome-terminal.jpg) + +*Gnome 终端* + +- [Gnome 终端][14] + +### 14. Final Term ### + +Final Term是一款漂亮的开源终端仿真器,在这一个单独的界面里蕴藏着一些令人激动的特性和方便的功能。虽然它仍然有待改进,但是它提供了一些重要的特性比如“语义”文本菜单、智能的命令行补全、GUI终端控制、全能的快捷键、彩色支持等等。以下动图抓取并演示了它们的一些特性,点开来看看吧。 + +![FinalTerm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/FinalTerm.gif) + +*FinalTerm 终端* + +- [Final Term][15] + +### 15. Terminology ### + +Terminology是又一款新的现代化终端仿真器,为Enlightenment桌面创造,但也能用于其它桌面环境。它有一些独一无二的棒极了的特性,这是其它终端仿真器所不具备的。 + +抛开这些特性,terminology甚至还提供了你无法从其它仿真器看到的东西,比如图像、视频和文档的缩略图预览,它允许你从Terminology直接就能看到那些文件。 + +你可以来看看Terminology的开发人员制作的小视频(视频画质不太清晰,但足以让你了解Terminology了): https://www.youtube.com/ibPziLRGvkg + +- [Terminology][16] + +### 16. Xfce4 终端 ### + +Xfce终端是一款轻量级的现代化终端仿真器,它简单易用,为Xfce桌面环境设计。它最新的一个版本有许多新的炫酷特性,比如搜索对话框、标签颜色转换器、像Guake或Yakuake一样的下拉式控制台等等。 + +![Xfce Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xfce-terminal.jpg) + +*Xfce 终端* + +- [Xfce4 终端][17] + +### 17. xterm ### + +xterm应用是一款标准的在X Window系统上的终端仿真器。它保持了对DEC VT102和Tektronix 4014终端的兼容,以支持那些不能直接使用窗口系统的应用。 + +![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg) + +*xterm 终端* + +- [xterm][18] + +### 18. LilyTerm ### + +LilyTerm是一款基于libvte的开源终端仿真器,这款不太出名的仿真器追求的是快速和轻量级。LilyTerm也包括一些关键特性: + +- 支持标签、彩色以及标签重新排序 +- 通过快捷键管理标签 +- 支持背景透明化和饱和度调整 +- 支持用户创建配置文件 +- 若干个自定义选项 +- 广泛支持UTF-8 + +![Lilyterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Lilyterm.jpg) + +*Lilyterm 终端* + +- [LilyTerm][19] + +### 19. Sakura ### + +Sakura是另一款不知名的Unix风格终端仿真器,是为命令行模式和基于文本的终端程序开发的。Sakura基于GTK和livte,自身特性不多,不过还是有一些自定义选项,比如多标签支持、自定义文本颜色、字体和背景图片、快速命令处理等等。 + +![Sakura Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/sakura.jpg) + +*Sakura 终端* + +- [Sakura][20] + +### 20. rxvt-unicode ### + +rxvt-unicode (也称为urxvt) 是另一个高度可定制、轻量级和快速的终端仿真器,支持xft和unicode,由Marc Lehmann开发。它有许多显著特性,比如通过Unicode支持国际化语言,能显示多种字体类型并支持Perl扩展。 + +![rxvt unicode](http://www.tecmint.com/wp-content/uploads/2014/01/rxvt-unicode.png) + +*rxvt unicode* + +- [rxvt-unicode][21] + +如果你知道任何其它强大的Linux终端仿真器而上文未提及,欢迎在评论中与我们分享。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-terminal-emulators/ + +作者:[Ravi Saive][a] +译者:[ZTinoZ](https://github.com/ZTinoZ) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/admin/ +[1]:https://launchpad.net/terminator +[2]:http://www.tecmint.com/terminator-a-linux-terminal-emulator-to-manage-multiple-terminal-windows/ +[3]:http://tilda.sourceforge.net/tildaabout.php +[4]:https://github.com/Guake/guake +[5]:http://extragear.kde.org/apps/yakuake/ +[6]:http://roxterm.sourceforge.net/index.php?page=index&lang=en +[7]:http://www.eterm.org/ +[8]:http://sourceforge.net/projects/rxvt/ +[9]:http://sourceforge.net/projects/wterm/ +[10]:http://wiki.lxde.org/en/LXTerminal +[11]:http://konsole.kde.org/ +[12]:https://github.com/unconed/TermKit +[13]:http://st.suckless.org/ +[14]:https://help.gnome.org/users/gnome-terminal/stable/ +[15]:http://finalterm.org/ +[16]:http://www.enlightenment.org/p.php?p=about/terminology +[17]:http://docs.xfce.org/apps/terminal/start +[18]:http://invisible-island.net/xterm/ +[19]:http://lilyterm.luna.com.tw/ +[20]:https://launchpad.net/sakura +[21]:http://software.schmorp.de/pkg/rxvt-unicode diff --git a/published/20150527 How to edit your documents collaboratively on Linux.md b/published/20150527 How to edit your documents collaboratively on Linux.md new file mode 100644 index 0000000000..a49cb0ef13 --- /dev/null +++ b/published/20150527 How to edit your documents collaboratively on Linux.md @@ -0,0 +1,122 @@ +如何在 Linux 上 使用 ONLYOFFICE 协同编辑文档 +================================================================================ +> “多年前由一些紧张兮兮的、带有强迫症的助理开发的 Bulletin,只是一个放在共享文件夹中只有 Emily 和我可以访问的 Word 文档而已。同一时间我们只有一个人可以打开它并添加消息、想法,或者给条目列表上增加问题。然后我们再打印出更新后的版本并放到我桌子架上的剪贴板,并在完成时删除旧的内容。”(——《穿普拉达的女王》,劳伦·魏丝伯格著 ) + +直到今天人们仍然在使用这样的“协同编辑”,只有一个人可以打开共享文件,对其进行更改,然后告诉其它人什么时候修改了什么。 + +ONLYOFFICE 是一款集成了文档、电子邮件、事件、任务和客户关系管理工具的开源在线办公套件。 + +使用 ONLYOFFICE 办公套件,一组人可以同时编辑文本、电子表格或者在浏览器上进行展示。可以直接在他们的文档上留下评论并用其中集成的聊天工具和其他人沟通。最后,可以保存文档为 PDF 文件并打印。作为额外的增强功能,它还能浏览文档历史并在如果需要时恢复到之前的修订/版本。 + +在这篇教程中,我会介绍如何使用 [免费版 ONLYOFFICE][1] 部署你自己的在线办公套件,免费版 ONLYOFFICE 是 ONLYOFFICE 在 GNU AGPL v3 协议下发布的自托管版本。 + +### 在 Linux 上安装 ONLYOFFICE ### + +安装 ONLYOFFICE 要求在你的 Linux 系统上要有 mono(4.0.0 或更高版本)、nodejs、libstdc++6、nginx 和 mysql-server。为了简化安装过程并避免依赖错误,我使用 Docker 安装 ONLYOFFICE。在这种情况下只需要安装一种依赖 - [Docker][2]。 + +提醒一下,Docker 是一个在软件容器中自动部署应用的开源项目。如果在你的 Linux 系统上 Docker 不可用,首先根据 [基于 Debian][3] 或 [基于 Red-Hat][4] 系统的 Docker 安装指令安装它。 + +注意,你需要 Docker 1.4.1 或更高版本。要检查安装的 Docker 版本,可以使用下面的命令。 + + $ docker version + +在一个 Docker 容器中试用 ONLYOFFICE,只需要执行下面的命令: + + $ sudo docker run -i -t -d --name onlyoffice-document-server onlyoffice/documentserver + $ sudo docker run -i -t -d -p 80:80 -p 443:443 --link onlyoffice-document-server:document_server onlyoffice/communityserver + +这些命令会下载为了能正常运行带有所有所需依赖的 [官方 ONLYOFFICE Docker 镜像][5]。 + +也可以在 Linux 服务器上单独安装 [ONLYOFFICE 在线编辑器][6],并通过提供的 API 轻松地集成到你的站点或云应用。 + +### 运行自行托管的在线 Office ### + +要打开你的在线 office,在你浏览器的地址栏输入 localhost(http://IP地址/)。会打开欢迎页面: + +![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) + +输入一个密码并指定下次访问你的 office 所使用的电子邮件地址。 + +### 在线编辑文档 ### + +首先点击 Document 链接打开 **the My Documents** 文件夹。 + +![](https://farm8.staticflickr.com/7781/17956640089_d3df0b18cd_c.jpg) + +#### STEP 1. 选择需要编辑的文档 #### + +要在这里新建一个新文档,点击左上角的 “Create” 按钮,从下拉列表中选择文件类型。要编辑保存在你硬盘中的文件,点击 **Create** 按钮旁边的 **Upload** 按钮上传文件到 **Document**。 + +![](https://farm9.staticflickr.com/8836/17956640109_ed8be735df_c.jpg) + +#### STEP 2. 共享文档 #### + +如果你在 **My Documents** 文件夹中,用右边的 **Share** 按钮,或者如果你在文档中,用 **File >> Document Info ... >> Change Access Rights**。 + +在打开的 **Sharing Settings** 窗口,点击左边的 **People outside portal** 链接,打开到文档的访问,并通过启用 **Full Access** 单选按钮给予完全访问权限。 + +最后,选择一种方式共享到你文档的链接,通过 email 或者你可用的一种社交网络:Google+、Facebook 或 Twitter 发送。 + +![](https://farm8.staticflickr.com/7766/17522306273_c8a9022c75_c.jpg) + +#### STEP 3. 开始协同编辑 #### + +邀请的人只需要根据提供的链接就可以开始协同编辑文档。 + +它会自动用不用颜色的虚线将你的合作者编辑的文本段落标记出来。 + +![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) + +只要你的其中一个协作者保存了他/她的更改,你会看到在顶部工具栏左上角出现了一个提示标签,表示这里有更新。 + +![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) + +点击 **Save** 图标保存更改并更新。然后会高亮所有的更新。 + +![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) + +#### STEP 4. 和协作者互动 #### + +要写评论,用鼠标选择一个文本段落,右击并从上下文菜单中选择 **Add comment** 选项。 + +![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) + +要和协作者实时互动,可以使用集成的聊天工具。**Chat** 面板会列出所有正在编辑文档的用户。点击左侧边栏的 **Chat** 图标打开它。在 **Chat** 面板的合适区域输入你的信息开始讨论。 + +![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) + +### 有用的提示 ### + +最后,这里有一些你充分利用 ONLYOFFICE 的有用提示。 + +#### Tip #1. 在云存储服务例如 ownCloud 上编辑文档 #### + +如果你将文档存储在其它网络资源上,例如 Box、Dropbox、Google Drive、OneDrive、SharePoint 或 ownCloud,你可以轻松地和 ONLYOFFICE 同步。 + +在打开的 ‘Documents’ 模块,点击 **Add the account** 下面的其中一个图标:Google、Box、DropBox、OneDrive、ownCloud 或 ‘Add account’,并输入所需数据。 + +#### Tip #2. 在 iPad 上编辑文档 #### + +要随时随地对文件进行修改,我使用 iPad 的 ONLYOFFICE Documents 应用。你可以从 [iTune][7] 下载并安装它,然后你需要输入你的 ONLYOFFICE 地址、email 和密码来访问你的文档。功能设置几乎一样。 + +为了评估 ONLYOFFICE 在线编辑器的功能,你可以使用供个人使用的 [云版本][8]。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/edit-documents-collaboratively-linux.html + +作者:[Tatiana Kochedykova][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/tatiana +[1]:http://www.onlyoffice.org/ +[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]:https://registry.hub.docker.com/u/onlyoffice/communityserver/ +[6]:http://onlyoffice.org/sources#document +[7]:https://itunes.apple.com/us/app/onlyoffice-documents/id944896972 +[8]:https://personal.onlyoffice.com/ \ No newline at end of file diff --git a/published/201506/20141013 Compact Text Editors Great for Remote Editing and Much More.md b/published/201506/20141013 Compact Text Editors Great for Remote Editing and Much More.md new file mode 100644 index 0000000000..8915ff5006 --- /dev/null +++ b/published/201506/20141013 Compact Text Editors Great for Remote Editing and Much More.md @@ -0,0 +1,222 @@ +适合于远程编辑以及更多环境的简洁文本编辑器 +================================================================================ +文本编辑器是用来编辑纯文本的软件。这种软件有许多用处,包括修改配置文件,编写程序源代码,记下一些想法或者甚至写一份购物列表。由于这种编辑器能都用于许多不同的方面,因此值得花些时间找一个最适合您喜好的编辑器。 + +不论编辑器有多么复杂,它们通常有一个共同的功能集,包括查找/替换文本,格式化文本,导入文件以及在文件中移动文本。 + +所有这些文本编辑器都是基于终端的应用,因此他们很适合在远程主机上编辑文件。文本编辑器通常也会提供一个图形化的用户界面,但依旧会保证快速和精简。 + +基于终端的应用程序在系统资源方面也是轻量级的(在低配置机器上很有用),比起它的图形化版本来也会更快、更高效,由于它们在X需要重启时也不会停止工作,因此非常适合编写脚本。 + +我选择了一些我最喜欢的开源文本编辑器,他们在使用系统资源方面都非常节俭。 + + + +### Textadept ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Textadept.png) + +Textadept是一款适合程序员的,快速、精简、可扩展、跨平台的开源文本编辑器。这个开源程序由C和Lua写就,并且于这些年间在速度和精简方面进行了优化。 + +Textadept是那些想要无限的扩展性且不愿牺牲速度或屈服于代码膨胀的程序员们的理想编辑器。 + +它也有一个用于终端的版本,仅仅依赖ncurses,适合在远程主机上进行编辑。 + +#### 功能包括: #### + +- 轻量级 +- 精简设计以最大化利用屏幕 +- 自包含的执行文件 - 无需安装 +- 全键盘驱动 +- 无限制的分割视图(GUI版本),以您所好任意水平或垂直的分割编辑器窗口。请注意Textadep不是一个选项卡式的编辑器。 +- 支持多达80种的编程语言 +- 强大的代码片段和快捷键命令 +- 代码自动补全和API查询 +- 无与伦比的扩展性 +- 书签 +- 查找和替换 +- 在文件中查找 +- 基于缓存的单词补全 +- 成熟的编程语言符号自动补全,以及显示API文档的功能 +- 主题:亮色、暗色、终端 +- 使用词法分析器将名称放到缓冲中,如评论、字符串、关键词 +- 支持会话 +- 快速打开 +- 许多可用的模块,包括对Java、Python、Ruby和近期打开文件列表的支持 +- 符合Gnome HIG用户接口的指导 +- 支持编辑Lua代码。许多Textadept对象和Lua的标准库支持语法自动补全和LuaDoc。 + +--- + +- 网址: [foicica.com/textadept][1] +- 开发者: Mitchell and contributors +- 许可证: MIT License +- 版本号: 7.7 + + +### Vim ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-vim.png) + +vim是一个高级的文本编辑器,它在'vi'强大的基础上,并拥有更全面的功能集。 + +这个编辑器对编程和编辑其他纯ASCII的文件十分有用。所有的命令都由普通的键盘按键提供,能够使用十指来输入,因而十分快捷。另外,功能键可以由用户来定义,并且可也以使用鼠标。 + +Vim通常被称作"程序员的编辑器",它十分适合于编程,并被认为可以作为完整的集成开发环境。然而,这个软件并不是仅仅面向程序员。Vim适合于各种文本编辑,从编写email到修改配置文件。 + +Vim的界面基于文本界面下的命令行。尽管它的图形化版本gVim为常用的命令添加了菜单和工具栏,但这个软件的整个功能依旧依赖于它的命令行模式。 + +#### 功能包括: #### + +- 3 种模式: + - 命令模式 + - 插入模式 + - 命令行模式 +- 无限制的撤销 +- 多个窗口和缓冲区 +- 平滑的插入模式 +- 根据所编辑的文件的类型使用不同的颜色或风格进行语法高亮 +- 交互命令 + - 标记一行 + - vi 行缓冲 + - 移动代码块 +- 块操作 +- 命令行历史 +- 扩展的正则表达式 +- 可编辑压缩/打包文件 (gzip, bzip2, zip, tar) +- 文件名补全 +- 标记跳转 +- 折叠文本 +- 缩进 +- ctags和cscope整合 +- 100%与vi的模式兼容 +- 插件用于添加/扩展功能 +- 宏 +- vimscript, Vim的内部脚本 +- Unicode支持 +- 多语言支持 +- 在线帮助支持 + +--- + +- 网址: [www.vim.org][2] +- 开发者: Bram Moolenaar +- 许可证: GNU GPL compatible (charityware) +- 版本号: 7.4 + + + +### ne ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ne.png) + +ne是一款全屏幕的开源文本编辑器。它像是一个比vi更容易学习的vi替代物,并且可以在POSIX-兼容的系统中便携使用。 + +ne对于新手来说易于使用,但也非常强大并有完全可配置的引导程序,并且在资源使用上十分节约。 + +#### 功能包括: #### + +- 三种用户界面: 控制键,命令行、菜单;按键和菜单都可配置 +- 语法高亮 +- 对于UTF-8文件的完全支持,包括占据多列的字符(宽字符) +- 文档,剪切块,显示的维度和文件/行号长度都有编号,并且仅受制于机器的整型字长 +- 简单的脚本语言,脚本可以用简单易理解的录制/播放的方式制作 +- 无限制的撤销/重做功能(可以通过命令禁用) +- 基于被编辑的文件扩展名的自动个性化配置系统 +- 使用您文档中的词语做字典来进行自动前缀补全 +- 易用的文件存取功能 +- 扩展的正则表达式可用于查找和替换,类似emacs和vi +- 非常紧凑的内存模型,在加载和修改大型文件时十分快速 +- 可编辑二进制文件 + +--- + +- 网址: [ne.di.unimi.it][3] +- 开发者: Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis +- 许可证: GNU GPL v3 +- 版本号: 2.5 + +---------- + +### Zile ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Zile.png) + +Zile(Zile Is Lossy Emacs,Emacs精简版),它是一个小型的Emacs的克隆版。Zile是一个可定制的,自文档化,实时显示的编辑器,Zile被开发的尽可能像Emacs一样,每个Emacs用户都会对Zile感到亲切。 + +Zile以它极小的RAM用量,大约130KB,以及快速开始编辑而闻名。它是支持8比特字符集的,允许用于编写任何种类的文件。 + +#### 功能包括: #### + +- 小型但快速、强大 +- 多个缓冲区,允许多级的撤销 +- 多窗口 +- 以最小的缓冲区完成补全 +- 自动填充 (自动换行) +- Registers +- 看起来像Emacs,键序列、功能和变量名都与Emacs相同 +- Killing +- Yanking +- 自动行末检测 + +--- + +- 网址: [www.gnu.org/software/zile][4] +- 开发者: Reuben Thomas, Sandro Sigala, David A. Capello +- 许可证: GNU GPL v2 +- 版本号: 2.4.11 + + + +### nano ### + +![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-nano.png) + +nano是基于curses库的文本编辑器。它是Pico(Pine电子邮件客户端编辑器)的一个复刻版。 + +由于Pine套件的许可证问题诉讼案(Pine并未以开源许可证发布),并且也因为Pine缺少一些重要的功能,nano项目于1999年发起。 + +nano致力于赶上Pico的功能和其易用性,与此同时提供更多的功能,但不集成Pine/Pico的邮件客户端。 + +nano像Pico一样是以键盘为导向的设计,可以用控制键来控制。 + +#### 功能包括: #### + +- 交互式的查找和替换 +- 彩色语法高亮 +- 转到行号和列号处 +- 自动缩进 +- 功能开关 +- 支持UTF-8 +- 混合型的文件类型自动转换 +- 逐字输入模式 +- 多个文件缓冲区 +- 平滑滚动 +- 括号匹配 +- 自定义引用字符串 +- 备份文件 +- 国际化支持 +- tab补全文件名 + +--- + +- 网址: [nano-editor.org][5] +- 开发者: Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger +- 许可证: GNU GPL v3 +- 版本号: 2.2.6 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html + +作者:Frazer Kline +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://foicica.com/textadept/ +[2]:http://www.vim.org/ +[3]:http://ne.di.unimi.it/ +[4]:http://www.gnu.org/software/zile/ +[5]:http://nano-editor.org/ diff --git a/published/201506/20141219 What is good audio editing software on Linux.md b/published/201506/20141219 What is good audio editing software on Linux.md new file mode 100644 index 0000000000..117961919d --- /dev/null +++ b/published/201506/20141219 What is good audio editing software on Linux.md @@ -0,0 +1,67 @@ +Linux下优秀的音频编辑软件 +================================================================================ + +不论您是一个音乐爱好者或只是一个要记录您导师的讲话的学生,您都需要录制音频和编辑音频。长久以来这样的工作都要靠Macintosh,如今那个时代已经过去,现在Linux也可以胜任这些工作了。简而言之,这里有一份不完全的音频编辑器软件列表,适用于不同的任务和需求。 + +### 1. Audacity ### + +![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg) + +让我们从我个人最喜欢的软件开始。[Audacity][1]可以运行在Windows、Mac和Linux上。它是开源的,且易于使用。你会觉得:Audacity几乎是完美的。它可以让您在干净的界面上操作音频波形。简单地说,您可以覆盖音轨、剪切和修改音轨、增加特效、执行高级的声音分析,然后将它们导出到一大堆可用的格式。我喜欢它的原因是它将基本的功能和复杂的功能结合在一起并且保持一个简单的学习曲线。然而,它并不是一个完全最优化的软件,尤其是对于音乐家和专业人员。 + +### 2. Jokosher ### + +![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg) + +在不同的层次上,[Jokosher][2]更多的聚焦在多音轨方面。它使用Python和GTK+作为前端界面,并使用GStreamer作为音频后端。Jokosher那易用的界面和它的扩展性给我留下了深刻的印象。也许编辑的功能并不是最先进的,但它的提示十分清晰,适合音乐家。例如,我十分喜欢音轨和乐器的组合。简而言之,如果您是一个音乐家,那么它是在您转移到下一个软件前进行实践的好机会。 + +### 3. Ardour ### + +![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg) + +接下来谈论一些复杂的工具,[Ardour][3]是一套完整的可以录制、编辑和混音的软件。这个设计吸引了所有的专业人员,Ardour在声音和插件方面超出我的想象。如果您在寻找一头野兽并且不惧怕驯服它,那么Ardour或许是一个不错的选择。再次,它的界面和丰富的文档,尤其是它首次启动时的配置工具都是它迷人魅力的一部分。 + +### 4. Kwave ### + +![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg) + +对于所有KDE的热爱者,[KWave][4]绝对符合您对于设计和功能的想象。它有丰富的快捷键以及很多有趣的选项,例如内存管理。尽管很多特效很不错,但我们更应该关注那些用于音频剪切/粘贴的工具。可惜的是它无法与Audacity相比,而更重要的是,它的界面并没有那么吸引我。 + +### 5. Qtractor ### + +![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg) + +如果Kwave对您来说过于简单,但基于Qt的程序却有些吸引力,那么对您来说,也许[Qtractor][5]是一个选项。它致力于做一个“对于家庭用户来说足够简单,并且对专业人员来说足够强大的软件。”实际上它功能和选项的数量几乎是压倒性的。我最喜欢的当然是可定制的快捷键。除此之外,Qtractor可能是我最喜欢的一个处理MIDI文件的工具。 + +### 6. LMMS ### + +![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg) + +作为Linux多媒体工作室,LMMS的直接目标是音乐制作。如果您之前没有什么经验并且不想浪费太多的时间,那么请去别处吧。LMMS是其中一个复杂但强大的软件,只有少数的人真正的掌握了它。它有太多的功能和特效以至于无法一一列出,但如果我必须找一个,我会说用来模拟Game Boy声音系统的Freeboy插件简直像魔术一样。然后,去看看它那惊人的文档吧。 + +### 7. Traverso ### + +![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg) + +最后站在我面前的是Traverso,它支持无限制的音轨计数,并直接整合了CD烧录的功能。另外,它对我来说是介于简单的软件和专业的软件之间的程序。它的界面是KDE样式的,其键盘配置很简单。更有趣的是,Traverso会监视您的系统资源以确定不会超过您的CPU或者硬件的能力。 + +总而言之,能在Linux系统上看到这么多不同的应用程序是一件开心的事。它使得您永远可以找到最适合自己的那一款。虽然我最喜欢的应用是Audacity,但我非常震惊于LMMS和Jokosher的设计。 + +我们有漏掉什么么?您在Linux下使用哪一款软件呢?原因是什么呢?请留言让我们知道。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/good-audio-editing-software-linux.html + +作者:[Adrien Brochard][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/adrien +[1]:http://audacity.sourceforge.net/ +[2]:https://launchpad.net/jokosher/ +[3]:http://ardour.org/ +[4]:http://kwave.sourceforge.net/ +[5]:http://qtractor.sourceforge.net/qtractor-index.html \ No newline at end of file diff --git a/published/201506/20150126 Installing Cisco Packet tracer in Linux.md b/published/201506/20150126 Installing Cisco Packet tracer in Linux.md new file mode 100644 index 0000000000..578f65f756 --- /dev/null +++ b/published/201506/20150126 Installing Cisco Packet tracer in Linux.md @@ -0,0 +1,187 @@ +Linux中安装Cisco Packet Tracer +================================================================================ +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/Main_picture.png) + +### Cisco Packet tracer是什么? ### + +**Cisco Packet Tracer**是一个强大的网络模拟工具,用于进行Cisco认证时的培训。它为我们提供了各个路由器和网络设备的良好的接口视图,这些模拟设备带有很多选项,跟使用物理机一样,我们可以在网络中使用无限的设备。我们能在单个工程中创建多个网络,以获得专业化的训练。Packet Tracer将提供给我们模拟的应用层协议,如**HTTP**,**DNS**,以及像**RIP**,**OSPF**,**EIGRP**等路由协议。 + +现在,它发布了包含有**ASA 5505防火墙**命令行配置的版本。Packet Tracer通常用于Windows版本,但没有Linux版本。这里,我们可以下载并安装Cisco Packet Tracer。 + +#### 新发布的Cisco Packet Tracer版本: #### + +下一代Cisco Packet Tracer版本将会是Cisco Packet Tracer 6.2,当前还处于开发中。 + +### 我的环境设置: ### + +**主机名** : desktop1.unixmen.com + +**IP地址** : 192.168.0.167 + +**操作系统** : Ubuntu 14.04 LTS Desktop + + # hostname + + # ifconfig | grep inet + + # lsb_release -a + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_001.png) + +### 步骤 1: 首先,我们需要下载Cisco Packet Tracer。 ### + +要从官方网站下载Packet Tracer,我们需要持有一个令牌,登入Cisco NetSpace,然后从Offering菜单选择CCNA > Cisco Packet Tracer来开始下载。如果我们没有令牌,可以从下面的链接中获得,我已经将它上传到了Droppox。 + +官方站点: [https://www.netacad.com/][1] + +大多数人没有下载Packet Tracer的令牌,出于该原因,我已经将它上传到了dropbox,你可以从下面的URL获得Packet Tracer。 + +[下载Cisco Packet Tracer 6.1.1][2] + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_002.png) + +### 步骤 2: 安装Java: ### + +要安装Packet Tracer,我们需要安装java。我们可以使用默认的仓库安装java;或者添加PPA仓库,然后更新包缓存来安装java。 + +使用以下命令来安装默认的jre + + # sudo apt-get install default-jre + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_003.png) + +(或者) + +使用下面的步骤来安装Java Run-time并设置环境。 + +从官方站点下载Java:[下载Java][3] + + # tar -zxvf jre-8u31-linux-x64.tar.gz + # sudo mkdir -p /usr/lib/jvm + # sudo mv -v jre1.8.0_31 /usr/lib/jvm/ + # cd /usr/lib/jvm/ + # sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" 1 + # sudo update-alternatives --set "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" + +通过编辑用户参数文件来设置Java环境,并添加路径相关的参数。当我们添加进用户参数文件后,我们机器上的每个用户都可以用java了。 + + # sudo vi /etc/profile + +将以下条目添加到/etc/profile文件中: + + export JAVA_HOME=/usr/lib/jvm/jre1.8.0_31 + export PATH=$PATH:/usr/java/jre1.8.0_31/bin + +运行以下命令来立即激活java路径。 + + # . /etc/profile + +检查Java版本和环境: + + # echo $JAVA_HOME + # java -version + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_004.png) + +### 步骤 3: 启用32位架构支持: ### + +对于Packet Tracer,我们需要一些32位包。要安装32位包,我们需要使用以下命令来安装一些依赖。 + + # sudo dpkg --add-architecture i386 + # sudo apt-get update + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_005.png) + + # sudo apt-get install libc6:i386 + # sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 + # sudo apt-get install libnss3-1d:i386 libqt4-qt3support:i386 libssl1.0.0:i386 libqtwebkit4:i386 libqt4-scripttools:i386 + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_006.png) + +### 步骤 4: 解压并安装软件包: ### + +使用tar命令来解压下载的包。 + + # mv Cisco\ Packet\ Tracer\ 6.1.1\ Linux.tar.gz\?dl\=0 Cisco_Packet_tracer.tar.gz + + # tar -zxvf Cisco_Packet_tracer.tar.gz + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_007.png) + +导航到解压后的目录 + + # cd PacketTracer611Student + +现在,该开始安装了。安装过程很简单,只需几秒钟即可搞定。 + + # sudo ./install + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_008.png) + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_009.png) + +要使用Packet Tracer工作,我们需要设置环境,Cisco已经提供了环境脚本,我们需要以root用户来运行该脚本以设置环境变量。 + + # sudo ./set_ptenv.sh + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_010.png) + +安装到此结束。接下来,我们需要为Packet Tracer创建桌面图标。 + +通过创建下面的桌面文件来创建桌面图标。 + + # sudo su + # cd /usr/share/applications + # sudo vim packettracer.desktop + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_011.png) + +使用vim编辑器或你喜爱的那个编辑器来添加以下内容到文件。 + + [Desktop Entry] + Name= Packettracer + Comment=Networking + GenericName=Cisco Packettracer + Exec=/opt/packettracer/packettracer + Icon=/usr/share/icons/packettracer.jpeg + StartupNotify=true + Terminal=false + Type=Application + +使用wq!来保存并退出vim。 + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_012.png) + +### 步骤 5: 运行Packet Tracer ### + + # sudo packettracer + +好了,我们已经成功将Packet Tracer安装到Linux中。上述安装步骤适用于所有基于Debian的Linux发行版。 + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_013.png) + +![](http://1102047360.rsc.cdn77.org/wp-content/uploads/2015/01/pkt_014.png) + +### 资源 ### + +主页:[Netacad][4] + +### 尾声: ### + +这里,我们展示了如何安装Packet Tracer到Linux发行版中。希望你们找到了将你们所钟爱的模拟器安装到Linux中的方法。 + +-------------------------------------------------------------------------------- + +via: http://www.unixmen.com/installing-cisco-packet-tracer-linux/ + +作者:[babin][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.unixmen.com/author/babin/ +[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/ diff --git a/published/201506/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md b/published/201506/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md new file mode 100644 index 0000000000..31d432f445 --- /dev/null +++ b/published/201506/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md @@ -0,0 +1,64 @@ +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内核内建的原生套接口界面,可以用于大范围支持的网卡 +- 全屏、菜单驱动操作 + +###要安装### + +**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] +译者:[GOLinux](https://github.com/GOLinux) +校对:[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/published/201506/20150128 The top 10 rookie open source projects.md b/published/201506/20150128 The top 10 rookie open source projects.md new file mode 100644 index 0000000000..ea9c04ce4f --- /dev/null +++ b/published/201506/20150128 The top 10 rookie open source projects.md @@ -0,0 +1,154 @@ +2015 年度开源项目新秀榜 +================================================================================ +黑鸭(Black Duck)软件公布了一份名叫“年度开源项目新秀”的报告,介绍了由全球开源协会发起的10个最有趣、最活跃的新项目。 + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_01-100564902-orig.jpeg) + +### 年度开源项目新秀 ### + +每年都有上千新的开源项目问世,但只有少数能够真正的吸引我们的关注。一些项目因为利用了当前比较流行的技术而发展壮大,有一些则真正地开启了一个新的领域。很多开源项目建立的初衷是为了解决一些生产上的问题,还有一些项目则是世界各地志同道合的开发者们共同发起的一个宏伟项目。 + +从2009年起,开源软件管理公司黑鸭便发起了[年度开源项目新秀][1]这一活动,它的评选根据[Open Hub][2]网站(即以前的Ohloh)上的活跃度。今年,我们很荣幸能够报道2015年10大开源项目新秀的得主和2名荣誉奖得主,它们是从上千个开源项目中脱颖而出的。评选采用了加权评分系统,得分标准基于项目的活跃度,交付速度和几个其它因数。 + +开源俨然成为了产业创新的引擎,就拿今年来说,和Docker容器相关的开源项目在全球各地兴起,这也不恰巧反映了企业最感兴趣的技术领域吗?最后,我们接下来介绍的项目,将会让你了解到全球开源项目的开发者们的在思考什么,这很快将会成为一个指引我们发展的领头羊。 + +### 2015年度开源项目新秀: DebOps ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_02-100564903-orig.jpeg) + +[DebOps][3]收集打包了一套[Ansible][4]方案和规则(Ansible是一种自动化运维工具),可以从1个容器扩展到一个完整的数据中心。它的创始人Maciej Delmanowski将DebOps开源来保证项目长久进行,从而更好的通过外部贡献者的帮助发展下去。 + +DebOps始创于波兰的一个不起眼大学校园里,他们运营自己的数据中心,一切工作都采用手工配置。有时系统崩溃而导致几天的宕机,这时Delmanowski意识到一个配置管理系统是很有必要的。以Debian作为基础开始,DebOps是一组配置一整个数据基础设施的Ansible方案。此项目已经在许多不同的工作环境下实现,而创始者们则打算继续支持和改进这个项目。 + +###2015年度开源项目新秀: Code Combat ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_03-100564904-gallery.idge.jpg) + +传统的纸笔学习方法已近不能满足技术学科了。然而游戏却有很多人都爱玩,这也就是为什么[CodeCombat][5]的创始人会去开发一款多人协同编程游戏来教人们如何编码。 + +刚开始CodeCombat是一个创业想法,但其创始人决定取而代之创建一个开源项目。此想法在社区传播开来,很快不少贡献者加入到项目中来。项目发起仅仅两个月后,这款游戏就被接纳到Google’s Summer of Code活动中。这款游戏吸引了大量玩家,并被翻译成45种语言。CodeCombat希望成为那些想要一边学习代码同时获得乐趣的同学的风向标。 + +### 2015年度开源项目新秀: Storj ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_04-100564905-gallery.idge.jpg) + +[Storj][6]是一个点对点的云存储网络,可实现端到端加密,保证用户不用依赖第三方即可传输和共享数据。基于比特币block chain技术和点对点协议,Storj提供安全、私密、加密的云存储。 + +云数据存储的反对者担心成本开销和漏洞攻击。针对这两个担忧,Storj提供了一个私有云存储市场,用户可以通过Storjcoin X(SJCX) 购买交易存储空间。上传到Storj的文件会被粉碎、加密和存储到整个社区。只有文件所有者拥有密钥加密的信息。 + +在2014年举办的Texas Bitcoin Conference Hackathon会议上,去中心化的云存储市场概念首次被提出并证明可行。在第一次赢得黑客马拉松活动后,项目创始人们和领导团队利用开放论坛、Reddit、比特币论坛和社交媒体增长成了一个活跃的社区,如今,它们已成为影响Storj发展方向的一个重要组成部分。 + +### 2015年度开源项目新秀: Neovim ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_05-100564906-orig.jpg) + +自1991年出现以来,Vim已经成为数以百万计软件开发人员所钟爱的文本编辑器。 而[Neovim][6]就是它的下一个版本。 + +在过去的23年里,软件开发生态系统经历了无数增长和创新。Neovim创始人Thiago de Arruda认为Vim缺乏当代元素,跟不上时代的发展。在保留Vim的招牌功能的前提下,Neovim团队同样在寻求改进和发展这个最受欢迎的文本编辑器的技术。早期众筹让Thiago de Arruda可以连续6个月时间投入到此项目。他相信Neovim社区会支持这个项目,激励他继续开发Neovim。 + +### 2015年度开源项目新秀: CockroachDB ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_06-100564907-orig.jpg) + +前谷歌员工开发了一个开源的大型企业数据存储项目[CockroachDB][8],它是一个可扩展的、跨地域复制且支持事务的数据存储的解决方案。 + +为了保证在线的百万兆字节流量业务的质量,Google开发了Spanner系统,这是一个可扩展的,稳定的,支持事务的系统。许多参与开发CockroachDB的团队现在都服务于开源社区。就像真正的蟑螂(cockroach)一样,CockroachDB可以在没有数据头、任意节点失效的情况下正常运行。这个开源项目有很多富有经验的贡献者,创始人们通过社交媒体、Github、网络、会议和聚会结识他们并鼓励他们参与其中。 + +### 2015年度开源项目新秀: Kubernetes ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_07-100564908-orig.jpg) + +在将容器化软件到引入开源社区发展时,[Docker][9]是一匹黑马,它创新了一套技术和工具。去年6月谷歌推出了[Kubernetes][10],这是一款开源的容器管理工具,用来加快开发和简化操作。 + +谷歌在它的内部运营上使用容器技术多年了。在2014年夏天的DockerCon上大会上,谷歌这个互联网巨头开源了Kubernetes,Kubernetes的开发是为了满足迅速增长的Docker生态系统的需要。通过和其它的组织、项目合作,比如Red Hat和CoreOS,Kubernetes项目的管理者们推动它登上了Docker Hub的工具下载榜榜首。Kubernetes的开发团队希望扩大这个项目,发展它的社区,这样的话软件开发者就能花更少的时间在管理基础设施上,而更多的去开发他们自己的APP。 + +### 2015年度开源项目新秀: Open Bazaar ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_08-100564909-orig.jpg) + +OpenBazaar是一个使用比特币与其他人交易的去中心化的市场。OpenBazaar这一概念最早在编程马拉松(hackathon)活动中被提出,它的创始人结合了BitTorent、比特币和传统的金融服务方式,创造了一个不受审查的交易平台。OpenBazaar的开发团队在寻求新的成员,而且不久以后他们将极度扩大Open Bazaar社区。Open Bazaar的核心是透明度,其创始人和贡献者的共同目标是在商务交易中掀起一场革命,让他们向着一个真实的、一个无控制的,去中心化的市场奋进。 + +### 2015年度开源项目新秀: IPFS ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_09-100564910-orig.jpg) + +IPFS 是一个面向全球的、点对点的分布式版本文件系统。它综合了Git,BitTorrent,HTTP的思想,开启了一个新的数据和数据结构传输协议。 + +人们所知的开源,它的本意用简单的方法解决复杂的问题,这样产生许多新颖的想法,但是那些强大的项目仅仅是开源社区的冰山一角。IFPS有一个非常激进的团队,这个概念的提出是大胆的,令人惊讶的,有点甚至高不可攀。看起来,一个点对点的分布式文件系统是在寻求将所有的计算设备连在一起。这个可能的 HTTP 替换品通过多种渠道维护着一个社区,包括Git社区和超过100名贡献者的IRC。这个疯狂的想法将在2015年进行软件内部测试。 + +### 2015年度开源项目新秀: cAdvisor ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_10-100564911-orig.jpg) + +[cAdvisor (Container Advisor)][13] 是一个针对在运行中的容器进行收集,统计,处理和输出信息的工具,它可以给容器的使用者提供资源的使用情况和工作特性。对于每一个容器,cAdvisor记录着资源的隔离参数,资源使用历史,资源使用历史对比框图,网络状态。这些从容器输出的数据跨越主机传递。 + +cAdvisor可以在绝大多数的Linux发行版上运行,并且支持包括Docker在内的多种容器类型。事实上它成为了一种容器的代理,并被集成在了很多系统中。cAdvisor在DockerHub下载量也是位居前茅。cAdvisor的开发团队希望把cAdvisor改进到能够更深入地理解应用性能,并且集成到集群系统。 + +### 2015年度开源项目新秀: Terraform ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_11-100564912-orig.jpg) + +[Terraform][14]提供了一些常见设置来创建一个基础设施,从物理机到虚拟机,以及email服务器、DNS服务器等。这个想法包括从家庭个人机解决方案到公共云平台提供的服务。一旦建立好了以后,Terraform可以让运维人员安全又高效地改变你的基础设施,就如同配置一样。 + +Terraform.io的创始者工作在一个Devops模式的公司,他找到了一个窍门把建立一个完整的数据中心所需的知识结合在一起,可以从添加服务器到支持网络服务的功能齐备的数据中心。基础设施的描述采用高级的配置语法,允许你把数据中心的蓝图按版本管理,并且转换成多种代码。著名开源公司HashiCorp赞助开发这个项目。 + +### 荣誉奖: Docker Fig ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_12-100564913-orig.jpg) + +[Fig][15]为[Docker][16]的使用提供了一个快速的,分离的开发环境。Docker的移植只需要将配置信息放到一个简单的 fig.yml文件里。它会处理所有工作,包括构建、运行,端口转发,分享磁盘和容器链接。 + +Orchard去年发起了Fig,来创造一个使Docker工作起来的系统工具。它的开发像是为Docker设置开发环境,为了确保用户能够为他们的APP准确定义环境,在Docker中会运行数据库和缓存。Fig解决了开发者的一个难题。Docker全面支持这个开源项目,最近[将买下][17]Orchard来扩张这个项目。 + +### 荣誉奖: Drone ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_13-100564916-orig.jpg) + +[Drone][18]是一个基于Docker的持续集成平台,而且它是用Go语言写的。Drone项目不满于现存的设置开发环境的技术和流程。 + +Drone提供了一个简单的自动测试和持续交付的方法:简单选择一个Docker镜像来满足你的需求,连接并提交至GitHub即可。Drone使用Docker容器来提供隔离的测试环境,让每个项目完全自主控制它的环境,没有传统的服务器管理的负担。Drone背后的100位社区贡献者强烈希望把这个项目带到企业和移动应用程序开发中。 + +### 开源新秀 ### + +![](http://images.techhive.com/images/article/2015/01/open_source_rookies_14-100564941-orig.jpg) + +参见: + +- [InfoWorld2015年年度技术奖][21] +- [Bossies: 开源软件最高荣誉][22] + +-------------------------------------------------------------------------------- + +via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-rookie-open-source-projects.html + +作者:[Black Duck Software][a] +译者:[sevenot](https://github.com/sevenot) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.infoworld.com/author/Black-Duck-Software/ +[1]:https://www.blackducksoftware.com/open-source-rookies +[2]:https://www.openhub.net/ +[3]:https://github.com/debops/debops +[4]:http://www.infoworld.com/article/2612397/data-center/review--ansible-orchestration-is-a-veteran-unix-admin-s-dream.html +[5]:https://codecombat.com/ +[6]:http://storj.io/ +[7]:http://neovim.org/ +[8]:https://github.com/cockroachdb/cockroach +[9]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker +[10]:http://kubernetes.io/ +[11]:https://openbazaar.org/ +[12]:http://ipfs.io/ +[13]:https://github.com/google/cadvisor +[14]:https://www.terraform.io/ +[15]:http://www.fig.sh/ +[16]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker +[17]:http://www.infoworld.com/article/2608546/application-virtualization/docker-acquires-orchard-in-a-sign-of-rising-ambitions.html +[18]:https://drone.io/ +[19]:http://www.infoworld.com/article/2683845/google-go/164121-Fast-guide-to-Go-programming.html +[20]:https://www.blackducksoftware.com/open-source-rookies +[21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html +[22]:http://www.infoworld.com/article/2688104/open-source-software/article.html +[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html + diff --git a/published/201506/20150209 How to access Feedly RSS feed from the command line on Linux.md b/published/201506/20150209 How to access Feedly RSS feed from the command line on Linux.md new file mode 100644 index 0000000000..6eac136d1a --- /dev/null +++ b/published/201506/20150209 How to access Feedly RSS feed from the command line on Linux.md @@ -0,0 +1,111 @@ +在 Linux 上如何用命令行获取 Freely RSS 源 +================================================================================ + +也许你并不知道 Feedly,它是世界上最流行的在线新闻聚合服务之一;它提供了平滑而一致的新闻阅读体验,你可以使用电脑的浏览器扩展,Android 和 iOS 设备上的移动应用程序等来体验Feedly。Feedly 在2013年Google Reader 停用后,迅速的获得了一大批Google Reader的用户。我就是他们之中的一位。从这以后,Feedly就一直是我的默认RSS(简易信息聚合)阅读器。 + +除了使用我非常喜欢的Feedly浏览器扩展和手机上的Feedly程序,这里还有一种途径来获取Feedly:Linux命令行。没错,你可以用命令行来获取Feedly上的新闻概要。听起来非常傻?但是对于那些在服务器上工作的系统管理员来说,这是非常有用的。 + +点击进入[Feednix][2],这个用c++编写的开源软件是Feedly的非官方命令行客户端。它允许你在一个基于ncurses的终端界面(例如:bash)下浏览Feedly的新闻。默认模式下,Feednix 关联了一个叫做 w3m 的基于控制台的浏览器,允许你在命令行终端的环境下阅读文章。当然你也可以选择使用你喜欢的网页浏览器。 + +在这个教程中,我准备示范一下怎样在命令行下安装和配置Feednix 来获取Feedly。 + +### 在Linux下安装Feednix ### + +你可以通过以下的步骤从源代码中构建Feednix。同时,在其官方的github仓库的Ubuntu-stable(Ubuntu稳定版本)的分支上有最新的Feednix源代码。现在让我们开始吧: + +作为必要组件,你需要安装一组开发包,和w3m浏览器(文字式页面浏览器)。 + +#### 在Debian、Ubuntu 和Linux Mint 操作 #### + + $ sudo apt-get install git automake g++ make libncursesw5-dev libjsoncpp-dev libcurl4-gnutls-dev w3m + $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git + $ cd Feednix + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install + + +#### 在Fedora 下操作 #### + + $ sudo yum groupinstall "C Development Tools and Libraries" + $ sudo yum install gcc-c++ git automake make ncurses-devel jsoncpp-devel libcurl-devel w3m + $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git + $ cd Feednix + $ ./autogen.sh + $ ./configure + $ make + $ sudo make install + +#### Arch Linux #### + +在Arch Linux发行版下,你可以非常容易的从 [AUR][3]安装Feednix。 + +### 配置Feednix ### + +在安装完软件后,用下面的命令启动Feednix + + $ feednix + +如果你是第一次运行Feddnix,它会弹出一个网页浏览器窗口,在这个窗口里,你需要登录来创建一个Feedly的账户ID和相应的开发人员密钥。 + +如果你是在无桌面环境下运行Feednix,先在另外一台电脑上打开一个网页,进入到网站:https://feedly.com/v3/auth/dev 。 + +![](https://farm8.staticflickr.com/7427/15825106524_42883b3e32_b.jpg) + +当你登录后,你对应的Feedly账户ID就生成了。 + +![](https://farm9.staticflickr.com/8565/15827565143_eb93db9c81_b.jpg) + +为了得到一个访问密钥,你需要在浏览器上访问发送你的邮箱中的密钥链接。之后就会在浏览器窗口显示你的用户ID,密钥,和密钥的有效期。请注意密钥的长度是非常长的(超过200个字符),所以密钥显示在一个带有垂直滚动条的文本框内,请确保把整个密钥复制下来。 + +![](https://farm9.staticflickr.com/8605/16446685812_9098df494b_b.jpg) + +像下面这样,把你的用户ID和密钥输入到Feddnix的命令行提示下: + + [Enter User ID] >> XXXXXX + [Enter token] >> YYYYY + +成功授权后,你会在屏幕上见到一个初始化为两个窗格的Feednix界面。左边的标题为“Categories”窗格,显示了一个新闻分类栏;右边“Posts”窗格显示了当前类别的新闻文章。 + +![](https://farm8.staticflickr.com/7412/16421639256_deb8e2d276_c.jpg) + +### 用Feednix读文章 ### + +这里我想简要描叙一下怎样通过Feednix来访问Feedly。 + +#### 在Feednix中导航 #### + +像我之前提过的,Feednix窗口包含了两个窗格。想在两个窗口之间进行切换的话,可以使用"TAB"健。想在一个窗格内的列表中上下移动,可以使用"j"和"k"。这些快捷健明显是受到了Vim编辑器的启发。 + +#### 阅读文章 #### + +想阅读一篇特定的文章,可以在当前的文章上使用"o"健。它会调用w3m浏览器,并且在浏览器里面加载文章。当你读完之后,可以使用"q"健来退出浏览器,并返回到Feednix。如果你的电脑环境允许打开网页浏览器,你可以按"0"健来在你默认的网页浏览器里面加载文章,比如使用Firefox。 + +![](https://farm8.staticflickr.com/7406/16445870201_b98e8da6d9_b.jpg) + +#### 订阅新闻源 #### + +你可以在Feednix界面中来为你的Feedly账户增加任何一种RSS新闻源。要这么做,仅仅只需要按下"a"键,它会在屏幕底部显示一个"[ENTER FEED]:"的提示。在输入完RSS新闻源后,继续输入新闻源的名字和及其首选分类。 + +![](https://farm8.staticflickr.com/7324/16421639296_b52ed3c52e_c.jpg) + +#### 总结 #### + +如你所见, Feednix 是一个非常方便易用的命令行RSS阅读器。如果你是重度依赖命令行的用户,同时也是一个Feedly用户的话,Feednix 是肯定值得去尝试的。我和Feednix的开发者Jarkore交流解决了一些问题。我想说,对于[bug的报告][4]和修复他非常的积极。鼓励大家来试用Feednix,并且给他(Jarkore)一些回馈。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/feedly-rss-feed-command-line-linux.html + +作者:[Dan Nanni][a] +译者:[chenzhijun](https://github.com/chenzhijun) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:https://feedly.com/ +[2]:https://github.com/Jarkore/Feednix +[3]:https://aur.archlinux.org/packages/feednix/ +[4]:https://github.com/Jarkore/Feednix/issues diff --git a/published/201506/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/published/201506/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md new file mode 100644 index 0000000000..bb69215e74 --- /dev/null +++ b/published/201506/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md @@ -0,0 +1,275 @@ +在Apache中使用mod\_security和mod\_evasive来抵御暴力破解和DDos攻击 +================================================================================ + +对于那些需要在因特网上提供服务或托管主机的人来说,保证您的系统在面对攻击时的安全是一个重要的事情。 + +mod\_security(一个开源的用于Web应用入侵检测及防护的引擎,可以无缝地集成到Web服务器)和mod\_evasive是两个在服务器端对抗暴力破解和(D)Dos攻击的非常重要的工具。 + +mod\_evasive,如它的名字一样,在受攻击时提供避实就虚的功能,它像一个雨伞一样保护Web服务器免受那些威胁。 + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Mod_Security-Mod_evasive-in-CentOS.jpg) + +*安装mod\_security和mod\_evasive来保护Apache* + +在这篇文章中我们将讨论如何安装、配置以及在RHEL/CentOS6、7和Fedora 21-15上将它们整合到Apache。另外,我们会模拟攻击以便验证服务器做出了正确的反应。 + +以上以您的系统中安装有LAMP服务器为基础,所以,如果您没有安装,请先阅读下面链接的文章再开始阅读本文。 + +- [在RHEL/CentOS 7中安装LAMP][1] + +(LCTT 译注:本文有修改。原文为了在RHEL/CentOS 7或Fedora 21中使用同样的工具,而删除了自带的 firewalld,使用了旧式的iptables。译者以为这样并不恰当,因此,译文中做了相应删节,并增加了firewalld的相应脚本。) + +### 步骤 1: 安装mod\_security和mod\_evasive ### + +另外,在安装LAMP后,您还需要在RHEL/CentOS 7/6中[开启EPEL仓库][3]来安装这两个包。Fedora用户不需要开启这个仓库,因为epel已经是Fedora项目的一部分了。 + + # yum update && yum install mod_security mod_evasive + +当安装结束后,您会在/etc/httpd/conf.d下找到这两个工具的配置文件。 + + # ls -l /etc/httpd/conf.d + +![](http://www.tecmint.com/wp-content/uploads/2012/06/mod_security-mod_evasive-Configurations.png) + +*mod\_security + mod\_evasive 配置文件* + +现在,为了整合这两个模块到Apache,并在启动时加载它们。请确保下面几行出现在mod\_evasive.conf和mod\_security.conf的顶层部分,它们分别为: + + LoadModule evasive20_module modules/mod_evasive24.so + LoadModule security2_module modules/mod_security2.so + +请注意modules/mod\_security2.so和modules/mod\_evasive24.so都是从/etc/httpd到模块源文件的相对路径。您可以通过列出/etc/httpd/modules的内容来验证(如果需要的话,修改它): + + # cd /etc/httpd/modules + # pwd + # ls -l | grep -Ei '(evasive|security)' + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Verify-mod_security-mod_evasive-Modules.png) + +*验证mod\_security + mod\_evasive模块* + +接下来重启Apache并且核实它已加载了mod\_evasive和mod\_security: + + # service httpd restart [在RHEL/CentOS 6和Fedora 20-18上] + # systemctl restart httpd [在RHEL/CentOS 7和Fedora 21上] + +---------- + + # httpd -M | grep -Ei '(evasive|security)' [输出已加载的静态模块和动态模块列表] + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Check-mod_security-mod_evasive-Loaded.png) + +*检查mod\_security + mod\_evasive模块已加载* + +### 步骤 2: 安装一个核心规则集并且配置mod\_security ### + +简单来说,一个核心规则集(即CRS)为web服务器提供特定状况下如何反应的指令。mod\_security的开发者们提供了一个免费的CRS,叫做OWASP([开放Web应用安全项目])ModSecurity CRS,可以从下面的地址下载和安装。 + +####下载OWASP CRS到为之创建的目录#### + + # mkdir /etc/httpd/crs-tecmint + # cd /etc/httpd/crs-tecmint + # wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Download-mod_security-Core-Rules.png) + +*下载mod\_security核心规则* + +#### 解压CRS文件并修改文件夹名称#### + + # tar xzf master + # mv SpiderLabs-owasp-modsecurity-crs-ebe8790 owasp-modsecurity-crs + + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Extract-mod_security-Core-Rules.png) + +*解压mod\_security核心规则* + +####现在,是时候配置mod\_security了#### + +将示例的规则文件(owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example)拷贝为同名的配置文件。 + + # cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf + +并通过将下面的几行插入到web服务器的主配置文件/etc/httpd/conf/httpd.conf来告诉Apache将这个文件和该模块放在一起使用。如果您选择解压打包文件到另一个文件夹,那么您需要修改Include的路径: + + + Include crs-tecmint/owasp-modsecurity-crs/modsecurity_crs_10_setup.conf + Include crs-tecmint/owasp-modsecurity-crs/base_rules/*.conf + + +最后,建议您在/etc/httpd/modsecurity.d目录下创建自己的配置文件,在那里我们可以用我们自定义的文件夹(接下来的示例中,我们会将其命名为tecmint.conf)而无需修改CRS文件的目录。这样做能够在CRS发布新版本时更加容易的升级。 + + + SecRuleEngine On + SecRequestBodyAccess On + SecResponseBodyAccess On + SecResponseBodyMimeType text/plain text/html text/xml application/octet-stream + SecDataDir /tmp + + +您可以在[SpiderLabs的ModSecurity GitHub][5]仓库中参考关于mod\_security目录的更完整的解释。 + +### 步骤 3: 配置mod\_evasive ### + +mod\_evasive被配置为使用/etc/httpd/conf.d/mod\_evasive.conf中的指令。与mod\_security不同,由于在包升级时没有规则来更新,因此我们不需要独立的文件来添加自定义指令。 + +默认的mod\_evasive.conf开启了下列的目录(注意这个文件被详细的注释了,因此我们剔掉了注释以重点显示配置指令): + + + DOSHashTableSize 3097 + DOSPageCount 2 + DOSSiteCount 50 + DOSPageInterval 1 + DOSSiteInterval 1 + DOSBlockingPeriod 10 + + +这些指令的解释: + +- DOSHashTableSize: 这个指令指明了哈希表的大小,它用来追踪基于IP地址的活动。增加这个数字将使得站点访问历史的查询变得更快,但如果被设置的太大则会影响整体性能。 +- DOSPageCount: 在DOSPageInterval间隔内可由一个用户发起的针对特定的URI(例如,一个Apache 提供服务的文件)的同一个请求的数量。 +- DOSSiteCount: 类似DOSPageCount,但涉及到整个站点总共有多少的请求可以在DOSSiteInterval间隔内被发起。 +- DOSBlockingPeriod: 如果一个用户超过了DOSSPageCount的限制或者DOSSiteCount,他的源IP地址将会在DOSBlockingPeriod期间内被加入黑名单。在DOSBlockingPeriod期间,任何从这个IP地址发起的请求将会遭遇一个403禁止错误。 + +尽可能的试验这些值,以使您的web服务器有能力处理特定大小的负载。 + +**一个小警告**: 如果这些值设置的不合适,则您会蒙受阻挡合法用户的风险。 + +您也许还会用到以下其它有用的指令: + +#### DOSEmailNotify #### + +如果您运行有一个邮件服务器,您可以通过Apache发送警告消息。注意,如果SELinux已开启,您需要授权apache用户SELinux的权限来发送email。您可以通过下面的命令来授予权限: + + # setsebool -P httpd_can_sendmail 1 + +接下来,将这个指令和其他指令一起加入到mod\_evasive.conf文件。 + + DOSEmailNotify you@yourdomain.com + +如果这个指令设置了合适的值,并且您的邮件服务器在正常的运行,则当一个IP地址被加入黑名单时,会有一封邮件被发送到相应的地址。 + +#### DOSSystemCommand #### + +它需要一个有效的系统命令作为参数, + + DOSSystemCommand + +这个指令指定当一个IP地址被加入黑名单时执行的命令。它通常结合shell脚本来使用,比如在脚本中添加一条防火墙规则来阻挡某个IP进一步的连接。 + +#####写一个shell脚本在防火墙阶段处理IP黑名单##### + +当一个IP地址被加入黑名单,我们需要阻挡它进一步的连接。我们需要下面的shell脚本来执行这个任务。在/usr/local/bin下创建一个叫做scripts-tecmint的文件夹(或其他的名字),以及一个叫做ban_ip.sh的文件。 + +**用于iptables防火墙** + + #!/bin/sh + # 由mod_evasive检测出,将被阻挡的IP地址 + IP=$1 + # iptables的完整路径 + IPTABLES="/sbin/iptables" + # mod_evasive锁文件夹 + mod_evasive_LOGDIR=/var/log/mod_evasive + # 添加下面的防火墙规则 (阻止所有从$IP流入的流量) + $IPTABLES -I INPUT -s $IP -j DROP + # 为了未来的检测,移除锁文件 + rm -f "$mod_evasive_LOGDIR"/dos-"$IP" + +**用于firewalld防火墙** + + #!/bin/sh + # 由mod_evasive检测出,将被阻挡的IP地址 + IP=$1 + # firewalld-cmd的完整路径 + FIREWALL_CMD="/usr/bin/firewall-cmd" + # mod_evasive锁文件夹 + mod_evasive_LOGDIR=/var/log/mod_evasive + # 添加下面的防火墙规则 (阻止所有从$IP流入的流量) + $FIREWALL_CMD --zone=drop --add-source $IP + # 为了未来的检测,移除锁文件 + rm -f "$mod_evasive_LOGDIR"/dos-"$IP" + +我们的DOSSystemCommand指令应该是这样的: + + DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s" + +上面一行的%s代表了由mod_evasive检测到的攻击IP地址。 + +#####将apache用户添加到sudoers文件##### + +请注意,如果您不给予apache用户以无需终端和密码的方式运行我们脚本(关键就是这个脚本)的权限,则这一切都不起作用。通常,您只需要以root权限键入visudo来存取/etc/sudoers文件,接下来添加下面的两行即可: + + apache ALL=NOPASSWD: /usr/local/bin/scripts-tecmint/ban_ip.sh + Defaults:apache !requiretty + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Add-Apache-User-to-Sudoers.png) + +*添加Apache用户到Sudoers* + +**重要**: 在默认的安全策略下您只能在终端中运行sudo。由于这个时候我们需要在没有tty的时候运行sudo,我们必须像下图中那样注释掉下面这一行: + + #Defaults requiretty + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-tty-for-Sudo.png) + +*为Sudo禁用tty* + +最后,重启web服务器: + + # service httpd restart [在RHEL/CentOS 6和Fedora 20-18上] + # systemctl restart httpd [在RHEL/CentOS 7和Fedora 21上] + +### 步骤4: 在Apache上模拟DDos攻击 ### + +有许多工具可以在您的服务器上模拟外部的攻击。您可以google下“tools for simulating ddos attacks”来找一找相关的工具。 + +注意,您(也只有您)将负责您模拟所造成的结果。请不要考虑向不在您自己网络中的服务器发起模拟攻击。 + +假如您想对一个由别人托管的VPS做这些事情,您需要向您的托管商发送适当的警告或就那样的流量通过他们的网络获得允许。Tecmint.com不会为您的行为负责! + +另外,仅从一个主机发起一个Dos攻击的模拟无法代表真实的攻击。为了模拟真实的攻击,您需要使用许多客户端在同一时间将您的服务器作为目标。 + +我们的测试环境由一个CentOS 7服务器[IP 192.168.0.17]和一个Windows组成,在Windows[IP 192.168.0.103]上我们发起攻击: + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png) +I +*确认主机IP地址* + +请播放下面的视频(YT 视频,请自备梯子: https://www.youtube.com/-U_mdet06Jk ),并跟从列出的步骤来模拟一个Dos攻击: + +然后攻击者的IP将被防火墙阻挡: + +![](http://www.tecmint.com/wp-content/uploads/2012/06/Blocked-Attacker-IP.png) + +*阻挡攻击者的IP地址* + +### 结论 ### + +在开启mod\_security和mod\_evasive的情况下,模拟攻击会导致CPU和RAM用量在源IP地址被加入黑名单之前出现短暂几秒的使用峰值。如果没有这些模块,模拟攻击绝对会很快将服务器击溃,并使服务器在攻击期间无法提供服务。 + +我们很高兴听见您打算使用(或已经使用过)这些工具。我们期望得到您的反馈,所以,请在留言处留下您的评价和问题,谢谢! + +### 参考链接 ### + +- [https://www.modsecurity.org/][6] +- [http://www.zdziarski.com/blog/?page_id=442][7] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/ + +作者:[Gabriel Cánepa][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/gacanepa/ +[1]:http://www.tecmint.com/install-lamp-in-centos-7/ +[2]:https://linux.cn/article-4425-1.html +[3]:https://linux.cn/article-2324-1.html +[4]:https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project +[5]:https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Configuration_Directives +[6]:https://www.modsecurity.org/ +[7]:http://www.zdziarski.com/blog/?page_id=442 \ No newline at end of file diff --git a/published/201506/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/published/201506/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md new file mode 100644 index 0000000000..122787ee3d --- /dev/null +++ b/published/201506/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md @@ -0,0 +1,80 @@ +为LUKS加密的磁盘/分区做增量备份 +================================================================================ +我们中有些人出于安全原因,在家里或者[VPS][1]上通过[Linux统一密钥配置(LUKS)][2]为硬盘驱动器加密,而这些驱动器的容量很快会增长到数十或数百GB。因此,虽然我们享受着LUKS设备带来的安全感,但是我们也该开始考虑一个可能的远程备份方案了。对于安全的非现场备份,我们将需要能在LUKS加密的设备上以块级别操作的东西。因此,最后我们发现这么个状况,我们每次都需要传输想要做备份的整个LUKS设备(比如说200GB大)。很明显,这是不可行的。我们该怎么来处理这个问题呢? + +### 一个解决方案: Bdsync ### + +这时,一个卓越的开源工具来拯救我们了,它叫[Bdsync][3](多亏了Rolf Fokkens)。顾名思义,Bdsync可以通过网络同步“块设备”。对于快速同步,Bdsync会生成并对比本地/远程块设备的块的MD5校验和,只同步差异部分。rsync在文件系统级别可以做的,Bdsync可以在块设备级别完成。很自然,对于LUKS加密的设备它也能工作得很好。相当地灵巧! + +使用Bdsync,首次备份将拷贝整个LUKS块设备到远程主机,因而会花费大量时间来完成。然而,在初始备份后,如果我们在LUKS设备新建一些文件,再次备份就会很快完成,因为我们只需拷贝修改过的块。经典的增量备份在起作用了! + +### 安装Bdsync到Linux ### + +Bdsync并不包含在Linux发行版的标准仓库中,因而你需要从源代码来构建它。使用以下针对特定版本的指令来安装Bdsync及其手册页到你的系统中。 + +#### Debian,Ubuntu或Linux Mint #### + + $ sudo apt-get install git gcc libssl-dev + $ git clone https://github.com/TargetHolding/bdsync.git + $ cd bdsync + $ make + $ sudo cp bdsync /usr/local/sbin + $ sudo mkdir -p /usr/local/man/man1 + $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' + +#### Fedora或CentOS/RHEL #### + + $ sudo yum install git gcc openssl-devel + $ git clone https://github.com/TargetHolding/bdsync.git + $ cd bdsync + $ make + $ sudo cp bdsync /usr/local/sbin + $ sudo mkdir -p /usr/local/man/man1 + $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' + +### 对LUKS加密的设备实施非现场增量备份 ### + +我假定你已经准备好了一个LUKS加密的块设备作为备份源(如,/dev/LOCDEV)。同时,我假定你也有一台远程主机,用以作为源设备的备份点(如,/dev/REMDEV)。 + +你需要在两台系统上具有root帐号访问权限,并且设置从本地访问远程的[无密码SSH访问][5]。最后,你需要安装Bdsync到两台主机上。 + +要在本地主机上初始化一个远程备份进程,我们需要以root执行以下命令: + + # bdsync "ssh root@remote_host bdsync --server" /dev/LOCDEV /dev/REMDEV | gzip > /some_local_path/DEV.bdsync.gz + +这里需要进行一些说明。Bdsync客户端将以root打开一个到远程主机的SSH连接,并执行带有--server选项的Bdsync客户端。明确说明一下,/dev/LOCDEV是我们的本地主机上的源LUKS块设备,而/dev/REMDEV是远程主机上的目标块设备。它们可以是/dev/sda(作为整个磁盘),或者/dev/sda2(作为单个分区)。本地Bdsync客户端的输出结果随后被管道输送到gzip,用来在本地主机中创建DEV.bdsync.gz(所谓的二进制补丁文件)。 + +你第一次运行上面的命令的时候,它会花费很长一段时间,这取决于你的互联网/局域网速度,以及/dev/LOCDEV的大小。记住,你必须有两个大小相同的块设备(/dev/LOCDEV和/dev/REMDEV)。 + +下一步是要将补丁文件从本地主机拷贝到远程主机。一种方式是使用scp: + + # scp /some_local_path/DEV.bdsync.gz root@remote_host:/remote_path + +最后一步,是要在远程主机上执行以下命令,它们会将补丁文件应用到/dev/REMDEV: + + # gzip -d < /remote_path/DEV.bdsync.gz | bdsync --patch=/dev/DSTDEV + +我推荐在使用真实数据部署Bdsync前,使用一些(没有任何重要数据)小分区来做这些测试。在你完全弄懂整个设置是如何工作之后,你可以开始备份真实数据。 + +### 尾声 ### + +小结之,我们演示了如何使用Bdsync来为LUKS设备实施增量备份。和rsync一样,每次备份只有一小部分数据,而不是整个LUKS设备,需要被推送到非现场备份点,这样会节省带宽和备份时间。剩下来,需要通过SSH或SCP来保证所有数据传输的安全,事实上设备自身是由LUKS加密的。也可以通过使用可以运行bdsync的专用用户(而非root)来改进该配置。我们也可以将bdsync用于任何块设备,如LVM卷或RAID磁盘,也可以很轻易地设置Bdsync备份本地磁盘到USB驱动器上。如你所见,它有着无限可能性! + +随时分享你的想法。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/remote-incremental-backup-luks-encrypted-disk-partition.html + +作者:[Iulian Murgulet][a] +译者:[GOLinux](https://github.com/GOLinux) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/iulian +[1]:http://xmodulo.com/go/digitalocean +[2]:http://xmodulo.com/how-to-create-encrypted-disk-partition-on-linux.html +[3]:http://bdsync.rolf-fokkens.nl/ +[4]:http://xmodulo.com/recommend/linuxbook +[5]:https://linux.cn/article-5444-1.html diff --git a/published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md b/published/201506/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md similarity index 100% rename from published/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md rename to published/201506/20150225 Install Google's Material Design Inspired GTK And Icon Theme Paper in Linux.md diff --git a/published/201506/20150310 FAQ--BSD.md b/published/201506/20150310 FAQ--BSD.md new file mode 100644 index 0000000000..e9f3d8fedb --- /dev/null +++ b/published/201506/20150310 FAQ--BSD.md @@ -0,0 +1,78 @@ +BSD 的那些事 +================================================================================ +![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq1-large1.png) + +### 假如历史稍有不同,今天你将听到的是“FreeBSD之声”... ### +(LCTT 译注:本文来自“Linux之声(LinuxVoice)”。) + +#### 那么,这个Birsa Seva Dal是怎么回事呢?难道不是一个印度的政治组织么? #### + +真有趣,您查阅了维基百科上“BSD”的消除分歧页面是为了讲上面这个笑话,对么?这里我们在讨论伯克利软件发行版(Berkeley Software Distribution),一个比您想象中用的更广泛的操作系统家族。 + +#### 抱歉,我有点 Hold 不住自己。那么,这些操作系统是怎么回事呢? #### + +今天,主要使用的BSD操作系统有三种。他们都基于Unix,他们都开源,并且大多担任服务器的角色,但也能当作优秀的桌面和工作站。他们运行KDE,Firefox,LibreOffice,Apache,MySQL和许多你能说得出名字的开源软件。它们都很稳定、安全、支持许多不同的硬件。 + +#### 真棒!你刚才在描述GNU/Linux吧 #### + +是的,Linux拥有我刚才提到的所有东西,这也是为什么很多人从来不讨论BSD。在日常的使用中,Linux和BSD并没有太多的不同,这主要是因为他们都以Unix为基础,并共用很多软件。您可以登录进远程主机,在Vim中写一些Python代码,使用Mutt检查您的email,您可能并未意识到您在使用BSD。或许您在咖啡馆里正通过网络终端使用它,但不知道他是BSD。 + +两者最大的区别在于开发模式和许可证,为了解这些,我们需要回到过去。在BSD中,B代表着加利福尼亚大学伯克利分校(University of California, Berkeley),在1980年代,那里是开源的Unix软件的发源地。到了90年代,基于x86的PC变得流行,许多人对在他们的家庭电脑中安装Unix类操作系统产生了兴趣。1992年,一个叫做386BSD的项目在那时发布,提供了上述功能。 + +#### 那么,所有的Linux发行版那个时候在哪里呢? #### + +问得好!您也许知道这一年的前一年(1991),Linus Torvalds已经发布了他的内核,当它与GNU项目结合时,变成了完整的开源操作系统。Linus那时也在关注GNU的内核(Hurd)和386BSD,并且他说过,如果那时两个内核有一个可以正常使用,他可能就不会创造Linux了。所以,90年代的头几年,开源操作系统生机勃勃,没有人知道哪个系统会最终胜出。 + +接下来,BSD遇到了一些麻烦。Unix最初的开发方AT&T试图从他们在操作系统方面的付出中获得一些利益,他们声称BSD侵犯了他们的知识产权。此事最终以1992年的一桩诉讼结束,它极大的抑制了BSD的开发进程。其结果就是,许多BSD源码必须重写,与此同时,GNU/Linux已经丰富了功能,变得稳定和流行了。 + +在90年代早期,BSD被认为比GNU/Linux更加成熟,如果没有那些法律麻烦,他可能已经成为了x86 PC的标准了。今天,我们可能都在使用它而不是Linux。 + +#### 但你提到BSD仍然被广泛的使用,所以它后来有提升么? #### + +是的。386BSD的开发停滞了,但有两只开发团队通过互联网协作并创造了两个独立的成功的项目。FreeBSD成为了使用最广泛的BSD版本,它目前是和Linux最相似的系统,包括桌面和服务器版本。而NetBSD则聚焦于可移植性(今天它可以运行在超过50种不同平台上,均基于同样的代码版本)。另一个版本是OpenBSD,它在NetBSD开始不久就因为开发者的口角而作为NetBSD的分支诞生了,今天,它以专注于安全闻名。多年以来,OpenBSD创建了许多程序,它们都成了Linux的标准部分,比如说OpenSSH - 甚至,现在我们还有了LibreSSL。 + +#### 所以,这三种版本的BSD和Linux发行版相似么? #### + +也是也不是,每个BSD版本都有自己的代码库、不同的开发团队。尽管他们间有许多共用的代码(尤其是硬件驱动)。但他们是各自拥有其特色、优点和缺点的相互独立的操作系统。 + +我们提到过,BSD的开发模式是他们真正和GNU/Linux区别的重要特点。在GNU/Linux中没有人对其整体进行掌控:一些团队在GNU组件方面工作,一些团队在开发内核,一些在开发启动脚本,一些在写手册,一些在写库等等。这样的开发模式通常被称作缺少中央权利的“荒蛮的美国西部”,由发行版负责将所有的东西各自锲合。 + +而BSD则相反,它们从中央化的源代码树中开发并作为一个整体。内核、库、系统组件和文档页都存在一个地方,且以同样的方式使用。许多BSD粉丝声称,这个特点给了操作系统更多的一致性和稳定性。通过我这些年使用BSD的经验来看,我们可以证明手册页已经变得非常完备。 + +![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq2-large1.png) + +#### 难道BSD没有使用GNU/Linux的任何东西么? #### + +是的,但除了GCC。几十年来,GNU Compiler Collection已经成为了实际上的Unix系统标准编译器,但FreeBSD最近已经转而使用LLVM/Clang了。值得注意的是BSD还是用了一些其他的开源项目,但它们并属于GNU或者Linux,比如说X Window System(XFree86和X.org)、Perl等等。并且幸亏有像POSIX一样的标准,许多运行在Linux上的程序可以在BSD的许多版本上编译和运行。 + +因此,您可以把LAMP(Linux、Apache、MySQL和PHP)中的L改成FreeBSD,这样可以获得几乎同样的环境,以及一些不同的特性(例如,在文件系统和驱动支持方面)。FreeBSD有一些大型、海量的用户,例如Netflix,每天提供海量的数据。尽管FreeBSD可以做为一个不错的桌面环境,但它的长处在于服务器方面,它拥有超乎寻常的可靠性和网络性能。 + +OpenBSD更倾向用于安全性十分必要的场合,如小型Web服务、文件托管、防火墙和网关。NetBSD是BSD主要发行版中最不流行的一个,它能运行在几乎所有平台上,包括古老的Amigas和Acorn boxes,有时您可以在闭源的网络设备中找到它的身影。 + +#### 等等,怎么会有人将开源代码闭源呢?那在Linux中是不合适的 #### + +对的,这里我们谈到了它与GNU/Linux的主要不同。BSD版本的许可证(很有趣,就叫做BSD许可证)非常不同于我们所知的GPL。对于新手来说,BSD更简短。BSD许可证主要内容是:对这份代码做你想做的事,但要保留它的初始开发者的荣誉,并且如果它搞坏你的电脑时不要提出诉讼。 + +因此,该许可证中没有任何条款强制代码开源,不像GPL,它要求使用这份代码的用户将他们的修改也开源。这一重要的不同引起了互联网上无数的激烈讨论,BSD的粉丝们说他们的许可证更加自由(因为它不那么严格),而GNU/GPL的粉丝说他们的证书才更自由(因为它保留了真正的自由) + +#### 啊呀,不管怎么说,你已经引起了我的兴趣,我在哪里能尝试这些可爱的BSD版本呢? #### + +您大概已经可以猜到这些网站了 – [www.openbsd.org][1]、[www.freebsd.org][2]、[www.netbsd.org][3]。在那里,您可以下载ISO镜像,在VirtualBox中启动它们,然后开始玩耍。如果您已经用了一段时间的Linux,你就会发现这并不难,虽然您需要了解命令行。如果您在寻找一些对新手更加友好的东西,可以试试PC-BSD,PC-BSD([www.pcbsd.org][4])是一个基于FreeBSD的个性化定制版本,它专注于桌面,有美观的图形化安装器和超级简单的软件管理器。 + +祝你玩的愉快! + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/faq-bsd-2/ + +作者:[Mike Saunders][a] +译者:[wwy-hust](https://github.com/wwy-hust) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/mike/ +[1]:http://www.openbsd.org/ +[2]:http://www.freebsd.org/ +[3]:http://www.netbsd.org/ +[4]:http://www.pcbsd.org/ diff --git a/published/201506/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md b/published/201506/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md new file mode 100644 index 0000000000..462c647ac8 --- /dev/null +++ b/published/201506/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md @@ -0,0 +1,143 @@ +用命令行工具Speedtest-CLI来测试你的上下行网速 +================================================================================ + +我们经常需要到检查家里与办公室之间的网络是否连通,那么我们要怎么做呢?打开网站Speedtest.net然后开始测试。网站是通过加载浏览器中的JavaScript脚本然后选择最佳的服务器测速然后用Flash产生图形化的结果。 + +那么远程服务器呢?要知道大多数远程服务器是没有浏览器可以打开web页面的。用浏览器打开网页测速的瓶颈就在此,你不能按计划的对服务器进行定期的常规测试。这时需要到一个名为Speedtest-cli的软件来打破这个瓶颈,它能让你通过命令行来测试互联网连接的速度。 + +#### Speedtest-cli是什么 #### + +此程序是基于Python开发的脚本程序,利用了speedtest.net的服务来测量出上下行的宽带。Speedtest-cli能根据机房离测速服务器的物理距离来列出测速服务器,或者针对某一服务器进行测速,同时还能为你生成一个URL以便你分享你的测速结果。 + +要在Linux上安装最新版本的speedtest-cli,你必须安装2.4-3.4或者更高版本的Python。 + +### 在Linux上安装speedtest-cli ### + +有两种方法可以安装speedtest-cli。第一种方法需要用到`python-pip`包管理器,第二种方法需要安装Python脚本,生成安装文件然后运行,这里我们分别介绍两种方法: + +#### 使用pythin-pip安装speedtest-cli#### + +首先你需要安装`python-pip`包管理器,之后你就可以用pip命令来安装speedtest-cli + + $ sudo apt-get install python-pip + $ sudo pip install speedtest-cli + +如果要把speedtest-cli升级至最新版本,你需要输入以下命令 + + $ sudo pip install speedtest-cli --upgrade + +#### 通过Pyhton脚本来安装speedtest-cli #### + +首先要用wget命令从github上下来Python脚本,然后解压提取下载的文件(master.zip) + + $ wget https://github.com/sivel/speedtest-cli/archive/master.zip + $ unzip master.zip + +提取出文件后,进入提取出的目录`speedtest-cli-master`然后使脚本可以执行。 + + $ cd speedtest-cli-master/ + $ chmod 755 speedtest_cli.py + +下一步,把可执行的脚本移动到`/usr/bin`文件夹,这样你就不用每次都输入完整的脚本路径了。 + + $ sudo mv speedtest_cli.py /usr/bin/ + +### 用speedtest-cli测试互联网连通速度### + +**1. 要测试你的下载与上传速度,只需要运行`speedtest-cli`命令,不需要带参数。** + + $ speedtest_cli.py + +![Test Download Upload Speed in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Download-Upload-Speed-in-Linux1.png) + +*在Linux下测试上传下载速度* + +**2. 测试上传下载的速度(以字节计算)** + + $ speedtest_cli.py --bytes + +![Test Internet Speed in Bytes](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Speed-in-Bytes.png) + +*测试bytes的速度* + +**3. 工具提供一个链接来下载由你的宽带测试结果生成的图片,你可以分享给你的家人朋友。** + +![Share Internet Speed Results](http://www.tecmint.com/wp-content/uploads/2015/03/Share-Internet-Speed-Results.png) + +*分享测速结果* + +下面的图片就是你通过以上的命令行测速而生成的图片 + +![Speed Test Results](http://www.tecmint.com/wp-content/uploads/2015/03/Speed-Test-Results.png) + +*测速结果* + +**4.如果你仅仅需要Ping,上传,下载的结果,就运行以下命令:** + + $ speedtest_cli.py --simple + +![Test Ping Download Upload Speed](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Ping-Download-Upload-Speed1.png) + +*测试Ping,上传,下载的速度* + +**5. 列出`speedtest.net`所有的服务器距离你的物理距离,单位是千米(km)** + + $ speedtest_cli.py --list + +![Check Speedtest.net Servers](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Speedtest-Servers.png) + +*列出Speedtest.net的服务器* + +**6. 当获得一个非常长的服务器列表之后,怎么列出我想要的某个服务器?如果我要在speedtest.net服务器列表中找出位于Mumbai(印度)的服务器呢?** + + $ speedtest_cli.py --list | grep -i Mumbai + +![Check Nearest Server](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Nearest-Server.png) + +*列出最近的服务器* + +**7. 对指定的服务器进行测速。我们使用上面例子5和例子6中获取的服务器ID:** + + $ speedtest_cli.py --server [server ID] + $ speedtest_cli.py --server [5060] ## 这里使用服务器ID为5060作为例子 + +![Test Connection Against Server](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Connection-Against-Server.png) + +*对指定的服务器进行测速* + +**8. 输出`speedtest-cli`的版本信息和帮助文档** + + $ speedtest_cli.py --version + +![Check SpeedCli Version](http://www.tecmint.com/wp-content/uploads/2015/03/Check-SpeedCLi-Version.png) + +*输出版本号* + + $ speedtest_cli.py --help + +![SpeedCli Help](http://www.tecmint.com/wp-content/uploads/2015/03/SpeedCli-Help.png) + +*输出帮助文档* + +**提醒:**报告中的延迟并不是确切的结果,不应该过于依赖它;这个数值可以当作相对延迟,这对你选择某一测试服务器来说是可靠的。同时,CPU和内存的容量会影响结果的准确度。 + +### 结论 ### + +系统管理员和开发者应该必备这个简单的脚本工具,这个轻量级的工具功能齐全,真是太赞了。我不喜欢Speedtest.net的原因是它使用来flash,相反speedtest-cli刚好戳中了我的痛点。 + +speedtest_cli是一个第三方工具,也不能自动地记录下宽带速度。Speedtest.net拥有上百万的用户,你可以自己[配制一个小型的测速服务器][1]。 + +上面就是所有内容,更多内容敬请关注我们。如果你有任何反馈记得在文章下方评论,如果你喜欢别忘了给我们点个赞,分享我们的文章。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/ + +作者:[Avishek Kumar][a] +译者:[NearTan](https://github.com/NearTan) +校对:[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/speedtest-mini-server-to-test-bandwidth-speed/ diff --git a/translated/tech/20150323 How to set up networking between Docker containers.md b/published/201506/20150323 How to set up networking between Docker containers.md similarity index 76% rename from translated/tech/20150323 How to set up networking between Docker containers.md rename to published/201506/20150323 How to set up networking between Docker containers.md index 3481dd8faa..6d8434041e 100644 --- a/translated/tech/20150323 How to set up networking between Docker containers.md +++ b/published/201506/20150323 How to set up networking between Docker containers.md @@ -12,13 +12,13 @@ ![](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 路由器。 -每个 weave 路由器会刷新整个对等网络的拓扑信息,像容器的 MAC 地址(就像交换机的 MAC 地址学习一样获取其他容器的 MAC 地址),因此它可以决定数据包的下一跳是往哪个容器的。weave 能让两个处于不同宿主机的容器进行通信,只要这两台宿主机在 weave 拓扑结构内连到同一个 weave 路由器。另外,weave 路由器还能使用公钥加密技术将 TCP 和 UDP 数据包进行加密。 +每个 weave 路由器会刷新整个对等网络的拓扑信息,可以称作容器的 MAC 地址(如同交换机的 MAC 地址学习一样获取其他容器的 MAC 地址),因此它可以决定数据包的下一跳是往哪个容器的。weave 能让两个处于不同宿主机的容器进行通信,只要这两台宿主机在 weave 拓扑结构内连到同一个 weave 路由器。另外,weave 路由器还能使用公钥加密技术将 TCP 和 UDP 数据包进行加密。 ### 准备工作 ### -在使用 weave 之前,你需要在所有宿主机上安装 Docker[2] 环境,参考[这些][3][教程][4],在 Ubuntu 或 CentOS/Fedora 发行版中安装 Docker。 +在使用 weave 之前,你需要在所有宿主机上安装 [Docker][2] 环境,参考[这些][3][教程][4],在 Ubuntu 或 CentOS/Fedora 发行版中安装 Docker。 Docker 环境部署完成后,使用下面的命令安装 weave: @@ -26,7 +26,7 @@ Docker 环境部署完成后,使用下面的命令安装 weave: $ chmod a+x weave $ sudo cp weave /usr/local/bin -注意你的 PATH 环境变量要包含 /usr/local/bin 这个路径,请在 /etc/profile 文件中加入一行(LCTT 注:要使环境变量生效,你需要执行这个命令: src /etc/profile): +注意你的 PATH 环境变量要包含 /usr/local/bin 这个路径,请在 /etc/profile 文件中加入一行(LCTT 译注:要使环境变量生效,你需要执行这个命令: source /etc/profile): export PATH="$PATH:/usr/local/bin" @@ -34,15 +34,15 @@ Docker 环境部署完成后,使用下面的命令安装 weave: Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防火墙,请确保这两个端口不会被防火墙挡住。 -### 在每台宿主机上开启 Weave 路由器 ### +### 在每台宿主机上启动 Weave 路由器 ### -当你想要让处于在不同宿主机上的容器能够互相通信,第一步要做的就是在每台宿主机上开启 weave 路由器。 +当你想要让处于在不同宿主机上的容器能够互相通信,第一步要做的就是在每台宿主机上启动 weave 路由器。 -第一台宿主机,运行下面的命令,就会创建并开启一个 weave 路由器容器(LCTT 注:前面说过了,weave 路由器也是一个容器): +第一台宿主机,运行下面的命令,就会创建并开启一个 weave 路由器容器(LCTT 译注:前面说过了,weave 路由器也是一个容器): $ sudo weave launch -第一次运行这个命令的时候,它会下载一个 weave 镜像,这会花一些时间。下载完成后就会自动运行这个镜像。成功启动后,终端会打印这个 weave 路由器的 ID 号。 +第一次运行这个命令的时候,它会下载一个 weave 镜像,这会花一些时间。下载完成后就会自动运行这个镜像。成功启动后,终端会输出这个 weave 路由器的 ID 号。 下面的命令用于查看路由器状态: @@ -52,7 +52,7 @@ Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防 第一个 weave 路由器就绪了,目前为止整个 peer 对等网络中只有一个 peer 成员。 -你也可以使用 doceker 的命令来查看 weave 路由器的状态: +你也可以使用 docker 的命令来查看 weave 路由器的状态: $ docker ps @@ -66,7 +66,7 @@ Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防 ![](https://farm8.staticflickr.com/7608/16868571891_e66d4b8841_c.jpg) -当你开启更多路由器,这个 peer 成员列表会更长。当你新开一个路由器时,要指定前一个宿主机的 IP 地址,请注意不是第一个宿主机的 IP 地址。 +当你开启更多路由器,这个 peer 成员列表会更长。当你新开一个路由器时,要指定前一个宿主机的 IP 地址,请注意不是第一个宿主机的 IP 地址(LCTT 译注:链状结构)。 现在你已经有了一个 weave 网络了,它由位于不同宿主机的 weave 路由器组成。 @@ -82,7 +82,7 @@ Weave 在 TCP 和 UDP 上都使用 6783 端口,如果你的系统开启了防 hostA:~$ sudo weave run 10.0.0.1/24 -t -i ubuntu -成功运行后,终端会打印出容器的 ID 号。你可以使用这个 ID 来访问这个容器: +成功运行后,终端会显示出容器的 ID 号。你可以使用这个 ID 来访问这个容器: hostA:~$ docker attach @@ -124,7 +124,7 @@ weave 提供了一些非常巧妙的特性,我在这里作下简单的介绍 ![](https://farm8.staticflickr.com/7639/16247212144_c31a49714d_c.jpg) -现在这个容器可以与 10.10.0.0/24 网络上的其它容器进行通信了。当你要把容器加入一个网络,而这个网络暂时不可用时,上面的步骤就很有帮助了。 +现在这个容器可以与 10.10.0.0/24 网络上的其它容器进行通信了。这在当你创建一个容器而网络信息还不确定时就很有帮助了。 #### 将 weave 网络与宿主机网络整合起来 #### @@ -134,13 +134,13 @@ weave 提供了一些非常巧妙的特性,我在这里作下简单的介绍 hostA:~$ sudo weave expose 10.0.0.100/24 -这个命令把 IP 地址 10.0.0.100 分配给宿主机 hostA,这样一来 hostA 也连到了 10.0.0.0/24 网络上了。很明显,你在为宿主机选择 IP 地址的时候,需要选一个没有被其他容器使用的地址。 +这个命令把 IP 地址 10.0.0.100 分配给宿主机 hostA,这样一来宿主机 hostA 也连到了 10.0.0.0/24 网络上了。显然,你在为宿主机选择 IP 地址的时候,需要选一个没有被其他容器使用的地址。 现在 hostA 就可以访问 10.0.0.0/24 上的所有容器了,不管这些容器是否位于 hostA 上。好巧妙的设定啊,32 个赞! ### 总结 ### -如你所见,weave 是一个很有用的 docker 网络配置工具。这个教程只是[它强悍功能][5]的冰山一角。如果你想进一步玩玩,你可以试试它的以下功能:多跳路由功能,这个在 multi-cloud 环境(LCTT 注:多云,企业使用多个不同的云服务提供商的产品,比如 IaaS 和 SaaS,来承载不同的业务)下还是很有用的;动态重路由功能是一个很巧妙的容错技术;或者它的分布式 DNS 服务,它允许你为你的容器命名。如果你决定使用这个好东西,欢迎分享你的使用心得。 +如你所见,weave 是一个很有用的 docker 网络配置工具。这个教程只是它[强悍功能][5]的冰山一角。如果你想进一步玩玩,你可以试试它的以下功能:多跳路由功能,这个在 multi-cloud 环境(LCTT 译注:多云,企业使用多个不同的云服务提供商的产品,比如 IaaS 和 SaaS,来承载不同的业务)下还是很有用的;动态重路由功能是一个很巧妙的容错技术;或者它的分布式 DNS 服务,它允许你为你的容器命名。如果你决定使用这个好东西,欢迎分享你的使用心得。 -------------------------------------------------------------------------------- diff --git a/translated/tech/20150326 A Peep into Process Management Commands in Linux.md b/published/201506/20150326 A Peep into Process Management Commands in Linux.md similarity index 53% rename from translated/tech/20150326 A Peep into Process Management Commands in Linux.md rename to published/201506/20150326 A Peep into Process Management Commands in Linux.md index f8c92f871d..705ec14d6d 100644 --- a/translated/tech/20150326 A Peep into Process Management Commands in Linux.md +++ b/published/201506/20150326 A Peep into Process Management Commands in Linux.md @@ -1,46 +1,44 @@ -12个进程管理命令 +12个进程管理命令介绍 ================================================================================ -每个程序在执行时叫进程。当程序是在存储中是可执行文件并且运行的时候,每个进程会被动态得分配系统资源,内存,安全属性和与之相关的状态。可以有多个进程关联同一个程序,并同时执行不会互相干扰。操作系统会有效地管理和追踪所有运行着的进程。 +执行中的程序在称作进程。当程序以可执行文件存放在存储中,并且运行的时候,每个进程会被动态得分配系统资源、内存、安全属性和与之相关的状态。可以有多个进程关联到同一个程序,并同时执行不会互相干扰。操作系统会有效地管理和追踪所有运行着的进程。 为了管理这些进程,用户应该能够: - 查看所有运行中的进程 - 查看进程消耗资源 -- 定位个别进程并且可以执行指定动作 +- 定位个别进程并且对其执行指定操作 - 改变进程的优先级 - 杀死指定进程 -- 限制进程的有效系统资源 -- 等 +- 限制进程可用的系统资源等 -Linux提供了许多命令给用户来高效掌控上述的操作。接下来,一个一个的来讲解下。 +Linux提供了许多命令来让用户来高效掌控上述的操作。接下来,一个一个的来讲解下。 ### 1. ps ### -'ps'是最基础浏览系统中的进程的命令。能列出系统中运行的进程,包括进程号,命令,CPU使用量,内存使用量等。下述选项可以得到更多有用的消息。 +'ps'是Linux 中最基础的浏览系统中的进程的命令。能列出系统中运行的进程,包括进程号、命令、CPU使用量、内存使用量等。下述选项可以得到更多有用的消息。 ps -a - 列出所有运行中/激活进程 ![Output of "ps -a" command](http://blog.linoxide.com/wp-content/uploads/2015/02/ps-a2.png) ps -ef |grep - 列出需要进程 - - ps -aux - 展示进程包括、终端(x)和用户(u)信息,如USER, PID, %CPU, %MEM等 + ps -aux - 显示进程信息,包括无终端的(x)和针对用户(u)的进程:如USER, PID, %CPU, %MEM等 ### 2. pstree ### -linux中,每一个进程都是由父进程创建的。此命令帮助可视化进程,通过显示进程树状图表展示进程间关系。如果使用pid了,那么树的根是pid。不然将会是init。 +linux中,每一个进程都是由其父进程创建的。此命令以可视化方式显示进程,通过显示进程的树状图来展示进程间关系。如果指定了pid了,那么树的根是该pid,不然将会是init(pid: 1)。 ![pstree](http://blog.linoxide.com/wp-content/uploads/2015/02/pstree.png) ### 3. top ### -‘top’是一个更加有用的命令,通过不同的进程所使用的资源可以监视系统。它提供实时的系统状态信息。显示进程的数据包括PID,进程用户,优先值,%CPU,%memory等。可以使用这些显示指示出资源使用量。 +‘top’是一个更加有用的命令,可以监视系统中不同的进程所使用的资源。它提供实时的系统状态信息。显示进程的数据包括 PID、进程属主、优先级、%CPU、%memory等。可以使用这些显示指示出资源使用量。 ![top](http://blog.linoxide.com/wp-content/uploads/2015/02/top.png) ### 4. htop ### -htop与top很类似,但是htop是交互式的模式进程查看器。它通过文字图像显示每一个CPU和内存使用量、swap使用量。上下键选择进程,F7和F8改变优先级,F9杀死进程。Htop不是系统默认,所以需要额外安装。 +htop与top很类似,但是htop是交互式的文本模式的进程查看器。它通过文字图形化地显示每一个进程的CPU和内存使用量、swap使用量。使用上下光标键选择进程,F7和F8改变优先级,F9杀死进程。Htop不是系统默认安装的,所以需要额外安装。 ![htop output](http://blog.linoxide.com/wp-content/uploads/2015/03/htop1.png) @@ -48,7 +46,7 @@ htop与top很类似,但是htop是交互式的模式进程查看器。它通过 通过nice命令的帮助,用户可以设置和改变进程的优先级。提高一个进程的优先级,内核会分配更多CPU时间片给这个进程。默认情况下,进程以0的优先级启动。进程优先级可以通过top命令显示的NI(nice value)列查看。 -进程优先级值的范围从-20到19。值越低,越优先。 +进程优先级值的范围从-20到19。值越低,优先级越高。 nice <优先值> <进程名> - 通过给定的优先值启动一个程序 @@ -56,17 +54,17 @@ htop与top很类似,但是htop是交互式的模式进程查看器。它通过 ![changed nice value of 'top'](http://blog.linoxide.com/wp-content/uploads/2015/02/top-nice.png) -上述命令例子,可以看到‘top’命令获得了-3的优先值。 +上述命令例子中,可以看到‘top’命令获得了-3的优先值。 ### 6. renice ### -renice命令类似nice命令。使用这个命令可以改变正在运行的进程优先值。注意,用户只能改变属于他们的进程的优先值。 +renice命令类似nice命令。使用这个命令可以改变正在运行的进程优先值。注意,用户只能改变属于他们自己的进程的优先值。 renice -n -p - 改变指定进程的优先值 ![renice command](http://blog.linoxide.com/wp-content/uploads/2015/02/renice2.png) -优先值初始化为0的3806号进程优先值已经变成了4. +初始优先值为0的3806号进程优先值已经变成了4. renice -u -g - 通过指定用户和组来改变进程优先值 @@ -76,7 +74,7 @@ renice命令类似nice命令。使用这个命令可以改变正在运行的进 ### 7. kill ### -这个命令通过发送信号结束进程。如果一个进程没有响应杀死命令,这也许就需要强制杀死,使用-9参数来执行。注意,使用强制杀死的时候一定要小心,因为没有机会确定是否写入完成、是否结束等。如果我们不知道进程PID或者打算用名字杀死进程时候,killall就能派上用场。 +这个命令用于发送信号来结束进程。如果一个进程没有响应杀死命令,这也许就需要强制杀死,使用-9参数来执行。注意,使用强制杀死的时候一定要小心,因为进程没有时机清理现场,也许写入文件没有完成。如果我们不知道进程PID或者打算用名字杀死进程时候,killall就能派上用场。 kill @@ -84,7 +82,7 @@ renice命令类似nice命令。使用这个命令可以改变正在运行的进 killall -9 - 杀死所有拥有同样名字的进程 -如果你使用kill,你需要知道进程ID号。pkill是类似的命令但只需要一个模式,如果进程名,进程拥有者等 +如果你使用kill,你需要知道进程ID号。pkill是类似的命令,但使用模式匹配,如进程名,进程拥有者等。 pkill <进程名> @@ -94,17 +92,17 @@ renice命令类似nice命令。使用这个命令可以改变正在运行的进 ### 8. ulimit ### -命令在控制系统资源在shell和进程上的分配量。对于系统管理员是最有用的,可以管理系统倾向和性能问题。限制资源大小可以确保重要进程持续运行,其他进程不会占用过多资源。 +该命令用于控制系统资源在shell和进程上的分配量。对于系统管理员是最有用的,可以管理重度使用和存在性能问题的系统。限制资源大小可以确保重要进程持续运行,其他进程不会占用过多资源。 ulimit -a - 显示当前用户关联的资源限制 ![ulimit -a](http://blog.linoxide.com/wp-content/uploads/2015/02/ulimit-a.png) - -f - 最大文件大小 + -f - 最大文件尺寸大小 -v - 最大虚拟内存大小(KB) - -n - 最大文件描述符加1 + -n - 增加最大文件描述符数量 -H : 改变和报告硬限制 @@ -114,13 +112,13 @@ renice命令类似nice命令。使用这个命令可以改变正在运行的进 ### 9. w ### -w提供正确登录的用户和其执行的进程的信息。显示信息头包含信息像现在时间,系统运行时长,登录用户总数,过去1,5,15分钟负载均衡数。 +w 提供当前登录的用户及其正在执行的进程的信息。显示信息头包含信息,如当前时间、系统运行时长、登录用户总数、过去的1,5,15分钟内的负载均衡数。 -基于这些用户信息,用户可以在终止进程前查看不属于他们的进程。 +基于这些用户信息,用户在终止不属于他们的进程时要小心。 !['w' command](http://blog.linoxide.com/wp-content/uploads/2015/02/w.png) -**who**是类似命令,提供列表,包含当前登录用户,系统启动时间,运行级别等。 +**who**是类似命令,提供当前登录用户列表、系统启动时间、运行级别等。 !['who' command](http://blog.linoxide.com/wp-content/uploads/2015/02/who.png) @@ -130,7 +128,7 @@ w提供正确登录的用户和其执行的进程的信息。显示信息头包 ### 10. pgrep ### -pgrep为"进程号全局正则匹配打印"。命令扫描当前运行进程,然后列出选择标准匹配出的进程ID到标准输出。对于通过名字检索进程号是很有用。 +pgrep的意思是"进程号全局正则匹配输出"。该命令扫描当前运行进程,然后按照命令匹配条件列出匹配结果到标准输出。对于通过名字检索进程号是很有用。 pgrep -u mint sh @@ -140,9 +138,9 @@ pgrep为"进程号全局正则匹配打印"。命令扫描当前运行进程, ### 11. fg , bg ### -有时,命令需要很长的时间才能执行完成。对于这种情况,我们使用‘bg’命令可以将任务放在后台执行,而是用‘fg’可以调到前台来使用。 +有时,命令需要很长的时间才能执行完成。对于这种情况,我们使用‘bg’命令可以将任务放在后台执行,而用‘fg’可以调到前台来使用。 -通过‘&’,我们后台启动一个程序: +我们可以通过‘&’在后台启动一个程序: find . -name *iso > /tmp/res.txt & @@ -152,7 +150,7 @@ pgrep为"进程号全局正则匹配打印"。命令扫描当前运行进程, ctrl+z - 挂起当前执行程序 - bg - 将程序发送到后台运行 + bg - 将程序放到后台运行 我们可以使用‘jobs’命令列出所有后台进程。 @@ -160,7 +158,7 @@ pgrep为"进程号全局正则匹配打印"。命令扫描当前运行进程, 使用‘fg’命令可以将后台程序调到前台执行。 - fg % + fg %进程id ![output of fg, bg and jobscommands](http://blog.linoxide.com/wp-content/uploads/2015/03/fg-bg-jobs.png) @@ -172,13 +170,13 @@ ipcs命令报告进程间通信设施状态。(共享内存,信号量和消 ipcs -p -m -下面屏幕截图列出了共享内存段的创建者ID和进程ID。 +下面屏幕截图列出了最近访问了共享内存段的进程的创建者的ID和进程ID。 ![ipcs command](http://blog.linoxide.com/wp-content/uploads/2015/03/ipcs.png) ### 总结 ### -总之 ,这些命令可以帮助管理员修复问题和改善性能。同样作为一名普通用户也需要解决进程间出现的问题。所以,熟悉如此繁多的命令,从能有效管理进程是行之有效。 +总之 ,这些命令可以帮助管理员修复问题和改善性能。同样作为一名普通用户也需要解决进程出现的问题。所以,熟悉如此繁多的命令,从能有效管理进程是行之有效。 -------------------------------------------------------------------------------- @@ -186,7 +184,7 @@ via: http://linoxide.com/linux-command/process-management-commands-linux/ 作者:[B N Poornima][a] 译者:[VicYu/Vic020](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md b/published/201506/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md similarity index 75% rename from translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md rename to published/201506/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md index 45c09f3475..ef30371412 100644 --- a/translated/tech/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md +++ b/published/201506/20150330 How to Serve Git Repositories Using Gitblit Tool in Linux.md @@ -1,18 +1,18 @@ -如何在Linux下使用Gitblit工具创建Git仓库服务 +如何在Linux下使用Gitblit工具创建Git仓库服务 ================================================================================ -嗨!朋友,今天我们将学习如何在你的Linux服务器或者PC上安装Gitblit工具。首先,我们看看什么是Git,它的功能以及安装Gitblit的步骤。[Git是分布式版本控制系统][1],它强调速度、数据一致性,并且支持分布式、非线性工作流。它最初由Linus Torvalds在2005年为Linux内核设计和开发,使用GPL2证书,并因此成为软件开发中使用最广泛的版本控制系统。 +嗨!朋友,今天我们将学习如何在你的Linux服务器或者PC上安装Gitblit工具。首先,我们看看什么是Git,它的功能以及安装Gitblit的步骤。[Git是分布式版本控制系统][1],它强调速度、数据一致性,并且支持分布式、非线性工作流。它最初由Linus Torvalds在2005年为Linux内核设计和开发,使用GPLv2证书,并从此成为软件开发中使用最广泛的版本控制系统。 -[Gitblit是完全开源的软件][2],它基于纯粹的Java堆栈,被设计以在Git仓库速度和效率方面胜任从小型到极大型的项目。它很容易学习和上手,并有着闪电般的性能。它在廉价的本地分支、便于staging、多工作流等方面远胜过一些SCM(版本控制)工具,比如Subversion、CVS、Perforce和ClearCase。 +[Gitblit是完全开源的软件][2],它基于纯粹的Java堆栈,被设计以在Git仓库速度和效率方面胜任从小型到极大型的项目。它很容易学习和上手,并有着闪电般的性能。它在很多方面远胜 Subversion、CVS、Perforce和ClearCase等SCM(版本控制)工具,比如,如快速本地分支、易于暂存、多工作流等。 #### Gitblit的功能 #### -- 它可以做为一个无声的仓库视图,没有管理控制以及用户账户。 -- 它可以做为完整的Git堆栈,拥有clone, pushing和仓库存取控制。 -- 它能独立于其他Git工具使用(包括实际的Git),它能和您已创建的工具合作。 +- 它可以做为一个哑仓库视图,没有管理控制以及用户账户。 +- 它可以做为完整的Git服务,拥有克隆、推送和仓库访问控制。 +- 它能独立于其他Git工具使用(包括实际的Git),它能和您已有的工具协作。 ### 1.创建Gitblit安装目录 ### -首先我们将在我们的服务器上建立一个目录,我们将在该目录下安装最新的Gitblit。 +首先我们将在我们的服务器上建立一个目录,并在该目录下安装最新的Gitblit。 $ sudo mkdir -p /opt/gitblit @@ -28,7 +28,7 @@ ![下载gitblit安装包](http://blog.linoxide.com/wp-content/uploads/2015/01/downloading-gitblit.png) -接下来,我们将解压下载到的tarball压缩包至之前创建的目录 /opt/gitblit/ +接下来,我们将下载到的tar压缩包解压至之前创建的目录 /opt/gitblit/ $ sudo tar -zxvf gitblit-1.6.2.tar.gz @@ -42,7 +42,7 @@ 另一种是将gitblit添加为服务。下面是在linux下将gitblit添加为服务的步骤。 -由于我在使用Ubuntu,下面的命令将是 sudo cp service-ubuntu.sh /etc/init.d/gitblit。所以请根据你的发行版修改文件名service-ubuntu.sh为相应的你运行的发行版。 +由于我在使用Ubuntu,下面的命令将是 sudo cp service-ubuntu.sh /etc/init.d/gitblit,所以请根据你的发行版修改文件名service-ubuntu.sh为相应的你运行的发行版。 $ sudo ./install-service-ubuntu.sh @@ -50,13 +50,13 @@ ![启动gitblit服务](http://blog.linoxide.com/wp-content/uploads/2015/01/starting-gitblit-service.png) -在你的浏览器中打开http://localhost:8080或https://localhost:8443,也可以将localhost根据本地配置替换为IP地址。输入默认的管理员凭证:admin/admin并点击login按钮。 +在你的浏览器中打开`http://localhost:8080`或`https://localhost:8443`,也可以将localhost根据本地配置替换为IP地址。输入默认的管理员凭证:admin / admin并点击login按钮。 ![gitblit欢迎页面](http://blog.linoxide.com/wp-content/uploads/2015/01/gitblit-welcome.png) 现在,我们将添加一个新的用户。首先,你需要以admin用户登录,username = **admin**,password = **admin**。 -然后,点击 user icon > users > (+) new user 来创建一个新用户,如下图所示。 +然后,点击用户图标 > users > (+) new user 来创建一个新用户,如下图所示。 ![添加新用户](http://blog.linoxide.com/wp-content/uploads/2015/01/add-user.png) @@ -73,7 +73,7 @@ git remote add origin ssh://arunlinoxide@localhost:29418/linoxide.com.git git push -u origin master -请将用户名arunlinoxide替换为你添加的用户名。 +请将其中的用户名arunlinoxide替换为你添加的用户名。 #### 在命令行中push一个已存在的仓库 #### @@ -84,7 +84,7 @@ ### 结论 ### -欢呼吧!我们已经在Linux电脑中安装好了最新版本的Gitblit。接下来我们便可以在我们的大小工程中享受这样一个优美的版本控制系统。有了Gitblit,版本控制便再容易不过了。它有易于学习、轻量级、高性能的特点。因此,如果你有任何的问题、建议和反馈,请在留言处留言。 +欢呼吧!我们已经在Linux电脑中安装好了最新版本的Gitblit。接下来我们便可以在我们的大小项目中享受这样一个优美的版本控制系统。有了Gitblit,版本控制便再容易不过了。它有易于学习、轻量级、高性能的特点。因此,如果你有任何的问题、建议和反馈,请在留言处留言。 -------------------------------------------------------------------------------- @@ -92,7 +92,7 @@ via: http://linoxide.com/linux-how-to/serve-git-repositories-gitblit/ 作者:[Arun Pyasi][a] 译者:[wwy-hust](https://github.com/wwy-hust) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md b/published/201506/20150331 How to Install WordPress with Nginx in a Docker Container.md similarity index 86% rename from translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md rename to published/201506/20150331 How to Install WordPress with Nginx in a Docker Container.md index 849dd4a853..e24767bd84 100644 --- a/translated/tech/20150331 How to Install WordPress with Nginx in a Docker Container.md +++ b/published/201506/20150331 How to Install WordPress with Nginx in a Docker Container.md @@ -1,6 +1,7 @@ -如何在 Docker 容器里的 Nginx 中安装 WordPress +如何在 Docker 容器中架设一个完整的 WordPress 站点 ================================================================================ -大家好,今天我们来学习一下如何在 Docker 容器上运行的 Nginx Web 服务器中安装 WordPress。WordPress 是一个很好的免费开源的内容管理系统,全球成千上万的网站都在使用它。[Docker][1] 是一个提供开放平台来打包,分发和运行任何应用的开源轻量级容器项目。它没有语言支持,框架或打包系统的限制,可以在从小的家用电脑到高端服务器的任何地方任何时间运行。这让它们成为可以用于部署和扩展网络应用,数据库和后端服务而不必依赖于特定的栈或者提供商的很好的构建块。 + +大家好,今天我们来学习一下如何在 Docker 容器里运行的 Nginx Web 服务器中安装 WordPress。WordPress 是一个很好的免费开源的内容管理系统,全球成千上万的网站都在使用它。[Docker][1] 是一个开源项目,提供了一个可以打包、装载和运行任何应用的轻量级容器的开放平台。它没有语言支持、框架和打包系统的限制,从小型的家用电脑到高端服务器,在何时何地都可以运行。这使它们可以不依赖于特定软件栈和供应商,像一块块积木一样部署和扩展网络应用、数据库和后端服务。 今天,我们会在 docker 容器上部署最新的 WordPress 软件包,包括需要的前提条件,例如 Nginx Web 服务器、PHP5、MariaDB 服务器等。下面是在运行在 Docker 容器上成功安装 WordPress 的简单步骤。 @@ -14,13 +15,13 @@ # systemctl restart docker.service -### 2. 创建 WordPress Docker 文件 ### +### 2. 创建 WordPress 的 Dockerfile ### -我们需要创建用于自动安装 wordpress 以及前提条件的 docker 文件。这个 docker 文件将用于构建 WordPress 的安装镜像。这个 WordPress docker 文件会从 Docker 库中心获取 CentOS 7 镜像并用最新的可用更新升级系统。然后它会安装必要的软件,例如 Nginx Web 服务器、PHP、MariaDB、Open SSH 服务器以及其它保证 Docker 容器正常运行不可缺少的组件。最后它会执行一个初始化 WordPress 安装的脚本。 +我们需要创建用于自动安装 wordpress 以及其前置需求的 Dockerfile。这个 Dockerfile 将用于构建 WordPress 的安装镜像。这个 WordPress Dockerfile 会从 Docker Registry Hub 获取 CentOS 7 镜像并用最新的可用更新升级系统。然后它会安装必要的软件,例如 Nginx Web 服务器、PHP、MariaDB、Open SSH 服务器,以及其它保证 Docker 容器正常运行不可缺少的组件。最后它会执行一个初始化 WordPress 安装的脚本。 # nano Dockerfile -然后,我们需要将下面的配置行添加到 Docker 文件中。 +然后,我们需要将下面的配置行添加到 Dockerfile中。 FROM centos:centos7 MAINTAINER The CentOS Project @@ -50,9 +51,9 @@ ![Wordpress Docker 文件](http://blog.linoxide.com/wp-content/uploads/2015/03/Dockerfile-wordpress.png) -### 3. 创建启动 script ### +### 3. 创建启动脚本 ### -我们创建了 docker 文件之后,我们需要创建用于运行和配置 WordPress 安装的脚本,名称为 start.sh。它会为 WordPress 创建并配置数据库和密码。用我们喜欢的文本编辑器打开 start.sh。 +我们创建了 Dockerfile 之后,我们需要创建用于运行和配置 WordPress 安装的脚本,名称为 start.sh。它会为 WordPress 创建并配置数据库和密码。用我们喜欢的文本编辑器打开 start.sh。 # nano start.sh @@ -86,7 +87,7 @@ } __handle_passwords() { - # 在这里我们生成随机密码(感谢 pwgen)。前面两个用于 mysql 用户,最后一个用于 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` @@ -292,7 +293,7 @@ ### 5. 构建 WordPress 容器 ### -现在,完成了创建配置文件和脚本之后,我们终于要使用 docker 文件来创建安装最新的 WordPress CMS(译者注:Content Management System,内容管理系统)所需要的容器,并根据配置文件进行配置。做到这点,我们需要在对应的目录中运行以下命令。 +现在,完成了创建配置文件和脚本之后,我们终于要使用 Dockerfile 来创建安装最新的 WordPress CMS(译者注:Content Management System,内容管理系统)所需要的容器,并根据配置文件进行配置。做到这点,我们需要在对应的目录中运行以下命令。 # docker build --rm -t wordpress:centos7 . @@ -340,7 +341,7 @@ via: http://linoxide.com/linux-how-to/install-wordpress-nginx-docker-container/ 作者:[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/) 荣誉推出 diff --git a/published/201506/20150331 How to set up remote desktop on Linux VPS using x2go.md b/published/201506/20150331 How to set up remote desktop on Linux VPS using x2go.md new file mode 100644 index 0000000000..8ce76e25c6 --- /dev/null +++ b/published/201506/20150331 How to set up remote desktop on Linux VPS using x2go.md @@ -0,0 +1,138 @@ +如何在 Linux 上使用 x2go 设置远程桌面 +================================================================================ +由于一切都迁移到了云上,作为提高职员生产力的一种方式,虚拟远程桌面在工业中越来越流行。尤其对于那些需要在多个地方和设备之间不停漫游的人,远程桌面可以让他们和工作环境保持无缝连接。远程桌面对于雇主同样有吸引力,可以在工作环境中提高敏捷性和灵活性,由于硬件整合、桌面安全加固等原因降低 IT 花费。 + +在 Linux 世界中,理所当然设置远程桌面有很多选择,支持许多协议(例如 RDP、RFB、NX) 和服务器/客户端实现(例如 [TigerVNC][1]、RealVNC、FreeNX、x2go、X11vnc、TeamViewer 等等)。 + +这当中有个出色的产品叫做 [X2Go][2],它是一个基于 NX(译者注:通过计算机网络显示远程桌面环境的一种技术,可参考 [Wiki][9])的远程桌面服务器和客户端的开源(GPLv2)实现。在这个教程中,我会介绍 **如何为 Linux VPS 使用 X2Go 设置远程桌面环境**。 + +### X2Go 是什么? ### + +X2Go 的历史要追溯到 NoMachine 的 NX 技术。NX 远程桌面协议的设计目的是通过利用主动压缩和缓存解决低带宽和高延迟的网络连接问题。后来,NX 转为闭源,但 NX 库还是采用 GPL 协议。这导致出现了多种基于 NX 的远程桌面解决方案开源实现,X2Go 就是其中之一。 + +和其它解决方案例如 VNC 相比,X2Go 有哪些好处呢? X2Go 继承了 NX 技术的所有高级功能,很自然能在慢速网络连接上良好工作。另外,由于它内置的基于 SSH 的加密技术,X2Go 保持了确保安全的良好业绩记录。不再需要[手动设置 SSH 隧道][4] 。X2Go 默认支持音频,这意味着远程桌面的音乐播放可以通过网络传送,并进入本地扬声器。在易用性方面,远程桌面上运行的应用程序可以在你的本地桌面中以一个独立窗口无缝呈现,会给你造成一种应用程序实际上在你本地桌面运行的错觉。正如你看到的,这些都是一些基于 VNC 的解决方案所缺少的[强大功能][5]。 + +### X2GO 的桌面环境兼容性 ### + +和其它远程桌面服务器一样,X2Go 服务器也有一些[已知的兼容性问题][6]。像 KDE 3/4、Xfce、MATE 和 LXDE 是对 X2Go 服务器最友好的桌面环境。但是,用其它桌面管理器效果可能有所不同。例如,已知 GNOME 3 之后的版本、KDE 5、Unity 和 X2Go 并不兼容。如果你的远程主机的桌面管理器和 X2Go 兼容,你可以继续以下的教程。 + +### 在 Linux 上安装 X2Go 服务器 ### + +X2Go 由远程桌面服务器和客户端组件组成。让我们首先安装 X2Go 服务器。我假设你已经有一个和 X2Go 兼容的桌面管理器并且在远程主机上运行,我们会安装 X2Go 服务器到该远程主机。 + +注意系统启动后 X2Go 服务器组件没有需要单独启动的服务。你只需要保证开启了 SSH 服务并在正常运行。 + +#### Ubuntu 或 Linux Mint: #### + +配置 X2Go PPA 库。对于 Ubuntu 14.04 以及更高版本,有可用的 X2Go PPA。 + + $ sudo add-apt-repository ppa:x2go/stable + $ sudo apt-get update + $ sudo apt-get install x2goserver x2goserver-xsession + +#### Debian (Wheezy): #### + + $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E + $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" + $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" + $ sudo apt-get update + $ sudo apt-get install x2goserver x2goserver-xsession + +#### Fedora: #### + + $ sudo yum install x2goserver x2goserver-xsession + +#### CentOS/RHEL: #### + +首先启用 [EPEL 库][7] 然后运行: + + $ sudo yum install x2goserver x2goserver-xsession + +### 在 Linux 上安装 X2Go 客户端 ### + +在将会连接到远程桌面的本地主机上,安装以下命令安装 X2Go 客户端。 + +#### Ubuntu 或 Linux Mint: #### + +配置 X2Go PPA 库。对于 Ubuntu 14.04 以及更高版本,有可用的 X2Go PPA。 + + $ sudo add-apt-repository ppa:x2go/stable + $ sudo apt-get update + $ sudo apt-get install x2goclient + +Debian (Wheezy): + + $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E + $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" + $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" + $ sudo apt-get update + $ sudo apt-get install x2goclient + +#### Fedora: #### + + $ sudo yum install x2goclient + +CentOS/RHEL: + +首先启用 [EPEL 库][7] ,然后运行: + + $ sudo yum install x2goclient + +### 用 X2Go 客户端连接到远程桌面 ### + +现在可以连接到远程桌面了。在本地主机上,只需运行以下命令或者使用桌面启动器启动 X2Go 客户端。 + + $ x2goclient + +输入远程主机的 IP 地址和 SSH 用户名称。同时,指定会话类型(例如,远程主机的桌面管理器)。 + +![](https://farm9.staticflickr.com/8730/16365755693_75f3d544e9_b.jpg) + +如果需要的话,你可以自定义其它东西(通过点击其它的标签),例如连接速度、压缩、屏幕分辨率等等。 + +![](https://farm9.staticflickr.com/8699/16984498482_665b975eca_b.jpg) + +![](https://farm9.staticflickr.com/8694/16985838755_1b7df1eb78_b.jpg) + +当你初始化一个远程桌面连接的时候,会要求你登录。输入你的 SSH 登录名和密码。 + +![](https://farm9.staticflickr.com/8754/16984498432_1c8068b817_b.jpg) + +成功登陆后,你会看到远程桌面屏幕。 + +![](https://farm9.staticflickr.com/8752/16798126858_1ab083ba80_c.jpg) + +如果你想测试 X2Go 的无缝窗口功能,选择 "Single application" 会话类型,然后指定远处主机上可执行文件的路径。在该例子中,我选择远程 KDE 主机上的 Dolphin 文件管理器。 + +![](https://farm8.staticflickr.com/7584/16798393920_128c3af9c5_b.jpg) + +你成功连接后,你会在本地桌面上看到一个远程应用窗口,而不是完整的远程桌面屏幕。 + +![](https://farm9.staticflickr.com/8742/16365755713_7b90cf65f0_c.jpg) + +### 总结 ### + +在这篇教程中,我介绍了如何在 [Linux VPS][8] 实例上设置 X2Go 远程桌面。正如你所看到的,整个设置过程都非常简单(如果你使用一个合适的桌面环境的话)。尽管对于特定桌面仍有问题,X2Go 是一个安全、功能丰富、快速并且免费的远程桌面解决方案。 + +X2Go 的什么功能最吸引你?欢迎分享你的观点。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/x2go-remote-desktop-linux.html + +作者:[Dan Nanni][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://ask.xmodulo.com/centos-remote-desktop-vps.html +[2]:http://wiki.x2go.org/ +[3]:http://xmodulo.com/go/digitalocean +[4]:http://xmodulo.com/how-to-set-up-vnc-over-ssh.html +[5]:http://wiki.x2go.org/doku.php/doc:newtox2go +[6]:http://wiki.x2go.org/doku.php/doc:de-compat +[7]:https://linux.cn/article-2324-1.html +[8]:http://xmodulo.com/go/digitalocean +[9]:https://en.wikipedia.org/wiki/NX_technology \ No newline at end of file diff --git a/published/201506/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md b/published/201506/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md new file mode 100644 index 0000000000..dee56ed250 --- /dev/null +++ b/published/201506/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md @@ -0,0 +1,88 @@ +六种在 Linux 上为你带来 iTunes 般体验的方法 +================================================================================ +![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/itunes-linux-840x420.jpg?35dc20) + +随着你对 Linux 的熟悉(也许会成为你首要使用的操作系统),你终将会寻找能在 Linux 上有效管理音乐的工具。你首先想到 iTunes,因为它是近几年最流行的音乐管理工具,但你马上会发现 iTunes 并没有 Linux 版本。而且,现在,你会发现还有比 iTunes 更好的音乐管理工具。 + +尽管如此,这并不意味着你就不能使用你喜欢的方式管理音乐。Linux 上有很多方式可以让你整理你的曲库。以下六种,仅供参考: + +### 通过WINE运行iTunes ### + +尽管 iTunes 没有Linux版,你还是可以试试 [使用 WINE 运行 iTunes ][1] 或 PlayOnLinux 的。这些软件给本来只能运行于Windows下的应用程序添加一个兼容层,这样就能让他们运行在Linux上了,但这样的方法效果十有分限。因此,[并非所有 Windows 应用程序都能使用WINE运行][2] - 但这还是一个值得尝试的方法。 + +各个版本的iTunes结果可能给你不同的结果,但一般都遵循以下方法: + +1. 安装WINE +2. 在WINE里运行iTunes安装程序 +3. 在网上搜索并解决你遇到的问题。 + +如果你在安装时遇到无法解决的问题,比如安装程序错误,或者安装好的程序运行不了,那是没办法的,WINE 就是这样。 + +如果你想在 WINE 上运行 iTunes 而且运气很好的跑起来了,那真是很棒。但如果你还想考虑运行一个原生的Linux应用,或者 WINE 不工作的话,还有很多其他选择的。有几个曲库管理软件能让你很方便的管理你的音乐并直接进行播放,还可以制作播放列表。 + +### [Amarok][3] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/amarok_main.jpg?35dc20) + +如果你使用KDE环境,我推荐 Amarok。它具有 [很多管理音乐的特性][4] 而且它还能与KDE桌面环境无缝兼容。它有很多实用的特性如集成了 Last.FM、文件跟踪、动态播放列表及脚本支持。它甚至会自动在你播放曲目时,自动下载艺术家封面。 + +### [Banshee][5] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/banshee_main.jpg?35dc20) + +如果你使用 GNOME 或其他任何基于 GTK 的桌面环境(它们十分常见)的话,我推荐使用使用Bansee作为 [全功能曲库管理工具][6] 。它的功能与Amarok类似,也集成了Last.FM,支持互联网广播,支持podcast等等。选择 Amarok 还是 Bansee 要看你使用的桌面环境(这样才能无缝整合)。 + +### [Rhythmbox][7] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/rhythmbox_main.jpg?35dc20) + +Rhythmbox是一个更好基于GTK的桌面环境的[轻量级的曲库替代品][8]。尽管如此,它也还是有一些自己的特性的。它也支持Last.FM,同时还能无缝播放并与其它如 Nautilus、XChat及Pidgin 等进行整合。 + +### [Clementine][9] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/clementine_main.jpg?35dc20) + +另一款叫 Clementine 的软件也值得我推荐,因为它的界面简洁、易用。它支持非常多的第三方服务例如Spotify,Digtal Imported 及Dropbox。Android系统上还有一款用作 Clementine 遥控的app。[Clementine是跨平台的][10] , 还支持Mac OS X 及 Windows。 + +这些程序都能很好的管理并播放你的音乐。唯一的问题是这些程序都不支持与 iOS 设备的整合, 而且目前Linux 上还没有程序能做到这一点。但 iOS 经过很多改进后,已经并不需要再连接到电脑了。 + +### [Google Play Music][11] ### + +![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/google_music.jpg?35dc20) + +最后,如果上面的那些程序还不能满足你的需求的话,你可以试试 Google Play Music。这个在线服务也可以用作播放音乐的曲库管理工具,但它还有几个额外的好处。你可以上传所有的音乐,并且在所有能上网的设备上获取这些音乐。这也意味着你不需要在电脑或者移动设备之间同步你的音乐(无论是 Android 还是 iOS 设备),因为你可以这些设备中使用Google Play Music。 如果你想要扩展你的曲库,你可以订阅 All Access 服务,但这并不是必须的。你不需要支付任何费用也可在你的曲库中储存20,000首 + +#### 靠,居然没有 Spotify ?! #### + +尽管 Spotify 也是一款管理和听音乐的方法,我不推荐它的唯一原因是它事实上并不让你管理你的音乐。你不能将曲目上传到 Spotify - 只能它们给你提供的曲目。尽管它们提供了很多,但口味未必一样。 + + +### 你还有其他选择 ### + +以上六个软件应该可以在给你带来类似 iTunes 的功能了。这些软件主要是能让你管理和播放你的曲库,但如果你还需要 iTunes 里的其他特性,其他Linux原生软件或许能满足这类需求。 + +**你通常在Linux上使用哪些音乐?**在下方评论与我们分享吧! + + +-------------------------------------------------------------------------------- + +via: http://www.makeuseof.com/tag/top-6-ways-get-itunes-experience-linux/ + +作者:[Danny Stieben][a] +译者:[KevinSJ](https://github.com/KevinSJ) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.makeuseof.com/tag/author/danny/ +[1]:http://www.makeuseof.com/tag/how-about-some-wine-with-your-linux/ +[2]:http://www.makeuseof.com/answers/does-wine-runs-all-windows-apps/ +[3]:https://amarok.kde.org/ +[4]:http://www.makeuseof.com/tag/control-music-amarok-linux/ +[5]:http://banshee.fm/ +[6]:http://www.makeuseof.com/tag/banshee-20-comprehensive-media-player-streamer-podcast-tool-linux/ +[7]:https://wiki.gnome.org/Apps/Rhythmbox +[8]:http://www.makeuseof.com/tag/play-manage-music-collection-rhythmbox-linux/ +[9]:https://www.clementine-player.org/ +[10]:http://www.makeuseof.com/tag/need-a-lightweight-music-player-without-sacrificing-features-clementine-cross-platform/ +[11]:http://music.google.com/ diff --git a/published/201506/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/published/201506/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md new file mode 100644 index 0000000000..db3aa23b6e --- /dev/null +++ b/published/201506/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md @@ -0,0 +1,149 @@ +Linux中7个用来浏览网页和下载文件的命令 +================================================================================ +上一篇文章中,我们提到了`rTorrent`、`wget`、`cURL`、`w3m`、`Elinks`等几个有用的工具,很多人回信说还有其它几个类似的工具也值得讨论,所以就有了这篇文章。如果错过了第一部分的讨论,可以通过下面的链接来回顾。 + +- [5 个基于Linux命令行的文件下载和网站浏览工具][1] + +这篇文章介绍了Linux下用于浏览网页和下载文件的其它几个命令行工具。 + +### 1. links ### + +Links是用C语言写的一个开源web浏览器,支持包括Linux、Windows、OS X和OS/2在内的所有主流平台。它提供了基于文本和图形界面两种版本。大多数标准的Linux发行版都默认包含了基于文本的版本。如果您的发行版中默认没有安装links,可以通过包管理工具进行安装。Elinks是links的一个衍生版本。 + + # apt-get install links + # yum install links + +安装完成后,您可以像下图中那样使用命令浏览任意网页。 + + # links www.tecmint.com + +在links中,可以使用键盘上的上下箭头键进行浏览。在超链接上按下右箭头会打开它,按下左箭头会返回到上一页面,按q键退出。 + +下图展示了如何使用links访问Tecmint的网站。 + +![](http://www.tecmint.com/wp-content/uploads/2015/04/links-browse-websites-terminal.gif) + +如何你想安装links的图形界面版本,可能需要从[http://links.twibright.com/download/][2]下载最新的版本(version 2.9)的源代码压缩包。 + +同样,也可以像下面那样使用wget下载安装。 + + # wget http://links.twibright.com/download/links-2.9.tar.gz + # tar -xvf links-2.9.tar.gz + # cd links-2.9 + # ./configure –enable-graphics + # make + # make install + +**注意**:links源代码的编译需要安装libpng, libjpeg, TIFF library, SVGAlib, XFree86, C Compiler 和 make这几个包。 + +### 2. links2 ### + +Links是Twibright实验室编写的web浏览器,而Links2是基于它的一个图形化版本。Links2支持鼠标点击,设计强调速度,不支持任何CSS,在一定程度上很好地支持了HTML和JavaScript。 + +通过下面的命令安装Links2。 + + # apt-get install links2 + # yum install links2 + +### 3. lynx ### + +lynx是一个基于文本的web浏览器,使用GNU GPLv2协议发布,用ISO C编写。lynx是一个可高度配置的web浏览器,是许多系统管理员的救世主,有最悠久的web浏览器之称,并且至今仍然处在积极开发中。 + +通过下面的命令安装lynx。 + + # apt-get install lynx + # yum install lynx + +安装完成后,可以像下图中那样使用这个命令浏览网页。 + + # lynx www.tecmint.com + +![](http://www.tecmint.com/wp-content/uploads/2015/04/lynx-commandline-web-browsing.gif) + +如果你想对links和lyns了解更多,可以访问下面的链接。 + +- [使用Lynx和Links命令浏览网页][3] + +### 4. youtube-dl ### + +youtube-dl是一个跨平台的应用,可以用来下载youtube和另外几个网站上的视频。它主要使用python开发,使用GNU GPL协议发布,并且超越了法律约束。(youtube不允许用户下载视频,因此使用youtube-dl可能会导致违法。使用该工具之前请您仔细阅读相关法律。) + +使用如下命令安装youtube-dl。 + + # apt-get install youtube-dl + # yum install youtube-dl + +安装完成后,可以用如下命令像图中那样从youtube网站下载视频。 + + # youtube-dl https://www.youtube.com/watch?v=ql4SEy_4xws + +![](http://www.tecmint.com/wp-content/uploads/2015/04/download-youtube-videos-from-terminal.gif) + +如果你想对youtube-dl了解更多,可以访问如下链接。 + +- [YouTube-DL – Linux下的youtube视频下载工具][4] + +### 5. fetch ### + +fetch是类unix系统下的一个检索URL的命令,支持许多选项,例如只检索ipv4或ipv6地址,无重定向,检索请求成功时退出,自动重试等。 + +fetch可以从通过下面的链接下载和安装。 + +- [http://sourceforge.net/projects/fetch/?source=typ_redirect][5] + +编译安装之前,需要安装HTTP Fetcher,可以通过下面的链接下载。 + +- [http://sourceforge.net/projects/http-fetcher/?source=typ_redirect][6] + +### 6. Axel ### + +Axel是Linux下的一个基于命令行的下载加速器,可以对请求使用多线程和多个http和ftp连接加速。 + +使用下面的命令安装Axel。 + + # apt-get install axel + # yum install axel + +Axel安装完成后,可以像下图那样使用这个命令下载任意文件。 + + # axel http://mirror.cse.iitk.ac.in/archlinux/iso/2015.04.01/archlinux-2015.04.01-dual.iso + +![](http://www.tecmint.com/wp-content/uploads/2015/04/download-accelarator-for-linux.gif) + +### 7. aria2 ### + +aria2是一个轻量级的基于命令行的下载工具,并且支持多种协议((HTTP, HTTPS, FTP, BitTorrent以及Metalink)。它可以使用.metalinks文件从多台服务器同时下载ISO文件。 + +使用下面的命令安装aria2。 + + # apt-get install aria2 + # yum install aria2 + +aria2安装完成后,可以像下图那样运行这个命令下载任意文件。 + + # aria2c http://cdimage.debian.org/debian-cd/7.8.0/multi-arch/iso-cd/debian-7.8.0-amd64-i386-netinst.iso + +![Aria2: Linux的命令行下载工具 ](http://www.tecmint.com/wp-content/uploads/2015/04/Download-Files-in-Terminal.gif) + +*Aria2: Linux命令行下载工具* + +目前就这么多了。稍后咱们讨论另一个有意思的话题。请保持联系,常来Tecmint逛逛。别忘了在评论中给我们提供您的宝贵反馈,您的喜爱和分享帮助我们不断前行。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/command-line-web-browser-download-file-in-linux/ + +作者:[Avishek Kumar][a] +译者:[fyh](https://github.com/fyh) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:https://linux.cn/article-5546-1.html +[2]:http://links.twibright.com/download/ +[3]:http://www.tecmint.com/command-line-web-browsers/ +[4]:http://www.tecmint.com/install-youtube-dl-command-line-video-download-tool/ +[5]:http://sourceforge.net/projects/fetch/?source=typ_redirect +[6]:http://sourceforge.net/projects/http-fetcher/?source=typ_redirect +[7]:http://www.tecmint.com/install-aria2-a-multi-protocol-command-line-download-manager-in-rhel-centos-fedora/ diff --git a/translated/tech/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md b/published/201506/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md similarity index 80% rename from translated/tech/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md rename to published/201506/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md index e115f85772..789a56688d 100644 --- a/translated/tech/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md +++ b/published/201506/20150413 How to Show Dialog Box from Bash Shell Script with Examples.md @@ -1,6 +1,7 @@ -如何在Bash Shell脚本中显示对话框以及事例 +如何在Bash Shell脚本中显示对话框 ================================================================================ -这个教程给出几个如何使用类似zenity和whiptail的工具在Bash Shell 脚本中提供消息/对话框的例子。使用这些工具,你的脚本能够告知用户当前程序运行的状态以及有与其交互的能力。这两个工具的不同之处在于显示消息框或者对话框的方式。Zenity用GTK工具包创建图形用户界面,而whiptail在终端内部创建消息框。 + +这个教程给出几个如何使用类似zenity和whiptail的工具在Bash Shell 脚本中提供消息/对话框的例子。使用这些工具,你的脚本能够告知用户当前程序运行的状态并能与用户进行交互。这两个工具的不同之处在于显示消息框或者对话框的方式。Zenity用GTK工具包创建图形用户界面,而whiptail则在终端窗口内创建消息框。 ### Zenity 工具 ### @@ -8,21 +9,21 @@ sudo apt-get install zenity -由于用zenity创建消息框或者对话框的命令是相当自解释的,我们会给你提供一些例子。 +用zenity创建消息框或者对话框的命令是不言自明的,我们会给你提供一些例子来参考。 ### 创建消息框 ### -zenity --info --title "Information Box" --text "This should be information" --width=300 --height=200 + zenity --info --title "Information Box" --text "This should be information" --width=300 --height=200 ![消息框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Information-Box.png) -创建 Yes/No 对话框 +创建 Yes/No 询问对话框 zenity --question --text "Do you want this?" --ok-label "Yeah" --cancel-label="Nope" ![问题截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-Question.png) -创建输入框并在变量中保存值 +创建输入框并将输入值保存到变量中 a=$(zenity --entry --title "Entry box" --text "Please enter the value" --width=300 --height=200) echo $a @@ -75,7 +76,7 @@ zenity --info --title "Information Box" --text "This should be information" --wi 信息框 -别忘了查看也许能帮助到你的有用的[zenity 选项][1] +别忘了查看也许能帮助到你的有用的[zenity 选项][1]。 ### Whiptail 工具 ### @@ -83,7 +84,7 @@ zenity --info --title "Information Box" --text "This should be information" --wi sudo apt-get install whiptail -用whiptail创建消息框或者对话框的命令也是相当自解释的,我们会给你提供一些基本例子。 +用whiptail创建消息框或者对话框的命令也是无需解释的,我们会给你提供一些基本例子作为参考。 ### 创建消息框 ### @@ -103,7 +104,7 @@ zenity --info --title "Information Box" --text "This should be information" --wi ![whiptail输入框截图](http://blog.linoxide.com/wp-content/uploads/2015/03/Screenshot-whiptail-entry.png) -尝试使用输入值要注意的一点是whiptail用stdout显示对话框,用stderr输出值。那样的话,如果你用 var=$(...),你不会看到对话框,也不能获得输入的值。解决方法是交换stdout和stderr。在whiptail命令后面添加 **3>&1 1>&2 2>&3** 就可以做到。你想获取输入值的任何whiptail命令也是如此。 +尝试使用输入值要注意的一点是whiptail用stdout显示对话框,用stderr输出值。这样的话,如果你用 var=$(...),你就根本不会看到对话框,也不能获得输入的值。解决方法是交换stdout和stderr。在whiptail命令后面添加 **3>&1 1>&2 2>&3** 就可以做到。你想获取输入值的任何whiptail命令也是如此。 ### 创建菜单对话框 ### @@ -157,7 +158,7 @@ zenity --info --title "Information Box" --text "This should be information" --wi ### 结论 ### -选择合适的工具显示对话框取决于你期望在桌面机器还是服务器上运行你的脚本。桌面机器用户通常使用窗口环境,更可能用显示的窗口运行脚本和交互。然而,如果你期望用户是在服务器上工作的,你也许会希望安全地显示,并使用whiptail或者任何其它在纯终端窗口显示对话框的工具。 +选择合适的工具显示对话框取决于你期望在桌面机器还是服务器上运行你的脚本。桌面机器用户通常使用GUI窗口环境,也可能运行脚本并与显示的窗口进行交互。然而,如果你期望用户是在服务器上工作的,(在没有图形界面时,)你也许希望能确保总能显示,那就使用whiptail或者任何其它在纯终端窗口显示对话框的工具。 -------------------------------------------------------------------------------- @@ -165,7 +166,7 @@ via: http://linoxide.com/linux-shell-script/bash-shell-script-show-dialog-box/ 作者:[Ilija Lazarevic][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/) 荣誉推出 diff --git a/published/201506/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md b/published/201506/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md new file mode 100644 index 0000000000..a0114d5382 --- /dev/null +++ b/published/201506/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md @@ -0,0 +1,176 @@ +如何使用图形化工具远程管理 Linux上的MySQL +================================================================================ +如果你在一个远程的VPS上运行了MySQL服务器,你会如何管理你的远程数据库主机呢?基于web的数据库管理工具例如[phpMyAdmin][2]或者[Adminer][3]可能会是你第一个想起的。这些基于web的管理工具需要一个正常运行的后端的web服务和PHP引擎。但是,如果你的VPS仅仅用来做数据库服务(例如,数据库与其它服务独立存放的分布式结构),为偶尔的数据库管理提供一整套的LAMP是浪费VPS资源的。更糟的是,LAMP所打开的HTTP端口可能会成为你VPS资源的安全漏洞。 + +作为一种选择,你可以使用在一台客户机上运行本地的MySQL客户端,当然,如果没有别的选择,一个纯净的MySQL命令行客户端将是你的默认选择。但是命令行客户端的功能是有限的,因为它没有生产级数据库管理功能,例如:可视化SQL开发、性能调优、模式验证等等。你是否在寻找一个成熟的MySQL管理工具,那么一个MySQL的图形化管理工具将会更好的满足你的需求。 + +###什么是MySQL Workbench? + +作为一个由Oracle开发的集成的数据库管理工具,[MySQL Workbench][4]不仅仅是一个简单的MySQL客户端。简而言之,Workbench是一个跨平台的(如:Linux,MacOX,Windows)数据库设计、开发和管理的图形化工具。MySQL Workbench 社区版是遵循GPL协议的。作为一个数据库管理者,你可以使用Workbench去配置MySQL服务、管理MySQL用户、进行数据库的备份与还原、监视数据库的健康状况,所有的都在对用户友好的图形化环境下处理。 + +在这个手册里,让我们演示下如何在Linux下安装和使用MySQL Workbench。 + +###在Linux上安装MySQL Workbench + +你可以在任何一个桌面linux机器上运行MySQL Workbench来设置你的数据库管理环境。虽然一些Linux发行版(例如:Debian/Ubuntu)在他们的软件源中已经有了MySQL Workbench,但是从官方源中安装是一个好的方法,因为他们提供了最新的版本。这里介绍了如何设置一个官方的Workbench软件源和从中安装它。 + +#### 基于 Debian 的桌面 (Debia, Ubuntu, Mint): #### + +到其[官方站点][5],选择一个和你环境匹配的DEB文件,并下载安装: + +例如,对于 Ubuntu 14.10: + + $ wget http://dev.mysql.com/get/mysql-apt-config_0.3.4-2ubuntu14.10_all.deb + $ sudo dpkg -i mysql-apt-config_0.3.4-2ubuntu14.10_all.deb + +对于 Debian 7: + + $ wget http://dev.mysql.com/get/mysql-apt-config_0.3.3-1debian7_all.deb + $ sudo dpkg -i mysql-apt-config_0.3.3-1debian7_all.deb + +当你安装DEB文件时,你会看到下面的配置菜单,并且选择配置那个MySQL产品 + +![](https://farm8.staticflickr.com/7702/16928715218_b1fcbcdbf3_c.jpg) + +选择“Utilities”。完成配置后,选择“Apply”去保存配置。然后,更新包索引,并且安装Workbench。 + + $ sudo apt-get update + $ sudo apt-get install mysql-workbench + +#### 基于 Red Hat 的桌面 (CentOS, Fedora, RHEL): #### + +去官网下载并安装适合你Linux环境的RPM源包。 + +例如,对于 CentOS 7: + + $ wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm + $ sudo yum localinstall mysql-community-release-el7-5.noarch.rpm + +对于 Fedora 21: + + $ wget http://dev.mysql.com/get/mysql-community-release-fc21-6.noarch.rpm + $ sudo yum localinstall mysql-community-release-fc21-6.noarch.rpm + +验证"MySQL Tools Community"源是否被安装: + + $ yum repolis enabled + +![](https://farm9.staticflickr.com/8826/16494069254_15458ace52_c.jpg) + +安装Workbench + + $ sudo yum install mysql-workbench-community + +###设置远程数据库的安全连接 + +接下来是为你运行MySQL服务的VPS设置一个远程连接。当然,你可以直接通过图形化的Workbench连接你的远程MySQL服务器(在数据库开放了远程连接后)。然而,这样做有很大的安全风险,因为有些人很容易窃听你的数据库传输信息,并且一个公开的MySQL端口(默认为3306)会是另外一个攻击入口。 + +一个比较好的方法是关掉远程访问数据库服务功能,(仅允许在VPS 上的127.0.0.1访问)。然后在本地客户机和远程VPS之间设置一个SSH隧道,这样的话,和MySQL之间的数据能安全地通过它的本地回环接口上中继。相比较设置一个SSL加密的连接来说,配置SSH隧道需要很少的操作,因为它仅仅需要SSH服务,并且在大多数的VPS上已经部署了。 + +让我们来看看如何来为一个MySQL Workbench设置一个SSH隧道。 + +在这个设置里,不需要你开放远程访问MySQL服务。 + +在一个运行了Workbench的本地客户机上,键入下面的命令,替换'user'(远程 VPS 的用户名)和'remote_vps'(远程 VPS 的地址)为你自己的信息: + + $ ssh user@remote_vps -L 3306:127.0.0.1:3306 -N + +你会被要求输入你VPS的SSH密码,当你成功登陆VPS后,在本地的3306端口和远程VPS的3306端口之间将会建立一个SSH隧道。这里你不会在前台看到任何信息显示。 + +或者你可以选择在后台运行SSH隧道,按CTRL+Z停止当前的命令,然后输入bg并且ENTER + +![](https://farm8.staticflickr.com/7714/16928715438_bf0db49b3b_c.jpg) + +这样SSH隧道就会在后台运行了。 + +###使用MySQL Workbench远程管理MySQL服务 + +在建立好SSH隧道后,你可以通过MySQL Workbench去远程连接MySQL服务了。 + +输入下面命令启动Workbench: + + $ mysql-workbench + +![](https://farm9.staticflickr.com/8768/16494069294_0fce571ddb_c.jpg) + +点击Workbench页面上面的“加号”图标去创建一个新的数据库连接,接着会出现下面的连接信息。 + +- **Connection Name**: 任意描述 (例如: My remote VPS database) +- **Hostname**: 127.0.0.1 +- **Port**: 3306 +- **Username**: MySQL 用户名 (例如 root) + +![](https://farm8.staticflickr.com/7727/16928715288_d9ac3bfc7a_c.jpg) + +注意:因为隧道设置的是127.0.0.1:3306,所以主机名字段必须是127.0.0.1,而不能是远程VPS的IP地址或者主机名。 + +当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。 + +![](https://farm8.staticflickr.com/7650/17114969532_0252ffcd31_c.jpg) + +当你登录到MySQL 服务器后,你可以再左侧面板看到各种管理任务。让我们来看一些常见的管理任务。 + +#### MySQL Server Status #### + +该菜单显示了展示数据库服务器的资源使用情况的实时监控面板。(例如:流量、链接、读写) + +![](https://farm8.staticflickr.com/7627/16494069414_9d838d4138_c.jpg) + +#### Client Connections #### + +客户端连接数是一个极其重要的监控的资源,这个菜单显示了每个连接的详细信息。 + +![](https://farm9.staticflickr.com/8747/16909119337_a8d89772dd_c.jpg) + +#### 用户和权限 #### + +这个菜单允许你管理MySQL用户,包括他们的资源限制和权限。 + +![](https://farm9.staticflickr.com/8765/16494069384_760fc17c8f_c.jpg) + +#### MySQL Server Administration #### + +你可以启动或关闭MySQL服务,并且检查它的服务日志。 + +![](https://farm8.staticflickr.com/7588/17114969592_54526dfb32_c.jpg) + +#### Database Schema Management #### + +可以可视化的查看、更改、检查数据库结构,在“Schemas”标题下选择任何一个数据库或表,然后右击 + +![](https://farm8.staticflickr.com/7665/16496363973_fd03a96198_c.jpg) + +![](https://farm9.staticflickr.com/8744/16909119497_7c884617b8_c.jpg) + +#### Database Query #### + +你可以执行任何的语句(只要你的权限允许),并且检查其结果。 + +![](https://farm8.staticflickr.com/7716/17114969692_c0f02bb277_c.jpg) + +此外,性能统计数据和报表仅用于MySQL5.6以上的版本。对于5.5及其以下的版本,性能部分会以灰色显示。 + +### 结论 ### + +简介且直观的选项卡界面,丰富的特性,开源,使MySQL Workbench成为一个非常好的可视化数据库设计和管理工具。为其减分的是它的性能。我注意到在一台运行繁忙的服务器上,Workbench有时会变得异常缓慢,尽管它的性能差强人意,我依然认为MySQL Workbench是MySQL数据库管理员和设计人员必备的工具之一。 + +你曾在你的生产环境中用过Workbench吗?或者你还有别的GUI工具可以推荐?请分享你的经验吧。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/remote-mysql-databases-gui-tool.html + +作者:[Dan Nanni][a] +译者:[tyzy313481929](https://github.com/tyzy313481929) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:http://xmodulo.com/author/nanni +[1]:http://xmodulo.com/go/digitalocean +[2]:http://ask.xmodulo.com/install-phpmyadmin-centos.html +[3]:http://xmodulo.com/set-web-based-database-management-system-adminer.html +[4]:http://mysqlworkbench.org/ +[5]:http://dev.mysql.com/downloads/repo/apt/ +[6]:http://dev.mysql.com/downloads/repo/yum/ +[7]:http://xmodulo.com/how-to-allow-remote-access-to-mysql.html diff --git a/translated/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md b/published/201506/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md similarity index 90% rename from translated/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md rename to published/201506/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md index e5f8f6bcc7..52ce998473 100644 --- a/translated/tech/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md +++ b/published/201506/20150413 Linux FAQs with Answers--How to compile ixgbe driver on CentOS, RHEL or Fedora.md @@ -1,17 +1,14 @@ -Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe - +Linux 有问必答: 如何在红帽系linux中编译Ixgbe驱动 ================================================================================ > **提问**:我想要安装最新版的ixgbe 10G网卡驱动。在CentOS, Fedora 或 RHEL中,我应该如何编译ixgbe驱动? +想要在linux使用Intel的PCI Express 10G网卡(例如,82598,82599,x540),需要安装Ixgbe驱动。如今的Linux发行版都会预安装ixgbe的可加载模块,但是预安装的ixgbe驱动不是完整功能版。如果想要开启和定制所有10G网卡的功能(如,RSS、多队列、虚拟化功能、硬件 offload 等),需要从源码编译安装。 -想要在linux使用Intel的PCI Express 10G网卡(例如,82598,82599,x540),需要安装Ixgbe驱动。如今的Linux发行版都会欲安装ixgbe作为可加载模块,但是预安装的ixgbe驱动不是完整功能版。如果想要开启和定制所有10G网卡(如,RSS,多)的功能,需要源码编译安装。 - -本文基于红帽系平台(如,CentOS,RHEL或Fedora)。Debian系系统,请看[这篇文章][1] - +本文基于红帽系平台(如,CentOS,RHEL或Fedora)。Debian系平台,请看[这篇文章][1] ### 第一步: 安装依赖 ### -首先,安装必要的开发环境和安装匹配的内核头 +首先,安装必要的开发环境和安装匹配的内核头文件 $ sudo yum install gcc make $ sudo yum install kernel-devel @@ -22,7 +19,7 @@ Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe $ wget http://downloads.sourceforge.net/project/e1000/ixgbe%20stable/3.23.2/ixgbe-3.23.2.tar.gz -确保检查支持内核版本。例如,Ixgbe3.23.2版本支持Linux内核版本2.6.18以上到3.18.1. +请检查支持的内核版本。例如,Ixgbe3.23.2版本支持Linux内核版本2.6.18到3.18.1。 提取压缩包并编译 @@ -30,7 +27,7 @@ Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe $ cd ixgbe-3.23.2/src $ make -如果成功,编译完成的驱动(ixgbe.ko)可以在当前目录找到。 +如果成功,可以在当前目录找到编译完成的驱动(ixgbe.ko)。 可以运行这个命令来查看编译信息: @@ -44,7 +41,7 @@ Linux 有问必答 -- 如何在红帽系linux中编译Ixgbe 这步准备加载已经编译好的驱动。 -如果系统已经加载了Ixgbe驱动,首先需要卸载掉老版本。否者,新版本不能够加载。 +如果系统已经加载了Ixgbe驱动,首先需要卸载掉老版本。否则,新版本不能加载。 $ sudo rmmod ixgbe.ko @@ -178,7 +175,7 @@ ixgbe.ko将会安装在下列目录 /lib/modules//kernel/drivers/net/ixgbe -此时,编译完蛋程序将在启动时自动加载,也可以通过运行命令加载它: +此时,编译好的驱动将在启动时自动加载,也可以通过运行命令加载它: $ sudo modprobe ixgbe @@ -190,10 +187,10 @@ via: http://ask.xmodulo.com/compile-ixgbe-driver-centos-rhel-fedora.html 作者:[Dan Nanni][a] 译者:[Vic020](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://ask.xmodulo.com/author/nanni -[1]:http://ask.xmodulo.com/download-install-ixgbe-driver-ubuntu-debian.html +[1]:https://linux.cn/article-5149-1.html [2]:http://sourceforge.net/projects/e1000/files/ixgbe%20stable/ diff --git a/published/201506/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md b/published/201506/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md new file mode 100644 index 0000000000..c7c2d21fa3 --- /dev/null +++ b/published/201506/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md @@ -0,0 +1,55 @@ +Linux有问必答:如何在虚拟机上配置PCI直通 +================================================================================ +> **提问**:我想要分配一块物理网卡到用KVM创建的虚拟机上。我打算为这台虚拟机启用网卡的PCI直通。请问,我如何才能在virt-manager里面通过PCI直通增加一个PCI设备到虚拟机上? + +如今的hypervisor能够高效地在多个虚拟操作系统间共享和模拟硬件资源。然而,虚拟资源共享不是总能使人满意,甚至在虚拟机性能是重点考量时,或者是虚拟机需要硬件DMA的完全控制时,应该避免共享。一项名叫“PCI直通”的技术可以用在一个虚拟机需要独享PCI设备时(例如:网卡、声卡、显卡)。本质上,PCI直通穿透了虚拟层,直接将PCI设备放到虚拟机里,而其他虚拟机则不能访问该设备。 + +### 开启“PCI直通”的准备 ### + +如果你想要为一台HVM实例开启PCI直通(例如,一台KVM创建的全虚拟化的虚拟机),你的母系统(包括CPU和主板)必须满足以下条件。如果你的虚拟机是半虚拟化的(由Xen创建),你可以跳过这步。 + +为了在 HVM虚拟机上开启PCI直通,系统需要支持**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]。 + +在确认你的设备支持VT-d/AMD-Vi后,还有两件事情需要做。首先,确保VT-d/AMD-Vi已经在BIOS中开启。然后,在内核启动过程中开启IOMMU。IOMMU服务,是由VT-d/AMD-Vi提供的,可以保护虚拟机访问的主机内存,同时它也是全虚拟化虚拟机支持PCI直通的前提。 + +Intel处理器中,通过将“**intel_iommu=on**传给内核启动参数来开启IOMMU。参看[这篇教程][2]了解如何通过GRUB修改内核启动参数。 + +配置完启动参数后,重启电脑。 + +### 添加PCI设备到虚拟机 ### + +我们已经完成了开启PCI直通的准备。事实上,只需通过virt-manager就可以给虚拟机分配一个PCI设备。 + +打开virt-manager的虚拟机设置,在左边工具栏点击‘增加硬件’按钮。 + +选择从PCI设备表一个PCI设备来分配,点击“完成”按钮 + +![](https://farm8.staticflickr.com/7587/17015584385_db49e96372_c.jpg) + +最后,启动实例。这样,主机的PCI设备已经可以由虚拟机直接访问了。 + +### 常见问题 ### + +在虚拟机启动时,如果你看见下列任何一个错误,这个错误有可能由于母机VT-d (或 IOMMU)未开启导致。 + + Error starting domain: unsupported configuration: host doesn't support passthrough of host PCI devices + +---------- + + Error starting domain: Unable to read from monitor: Connection reset by peer + +请确保"**intel_iommu=on**"启动参数已经按上文叙述开启。 + +-------------------------------------------------------------------------------- + +via: http://ask.xmodulo.com/pci-passthrough-virt-manager.html + +作者:[Dan Nanni][a] +译者:[Vic020/VicYu](http://vicyu.net) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[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 diff --git a/translated/tech/20150416 Linux Network Statistics Tools or Commands.md b/published/201506/20150416 Linux Network Statistics Tools or Commands.md similarity index 98% rename from translated/tech/20150416 Linux Network Statistics Tools or Commands.md rename to published/201506/20150416 Linux Network Statistics Tools or Commands.md index 1dcad55baf..e4ce5db81d 100644 --- a/translated/tech/20150416 Linux Network Statistics Tools or Commands.md +++ b/published/201506/20150416 Linux Network Statistics Tools or Commands.md @@ -72,7 +72,7 @@ Linux网络统计工具/命令 查看[ss 命令教程][1] 获取更多信息。 -### netstat 命令 : 显示套接字信息的旧的好工具 ### +### netstat 命令 : 不错的显示套接字信息的旧工具 ### 查看所有网络端口以及汇总信息表,输入: @@ -268,6 +268,7 @@ Linux网络统计工具/命令 ### sar 命令: 显示网络统计信息 ### 输入以下命令 (你需要 [通过sysstat包安装并启用sar][3]): + sar -n DEV Linux 2.6.32-220.2.1.el6.x86_64 (www.cyberciti.biz) Tuesday 13 March 2012 _x86_64_ (2 CPU) @@ -345,11 +346,11 @@ via: http://www.cyberciti.biz/faq/network-statistics-tools-rhel-centos-debian-li 作者:[nixCraft][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.cyberciti.biz/tips/about-us -[1]:http://www.cyberciti.biz/tips/linux-investigate-sockets-network-connections.html -[2]:http://www.cyberciti.biz/tips/netstat-command-tutorial-examples.html +[1]:https://linux.cn/article-4372-1.html +[2]:https://linux.cn/article-2434-1.html [3]:http://www.cyberciti.biz/tips/identifying-linux-bottlenecks-sar-graphs-with-ksar.html \ No newline at end of file diff --git a/translated/tech/20150417 How to Install Discourse in a Docker Container.md b/published/201506/20150417 How to Install Discourse in a Docker Container.md similarity index 54% rename from translated/tech/20150417 How to Install Discourse in a Docker Container.md rename to published/201506/20150417 How to Install Discourse in a Docker Container.md index e4dcf8f3c5..cb3351a77e 100644 --- a/translated/tech/20150417 How to Install Discourse in a Docker Container.md +++ b/published/201506/20150417 How to Install Discourse in a Docker Container.md @@ -1,8 +1,10 @@ 如何在一个Docker容器里安装Discourse ============================================================================= -大家好,今天我们将会学习如何利用Docker平台安装Discourse。Discourse是完全开源的讨论平台,为互联网的下一个十年而搭建,拥有一个邮件列表,一个论坛和一个long-form(此处不明白)聊天室。不管从技术角度还是社会学角度,当你试图去重新想象当今一个现代的,可持续的,完全开源的互联网讨论平台该是什么样子,Discourse都是一个不错的途径。Discourse简洁,直接之于讨论。它确实是一个令人称赞的平台,对于互联网上各种各样的讨论来说,提供了在机器之外如此酷的一个服务。Docker是一个开源平台,提供打包,运输和运行任何应用的平台,如一个轻量级容器。Docker容器技术使得Discourse更加方便和容易去建立应用程序。 +大家好,今天我们将会学习如何利用Docker平台安装Discourse。Discourse是一个完全开源的讨论平台,以未来十年的互联网理念设计,拥有一个邮件列表,一个论坛和一个长篇聊天室。不管从技术角度还是社会学角度,如今要体验一个现代的、勃勃生机的、完全开源的互联网讨论平台,Discourse都是一个不错的途径。Discourse是一个简单、简明、简易的讨论方式。它确实是一个令人称赞的平台,对于互联网上各种各样的论坛来说,提供了一个上手可用的很酷的服务。 -所以,下面是一些快速且容易的步骤,用来安装Discourse在一个Docker环境里面。 +Docker是一个开源的、可以将任何应用以轻量级容器的方式打包、传输和运行的开放平台。Docker容器技术使得可以更加方便和容易构建Discourse。 + +所以,下面是一些快速且容易的步骤,用来在一个Docker环境里面安装Discourse。 ### 1. 安装Docker ### @@ -16,7 +18,7 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap #### 在CentOS 7上 #### -在CentOS 7的主机上,我们使用yum管理器安装docker,因为CentOS的仓库里同样有docker安装包 +在CentOS 7的主机上,我们使用yum管理器安装docker,因为CentOS的仓库里同样有docker安装包 # yum install docker @@ -24,7 +26,7 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap ### 2. 设定交换内存 ### -如果你的RAM容量小于1GB,那么确保升级你的系统达到1GB或者以上,否则Discourse不会在512MB的RAM下安装。如果你现在准备好了安装Discourse,根据下面的步骤为你的VPS(Virtual Private Servers)或者服务器设定交换内存 +如果你的RAM容量小于1GB,那么确保升级你的系统达到1GB或者以上,Discourse不能在512MB的RAM下安装。如果你现在准备好了安装Discourse,根据下面的步骤为你的VPS(Virtual Private Servers)或者服务器设定交换内存: 运行下面的命令,创建一个空的交换文件。 @@ -34,7 +36,7 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap # dd if=/dev/zero of=/swapfile bs=1k count=1024k -如果你想达到2GB,跳过上面的所有步骤,跟着下面做 +如果你想达到2GB,跳过上一步,跟着下面做 # dd if=/dev/zero of=/swapfile bs=1k count=2014k @@ -50,14 +52,14 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap # echo "/swapfile swap swap auto 0 0" | sudo tee -a /etc/fstab -设置swappiness为10,这样交换内存仅作为一个紧急缓冲区用。 +设置swappiness参数为10,这样交换内存仅作为一个紧急缓冲区用。 # sudo sysctl -w vm.swappiness=10 # echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf ### 3. 安装Discourse ### -在我们的主机上安装Docker后,我们将会安装Discourse。现在,我们从官方的Discourse GitHub仓库克隆一份到/var/discourse目录下。我们需要运行下面的命令完成这一步。 +在我们的主机上安装好Docker后,我们将会安装Discourse。现在,我们从官方的Discourse GitHub仓库克隆一份到`/var/discourse`目录下。我们需要运行下面的命令完成这一步。 # mkdir /var/discourse/ @@ -65,7 +67,7 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap # git clone https://github.com/discourse/discourse_docker.git /var/discourse/ -克隆好仓库后,我们会为discourse服务器复制配置文件 +克隆好仓库后,我们给discourse服务器复制配置文件 # cp samples/standalone.yml containers/app.yml @@ -77,15 +79,15 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap # nano containers/app.yml -现在,我们需要设置开发者的邮箱地址为DISCOURSE_DEVELOPER_EMAILS,如下。 +现在,我们需要将开发者邮箱地址DISCOURSE_DEVELOPER_EMAILS修改为自己的,如下。 DISCOURSE_DEVELOPER_EMAILS: 'arun@linoxide.com' -然后,我们会设置主机名为服务器的域名。 +然后,我们设置主机名为服务器的域名。 DISCOURSE_HOSTNAME: 'discourse.linoxide.com' -接着,为每个托管在相同discourse主机或者vps上的SMTP服务器设定邮箱证书。SMTP设置需要从你的Discourse发送邮件 +接着,设置放在相同的discourse主机或vps上的SMTP服务器的认证信息。这些SMTP设置用于你的Discourse发送邮件。 DISCOURSE_SMTP_ADDRESS: smtp.linoxide.com DISCOURSE_SMTP_PORT: 587 # (optional) @@ -94,11 +96,9 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap ![](http://blog.linoxide.com/wp-content/uploads/2015/04/discourse-configuration.png) - Discourse 配置 - 如果你在使用一个1GB的Discourse,设定UNICORN_WORKERS为2,db_shared_buffers为128MB,这样你会有更多的内存空间。 -运行Discourse需要强制性地创建一个邮件服务器。如果你已经有一个服务器了那就好办多了,我们可以使用它的证书。如果你没有现成的邮件服务器,或者你不知道那是什么。没关系,创建一个免费的帐号在[Mandrill][1] ([Mailgun][2],或者[Mailjet][3]),然后使用面板上提供的证书。 +运行Discourse需要强制性地创建一个邮件服务器。如果你已经有一个服务器了那就好办多了,我们可以使用它的认证信息。如果你没有现成的邮件服务器,或者你不知道那是什么。没关系,可以在[Mandrill][1] (或[Mailgun][2]和 [Mailjet][3])创建一个免费的帐号,然后使用其提供的认证信息。 ### 5. 启动Discourse应用 ### @@ -110,35 +110,39 @@ docker安装包在Ubuntu的仓库里面是可用的,所以我们将会使用ap 上述命令可能会花去几分钟时间,会自动配置我们的Discourse环境。然后,该进程完成后,我们需要运行下面的命令启动Discourse App - #./launch start app + #./launcher start app ![Starting Discourse](http://blog.linoxide.com/wp-content/uploads/2015/04/starting-discourse.png) +如果一切都正常,我们就能使用惯用的浏览器来访问我们新鲜出炉的 Discourse 的 Web 界面了: http://ip-address/ or http://discourse.linoxide.com/ 。然后,我们就可以创建一个新账号并成为管理员。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/04/Discourse-web-interface.png) + ### 维护 ### -这里往下是/var/discourse/目录里加载命令的使用,这使得我们可以承担维护的任务,通过Docker 容器控制Disourse。(这里不太明白原文表达意思) +这里往下是/var/discourse/目录里的 launcher 命令的用法,它可以用于我们在Docker 容器里面控制和维护Disourse。 - Usage: launcher COMMAND CONFIG [--skip-prereqs] - Commands: - start: Start/initialize a container - stop: Stop a running container - restart: Restart a container - destroy: Stop and remove a container - enter: Use nsenter to enter a container - ssh: Start a bash shell in a running container - logs: Docker logs for container - mailtest: Test the mail settings in a container - bootstrap: Bootstrap a container for the config based on a template - rebuild: Rebuild a container (destroy old, bootstrap, start new) - cleanup: Remove all containers that have stopped for > 24 hours + 用法: launcher 命令 配置 [--skip-prereqs] + 命令: + start: 启动/初始化一个容器 + stop: 停止一个运行的容器 + restart: 重启一个容器 + destroy:停止并删除一个容器 + enter: 使用 nsenter 进入容器 + ssh: 在一个运行的容器中启动一个 bash shell + logs: 容器的 Docker l日志 + mailtest: 在容器中测试邮件设置 + bootstrap: 基于配置模版来引导一个容器 + rebuild: 重建一个容器(摧毁旧的,初始化,启动新的) + cleanup: 清理所有停止了24小时以上的容器 - Options: - --skip-prereqs Don't check prerequisites - --docker-args Extra arguments to pass when running docker + 选项: + --skip-prereqs 不检查前置需求 + --docker-args 当运行 docker 时,展开并传入参数 ### 总结 ### -Hurray!我们已经成功使用Docker技术安装了Discourse。Docker技术使得Discourse十分容易安装在任何平台,并且包含所有的要求。我们需要自己的邮件服务器或者邮件服务器的证书来启动它。对于便捷的现代邮件列表,论坛来说,Discourse是一个伟大的平台。(最后这句有些别扭) +哈哈!我们已经成功使用Docker技术安装了Discourse。Docker技术使得Discourse十分容易安装在任何平台,并且包含所有的要求。我们需要自己的邮件服务器或者邮件服务器的证书来启动它。对于便捷的现代邮件列表,论坛来说,Discourse是一个伟大的平台。(最后这句有些别扭) -------------------------------------------------------------------------------- @@ -146,7 +150,7 @@ via: http://linoxide.com/how-tos/install-discourse-docker-container/ 作者:[Arun Pyasi][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/) 荣誉推出 diff --git a/translated/tech/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md b/published/201506/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md similarity index 85% rename from translated/tech/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md rename to published/201506/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md index 0aaef749c8..052103ddda 100644 --- a/translated/tech/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md +++ b/published/201506/20150420 Managing file and directory attributes in linux using chattr and lsattr command.md @@ -1,11 +1,11 @@ 在Linux中用chattr和lsattr命令管理文件和目录属性 ================================================================================ -为了允许添加数据,防止更改或者删除等,文件和文件夹中设定了一定的控制属性。例如,你可以在关键系统文件或者文件夹中启用属性,然后没有用户,包括root,可以删除或者修改它,不允许比如dump命令等备份工具去备份一个特定的文件或者文件夹,等等。这些属性只可以在ext2,ext3或者ext4文件系统中的文件和文件夹上设定。 +为了允许添加数据,防止更改或者删除等,文件和文件夹可以设定了特定的控制属性。例如,你可以在关键的系统文件或者文件夹中启用属性,然后没有任何用户,包括root,可以删除或者修改它,比如不允许使用像dump这样的命令等备份工具去备份一个特定的文件或者文件夹,等等。这些属性只可以在ext2,ext3或者ext4文件系统中的文件和文件夹上设定。 有两个命令 **lsattr** 和 **chattr** 用来管理属性。下面是常用属性的列表。 注:表格代码 - +
@@ -63,7 +63,7 @@

e (extent format)

@@ -71,7 +71,7 @@

i (immutable)

@@ -96,14 +96,14 @@ chattr属性中可以使用的不同选项 : - **-R** 递归地修改文件夹和子文件夹的属性 -- **-V** chattr命令的输出伴随版本信息 -- **-f** 压缩大部分错误信息 +- **-V** chattr命令会输出带有版本信息的冗余信息 +- **-f** 忽略大部分错误信息 在chattr中用于设置或者取消属性的 **操作符** -- ‘+’ 符号用来为文件和文件夹设置属性, -- ‘-‘ 符号用来移除或者取消属性 -- ‘=’ 使它们成为文件有的唯一属性。 +- '+' 符号用来为文件和文件夹设置属性, +- '-' 符号用来移除或者取消属性 +- '=' 使它们成为文件有的唯一属性。 **chattr** 和 **lsattr** 命令的基本语法 : @@ -120,7 +120,7 @@ chattr属性中可以使用的不同选项 : 现在试着删除或者修改文件 [root@linuxtechi ~]# rm -f dummy_data - rm: cannot remove ‘dummy_data’: Operation not permitted + rm: cannot remove 'dummy_data': Operation not permitted [root@linuxtechi ~]# echo "test" >> dummy_data -bash: dummy_data: Permission denied @@ -193,7 +193,7 @@ via: http://www.linuxtechi.com/file-directory-attributes-in-linux-using-chattr-l 作者:[Pradeep 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/) 荣誉推出 diff --git a/translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md b/published/201506/20150423 20 Awesome Docker Containers for a Desktop User.md similarity index 68% rename from translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md rename to published/201506/20150423 20 Awesome Docker Containers for a Desktop User.md index 055c1eb9b5..a0ef45f433 100644 --- a/translated/tech/20150423 20 Awesome Docker Containers for a Desktop User.md +++ b/published/201506/20150423 20 Awesome Docker Containers for a Desktop User.md @@ -1,12 +1,13 @@ -20个为桌面用户准备的令人惊叹的Docker容器 +20个令人惊叹的桌面Docker容器 ================================================================================ -大家好,今天我们会列出一些很棒的运行在Docker容器中的桌面软件,我们可以在自己的桌面系统中运行它们。Docker是一个开源的项目,它提供可以将应用程序作为一个轻量级容器来打包、传送和运行的开放平台。它没有语言支持、框架或打包系统的限制,可以运行在任何地方,从小型的家用电脑到高端的服务器。它可以使部署和扩展web应用程序、数据库和后端服务像搭积木一样容易,而不依赖特定技术栈或提供商。它主要是由开发、运维工程师使用的,因为它简单、快速和方便,可以用来测试和辅助开发他们产品,但是我们也可以在桌面环境使用Docker,这样一些桌面程序可以开箱即用。 + +大家好,今天我们会列出一些运行在Docker容器中的很棒的桌面软件,我们可以在自己的桌面系统中运行它们。Docker 是一个开源项目,提供了一个可以打包、装载和运行任何应用的轻量级容器的开放平台。它没有语言支持、框架和打包系统的限制,从小型的家用电脑到高端服务器,在何时何地都可以运行。它可以使部署和扩展web应用程序、数据库和后端服务像搭积木一样容易,而不依赖特定技术栈或提供商。它主要是由开发、运维工程师使用的,因为它简单、快速和方便,可以用来测试和辅助开发他们产品,但是我们也可以在桌面环境使用Docker,这样一些桌面程序可以开箱即用。 下边是20个非常棒的桌面软件docker镜像,我们可以使用Docker来运行。 ### 1. Lynx ### -Lynx是一个一直以来最受欢迎的文本界面网页浏览器,它对多数Linux用户来说都很熟悉。它应该是现在还在日常和开发环境中被使用的最古老的网页浏览器了。可以使用如下命令运行Lync。 +Lynx是一个一直以来最受欢迎的文本界面网页浏览器,很多Linux用户都很熟悉它。它应该是现在还在日常和开发环境中被使用的最古老的网页浏览器了。可以使用如下命令运行Lync。 $ docker run -it \ --name lynx \ @@ -39,7 +40,7 @@ Chrome是一个令人惊叹的图形界面网页浏览器,由Google开发, ### 4. Tor浏览器 ### -Tor浏览器是一个支持匿名访问的网页浏览器。它让我们可以自由地在网络世界遨游,或者浏览被特定组织或者网络服务提供商封锁的网站。它会阻止有人通过监视我们的网络连接来窃取我们在网络上的一举一动以及我们的确切位置。运行如下命令运行Tor浏览器。 +Tor浏览器是一个支持匿名访问的网页浏览器。它让我们可以自由地在网络世界遨游,或者浏览被特定组织或者网络服务提供商封锁的网站。它会阻止别人通过监视我们的网络连接来窃取我们在网络上的一举一动以及我们的确切位置。运行如下命令运行Tor浏览器。 $ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix \ @@ -50,7 +51,7 @@ Tor浏览器是一个支持匿名访问的网页浏览器。它让我们可以 ### 5. Firefox浏览器 ### -Firefox浏览器是一个自由并且开源的网页浏览器,它由Mozilla基金会开发。它使用Gecko和SpiderMonkey引擎。Firefox浏览器有很多新特性,并且它以性能和安全性著称。 +Firefox浏览器是一个自由开源的网页浏览器,它由Mozilla基金会开发。它使用Gecko和SpiderMonkey引擎。Firefox浏览器有很多新特性,并且它以性能和安全性著称。 $ docker run -d \ --name firefox \ @@ -71,12 +72,12 @@ Rainbow Stream是一个文本界面的Twitter客户端,有实时显示tweetstr ### 7. Gparted ### -Gparted是一个用来给磁盘分区的开源软件。现在可以在Docker容器里享受分区的乐趣。可以使用如下命令运行gparted。 +Gparted是一个用来给磁盘分区的开源软件。现在可以在Docker容器里享受分区的乐趣了。可以使用如下命令运行gparted。 $ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e DISPLAY=unix$DISPLAY \ - --device /dev/sda:/dev/sda \ # mount the device to partition + --device /dev/sda:/dev/sda \ # 将设备挂载为分区 --name gparted \ jess/gparted @@ -91,7 +92,7 @@ GIMP(Gnu Image Manipulation Program)是一个令人惊叹的Linux图片编 ### 9. Thunderbird ### -Thunderbird是一个自由并且开源的电子邮件软件,它由Mozilla基金会开发和维护。它有众多一个电子邮件软件应该具有的功能。Thunderbird非常易于安装和定制。使用如下命令在Docker中运行Thunderbird。 +Thunderbird是一个自由开源的电子邮件软件,它由Mozilla基金会开发和维护。它有众多一个电子邮件软件应该具有的功能。Thunderbird非常易于安装和定制。使用如下命令在Docker中运行Thunderbird。 $ docker run -d \ -e DISPLAY \ @@ -102,7 +103,7 @@ Thunderbird是一个自由并且开源的电子邮件软件,它由Mozilla基 ### 10. Mutt ### -Mutt是一个文本界面的电子邮件客户端,有很多很酷的功能,如颜色支持,IMAP、POP3、SMTP支持,邮件存储支持等。 使用如下命令运行Mutt。 +Mutt是一个文本界面的电子邮件客户端,有很多很酷的功能,如彩色支持,IMAP、POP3、SMTP支持,邮件存储支持等。 使用如下命令运行Mutt。 $ docker run -it \ -v /etc/localtime:/etc/localtime \ @@ -114,7 +115,7 @@ Mutt是一个文本界面的电子邮件客户端,有很多很酷的功能, ### 11. Skype ### -Skype是一个支持文字、语音和视频的即时通讯软件,它不是开源的,但在Linux下可以很棒地运行。我们同样可以在Docker中运行Skype,使用如下命令。 +Skype是一个支持文字、语音和视频的即时通讯软件,它不是开源的,但在Linux下可以运行的很好。我们同样可以在Docker中运行Skype,使用如下命令。 $ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix:ro \ @@ -124,7 +125,7 @@ Skype是一个支持文字、语音和视频的即时通讯软件,它不是开 ### 12. Cathode ### -Cathode是一个漂亮并且高度可定制的终端模拟器,灵感来自经典的计算机。使用如下命令运行Cathode。 +Cathode是一个漂亮并且高度可定制的终端模拟器,灵感来自古典计算机。使用如下命令运行Cathode。 $ docker run -it \ -v /tmp/.X11-unix:/tmp/.X11-unix \ @@ -134,7 +135,8 @@ Cathode是一个漂亮并且高度可定制的终端模拟器,灵感来自经 ### 13. LibreOffice ### -LibreOffice是一个功能强大的办公套件,它是自由和开源的,现在由The Document基金会维护。它有干净的界面和强大的功能,让我们释放创造力和提升生产力。LibreOffice将数个应用程序集成在一起,是市面上最强大的自由并且开源的办公套件。 +LibreOffice是一个功能强大的办公套件,它是自由开源的,现在由The Document基金会维护。它有干净的界面和强大的功能,让我们释放创造力和提升生产力。LibreOffice将数个应用程序集成在一起,是市面上最强大的自由并且开源的办公套件。 + $docker run \ -v $HOME/Documents:/home/libreoffice/Documents:rw \ -v /tmp/.X11-unix:/tmp/.X11-unix \ @@ -155,7 +157,7 @@ Spotify可以即时访问数百万的歌曲,从经典老歌到最新单曲。 ### 15. Audacity ### -Audacity是一个自由并且开源的跨平台软件,用来录制和编辑音频。Audacity可以用来做所有类型音频(例如podcast)的后期处理,如归一化、调整、淡入淡出。使用如下命令来运行Audacity。 +Audacity是一个自由开源的跨平台软件,用来录制和编辑音频。Audacity可以用来做所有类型音频(例如podcast)的后期处理,如归一化、调整、淡入淡出。使用如下命令来运行Audacity。 $ docker run --rm \ -u $(id -u):$(id -g) \ @@ -178,7 +180,7 @@ Eclipse是一个集成开发环境。它包含基本的工作区和用来定制 ### 17. VLC媒体播放器 ### -VLC是一个自由并且开源的跨平台多媒体播放器,可以播放本地文件、DVD、CD、VCD和各种流媒体。VLC由VideoLAN组织开发和维护。使用如下命令运行VLC。 +VLC是一个自由开源的跨平台多媒体播放器,可以播放本地文件、DVD、CD、VCD和各种流媒体。VLC由VideoLAN组织开发和维护。使用如下命令运行VLC。 $ docker run -v\ $HOME/Documents:/home/vlc/Documents:rw \ @@ -196,7 +198,7 @@ Vim是一个高度可配置的文本界面文字编辑器,为高效的文本 ### 19. Inkscape ### -Inkscape是一个自由并且开源的矢量图形编辑器。它可以创建、编辑矢量图形,如插图、图示、线条艺术、图表、徽标以及更复杂的绘画。Inkscape使用的主要矢量图形格式是SVG 1.1版本。它也可以导入和导出一些其他的格式,但实际编辑使用的还是SVG格式。 +Inkscape是一个自由开源的矢量图形编辑器。它可以创建、编辑矢量图形,如插图、图示、线条艺术、图表、徽标以及更复杂的绘画。Inkscape使用的主要矢量图形格式是SVG 1.1版本。它也可以导入和导出一些其他的格式,但实际编辑使用的还是SVG格式。 $docker build -t rasch/inkscape --rm . $ docker run --rm -e DISPLAY \ @@ -207,7 +209,7 @@ Inkscape是一个自由并且开源的矢量图形编辑器。它可以创建、 ### 20. Filezilla ### -Filezilla是一个自由的FTP解决方案,支持FTP、SFTP、FTPS协议。它的客户端是一个功能强大的文件管理工具。它是一个很棒的高度可靠和易用的开源FTP解决方案。 +Filezilla是一个免费的FTP解决方案,支持FTP、SFTP、FTPS协议。它的客户端是一个功能强大的文件管理工具。它是一个很棒的高度可靠和易用的开源FTP解决方案。 $ xhost +si:localuser:$(whoami) $ docker run \ @@ -229,7 +231,7 @@ via: http://linoxide.com/how-tos/20-docker-containers-desktop-user/ 作者:[Arun Pyasi][a] 译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md b/published/201506/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md similarity index 70% rename from translated/tech/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md rename to published/201506/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md index a8ba20fff0..0b141dcf33 100644 --- a/translated/tech/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md +++ b/published/201506/20150423 How IP forwarding Helps Connecting Private interface to Internet in Linux.md @@ -1,12 +1,13 @@ -Linux 上IP转发如何帮助专用接口连接到互联网 +如何在 Linux 上用 IP转发使内部网络连接到互联网 ================================================================================ -大家好,今天我们学习一下在 Linux 上用 iptables 实现从一个网络接口到另一个接口的IP转发或者数据包转发。IP转发的概念是,使 Linux 机器像路由器一样将数据从一个网络发送到另一个网络。所以,它能作为一个**路由器**或者代理服务器,实现从一个连接到多个客户端机器的共享互联网或者网络连接。 + +大家好,今天我们学习一下在 Linux 上用 iptables 实现从一个网络接口到另一个接口的IP转发(数据包转发)。IP转发的概念是,使 Linux 机器像路由器一样将数据从一个网络发送到另一个网络。所以,它能作为一个**路由器**或者代理服务器,实现将一个连接的互联网或者网络连接共享给多个客户端机器。 这是一些启用IP转发或网络包转发方法的简单步骤。 ### 1. 启用 IPv4 转发 ### -首先,我们打算在我们的 Linux 操作系统上启用 IPv4 转发。要做到这点,我们需要用 sudo 模式在 shell 或终端下执行下面的命令。 +首先,我们需要在我们的 Linux 操作系统上启用 IPv4 转发。要做到这点,我们需要用 sudo 模式在 shell 或终端下执行下面的命令。 $ sudo -s @@ -14,7 +15,7 @@ Linux 上IP转发如何帮助专用接口连接到互联网 ![临时IP转发](http://blog.linoxide.com/wp-content/uploads/2015/03/ip-forward-temporary.png) -**注意:上面的命令能马上启用ip转发,但只是临时的,直到下一次重启。要永久启用,我们需要使用我们喜欢的文本编辑器打开 /etc/sysctl.conf 文件。** +**注意:上面的命令能马上启用ip转发,但只是临时的,直到下一次重启。要永久启用,我们需要使用我们惯用的文本编辑器打开 /etc/sysctl.conf 文件。** # nano /etc/sysctl.conf @@ -38,13 +39,13 @@ Linux 上IP转发如何帮助专用接口连接到互联网 ![Ifconfig](http://blog.linoxide.com/wp-content/uploads/2015/03/ifconfig.png) -这里,在我们的机器中, eth2 是连接到互联网或者网络的网卡接口, wlan2 是我们要使用 iptables 从 eth2 转发数据包的接口。要做到这点,我们需要运行以下命令。 +这里,在我们的机器中, eth2 是连接到互联网或者网络的网卡接口, wlan2 是我们要使用 iptables 从 eth2 转发数据包的接口。要实现转发,我们需要运行以下命令。 # iptables -A FORWARD -i wlan2 -o eth2 -j ACCEPT 注意:请用你 Linux 机器中的可用设备名称替换 wlan2 和 eth2。 -现在,由于网络过滤器是一个无状态的防火墙,我们要用 iptables 允许已建立的连接通过。要做到这点,我们要运行下面的命令。 +现在,由于netfilter/iptables是一个无状态的防火墙,我们需要让 iptables 允许已建立的连接通过。要做到这点,我们要运行下面的命令。 # iptables -A FORWARD -i eth2 -o wlan2 -m state --state ESTABLISHED,RELATED -j ACCEPT @@ -60,7 +61,7 @@ Linux 上IP转发如何帮助专用接口连接到互联网 ### 总结 ### -最后,用安装的 iptables 作为防火墙解决方案,我们在我们的 Linux 机器上成功的配置了从一个接口到另一个接口的数据包转发。这篇文章允许你的专用接口连接到互联网,你不需要桥接接口,而是路由从一个接口进来的数据包到另一个接口,就是这些。如果你有任何问题、建议、反馈,请写到下面的评论框中,然后我们可以改进或更新我们的内容。非常感谢!享受吧 :-) +最后,我们在我们以 iptables 作为防火墙 Linux 机器上成功的配置了从一个接口到另一个接口的数据包转发。这篇文章教给你将你的私有接口连接到互联网,不需要桥接接口,而是将从一个接口进来的数据包路由到另一个接口。就是这些,如果你有任何问题、建议、反馈,请写到下面的评论框中,然后我们可以改进或更新我们的内容。非常感谢!享受吧 :-) -------------------------------------------------------------------------------- @@ -68,7 +69,7 @@ via: http://linoxide.com/firewall/ip-forwarding-connecting-private-interface-int 作者:[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/) 荣誉推出 diff --git a/translated/tech/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md b/published/201506/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md similarity index 75% rename from translated/tech/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md rename to published/201506/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md index 5e7413e37d..958ce87fae 100644 --- a/translated/tech/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md +++ b/published/201506/20150423 How to Change Default Web Browser and Email Client in Ubuntu.md @@ -4,19 +4,17 @@ Ubuntu 自带了一些已经预装的默认应用程序,包括非常流行的 ![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/web-browser.png) -尽管这两个应用都有它们自己的粉丝,但是没有一个应用能符合每个人的口味和需要。我们经常收到邮件或者推文,询问我们怎样可以在 Ubuntu 上更改默认浏览器或者设置处理邮件链接的不同的电子邮件客户端等。 +尽管这两个应用都有它们自己的粉丝,但是没有一个应用能符合每个人的口味和需要。我们经常收到邮件或者推文,询问我们可以怎样在 Ubuntu 上更改默认浏览器或者设置处理邮件链接为不同的电子邮件客户端等。 -我们在这里不仅讨论如何安装不同的软件,还包括如何给一个特定的文件,链接或者内容类型设置系统处理应用。 +我们在这里不仅讨论如何安装不同的软件,还包括如何给一个特定的文件,链接或者内容类型设置其系统处理应用。 在 Ubuntu 中更改默认应用程序,包括浏览器、电子邮件客户端、文本编辑器、音乐和视频播放器都非常的简单。但并不是每个人都知道更改这些的设置面板在哪里,让我们来快速看一下吧。 ### 如何在 Ubuntu 上更改默认浏览器 ### -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/change-default-browser-in-ubuntu-750x402.jpg) +Mozilla 火狐浏览器是一扇稳定、开源而且可靠的互联网之窗,但它并不是每个人的选择。这都没关系。 -Mozilla 火狐浏览器是万维网上稳定、开源而且可依赖的窗口,但它并不是每个人的选择。这都没关系。 - -在 Ubuntu 上使用不同的默认浏览器,首先,显而易见,你需要安装一个新的浏览器。你该怎么做取决于你想要的浏览器: +要在 Ubuntu 上使用不同的默认浏览器,首先,显而易见,你需要安装一个新的浏览器。你该怎么做取决于你想要的浏览器: - 开源浏览器,例如 [Epiphany][1], [Chromium][2] 和 [IceWeasel][3],可以从 Ubuntu 软件中心安装。 @@ -24,9 +22,9 @@ Mozilla 火狐浏览器是万维网上稳定、开源而且可依赖的窗口, 不管你选择哪个浏览器,不管你选择怎样安装,完成之后你就可以继续了。 -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/system-settings-ubuntu-300x215.jpg) +要更改在点击其它应用(如即时通讯软件、Twitter 客户端、 e-mail 中)中的链接时打开的默认网页浏览器,你需要用到 Ubuntu 系统设置工具。 -点击其它应用上的链接,例如及时通讯软件、Twitter 客户端、 e-mail,要更改打开网页的默认浏览器,你需要用到 Ubuntu 系统设置工具。 +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/system-settings-ubuntu-300x215.jpg) 你可以用多种方法打开系统设置。其中一种最快的方式是点击右上角(RTL系统是左上角)的 Cog 图标并选择‘系统设置’菜单快捷方式。 @@ -35,25 +33,27 @@ Mozilla 火狐浏览器是万维网上稳定、开源而且可依赖的窗口, 1. 在侧边栏选择‘默认应用程序’ 1. 把 ‘Web’ 条目的 ‘火狐’ 改为你想要的选项 +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/change-default-browser-in-ubuntu-750x402.jpg) + 就是这样。 ### 如何在 Ubuntu 上更改默认的邮件客户端 ### -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/CHANGE-DEFAULT-APPS-UBUNTU.jpg) - -Ubuntu 用 Thunderbird 作为默认的邮件应用程序。这意味着 当你点击大部分浏览器、 PDF文件、及时通讯软件等上的 **电子邮件地址或者一个 [mailto 链接][7] 的时候会自动打开** 这个应用。 +Ubuntu 用 Thunderbird 作为默认的邮件应用程序。这意味着当你点击大部分浏览器、 PDF文件、及时通讯软件等上的 **电子邮件地址或者一个 [mailto 链接][7] 的时候会自动打开** 这个应用。 当然,如果你使用 Thunderbird,这真的很方便。但是我们很多人并非如此; 我们可能**[使用像 Geary 这样的轻量级客户端][8]**,GNOME stalwart Evolution,或者依靠像 Gmail 或者 Outlook 这样的网络邮件服务。 在 Ubuntu 上从 Thunderbird **更改默认邮件客户端** 到另一个应用程序,打开系统设置 > 详细 > 默认应用程序。点击下拉菜单到 ‘Mail’ 并选择从列表中选择你喜欢的客户端。 -**在 Ubuntu 上设置 Gmail 为默认的邮件客户端**,你首先需要点击下面的按钮安装 ‘gnome-gmail’ 软件包。安装完后打开系统设置 > 详细 > 默认应用程序。点击下拉菜单到 ‘Mail’ 并选择从列表中选择 ‘Gmail’。 +**在 Ubuntu 上设置 Gmail 为默认的邮件客户端**,你首先需要点击下面的按钮安装 ‘gnome-gmail’ 软件包。安装完后打开系统设置 > 详细 > 默认应用程序。然后点击‘Mail’ 的下拉菜单,并选择从列表中选择 ‘Gmail’。 + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/CHANGE-DEFAULT-APPS-UBUNTU.jpg) - [在 Ubuntu 上安装 GNOME Gmail][9] ### 更多 ### -上述同样的步骤可以用来设置你双击音乐文件时打开你喜欢的音乐播放器,用比如 VLC 应用程序处理 .avi 和 .mp4 文件,等等。 +上述同样的步骤也可以用来设置你双击音乐文件时打开你喜欢的音乐播放器,用比如 VLC 应用程序处理 .avi 和 .mp4 文件,等等。 -------------------------------------------------------------------------------- @@ -61,7 +61,7 @@ via: http://www.omgubuntu.co.uk/2015/04/change-your-default-web-browser-in-ubunt 作者:[Joey-Elijah Sneddon][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/) 荣誉推出 @@ -73,5 +73,5 @@ via: http://www.omgubuntu.co.uk/2015/04/change-your-default-web-browser-in-ubunt [5]:http://www.opera.com/computer/linux [6]:https://vivaldi.com/#Download [7]:http://en.wikipedia.org/wiki/Mailto -[8]:http://www.omgubuntu.co.uk/2015/03/install-geary-ubuntu-linux-email-update +[8]:https://linux.cn/article-5511-1.html [9]:apt://gnome-gmail \ No newline at end of file diff --git a/translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md b/published/201506/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md similarity index 71% rename from translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md rename to published/201506/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md index e806e8e436..de0f973cc8 100644 --- a/translated/tech/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md +++ b/published/201506/20150427 15 Things to Do After Installing Ubuntu 15.04 Desktop.md @@ -1,74 +1,87 @@ 安装完Ubuntu 15.04桌面后要做的15件事 ================================================================================ -本教程适用于新手和在自己的电脑上安装好Ubuntu 15.04 “Vivid Vervet” 桌面之后为了自定义自己的系统并安装一些基本程序作为日常使用的已经做了一些准备的人。 +本教程适用于在自己的电脑上安装了 Ubuntu 15.04 “Vivid Vervet” 桌面的新手,这里会告诉你安装之后应该做哪些事情,来自定义你的系统和安装一些基本程序作为日常使用。 ![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) -安装完Ubuntu 15.04桌面后要做的15件事 + +*安装完Ubuntu 15.04桌面后要做的15件事* ### 1. 启用Ubuntu额外软件库并更新系统 ### -在刚装好Ubuntu之后你应该要关心的第一件事是启用官方合作伙伴提供的Ubuntu额外软件库并且通过最近一次的安全补丁和软件更新来保持系统是最新状态。 +在刚装好Ubuntu之后你应该要关心的第一件事是启用Canonical的官方合作伙伴提供的Ubuntu额外软件库,并且通过最近一次的安全补丁和软件更新来保持系统是最新状态。 -要完成这一步,依次从左边菜单中打开System Settings -> Software and Updates工具并检查所有Ubuntu软件和其他软件库(官方合作伙伴所提供),点击关闭按钮并等待重新加载缓存源树。 +要完成这一步,依次从左边菜单中打开System Settings -> Software and Updates工具,并检查所有Ubuntu软件和其他软件库(Canonical 的合作伙伴所提供),点击关闭按钮并等待重新加载缓存源树。 ![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) -经过一系列快速平滑的更新过程之后,打开终端并输入以下命令来让系统使用新软件库: +*其它软件(Canonical 合作伙伴)* + +为了快速而顺畅的更新,打开终端并输入以下命令来让系统使用新软件库: $ sudo apt-get update $ sudo apt-get upgrade ![Ubuntu Upgrade](http://www.tecmint.com/wp-content/uploads/2015/04/Ubuntu-Upgrade.jpg) -Ubuntu Upgrade + +*Ubuntu 升级* ### 2. 安装额外驱动 ### 为了能让系统扫描并安装额外的硬件专有驱动,我们依然从System Settings打开Software and Updates工具,选择Additional Drivers标签并等待该工具扫描驱动。 -如果有驱动匹配到了你的硬件,查看你想要安装的驱动并点击Apply按钮来安装它,以防专有驱动没有如期工作,用Revert按钮就能卸载它们或勾选Do not use the device后点击Apply按钮。 +如果有驱动匹配到了你的硬件,查看你想要安装的驱动并点击Apply按钮来安装它。如果专有驱动没有如预期的工作,用Revert按钮就能卸载它们或勾选Do not use the device后点击Apply按钮。 ![Install Drivers in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-drivers.jpg) -Install Drivers + +*安装驱动* ### 3. 安装Synaptic和Gdebi工具 ### -除了Ubuntu Software Center,Synaptic是一个apt图形化工具,通过它你能管理、安装、卸载、搜索和升级软件库并配置软件包。同样的,Gdebi在功能上也有相同的地方。在终端上输入以下命令来安装这两个包: +除了Ubuntu Software Center之外,Synaptic也是一个apt的图形化工具,通过它你能管理、安装、卸载、搜索和升级软件库并配置软件包。同样的,Gdebi对本地的.deb 包也有类似功能。在终端上输入以下命令来安装这两个包: $ 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 和 Gdebi* ![Synaptic Package Manager](http://www.tecmint.com/wp-content/uploads/2015/04/synaptic-package-manager.jpg) -Synaptic Package Manager -### 4. 更改系统外观和运行状态 ### +*Synaptic 包管理器* -如果你想要更改桌面背景或图标大小,依次打开System Settings –> Appearance –> Look并对桌面进行个性化设置,把菜单移动到窗口标题栏,在Behavior标签中启动workspaces和desktop icons或开关auto-hide the Launcher。 +### 4. 更改系统外观和行为 ### + +如果你想要更改桌面背景或图标大小,依次打开System Settings –> Appearance –> Look,并对桌面进行个性化设置。要把菜单移动到窗口标题栏,在Behavior标签中设置即可。 ![System Appearances](http://www.tecmint.com/wp-content/uploads/2015/04/system-appearance.jpg) -System Appearances + +*系统外观* ### 5. 提升系统安全性和隐私性 ### ![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 + +*系统安全选项* ### 6. 禁用不需要开机自启动的应用程序 ### -要提高登录系统的速度,通过输入以下命令来显示被隐藏的开机启动应用程序,在Dash中搜索它就能打开Startup Applications工具并反选不需要再登录系统的过程中启动的程序。 +要提高登录系统的速度,通过输入以下命令来显示被隐藏的开机启动应用程序。 - $ sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart/*.desktop + $ sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop + +在Dash中搜索打开Startup Applications工具,并反选不需要在登录系统的过程中启动的程序。 ![Disable Unwanted Applications](http://www.tecmint.com/wp-content/uploads/2015/04/disable-unwanted-applications.jpg) -Disable Unwanted Applications + +*禁用不需要的应用程序* ### 7. 添加扩展多媒体支持 ### @@ -88,50 +101,54 @@ Disable Unwanted Applications $ 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 -除了多媒体播放器,安装ubuntu-restricted-extras和Java支持包也可以解码并支持其它受约束的多媒体格式。 +*媒体播放器的播放列表* + +除了多媒体播放器,安装ubuntu-restricted-extras和Java支持包也可以解码并支持其它受限制的多媒体格式。 $ 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 -在终端上输入以下命令来启用DVD Playback和其它多媒体解码器: +*安装 Ubuntu Extras* + +在终端上输入以下命令来启用DVD 回放和其它多媒体解码器: $ 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 -### 8. 安装图像处理应用程序 ### +*启用视频解码器* + +### 8. 安装图像处理应用程序和安装媒体烧录软件 ### 如果你是一个摄影爱好者,想在Ubuntu上处理调整图像,或许需要安装一下图像处理程序: -- GIMP (alternative for Adobe Photoshop) +- GIMP (一个 Adobe Photoshop 替代品) - Darktable - Rawtherapee - Pinta - Shotwell -- Inkscape (alternative for Adobe Illustrator) +- Inkscape (一个 Adobe Illustrator 替代品) - Digikam - Cheese -这些应用程序能从Ubuntu Software Center中安装或者立刻在终端上使用以下命令: +这些应用程序能从Ubuntu Software Center中安装,或者立刻在终端上使用以下命令: $ 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 -### 9. 安装媒体烧录软件 ### +*Rawtherapee Tool* 如果要挂载ISO镜像或烧录一张CD或DVD,你可以选择并安装以下软件中的一款: @@ -146,18 +163,20 @@ Rawtherapee Tool $ sudo apt-get install furiusisomount ![Install Media Burners](http://www.tecmint.com/wp-content/uploads/2015/04/install-media-burners.jpg) -Install Media Burners -### 10. 安装压缩应用程序 ### +*安装媒体烧录软件* + +### 9. 安装压缩应用程序 ### 如果要处理大多数归档格式的文件(zip, tar.gz, zip, 7zip rar等等),输入以下命令来安装这些包: $ 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 -### 11. 安装聊天应用程序 ### +*安装压缩应用程序* + +### 10. 安装聊天应用程序 ### 如果你想要和世界各地的人们聊天,这里有一份最流行的Linux聊天应用程序列表: @@ -179,14 +198,16 @@ Install Archive Applications $ sudo apt-get install telegram ![Install Chat Applications](http://www.tecmint.com/wp-content/uploads/2015/04/install-chat-apps.jpg) -Install Chat Applications -想要在Ubuntu上安装Viber可以访问[Viber官方网站][1]下载Debian安装包到本地并用Gdebi包管理工具来安装viber.deb应用程序(右击 –> 打开 -> GDebi Package Installer). +*安装聊天应用程序* + +想要在Ubuntu上安装Viber可以访问[Viber官方网站][1]下载Debian安装包到本地,并用Gdebi包管理工具来安装viber.deb应用程序(右击 –> 打开 -> GDebi Package Installer). ![Install Viber in Ubuntu](http://www.tecmint.com/wp-content/uploads/2015/04/install-viber.jpg) -Install Viber -### 12. 安装种子软件 ### +*安装 Viber* + +### 11. 安装种子软件 ### 在Ubuntu最流行的种子应用程序和P2P文件共享程序是: @@ -203,77 +224,90 @@ Install Viber $ sudo apt-get install linuxdcpp ![Install Torrent](http://www.tecmint.com/wp-content/uploads/2015/04/install-torrent.jpg) -Install Torrent -### 13. 安装Windows仿真器-Wine和游戏支持平台-Steam ### +*安装种子软件* -Wine仿真器允许你在Linux上安装并运行Window应用程序。在另一方面,Steam是一款Valve开发的流行于Linux系统的游戏平台。想要在你的机器上安装它们,可以输入以下命令或使用Ubuntu Software Center。 +### 12. 安装Windows仿真器-Wine和游戏支持平台-Steam ### + +Wine仿真器允许你在Linux上安装并运行Window应用程序。在另一方面,Steam是一款Valve开发的基于Linux系统的流行游戏平台。想要在你的机器上安装它们,可以输入以下命令或使用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 -### 14. 安装Cairo-Dock并启用桌面视觉效果 ### +*安装 Wine* + +### 13. 安装Cairo-Dock并启用桌面视觉效果 ### Cairo-Dock是一款漂亮且灵巧的用于Linux桌面上的启动条,类似于Mac OS X dock。想要在Ubuntu上安装它,可以在终端上运行以下命令: $ 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 + +*安装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 + +*让 Cairo Dock 自动启动* 想要启用某一套桌面效果,例如Cube效果,可以使用以下命令来安装Compiz包: $ sudo apt-get install compiz compizconfig-settings-manager compiz-plugins-extra -想要激活桌面Cube效果,在Dash上查找ccsm,打开CompizConfig Settings Manager,找到General Options – > Desktop Size并设置Horizontal Virtual Size的值为4,Vertical Virtual Size的值为1。然后返回检查Desktop Cube框(禁用Desktop Wall)和Rotate Cube框(解决冲突 -> 禁止切换视图1)并Ctrl+Alt+鼠标左击来查看cube效果。 +想要激活桌面Cube效果,在Dash上查找ccsm来打开CompizConfig Settings Manager,找到General Options – > Desktop Size并设置Horizontal Virtual Size的值为4,Vertical Virtual Size的值为1。然后返回检查Desktop Cube框(禁用Desktop Wall)和Rotate Cube框(解决冲突 -> 禁止切换视图1)并Ctrl+Alt+鼠标左击来查看cube效果。 ![Enable Compiz](http://www.tecmint.com/wp-content/uploads/2015/04/enable-compiz.jpg) -Enable Compiz + +*启用Compiz* ![Compiz Settings](http://www.tecmint.com/wp-content/uploads/2015/04/compiz-settings.jpg) -Compiz Settings + +*Compiz设置* ![Compiz Settings Addons](http://www.tecmint.com/wp-content/uploads/2015/04/compiz-settings-1.jpg) -Compiz Settings Addons + +*Compiz设置插件* ![Desktop Window Rotating](http://www.tecmint.com/wp-content/uploads/2015/04/desktop-cube.jpg) -Desktop Window Rotating -### 15. 添加额外浏览器支持 ### +*桌面窗口旋转* + +### 14. 添加其它浏览器 ### Ubuntu 15.04默认浏览器是Mozilla Firefox。想要安装其它浏览器比如Google Chrome或Opera,可以访问它们的官方网站,下载所提供的.deb包并用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 + +*Opera Browser* 想要安装Chromium开源浏览器请在终端上输入以下命令: $ sudo apt-get install chromium-browser -### 16. 安装Tweak工具 ### +### 15. 安装Tweak工具 ### 想要用额外的应用程序来自定义Ubuntu吗?在终端上输入以下命令来安装Unity Tweak工具和Gnome Tweak工具: $ 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* ![Tweak Tool Settings](http://www.tecmint.com/wp-content/uploads/2015/04/tweak-settings.jpg) -Tweak Tool Settings -另一个有趣的tweak工具主要是Ubuntu Tweak包,可以通过访问官方网站来获取并安装: [http://ubuntu-tweak.com/][2]. +*Tweak Tool 设置* + +另一个有趣的tweak工具主要是Ubuntu Tweak包,可以通过访问官方网站来获取并安装: [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 + +*Tweak Tool: 系统信息* 在你安装好这一连串软件之后,你或许想要清理一下你的系统来释放一点硬盘上的空间,输入以下命令即可: @@ -281,7 +315,7 @@ Tweak Tool: System Information $ sudo apt-get -y autoclean $ sudo apt-get -y clean -这只是tweaks工具中的其中一些和普通用户日常生活中可能会在Ubuntu 15.04桌面上安装使用的程序。想要了解更多高级的程序,特性和功能,请使用Ubuntu Software Center或查阅Ubuntu Wiki主页。 +这只是一些普通用户日常使用Ubuntu 15.04桌面是需要调整和安装的程序。想要了解更多高级的程序,特性和功能,请使用Ubuntu Software Center或查阅Ubuntu Wiki主页。 -------------------------------------------------------------------------------- @@ -289,7 +323,7 @@ via: http://www.tecmint.com/things-to-do-after-installing-ubuntu-15-04-desktop/ 作者:[Matei Cezar][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/) 荣誉推出 diff --git a/translated/tech/20150427 How to set up NTP server in CentOS.md b/published/201506/20150427 How to set up NTP server in CentOS.md similarity index 60% rename from translated/tech/20150427 How to set up NTP server in CentOS.md rename to published/201506/20150427 How to set up NTP server in CentOS.md index 3924edd93f..deb5cc3ca6 100644 --- a/translated/tech/20150427 How to set up NTP server in CentOS.md +++ b/published/201506/20150427 How to set up NTP server in CentOS.md @@ -1,30 +1,31 @@ 如何在 CentOS 中设置 NTP 服务器 ================================================================================ -网络时间协议(NTP)用来同步网络上不同主机的系统时间。所有托管的主机都可以和一个指定的被称为 NTP 服务器的时间服务器同步它们的时间。另一方面一个 NTP 服务器将它的时间和任何公共 NTP 服务器,或者你选定的服务器同步。NTP 托管的所有系统时钟都同步精确到毫秒级。 -在一个协作环境中,如果他们不想为 NTP 传输打开防火墙,就有必要设置一个内部 NTP 服务器,然后让员工使用内部服务器而不是公共 NTP 服务器。在这个指南中,我们会介绍如何将一个 CentOS 系统配置为 NTP 服务器。在介绍详细内容之前,让我们先来简单了解一下 NTP 的概念。 +网络时间协议(NTP)用来同步网络上不同主机的系统时间。你管理的所有主机都可以和一个指定的被称为 NTP 服务器的时间服务器同步它们的时间。而另一方面,一个 NTP 服务器会将它的时间和任意公共 NTP 服务器,或者你选定的服务器同步。由 NTP 管理的所有系统时钟都会同步精确到毫秒级。 + +在公司环境中,如果他们不想为 NTP 传输打开防火墙,就有必要设置一个内部 NTP 服务器,然后让员工使用内部服务器而不是公共 NTP 服务器。在这个指南中,我们会介绍如何将一个 CentOS 系统配置为 NTP 服务器。在介绍详细内容之前,让我们先来简单了解一下 NTP 的概念。 ### 为什么我们需要 NTP? ### -由于制造工艺多种多样,所有的(非原子)时钟并不按照完全一致的速度行走。有一些时钟走的比较快而有一些走的比较慢。因此经过很长一段时间以后,一个时钟的时间慢慢的偏移于其它,导致有名的 “时钟漂移” 或 “时间漂移”。为了最小化时钟漂移的影响,使用 NTP 的主机应该周期性地和指定的 NTP 服务器交互以保持它们的时钟同步。 +由于制造工艺多种多样,所有的(非原子)时钟并不按照完全一致的速度行走。有一些时钟走的比较快而有一些走的比较慢。因此经过很长一段时间以后,一个时钟的时间慢慢的和其它的发生偏移,这就是常说的 “时钟漂移” 或 “时间漂移”。为了将时钟漂移的影响最小化,使用 NTP 的主机应该周期性地和指定的 NTP 服务器交互以保持它们的时钟同步。 -在不同的主机之间进行时间同步对于计划备份、[干扰检测][1]日志、[分布式任务调度][2]或者事务订单管理来说是很重要的事情。它甚至可能要求作为日常任务的一部分。 +在不同的主机之间进行时间同步对于计划备份、[入侵检测][1]记录、[分布式任务调度][2]或者事务订单管理来说是很重要的事情。它甚至应该作为日常任务的一部分。 -### NTP 层次 ### +### NTP 的层次结构 ### -NTP 时钟以层次模型组织。层级中的每层被称为一个 *stratum*。stratum 的概念说明了一台机器到授权的时间源有多少 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 时钟可能通过网络和彼此互联。 +Stratum 0 由没有时间漂移的时钟组成,例如原子时钟。这种时钟不能在网络上直接使用。Stratum N (N > 1) 层服务器从 Stratum N-1 层服务器同步时间。Stratum N 时钟能通过网络和彼此互联。 -NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不能使用的。 +NTP 支持多达 15 个 stratum 的层级。Stratum 16 被认为是未同步的,不能使用的。 ### 准备 CentOS 服务器 ### 现在让我们来开始在 CentOS 上设置 NTP 服务器。 -首先,我们需要保证正确设置了服务器的时区。在 CentOS 7 中,我们可以使用 timedatectl 命令查看和更改服务器的时区(比如,"Australia/Adelaide") +首先,我们需要保证正确设置了服务器的时区。在 CentOS 7 中,我们可以使用 timedatectl 命令查看和更改服务器的时区(比如,"Australia/Adelaide",LCTT 译注:中国可设置为 Asia/Shanghai ) # timedatectl list-timezones | grep Australia # timedatectl set-timezone Australia/Adelaide @@ -56,7 +57,7 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 # chown ntp:ntp /var/log/ntpd.log # chcon -t ntpd_log_t /var/log/ntpd.log -现在初始化 NTP 服务并确保把它添加到了随机启动。 +现在初始化 NTP 服务并确保把它添加到了开机启动。 # systemctl restart ntp # systemctl enable ntp @@ -69,19 +70,18 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 下面的表格解释了输出列。 -注:表格
-

它表明,该文件使用扩展到映射磁盘上的块

+

它表明,该文件使用磁盘上的块的映射扩展

-

在文件上启用这个属性时,我们不能更改,重命名或者删除这个文件

+

在文件上启用这个属性时,我们不能更改、重命名或者删除这个文件

- + - + - + @@ -89,15 +89,15 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 - + - + - + @@ -109,7 +109,7 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 - +
remote源在 ntp.conf 中定义。‘*’ 表示当前使用的最好的源;‘+’ 表示可作为 NTP 源的源;‘-’ 标记的源是不可用的。源在 ntp.conf 中定义。‘*’ 表示当前使用的,也是最好的源;‘+’ 表示这些源可作为 NTP 源;‘-’ 标记的源是不可用的。
refid和远程服务器时钟同步的时钟的 IP 地址。用于和本地时钟同步的远程服务器的 IP 地址。
stStratumStratum(阶层)
t
when自从上次和服务器交互经过的时间(以秒数计)。自从上次和服务器交互后经过的时间(以秒数计)。
poll和服务器的轮询频率,以秒数计。和服务器的轮询间隔,以秒数计。
reach表示和服务器交互是否有任何错误的十进制数。值 337 表示 100% 成功。表示和服务器交互是否有任何错误的八进制数。值 337 表示 100% 成功(即十进制的255)。
delay
jitter两个例子之间平局时间差异,以毫秒数计。两次取样之间平均时差,以毫秒数计。
@@ -120,13 +120,13 @@ NTP 支持多达 15 stratums 的层级。Stratum 16 被认为是没有同步不 # 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),任何其它网络的流量会被截停。你可以根据需要更改规则。 +该规则允许从 192.168.1.0/24 来的 NTP 流量(端口 UDP/123),任何其它网络的流量会被丢弃。你可以根据需要更改规则。 ### 配置 NTP 客户端 ### #### 1. Linux #### -NTP 客户端主机需要 ntpupdate 软件包和服务器同步时间。可以轻松地使用 yum 或 apt-get 安装这个软件包。安装完软件包之后,用服务器的 IP 地址运行下面的命令。 +NTP 客户端主机需要 ntpupdate 软件包来和服务器同步时间。可以轻松地使用 yum 或 apt-get 安装这个软件包。安装完软件包之后,用服务器的 IP 地址运行下面的命令。 # ntpdate @@ -138,17 +138,17 @@ NTP 客户端主机需要 ntpupdate 软件包和服务器同步时间。可以 #### 3. Cisco 设备 #### -如果你想和 Cisco 设备同步时间,你可以在全局配置模式下使用下面的命令。 +如果你想要同步 Cisco 设备的时间,你可以在全局配置模式下使用下面的命令。 # ntp server -其它有支持 NTP 的卖家有自己的参数用于网络时间。如果你想将设备和 NTP服务器同步时间,请查看设备的说明文档。 +来自其它厂家的支持 NTP 的设备有自己的用于网络时间的参数。如果你想将设备和 NTP服务器同步时间,请查看设备的说明文档。 ### 结论 ### 总而言之,NTP 是在你的所有主机上同步时钟的一个协议。我们已经介绍了如何设置 NTP 服务器并使支持 NTP 的设备和服务器同步时间。 -希望能对你有所帮助 +希望能对你有所帮助。 -------------------------------------------------------------------------------- @@ -156,7 +156,7 @@ via: http://xmodulo.com/setup-ntp-server-centos.html 作者:[Sarmed Rahman][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/) 荣誉推出 diff --git a/translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md b/published/201506/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md similarity index 54% rename from translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md rename to published/201506/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md index be9297c370..dff5090cfc 100644 --- a/translated/tech/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md +++ b/published/201506/20150429 How To Integrate Apache2 With Tomcat 7 Using mod_jk Connector.md @@ -1,65 +1,63 @@ 如何用mod_jk连接器来集成Apache2和Tomcat 7 ================================================================================ -Apache是最流行的web服务器。通常用来接收客户端的请求并响应。它得到一个URL并将它翻译成一个文件名(或者静态请求),并将文件从本地磁盘中通过因特网返回,或者将它翻译成程序名执行它,接着将输出返回给请求方。如果web服务器不能处理和完成请求,它会返回一个错误信息。 +Apache是最流行的web服务器,它通常用来接收客户端的请求并响应。它得到一个URL并将它翻译成一个文件名(或者静态请求),并将文件从本地磁盘中取出,通过因特网返回;或者将它翻译成程序执行它,接着将输出返回给请求方。如果web服务器不能处理和完成请求,它会返回一个错误信息。 -在本篇中,我们会列出Apache的特性以及我们该如何用mod_jk连接器来集成Tomcat7和Tomcat8. +在本篇中,我们会列出Apache的特性以及我们该如何用mod\_jk连接器来集成Tomcat 7和Tomcat 8. ### Apache的特性 ### 如我们所说Apache是最流行的web服务器。下面是流行背后的原因: - 它是自由工具,你可以很简单地下载和安装 -- 它开放源码因此你可以查看源码,调整它,优化它,并且修复错误和安全漏洞。也可以增加新的功能和模块。 +- 它开放源码,因此你可以查看源码,调整它,优化它,并且修复错误和安全漏洞。也可以增加新的功能和模块。 - 它可以用在只有一两个页面的小网站,或者是有成千上万个页面的大网站,每月处理上百万的常规访问者的请求。它可以同时处理静态和动态内容。 -- 提高的缓存模块(mod_cache、 mod_disk_cache、 mod_mem_cache)。 +- 改进的缓存模块(mod\_cache、 mod\_disk\_cache、 mod\_mem\_cache)。 - Apache 2 支持 IPv6. -### Tomcat 目录 ### +### Tomcat 的目录 ### ${tomcat_home} 是tomcat的根目录。你的tomcat安装应该有下面的子目录: - ${tomcat_home}\conf – 存放不同配置文件的地方 - ${tomcat_home}\webapps – 包含示例程序 -- ${tomcat_home}\bin – 存放插件的地方 +- ${tomcat_home}\bin – 存放你的Web服务器的插件的地方 ### Mod_jk 模块 ### -mod_jk有两种可接受的方式:二进制或者源码。取决于你运行的web服务器的平台,二进制版本的mod_jk也许可以找到。如果有二进制版本的话建议使用这个。 +mod\_jk有两种可接受的方式:二进制或者源码。取决于你运行的web服务器的平台,也许有符合你的平台的二进制版本的mod\_jk。如果有的话建议使用这个。 -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 +- Linux、 FreeBSD、 AIX、 HP-UX、 MacOS X、 Solaris ,应该在主流的支持Apache 1.3 和/或者 2.x的Unix平台上都工作。 +- WinNT 4.0-i386 SP4/SP5/SP6a (应该可以与其他的服务包一起工作), Win2K 和 WinXP 和 Win98 - Cygwin (需要你有apache服务器及autoconf/automake支持工具) - Netware -- i5/OS V5R4 (System I) 中的 Apache HTTP Server 2.0.58。 确保已经安装了Apache PTF -- Tomcat 3.2 到 Tomcat 8. +- i5/OS V5R4 (System I) ,带有 Apache HTTP Server 2.0.58。 确保已经安装了最新的 Apache PTF +- Tomcat 3.2 到 Tomcat 8 -The mod_jk 需要两个组件: +The mod\_jk 需要两个组件: -- **mod_jk.xxx** – Apache HTTP服务器模块,取决于你的操作系统,它可能是mod_jk.so、mod_jk.nlm或者MOD_JK.SRVPGM。 -- **workers.properties** - 描述主机以及处理器使用的端口(Tomcat进程)。在下载的源码内可以在conf目录下找到workers.properties文件。 +- **mod\_jk.xxx** – Apache HTTP服务器模块,取决于你的操作系统,它可能是mod\_jk.so、mod\_jk.nlm或者mod\_jk.SRVPGM。 +- **workers.properties** - 描述Worker (Tomcat进程)所用的主机以及处理器使用的端口。在下载的源码的conf目录下找到示例的workers.properties文件。 -和Apache HTTP服务器其他的模块一样,mod_jk应该安装在你的Apache服务器下的模块目录下:/usr/lib/apache,你应该更新你的**httpd.conf**文件。 +和Apache HTTP服务器其他的模块一样,mod\_jk应该安装在你的Apache服务器下的模块目录下:/usr/lib/apache,而且你应该更新你的**httpd.conf**文件。 ### 安装 ### -它需要非root用户在安装钱使用“sudo”特权。现在我们开始安装,我们将使用下面的命令来安装Apache2和Tomcat: +在开始安装前,非root用户需要使用“sudo”特权。现在我们开始安装,我们将使用下面的命令来安装Apache2和Tomcat: - sudo apt-get install apache2 - + 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 -粘贴下面的代码: +并粘贴下面的代码到上述的 index.jsp: @@ -71,19 +69,19 @@ The mod_jk 需要两个组件: -一切完毕后,我们将使用下面的命令安装和配置mod_jk: +一切完毕后,我们将使用下面的命令安装和配置mod\_jk: sudo apt-get install libapache2-mod-jk -我们将使用下面的命令启用Tomcat的8443转发端口: +我们需要使用下面的命令启用Tomcat的8443转发端口: sudo vim /etc/tomcat7/server.xml -我们将解除下面的注释行: +解除下面的注释行: -之后,我们将用下面的命令位Apache创建workers.properties文件: +之后,我们将用下面的命令为Apache创建workers.properties文件: sudo vim /etc/apache2/workers.properties @@ -123,7 +121,7 @@ The mod_jk 需要两个组件: ### 总结 ### -在本篇中我们展示了你该如何使用mod_jk连接器配置和安装Apache2以及Tomcat7。 +在本篇中我们展示了你该如何使用mod\_jk连接器配置和安装Apache2以及Tomcat7。 -------------------------------------------------------------------------------- @@ -131,7 +129,7 @@ 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) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md b/published/201506/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md similarity index 75% rename from translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md rename to published/201506/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md index 1e2a36a0a7..5dba39a1d3 100644 --- a/translated/tech/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md +++ b/published/201506/20150429 KDE Plasma 5.3 Released, Here' s How To Upgrade in Kubuntu 15.04.md @@ -1,7 +1,6 @@ - -KDE Plasma 5.3已发布,Kubuntu 15.04升级攻略 +在 Kubuntu 15.04 中升级 KDE Plasma 5.3 ================================================================================ -**KDE[已经宣布][1]Plasma 5.3的稳定版已经准备就绪,它包含了一个新的电源管理方面的稳定特性。** +**KDE[已经发布了][1]Plasma 5.3的稳定版,它包含了一个新的电源管理方面的稳定特性。** [先前四月份的beta版][2]已经让我们印象深刻,甚至跃跃欲试了,Plasma 5桌面环境的稳定版更新的最新更新已经稳定,并且可以下载了。 @@ -10,7 +9,8 @@ Plasma 5.3继续改善和细化了全新的KDE桌面,它添加了大量的特 ### 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) -Plasma 5.3中更好的蓝牙管理 + +*Plasma 5.3中更好的蓝牙管理* 而[在早期关于Plasma 5.3的文章][3]中,我们触及了大量**新特性**,这其中很多都值得反复说道说道。 @@ -18,19 +18,21 @@ Plasma 5.3中更好的蓝牙管理 在连接了外部监视器的时候合上笔记本盖子时,不会再触发‘挂起’操作。这个新的行为被称之为‘**影院模式**’,并且默认开启。但是,可以通功过电源管理设置中的相关选项禁用。 -**蓝牙功能被改善**,带来了一个全新的面板小程序,使得在连接到并配置配对的蓝牙设备,如只能手机、键盘和扬声器时,比以往更为便捷。 +**蓝牙功能被改善**,带来了一个全新的面板小程序,使得在连接到并配置配对的蓝牙设备,如智能手机、键盘和扬声器时,比以往更为便捷。 同样,对于Plasma 5.3,**KDE中的轨迹板配置更为方便**,这多亏了新的安装和设置模块。 + ![Trackpad, Touchpad. Tomato, Tomayto.](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/touchpad-kde.jpg) -轨迹板、触控板。Tomato, Tomayto。 -对于Plasma小部件狂热者,带来了一个**按住并锁定**手势。当启用该功能,会隐藏移动鼠标时出现的设置处理。取而代之的是,它只会在长点击小部件时发生该行为。 +*轨迹板、触控板。Tomato, Tomayto。* -谈到widget-y这类事情时,该发布版中**再次引入了几个旧的Plasmoid最受欢迎的东西**,包括一个有用的系统监视器、便利的硬盘驱动器统计和一个漫画阅读器。 +对于Plasma小部件狂热者,它带来了一个**按住并锁定**手势。当启用该功能,会隐藏移动鼠标时出现的设置处理。取而代之的是,它只会在长点击小部件时发生该行为。 + +谈到widget-y这类事情时,该发布版中**再次引入了几个旧的Plasmoid中最受欢迎的东西**,包括一个有用的系统监视器、便利的硬盘驱动器统计和一个漫画阅读器。 ### 了解更多&尝试 ### -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/plasma-5.3-beta.jpg\) +![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/04/plasma-5.3-beta.jpg) 一张全部内容的完整列表——我说全部内容——是指Plasma 5.3中[在官方修改日志中][4]列出的新的和改进的内容。 @@ -40,7 +42,7 @@ Plasma 5.3中更好的蓝牙管理 如果你需要超级稳定的系统,你可以使用这些镜像来尝试新特性,但是你可以继续使用你的主要计算机上与你的版本对应的KDE版本。 -但是,如果你对实验版满意——请阅:能够处理任何包冲突,或者由尝试升级桌面环境而导致的系统问题——那么你可以安装。 +不过,如果你对实验版满意——请注意:能够处理任何包冲突,或者由尝试升级桌面环境而导致的系统问题——那么你可以安装。 ### 安装Plasma 5.3到Kubuntu 15.04 ### @@ -52,20 +54,19 @@ Kubuntu移植PPA可能也会升级除了安装在你系统上的Plasma外的其 目前为止,使用命令行来升级Kubuntu中的到Plasma 5.3是最快速的方法: - sudo add-apt-repository ppa:kubuntu-ppa/backports - + sudo add-apt-repository ppa:kubuntu-ppa/backports sudo apt-get update && sudo apt-get dist-upgrade 在升级过程完成后,如果一切顺利,你应该重启计算机。 如果你正在使用一个备用桌面环境,比如LXDE、Unity或者GNOME,则你需要在运行完上面的两个命令后安装Kubuntu桌面包(你可以在Ubuntu软件中心找到)。 -To downgrade to the stock version of Plasma in 15.04 you can use the PPA-Purge tool: + +要降级到15.04中自带的 Plasma 版本的话,你可以使用 PPA-Purge 工具: sudo apt-get install ppa-purge - sudo ppa-purge ppa:kubuntu-ppa/backports -请在下面的评论中留言,让我们知道你怎么升级/测试过程是怎样的,别忘了告诉我们你在下一个Plasma 5桌面中要看到的特性。 +请在下面的评论中留言,让我们知道你怎么升级,测试过程是怎样的,别忘了告诉我们你在下一个Plasma 5桌面中要看到的特性。 -------------------------------------------------------------------------------- @@ -73,7 +74,7 @@ via: http://www.omgubuntu.co.uk/2015/04/kde-plasma-5-3-released-heres-how-to-upg 作者:[Joey-Elijah Sneddon][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/published/201506/20150429 What are good command line HTTP clients.md b/published/201506/20150429 What are good command line HTTP clients.md new file mode 100644 index 0000000000..969b14da29 --- /dev/null +++ b/published/201506/20150429 What are good command line HTTP clients.md @@ -0,0 +1,111 @@ +有哪些不错的命令行HTTP客户端? +============================================================================== + +“整体大于它的各部分之和”,这是引自希腊哲学家和科学家的亚里士多德的名言。这句话特别切中Linux。在我看来,Linux最强大的地方之一就是它的协作性。Linux的实用性并不仅仅源自大量的开源程序(命令行)。相反,其协作性来自于这些程序的综合利用,有时是结合成更大型的应用。 + +Unix哲学引发了一场“软件工具”的运动,关注开发简洁,基础,干净,模块化和扩展性好的代码,并可以运用于其他的项目。这种哲学成为了许多的Linux项目的一个重要的元素。 + +好的开源开发者写程序为了确保该程序尽可能运行得好,并且同时能与其他程序很好地协作。目标就是使用者拥有一堆方便的工具,每一个力求干好一件事。许多程序能独立工作得很好。 + +这篇文章讨论3个开源命令行HTTP客户端。这些客户端可以让你使用命令行从互联网上下载文件。但同时,他们也可以用于许多有意思的地方,如测试,调式和与HTTP服务器或web应用交互。对于HTTP架构师和API设计人员来说,使用命令行操作HTTP是一个值得花时间学习的技能。如果你需要经常使用API,HTTPie和cURL就非常有价值。 + +###HTTPie### + +![HTTPie in action](http://www.linuxlinks.com/portal/content/reviews/Internet/Screenshot-httpie.png) + +HTTPie(发音 aych-tee-tee-pie)是一款开源的命令行HTTP客户端。它是一个命令行界面,便于手工操作的类cURL工具。 + +该软件的目标是使得与Web服务器的交互尽可能的人性化。其提供了一个简单的http命令,允许使用简单且自然的语句发送任意的HTTP请求,并显示不同颜色的输出。HTTPie可以用于测试,调试,以及与HTTP服务器的常规交互。 + +#### 功能包括:#### + +- 生动而直观的语法格式 +- 经过格式化的彩色终端输出 +- 内建JSON支持 +- 支持表单和文件上传 +- 支持HTTPS,代理和认证 +- 任意数据请求 +- 自定义请求头 +- 持久会话 +- 类Wget的下载 +- 支持Python 2.6,2.7和3.x +- 支持Linux,Mac OS X 和 Windows +- 支持插件 +- 文档 +- 单元测试覆盖 + +--- + +- 网站:[httpie.org][1] +- 开发者: Jakub Roztočil +- 证书: 开源 +- 版本号: 0.9.2 + +###cURL### + +![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 +- 支持匹配: [0-13],{one, two, three} +- 一个命令上传多个文件 +- 自定义最大传输速度 +- 重定向了标准错误输出 +- 支持Metalink + +--- + +- 网站: [curl.haxx.se][2] +- 开发者: Daniel Stenberg +- 证书: MIT/X derivate license +- 版本号: 7.42.0 + +###Wget### + +![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页面的链接,创建远程网络站点的本地副本,完全重造源站点的目录结构。这种方式被称作“递归下载”。 + +Wget设计上增强了低速或者不稳定的网络连接。 + +功能包括: + +- 使用REST和RANGE恢复中断的下载 +- 使用文件名通配符,支持递归地对目录镜像 +- 基于NLS的消息文件支持多语言 +- 可选的转换下载文档里地绝对链接为相对链接,使得下载文档可以在本地相互链接 +- 可以在大多数类UNIX操作系统和微软Windows上运行 +- 支持HTTP代理 +- 支持HTTP cookie +- 支持HTTP持久连接 +- 无人照管/后台操作 +- 当对远程镜像时,使用本地文件时间戳来决定是否需要重新下载文档 + +--- + +- 站点: [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) +校对:[wxy](https://github.com/wxy) + +本文由 [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/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md b/published/201506/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md similarity index 68% rename from translated/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md rename to published/201506/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md index 0f7bc3d62f..4c3c824682 100644 --- a/translated/tech/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md +++ b/published/201506/20150504 How to Install and Configure 'PowerDNS' (with MariaDB) and 'PowerAdmin' in RHEL or CentOS 7.md @@ -1,44 +1,48 @@ -RHEL/CentOS 7中安装并配置‘PowerDNS’(与MariaDB搭配)和‘PowerAdmin’ +RHEL/CentOS 7中安装并配置 PowerDNS 和 PowerAdmin ================================================================================ -PowerDNS是一个运行在许多Linux/Unix衍生版上的DNS服务器,它可以使用不同的后端进行配置,包括BIND类型的区域文件、相关的数据库,或者负载均衡/失效转移算法。它也可以被配置成一台DNS递归器,作为服务器上的一个独立进程运行。 +PowerDNS是一个运行在许多Linux/Unix衍生版上的DNS服务器,它可以使用不同的后端进行配置,包括BIND类型的区域文件、关系型数据库,或者负载均衡/失效转移算法。它也可以被配置成一台DNS递归器,作为服务器上的一个独立进程运行。 PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以获得的版本是3.4.3。我推荐安装EPEL仓库中提供的那一个,因为该版本已经在CentOS和Fedora中测试过。那样,你也可以在今后很容易地更新PowerDNS。 -本文倾向于向你演示如何安装并配置以MariaDB作为后端的PowerDNS和 +本文用于向你演示如何安装并配置以MariaDB作为后端的PowerDNS,以及它的界面友好的 Web 管理工具 PowerAdmin。 + 出于本文的写作目的,我将使用以下服务器: 主机名: centos7.localhost IP地址: 192.168.0.102 -### 步骤 1: 安装带有MariaDB后端的PowerDNS ### +### 第一部分: 安装带有MariaDB后端的PowerDNS ### -#### 1. 首先,你需要为你的系统启用EPEL仓库,只需使用: #### +1、 首先,你需要为你的系统启用EPEL仓库,只需使用: # yum install epel-release.noarch ![Enable Epel Repository](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Epel-Repository.png) -启用Epel仓库 -#### 2. 下一步是安装MariaDB服务器。运行以下命令即可达成: #### +*启用Epel仓库* + +2、 下一步是安装MariaDB服务器。运行以下命令即可达成: # yum -y install mariadb-server mariadb ![Install MariaDB Server](http://www.tecmint.com/wp-content/uploads/2015/04/Install-MariaDB-Server.png) -安装MariaDB服务器 -#### 3. 接下来,我们将配置并启用MySQL,并设置开机启动: #### +*安装MariaDB服务器* + +3、 接下来,我们将配置并启用MariaDB,并设置开机启动: # 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) -启用MariaDB开机启动 -#### 4. 由于MySQL服务正在运行,我们将为MariaDB设置密码进行安全加固,运行以下命令: #### +*启用MariaDB开机启动* + +4、 现在MariaDB服务运行起来了,我们将为MariaDB设置密码进行安全加固,运行以下命令: # mysql_secure_installation -#### 按照指示做 #### +**按照指示做** /bin/mysql_secure_installation: line 379: find_mysql_client: command not found @@ -102,33 +106,36 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 Thanks for using MariaDB! -#### 5. MariaDB配置成功后,我们可以继续去安装PowerDNS。运行以下命令即可轻易完成: #### +5、 MariaDB配置成功后,我们可以继续去安装PowerDNS。运行以下命令即可轻易完成: # 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) -安装带有MariaDB后端的PowerDNS -#### 6. PowerDNS的配置文件位于`/etc/pdns/pdns`,在编辑之前,我们将为PowerDNS服务配置一个MySQL数据库。首先,我们将连接到MySQL服务器并创建一个名为powerdns的数据库: #### +*安装带有MariaDB后端的PowerDNS* + +6、 PowerDNS的配置文件位于`/etc/pdns/pdns`,在编辑之前,我们将为PowerDNS服务配置一个MariaDB数据库。首先,我们将连接到MariaDB服务器并创建一个名为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) -创建PowerDNS数据库 -#### 7. 接下来,我们将创建一个名为powerdns的数据库用户: #### +*创建PowerDNS数据库* + +7、 接下来,我们将创建一个名为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) -创建PowerDNS用户 + +*创建PowerDNS用户* **注意**: 请将“tecmint123”替换为你想要设置的实际密码。 -#### 8. 我们继续创建PowerDNS要使用的数据库表。像堆积木一样执行以下这些: #### +8、 我们继续创建PowerDNS要使用的数据库表。像堆积木一样执行以下这些: MariaDB [(none)]> USE powerdns; MariaDB [(none)]> CREATE TABLE domains ( @@ -143,7 +150,8 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 ); ![Create Table Domains for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Table-Domains-for-PowerDNS.png) -创建用于PowerDNS的表域 + +*创建用于PowerDNS的表domains* MariaDB [(none)]> CREATE UNIQUE INDEX name_index ON domains(name); MariaDB [(none)]> CREATE TABLE records ( @@ -158,15 +166,17 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 primary key(id) ); -![Create Index Domains for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Index-Domains-for-PowerDNS.png) -创建用于PowerDNS的索引域 +![Create Table Records for PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Index-Domains-for-PowerDNS.png) + +*创建用于PowerDNS的表 records* 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 of Table](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Records.png) + +*创建表索引* MariaDB [(none)]> CREATE TABLE supermasters ( ip VARCHAR(25) NOT NULL, @@ -175,13 +185,14 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 ); ![Create Table Supermaster](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Table-Supermaster.png) -创建表的超主 -你现在可以输入以下命令退出MySQL控制台: +*创建表supermasters* + +你现在可以输入以下命令退出MariaDB控制台: MariaDB [(none)]> quit; -#### 9. 最后,我们可以继续以MySQL作为后台的方式配置PowerDNS。请打开PowerDNS的配置文件: #### +9、 最后,我们可以继续配置PowerDNS了,以MariaDB作为后台。请打开PowerDNS的配置文件: # vim /etc/pdns/pdns.conf @@ -203,35 +214,39 @@ PowerDNS授权服务器的最新版本是3.4.4,但是当前EPEL仓库中可以 修改“user-pass”为你先前设置的实际密码,配置如下: ![Configure PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-PowerDNS.png) -配置PowerDNS + +*配置PowerDNS* 保存修改并退出。 -#### 10. 现在,我们将启动并添加PowerDNS到系统开机启动列表: #### +10、 现在,我们将启动并添加PowerDNS到系统开机启动列表: # 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) -启用并启动PowerDNS + +*启用并启动PowerDNS* 到这一步,你的PowerDNS服务器已经起来并运行了。要获取更多关于PowerDNS的信息,你可以参考手册[http://downloads.powerdns.com/documentation/html/index.html][1] -### 步骤 2: 安装PowerAdmin来管理PowerDNS ### +### 第二部分: 安装PowerAdmin来管理PowerDNS ### -#### 11. 现在,我们将安装PowerAdmin——一个友好的网页接口PowerDNS服务器管理器。由于它是用PHP写的,我们将需要安装PHP和一台网络服务器(Apache): #### +11、 现在,我们将安装PowerAdmin——一个界面友好的PowerDNS服务器的 Web 管理器。由于它是用PHP写的,我们将需要安装PHP和一台网络服务器(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) -安装Apache PHP + +*安装Apache 和 PHP* PowerAdmin也需要两个PEAR包: # 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) -安装Pear + +*安装Pear* 你也可以参考一下文章了解CentOS 7中安装LAMP堆栈的完整指南: @@ -243,58 +258,66 @@ PowerAdmin也需要两个PEAR包: # systemctl start httpd.service ![Enable Start Apache System Boot](http://www.tecmint.com/wp-content/uploads/2015/04/Enable-Start-Apache-System-Boot.png) -启用Apache开机启动 -#### 12. 由于已经满足PowerAdmin的所有系统要求,我们可以继续下载软件包。因为Apache默认的网页目录位于/var/www/html/,我们将下载软件包到这里。 #### +*启用Apache开机启动* + +12、 由于已经满足PowerAdmin的所有系统要求,我们可以继续下载软件包。因为Apache默认的网页目录位于/var/www/html/,我们将下载软件包到这里。 # 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) -下载PowerAdmin -#### 13. 现在,我们可以启动PowerAdmin的网页安装器了,只需打开: #### +*下载PowerAdmin* + +13、 现在,我们可以启动PowerAdmin的网页安装器了,只需打开: http://192.168.0.102/poweradmin-2.1.7/install/ 这会进入安装过程的第一步: ![Select Installation Language](http://www.tecmint.com/wp-content/uploads/2015/04/Select-Installation-Language.png) -选择安装语言 + +*选择安装语言* 上面的页面会要求你为PowerAdmin选择语言,请选择你想要使用的那一个,然后点击“进入步骤 2”按钮。 -#### 14. 安装器需要PowerDNS数据库: #### +14、 安装器需要PowerDNS数据库: ![PowerDNS Database](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Database.png) -PowerDNS数据库 -#### 15. 因为我们已经创建了一个,所以我们可以继续进入下一步。你会被要求提供先前配置的数据库详情,你也需要为Poweradmin设置管理员密码: #### +*PowerDNS数据库* + +15、 因为我们已经创建了一个数据库,所以我们可以继续进入下一步。你会被要求提供先前配置的数据库详情,你也需要为Poweradmin设置管理员密码: ![Enter PowerDNS Database Settings](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS.png) -输入PowerDNS数据库配置 -#### 16. 输入这些信息后,进入步骤 4。你将创建为Poweradmin创建一个受限用户。这里你需要输入的字段是: #### +*输入PowerDNS数据库配置* -- 用户名 - PowerAdmin用户名。 -- 密码 – 上述用户的密码。 -- 注册人 - 当创建SOA记录而你没有制定注册人时,该值会被使用。 -- 辅助域名服务器 – 该值在创建新的DNS区域时会被用于作为主域名服务器。 +16、 输入这些信息后,进入步骤 4。你将创建为Poweradmin创建一个受限用户。这里你需要输入的字段是: + +- 用户名(Username) - PowerAdmin用户名。 +- 密码(Password) – 上述用户的密码。 +- 主机管理员(Hostmaster) - 当创建SOA记录而你没有指定主机管理员时,该值会被用作默认值。 +- 主域名服务器 - 该值在创建新的DNS区域时会被用于作为主域名服务器。 +- 辅域名服务器 – 该值在创建新的DNS区域时会被用于作为辅域名服务器。 ![PowerDNS Configuration Settings](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Configuration-Settings.png) -PowerDNS配置设置 -#### 17. 在下一步中,Poweradmin会要求你在数据库表中创建新的受限数据库用户,它会提供你需要在MySQL控制台输入的代码: #### +*PowerDNS配置设置* + +17、 在下一步中,Poweradmin会要求你在数据库表中创建一个新的受限数据库用户,它会提供你需要在MariaDB控制台输入的代码: ![Create New Database User](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Database-User.png) -创建新的数据库用户 -#### 18. 现在打开终端并运行: #### +*创建新的数据库用户* + +18、 现在打开终端并运行: # mysql -u root -p -提供你的密码并执行由Poweradmin提供的代码: +提供你的密码并执行由PowerAdmin提供的代码: MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE ON powerdns.* @@ -302,27 +325,30 @@ PowerDNS配置设置 IDENTIFIED BY '123qweasd'; ![Grant Mysql Permissions to User](http://www.tecmint.com/wp-content/uploads/2015/04/Grant-Mysql-Permissions-to-User.png) -为用户授予Mysql权限 -#### 19. 现在,回到浏览器中并继续下一步。安装器将尝试创建配置文件到/var/www/html/poweradmin-2.1.7/inc。 #### +*为用户授予Mysql权限* + +19、 现在,回到浏览器中并继续下一步。安装器将尝试创建配置文件到/var/www/html/poweradmin-2.1.7/inc。 文件名是config.inc.php。为防止该脚本没有写权限,你可以手动复制这些内容到上述文件中: ![Configuration Settings of PowerDNS](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Configuration.png) -配置PowerDNS设置 -#### 20. 现在,进入最后页面,该页面会告知你安装已经完成以及如何访问安装好的Poweradmin: #### +*配置PowerDNS设置* + +20、 现在,进入最后页面,该页面会告知你安装已经完成以及如何访问安装好的PowerAdmin: ![PowerDNS Installation Completed](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Installation-Completed.png) -PowerDNS安装完成 -你可以通过运行以下命令来启用其他动态DNS提供商的URL: +*PowerDNS安装完成* + +你可以通过运行以下命令来启用用于其他动态DNS提供商的URL: # cp install/htaccess.dist .htaccess 出于该目的,你将需要在Apache的配置中启用mod_rewrite。 -#### 21. 现在,需要移除从Poweradmin的根目录中移除“install”文件夹,这一点很重要。使用以下命令: #### +21、 现在,需要移除从PowerAdmin的根目录中移除“install”文件夹,这一点很重要。使用以下命令: # rm -fr /var/www/html/poweradmin/install/ @@ -331,78 +357,86 @@ PowerDNS安装完成 http://192.168.0.102/poweradmin-2.1.7/ ![PowerDNS Login](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Login.png) -PowerDNS登录 -在登录后,你应该会看到Poweradmin的主页: +*PowerDNS登录* + +在登录后,你应该会看到PowerAdmin的主页: ![PowerDNS Dashboard](http://www.tecmint.com/wp-content/uploads/2015/04/PowerDNS-Dashboard.png) -PowerDNS仪表盘 + +*PowerDNS仪表盘* 到这里,安装已经完成了,你也可以开始管理你的DNS区域了。 -### 步骤 3: PowerDNS中添加、编辑和删除DNS区域 ### +### 第三部分: PowerDNS中添加、编辑和删除DNS区域 ### -#### 22. 要添加新的主区域,只需点击“添加主区域”: #### +22、 要添加新的主区域,只需点击“添加主区域”: ![Add Master Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Add-Master-Zone.png) -添加主区域 + +*添加主区域* 在下一页中,你需要填写一些东西: -- 域 – 你要添加区域的域。 -- 所有者 – 设置DNS区域的所有者。 -- 模板 – DNS模板 – 留空。 -- DNSSEC – Donany名称系统安全扩展(可选——检查你是否需要)。 +- 域(Domain) – 你要添加区域的域。 +- 所有者(Owner) – 设置DNS区域的所有者。 +- 模板(Template)– DNS模板 – 留空。 +- DNSSEC – 域名系统安全扩展(可选——看看你是否需要)。 点击“添加区域”按钮来添加DNS区域。 ![Master DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Master-DNS-Zone.png) -主DNS区域 -现在,你可以点击“首页”链接回到Poweradmin的首页。要查看所有现存的DNS区域,只需转到“列出区域”: +*主DNS区域* + +现在,你可以点击“首页”链接回到PowerAdmin的首页。要查看所有现存的DNS区域,只需转到“列出区域(List Zones)”: ![Check List of Zones](http://www.tecmint.com/wp-content/uploads/2015/04/Check-List-Zones.png) -检查区域列表 + +*查看区域列表* 你现在应该看到一个可用DNS区域列表: ![Check List of DNS Zones](http://www.tecmint.com/wp-content/uploads/2015/04/DNS-Zones.png) -检查DNS区域列表 -#### 23. 要编辑现存DNS区域或者添加新的记录,点击编辑图标: #### +*检查DNS区域列表* + +23、 要编辑现存DNS区域或者添加新的记录,点击编辑图标: ![Edit DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Edit-DNS-Zone.png) -编辑DNS区域 + +*编辑DNS区域* 在接下来的页面,你会看到你选择的DNS区域的条目: ![Domain DNS Zone Entries](http://www.tecmint.com/wp-content/uploads/2015/04/Domain-DNS.png) -主DNS区域条目 -#### 24. 在此处添加新的DNS区域,你需要设置以下信息: #### +*域名的DNS区域条目* -- 名称 – 条目名称。只需添加域/子域的第一部分,Poweradmin会添加剩下的。 -- 类型 – 选择记录类型。 -- 优先级 – 记录优先级。 +24、 在此处添加新的DNS条目,你需要设置以下信息: + +- 名称(Name) – 条目名称。只需添加域/子域的第一部分,PowerAdmin会添加剩下的。 +- 类型(Type) – 选择记录类型。 +- 优先级(Priority) – 记录优先级。 - TTL – 存活时间,以秒计算。 出于本文目的,我将为子域new.example.com添加一个A记录用于解析IP地址192.168.0.102,设置存活时间为14400秒: ![Add New DNS Record](http://www.tecmint.com/wp-content/uploads/2015/04/Add-New-DNS-Record.png) -添加新DNS记录 + +*添加新DNS记录* 最后,点击“添加记录”按钮。 -#### 25. 如果你想要删除DNS区域,你可以回到“列出区域”页面,然后点击你想要删除的DNS区域旁边“垃圾桶”图标: #### +25、 如果你想要删除DNS区域,你可以回到“列出区域”页面,然后点击你想要删除的DNS区域旁边“垃圾桶”图标: ![Delete DNS Zone](http://www.tecmint.com/wp-content/uploads/2015/04/Delete-DNS-Zone.png) -删除DNS区域 + +*删除DNS区域* Poweradmin将问你是否确定想要删除DNS区域。只需点击“是”来完成删除。 -如要获取更多关于怎样创建、编辑和删除区域的说明,你可以参与Poweradmin的文档: - -[https://github.com/poweradmin/poweradmin/wiki/Documentation][3] +如要获取更多关于怎样创建、编辑和删除区域的说明,你可以参与Poweradmin的文档:[https://github.com/poweradmin/poweradmin/wiki/Documentation][3] 我希望你已经发现本文很有趣,也很有用。一如既往,如果你有问题或要发表评论,请别犹豫,在下面评论区提交你的评论吧。 @@ -412,7 +446,7 @@ via: http://www.tecmint.com/install-powerdns-poweradmin-mariadb-in-centos-rhel/ 作者:[Marin Todorov][a] 译者:[GOLinux](https://github.com/GOLinux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md b/published/201506/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md similarity index 80% rename from translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md rename to published/201506/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md index cd90e2bfb7..786e06b436 100644 --- a/translated/tech/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md +++ b/published/201506/20150504 Useful Commands to Create Commandline Chat Server and Remove Unwanted Packages in Linux.md @@ -2,33 +2,35 @@ Linux中,创建聊天服务器、移除冗余软件包的实用命令 ============================================================================= 这里,我们来看Linux命令行实用技巧的下一个部分。如果你错过了Linux Tracks之前的文章,可以从这里找到。 -- [5 Linux Command Line Tracks][1] +- [5个有趣的Linux命令行技巧][1] 本篇中,我们将会介绍6个命令行小技巧,包括使用Netcat命令创建Linux命令行聊天,从某个命令的输出中对某一列做加法,移除Debian和CentOS上多余的包,从命令行中获取本地与远程的IP地址,在终端获得彩色的输出与解码各样的颜色,最后是Linux命令行里井号标签的使用。让我们来一个一个地看一下。 ![Linux Commandline Chat Server](http://www.tecmint.com/wp-content/uploads/2015/04/linux-commandline-chat-server.jpg) -6个实用的命令行技巧 + +*6个实用的命令行技巧* ### 1. 创建Linux命令行聊天服务 ### -我们大家使用聊天服务都有很长一段时间了。对于Google Chat,Hangout,Facebook Chat,Whatsapp,Hike和其他一些应用与集成的聊天服务,我们都很熟悉了。那你知道Linux的nc命令可以使你的Linux盒子变成一个聊天服务器,而仅仅只需要一行命令吗。什么是nc命令,它又是怎么工作的呢? -nc是Linux netcat命令的旧版。nc就像瑞士军刀一样,内建呢大量的功能。nc可用做调式工具,调查工具,使用TCP/UDP读写网络连接,DNS正向/反向检查。 +我们大家使用聊天服务都有很长一段时间了。对于Google Chat,Hangout,Facebook Chat,Whatsapp,Hike和其他一些应用与集成的聊天服务,我们都很熟悉了。那你知道Linux的nc命令可以使你的Linux机器变成一个聊天服务器,而仅仅只需要一行命令吗。什么是nc命令,它又是怎么工作的呢? + +nc即Linux netcat命令。nc就像瑞士军刀一样,内建了大量的功能。nc可用做调式工具,调查工具,使用TCP/UDP读写网络连接,DNS正向/反向查询等等。 nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使用任何闲置的端口和任何本地网络源地址。 使用nc命令(在192.168.0.7的服务器上)创建一个命令行即时信息传输服务器。 - $ nc -l -vv 11119 + $ nc -l -vv -p 11119 对上述命令的解释。 -- -v : 表示 Verbose -- -vv : 更多的 Verbose +- -v : 显示冗余信息 +- -vv : 显示更多的冗余信息 - -p : 本地端口号 你可以用任何其他的本地端口号替换11119。 -接下来在客户端机器(IP地址:192.168.0.15),运行下面的命令初始化聊天会话(信息传输服务正在运行)。 +接下来在客户端机器(IP地址:192.168.0.15),运行下面的命令初始化聊天会话(这里需要上面提到的信息服务器正在运行)。 $ nc 192.168.0.7:11119 @@ -38,7 +40,7 @@ nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使 ### 2. Linux中如何统计某一列的总值 ### -如何统计在终端里,某个命令的输出中,其中一列的数值总和, +如何在终端里统计某个命令的输出中其中一列的数值总和, ‘ls -l’命令的输出。 @@ -64,7 +66,7 @@ nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使 废弃包是指那些作为其他包的依赖而被安装,但是当源包被移除之后就不再需要的包。 -假设我们安装了gtprogram,依赖是gtdependency。除非我们安装了gtdependency,否则安装不了gtprogram。 +假设我们安装了一个叫gtprogram的软件包,其依赖是gtdependency。除非我们安装了gtdependency,否则安装不了gtprogram。 当我们移除gtprogram的时候,默认并不会移除gtdependency。并且如果我们不移除gtdependency的话,它就会遗留下来成为废弃包,与其他任何包再无联系。 @@ -116,13 +118,13 @@ nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使 ### 5.如何在Linux终端彩色输出 ### -你可能在终端看见过彩色的输出。同时你也可能知道在终端里允许/禁用彩色输出。如果都不知道的话,里可以参考下面的步骤。 +你可能在终端看见过彩色的输出。同时你也可能知道在终端里允许/禁用彩色输出。如果都不知道的话,你可以参考下面的步骤。 在Linux中,每个用户都有`'.bashrc'`文件,被用来管理你的终端输出。打开并且编辑该文件,用你喜欢的编辑器。注意一下,这个文件是隐藏的(文件开头为点的代表隐藏文件)。 $ vi /home/$USER/.bashrc -确保以下的行没有被注释掉。ie.,行开头没有#。 +确保以下的行没有被注释掉。即,行开头没有#。 if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dirc$ @@ -139,27 +141,27 @@ nc主要用在端口扫描,文件传输,后台和端口监听。nc可以使 完成后!保存并退出。为了让改动生效,需要注销账户后再次登录。 -现在,你会看见列出的文件和文件夹名字有着不同的颜色,根据文件类型来决定。为了解码颜色,可以运行下面的命令。 +现在,你会看见列出的文件和文件夹名字有着不同的颜色,根据文件类型来决定。要了解所用的颜色代码,可以运行下面的命令。 $ dircolors -p | less ![Linux Color Output](http://www.tecmint.com/wp-content/uploads/2015/04/Linux-Color-Output.gif) -### 6.如何用井号标记和Linux命令和脚本 ### +### 6.如何用#号标记Linux命令和脚本 ### -我们一直在Twitter,Facebook和Google Plus(可能是其他我们没有提到的地方)上使用井号标签。那些井号标签使得其他人搜索一个标签更加容易。可是很少人知道,我们可以在Linux命令行使用井号标签。 +我们一直在Twitter,Facebook和Google Plus(可能是其他我们没有提到的地方)上使用#号标签。那些#号标签使得其他人搜索一个标签更加容易。可是很少人知道,我们可以在Linux命令行使用#号标签。 我们已经知道配置文件里的`#`,在大多数的编程语言中,这个符号被用作注释行,即不被执行。 -运行一个命令,然后为这个命令创建一个井号标签,这样之后我们就可以找到它。假设我们有一个很长的脚本,就上面第四点被执行的命令。现在为它创建一个井号标签。我们知道ifconfig可以被sudo或者root执行,因此用root来执行。 +运行一个命令,然后为这个命令创建一个#号标签,这样之后我们就可以找到它。假设我们有一个很长的脚本,就上面第四点被执行的命令。现在为它创建一个#号标签。我们知道ifconfig可以被sudo或者root执行,因此用root来执行。 # ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: #myip -上述脚本被’mytag‘给标记了。现在在reverse-i-search(按下ctrl+r)搜索一下这个标签,在终端里,并输入’mytag‘。你可以从这里开始执行。 +上述脚本被’myip‘给标记了。现在在reverse-i-search(按下ctrl+r)搜索一下这个标签,在终端里,并输入’myip‘。你可以从这里开始执行。 ![Create Command Hash Tags](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Command-Hash-Tags.gif) -你可以创建很多的井号标签,为每个命令,之后使用reverse-i-search找到它。 +你可以为每个命令创建#号标签,之后使用reverse-i-search找到它。 目前就这么多了。我们一直在辛苦的工作,创造有趣的,有知识性的内容给你。你觉得我们是如何工作的呢?欢迎咨询任何问题。你可以在下面评论。保持联络!Kudox。 @@ -169,9 +171,9 @@ via: http://www.tecmint.com/linux-commandline-chat-server-and-remove-unwanted-pa 作者:[Avishek Kumar][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://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/5-linux-command-line-tricks/ +[1]:https://linux.cn/article-5485-1.html diff --git a/translated/tech/20150506 First Step Guide for Learning Shell Scripting.md b/published/201506/20150506 First Step Guide for Learning Shell Scripting.md similarity index 85% rename from translated/tech/20150506 First Step Guide for Learning Shell Scripting.md rename to published/201506/20150506 First Step Guide for Learning Shell Scripting.md index af71b8f4ca..6369c96c8a 100644 --- a/translated/tech/20150506 First Step Guide for Learning Shell Scripting.md +++ b/published/201506/20150506 First Step Guide for Learning Shell Scripting.md @@ -1,4 +1,4 @@ -Shell脚本学习初次操作指南 +Shell脚本编程初体验 ================================================================================ ![](http://blog.linoxide.com/wp-content/uploads/2015/04/myfirstshellscript.jpg) @@ -18,33 +18,33 @@ Linux世界中最为流行的shell脚本语言之一,就是bash。而我认为 shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象成能帮你做事的那些人,只要你用正确的方式来请求他们去做。比如说,你想要写文档。首先,你需要纸。然后,你需要把内容说给某个人听,让他帮你写。最后,你想要把它存放到某个地方。或者说,你想要造一所房子,因而你需要请合适的人来清空场地。在他们说“事情干完了”,那么另外一些工程师就可以帮你来砌墙。最后,当这些工程师们也告诉你“事情干完了”的时候,你就可以叫油漆工来给房子粉饰了。如果你让油漆工在墙砌好前就来粉饰,会发生什么呢?我想,他们会开始发牢骚了。几乎所有这些像人一样的命令都会说话,如果它们完成了工作而没有发生什么问题,那么它们就会告诉“标准输出”。如果它们不能做你叫它们做的事——它们会告诉“标准错误”。这样,最后,所有的命令都通过“标准输入”来听你的话。 -快速实例——当你打开linux终端并写一些文本时——你正通过“标准输入”和bash说话。那么,让我们来问问bash shell **who am i**吧。 +快速实例——当你打开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 + root@localhost ~]# who am i <--- 你通过标准输入对 bash shell 说 + root pts/0 2015-04-22 20:17 (192.168.1.123) <--- bash shell通过标准输出回答你 现在,让我们说一些bash听不懂的问题: [root@localhost ~]# blablabla <--- 哈,你又在和标准输入说话了 -bash: blablabla: command not found <--- bash通过标准错误在发牢骚了 -“:”之前的第一个单词通常是向你发牢骚的命令。实际上,这些流中的每一个都有它们自己的索引号: +“:”之前的第一个单词通常是向你发牢骚的命令。实际上,这些流中的每一个都有它们自己的索引号(LCTT 译注:文件句柄号): - 标准输入(**stdin**) - 0 - 标准输出(**stdout**) - 1 - 标准错误(**stderr**) - 2 -如果你真的想要知道哪个输出命令说了些什么——你需要重定向(在命令后使用大于号“>”和流索引)那次发言到文件: +如果你真的想要知道哪个输出命令说了些什么——你需要将那次发言重定向到(在命令后使用大于号“>”和流索引)文件: [root@localhost ~]# blablabla 1> output.txt -bash: blablabla: command not found -在本例中,我们试着重定向1(**stdout**)流到名为output.txt的文件。让我们来看对该文件内容所做的事情吧,使用cat命令可以做这事: +在本例中,我们试着重定向流1(**stdout**)到名为output.txt的文件。让我们来看对该文件内容所做的事情吧,使用cat命令可以做这事: [root@localhost ~]# cat output.txt [root@localhost ~]# -看起来似乎是空的。好吧,现在让我们来重定向2(**stderr**)流: +看起来似乎是空的。好吧,现在让我们来重定向流2(**stderr**): [root@localhost ~]# blablabla 2> error.txt [root@localhost ~]# @@ -77,17 +77,17 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 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流(上面已经解释过了),而该流会被重定向到同一个文件。让我们看这个实例: +让我来解释一下吧。所有命令的标准输出将被重定向到out_err.txt,错误输出将被重定向到流1(上面已经解释过了),而该流会被重定向到同一个文件。让我们看这个实例: [root@localhost ~]# rm -fv folder2 file2 >out_err.txt 2>&1 [root@localhost ~]# cat out_err.txt @@ -127,7 +127,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 如果你打算grep一些双引号引起来带有空格的内容呢! -注意: fdisk命令显示关于Linux操作系统磁盘驱动器的信息 +注意:fdisk命令显示关于Linux操作系统磁盘驱动器的信息。 就像我们看到的,这种方式很不方便,因为我们不一会儿就把临时文件空间给搞乱了。要完成该任务,我们可以使用管道。它们允许我们重定向一个命令的**stdout**到另一个命令的**stdin**流: @@ -147,11 +147,11 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 正如我们所知道的,通常,与shell的交流以及shell内的交流是以对话的方式进行的。因此,让我们创建一些真正的脚本吧,这些脚本也会和我们讲话。这会让你学到一些简单的命令,并对脚本的概念有一个更好的理解。 -假设我们是某个公司的总服务台经理,我们想要创建某个shell脚本来注册呼叫信息:电话号码、用户名以及问题的简要描述。我们打算把这些信息存储到普通文本文件data.txt中,以便今后统计。脚本它自己就是以对话的方式工作,这会让总服务台的工作人员的小日子过得轻松点。那么,首先我们需要显示问题。对于现实信息,我们可以用echo和printf命令。这两个都是用来显示信息的,但是printf更为强大,因为我们可以通过它很好地格式化输出,我们可以让它右对齐、左对齐或者为信息留出专门的空间。让我们从一个简单的例子开始吧。要创建文件,请使用你喜欢的文本编辑器(kate,nano,vi,……),然后创建名为note.sh的文件,里面写入这些命令: +假设我们是某个公司的总服务台经理,我们想要创建某个shell脚本来注册呼叫信息:电话号码、用户名以及问题的简要描述。我们打算把这些信息存储到普通文本文件data.txt中,以便今后统计。脚本它自己就是以对话的方式工作,这会让总服务台的工作人员的小日子过得轻松点。那么,首先我们需要显示提问。对于显示信息,我们可以用echo和printf命令。这两个都是用来显示信息的,但是printf更为强大,因为我们可以通过它很好地格式化输出,我们可以让它右对齐、左对齐或者为信息留出专门的空间。让我们从一个简单的例子开始吧。要创建文件,请使用你惯用的文本编辑器(kate,nano,vi,……),然后创建名为note.sh的文件,里面写入这些命令: echo "Phone number ?" - -### Script执行 ### + +### 如何运行/执行脚本? ### 在保存文件后,我们可以使用bash命令来运行,把我们的文件作为它的参数: @@ -176,7 +176,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 [root@localhost ~]# ./note.sh Phone number ? -在脚本名前,我添加了./组合。.(点)在unix世界中意味着当前位置(当前文件夹),/(斜线)是文件夹分隔符。(在Windows系统中,我们使用\(反斜线)实现同样功能)所以,这整个组合的意思是说:“从当前文件夹执行note.sh脚本”。我想,如果我用完整路径来运行这个脚本的话,你会更加清楚一些: +在脚本名前,我添加了 ./ 组合。.(点)在unix世界中意味着当前位置(当前文件夹),/(斜线)是文件夹分隔符。(在Windows系统中,我们使用反斜线 \ 表示同样功能)所以,这整个组合的意思是说:“从当前文件夹执行note.sh脚本”。我想,如果我用完整路径来运行这个脚本的话,你会更加清楚一些: [root@localhost ~]# /root/note.sh Phone number ? @@ -184,7 +184,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 它也能工作。 -如果所有linux用户都有相同的默认shell,那就万事OK。如果我们只是执行该脚本,默认的用户shell就会用于解析脚本内容并运行命令。不同的shell有着一丁点不同的语法、内部命令等等,所以,为了保证我们的脚本会使用**bash**,我们应该添加**#!/bin/bash**到文件首行。这样,默认的用户shell将调用**/bin/bash**,而只有在那时候,脚本中的命令才会被执行: +如果所有linux用户都有相同的默认shell,那就万事OK。如果我们只是执行该脚本,默认的用户shell就会用于解析脚本内容并运行命令。不同的shell的语法、内部命令等等有着一丁点不同,所以,为了保证我们的脚本会使用**bash**,我们应该添加**#!/bin/bash**到文件首行。这样,默认的用户shell将调用**/bin/bash**,而只有在那时候,脚本中的命令才会被执行: [root@localhost ~]# cat note.sh #!/bin/bash @@ -194,13 +194,13 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 ### 读取输入 ### -在现实信息后,脚本会等待用户回答。那儿有个**read**命令用来接收用户的回答: +在显示信息后,脚本会等待用户回答。有个**read**命令用来接收用户的回答: #!/bin/bash echo "Phone number ?" read phone -在执行后,脚本会等待用户输入,直到用户按[ENTER]键: +在执行后,脚本会等待用户输入,直到用户按[ENTER]键结束输入: [root@localhost ~]# ./note.sh Phone number ? @@ -220,7 +220,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 You have entered 123456 as a phone number [root@localhost ~]# -在**bash** shell中,我们使用**$**(美元)符号作为变量标示,除了读入到变量和其它为数不多的时候(将在今后说明)。 +在**bash** shell中,一般我们使用**$**(美元)符号来表明这是一个变量,除了读入到变量和其它为数不多的时候才不用这个$(将在今后说明)。 好了,现在我们准备添加剩下的问题了: @@ -244,7 +244,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 太完美了!剩下来就是重定向所有东西到文件data.txt了。作为字段分隔符,我们将使用/(斜线)符号。 -**注意** : 你可以选择任何你认为是最好,但是确保文件内容不会包含这些符号在内。它会导致在文本行中产生额外字段。 +**注意** : 你可以选择任何你认为是最好的分隔符,但是确保文件内容不会包含这些符号在内,否则它会导致在文本行中产生额外字段。 别忘了使用“>>”来代替“>”,因为我们想要将输出内容附加到文件末! @@ -262,7 +262,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 987/Jimmy/Keybord issue. [root@localhost ~]# -**注意** : **tail**命令显示了文件的最后**-n**行。 +**注意** : **tail**命令显示了文件的最后的**n**行。 搞定。让我们再来运行一次看看: @@ -285,7 +285,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 [root@localhost ~]# date "+%Y.%m.%d %H:%M:%S" 2015.04.23 21:33:18 <---- 格式化后的输出 -有几种方式可以读取命令输出到变脸,在这种简单的情况下,我们将使用`(反引号): +有几种方式可以读取命令的输出到变量,在这种简单的情况下,我们将使用`(是反引号,不是单引号,和波浪号~在同一个键位): [root@localhost ~]# cat note.sh #!/bin/bash @@ -320,7 +320,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 你可以直接从控制台查找到各个命令的大量有趣的信息,只需输入:**man read, man echo, man date, man ……** -同意吗?它看上去是好多了! +同意吗?它看上去是舒服多了! [root@localhost ~]# ./note.sh Phone number: 321 @@ -331,9 +331,9 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 2015.04.23 21:43:50/321/Susane/Mouse was stolen [root@localhost ~]# -光标在消息的后面(不是在新的一行中),这有点意思。 +光标在消息的后面(不是在新的一行中),这有点意思。(LCTT 译注:如果用 echo 命令输出显示的话,可以用 -n 参数来避免换行。) -循环 +### 循环 ### 是时候来改进我们的脚本了。如果用户一整天都在接电话,如果每次都要去运行,这岂不是很麻烦?让我们让这些活动都永无止境地循环去吧: @@ -348,7 +348,7 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 echo "$now/$phone/$name/$issue">>data.txt done -我已经交换了**read phone**和**now=`date`**行。这是因为我想要在输入电话号码后再获得时间。如果我把它放在循环**- the**的首行,变量就会在数据存储到文件中后获得时间。而这并不好,因为下一次呼叫可能在20分钟后,甚至更晚。 +我已经交换了**read phone**和**now=`date`**行的位置。这是因为我想要在输入电话号码后再获得时间。如果我把它放在循环的首行,那么循环一次后,变量 now 就会在数据存储到文件中后马上获得时间。而这并不好,因为下一次呼叫可能在20分钟后,甚至更晚。 [root@localhost ~]# ./note.sh Phone number: 123 @@ -365,11 +365,11 @@ shell脚本语言就跟和几个人聊天类似。你只需把所有命令想象 2015.04.23 21:48:16/777/Daniel/I broke my monitor [root@localhost ~]# -注意: 要从无限循环中退出,你可以按[Ctrl]+[C]键。Shell会显示^表示Ctrl键。 +注意: 要从无限循环中退出,你可以按[Ctrl]+[C]键。Shell会显示\^表示Ctrl键。 ### 使用管道重定向 ### -让我们添加更多功能到我们的“弗兰肯斯坦”,我想要脚本在每次呼叫后显示某个统计数据。比如说,我想要查看各个号码呼叫了我几次。对于这个,我们应该cat文件data.txt: +让我们添加更多功能到我们的“弗兰肯斯坦(Frankenstein)”,我想要脚本在每次呼叫后显示某个统计数据。比如说,我想要查看各个号码呼叫了我几次。对于这个,我们应该cat文件data.txt: [root@localhost ~]# cat data.txt 2015.04.23 21:38:56/123/Jim/Script hanging. @@ -453,7 +453,7 @@ via: http://linoxide.com/linux-shell-script/guide-start-learning-shell-scripting 作者:[Petras Liumparas][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/) 荣誉推出 diff --git a/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md b/published/201506/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md similarity index 69% rename from translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md rename to published/201506/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md index 0cd972b425..0035432ecb 100644 --- a/translated/tech/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md +++ b/published/201506/20150506 How to Setup OpenERP (Odoo) on CentOS 7.x.md @@ -2,7 +2,7 @@ ================================================================================ 各位好,这篇教程关于的是如何在CentOS 7中安装Odoo(就是我们所知的OpenERP)。你是不是在考虑为你的业务安装一个不错的ERP(企业资源规划)软件?那么OpenERP就是你寻找的最好的程序,因为它是一款为你的商务提供杰出特性的自由开源软件。 -[OpenERP][1]是一款自由开源的传统的OpenERP(企业资源规划),它包含了开源CRM、网站构建、电子商务、项目管理、计费账务、销售点、人力资源、市场、生产、采购管理以及其他模块用于提高效率及销售。Odoo可以作为独立程序,但是它可以无缝集成因此你可以在安装数个程序后得到一个全功能的开源ERP。 +[OpenERP][1]是一款自由开源的传统的OpenERP(企业资源规划),它包含了开源CRM、网站构建、电子商务、项目管理、计费账务、POS、人力资源、市场、生产、采购管理以及其它模块用于提高效率及销售。Odoo中的应用可以作为独立程序使用,它们也可以无缝集成到一起,因此你可以在安装几个程序来得到一个全功能的开源ERP。 因此,下面是在你的CentOS上安装OpenERP的步骤。 @@ -13,13 +13,13 @@ # yum clean all # yum update -现在我们要安装PostgreSQL,因为OpenERP使用PostgreSQL作为他的数据库。要安装它,我们需要运行下面的命令。 +现在我们要安装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 @@ -42,13 +42,13 @@ ### 2. 设置Odoo仓库 ### -在初始化数据库初始化完成后,我们要添加EPEL(企业版Linux的额外包)到我们的CentOS中。Odoo(或者OpenERP)依赖于Python运行时以及其他包没有包含在标准仓库中。这样我们要位企业版Linux添加额外的包仓库支持来解决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)的仓库。 +现在,安装EPEL后,我们现在使用yum-config-manager添加Odoo(OpenERP)的仓库。 # yum install yum-utils @@ -73,16 +73,16 @@ ![Starting Odoo](http://blog.linoxide.com/wp-content/uploads/2015/03/starting-odoo.png) -### 4. 防火墙允许 ### +### 4. 打开防火墙 ### -因为Odoo使用8069端口,我们需要在防火墙中允许远程访问。我们使用下面的命令来在防火墙中允许8069防火墙。 +因为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添加下面图片中一行** +**注意:默认情况下只有本地才允许连接数据库。如果我们要允许PostgreSQL的远程访问,我们需要在pg_hba.conf添加下面图片中一行** # nano /var/lib/pgsql/data/pg_hba.conf @@ -90,13 +90,13 @@ ### 5. Web接口 ### -我们已经在CentOS 7中安装了最新的Odoo 8(OpenERP),我们可以在浏览器中输入http://ip-address:8069来访问Odoo。 接着,我们要做的第一件事就是创建一个新的数据库和新的密码。注意,主密码默认是管理员密码。接着,我们可以在面板中输入用户名和密码。 +我们已经在CentOS 7中安装了最新的Odoo 8(OpenERP),我们可以在浏览器中输入`http://ip-address:8069`来访问Odoo。 接着,我们要做的第一件事就是创建一个新的数据库和新的密码。注意,主密码默认是‘admin’。接着,我们可以在面板中输入用户名和密码。 ![Odoo Panel](http://blog.linoxide.com/wp-content/uploads/2015/03/odoo-panel.png) ### 总结 ### -Odoo 8(OpenERP)是世界上最好的开源ERP程序。我们做了一件出色的工作来安装它因为OpenERP是由许多模块组成的针对商务和公司的完整ERP程序。因此,如果你有任何问题、建议、反馈请在下面的评论栏写下。谢谢你!享受OpenERP(Odoo 8)吧 :-) +Odoo 8(OpenERP)是世界上最好的开源ERP程序。OpenERP是由许多模块组成的针对商务和公司的完整ERP程序,我们已经把它安装好了。因此,如果你有任何问题、建议、反馈请在下面的评论栏写下。谢谢你!享受OpenERP(Odoo 8)吧 :-) -------------------------------------------------------------------------------- @@ -104,7 +104,7 @@ 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) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 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/published/201506/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md similarity index 76% rename from translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md rename to published/201506/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md index 2871298396..fb67d3dd34 100644 --- a/translated/tech/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md +++ b/published/201506/20150506 Linux FAQs with Answers--How to disable entering password for default keyring to unlock on Ubuntu desktop.md @@ -1,12 +1,12 @@ -Linux有问必答——Ubuntu桌面上如何禁用默认的密钥环解锁密码输入 +Linux有问必答:Ubuntu桌面上如何禁用默认的密钥环解锁提示 ================================================================================ >**问题**:当我启动我的Ubuntu桌面时,出现了一个弹出对话框,要求我输入密码来解锁默认的密钥环。我怎样才能禁用这个“解锁默认密钥环”弹出窗口,并自动解锁我的密钥环? -密钥环被认为是用来以加密方式存储你的登录信息的本地数据库。各种桌面应用(如浏览器、电子邮件客户端)使用密钥环来安全地存储并管理你的登录凭证、机密、密码、证书或密钥。对于那些需要检索存储在密钥环中的信息的应用程序,需要解锁该密钥环。 +密钥环是一个以加密方式存储你的登录信息的本地数据库。各种桌面应用(如浏览器、电子邮件客户端)使用密钥环来安全地存储并管理你的登录凭证、机密、密码、证书或密钥。对于那些需要检索存储在密钥环中的信息的应用程序,需要解锁该密钥环。 Ubuntu桌面所使用的GNOME密钥环被整合到了桌面登录中,该密钥环会在你验证进入桌面后自动解锁。但是,如果你设置了自动登录桌面或者是从休眠中唤醒,你默认的密钥环仍然可能“被锁定”的。在这种情况下,你会碰到这一提示: ->“为密钥环‘默认密钥环’输入密码来解锁。某个应用想要访问密钥环‘默认密钥环’,但它被锁定了。” +>“输入密码来解锁密钥环‘默认密钥环’。某个应用想要访问密钥环‘默认密钥环’,但它被锁定了。” > ![](https://farm9.staticflickr.com/8787/16716456754_309c39513c_o.png) @@ -16,7 +16,7 @@ Ubuntu桌面所使用的GNOME密钥环被整合到了桌面登录中,该密钥 ### 禁用默认密钥环解锁密码 ### -打开Dash,然后输入“密码”来启动“密码和密钥”应用。 +打开Dash,然后输入“password”来启动“密码和密钥”应用。 ![](https://farm8.staticflickr.com/7709/17312949416_ed9c4fbe2d_b.jpg) @@ -31,6 +31,7 @@ Ubuntu桌面所使用的GNOME密钥环被整合到了桌面登录中,该密钥 输入你的当前登录密码。 ![](https://farm8.staticflickr.com/7775/17347551135_ce09260818_b.jpg) + 在设置“默认”密钥环新密码的密码框中留空。 ![](https://farm8.staticflickr.com/7669/17345663222_c9334c738b_c.jpg) @@ -47,7 +48,7 @@ via: http://ask.xmodulo.com/disable-entering-password-unlock-default-keyring.htm 作者:[Dan Nanni][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/) 荣誉推出 diff --git a/translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md b/published/201506/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md similarity index 88% rename from translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md rename to published/201506/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md index abe1d3943d..56f57a5020 100644 --- a/translated/tech/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md +++ b/published/201506/20150506 Linux FAQs with Answers--How to install Shrew Soft IPsec VPN client on Linux.md @@ -1,9 +1,9 @@ -Linux有问必答——Linux上如何安装Shrew Soft IPsec VPN +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客户端,它支持多种验证方法、密钥交换、加密以及防火墙穿越选项。 +> **问题**:我需要连接到一个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平台。 @@ -90,7 +90,7 @@ 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) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md b/published/201506/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md similarity index 74% rename from translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md rename to published/201506/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md index d5c2fc98f5..569a50d667 100644 --- a/translated/tech/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md +++ b/published/201506/20150507 Install uGet Download Manager 2.0 in Debian Ubuntu Linux Mint and Fedora.md @@ -1,37 +1,37 @@ 在 Debian, Ubuntu, Linux Mint 及 Fedora 中安装 uGet 下载管理器 2.0 ================================================================================ -在经历了一段漫长的开发期后,期间发布了超过 11 个开发版本,最终 uGet 项目小组高兴地宣布 uGet 的最新稳定版本 uGet 2.0 已经可以下载使用了。最新版本包含许多吸引人的特点,例如一个新的设定对话框,改进了 aria2 插件对 BitTorrent 和 Metalink 协议的支持,同时对位于横栏中的 uGet RSS 信息提供了更好的支持,其他特点包括: +在经历了一段漫长的开发期后,并发布了超过 11 个开发版本,最终 uGet 项目小组高兴地宣布 uGet 的最新稳定版本 uGet 2.0 已经可以下载使用了。最新版本包含许多吸引人的特点,例如一个新的设定对话框,改进了 aria2 插件对 BitTorrent 和 Metalink 协议的支持,同时对位于横幅中的 uGet RSS 信息提供了更好的支持,其他特点包括: -- 一个新的 “检查更新” 按钮,提醒您有关新的发行版本的信息; +- 新增一个 “检查更新” 按钮,提醒您有关新的发行版本的信息; - 增添新的语言支持并升级了现有的语言; -- 增加了一个新的 “信息横栏” ,允许开发者轻松地向所有的用户提供有关 uGet 的信息; -- 通过对文档、提交反馈和错误报告等内容的链接,增强了帮助菜单; +- 新增一个 “信息横幅” ,可以让开发者轻松地向所有的用户提供有关 uGet 的信息; +- 增强了帮助菜单,包括文档、提交反馈和错误报告等内容的链接; - 将 uGet 下载管理器集成到了 Linux 平台下的两个主要的浏览器 Firefox 和 Google Chrome 中; - 改进了对 Firefox 插件 ‘FlashGot’ 的支持; ### 何为 uGet ### -uGet (先前名为 UrlGfe) 是一个开源,免费,且极其强大的基于 GTK 的多平台下载管理器应用程序,它用 C 语言写就,在 GPL 协议下发布。它提供了一大类的功能,如恢复先前的下载任务,支持多重下载,使用一个独立的配置来支持分类,剪贴板监视,下载队列,从 HTML 文件中导出 URL 地址,集成在 Firefox 中的 Flashgot 插件中,使用集成在 uGet 中的 aria2(一个命令行下载管理器) 来下载 torrent 和 metalink 文件。 +uGet (先前名为 UrlGfe) 是一个开源,免费,且极其强大的基于 GTK 的多平台下载管理器应用程序,它用 C 语言写就,在 GPL 协议下发布。它提供了大量功能,如恢复先前的下载任务,支持多点下载,使用一个独立的配置来支持分类,剪贴板监视,下载队列,从 HTML 文件中导出 URL 地址,集成在 Firefox 中的 Flashgot 插件中,使用集成在 uGet 中的 aria2(一个命令行下载管理器) 来下载 torrent 和 metalink 文件。 我已经在下面罗列出了 uGet 下载管理器的所有关键特点,并附带了详细的解释。 #### uGet 下载管理器的关键特点 #### -- 下载队列: 可以将你的下载任务放入一个队列中。当某些下载任务完成后,将会自动开始下载队列中余下的文件; +- 下载队列: 将你的下载任务放入一个队列中。当某些下载任务完成后,将会自动开始下载队列中余下的文件; - 恢复下载: 假如在某些情况下,你的网络中断了,不要担心,你可以从先前停止的地方继续下载或重新开始; - 下载分类: 支持多种分类来管理下载; - 剪贴板监视: 将要下载的文件类型复制到剪贴板中,便会自动弹出下载提示框以下载刚才复制的文件; - 批量下载: 允许你轻松地一次性下载多个文件; - 支持多种协议: 允许你轻松地使用 aria2 命令行插件通过 HTTP, HTTPS, FTP, BitTorrent 及 Metalink 等协议下载文件; - 多连接: 使用 aria2 插件,每个下载同时支持多达 20 个连接; -- 支持 FTP 登录或匿名 FTP 登录: 同时支持使用用户名和密码来登录 FTP 或匿名 FTP ; +- 支持 FTP 登录或 FTP 匿名登录: 同时支持使用用户名和密码来登录 FTP 或匿名 FTP ; - 队列下载: 新增队列下载,现在你可以对你的所有下载进行安排调度; - 通过 FlashGot 与 FireFox 集成: 与作为一个独立支持的 Firefox 插件的 FlashGot 集成,从而可以处理单个或大量的下载任务; - CLI 界面或虚拟终端支持: 提供命令行或虚拟终端选项来下载文件; - 自动创建目录: 假如你提供了一个先前并不存在的保存路径,uGet 将会自动创建这个目录; - 下载历史管理: 跟踪记录已下载和已删除的下载任务的条目,每个列表支持 9999 个条目,比当前默认支持条目数目更早的条目将会被自动删除; - 多语言支持: uGet 默认使用英语,但它可支持多达 23 种语言; -- Aria2 插件: uGet 集成了 Aria2 插件,来为 aria2 提供更友好的 GUI 界面; +- Aria2 插件: uGet 集成了 Aria2 插件,来为你提供更友好的 GUI 界面; 如若你想了解更加完整的特点描述,请访问 uGet 官方的 [特点页面][1]. @@ -43,7 +43,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最 #### 在 Debian 下 #### -在 Debian 的测试版本 (Jessie) 和不稳定版本 (Sid) 中,你可以在一个可信赖的基础上,使用官方的软件仓库轻易地安装和升级 uGet 。 +在 Debian Jessie 和Sid 中,你可以使用官方软件仓库轻易地安装和升级可靠的 uGet 软件包。 $ sudo apt-get update $ sudo apt-get install uget @@ -58,7 +58,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最 #### 在 Fedora 下 #### -在 Fedora 20 – 21 下,最新版本的 uGet(2.0) 可以从官方软件仓库中获得,从这些软件仓库中安装是非常值得信赖的。 +在 Fedora 20 – 21 下,最新版本的 uGet(2.0) 可以从官方软件仓库中获得可靠的软件包。 $ sudo yum install uget @@ -70,7 +70,7 @@ uGet 开发者在 Linux 平台下的各种软件仓库中添加了 uGet 的最 默认情况下,uGet 在当今大多数的 Linux 系统中使用 `curl` 来作为后端,但 aria2 插件将 curl 替换为 aria2 来作为 uGet 的后端。 -aria2 是一个单独的软件包,需要独立安装。你可以在你的 Linux 发行版本下,使用受支持的软件仓库来轻易地安装 aria2 的最新版本,或根据 [下载 aria2 页面][4] 来安装它,该页面详细解释了在各个发行版本中如何安装 aria2 。 +aria2 是一个单独的软件包,需要独立安装。你可以在你的 Linux 发行版下,使用受支持的软件仓库来轻易地安装 aria2 的最新版本,或根据 [下载 aria2 页面][4] 来安装它,该页面详细解释了在各个发行版本中如何安装 aria2 。 #### 在 Debian, Ubuntu 和 Linux Mint 下 #### @@ -91,28 +91,34 @@ Fedora 的官方软件仓库中已经添加了 aria2 软件包,所以你可以 为了启动 uGet,从桌面菜单的搜索栏中键入 "uGet"。可参考如下的截图: ![开启 uGet 下载管理器](http://www.tecmint.com/wp-content/uploads/2014/03/Start-uGet.gif) -开启 uGet 下载管理器 + +*开启 uGet 下载管理器* ![uGet 版本: 2.0](http://www.tecmint.com/wp-content/uploads/2014/03/uGet-Version.gif) -uGet 版本: 2.0 + +*uGet 版本: 2.0* #### 在 uGet 中激活 aria2 插件 #### 为了激活 aria2 插件, 从 uGet 菜单接着到 `编辑 –> 设置 –> 插件` , 从下拉菜单中选择 "aria2"。 ![为 uGet 启用 Aria2 插件](http://www.tecmint.com/wp-content/uploads/2014/03/Enable-Aria2-Plugin.gif) -为 uGet 启用 Aria2 插件 + +*为 uGet 启用 Aria2 插件* ### uGet 2.0 截图赏析 ### ![使用 Aria2 下载文件](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Files-Using-Aria2.gif) -使用 Aria2 下载文件 + +*使用 Aria2 下载文件* ![使用 uGet 下载 Torrent 文件](http://www.tecmint.com/wp-content/uploads/2014/03/Download-Torrent-File.gif) -使用 uGet 下载 Torrent 文件 + +*使用 uGet 下载 Torrent 文件* ![使用 uGet 进行批量下载](http://www.tecmint.com/wp-content/uploads/2014/03/Batch-Download-Files.gif) -使用 uGet 进行批量下载 + +*使用 uGet 进行批量下载* 针对其他 Linux 发行版本和 Windows 平台的 RPM 包和 uGet 的源文件都可以在 uGet 的[下载页面][5] 下找到。 @@ -122,7 +128,7 @@ via: http://www.tecmint.com/install-uget-download-manager-in-linux/ 作者:[Ravi Saive][a] 译者:[FSSlc](https://github.com/FSSlc) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md b/published/201506/20150511 Fix Various Update Errors In Ubuntu 14.04.md similarity index 90% rename from translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md rename to published/201506/20150511 Fix Various Update Errors In Ubuntu 14.04.md index 3780b4f948..085869bde6 100644 --- a/translated/tech/20150511 Fix Various Update Errors In Ubuntu 14.04.md +++ b/published/201506/20150511 Fix Various Update Errors In Ubuntu 14.04.md @@ -1,8 +1,8 @@ -修复Ubuntu 14.04中各种更新错误 +Ubuntu 更新错误修复大全 ================================================================================ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Fix_Ubuntu_Update_Error.jpeg) -在Ubuntu更新中,谁没有碰见个错误?在Ubuntu和其它基于Ubuntu的Linux发行版中,更新错误很常见,也为数不少。这些错误出现的原因多种多样,修复起来也很简单。在本文中,我们将见到Ubuntu中各种类型频繁发生的更新错误以及它们的修复方法。 +在Ubuntu更新中,谁没有碰见个错误?在Ubuntu和其它基于Ubuntu的Linux发行版中,更新错误是一个共性的错误,也经常发生。这些错误出现的原因多种多样,修复起来也很简单。在本文中,我们将见到Ubuntu中各种类型频繁发生的更新错误以及它们的修复方法。 ### 合并列表问题 ### @@ -38,7 +38,7 @@ 下载仓库信息失败的另外一种类型是由于PPA过时导致的。通常,当你运行更新管理器,并看到这样的错误时: -![](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:) +![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2013/04/Failed-to-download-repository-information-Ubuntu-13.04.png) 你可以运行sudo apt-get update来查看哪个PPA更新失败,你可以把它从源列表中删除。你可以按照这个截图指南来[修复下载仓库信息失败错误][3]。 @@ -48,7 +48,7 @@ ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Ubuntu_Update_error.jpeg) -该错误很容易修复,只需修改软件源为主服务器即可。转到软件和更新,在那里你可以修改下载服务器为主服务器: +该错误很容易修复,只需修改软件源为主服务器即可。转到“软件和更新”,在那里你可以修改下载服务器为主服务器: ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/Change_server_Ubuntu.jpeg) @@ -78,7 +78,7 @@ 你可以在这里查找到更多详细内容[加载共享库时发生错误][6]。 -### 无法获取锁/var/cache/apt/archives/lock ### +### 无法获取锁 /var/cache/apt/archives/lock ### 在另一个程序在使用APT时,会发生该错误。假定你正在Ubuntu软件中心安装某个东西,然后你又试着在终端中运行apt。 @@ -135,7 +135,7 @@ via: http://itsfoss.com/fix-update-errors-ubuntu-1404/ 作者:[Abhishek][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/) 荣誉推出 diff --git a/translated/talk/20150511 Open Source History--Why Did Linux Succeed.md b/published/201506/20150511 Open Source History--Why Did Linux Succeed.md similarity index 61% rename from translated/talk/20150511 Open Source History--Why Did Linux Succeed.md rename to published/201506/20150511 Open Source History--Why Did Linux Succeed.md index 85b2473719..76b6d03ebe 100644 --- a/translated/talk/20150511 Open Source History--Why Did Linux Succeed.md +++ b/published/201506/20150511 Open Source History--Why Did Linux Succeed.md @@ -1,21 +1,21 @@ 开源旧事:Linux为什么能成功? ================================================================================ -> Linux,这个始于1991年由Lnius Torvalds开发的类Unix操作系统内核已经成为开源世界的中心,人们不禁追问为什么Linux成功了,而包括GNU HURD和BSD在内的那么多相似的项目却失败了? +> Linux,这个始于1991年由Linus Torvalds开发的类Unix操作系统内核已经成为开源世界的中心,人们不禁追问为什么Linux成功了,而包括GNU HURD和BSD在内的那么多相似的项目却失败了? ![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/linux.jpg) 自由软件和开源世界的发展史中最令人不解的问题之一是为什么Linux取得了如此辉煌的成功,然而其它同样尝试打造自由开源、类Unix操作系统内核的项目却没能那么成功?这个问题难以回答,但我总结了一些原因,在下面与大家分享。 -不过,首先得明确:当我谈论Linux是一个巨大的成功时所表达的含义。我对Linux成功的定义和对其它类Unix操作系统内核不一样,后者中一些是开源的,一些不是,而且它们繁荣发展的时期是Linux诞生的时期。[GNU][1]的HURD,一个发起于[1991年5月][1]的自由但不是免费的内核,便是其中之一。其它的包括现在大部分人都没听说过的Unix,比如由加州大学伯克利分校开发出来的BSD的各种各样Unix衍生版,由微软主导的Unix系统Xenix,包括Minix在内的学术版本Unix,和在AT&T赞助下开发的最初的Unix。在更早的数十年内,它对于学术界和商业届的计算发展至关重要,但到19世纪90年代就已经几乎已经消失在人们的视野里。 +不过,首先得明确:当我谈论Linux是一个巨大的成功时所表达的含义。我这样说是相对于其它类Unix操作系统内核的,后者中一些是开源的,一些不是,而且它们繁荣发展的时期是Linux诞生的时期。[GNU][1]的HURD,一个发起于[1991年5月][1]的Free(自由)的内核,便是其中之一。其它的包括现在大部分人都没听说过的Unix,比如由加州大学伯克利分校开发出来的BSD的各种各样Unix衍生版,由微软主导的Unix系统Xenix,包括Minix在内的学术版本Unix,和在AT&T赞助下开发的最初的Unix。在更早的数十年内,它对于学术界和商业界的计算发展至关重要,但到19世纪90年代就已经几乎已经消失在人们的视野里。 #### 相关阅读 #### -- [Open Source History: Tracing the Origins of Hacker Culture and the Hacker Ethic][3] -- [Unix and Personal Computers: Reinterpreting the Origins of Linux][4] +- [开源旧事:黑客文化和黑客伦理的起源追踪][3] +- [Unix和个人计算机:重新诠释Linux起源][4] -因此,得说明的是,我所写的是关于内核,而不是完整的操作系统。在很大程度上,Linux内核的成功归功于GNU整个项目。GNU这个项目产生了一套至关重要的工具,包括编译器、调试器和BASH shell的实现,这些对于构建一个类Unix操作系统是必需的。但是GNU的开发者们从没开发出一个HURD内核的可行版本(尽管他们仍在[不懈努力中][5])。相反,Linux呈现出来的则是一个将GNU各个部分紧密连接在一起的内核,尽管这超出了GNU的初衷。 +此外,得说明的是,我这里说的是内核,而不是完整的操作系统。在很大程度上,Linux内核的成功归功于GNU整个项目。GNU这个项目产生了一套至关重要的工具,包括编译器、调试器和BASH shell的实现,这些对于构建一个类Unix操作系统是必需的。但是GNU的开发者们从没开发出一个HURD内核的可行版本(尽管他们仍在[不懈努力中][5])。相反,Linux呈现出来的则是一个将GNU各个部分紧密连接在一起的内核,尽管这超出了GNU的初衷。 -因此,值得人们去追问为什么Linux,一个由Linus Torvalds这个芬兰的无名程序员于1991年——和HURD同一年——发起的内核,能够禁受考验并发展壮大?在当时的大环境下,很多拥有强力商业支持的、由当时炙手可热的黑客领头的类Unix内核都没能够发展起来。为了说明这个问题,我找到了一些和这个问题相关的解释。为此我研究了自由软件和开源世界的发展史,和不同解释的优缺点。 +因此,值得人们去追问为什么Linux,一个由Linus Torvalds这个芬兰的无名程序员于1991年——和HURD同一年——发起的内核,能够经受考验并发展壮大?在当时的大环境下,很多拥有强力商业支持的、由当时炙手可热的黑客领头的类Unix内核都没能够发展起来。为了说明这个问题,我找到了一些和这个问题相关的解释。为此我研究了自由软件和开源世界的发展史,和不同解释的优缺点。 ### Linux采用去中心化的开发方式 ### @@ -25,7 +25,7 @@ ### Linux是实用型的,而GNU是空想型的 ### -个人而言,我觉得下面这个说法是最引人注目的,即Linux之所发展得如此迅速是因为它的创建者是一个实用主义者,他起初只是想写一个内核,使其能够在他家里的电脑上运行一个裁剪过的Unix操作系统,而不是成为以改变世界为目标的自由软件的一部分,而后者正是GNU项目的一贯目标。 +个人而言,我觉得这个说法是最引人注目的,即Linux之所发展得如此迅速是因为它的创建者是一个实用主义者,他起初只是想写一个内核,使其能够在他家里的电脑上运行一个裁剪过的Unix操作系统,而不是成为以改变世界为目标的自由软件的一部分,而后者正是GNU项目的一贯目标。 然而,这个解释仍然有一些不能完全让人信服的地方。特别是,尽管Torvalds本人信奉实用主义的原则,但无论以前还是现在,并非所有参与到他的项目中的成员都和他一样信奉这一原则。尽管如此,Linux仍然取得了成功。 @@ -37,27 +37,27 @@ 当谈到Linux的成功时,不可忽视的是Linux和其它Unix变体之间的诸多技术差异。Richard Stallman,GNU项目的创始人,在一封给我的电子邮件中解释了为什么HURD的开发进度频频滞后:“GNU Hurd确实不是一次实用上的成功。部分原因是它的基本设计使它像是一个研究项目。(我之所以选择这样的设计,是考虑到这是快速实现一个可用内核的捷径。)” -就Torvalds独自编写出Linux的所有代码这点而言,Linux也有别于其它Unix变体。当他在1991年8月[第一次发布Linux][7]时他的一个初衷就是拥有一个属于他自己的Unix,免费共享代码。这点特性使得Linux区别于同时期的大部分Unix变体,后者一般是从AT&T Unix或伯克利的BSD中衍生出基础代码。 +就Torvalds独自编写出Linux的所有代码这点而言,Linux也有别于其它Unix变体。当他在1991年8月[第一次发布Linux][7]时他的一个初衷就是拥有一个属于他自己的Unix,而不用别人的代码。这点特性使得Linux区别于同时期的大部分Unix变体,后者一般是从AT&T Unix或伯克利的BSD中衍生出基础代码。 -我并不是一个计算机科学家,所以我没有资格去评判是否Lunux代码就优于其他Unix代码,以此来解释Linux的成功。虽然这并不能解释Linux和其它Unix内核在文化和人力上的不同,但这个观点对我来说解释得通,因为似乎在理解Linux成功这一点上它比代码更加重要。(译者尽力了+_+) +我并不是一个计算机科学家,所以我没有资格去评判是否Linux代码就优于其他Unix代码,以此来解释Linux的成功。虽然这并不能解释Linux和其它Unix内核在文化和人员上的不同,但这个观点对我来说解释得通,因为似乎在理解Linux成功这一点上操作系统设计比代码更加重要。 ### Linux背后的社区提供了有力支持 ### -Stallman也写到Linux成功的“主要原因”是“Torvalds使Linux成为一个自由软件,所以相比Hurd有更多来自社区的支持涌入Linux的发展中。”但这对于Linux的成长轨迹并非是一个完美的解释,因为它不能说明为什么自由软件的开发者们追随了Torvalds而不是HURD或其它某个Unix。但它仍然突出了这个转变是Linux盛行的很大一部分。(译者尽力了) +Stallman也写到Linux成功的“主要原因”是“Torvalds使Linux成为一个自由软件,所以相比Hurd有更多来自社区的支持涌入Linux的发展中。”但这对于Linux的成长轨迹并非是一个完美的解释,因为它不能说明为什么自由软件的开发者们追随了Torvalds而不是HURD或其它某个Unix,但它仍然点明了这种变化是Linux盛行的很大一部分原因。 -对于自由软件社区支持Linux的决定有一个更全面的理由可以用来解释为什么开发者们这么做。起初,Linux只是一个默默无闻的小项目,以任何标准来衡量,它比同时期其它的一些尝试创建一个更加自由的Unix,比如NET BSD和386/BSD,都要显得微不足道。同样,最初并不清楚Linux和自由软件运行目标的亲和力是怎样。创建伊始,Torvalds只是在一份防止Linux不被商业使用的证书下发布了Linux。至于后来他为了保护源代码的开放性转向使用GNU的通用公开证书则是后话了。 +对于自由软件社区决定支持Linux有一个更全面的理由可以用来解释为什么开发者们这么做。起初,Linux只是一个默默无闻的小项目,以任何标准来衡量,它比同时期其它的一些尝试创建一个更加自由的Unix,比如NET BSD和386/BSD,都要显得微不足道。同样,最初并不清楚Linux和自由软件运动的目标是否一致。创建伊始,Torvalds只是在一份防止Linux不被商业使用的证书下发布了Linux。至于后来他为了保护源代码的开放性转向使用GNU的通用公开证书则是后话了。 -所以,这些就是我所找到的Linux作为一个开源操作系统之所以取得成功的解释,可以肯定Linux的成就在某些方面(但比如桌面版的Linux从未成为它的支持者希望成为的样子)已经是可以衡量的成功。总之,Linux业已以其它任何类Unix操作系统都没有实现的方式成为了计算机世界的基石。也许源于BSD的苹果公司的OS X和iOS系统也很接近这一点,但它们没有在其它方面像Linux影响互联网一样扮演着如此重要的中心角色。 +所以,这些就是我所找到的Linux作为一个开源操作系统之所以取得成功的解释,可以肯定Linux的成就在某些方面(但比如桌面版的Linux从未成为它的支持者希望成为的样子)已经是可以衡量的成功。总之,Linux业已与其它任何类Unix操作系统不同的方式成为了计算机世界的基石。也许源于BSD的苹果公司的OS X和iOS系统也很接近这一点,但它们没有在其它方面像Linux影响互联网一样扮演着如此重要的中心角色。 -对于为什么Linux能成为它已经成为的样子,或者为什么它在Unix世界的竞争对手们几乎全部变得默默无闻的问题你有其它的想法吗?如果有,我很乐意听到你的想法。(诚然,BSD的变体如今仍有一批追随者,而一些商用的Unix对于[Red Hat][8](RHT)为[他们的用户提供支持][9]来说也仍然十分重要。但这些Unix中没有一个能够像Linux一样几乎征服了从Web服务器到智能手机的每一个领域。) +对于为什么Linux能成为现在的样子,或者为什么它在Unix世界的竞争对手们几乎全部变得默默无闻的问题,你有其它的想法吗?如果有,我很乐意听到你的想法。(诚然,BSD的变体如今仍有一批追随者,而一些商用的Unix对于[Red Hat][8](RHT)为[他们的用户提供支持][9]来说也仍然十分重要。但这些Unix中没有一个能够像Linux一样几乎征服了从Web服务器到智能手机的每一个领域。) -------------------------------------------------------------------------------- via: http://thevarguy.com/open-source-application-software-companies/050415/open-source-history-why-did-linux-succeed -作者:[hristopher Tozzi][a] +作者:[Christopher Tozzi][a] 译者:[KayGuoWhu](https://github.com/KayGuoWhu) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md b/published/201506/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md similarity index 89% rename from translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md rename to published/201506/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md index efa807f2f3..0280635408 100644 --- a/translated/tech/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md +++ b/published/201506/20150512 45 Zypper Commands to Manage 'Suse' Linux Package Management.md @@ -1,14 +1,14 @@ -45 个用于 ‘Suse‘ Linux 包管理的 Zypper 命令 +用于 ‘Suse‘ Linux 包管理的 Zypper 命令大全 ====================================================================== -SUSE( Software and System Entwicklung,即软件和系统开发。其中‘entwicklung‘是德语,意为开发)Linux是 Novell 公司在 Linux 内核基础上发布的操作系统。SUSE Linux 有两个发行分支。其中之一名为 OpenSUSE,这是一款自由而且免费的操作系统。该系统由开源社区开发维护,支持一些最新版本的应用软件,其最新的稳定版本为 13.2。 +SUSE( Software and System Entwicklung,即软件和系统开发。其中‘entwicklung‘是德语,意为开发)Linux 是由 Novell 公司在 Linux 内核基础上建立的操作系统。SUSE Linux 有两个发行分支。其中之一名为 openSUSE,这是一款自由而且免费的操作系统 (free as in speech as well as free as in wine)。该系统由开源社区开发维护,支持一些最新版本的应用软件,其最新的稳定版本为 13.2。 -另外一个分支是SUSE Linux 企业版。该分支是一个为企业及商业化产品设计的 Linux 发行版,包含了大量的企业应用以及适用于商业产品生产环境的特性。其最新的稳定版本为 12。 +另外一个分支是 SUSE Linux 企业版。该分支是一个为企业及商业化产品设计的 Linux 发行版,包含了大量的企业应用以及适用于商业产品生产环境的特性。其最新的稳定版本为 12。 以下的链接包含了安装企业版 SUSE Linux 服务器的详细信息。 - [如何安装企业版 SUSE Linux 12][1] -Zypper 和 Yast 是 SUSE Linux 平台上的软件包管理工具,他们的底层使用了 RPM(译者注:RPM 最初指 Redhat Pacakge Manager ,现普遍解释为递归短语 RPM Package Manager 的缩写)。 +Zypper 和 Yast 是 SUSE Linux 平台上的软件包管理工具,他们的底层使用了 RPM(LCTT 译者注:RPM 最初指 Redhat Pacakge Manager ,现普遍解释为递归短语 RPM Package Manager 的缩写)。 Yast(Yet another Setup Tool )是 OpenSUSE 以及企业版 SUSE 上用于系统管理、设置和配置的工具。 @@ -16,21 +16,21 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS 本文将介绍实际应用中常见的一些Zypper命令。这些命令用来进行安装、更新、删除等任何软件包管理器所能够胜任的工作。 -**重要** : 切记所有的这些指令都将在系统全局范围内产生影响,所以必须以 root 身份执行,否则命令将失败。 +**重要** : 切记所有的这些命令都将在系统全局范围内产生影响,所以必须以 root 身份执行,否则命令将失败。 ### 获取基本的 Zypper 帮助信息 ### -1. 不带任何选项的执行 zypper, 将输出该命令的全局选项以及子命令列表(译者注:全局选项,global option,控制台命令的输入分为可选参数和位置参数两大类。按照习惯,一般可选参数称为选项'option',而位置参数称为参数 'argument')。 +1. 不带任何选项的执行 zypper, 将输出该命令的全局选项以及子命令列表(LCTT 译者注:全局选项,global option,控制台命令的输入分为可选参数和位置参数两大类。按照习惯,一般可选参数称为选项'option',而位置参数称为参数 'argument')。 -
%>  zypper
+    
#  zypper
         Usage:
         zypper [--global-options]
2. 获取一个具体的子命令的帮助信息,比如 'in' (install),可以执行下面的命令 -
%> zypper help in
+
# zypper help in
或者 -
%> zypper help install
+    
# zypper help install
     install (in) [options] {capability | rpm_file_uri}
     
     Install packages with specified capabilities or RPM files with specified
@@ -96,7 +96,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 4. 获取一个模式包的信息(以 lamp_server 为例)。
 
-    
%> zypper info -t pattern lamp_server
+    
# zypper info -t pattern lamp_server
     
     Loading repository data...
     Reading installed packages...
@@ -136,9 +136,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 5. 开启一个Zypper Shell 的会话。
 
-    
 %>zypper shell 
+
# zypper shell 
或者 -
 %>zypper sh 
+
# zypper sh 
zypper> help
       Usage:
@@ -151,9 +151,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 6. 使用 'zypper repos' 或者 'zypper lr' 来列举所有已定以的软件库。
 
-    
%> zypper repos
+
# zypper repos
或者 -
%> zypper lr
+    
# zypper lr
       | Alias                     | Name                               | Enabled | Refresh
     --+---------------------------+------------------------------------+---------+--------
     1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
@@ -183,7 +183,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 8. 根据优先级列举软件库。
 
-    
%> zypper lr -P
+    
# zypper lr -P
       | Alias                     | Name                               | Enabled | Refresh | Priority
     --+---------------------------+------------------------------------+---------+---------+---------
     1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No      |   99
@@ -200,9 +200,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 9. 使用 'zypper refresh' or 'zypper ref' 来刷新 zypper 软件库。
 
-    
%> zypper refresh 
+
# zypper refresh 
或者 -
%> zypper ref
+    
# zypper ref
     Repository 'openSUSE-13.2-0' is up to date.
     Repository 'openSUSE-13.2-Debug' is up to date.
     Repository 'openSUSE-13.2-Non-Oss' is up to date.
@@ -213,13 +213,13 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 10. 刷新一个指定的软件库(以 'repo-non-oss' 为例 )。
 
-    
%> zypper refresh repo-non-oss
+    
# zypper refresh repo-non-oss
     Repository 'openSUSE-13.2-Non-Oss' is up to date.
     Specified repositories have been refreshed. 
11. 强制更新一个软件库(以 'repo-non-oss' 为例 )。 -
%> zypper ref -f repo-non-oss 
+    
# zypper ref -f repo-non-oss 
     Forcing raw metadata refresh
     Retrieving repository 'openSUSE-13.2-Non-Oss' metadata ............................................................[done]
     Forcing building of repository cache
@@ -230,9 +230,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 本文中我们使用‘zypper modifyrepo‘ 或者 ‘zypper mr‘ 来关闭或者开启 zypper 软件库。
 
-12. 在关闭一个软件库之前,我们需要知道在 zypper中,每一个软件库有一个唯一的标示数字与之关联,该数字用于打开或者关闭与之相联系的软件库。假设我们需要关闭 'repo-oss' 软件库,那么我们可以通过以下的法来获得该软件库的标志数字。
+12. 在关闭一个软件库之前,我们需要知道在 zypper 中,每一个软件库有一个唯一的标示数字与之关联,该数字用于打开或者关闭与之相联系的软件库。假设我们需要关闭 'repo-oss' 软件库,那么我们可以通过以下的法来获得该软件库的标志数字。
 
-    
%> zypper lr
+    
# zypper lr
       | Alias                     | Name                               | Enabled | Refresh
     --+---------------------------+------------------------------------+---------+--------
     1 | openSUSE-13.2-0           | openSUSE-13.2-0                    | Yes     | No
@@ -246,23 +246,23 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     9 | repo-update-non-oss       | openSUSE-13.2-Update-Non-Oss       | Yes     | Yes
从以上输出的列表中我们可以看到 'repo-oss' 库的标示数字是 6,因此通过以下的命令来关闭该库。 -
%> zypper mr -d 6
+    
# zypper mr -d 6
     Repository 'repo-oss' has been successfully disabled.
13. 如果需要再次开启软件库 ‘repo-oss‘, 接上例,与之相关联的标示数字为 6。 -
%> zypper mr -e 6
+    
# zypper mr -e 6
     Repository 'repo-oss' has been successfully enabled.
14. 针对某一个软件库(以 'repo-non-oss' 为例 )开启自动刷新( auto-refresh )和 rpm 缓存,并设置该软件库的优先级,比如85。 -
%> zypper mr -rk -p 85 repo-non-oss
+    
# zypper mr -rk -p 85 repo-non-oss
     Repository 'repo-non-oss' priority has been left unchanged (85)
     Nothing to change for repository 'repo-non-oss'.
15. 对所有的软件库关闭 rpm 文件缓存。 -
%> zypper mr -Ka
+    
# zypper mr -Ka
     RPM files caching has been disabled for repository 'openSUSE-13.2-0'.
     RPM files caching has been disabled for repository 'repo-debug'.
     RPM files caching has been disabled for repository 'repo-debug-update'.
@@ -274,7 +274,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     RPM files caching has been disabled for repository 'repo-update-non-oss'.
16. 对所有的软件库开启 rpm 文件缓存。 -
 zypper mr -ka
+    
# zypper mr -ka
     RPM files caching has been enabled for repository 'openSUSE-13.2-0'.
     RPM files caching has been enabled for repository 'repo-debug'.
     RPM files caching has been enabled for repository 'repo-debug-update'.
@@ -285,8 +285,8 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     RPM files caching has been enabled for repository 'repo-update'.
     RPM files caching has been enabled for repository 'repo-update-non-oss'.
-17. 关闭远程库的rpm 文件缓存 -
%> zypper mr -Kt
+17. 关闭远程库的 rpm 文件缓存
+    
# zypper mr -Kt
     RPM files caching has been disabled for repository 'repo-debug'.
     RPM files caching has been disabled for repository 'repo-debug-update'.
     RPM files caching has been disabled for repository 'repo-debug-update-non-oss'.
@@ -297,7 +297,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     RPM files caching has been disabled for repository 'repo-update-non-oss'.
18. 开启远程软件库的 rpm 文件缓存。 -
%> zypper mr -kt
+    
# zypper mr -kt
     RPM files caching has been enabled for repository 'repo-debug'.
     RPM files caching has been enabled for repository 'repo-debug-update'.
     RPM files caching has been enabled for repository 'repo-debug-update-non-oss'.
@@ -313,7 +313,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 19. 增加一个新的软件库( 以 “http://download.opensuse.org/update/12.3/” 为例 )。
 
-    
%>  zypper ar http://download.opensuse.org/update/11.1/ update
+    
# zypper ar http://download.opensuse.org/update/11.1/ update
     Adding repository 'update' .............................................................................................................................................................[done]
     Repository 'update' successfully added
     Enabled     : Yes
@@ -323,14 +323,14 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 20. 更改一个软件库的名字,这将仅仅改变软件库的别名。 命令 'zypper namerepo' 或者 'zypperr nr' 可以胜任此工作。例如更改标示数字为10的软件库的名字为 'upd8',或者说将标示数字为10的软件库的别名改为 'upd8',可以使用下面的命令。
 
-    
%> zypper nr 10 upd8
+    
# zypper nr 10 upd8
     Repository 'update' renamed to 'upd8'.
#### 删除软件库 #### 21. 删除一个软件库。要从系统删除一个软件库可以使 'zypper removerepo' 或者 'zypper rr'。例如以下的命令可以删除软件库 'upd8' -
%> zypper rr upd8
+    
# zypper rr upd8
     # Removing repository 'upd8' .........................................................................................[done]
     Repository 'upd8' has been removed.
@@ -339,7 +339,8 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS #### 用 zypper 安装一个软件包 #### 22. 在 zypper 中,我们可以通过软件包的功能名称来安装一个软件包。以 Firefox 为例,以下的命令可以用来安装该软件包。 -
%> zypper in MozillaFirefox
+
+    
# zypper in MozillaFirefox
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -370,8 +371,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Retrieving: hicolor-icon-theme-0.13-2.1.2.noarch.rpm ...................................................................................................................................[done]
     Retrieving package sound-theme-freedesktop-0.8-7.1.2.noarch                                                                                            (3/128), 372.6 KiB (460.3 KiB unpacked) 
-23. 安装指定版本号的软件包,(以 gcc 5.1 为例)。 -
 %>zypper in 'gcc<5.1'
+23. 安装指定版本号的软件包,(以 gcc 5.1 为例)。
+
+    
# zypper in 'gcc<5.1'
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -385,7 +387,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 24. 为特定的CPU架构安装软件包(以兼容 i586 的 gcc 为例)。
 
-    
%> zypper in gcc.i586
+    
# zypper in gcc.i586
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -403,7 +405,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
  
 25. 为特定的CPU架构安装指定版本号的软件包(以兼容 i586 且版本低于5.1的 gcc 为例)
 
-    
%> zypper in 'gcc.i586<5.1'
+    
# zypper in 'gcc.i586<5.1'
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -418,8 +420,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     In cache libatomic1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                           (2/13),  14.3 KiB ( 26.1 KiB unpacked)
     In cache libgomp1-gcc49-4.9.0+r211729-2.1.7.x86_64.rpm                                             (3/13),  41.1 KiB ( 90.7 KiB unpacked) 
-26. 从指定的软件库里面安装一个软件包,例如从 amarok 中安装 libxine。 -
%> zypper in amarok upd:libxine1
+26. 从指定的软件库里面安装一个软件包,例如从 amarok 中安装 libxine。
+
+    
# zypper in amarok upd:libxine1
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -431,7 +434,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 27. 通过指定软件包的名字安装软件包。
 
-    
%> zypper in -n git
+    
# zypper in -n git
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -451,8 +454,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Overall download size: 15.6 MiB. Already cached: 0 B  After the operation, additional 56.7 MiB will be used.
     Continue? [y/n/? shows all options] (y): y 
-28. 通过通配符来安装软件包,例如,安装所有 php5 的软件包。 -
%> zypper in php5*
+28. 通过通配符来安装软件包,例如,安装所有 php5 的软件包。
+
+    
# zypper in php5*
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -484,9 +488,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
       do not install php5-pear-Horde_Pdf-2.0.1-6.1.3.noarch
     ....
-29. 使用模式名称(模式名称是一类软件包的名字)来批量安装软件包 +29. 使用模式名称(模式名称是一类软件包的名字)来批量安装软件包。 -
%> zypper in -t pattern lamp_server
+    
# zypper in -t pattern lamp_server
     ading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -506,7 +510,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Overall download size: 7.2 MiB. Already cached: 1.2 MiB  After the operation, additional 34.7 MiB will be used.
     Continue? [y/n/? shows all options] (y): 
-30. 使用一行命令安转一个软件包同时卸载另一个软件包,例如在安装 nano 的同时卸载 vi +30. 使用一行命令安装一个软件包同时卸载另一个软件包,例如在安装 nano 的同时卸载 vi
# zypper in nano -vi
     Loading repository data...
@@ -530,7 +534,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 31. 使用 zypper 安装 rpm 软件包。
 
-    
%> zypper in teamviewer*.rpm
+    
# zypper in teamviewer*.rpm
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -552,9 +556,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 32. 命令 ‘zypper remove‘ 和 ‘zypper rm‘ 用于卸载软件包。例如卸载 apache2:
 
-    
%> zypper remove apache2 
+
# zypper remove apache2 
或者 -
%> zypper rm apache2
+    
# zypper rm apache2
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -572,9 +576,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 33. 更新所有的软件包,可以使用 ‘zypper update‘ 或者 ‘zypper up‘。
 
-    
%> zypper up 
+
# zypper up 
或者 -
%> zypper update
+    
# zypper update
 
     Loading repository data...
     Reading installed packages...
@@ -591,9 +595,9 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
     Nothing to do.
-35. 安装一个软件库,例如 ariadb,如果该库存在则更新之。 +35. 安装一个软件库,例如 mariadb,如果该库存在则更新之。 -
%> zypper in mariadb
+    
# zypper in mariadb
     Loading repository data...
     Reading installed packages...
     'mariadb' is already installed.
@@ -608,7 +612,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 36. 安装某一个软件包的源文件及其依赖关系,例如 mariadb。
 
-    
%> zypper si mariadb
+    
# zypper si mariadb
     Reading installed packages...
     Loading repository data...
     Resolving package dependencies...
@@ -626,7 +630,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 37. 仅为某一个软件包安装源文件,例如 mariadb
 
-    
%> zypper in -D mariadb
+    
# zypper in -D mariadb
     Loading repository data...
     Reading installed packages...
     'mariadb' is already installed.
@@ -637,7 +641,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 38. 仅为某一个软件包安装依赖关系,例如 mariadb
 
-    
%> zypper si -d mariadb
+    
# zypper si -d mariadb
     Reading installed packages...
     Loading repository data...
     Resolving package dependencies...
@@ -653,11 +657,11 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Overall download size: 33.7 MiB. Already cached: 129.5 KiB  After the operation, additional 144.3 MiB will be used.
     Continue? [y/n/? shows all options] (y): y
-#### Zypper in Scripts and Applications #### +#### 在脚本和应用中调用 Zypper (非交互式) #### 39. 安装一个软件包,并且在安装过程中跳过与用户的交互, 例如 mariadb。 -
%> zypper --non-interactive in mariadb
+    
# zypper --non-interactive in mariadb
     Loading repository data...
     Reading installed packages...
     'mariadb' is already installed.
@@ -668,7 +672,7 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 40. 卸载一个软件包,并且在卸载过程中跳过与用户的交互,例如 mariadb
 
-    
%> zypper --non-interactive rm mariadb
+    
# zypper --non-interactive rm mariadb
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -681,18 +685,18 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
     Continue? [y/n/? shows all options] (y): y
     (1/1) Removing mariadb-10.0.13-2.6.1 .............................................................................[done] 
-41. 将 zypper 输出用 XML 格式打印。 +41. 以 XML 格式显示 zypper 的输出。 -
%> zypper --xmlout
+    
# zypper --xmlout
       Usage:
     	zypper [--global-options]  [--command-options] [arguments]
 
       Global Options
     ....
-42. 禁止详细信息输出到屏幕。 +42. 在安装过程中禁止详细信息输出到屏幕。 -
%> zypper --quiet in mariadb
+    
# zypper --quiet in mariadb
     The following NEW package is going to be installed:
       mariadb
 
@@ -703,10 +707,11 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 43. 在卸载过程中禁止详细信息输出到屏幕
 
-    
%> zypper --quiet rm mariadb 
+
# zypper --quiet rm mariadb 
-44. 自动地同意版权或者协议。 -
%> zypper patch --auto-agree-with-licenses
+44. 自动地同意版权或者协议。
+
+    
# zypper patch --auto-agree-with-licenses
     Loading repository data...
     Reading installed packages...
     Resolving package dependencies...
@@ -717,15 +722,15 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 45. 以下指令可以用来清理Zypper缓存。
 
-    
%> zypper clean
+    
# zypper clean
     All repositories have been cleaned up.
-如果需要一次性地清理元数据以及软件包缓存,可以通过 -all/-a 选项来达到目的 +如果需要一次性地清理元数据以及软件包缓存,可以通过 -all 或 -a 选项来达到目的 -
%> zypper clean -a
+    
# zypper clean -a
     All repositories have been cleaned up.
-46. 查看 Zypper 的历史信息。籍由 Zypper 所有的软件包管理动作,包括安装、更新以及卸载都会在 /var/log/zypp/history中保留历史信息。可以通过 cat 来查看此文件,或者通过过滤器来筛选希望看到的信息。 +46. 查看 Zypper 的历史信息。任何通过 Zypper 进行的软件包管理动作,包括安装、更新以及卸载都会在 /var/log/zypp/history中保留历史信息。可以通过 cat 来查看此文件,或者通过过滤器来筛选希望看到的信息。
 cat /var/log/zypp/history
     2015-05-07 15:43:03|install|boost-license1_54_0|1.54.0-10.1.3|noarch||openSUSE-13.2-0|0523b909d2aae5239f9841316dafaf3a37b4f096|
@@ -742,7 +747,8 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 #### 使用 Zypper 进行SUSE系统升级 ####
 
-47. 可以使用 Zypper 命令的 'dist-upgrade' 选项来将当前的SUSE Linux升级至最新版本。
+47. 可以使用 Zypper 命令的 'dist-upgrade' 选项来将当前的 SUSE Linux 升级至最新版本。
+
     
# zypper dist-upgrade
     You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
     Building repository 'openSUSE-13.2-0' cache .....................................................................[done]
@@ -755,11 +761,11 @@ Zypper 是软件包管理器ZYpp的命令行接口,可用于安装、删除SUS
 
 --------------------------------------------------------------------------------
 
-原文地址: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/
+via: http://www.tecmint.com/zypper-commands-to-manage-suse-linux-package-management/
 
 作者:[Avishek Kumar][a]
 译者:[张博约](https://github.com/zhangboyue)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md b/published/201506/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md
similarity index 60%
rename from translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md
rename to published/201506/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md
index 58eb9f18ca..723cf72ddf 100644
--- a/translated/tech/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md	
+++ b/published/201506/20150512 A Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux.md	
@@ -1,21 +1,22 @@
-Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存使用率的shell脚本
+一个Linux中用于监控的简易shell脚本
 ================================================================================
-系统管理员的任务真的很艰难,因为他/她必须监控服务器、用户、日志,还得创建备份,等等等等。对于大多数重复性的任务,大多数管理员都会写一个自动化脚本来日复一日重复这些任务。这里,我们已经写了一个shell脚本给大家,用来自动化完成系统管理员所要完成的常规任务,这可能在多数情况下,尤其是对于新手而言十分有用,他们能通过该脚本获取到大多数的他们想要的信息,包括系统、网络、用户、负载、内存、主机、内部IP、外部IP、开机时间等。
+系统管理员的任务真的很艰难,因为他/她必须监控服务器、用户、日志,还得创建备份,等等等等。对于大多数重复性的任务,大多数管理员都会写一个自动化脚本来日复一日地重复这些任务。这里,我们已经写了一个shell脚本给大家,用来自动化完成系统管理员所要完成的常规任务,这可能在多数情况下,尤其是对于新手而言十分有用,他们能通过该脚本获取到大多数的他们想要的信息,包括系统、网络、用户、负载、内存、主机、内部IP、外部IP、开机时间等。
 
 我们已经注意并进行了格式化输出(在一定程度上哦)。此脚本不包含任何恶意内容,并且它能以普通用户帐号运行。事实上,我们也推荐你以普通用户运行该脚本,而不是root。
 
 ![Linux Server Health Monitoring](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-Health-Monitoring.png)
-监控Linux系统健康的Shell脚本
 
-你可以通过给Tecmint和脚本作者合适的积分,获得自由使用/修改/再分发下面代码的权利。我们已经试着在一定程度上自定义了输出结果,除了要求的输出内容外,其它内容都不会生成。我们也已经试着使用了那些Linux系统中通常不使用的变量,这些变量可能也是自由代码。
+*监控Linux系统健康的Shell脚本*
+
+在保留Tecmint和脚本作者应得荣誉的前提下,可以自由使用/修改/再分发下面代码。我们已经试着在一定程度上自定义了输出结果,除了要求的输出内容外,其它内容都不会生成。我们也已经试着使用了那些Linux系统中通常不使用的变量,这些变量应该是可以随便用的。
 
 #### 最小系统要求 ####
 
-你所需要的一切,就是一台正常运转的Linux盒子。
+你所需要的一切,就是一台正常运转的Linux机器。
 
 #### 依赖性 ####
 
-对于一个标准的Linux发行版,使用此包时没有任何依赖。此外,该脚本不需要root权限来执行。但是,如果你想要安装,则必须输入一次root密码。
+对于一个标准的Linux发行版,使用此软件包不需任何依赖。此外,该脚本不需要root权限来执行。但是,如果你想要安装,则必须输入一次root密码。
 
 #### 安全性 ####
 
@@ -30,16 +31,16 @@ Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存
 
 强烈建议你以普通用户身份安装该脚本,而不是root。安装过程中会询问root密码,并且在需要的时候安装必要的组件。
 
-要安装`“tecmint_monitor.sh”`脚本,只需像下面这样使用-i(安装)选项就可以了。
+要安装“`tecmint_monitor.sh`”脚本,只需像下面这样使用-i(安装)选项就可以了。
 
-    /tecmint_monitor.sh -i 
+    ./tecmint_monitor.sh -i 
 
 在提示你输入root密码时输入该密码。如果一切顺利,你会看到像下面这样的安装成功信息。
 
     Password: 
     Congratulations! Script Installed, now run monitor Command
 
-安装完毕后,你可以通过在任何位置,以任何用户调用命令`‘monitor’`来运行该脚本。如果你不喜欢安装,你需要在每次运行时输入路径。
+安装完毕后,你可以在任何位置,以任何用户调用命令`‘monitor’`来运行该脚本。如果你不喜欢安装,你需要在每次运行时输入路径。
 
     # ./Path/to/script/tecmint_monitor.sh
 
@@ -49,7 +50,7 @@ Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存
 
 ![TecMint Monitor Script in Action](http://www.tecmint.com/wp-content/uploads/2015/05/TecMint-Monitor-Script.gif)
 
-你一运行命令,就会获得下面这些各种各样和系统相关的信息:
+你运行命令就会获得下面这些各种各样和系统相关的信息:
 
 - 互联网连通性
 - 操作系统类型
@@ -78,9 +79,9 @@ Linux中用于监控网络、磁盘使用、开机时间、平均负载和内存
 
 ### 小结 ###
 
-该脚本在一些机器上可以开机即用,这一点我已经检查过。相信对于你而言,它也会正常工作。如果你们发现了什么毛病,可以在评论中告诉我。这个脚本还不是结束,这仅仅是个开始。从这里开始,你可以将它提升到任何等级。如果你想要编辑脚本,将它带入一个更深的层次,尽管随意去做吧,别忘了给我们合适的积分,也别忘了把你更新后的脚本拿出来和我们分享哦,这样,我们也能通过给你合适的积分来更新此文。
+该脚本在一些机器上可以开机即用,这一点我已经检查过。相信对于你而言,它也会正常工作。如果你们发现了什么毛病,可以在评论中告诉我。这个脚本还不完善,这仅仅是个开始。从这里开始,你可以将它改进到任何程度。如果你想要编辑脚本,将它带入一个更深的层次,尽管随意去做吧,别忘了给我们应的的荣誉,也别忘了把你更新后的脚本拿出来和我们分享哦,这样,我们也会更新此文来给你应得的荣誉。
 
-别忘了和我们分享你的想法或者脚本,我们会在这儿帮助你。谢谢你们给予的所有挚爱。保持连线,不要走开哦。
+别忘了和我们分享你的想法或者脚本,我们会在这儿帮助你。谢谢你们给予的所有挚爱。继续浏览,不要走开哦。
 
 --------------------------------------------------------------------------------
 
@@ -88,7 +89,7 @@ via: http://www.tecmint.com/linux-server-health-monitoring-script/
 
 作者:[Avishek Kumar][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/) 荣誉推出
 
diff --git a/translated/tech/20150512 How To Run Docker Client Inside Windows OS.md b/published/201506/20150512 How To Run Docker Client Inside Windows OS.md
similarity index 70%
rename from translated/tech/20150512 How To Run Docker Client Inside Windows OS.md
rename to published/201506/20150512 How To Run Docker Client Inside Windows OS.md
index f23c109149..050ed636f3 100644
--- a/translated/tech/20150512 How To Run Docker Client Inside Windows OS.md	
+++ b/published/201506/20150512 How To Run Docker Client Inside Windows OS.md	
@@ -1,6 +1,7 @@
 如何在 Windows 操作系统中运行 Docker 客户端
 ================================================================================
-大家好,今天我们来了解一下 Windows 操作系统中的 Docker 以及在其中安装 Docker Windows 客户端的知识。Docker 引擎使用 Linux 特定内核特性,因此不能通过 Windows 内核运行,Docker 引擎创建一个小的虚拟系统运行 Linux 并利用它的资源和内核。Windows Docker 客户端用虚拟化 Docker 引擎构建,运行以及管理 盒子以外的 Docker 容器。这里有个由 Boot2Docker 团队开发的名为 Boot2Docker 的应用程序,它创建运行在基于[Linux 微内核][1]的小型 Linux 系统上的虚拟机,是特意为在 Windows 上运行 [Docker][2] 容器开发的。它完全运行在 RAM 中,需要大约 27M 内存并能在 5s(YMMV,译者注:your mileage may vary,因人而异) 内启动。因此,在用于 Windows 的 Docker 引擎被开发出来之前,我们在 Windows 机器里只能运行 Linux 容器。
+
+大家好,今天我们来了解一下 Windows 操作系统中的 Docker 以及在其中安装 Docker Windows 客户端的知识。Docker 引擎使用 Linux 特有的内核特性,因此不能通过 Windows 内核运行,所以,(在 Windows 上)Docker 引擎创建了一个小的虚拟系统运行 Linux 并利用它的资源和内核。这样,Windows Docker 客户端就可以用这个虚拟的 Docker 引擎来构建、运行以及管理 Docker 容器。有个叫 Boot2Docker 的团队开发了一个同名的应用程序,它创建了一个虚拟机来运行基于[Tiny Core Linux][1]特制的小型 Linux,来在 Windows 上运行 [Docker][2] 容器。它完全运行在内存中,需要大约 27M 内存并能在 5秒 (因人而异) 内启动。因此,在用于 Windows 的 Docker 引擎被开发出来之前,我们在 Windows 机器里只能运行 Linux 容器。
 
 下面是安装 Docker 客户端并在上面运行容器的简单步骤。
 
@@ -12,7 +13,7 @@
 
 ### 2. 安装 Boot2Docker ###
 
-现在我们运行安装文件,它会安装 Window Docker 客户端、用于 Windows 的 Git(MSYS-git)、VirtualBox、Boot2Docker Linux ISO 以及 Boot2Docker 管理工具,这些对于在盒子之外运行 Docker 引擎都至关重要。
+现在我们运行安装文件,它会安装 Window Docker 客户端、用于 Windows 的 Git(MSYS-git)、VirtualBox、Boot2Docker Linux ISO 以及 Boot2Docker 管理工具,这些对于开箱即用地运行全功能的 Docker 引擎都至关重要。
 
 ![](http://blog.linoxide.com/wp-content/uploads/2015/05/boot2docker-installer.png)
 
@@ -20,7 +21,7 @@
 
 ![](http://blog.linoxide.com/wp-content/uploads/2015/05/boot2docker-start-icon-e1431322598697.png)
 
-安装完成必要的组件之后,我们从桌面 Boot2Docker 快捷方式启动 Boot2Docker。它会要求你输入以后用于验证的 SSH 密钥。然后会启动一个配置好的用于管理在虚拟机中运行的 Docker 的 unix shell。
+安装完成必要的组件之后,我们从桌面上的“Boot2Docker Start”快捷方式启动 Boot2Docker。它会要求你输入以后用于验证的 SSH 密钥。然后会启动一个配置好的用于管理在虚拟机中运行的 Docker 的 unix shell。
 
 ![](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-boot2docker.png)
 
@@ -32,7 +33,7 @@
 
 ### 4. 运行 Docker ###
 
-由于 **Boot2Docker Start** 自动启动了一个已经正确设置好环境变量的 shell,我们可以马上开始使用 Docker。**请注意,如果我们将 Boot2Docker 作为一个远程 Docker 守护进程,那么不要在 docker 命令之前加 sudo。**
+由于 **Boot2Docker Start** 自动启动了一个已经正确设置好环境变量的 shell,我们可以马上开始使用 Docker。**请注意,如果我们要将 Boot2Docker 作为一个远程 Docker 守护进程,那么不要在 docker 命令之前加 sudo。**
 
 现在,让我们来试试 **hello-world** 例子镜像,它会下载 hello-world 镜像,运行并输出 "Hello from Docker" 信息。
 
@@ -56,7 +57,7 @@
 
 **注意**: 如果你看到 machine does no exist 的错误信息,就运行 **boot2docker init** 命令。
 
-然后复制控制台中的命令到 cmd.exe 中为控制台窗口设置环境变量,然后我们就可以像平常一样运行 docker 容器了。
+然后复制上图中控制台标出命令到 cmd.exe 中为控制台窗口设置环境变量,然后我们就可以像平常一样运行 docker 容器了。
 
 ### 6. 使用 PowerShell 运行 Docker ###
 
@@ -74,7 +75,7 @@
 
 ### 7.  用 PUTTY 登录 ###
 
-Boot2Docker 在%USERPROFILE%\.ssh 目录生成和使用用于登录的公共和私有密钥,我们也需要使用这个文件夹中的私有密钥。私有密钥需要转换为 PuTTY 的格式。我们可以通过 puttygen.exe 实现。
+Boot2Docker 会在%USERPROFILE%\.ssh 目录生成和使用用于登录的公共和私有密钥,我们也需要使用这个文件夹中的私有密钥。私有密钥需要转换为 PuTTY 的格式。我们可以通过 puttygen.exe 实现。
 
 我们需要打开 puttygen.exe 并从 %USERPROFILE%\.ssh\id_boot2docker 中导入("File"->"Load" 菜单)私钥,然后点击 "Save Private Key"。然后用保存的文件通过 PuTTY 用 docker@127.0.0.1:2022 登录。
 
@@ -88,7 +89,9 @@ Boot2Docker 管理工具提供了一些命令,如下所示。
 
 ### 总结 ###
 
-通过 Docker Windows 客户端使用 Docker 很有趣。Boot2Docker 管理工具是一个能使任何 Docker 容器能像在 Linux 主机上平稳运行的很棒的应用程序。如果你更仔细的话,你会发现 boot2docker 默认用户的用户名是 docker,密码是 tcuser。最新版本的 boot2docker 设置了一个 host-only 的网络适配器提供访问容器的端口。一般来说是 192.168.59.103,但可以通过 VirtualBox 的 DHCP 实现改变。如果你有任何问题、建议、反馈,请在下面的评论框中写下来然后我们可以改进或者更新我们的内容。非常感谢!Enjoy:-)
+通过 Docker Windows 客户端使用 Docker 很有趣。Boot2Docker 管理工具是一个能使任何 Docker 容器能像在 Linux 主机上平滑运行的很棒的应用程序。如果你更仔细的话,你会发现 boot2docker 默认用户的用户名是 docker,密码是 tcuser。最新版本的 boot2docker 设置了一个 host-only 的网络适配器提供访问容器的端口。一般来说是 192.168.59.103,但可以通过 VirtualBox 的 DHCP 实现改变。
+
+如果你有任何问题、建议、反馈,请在下面的评论框中写下来然后我们可以改进或者更新我们的内容。非常感谢!Enjoy:-)
 
 --------------------------------------------------------------------------------
 
@@ -96,7 +99,7 @@ via: http://linoxide.com/linux-how-to/run-docker-client-inside-windows-os/
 
 作者:[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中国](https://linux.cn/) 荣誉推出
 
diff --git a/translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md b/published/201506/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md
similarity index 85%
rename from translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md
rename to published/201506/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md
index 8b5ba22907..8f2a9c2ecd 100644
--- a/translated/tech/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md	
+++ b/published/201506/20150512 Linux FAQs with Answers--How to view torrent file content on Linux.md	
@@ -1,6 +1,6 @@
-Linux有问必答——Linux上如何查看torrent文件内容
+Linux有问必答:Linux上如何查看种子文件的内容
 ================================================================================
-> **问题**: 我从网站上下载了一个torrent文件。Linux上有没有工具让我查看torrent文件的内容?例如,我想知道torrent里面都有什么文件。
+> **问题**: 我从网站上下载了一个torrent(种子)文件。Linux上有没有工具让我查看torrent文件的内容?例如,我想知道torrent里面都包含什么文件。
 
 torrent文件(也就是扩展名为**.torrent**的文件)是BitTorrent元数据文件,里面存储了BitTorrent客户端用来从BitTorrent点对点网络下载共享文件的信息(如,追踪器URL、文件列表、大小、校验和、创建日期等)。在单个torrent文件里面,可以列出一个或多个文件用于共享。
 
@@ -8,7 +8,7 @@ torrent文件内容由BEncode编码为BitTorrent数据序列化格式,因此
 
 事实上,任何图形化的BitTorrent客户端(如Transmission或uTorrent)都带有BEncode解码器,所以,你可以用它们直接打开来查看torrent文件的内容。然而,如果你不想要使用BitTorrent客户端来检查torrent文件,你可以试试这个命令行torrent查看器,它叫[dumptorrent][1]。
 
-**dumptorrent**命令可以使用内建的BEncode解码器打印torrent文件的详细信息(如,文件名、大小、跟踪器URL、创建日期、信息散列等等)。
+**dumptorrent**命令可以使用内建的BEncode解码器打印出torrent文件的详细信息(如,文件名、大小、跟踪器URL、创建日期、信息散列等等)。
 
 ### 安装DumpTorrent到Linux ###
 
@@ -32,7 +32,7 @@ torrent文件内容由BEncode编码为BitTorrent数据序列化格式,因此
     $ make
     $ sudo cp dumptorrent /usr/local/bin 
 
-确保你的路径中[包含][2]了/usr/local/bin。
+确保你的搜索路径 PATH 中[包含][2]了/usr/local/bin。
 
 ### 查看torrent的内容 ###
 
@@ -41,6 +41,7 @@ torrent文件内容由BEncode编码为BitTorrent数据序列化格式,因此
     $ dumptorrent  
 
 ![](https://farm8.staticflickr.com/7729/16816455904_b051e29972_b.jpg)
+
 要查看torrent的完整内容,请添加“-v”选项。它会打印更多关于torrent的详细信息,包括信息散列、片长度、创建日期、创建者,以及完整的声明列表。
 
     $ dumptorrent -v  
@@ -53,7 +54,7 @@ via: http://ask.xmodulo.com/view-torrent-file-content-linux.html
 
 作者:[Dan Nanni][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/) 荣誉推出
 
diff --git a/published/201506/20150515 Basic Networking Commands with Docker Containers.md b/published/201506/20150515 Basic Networking Commands with Docker Containers.md
new file mode 100644
index 0000000000..fd81249f10
--- /dev/null
+++ b/published/201506/20150515 Basic Networking Commands with Docker Containers.md	
@@ -0,0 +1,108 @@
+基础的Docker容器网络命令
+================================================================================
+各位好,今天我们将学习一些Docker容器的基础命令。Docker 是一个开源项目,提供了一个可以打包、装载和运行任何应用的轻量级容器的开放平台。它没有语言支持、框架和打包系统的限制,从小型的家用电脑到高端服务器,在何时何地都可以运行。它可以使部署和扩展web应用程序、数据库和后端服务像搭积木一样容易,而不依赖特定技术栈或提供商。Docker适用于网络环境,它正应用于数据中心、ISP和越来越多的网络服务。
+
+因此,这里有一些你在管理Docker容器的时候会用到的一些命令。
+
+### 1. 找到Docker接口 ###
+
+Docker默认会创建一个名为docker0的网桥接口作为连接外部世界的基础。运行中的docker容器直接连接到网桥接口docker0。默认上,docker会分配172.17.42.1/16给docker0,它是所有运行中的容器ip地址的子网。找到Docker接口的ip地址非常简单。要找出docker0网桥接口和连接到网桥上的docker容器,我们可以在安装了docker的终端或者shell中运行ip命令。
+
+    # ip a
+
+![Docker Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-interface.png)
+
+### 2. 得到Docker容器的ip地址 ###
+
+如我们上面读到的,docker在宿主机中创建了一个叫docker0的网桥接口。在我们创建一个新的docker容器时,它自动被默认分配了一个在该子网范围内的ip地址。因此,要检测运行中的Docker容器的ip地址,我们需要进入一个正在运行的容器并用下面的命令检查ip地址。首先,我们运行一个新的容器并进入其中。如果你已经有一个正在运行的容器,你可以跳过这个步骤。
+
+    # docker run -it ubuntu
+
+现在,我们可以运行ip a来得到容器的ip地址了。
+
+    # ip a
+
+![Docker Container IP](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-container-ip.png)
+
+### 3. 映射暴露的端口 ###
+
+要映射配置在Dockerfile的暴露端口到宿主机的高位端口,我们只需用下面带上-P标志的命令。这会打开docker容器的随机端口并映射到Dockerfile中定义的端口。下面是使用-P来打开/暴露定义的端口的例子。
+
+    # docker run -itd -P httpd
+
+![Mapping Expose Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-expose-port.png)
+
+上面的命令会映射容器的端口到 httpd 容器的 Dockerfile 中定义的80端口上。我们用下面的命令来查看正在运行的容器暴露的端口。
+
+    # docker ps
+
+并且可以用下面的curl命令来检查。
+
+    # curl http://localhost:49153
+
+![Curl Exposed Port](http://blog.linoxide.com/wp-content/uploads/2015/05/curl-exposed-port-e1431034586219.png)
+
+### 4. 映射到特定的端口上 ###
+
+我们也可以映射暴露端口或者docker容器端口到我们指定的端口上。要实现这个,我们用-p标志来定义我们所需的端口。这里是我们的一个例子。
+
+    # docker run -itd -p 8080:80 httpd
+
+上面的命令会映射(宿主机的)8080端口到(容器的)80上。我们可以运行curl来检查这点。
+
+    # curl http://localhost:8080
+
+![Mapping Specific Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-specific-port.png)
+
+### 5. 创建自己的网桥 ###
+
+要给容器创建一个自定义的IP地址,在本篇中我们会创建一个名为br0的新网桥。要分配需要的ip地址,我们需要在运行docker的宿主机中运行下面的命令。
+
+    # stop docker.io
+    # ip link add br0 type bridge
+    # ip addr add 172.30.1.1/20 dev br0
+    # ip link set br0 up
+    # docker -d -b br0
+
+![Creating Bridge Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-bridge-interface.png)
+
+创建完docker网桥之后,我们要让docker的守护进程知道它。
+
+    # echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker
+    # service docker.io start
+
+![Adding Interface to Docker](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-interface-to-docker.png)
+
+到这里,桥接后的接口将会分配给容器在桥接子网内的新ip地址。
+
+### 6. 链接到另外一个容器上 ###
+
+我们可以用Docker将一个容器连接到另外一个上。我们可以在不同的容器上运行不同的程序,并且相互连接或链接。链接允许容器间相互连接并从一个容器上安全地传输信息给另一个容器。要做到这个,我们可以使用--link标志。首先,我们使用--name标志来标示training/postgres镜像。
+
+    # docker run -d --name db training/postgres
+
+![Running db Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-db-container.png)
+
+完成之后,我们将容器db与training/webapp链接来形成新的叫web的容器。
+
+    # docker run -d -P --name web --link db:db training/webapp python app.py
+
+![linking two containers](http://blog.linoxide.com/wp-content/uploads/2015/05/linking-two-containers.png)
+
+### 总结 ###
+
+Docker网络很神奇也好玩,我们可以对docker容器做很多事情。我们可以把玩这些简单而基础的docker网络命令。docker的网络是非常先进的,我们可以用它做很多事情。
+
+如果你有任何的问题、建议、反馈请在下面的评论栏写下来以便于我们我们可以提升或者更新文章的内容。谢谢! 玩得开心!:-)
+
+--------------------------------------------------------------------------------
+
+via: http://linoxide.com/linux-how-to/networking-commands-docker-containers/
+
+作者:[Arun Pyasi][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://linoxide.com/author/arunp/
diff --git a/published/201506/20150515 Extend Swap Space using Swap file in Linux.md b/published/201506/20150515 Extend Swap Space using Swap file in Linux.md
new file mode 100644
index 0000000000..b92b4a8a36
--- /dev/null
+++ b/published/201506/20150515 Extend Swap Space using Swap file in Linux.md	
@@ -0,0 +1,73 @@
+在linux上使用交换文件扩展交换空间
+================================================================================
+想像一种情景,当我们的Linux系统用尽交换空间时,在这种情况下,我们想要使用swap分区扩展交换空间,但在某些情况下磁盘上已经没有可用的空闲分区了,致使我们不能把它扩大。
+
+因此,在这种情况下,我们可以使用交换文件增加swap空间。
+
+### 以下是使用交换文件在Linux上扩展swap空间的方法 ###
+
+让我们首先检查现有的交换空间/分区的大小,使用命令 ‘**free -m‘** 或者 ‘**swapon -s**‘
+
+![](http://www.linuxtechi.com/wp-content/uploads/2015/06/free-output-with-swap.jpg)
+free-output-with-swap
+
+我的交换分区大小是2 GB,我们将把交换空间扩展1GB。
+
+#### 第一步:使用下面的dd命令创建大小为1GB交换文件 ####
+
+    [root@linuxtechi ~]# dd if=/dev/zero of=/swap_file bs=1G count=1
+    1+0 records in
+    1+0 records out
+    1073741824 bytes (1.1 GB) copied, 414.898 s, 2.6 MB/s
+    [root@linuxtechi ~]#
+
+根据你的需要替换 ‘**bs**‘ 和 ‘**count**‘ 的大小.
+
+#### 第二步:设置交换文件权限为600 ####
+
+    [root@linuxtechi ~]# chmod 600 /swap_file
+
+#### 第三步:用文件开启交换区(swap_file)####
+
+用mkswap命令开启交换区
+
+    [root@linuxtechi ~]# mkswap /swap_file
+    Setting up swapspace version 1, size = 1048572 KiB
+    no label, UUID=f7b3ae59-c09a-4dc2-ba4d-c02abb7db33b
+    [root@linuxtechi ~]#
+
+#### 第四步:在fstab文件中添加交换文件条目 ####
+
+在fstab文件中添加以下条目,以便交换文件每次重启后互能继续使用.
+
+    /swap_file  swap  swap  defaults  0 0
+
+![swap-file-fstab-entry](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-file-fstab-entry.jpg)
+
+#### 第五步:用命令 ‘mkswap on’ 启用交换文件. ####
+
+    [root@linuxtechi ~]# swapon /swap_file
+    [root@linuxtechi ~]#
+
+#### 第六步:现在查看交换空间 ####
+
+![swap-space-after-extension](http://www.linuxtechi.com/wp-content/uploads/2015/06/swap-space-after-extension.jpg)
+
+**Note**: 为了避免出现意外的情况,如下所示使用swapoff命令关闭它,仅在需要使用时,使用步骤5所示的swapon命令,重新启用交换文件。
+
+    [root@linuxtechi ~]# swapoff /swap_file
+    [root@linuxtechi ~]#
+
+请分享您的宝贵意见或者评论此文章。
+
+--------------------------------------------------------------------------------
+
+via: http://www.linuxtechi.com/extend-swap-space-using-swap-file-in-linux/
+
+作者:[Pradeep Kumar][a]
+译者:[strugglingyouth](https://github.com/strugglingyouth)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.linuxtechi.com/author/pradeep/
diff --git a/published/201506/20150515 How to Install Percona Server on CentOS 7.md b/published/201506/20150515 How to Install Percona Server on CentOS 7.md
new file mode 100644
index 0000000000..8a99197328
--- /dev/null
+++ b/published/201506/20150515 How to Install Percona Server on CentOS 7.md	
@@ -0,0 +1,181 @@
+如何在 CentOS 7 上安装 Percona服务器
+================================================================================
+
+在这篇文章中我们将了解关于 Percona 服务器,一个开源的MySQL,MariaDB的替代品。InnoDB的数据库引擎使得Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比的解决方案,它将是一个很好的选择。
+
+在下文中将介绍在CentOS 7上Percona 服务器的安装,以及备份当前数据,配置的步骤和如何恢复备份。
+
+### 1.什么是Percona,为什么使用它 ###
+
+Percona是一个MySQL,MariaDB数据库的开源替代品,它是MySQL的一个分支,相当多的改进和独特的功能使得它比MYSQL更可靠,性能更强,速度更快,它与MYSQL完全兼容,你甚至可以在Oracle的MySQL与Percona之间使用复制。
+
+#### 在Percona中独具特色的功能 ####
+
+- 分区适应哈希搜索
+- 快速校验算法
+- 缓冲池预加载
+- 支持FlashCache
+
+#### MySQL企业版和Percona中的特有功能 ####
+
+- 从不同的服务器导入表
+- PAM认证
+- 审计日志
+- 线程池
+
+现在,你肯定很兴奋地看到这些好的东西整合在一起,我们将告诉你如何安装和对Percona Server做基本配置。
+
+### 2. 备份你的数据库 ###
+
+接下来,在命令行下使用SQL命令创建一个mydatabases.sql文件,来重建或恢复salesdb和employeedb数据库,根据你的设置替换数据库名称,如果没有安装MySQL则跳过此步:
+
+	mysqldump -u root -p --databases employeedb salesdb > mydatabases.sql
+
+复制当前的配置文件,如果你没有安装MYSQL也可跳过:
+
+    cp my.cnf my.cnf.bkp
+
+### 3.删除之前的SQL服务器 ###
+
+停止MYSQL/MariaDB,如果它们还在运行:
+
+    systemctl stop mysql.service
+    
+卸载MariaDB和MYSQL:
+
+    yum remove MariaDB-server MariaDB-client MariaDB-shared mysql mysql-server
+
+移动重命名放在/var/lib/mysql当中的MariaDB文件。这比仅仅只是移除更为安全快速,这就像2级即时备份。:)
+
+    mv /var/lib/mysql /var/lib/mysql_mariadb
+    
+### 4.使用二进制包安装Percona ###
+
+你可以在众多Percona安装方法中选择,在CentOS中使用Yum或者RPM包安装通常是更好的主意,所以这些是本文介绍的方式,下载源文件编译后安装在本文中并没有介绍。
+
+从Yum仓库中安装:
+
+首先,你需要设置Percona的Yum库:
+
+    yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
+
+接下来安装Percona:
+
+    yum install Percona-Server-client-56 Percona-Server-server-56
+
+上面的命令安装Percona的服务器和客户端、共享库,可能需要Perl和Perl模块,以及其他依赖的需要,如DBI::MySQL。如果这些尚未安装,可能需要安装更多的依赖包。
+
+使用RPM包安装:
+
+我们可以使用wget命令下载所有的rpm包:
+
+    wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \
+    http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/
+
+使用rpm工具,一次性安装所有的rpm包:
+
+    rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \
+    Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \
+    Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm
+
+注意在上面命令语句中最后的反斜杠'\'(只是为了换行方便)。如果您安装单独的软件包,记住要解决依赖关系,在安装客户端之前要先安装共享包,在安装服务器之前请先安装客户端。
+
+### 5.配置Percona服务器 ###
+
+#### 恢复之前的配置 ####
+
+当我们从MariaDB迁移过来时,你可以将之前的my.cnf的备份文件恢复回来。
+
+    cp /etc/my.cnf.bkp /etc/my.cnf
+
+#### 创建一个新的my.cnf文件 ####
+
+如果你需要一个适合你需求的新的配置文件或者你并没有备份配置文件,你可以使用以下方法,通过简单的几步生成新的配置文件。
+
+下面是Percona-server软件包自带的my.cnf文件
+
+    # Percona Server template configuration
+
+    [mysqld]
+    #
+    # Remove leading # and set to the amount of RAM for the most important data
+    # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
+    # innodb_buffer_pool_size = 128M
+    #
+    # Remove leading # to turn on a very important data integrity option: logging
+    # changes to the binary log between backups.
+    # log_bin
+    #
+    # Remove leading # to set options mainly useful for reporting servers.
+    # The server defaults are faster for transactions and fast SELECTs.
+    # Adjust sizes as needed, experiment to find the optimal values.
+    # join_buffer_size = 128M
+    # sort_buffer_size = 2M
+    # read_rnd_buffer_size = 2M
+    datadir=/var/lib/mysql
+    socket=/var/lib/mysql/mysql.sock
+
+    # Disabling symbolic-links is recommended to prevent assorted security risks
+    symbolic-links=0
+
+    [mysqld_safe]
+    log-error=/var/log/mysqld.log
+    pid-file=/var/run/mysqld/mysqld.pid
+
+根据你的需要配置好my.cnf后,就可以启动该服务了:
+
+    systemctl restart mysql.service
+
+如果一切顺利的话,它已经准备好执行SQL命令了,你可以用以下命令检查它是否已经正常启动:
+
+    mysql -u root -p -e 'SHOW VARIABLES LIKE "version_comment"'
+
+如果你不能够正常启动它,你可以在**/var/log/mysql/mysqld.log**中查找原因,该文件可在my.cnf的[mysql_safe]的log-error中设置。
+
+	tail /var/log/mysql/mysqld.log
+
+你也可以在/var/lib/mysql/文件夹下查找格式为[主机名].err的文件,就像下面这个例子:
+
+    tail /var/lib/mysql/centos7.err
+
+如果还是没找出原因,你可以试试strace:
+
+    yum install strace && systemctl stop mysql.service && strace -f -f mysqld_safe
+    
+上面的命令挺长的,输出的结果也相对简单,但绝大多数时候你都能找到无法启动的原因。
+
+### 6.保护你的数据 ###
+
+好了,你的关系数据库管理系统已经准备好接收SQL查询,但是把你宝贵的数据放在没有最起码安全保护的服务器上并不可取,为了更为安全最好使用mysql_secure_install来安装,这个工具可以帮助你删除未使用的默认功能,并设置root的密码,限制使用此用户进行访问。只需要在shell中执行该命令,并参照屏幕上的说明操作。
+
+	mysql_secure_install
+
+### 7.还原备份 ###
+
+如果您参照之前的设置,现在你可以恢复数据库,只需再用mysqldump一次。
+
+    mysqldump -u root -p < mydatabases.sql
+    
+恭喜你,你刚刚已经在你的CentOS上成功安装了Percona,你的服务器已经可以正式投入使用;你可以像使用MySQL一样使用它,你的服务器与它完全兼容。
+
+### 总结 ###
+
+为了获得更强的性能你需要对配置文件做大量的修改,但这里也有一些简单的选项来提高机器的性能。当使用InnoDB引擎时,将innodb_file_per_table设置为on,它将在一个文件中为每个表创建索引表,这意味着每个表都有它自己的索引文件,它使系统更强大和更容易维修。
+
+可以修改innodb_buffer_pool_size选项,InnoDB应该有足够的缓存池来应对你的数据集,大小应该为当前可用内存的70%到80%。
+
+将innodb-flush-method设置为O_DIRECT,关闭写入高速缓存,如果你使用了RAID,这可以提升性能,因为在底层已经完成了缓存操作。
+
+如果你的数据并不是十分关键并且并不需要对数据库事务正确执行的四个基本要素完全兼容,可以将innodb_flush_log_at_trx_commit设置为2,这也能提升系统的性能。
+
+--------------------------------------------------------------------------------
+
+via: http://linoxide.com/linux-how-to/percona-server-centos-7/
+
+作者:[Carlos Alberto][a]
+译者:[FatJoe123](https://github.com/FatJoe123)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://linoxide.com/author/carlosal/
diff --git a/published/201506/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/published/201506/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md
new file mode 100644
index 0000000000..4266bba59c
--- /dev/null
+++ b/published/201506/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md	
@@ -0,0 +1,192 @@
+用 Tails 1.4 Linux 系统来保护隐私和保持匿名
+================================================================================
+在这个互联网世界和互联网的世界中,我们在线执行我们的大多数任务,无论是订票,汇款,研究,商务,娱乐,社交网络,还是其它。每天我们花费大部分时间在网络上。在过去这些的日子里,在网络中保持匿名变得越来越难,尤其是在被某些机构例如 NSA (National Security Agency) 植入后门的情况下,他们嗅探着我们在网络中的所有动作。在网络中,我们有着极少的,或者说根本就没有隐私。基于用户浏览网络的活动和机器的活动的搜索都被记录了下来。
+
+一款来自于 Tor 项目的绝妙浏览器正被上百万人使用,它帮助我们匿名地浏览网络,即使这样,跟踪你的浏览习惯也并不难,所以只使用 Tor 并不能保证你的网络安全。你可以从下面的链接中查看 Tor 的特点及安装指南。
+ 
+- [使用 Tor 来进行匿名网络浏览][1]
+
+Tor 项目中有一个名为 Tails 的操作系统。Tails (The Amnesic Incognito Live System) 是一个 live 操作系统,基于 Debian Linux 发行版本,主要着眼于在浏览网络时在网络中保护隐私和匿名,这意味着所有的外向连接都强制通过 Tor 来连接,直接的(非匿名的) 连接请求都会被阻挡。该系统被设计为可在任何可启动介质上运行,例如 USB 棒或 DVD。
+
+Tails OS 的最新稳定发行版本为 1.4 , 于 2015 年 5 月 12 日发行。Tails 由开源的 Linux 宏内核所驱动,构建在 Debian GNU/Linux 之上,着眼于个人电脑市场, 使用 GNOME 3 作为其默认的用户界面。
+
+#### Tails OS 1.4 的特点 ####
+
+- Tails 是一个 free 的操作系统, free 的意义不仅是免费(free)啤酒的免费,也是言论自由(free) 中的自由
+- 构建在 Debian/GNU Linux 操作系统之上, Debian 是使用最广泛的通用操作系统
+- 着眼于安全的发行版本
+- 伪装成 Windows 8 外观
+- 不必安装就可以使用 Live Tails CD/DVD 来匿名浏览网络
+- 当 Tails 运行时,不会在计算机上留下任何痕迹
+- 使用先进的加密工具来加密任何相关文件,邮件等内容
+- 通过 Tor 网络来发送和接收流量
+- 真正意义地无论何时何处保护隐私
+- 在 Live 环境中带有一些立即可用的应用
+- 系统自带的所有软件都预先配置好只通过 Tor 网络来连接到互联网
+- 任何不通过 Tor 网络而尝试连接网络的应用都将被自动阻拦
+- 限制那些想查看你正在浏览什么网站的人的行动,并限制网站获取你的地理位置
+- 连接到那些被墙或被审查的网站
+- 特别设计不使用主操作系统的空间,即便是 swap 空间也不用
+- 整个操作系统加载在内存中,在每次重启或关机后会自动擦除掉,所以不会留下任何运行的痕迹。
+- 先进的安全实现,通过加密 USB 磁盘, HTTPS 应答加密和对邮件,文档进行签名。
+
+#### 在 Tails 1.4 中所期待的东西 ####
+
+- 带有安全滑块的 Tor 浏览器 4.5 
+- Tor 被升级到版本 0.2.6.7
+- 修补了几个安全漏洞
+- 针对诸如 curl、 OpenJDK 7、 tor Network、 openldap 等应用, 许多漏洞被修复并打上了补丁
+
+要得到完整的更改记录,你需要访问 [这里][2]
+ 
+**注意**: 假如你使用 Tails 的任何旧版本,强烈建议升级到 Tails 1.4 。
+
+#### 为什么我应该使用 Tails 操作系统 ####
+
+你需要 Tails 因为你想:
+
+- 在网络监控下保持自由
+- 捍卫自由,隐私和秘密
+- 流量分析下保持安全
+
+这个教程将带你了解 Tails 1.4 操作系统的安装并给出一个简短的评论。
+
+### Tails 1.4 安装指南 ###
+
+1. 为了下载最新的 Tails OS 1.4,你可以使用 wget 命令来直接下载它
+
+    $ wget http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso
+
+或者你可以直接下载 Tails 1.4 的 ISO 镜像文件,或使用一个 Torrent 客户端来为你获取 ISO 镜像文件:
+ 
+- [tails-i386-1.4.iso][3]
+- [tails-i386-1.4.torrent][4]
+
+2. 下载后,可使用 sha256sum 来获取 ISO 文件的哈希值并与官方提供的值相比较,以核实 ISO 文件的完整性
+
+    $ sha256sum tails-i386-1.4.iso
+    
+    339c8712768c831e59c4b1523002b83ccb98a4fe62f6a221fee3a15e779ca65d
+
+假如你熟悉 OpenPGP ,将 Tails 的签名密钥与 Debian 的 keyring 相比较以验证其签名,若想了解任何有关 Tails 的加密签名,请用浏览器访问 [这里][5]
+
+3. 下一步,你需要将镜像写入 USB 棒或 DVD ROM 中。或许你需要看看这篇文章 “[如何创建一个 Live 可启动的 USB棒][6] ”以了解如何使得一个闪存盘变得可启动并向它写入 ISO 镜像文件。
+
+4. 插入 Tails OS 的可启动闪存盘或 DVD ROM,并从那里启动 (在 BIOS 中选择该介质来启动)。第一个屏幕中会有两个选项 'Live' 和 'Live (failsafe)' 让你选择。选择 'Live' 并确定。
+
+![Tails 启动菜单](http://www.tecmint.com/wp-content/uploads/2015/05/1.png)
+
+*Tails 启动菜单*
+
+5. 在登录之前,你有两个选项, 假如你想配置并设定高级选项,点击 '更多选项' 否则点击 'NO'。
+
+![Tails 欢迎界面](http://www.tecmint.com/wp-content/uploads/2015/05/2.png)
+
+*Tails 欢迎界面*
+
+6. 在点击高级选项后,你需要设置 root 密码。假如你想升级它,这是非常重要的。这个 root 密码的有效期将持续到你关机或重启。
+
+另外,若你想开启 Windows 伪装,假如你想在一个公共场所运行这个操作系统,这将使得看起来你正在运行 Windows 8 操作系统。这真是一个好的选项!不是吗?另外,你还有一个选项来配置网络和 Mac 地址,当一切准备完毕后,点击 '登录' !
+
+![Tails OS 的配置](http://www.tecmint.com/wp-content/uploads/2015/05/3.png)
+
+*Tails OS 的配置*
+
+7. 这是使用 Windows 皮肤伪装的 Tails GNU/Linux OS:
+
+![Tails 的 Windows 伪装](http://www.tecmint.com/wp-content/uploads/2015/05/4.jpg)
+
+*Tails 的 Windows 伪装*
+
+8. 系统将在后台启动 Tor 网络。在屏幕的右上角查看通知 :“Tor 已经准备好了,现在你已经连接上了互联网”。
+
+你也可以在 Internet 菜单下查看它包含了哪些东西。 注意 :它包含有 Tor 浏览器(安全的) 和 不安全的网络浏览器(其中的向内和向外数据不通过 Tor 网络) 和其他应用。
+
+![Tails 菜单和工具](http://www.tecmint.com/wp-content/uploads/2015/05/5.jpg)
+
+*Tails 菜单和工具*
+
+9. 点击 Tor 并检查你的 IP 地址。 它确认我的物理位置没有被分享以及我的隐私未被触动。
+
+![在 Tails 上检查隐私](http://www.tecmint.com/wp-content/uploads/2015/05/6.jpg)
+
+*在 Tails 上检查隐私*
+
+10. 你还可以激活 Tails 安装器来“克隆和安装”, “克隆和升级”以及“从 ISO 镜像文件中升级系统”。
+
+![Tails 安装器选项](http://www.tecmint.com/wp-content/uploads/2015/05/7.jpg)
+
+*Tails 安装器选项*
+
+11. 如果选择另外的那个不带有高级选项的方式,那就直接登录。(查看上面的第 5 步).
+
+![不设置高级选项的 Tails](http://www.tecmint.com/wp-content/uploads/2015/05/8.png)
+
+*不设置高级选项的 Tails*
+
+12. 这将登录到 Gnome3 桌面环境。
+
+![Tails Gnome 桌面](http://www.tecmint.com/wp-content/uploads/2015/05/9.png)
+
+*Tails Gnome 桌面*
+
+13. 假如你点击启动不安全的浏览器,无论是否带有地址伪装,你都将会收到弹窗通知。
+
+![Tails 浏览通知](http://www.tecmint.com/wp-content/uploads/2015/05/10.png)
+
+*Tails 浏览通知*
+
+假如你仍启动不安全的浏览器,你将在浏览器中看到如下网页:
+
+![Tails 浏览警告](http://www.tecmint.com/wp-content/uploads/2015/05/11.png)
+
+*Tails 浏览警告*
+
+#### Tails 适合我吗?####
+
+要想得到上面问题的答案,首先回答如下的问题:
+
+- 在上网时,你想你的隐私不被触动吗?
+- 你想在窃取身份信息的人的眼皮底下保持隐身吗?
+- 你想在你的网上私人聊天过程中被他人嗅探吗?
+- 你真的想向任何人展示你的地理位置吗?
+- 你开展银行网上交易吗?
+- 你愿意受政府和 ISP的审查吗?
+
+假如以上问题中,任意一个问题的答案为 'YES',则你最好需要 Tails。假如上面所有的问题的答案都是 'NO',则或许你不需要它。
+
+想对 Tails 了解更多?请将你的浏览器指向它的用户文档页面: 
+
+文档: [https://tails.boum.org/doc/index.en.html][7]
+
+### 总结 ###
+
+对于那些工作在不安全环境中的人来说,Tails 是一个必需的操作系统。Tails 还是一个着眼于安全的操作系统,现在为止,包含了一大批应用 – Gnome 桌面、Tor、 Firefox (Iceweasel)、 Network Manager、 Pidgin、 Claws mail、 Liferea feed addregator、 Gobby、 Aircrack-ng、 I2P。
+
+同时,它含有一些有关加密和隐私的工具,即 UKS、 GnuPG、 PWGen、 Shamir's Secret Sharing、 Virtual Keyboard (对付硬件的键盘记录器)、 MAT、 KeePassX Password Manager 等。
+
+这就是全部了。关注我们。请分享你的有关 Tails GNU/Linux 操作系统的想法。对于这个项目的未来,你怎么看?同时在实际中测试它,并让我们获知你的体验感受。
+
+你也可以在 [Virtualbox][8] 中运行它。 Tails 在内存中加载整个操作系统,所以在虚拟机中你需要给定足够的内存来运行 Tails。
+
+我在 1GB 内存的环境中测试了 Tails,它工作起来毫无滞后感。谢谢我们的所有用户的支持。使我们成为一个包含所有 Linux 相关信息的地方,你的支持是必需的。 Kudos!
+
+--------------------------------------------------------------------------------
+
+via: http://www.tecmint.com/install-tails-1-4-linux-operating-system-to-preserve-privacy-and-anonymity/
+
+作者:[Avishek Kumar][a]
+译者:[FSSlc](https://github.com/FSSlc)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.tecmint.com/author/avishek/
+[1]:https://linux.cn/article-3566-1.html
+[2]:https://tails.boum.org/news/version_1.4/index.en.html
+[3]:http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso
+[4]:https://tails.boum.org/torrents/files/tails-i386-1.4.torrent
+[5]:https://tails.boum.org/download/index.en.html#verify
+[6]:http://www.tecmint.com/install-linux-from-usb-device/
+[7]:https://tails.boum.org/doc/index.en.html
+[8]:http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/
\ No newline at end of file
diff --git a/published/201506/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/published/201506/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md
new file mode 100644
index 0000000000..d44db58488
--- /dev/null
+++ b/published/201506/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md	
@@ -0,0 +1,70 @@
+在 Ubuntu 中给你的照片加上 Instagram 风格的滤镜程序
+================================================================================
+拿起你的自拍杆跟我来。
+
+### XnRetro 照片编辑器 ###
+
+**XnRetro** 是一个可以让你快速给你照片添加“类 Instagram”效果的程序。
+
+你肯定知道我说的这些效果:划痕、噪点、相框、过度处理、复古和怀旧色调(因为在这个数字过客的时代,我们一定知道无穷无尽的自拍永远也找不回怀旧的自己。)
+
+无论你认为这些效果是愚蠢的艺术还是创作的捷径,这些滤镜非常流行,可以帮助那些平实无奇的照片添加个性。
+
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg)
+
+*XnRetro是一个照片编辑应用*
+
+#### XnRetro的功能 ####
+
+**XnRetro 有下面那些功能**
+
+- 20 种色彩滤镜
+- 15 种光影效果(虚化、泄露等等)
+- 28 种画框和边线
+- 5 种插图 (带力度控制)
+- 对比度、伽马校正、饱和度等图像调整
+- 矩形修剪选项
+
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png)
+
+*灯光效果调整*
+
+(理论上)你可以保存编辑过的 .jpg 或者 .png 文件,并且直接在 app 中分享到社交媒体上。
+
+我说“理论上”的意思是保存.jpg图像无法正常在 linux 版的程序上工作(你可以保存 .png 的图像)。相似问题还有,大多数内置的社交链接失效或者无法导出。
+
+要使用**15 种光影效果**,你需要在 XnRetro 的‘light’文件夹下将 .jpg 文件重新保存成 .png 文件。编辑‘light.xml’来匹配新的文件名,点击保存那么灯光效果就可以没有问题的加载进 XnRetro 了。
+
+
+**XnRetro 值得安装么?**
+
+XnRetro 并不是完美的。它看上去很老土、很难正确的安装,**并且已经几年没有更新了**。
+
+但它还可以使用,除了保存 .jpg 文件外。同时也是那些像 Gimp 或者 Shotwell 的那些‘正规’的图片调整工具的一个灵活替代品。
+
+虽然像 [Pixlr Touch Up][1] 和 [Polarr][2] 这样的 web 应用和 Chrome Apps 也提供相似的功能,但你也许正在寻找真正原生的解决方案。
+
+习惯了 XnRetro 就很难离开它。
+
+### 下载 Ubuntu 下的 XnRetro ###
+
+XnRetro 没有可用的 .deb 安装包。它以二进制文件的形式发行,这意味着你需要每次双击程序来运行。它也只有32位的版本。
+
+你可以使用下面的 XnRetro下载链接。下载完成后你需要解压压缩包并进入。双击里面的‘xnretro’程序。
+
+- [下载 Linux 版 XnRetro (32位, tar.gz)][3]
+
+--------------------------------------------------------------------------------
+
+via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app
+
+作者:[Joey-Elijah Sneddon][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://plus.google.com/117485690627814051450/?rel=author
+[1]:http://www.omgchrome.com/?s=pixlr
+[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/
+[3]:http://www.xnview.com/en/xnretro/#downloads
diff --git a/published/201506/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/published/201506/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md
new file mode 100644
index 0000000000..e647b452c7
--- /dev/null
+++ b/published/201506/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md	
@@ -0,0 +1,214 @@
+在Linux命令行下令人惊叹的惊叹号(!)
+================================================================================
+`'!'`符号在Linux中不但可以用作否定符号,还可以用来从历史命令记录中取出命令或不加修改的执行之前运行的命令。下面的所有命令都已经在Bash Shell中经过确切地检验。尽管我没有试过,但大多都不能在别的Shell中运行。这里我们介绍下Linux命令行中符号`'!'`那惊人和奇妙的用法。
+
+### 1. 使用数字从历史命令列表中找一条命令来执行 ###
+
+您也许没有意识到您可以从历史命令列表(之前已经执行的命令集)中找出一条来运行。首先,通过"history"命令查找之前命令的序号。
+
+    $ history
+
+![使用history命令找到最后执行的命令](http://www.tecmint.com/wp-content/uploads/2015/05/history-Command.gif)
+
+*使用history命令找到最后执行的命令*
+
+现在,只需要使用历史命令输出中显示在该命令前面的数字便可以运行这个命令。例如,运行一个在`history`输出中编号是1551的命令。
+
+    $ !1551
+
+![使用命令ID来执行最后运行的命令](http://www.tecmint.com/wp-content/uploads/2015/05/Run-Commands-By-number.gif)
+
+*使用命令ID来执行最后运行的命令*
+
+这样,编号为1551的命令(上面的例子是[top命令][1])便运行了。这种通过ID号来执行之前的命令的方式很有用,尤其是在这些命令都很长的情况下。您只需要使用**![history命令输出的序号]**便可以调用它。
+
+### 2. 运行之前的倒数第二个、第七个命令等 ###
+
+您可以以另一种方式来运行之前执行的命令,通过使用-1代表最后的命令,-2代表倒数第二个命令,-7代表倒数第七个命令等。
+
+首先使用history命令来获得执行过的命令的列表。**history命令的执行很有必要**,因为您可以通过它来确保没有`rm command > file`或其他会导致危险的命令。接下来执行倒数第六个、第八个、第十个命令。
+
+    $ history
+    $ !-6
+    $ !-8
+    $ !-10
+
+![通过负数序号运行之前执行的命令](http://www.tecmint.com/wp-content/uploads/2015/05/3.gif)
+
+*通过负数序号运行之前执行的命令*
+
+### 3. 传递最后执行的命令的参数,以方便的运行新的命令 ###
+
+我需要显示`/home/$USER/Binary/firefox`文件夹的内容,因此我执行:
+
+    $ ls /home/$USER/Binary/firefox
+
+接下来,我意识到我应该执行'ls -l'来查看哪个文件是可执行文件。因此我应该重新输入整个命令么?不,我不需要。我仅需要在新的命令中带上最后的参数,类似:
+
+    $ ls -l !$
+
+这里`!$`将把最后执行的命令的参数传递到这个新的命令中。
+
+![将上一个命令的参数传递给新命令](http://www.tecmint.com/wp-content/uploads/2015/05/4.gif)
+
+*将上一个命令的参数传递给新命令*
+
+### 4. 如何使用!来处理两个或更多的参数 ###
+
+比如说我在桌面创建了一个文本文件file1.txt。
+
+    $ touch /home/avi/Desktop/1.txt
+
+然后在cp命令中使用绝对路径将它拷贝到`/home/avi/Downloads`。
+
+    $ cp /home/avi/Desktop/1.txt /home/avi/downloads
+
+这里,我们给cp命令传递了两个参数。第一个是`/home/avi/Desktop/1.txt`,第二个是`/home/avi/Downloads`。让我们分别处理他们,使用`echo [参数]`来打印两个不同的参数。
+
+    $ echo "1st Argument is : !^"
+    $ echo "2nd Argument is : !cp:2"
+
+注意第一个参数可以使用`"!^"`进行打印,其余的命令可以通过`"![命令名]:[参数编号]"`打印。
+
+在上面的例子中,第一个命令是`cp`,第二个参数也需要被打印。因此是`"!cp:2"`,如果任何命令比如xyz运行时有5个参数,而您需要获得第四个参数,您可以使用`"!xyz:4"`。所有的参数都可以通过`"!*"`来获得。
+
+![处理两个或更多的参数](http://www.tecmint.com/wp-content/uploads/2015/05/5.gif)
+
+*处理两个或更多的参数*
+
+### 5. 以关键字为基础执行上个的命令 ###
+
+我们可以以关键字为基础执行上次执行的命令。可以从下面的例子中理解:
+
+    $ ls /home > /dev/null						[命令1]
+    $ ls -l /home/avi/Desktop > /dev/null		                [命令2]	
+    $ ls -la /home/avi/Downloads > /dev/null	                [命令3]
+    $ ls -lA /usr/bin > /dev/null				        [命令4]
+
+上面我们使用了同样的命令(ls),但有不同的开关和不同的操作文件夹。而且,我们还将输出传递到`/dev/null`,我们并未显示输出,因而终端依旧很干净。
+
+现在以关键字为基础执行上个的命令。
+
+    $ ! ls					[命令1]
+    $ ! ls -l				[命令2]	
+    $ ! ls -la				[命令3]
+    $ ! ls -lA				[命令4]
+
+检查输出,您将惊奇发现您仅仅使用关键字`ls`便执行了您已经执行过的命令。
+
+![以关键字为基础执行命令](http://www.tecmint.com/wp-content/uploads/2015/05/6.gif)
+
+*以关键字为基础执行命令*
+
+(LCTT 译注:澄清一下,这种用法会按照命令名来找到最后匹配的命令,不会匹配参数。所以上述执行的四个命令都是执行了 `ls -lA /usr/bin > /dev/null`,并增加了新的参数而已。)
+
+### 6. !!操作符的威力 ###
+
+您可以使用`(!!)`运行/修改您上个运行的命令。它将附带一些修改/调整并调用上个命令。让我给您展示一些实际情境。
+
+昨天我运行了一行脚本来获得我的私有IP,因此我执行了:
+
+    $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/
+
+接着,我突然发现我需要将上面脚本的输出重定向到一个ip.txt的文件,因此,我该怎么办呢?我该重新输入整个命令并重定向到一个文件么?一个简单的解决方案是使用向上光标键并添加`'> ip.txt'`来将输出重定向到文件。
+
+    $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ > ip.txt
+
+在这里要感谢救世主"向上光标键"。现在,考虑下面的情况,这次我运行了下面这一行脚本。
+
+    $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d:
+
+一旦我运行了这个脚本,Bash提示符便返回了错误消息`"bash: ifconfig: command not found"`。原因并不难猜,我运行了本应以root权限的运行的命令。
+
+所以,怎么解决呢?以root用户登录并且再次键入整个命令就太麻烦了!而且向上导航键也不管用了(LCTT 译注:当你以新的用户身份登录了,是不能用向上光标键找到之前的另外一个用户的命令历史的)。因此,我们需要调用`"!!"`(去掉引号),它将为那个用户调用上个命令。
+
+    $ su -c !! root
+
+这里su是用来切换到root用户的,`-c`用来以某用户运行特定的命令,最重要的部分是`!!`,它将被替换为上次运行的命令。当然!您需要提供root密码。
+
+![!!操作符的威力](http://www.tecmint.com/wp-content/uploads/2015/05/7.gif)
+
+*!!操作符的威力*
+
+我通常在下面的情景中使用`!!`。
+
+当我用普通用户来运行apt-get,我通常收到提示说我没有权限来执行。
+
+    $ apt-get upgrade && apt-get dist-upgrade
+
+好吧,有错误。但别担心,使用下面的命令来成功的执行...
+
+    $ su -c !!
+
+同样的适用于:
+
+    $ service apache2 start
+    
+或
+    
+    $ /etc/init.d/apache2 start
+    
+或
+    
+    $ systemctl start apache2
+
+普通用户不被授权执行那些任务,这样相当于我运行:
+
+    $ su -c 'service apache2 start'
+    
+或
+    
+    $ su -c '/etc/init.d/apache2 start'
+    
+或
+    
+    $ su -c 'systemctl start apache2'
+    
+(LCTT 译注:使用`!!`之前,一定要确认你执行的是什么命令!另外,在 root 身份下,千万不要养成使用它的习惯,因为你总是会在不合适的目录执行不合适的命令!)
+
+### 7.运行一个影响所有除了![FILE_NAME]的文件命令 ###
+
+`!`(逻辑非)能用来对除了`'!'`后的文件的所有的文件/扩展名执行命令。
+
+A.从文件夹移除所有文件,2.txt除外。
+
+    $ rm !(2.txt)
+
+B.从文件夹移除所有的文件类型,pdf类型除外。
+
+    $ rm !(*.pdf)
+
+### 8.检查某个文件夹(比如/home/avi/Tecmint)是否存在?并打印 ###
+
+这里,我们使用`'! -d'`来验证文件夹是否存在,当文件夹不存在时,将使用其后跟随AND操作符`(&&)`进行打印,当文件夹存在时,将使用OR操作符`(||)`进行打印。
+
+逻辑上,当`[ ! -d /home/avi/Tecmint ]`的输出为0时,它将执行AND逻辑符后面的内容,否则,它将执行OR逻辑符`(||)`后面的内容。
+
+    $ [ ! -d /home/avi/Tecmint ] && printf '\nno such /home/avi/Tecmint directory exist\n' || printf '\n/home/avi/Tecmint directory exist\n'
+
+### 9.检查某文件夹是否存在?如果不存在则退出该命令 ###
+
+类似于上面的情况,但这里当期望的文件夹不存在时,该命令会退出。
+
+    $ [ ! -d /home/avi/Tecmint ] && exit
+
+### 10.如果您的home文件夹内不存在一个文件夹(比方说test),则创建它 ###
+
+这是脚本语言中的一个常用的实现,当期望的文件夹不存在时,创建一个。
+
+    [ ! -d /home/avi/Tecmint ] && mkdir /home/avi/Tecmint
+
+这便是全部了。如果您知道或偶尔遇到其他值得了解的`'!'`使用方法,请您在反馈的地方给我们提建议。保持联系!
+
+--------------------------------------------------------------------------------
+
+via: http://www.tecmint.com/mysterious-uses-of-symbol-or-operator-in-linux-commands/
+
+作者:[Avishek Kumar][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://www.tecmint.com/author/avishek/
+[1]:http://www.tecmint.com/12-top-command-examples-in-linux/
diff --git a/translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md b/published/201506/20150518 70 Expected Shell Scripting Interview Questions and Answers.md
similarity index 50%
rename from translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md
rename to published/201506/20150518 70 Expected Shell Scripting Interview Questions and Answers.md
index b5ccd63e0a..9b0201d51e 100644
--- a/translated/tech/20150518 70 Expected Shell Scripting Interview Questions and Answers.md	
+++ b/published/201506/20150518 70 Expected Shell Scripting Interview Questions and Answers.md	
@@ -1,14 +1,14 @@
-70 个可能的 Shell 脚本面试问题及解答
+Shell 脚本面试问题大全
 ================================================================================
-我们为你的面试准备选择了 70 个可能的 shell 脚面问题及解答。了解脚本或至少知道基础知识对系统管理员来说至关重要,它也有助于你在工作环境中自动完成很多任务。在过去的几年里,我们注意到所有的 linux 工作职位都要求脚本技能。
+我们为你的面试准备选择了 70 个你可能遇到的 shell 脚面问题及解答。了解脚本或至少知道基础知识对系统管理员来说至关重要,它也有助于你在工作环境中自动完成很多任务。在过去的几年里,我们注意到所有的 linux 工作职位都要求脚本技能。
 
 ### 1) 如何向脚本传递参数 ? ###
 
-./script argument
+	./script argument
 
 **例子** : 显示文件名称脚本
 
-./show.sh file1.txt
+	./show.sh file1.txt
 
     cat show.sh
     #!/bin/bash
@@ -16,12 +16,11 @@
 
 ### 2) 如何在脚本中使用参数 ? ###
 
-第一个参数: $1,
-第二个参数 : $2
+第一个参数 : $1,第二个参数 : $2
 
 例子 : 脚本会复制文件(arg1) 到目标地址(arg2)
 
-./copy.sh file1.txt /tmp/
+	./copy.sh file1.txt /tmp/
 
     cat copy.sh
     #!/bin/bash
@@ -29,127 +28,129 @@
 
 ### 3) 如何计算传递进来的参数 ? ###
 
-$#
+	$#
 
 ### 4) 如何在脚本中获取脚本名称 ? ###
 
-$0
+	$0
 
 ### 5) 如何检查之前的命令是否运行成功 ? ###
 
-$?
+	$?
 
 ### 6) 如何获取文件的最后一行 ? ###
 
-tail -1
+	tail -1
 
 ### 7) 如何获取文件的第一行 ? ###
 
-head -1
+	head -1
 
 ### 8) 如何获取一个文件每一行的第三个元素 ? ###
 
-awk '{print $3}'
+	awk '{print $3}'
 
-### 9) 假如第一个等于 FIND,如何获取文件中每行的第二个元素 ###
+### 9) 假如文件中每行第一个元素是 FIND,如何获取第二个元素 ###
 
-awk '{ if ($1 == "FIND") print $2}'
+	awk '{ if ($1 == "FIND") print $2}'
 
 ### 10) 如何调试 bash 脚本 ###
 
-Add -xv to #!/bin/bash
 
-例子
+将 -xv 参数加到 #!/bin/bash 后
 
-#!/bin/bash –xv
+例子:
+
+	#!/bin/bash –xv
 
 ### 11) 举例如何写一个函数 ? ###
 
-function example {
-echo "Hello world!"
-}
+	function example {
+	echo "Hello world!"
+	}
 
-### 12) 如何向 string 添加 string ? ###
+### 12) 如何向连接两个字符串 ? ###
 
-V1="Hello"
-V2="World"
-V3=$V1+$V2
-echo $V3
+	V1="Hello"
+	V2="World"
+	V3=$V1+$V2
+	echo $V3
 
-Output
+输出
 
-Hello+World
+	Hello+World
 
 ### 13) 如何进行两个整数相加 ? ###
 
-V1=1
-V2=2
-V3=$V1+$V2
-echo $V3
+	V1=1
+	V2=2
+	V3=$V1+$V2
+	echo $V3
 
-Output
-3
+输出
+
+	3
 
 ### 14) 如何检查文件系统中是否存在某个文件 ? ###
 
-if [ -f /var/log/messages ]
-then
-echo "File exists"
-fi
+	if [ -f /var/log/messages ]
+	then
+	echo "File exists"
+	fi
 
 ### 15) 写出 shell 脚本中所有循环语法 ? ###
 
-#### for loop : ####
+#### for 循环 : ####
 
-for i in $( ls ); do
-echo item: $i
-done
+	for i in $( ls ); do
+	echo item: $i
+	done
 
-#### while loop : ####
+#### while 循环 : ####
 
-#!/bin/bash
-COUNTER=0
-while [ $COUNTER -lt 10 ]; do
-echo The counter is $COUNTER
-let COUNTER=COUNTER+1
-done
+	#!/bin/bash
+	COUNTER=0
+	while [ $COUNTER -lt 10 ]; do
+	echo The counter is $COUNTER
+	let COUNTER=COUNTER+1
+	done
 
-#### untill oop : ####
+#### until 循环 : ####
 
-#!/bin/bash
-COUNTER=20
-until [ $COUNTER -lt 10 ]; do
-echo COUNTER $COUNTER
-let COUNTER-=1
-done
+	#!/bin/bash
+	COUNTER=20
+	until [ $COUNTER -lt 10 ]; do
+	echo COUNTER $COUNTER
+	let COUNTER-=1
+	done
 
 ### 16) 每个脚本开始的 #!/bin/sh 或 #!/bin/bash 表示什么意思 ? ###
 
-这一行说明要使用的 shell。#!/bin/bash 表示脚本使用 /bin/bash。对于 python 脚本,就是 #!/usr/bin/python
+这一行说明要使用的 shell。#!/bin/bash 表示脚本使用 /bin/bash。对于 python 脚本,就是 #!/usr/bin/python。(LCTT译注:这一行称之为[释伴行](https://linux.cn/article-3664-1.html)。)
 
 ### 17) 如何获取文本文件的第 10 行 ? ###
 
-head -10 file|tail -1
+	head -10 file|tail -1
 
 ### 18) bash 脚本文件的第一个符号是什么 ###
 
-#
+	#
 
 ### 19) 命令:[ -z "" ] && echo 0 || echo 1 的输出是什么 ###
 
-0
+	0
 
 ### 20) 命令 “export” 有什么用 ? ###
 
-使变量在子 shell 中公有
+使变量在子 shell 中可用。
 
 ### 21) 如何在后台运行脚本 ? ###
 
-在脚本后面添加 “&”
+在脚本后面添加 “&”。
 
 ### 22) "chmod 500 script" 做什么 ? ###
 
-使脚本所有者拥有可执行权限
+使脚本所有者拥有可执行权限。
 
 ### 23) ">" 做什么 ? ###
 
@@ -157,8 +158,8 @@ head -10 file|tail -1
 
 ### 24) & 和 && 有什么区别 ###
 
-& - 希望脚本在后台运行的时候使用它
-&& - 当第一个脚本成功完成才执行命令/脚本的时候使用它
+- & - 希望脚本在后台运行的时候使用它
+- && - 当前一个脚本成功完成才执行后面的命令/脚本的时候使用它
 
 ### 25) 什么时候要在 [ condition ] 之前使用 “if” ? ###
 
@@ -166,81 +167,87 @@ head -10 file|tail -1
 
 ### 26) 命令: name=John && echo 'My name is $name' 的输出是什么 ###
 
-My name is $name
+	My name is $name
 
 ### 27) bash shell 脚本中哪个符号用于注释 ? ###
 
-#
+	#
 
 ### 28) 命令: echo ${new:-variable} 的输出是什么 ###
 
-variable
+	variable
 
 ### 29)  ' 和 " 引号有什么区别 ? ###
 
-' - 当我们不希望把变量转换为值的时候使用它。
-" - 会计算所有变量的值并用值代替。
+- ' - 当我们不希望把变量转换为值的时候使用它。
+- " - 会计算所有变量的值并用值代替。
 
-### 30) 如何在脚本文件中重定向标准输入输出流到 log.txt 文件 ? ###
+### 30) 如何在脚本文件中重定向标准输出和标准错误流到 log.txt 文件 ? ###
 
-在脚本文件中添加 "exec >log.txt 2>&1" 命令
+在脚本文件中添加 "exec >log.txt 2>&1" 命令。
 
-### 31) 如何只用 echo 命令获取 string 变量的一部分 ? ###
+### 31) 如何只用 echo 命令获取字符串变量的一部分 ? ###
+
+	echo ${variable:x:y}
+	x - 起始位置
+	y - 长度
 
-echo ${variable:x:y}
-x - 起始位置
-y - 长度
 例子:
-variable="My name is Petras, and I am developer."
-echo ${variable:11:6} # 会显示 Petras
 
-### 32) 如果给定字符串 variable="User:123:321:/home/dir" 如何只用 echo 命令获取 home_dir ? ###
+	variable="My name is Petras, and I am developer."
+	echo ${variable:11:6} # 会显示 Petras
+
+### 32) 如果给定字符串 variable="User:123:321:/home/dir",如何只用 echo 命令获取 home_dir ? ###
+
+	echo ${variable#*:*:*:}
 
-echo ${variable#*:*:*:}
 或
-echo ${variable##*:}
+
+	echo ${variable##*:}
 
 ### 33) 如何从上面的字符串中获取 “User”  ? ###
 
-echo ${variable%:*:*:*}
+	echo ${variable%:*:*:*}
+
 或
-echo ${variable%%:*}
+
+	echo ${variable%%:*}
 
 ### 34) 如何使用 awk 列出 UID 小于 100 的用户 ? ###
 
-awk -F: '$3<100' /etc/passwd
+	awk -F: '$3<100' /etc/passwd
 
 ### 35) 写程序为用户计算主组数目并显示次数和组名 ###
 
-cat /etc/passwd|cut -d: -f4|sort|uniq -c|while read c g
-do
-{ echo $c; grep :$g: /etc/group|cut -d: -f1;}|xargs -n 2
-done
+	cat /etc/passwd|cut -d: -f4|sort|uniq -c|while read c g
+	do
+	{ echo $c; grep :$g: /etc/group|cut -d: -f1;}|xargs -n 2
+	done
 
-### 36) 如何在 bash shell 中更改标注域分隔符为 ":" ? ###
+### 36) 如何在 bash shell 中更改标准的域分隔符为 ":" ? ###
 
-IFS=":"
+	IFS=":"
 
 ### 37) 如何获取变量长度 ? ###
 
-${#variable}
+	${#variable}
 
 ### 38) 如何打印变量的最后 5 个字符 ? ###
 
-echo ${variable: -5}
+	echo ${variable: -5}
 
 ### 39) ${variable:-10} 和 ${variable: -10} 有什么区别? ###
 
-${variable:-10} - 如果之前没有给 variable 赋值则输出 10
-${variable: -10} - 输出 variable 的最后 10 个字符
+- ${variable:-10} - 如果之前没有给 variable 赋值则输出 10
+- ${variable: -10} - 输出 variable 的最后 10 个字符
 
 ### 40) 如何只用 echo 命令替换字符串的一部分 ? ###
 
-echo ${variable//pattern/replacement}
+	echo ${variable//pattern/replacement}
 
 ### 41) 哪个命令将命令替换为大写 ? ###
 
-tr '[:lower:]' '[:upper:]'
+	tr '[:lower:]' '[:upper:]'
 
 ### 42) 如何计算本地用户数目 ? ###
 
@@ -250,141 +257,151 @@ cat /etc/passwd|wc -l
 
 ### 43) 不用 wc 命令如何计算字符串中的单词数目 ? ###
 
-set ${string}
-echo $#
+	set ${string}
+	echo $#
 
 ### 44)  "export $variable" 或 "export variable" 哪个正确 ? ###
 
-export variable
+	export variable
 
 ### 45) 如何列出第二个字母是 a 或 b 的文件 ? ###
 
-ls -d ?[ab]*
+	ls -d ?[ab]*
 
 ### 46) 如何将整数 a 加到 b 并赋值给 c ? ###
 
-c=$((a+b))
+	c=$((a+b))
+
 或
-c=`expr $a + $b`
+
+	c=`expr $a + $b`
+
 或
-c=`echo "$a+$b"|bc`
+
+	c=`echo "$a+$b"|bc`
 
 ### 47) 如何去除字符串中的所有空格 ? ###
 
-echo $string|tr -d " "
+	echo $string|tr -d " "
 
-### 48) 重写命令输出变量转换为复数的句子: item="car"; echo "I like $item" ? ###
+### 48) 重写这个命令,将输出变量转换为复数: item="car"; echo "I like $item" ? ###
 
-item="car"; echo "I like ${item}s"
+	item="car"; echo "I like ${item}s"
 
 ### 49) 写出输出数字 0 到 100 中 3 的倍数(0 3 6 9 …)的命令 ? ###
 
-for i in {0..100..3}; do echo $i; done
+	for i in {0..100..3}; do echo $i; done
+	
 或
-for (( i=0; i<=100; i=i+3 )); do echo "Welcome $i times"; done
+
+	for (( i=0; i<=100; i=i+3 )); do echo "Welcome $i times"; done
 
 ### 50) 如何打印传递给脚本的所有参数 ? ###
 
-echo $*
+	echo $*
+
 或
-echo $@
+
+	echo $@
 
 ### 51)  [ $a == $b ] 和 [ $a -eq $b ] 有什么区别 ###
 
-[ $a == $b ] - 用于字符串比较
-[ $a -eq $b ] - 用于数字比较
+- [ $a == $b ] - 用于字符串比较
+- [ $a -eq $b ] - 用于数字比较
 
 ### 52) = 和 == 有什么区别 ###
 
-= - 用于为变量复制
-== - 用于字符串比较
+- = - 用于为变量复制
+- == - 用于字符串比较
 
 ### 53) 写出测试 $a 是否大于 12 的命令 ? ###
 
-[ $a -gt 12 ]
+	[ $a -gt 12 ]
 
 ### 54) 写出测试 $b 是否小于等于 12 的命令 ? ###
 
-[ $b -le 12 ]
+	[ $b -le 12 ]
 
 ### 55) 如何检查字符串是否以字母 "abc" 开头 ? ###
 
-[[ $string == abc* ]]
+	[[ $string == abc* ]]
 
 ### 56) [[ $string == abc* ]] 和 [[ $string == "abc*" ]] 有什么区别 ###
 
-[[ $string == abc* ]] - 检查字符串是否以字母 abc 开头
-[[ $string == "abc* " ]] - 检查字符串是否完全等于 abc*
+- [[ $string == abc* ]] - 检查字符串是否以字母 abc 开头
+- [[ $string == "abc*" ]] - 检查字符串是否完全等于 abc*
 
 ### 57) 如何列出以 ab 或 xy 开头的用户名 ? ###
 
-egrep "^ab|^xy" /etc/passwd|cut -d: -f1
+	egrep "^ab|^xy" /etc/passwd|cut -d: -f1
 
 ### 58) bash 中 $! 表示什么意思 ? ###
 
-后台最近命令的 PID
+后台最近执行命令的 PID.
 
 ### 59) $? 表示什么意思 ? ###
 
-前台最近命令的结束状态
+前台最近命令的结束状态。
 
 ### 60) 如何输出当前 shell 的 PID ? ###
 
-echo $$
+	echo $$
 
 ### 61) 如何获取传递给脚本的参数数目 ? ###
 
-echo $#
+	echo $#
+	
+(LCTT 译注:和第3题重复了。)
 
 ### 62) $* 和 $@ 有什么区别 ###
 
-$* - 以一个字符串形式输出所有传递到脚本的参数
-$@ - 以 $IFS 为分隔符列出所有传递到脚本中的参数
+- $* - 以一个字符串形式输出所有传递到脚本的参数
+- $@ - 以 $IFS 为分隔符列出所有传递到脚本中的参数
 
 ### 63) 如何在 bash 中定义数组 ? ###
 
-array=("Hi" "my" "name" "is")
+	array=("Hi" "my" "name" "is")
 
 ### 64) 如何打印数组的第一个元素 ? ###
 
-echo ${array[0]}
+	echo ${array[0]}
 
 ### 65) 如何打印数组的所有元素 ? ###
 
-echo ${array[@]}
+	echo ${array[@]}
 
 ### 66) 如何输出所有数组索引 ? ###
 
-echo ${!array[@]}
+	echo ${!array[@]}
 
 ### 67) 如何移除数组中索引为 2 的元素 ? ###
 
-unset array[2]
+	unset array[2]
 
 ### 68) 如何在数组中添加 id 为 333 的元素 ? ###
 
-array[333]="New_element"
+	array[333]="New_element"
 
 ### 69) shell 脚本如何获取输入的值 ? ###
 
 a) 通过参数
 
-./script param1 param2
+	./script param1 param2
 
 b) 通过 read 命令
 
-read -p "Destination backup Server : " desthost
+	read -p "Destination backup Server : " desthost
 
 ### 70) 在脚本中如何使用 "expect" ? ###
 
-/usr/bin/expect << EOD
-spawn rsync -ar ${line} ${desthost}:${destpath}
-expect "*?assword:*"
-send "${password}\r"
-expect eof
-EOD
+	/usr/bin/expect << EOD
+	spawn rsync -ar ${line} ${desthost}:${destpath}
+	expect "*?assword:*"
+	send "${password}\r"
+	expect eof
+	EOD
 
-好运 !! 如果你有任何疑问或者问题需要解答都可以在下面的评论框中写下来。让我们知道这对你的面试有所帮助:-)
+祝你好运 !! 如果你有任何疑问或者问题需要解答都可以在下面的评论框中写下来。让我们知道这对你的面试有所帮助:-)
 
 --------------------------------------------------------------------------------
 
@@ -392,7 +409,7 @@ via: http://linoxide.com/linux-shell-script/shell-scripting-interview-questions-
 
 作者:[Petras Liumparas][a]
 译者:[ictlyh](https://github.com/ictlyh)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md b/published/201506/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md
similarity index 92%
rename from translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md
rename to published/201506/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md
index 9880f7953f..81bf2cbbf6 100644
--- a/translated/tech/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md	
+++ b/published/201506/20150518 Linux FAQs with Answers--How to fix '404 Not Found' error with 'apt-get update' on old Ubuntu.md	
@@ -1,4 +1,4 @@
-Linux有问必答——在旧的Ubuntu上如何修复“apt-get update”的“404 Not Found”错误
+Linux有问必答:如何更新过期版本的Ubuntu
 ================================================================================
 > **问题**: 我的PC上安装了旧版的Ubuntu 13.04(急切的浣熊)。当我在上面运行“sudo apt-get update”时,它丢给了我一大堆“404 Not Found”错误,结果是我不能使用apt-get或aptitude来安装或更新任何软件包了。由于该错误的原因,我甚至不能将它升级到更新的版本。我怎样才能修复这个问题啊?
 > 
@@ -20,7 +20,7 @@ Linux有问必答——在旧的Ubuntu上如何修复“apt-get update”的“4
 
 这里,通过切换到旧版本仓库提供了一个快速修复“404 Not Found”错误的便捷方式。
 
-首先,使用旧版本仓库替换main/security仓库,就像下面这样。
+首先,使用old-releases仓库替换main/security仓库,就像下面这样。
 
     $ sudo sed -i -r 's/([a-z]{2}\.)?archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
     $ sudo sed -i -r 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
@@ -38,7 +38,7 @@ via: http://ask.xmodulo.com/404-not-found-error-apt-get-update-ubuntu.html
 
 作者:[Dan Nanni][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/) 荣誉推出
 
diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md b/published/201506/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md
similarity index 68%
rename from translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md
rename to published/201506/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md
index 54e0f393d1..1d51e06b18 100644
--- a/translated/tech/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md	
+++ b/published/201506/20150518 Linux FAQs with Answers--How to fix 'Encountered a section with no Package--header' error on Raspbian.md	
@@ -1,6 +1,6 @@
-Linux 有问必答--如何修复 Raspbian 上的 “Encountered a section with no Package: header” 错误
+Linux 有问必答:如何修复 Rasbian 上的 “Encountered a section with no Package: header” 错误
 ================================================================================
-> **问题**: 我在 Raspberry Pi 上安装新版的 Rasbian。但当我使用 sudo apt-get update 命令更新 APT 软件包索引的时候,它抛出下面的错误:
+> **问题**: 我在树莓派上安装新版的 Rasbian。但当我使用 sudo apt-get update 命令更新 APT 软件包索引的时候,它抛出下面的错误:
 
     E: Encountered a section with no Package: header
     E: Problem with MergeList /var/lib/dpkg/status
@@ -10,7 +10,7 @@ Linux 有问必答--如何修复 Raspbian 上的 “Encountered a section with n
 
 ![](https://farm8.staticflickr.com/7704/17445484636_05ba81722f_c.jpg)
 
-错误说 "Problem with MergeList /var/lib/dpkg/status"  表示由于某些原因状态文件损坏了,因此无法解释。这个状态文件包括了已经安装的 deb 软件包的信息,因此需要小心备份。
+这个错误说 "Problem with MergeList /var/lib/dpkg/status"  表示由于某些原因状态文件损坏了,因此无法解析。这个状态文件包括了已经安装的 deb 软件包的信息,因此需要小心备份。
 
 在这种情况下,由于这是新安装的 Raspbian,你可以安全地删除状态文件,然后用下面的命令重新生成。
 
@@ -24,7 +24,7 @@ via: http://ask.xmodulo.com/encountered-section-with-no-package-header-error.htm
 
 作者:[Dan Nanni][a]
 译者:[ictlyh](https://github.com/ictlyh)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md b/published/201506/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md
similarity index 72%
rename from translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md
rename to published/201506/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md
index a91a2b3ed3..0011c66b1e 100644
--- a/translated/tech/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md	
+++ b/published/201506/20150518 Linux FAQs with Answers--How to view threads of a process on Linux.md	
@@ -1,16 +1,16 @@
-Linux有问必答——Linux上如何查看某个进程的线程
+Linux有问必答:Linux上如何查看某个进程的线程
 ================================================================================
-> **问题**: 我的程序创建并在它里头执行了多个线程,我怎样才能在该程序创建线程后监控其中单个线程?我想要看到带有它们名称的单个线程详细情况(如,CPU/内存使用率)。
+> **问题**: 我的程序在其内部创建并执行了多个线程,我怎样才能在该程序创建线程后监控其中单个线程?我想要看到带有它们名称的单个线程详细情况(如,CPU/内存使用率)。
 
-线程是现代操作系统上进行并行执行的一个流行的编程方面的抽象概念。当一个程序内有多个线程被叉分出用以执行多个流时,这些线程就会在它们之间共享特定的资源(如,内存地址空间、打开的文件),以使叉分开销最小化,并避免大量花销IPC(进程间通信)频道。这些功能让线程在并发执行时成为一个高效的机制。
+线程是现代操作系统上进行并行执行的一个流行的编程方面的抽象概念。当一个程序内有多个线程被叉分出用以执行多个流时,这些线程就会在它们之间共享特定的资源(如,内存地址空间、打开的文件),以使叉分开销最小化,并避免大量高成本的IPC(进程间通信)通道。这些功能让线程在并发执行时成为一个高效的机制。
 
-在Linux中,程序中创建的线程(也称为轻量级进程,LWP)会具有和程序的PID相同的“线程组ID”。然后,各个线程会获得其自身的线程ID(TID)。对于Linux内核调度器而言,线程不过是恰好共享特定资源的标准的进程。经典的命令行工具,如ps或top,都可以用来显示线程级别的信息,默认情况下它们会显示进程级别的信息。
+在Linux中,程序中创建的线程(也称为轻量级进程,LWP)会具有和程序的PID相同的“线程组ID”。然后,各个线程会获得其自身的线程ID(TID)。对于Linux内核调度器而言,线程不过是恰好共享特定资源的标准的进程而已。经典的命令行工具,如ps或top,都可以用来显示线程级别的信息,只是默认情况下它们显示进程级别的信息。
 
 这里提供了**在Linux上显示某个进程的线程**的几种方式。
 
 ### 方法一:PS ###
 
-在ps命令中,“-T”选项可以开启线程查看。下面的命令列出了由进程号为的进程创建的所有线程。
+在ps命令中,“-T”选项可以开启线程查看。下面的命令列出了由进程号为\的进程创建的所有线程。
 
     $ ps -T -p 
 
@@ -26,7 +26,7 @@ top命令可以实时显示各个线程情况。要在top输出中开启线程
 
 ![](https://farm9.staticflickr.com/8824/17350561070_3dfe447974_c.jpg)
 
-要让top输出某个特定进程并检查该进程内运行的线程状况:
+要让top输出某个特定进程\并检查该进程内运行的线程状况:
 
     $ top -H -p 
 
@@ -36,7 +36,7 @@ top命令可以实时显示各个线程情况。要在top输出中开启线程
 
 一个对用户更加友好的方式是,通过htop查看单个进程的线程,它是一个基于ncurses的交互进程查看器。该程序允许你在树状视图中监控单个独立线程。
 
-要在htop中启用线程查看,请开启htop,然后按来进入htop的设置菜单。选择“设置”栏下面的“显示选项”,然后开启“树状视图”和“显示自定义线程名”选项。按退出设置。
+要在htop中启用线程查看,请开启htop,然后按\来进入htop的设置菜单。选择“设置”栏下面的“显示选项”,然后开启“树状视图”和“显示自定义线程名”选项。按\退出设置。
 
 ![](https://farm6.staticflickr.com/5338/17350364568_59bce22e7b_b.jpg)
 
@@ -50,7 +50,7 @@ via: http://ask.xmodulo.com/view-threads-process-linux.html
 
 作者:[Dan Nanni][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/) 荣誉推出
 
diff --git a/translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md b/published/201506/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md
similarity index 74%
rename from translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md
rename to published/201506/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md
index c43ac481e7..cf1ef694c0 100644
--- a/translated/tech/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md	
+++ b/published/201506/20150518 Linux FAQs with Answers--What is the Apache error log location on Linux.md	
@@ -1,8 +1,8 @@
-Linux有问必答——Linux上Apache错误日志的位置在哪里?
+Linux有问必答:Linux上Apache错误日志的位置在哪里?
 ================================================================================
-> **问题**: 我尝试着解决我 Linux 系统上的 Apache 网络服务器的错误,Apache的错误日志文件放在[你的 Linux 版本]的哪个位置呢?
+> **问题**: 我尝试着解决我 Linux 系统上的 Apache Web 服务器的错误,Apache的错误日志文件放在[XX  Linux 版本]的哪个位置呢?
 
-错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为网络服务器排障,[保护][1]系统不受各种各样的恶意活动侵犯,或者只是进行[各种各样的][2][分析][3]以监控 HTTP 服务器。根据你网络服务器配置的不同,其错误/访问日志可能放在你系统中不同位置。
+错误日志和访问日志文件为系统管理员提供了有用的信息,比如,为 Web 服务器排障,[保护][1]系统不受各种各样的恶意活动侵犯,或者只是进行[各种各样的][2][分析][3]以监控 HTTP 服务器。根据你 Web 服务器配置的不同,其错误/访问日志可能放在你系统中不同位置。
 
 本文可以帮助你**找到Linux上的Apache错误日志**。
 
@@ -28,7 +28,7 @@ Linux有问必答——Linux上Apache错误日志的位置在哪里?
 
 #### 使用虚拟主机自定义的错误日志 ####
 
-如果在 Apache 网络服务器中使用了虚拟主机, ErrorLog 指令可能会在虚拟主机容器内指定,在这种情况下,上面所说的系统范围的错误日志位置将被忽略。
+如果在 Apache  Web 服务器中使用了虚拟主机, ErrorLog 指令可能会在虚拟主机容器内指定,在这种情况下,上面所说的系统范围的错误日志位置将被忽略。
 
 启用了虚拟主机后,各个虚拟主机可以定义其自身的自定义错误日志位置。要找出某个特定虚拟主机的错误日志位置,你可以打开 /etc/apache2/sites-enabled/.conf,然后查找 ErrorLog 指令,该指令会显示站点指定的错误日志文件。
 
@@ -40,11 +40,11 @@ Linux有问必答——Linux上Apache错误日志的位置在哪里?
 
 #### 自定义的错误日志 ####
 
-要找出 Apache 错误日志的自定义位置,请用文本编辑器打开 /etc/httpd/conf/httpd.conf,然后查找 ServerRoot,该参数显示了 Apache 服务器目录树的顶层,日志文件和配置都位于该目录树中。例如:
+要找出 Apache 错误日志的自定义位置,请用文本编辑器打开 /etc/httpd/conf/httpd.conf,然后查找 ServerRoot,该参数显示了 Apache  Web 服务器目录树的顶层,日志文件和配置都位于该目录树中。例如:
 
     ServerRoot "/etc/httpd"
 
-现在,查找 ErrorLog 开头的行,该行指出了 Apache 网络服务器将错误日志写到了哪里去。注意,指定的位置是 ServerRoot 值的相对位置。例如:
+现在,查找 ErrorLog 开头的行,该行指出了 Apache Web 服务器将错误日志写到了哪里去。注意,指定的位置是 ServerRoot 值的相对位置。例如:
 
     ErrorLog "log/error_log"
 
@@ -71,11 +71,11 @@ via: http://ask.xmodulo.com/apache-error-log-location-linux.html
 
 作者:[Dan Nanni][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/) 荣誉推出
 
 [a]:http://ask.xmodulo.com/author/nanni
-[1]:http://xmodulo.com/configure-fail2ban-apache-http-server.html
-[2]:http://xmodulo.com/interactive-apache-web-server-log-analyzer-linux.html
-[3]:http://xmodulo.com/sql-queries-apache-log-files-linux.html
+[1]:https://linux.cn/article-5068-1.html
+[2]:https://linux.cn/article-5352-1.html
+[3]:https://linux.cn/article-4405-1.html
diff --git a/translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md b/published/201506/20150520 How to Use Docker Machine with a Cloud Provider.md
similarity index 65%
rename from translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md
rename to published/201506/20150520 How to Use Docker Machine with a Cloud Provider.md
index acf052d493..78909dfced 100644
--- a/translated/tech/20150520 How to Use Docker Machine with a Cloud Provider.md	
+++ b/published/201506/20150520 How to Use Docker Machine with a Cloud Provider.md	
@@ -1,7 +1,7 @@
-如何在云服务提供商的机器使用Docker Machine
+如何在云服务提供商的平台上使用Docker Machine
 ================================================================================
-大家好,今天我们来学习如何使用Docker Machine在各种云服务提供商的平台部署Docker。Docker Machine是一个可以帮助我们在自己的电脑、云服务提供商的机器以及我们数据中心的机器上创建Docker机器的应用程序。它为创建服务器、在服务器中安装Docker、根据用户需求配置Docker客户端提供了简单的解决方案。驱动API对本地机器、数据中心的虚拟机或者公用云机器都适用。Docker Machine支持Windows、OSX和Linux,并且提供一个独立的二进制文件,可以直接使用。它让我们可以充分利用支持Docker的基础设施的生态环境合作伙伴,并且使用相同的接口进行访问。它让人们可以使用一个命令来简单而迅速地在不同的云平台部署Docker容器。
-
+
+大家好,今天我们来了解如何使用Docker Machine在各种云服务提供商的平台上部署Docker。Docker Machine是一个可以帮助我们在自己的电脑、云服务提供商的平台以及我们数据中心的机器上创建Docker机器的应用程序。它为创建服务器、在服务器中安装Docker、根据用户需求配置Docker客户端提供了简单的解决方案。驱动API对本地机器、数据中心的虚拟机或者公用云机器都适用。Docker Machine支持Windows、OSX和Linux,并且提供一个独立的二进制文件,可以直接使用。它让我们可以充分利用支持Docker的基础设施的生态环境合作伙伴,并且使用相同的接口进行访问。它让人们可以使用一个命令来简单而迅速地在不同的云平台部署Docker容器。
 
 ### 1. 安装Docker Machine ###
 
@@ -25,14 +25,14 @@ Docker Machine可以很好地支持每一种Linux发行版。首先,我们需
 
 ![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png)
 
-另外机器上需要有docker命令,可以使用如下命令安装:
+要在我们的机器上启用docker命令,需要使用如下命令安装Docker客户端:
 
         # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker
         # chmod +x /usr/local/bin/docker
 
 ### 2. 创建机器 ###
 
-在自己的Linux机器上安装好了Docker Machine之后,我们想要将一个docker虚拟机部署到云服务器上。Docker Machine支持几个流行的云平台,如igital Ocean、Amazon Web Services(AWS)、Microsoft Azure、Google Cloud Computing等等,所以我们可以在不同的平台使用相同的接口来部署Docker。本文中我们会使用digitalocean驱动在Digital Ocean的服务器上部署Docker,--driver选项指定digitalocean驱动,--digitalocean-access-token选项指定[Digital Ocean Control Panel][1]提供的API Token,命令最后的是我们创建的Docker虚拟机的机器名。运行如下命令:
+在自己的Linux机器上安装好了Docker Machine之后,我们想要将一个docker虚拟机部署到云服务器上。Docker Machine支持几个流行的云平台,如igital Ocean、Amazon Web Services(AWS)、Microsoft Azure、Google Cloud Computing及其它等等,所以我们可以在不同的平台使用相同的接口来部署Docker。本文中我们会使用digitalocean驱动在Digital Ocean的服务器上部署Docker,--driver选项指定digitalocean驱动,--digitalocean-access-token选项指定[Digital Ocean Control Panel][1]提供的API Token,命令最后的是我们创建的Docker虚拟机的机器名。运行如下命令:
 
     # docker-machine create --driver digitalocean --digitalocean-access-token  linux-dev
 
@@ -40,7 +40,7 @@ Docker Machine可以很好地支持每一种Linux发行版。首先,我们需
 
 ![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png)
 
-**注意**: 这里linux-dev是我们将要创建的机器的名称。``是一个安全key,可以在Digtal Ocean Control Panel生成。要找到这个key,我们只需要登录到我们的Digital Ocean Control Panel,然后点击API,再点击Generate New Token,填写一个名称,选上Read和Write。然后我们就会得到一串十六进制的key,那就是``,简单地替换到上边的命令中即可。
+**注意**: 这里linux-dev是我们将要创建的机器的名称。``是一个安全key,可以在Digtal Ocean Control Panel生成。要找到这个key,我们只需要登录到我们的Digital Ocean Control Panel,然后点击API,再点击 Generate New Token,填写一个名称,选上Read和Write。然后我们就会得到一串十六进制的key,那就是``,简单地替换到上边的命令中即可。
 
 运行如上命令后,我们可以在Digital Ocean Droplet Panel中看到一个具有默认配置的droplet已经被创建出来了。
 
@@ -48,35 +48,35 @@ Docker Machine可以很好地支持每一种Linux发行版。首先,我们需
 
 简便起见,docker-machine会使用默认配置来部署Droplet。我们可以通过增加选项来定制我们的Droplet。这里是一些digitalocean相关的选项,我们可以使用它们来覆盖Docker Machine所使用的默认配置。
 
-    --digitalocean-image "ubuntu-14-04-x64" 是选择Droplet的镜像
-    --digitalocean-ipv6 enable 是启用IPv6网络支持
-    --digitalocean-private-networking enable 是启用专用网络
-    --digitalocean-region "nyc3" 是选择部署Droplet的区域
-    --digitalocean-size "512mb" 是选择内存大小和部署的类型
+-    --digitalocean-image "ubuntu-14-04-x64" 用于选择Droplet的镜像
+-    --digitalocean-ipv6 enable 启用IPv6网络支持
+-    --digitalocean-private-networking enable 启用专用网络
+-    --digitalocean-region "nyc3" 选择部署Droplet的区域
+-    --digitalocean-size "512mb" 选择内存大小和部署的类型
 
 如果你想在其他云服务使用docker-machine,并且想覆盖默认的配置,可以运行如下命令来获取Docker Mackine默认支持的对每种平台适用的参数。
 
     # docker-machine create -h
 
-### 3. 选择活跃机器 ###
+### 3. 选择活跃主机 ###
 
-部署Droplet后,我们想马上运行一个Docker容器,但在那之前,我们需要检查下活跃机器是否是我们需要的机器。可以运行如下命令查看。
+部署Droplet后,我们想马上运行一个Docker容器,但在那之前,我们需要检查下活跃主机是否是我们需要的机器。可以运行如下命令查看。
 
     # docker-machine ls
 
 ![Docker Machine List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-ls.png)
 
-ACTIVE一列有“*”标记的是活跃机器。
+ACTIVE一列有“*”标记的是活跃主机。
 
-现在,如果我们想将活跃机器切换到需要的机器,运行如下命令:
+现在,如果我们想将活跃主机切换到需要的主机,运行如下命令:
 
     # docker-machine active linux-dev
 
-**注意**:这里,linux-dev是机器名,我们打算激活这个机器,并且在其中运行Docker容器。
+**注意**:这里,linux-dev是机器名,我们打算激活这个机器,并且在其上运行Docker容器。
 
 ### 4. 运行一个Docker容器 ###
 
-现在,我们已经选择了活跃机器,就可以运行Docker容器了。可以测试一下,运行一个busybox容器来执行`echo hello word`命令,这样就可以得到输出:
+现在,我们已经选择了活跃主机,就可以运行Docker容器了。可以测试一下,运行一个busybox容器来执行`echo hello word`命令,这样就可以得到输出:
 
     # docker run busybox echo hello world
 
@@ -98,9 +98,9 @@ SSH到机器上之后,我们可以在上边运行任何Docker容器。这里
 
     # exit
 
-### 5. 删除机器 ###
+### 5. 删除主机 ###
 
-删除在运行的机器以及它的所有镜像和容器,我们可以使用docker-machine rm命令:
+删除在运行的主机以及它的所有镜像和容器,我们可以使用docker-machine rm命令:
 
     # docker-machine rm linux-dev
 
@@ -112,15 +112,15 @@ SSH到机器上之后,我们可以在上边运行任何Docker容器。这里
 
 ![Docker Machine Remove Check](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-remove-check.png)
 
-### 6. 在不使用驱动的情况新增一个机器 ###
+### 6. 在不使用驱动的情况新增一个主机 ###
 
-我们可以在不使用驱动的情况往Docker增加一台机器,只需要一个URL。它可以使用一个已有机器的别名,所以我们就不需要每次在运行docker命令时输入完整的URL了。
+我们可以在不使用驱动的情况往Docker增加一台主机,只需要一个URL。它可以使用一个已有机器的别名,所以我们就不需要每次在运行docker命令时输入完整的URL了。
 
     $ docker-machine create --url=tcp://104.131.50.36:2376 custombox
 
-### 7. 管理机器 ###
+### 7. 管理主机 ###
 
-如果你已经让Docker运行起来了,可以使用简单的**docker-machine stop**命令来停止所有正在运行的机器,如果需要再启动的话可以运行**docker-machine start**:
+如果你已经让Docker运行起来了,可以使用简单的**docker-machine stop**命令来停止所有正在运行的主机,如果需要再启动的话可以运行**docker-machine start**:
 
     # docker-machine stop
     # docker-machine start
@@ -140,7 +140,7 @@ via: http://linoxide.com/linux-how-to/use-docker-machine-cloud-provider/
 
 作者:[Arun Pyasi][a]
 译者:[goreliu](https://github.com/goreliu)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/published/201506/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/published/201506/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md
new file mode 100644
index 0000000000..8d376b8b72
--- /dev/null
+++ b/published/201506/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md	
@@ -0,0 +1,64 @@
+如何在RHEL/CentOS 7.0中使用tmpfs
+================================================================================
+今天我们来谈谈 Centos 7 中的一个文件系统tmpfs,这是一个将所有文件和文件夹写到虚拟内存中而不是实际写到磁盘中的虚拟文件系统。这意味中tmpfs中所有的内容都是临时的,在tmpfs卸载、系统重启或者电源切断后内容都将会丢失。技术的角度上来说,tmpfs将所有的内容放在内核内部缓存中并且会调整大小来容纳文件,并可从交换空间中交换出不需要的页。
+
+CentOS默认使用tmpfs做的几种用途可用df -h命令的输出来看:
+
+    # df –h
+
+![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs1.jpg)
+
+- /dev - 含有针对所有设备的设备文件的目录
+- /dev/shm - 包含共享内存分配
+- /run - 用于系统日志
+- /sys/fs/cgroup - 用于cgrpups, 一个针对特定进程限制、管制和审计资源利用的内核特性
+
+显然,它也可以用作/tmp目录, 你可以用下面的两种方法来做到:
+
+### 使用systemctl来在/tmp中启用tmpfs ###
+
+你可以使用systemctl命令在tmp目录启用tmpfs, 首先用下面的命令来检查这个特性是否可用:
+
+    # systemctl is-enabled tmp.mount
+
+这会显示当先的状态,(如果未启用,)你可以使用下面的命令来启用它:
+
+    # systemctl enable tmp.mount
+
+![systemctl](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs3.jpg)
+
+这会让系统控制/tmp目录并在该目录下挂载一个tmpfs文件系统。
+
+### 手动挂载/tmp文件系统 ###
+
+你可以在/etc/fstab中添加下面这行,来手工在/tmp下挂载 tmpfs。
+
+    tmpfs /tmp tmpfs size=512m 0 0
+
+接着运行这条命令
+
+    # mount –a
+
+![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs2.jpg)
+
+这应该就会在df -h中显示tmpfs了,同样也会在你下次重启时自动挂载。
+
+### 立即创建tmpfs ###
+
+如果由于一些原因,你需要在一个文件夹下立即创建tmpfs,你可以使用下面的命令:
+
+    # mount -t tmpfs -o size=1G tmpfs /mnt/mytmpfs
+
+当然你可以在size选项中指定你希望的大小和希望的挂载点,只要记住是有效的目录就行了。
+
+--------------------------------------------------------------------------------
+
+via: http://linoxide.com/file-system/use-tmpfs-rhel-centos-7-0/
+
+作者:[Adrian Dinu][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://linoxide.com/author/adriand/
diff --git a/translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md b/published/201506/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md
similarity index 81%
rename from translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md
rename to published/201506/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md
index 1f733207f3..db8dc669dc 100644
--- a/translated/tech/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md	
+++ b/published/201506/20150520 How to compile and install wxWidgets on Ubuntu or Debian or Linux Mint.md	
@@ -1,16 +1,13 @@
 如何在Ubuntu/Debian/Linux Mint中编译和安装wxWidgets
 ================================================================================
+
 ### wxWidgets ###
 
-wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中使用相同的代码跨平台开发。
-
-它主要用C++写成,但也可以与其他语言绑定比如Python、Perl、Ruby。
+wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中使用相同的代码跨平台开发。它主要用C++写成,但也可以与其他语言绑定比如Python、Perl、Ruby。
 
 本教程中我将向你展示如何在基于Debian的linux中如Ubuntu和Linux Mint中编译wxwidgets 3.0+。
 
-从源码编译wxWidgets并不困难,仅仅需要几分钟。
-
-库可以按不同的方式来编译,比如静态或者动态库。
+从源码编译wxWidgets并不困难,仅仅需要几分钟。库可以按不同的方式来编译,比如静态或者动态库。
 
 ### 1. 下载 wxWidgets ###
 
@@ -20,13 +17,13 @@ wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中
 
 ### 2. 设置编译环境 ###
 
-要编译wxwidgets,我们需要一些工具包括C++编译器, 在Linux上是g++。所有这些可以通过apt-get工具从仓库中安装。
+要编译wxwidgets,我们需要一些工具包括C++编译器,在Linux上是g++。所有这些可以通过apt-get工具从仓库中安装。
 
 我们还需要wxWidgets依赖的GTK开发库。
 
     $ sudo apt-get install libgtk-3-dev build-essential checkinstall
 
->checkinstall工具允许我们为wxwidgets创建一个安装包,这样之后就可以轻松的使用包管理器来卸载。
+> 这个叫做checkinstall的工具允许我们为wxwidgets创建一个安装包,这样之后就可以轻松的使用包管理器来卸载。
 
 ### 3. 编译 wxWidgets ###
 
@@ -42,7 +39,7 @@ wxWidgets是一个程序开发框架/库, 允许你在Windows、Mac、Linux中
 
 "--disable-shared"选项将会编译静态库而不是动态库。
 
-make命令完成后,编译也成功了。是时候安装wxWidgets到正确的目录。
+make命令完成后,编译就成功了。是时候安装wxWidgets到正确的目录。
 
 更多信息请参考install.txt和readme.txt,这可在wxwidgets中的/docs/gtk/目录下找到。
 
@@ -58,7 +55,7 @@ checkinstall会询问几个问题,请保证在提问后提供一个版本号
 
 ### 5. 追踪安装的文件 ###
 
-如果你想要检查文件安装的位置,使用dpkg命令后面跟上checkinstall提供的报名。
+如果你想要检查文件安装的位置,使用dpkg命令后面跟上checkinstall提供的包名。
 
     $ dpkg -L package_name
     /.
@@ -85,17 +82,17 @@ checkinstall会询问几个问题,请保证在提问后提供一个版本号
     $ cd samples/
     $ make
 
-make命令完成后,进入sampl子目录,这里就有一个可以马上运行的Demo程序了。
+make命令完成后,进入sample 子目录,这里就有一个可以马上运行的Demo程序了。
 
 ### 7. 编译你的第一个程序 ###
 
 你完成编译demo程序后,可以写你自己的程序来编译了。这个也很简单。
 
-假设你用的是C++这样你可以使用编辑器的高亮特性。比如gedit、kate、kwrite等等。或者用全功能的IDE像Geany、Codelite、Codeblocks等等。
+假设你用的是C++,这样的话你还可以使用编辑器的高亮特性。比如gedit、kate、kwrite等等。或者用全功能的IDE像Geany、Codelite、Codeblocks等等。
 
 然而你的第一个程序只需要用一个文本编辑器来快速完成。
 
-这里就是
+如下:
 
     #include 
     
@@ -155,7 +152,7 @@ via: http://www.binarytides.com/install-wxwidgets-ubuntu/
 
 作者:[Silver Moon][a]
 译者:[geekpi](https://github.com/geekpi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md b/published/201506/20150520 Shell Script to Backup Files or Directories Using rsync.md
similarity index 51%
rename from translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md
rename to published/201506/20150520 Shell Script to Backup Files or Directories Using rsync.md
index 639e58ede9..b987588c4f 100644
--- a/translated/tech/20150520 Shell Script to Backup Files or Directories Using rsync.md	
+++ b/published/201506/20150520 Shell Script to Backup Files or Directories Using rsync.md	
@@ -1,6 +1,6 @@
 Shell脚本:使用rsync备份文件/目录
 ================================================================================
-本文,我们带来了shell脚本,用来使用rsync命令将你本地Linux机器上的文件/目录备份到远程Linux服务器上。使用该脚本实施备份会是一个交互的方式,你需要提供远程备份服务器的主机名/ip地址和文件夹位置。我们保留了一个独立文件,在这个文件中你需要提供需要备份的文件/目录。我们添加了两个脚本,**第一个脚本**在每次拷贝完一个文件后询问密码(如果你启用了ssh验证密钥,那么就不会询问密码),而第二个脚本中,则只会提示一次输入密码。
+本文我们介绍一个shell脚本,用来使用rsync命令将你本地Linux机器上的文件/目录备份到远程Linux服务器上。使用该脚本会以交互的方式实施备份,你需要提供远程备份服务器的主机名/ip地址和文件夹位置。我们使用一个单独的列表文件,在这个文件中你需要列出要备份的文件/目录。我们添加了两个脚本,**第一个脚本**在每次拷贝完一个文件后询问密码(如果你启用了ssh密钥验证,那么就不会询问密码),而第二个脚本中,则只会提示一次输入密码。
 
 我们打算备份bckup.txt,dataconfig.txt,docs和orcledb。
 
@@ -12,7 +12,7 @@ Shell脚本:使用rsync备份文件/目录
     drwxr-xr-x. 2 root root 4096 May 15 10:45 docs
     drwxr-xr-x. 2 root root 4096 May 15 10:44 oracledb
 
-该文件包含了备份文件/目录的详情
+bckup.txt文件包含了需要备份的文件/目录的详情
 
     [root@Fedora21 tmp]# cat /tmp/bckup.txt
     /tmp/oracledb
@@ -24,46 +24,46 @@ Shell脚本:使用rsync备份文件/目录
 
     #!/bin/bash
 
-    #We will save path to backup file in variable
+    # 将备份列表文件的路径保存到变量中
     backupf='/tmp/bckup.txt'
 
-    #Next line just prints message
+    # 输入一个提示信息
     echo "Shell Script Backup Your Files / Directories Using rsync"
 
-    #next line check if entered value is not null, and if null it will reask user to enter Destination Server
+    # 检查是否输入了目标服务器,如果为空就再次提示用户输入
     while [ x$desthost = "x" ]; do
 
-    #next line prints what userd should enter, and stores entered value to variable with name desthost
+    # 提示用户输入目标服务器地址并保存到变量
     read -p "Destination backup Server : " desthost
 
-    #next line finishes while loop
+    # 结束循环
     done
 
-    #next line check if entered value is not null, and if null it will reask user to enter Destination Path
+    # 检查是否输入了目标文件夹,如果为空就再次提示用户输入
     while [ x$destpath = "x" ]; do
 
-    #next line prints what userd should enter, and stores entered value to variable with name destpath
+    # 提示用户输入目标文件夹并保存到变量
     read -p "Destination Folder : " destpath
 
-    #next line finishes while loop
+    # 结束循环
     done
 
-    #Next line will start reading backup file line by line
+    # 逐行读取备份列表文件
     for line in `cat $backupf`
 
-    #and on each line will execute next
+    # 对每一行都进行处理
     do
 
-    #print message that file/dir will be copied
+    # 显示要被复制的文件/文件夹名称
     echo "Copying $line ... "
-    #copy via rsync file/dir to destination
+    # 通过 rsync 复制文件/文件夹到目标位置
 
     rsync -ar "$line" "$desthost":"$destpath"
 
-    #this line just print done
+    # 显示完成
     echo "DONE"
 
-    #end of reading backup file
+    # 结束
     done
 
 #### 运行带有输出结果的脚本 ####
@@ -91,64 +91,65 @@ Shell脚本:使用rsync备份文件/目录
 
     #!/bin/bash
 
-    #We will save path to backup file in variable
+    # 将备份列表文件的路径保存到变量中
     backupf='/tmp/bckup.txt'
 
-    #Next line just prints message
+    # 输入一个提示信息
     echo "Shell Script Backup Your Files / Directories Using rsync"
 
-    #next line check if entered value is not null, and if null it will reask user to enter Destination Server
+    # 检查是否输入了目标服务器,如果为空就再次提示用户输入
     while [ x$desthost = "x" ]; do
 
-    #next line prints what userd should enter, and stores entered value to variable with name desthost
+    # 提示用户输入目标服务器地址并保存到变量
     read -p "Destination backup Server : " desthost
 
-    #next line finishes while loop
+    # 结束循环
     done
 
-    #next line check if entered value is not null, and if null it will reask user to enter Destination Path
+    # 检查是否输入了目标文件夹,如果为空就再次提示用户输入
     while [ x$destpath = "x" ]; do
 
-    #next line prints what userd should enter, and stores entered value to variable with name destpath
+    # 提示用户输入目标文件夹并保存到变量
     read -p "Destination Folder : " destpath
 
-    #next line finishes while loop
+    # 结束循环
     done
 
-    #next line check if entered value is not null, and if null it will reask user to enter password
+    # 检查是否输入了目标服务器密码,如果为空就再次提示用户输入
     while [ x$password = "x" ]; do
-    #next line prints what userd should enter, and stores entered value to variable with name password. #To hide password we are using -s key
+    # 提示用户输入密码并保存到变量
+    # 使用 -s 选项不回显输入的密码
     read -sp "Password : " password
-    #next line finishes while loop
+    # 结束循环
     done
 
-    #Next line will start reading backup file line by line
+    # 逐行读取备份列表文件
     for line in `cat $backupf`
 
-    #and on each line will execute next
+    # 对每一行都进行处理
     do
 
-    #print message that file/dir will be copied
+    # 显示要被复制的文件/文件夹名称
     echo "Copying $line ... "
-    #we will use expect tool to enter password inside script
+    # 使用 expect 来在脚本中输入密码
     /usr/bin/expect << EOD
-    #next line set timeout to -1, recommended to use
+    # 推荐设置超时为 -1 
     set timeout -1
-    #copy via rsync file/dir to destination, using part of expect — spawn command
+    # 通过 rsync 复制文件/文件夹到目标位置,使用 expect 的组成部分 spawn 命令
 
     spawn rsync -ar ${line} ${desthost}:${destpath}
-    #as result of previous command we expect “password” promtp
+    # 上一行命令会等待 “password” 提示
     expect "*?assword:*"
-    #next command enters password from script
+    # 在脚本中提供密码
     send "${password}\r"
-    #next command tells that we expect end of file (everything finished on remote server)
+    # 等待文件结束符(远程服务器处理完了所有事情)
     expect eof
-    #end of expect pard
+    # 结束 expect 脚本
     EOD
-    #this line just print done
+    # 显示结束
     echo "DONE"
 
-    #end of reading backup file
+    # 完成
     done
 
 #### 运行第二个带有输出结果的脚本的屏幕截图 ####
@@ -163,7 +164,7 @@ via: http://linoxide.com/linux-shell-script/shell-script-backup-files-directorie
 
 作者:[Yevhen Duma][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/) 荣誉推出
 
diff --git a/translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md b/published/201506/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md
similarity index 79%
rename from translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md
rename to published/201506/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md
index 526de3549e..377a9a0399 100644
--- a/translated/tech/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md	
+++ b/published/201506/20150521 Linux FAQs with Answers--How to change system proxy settings from the command line on Ubuntu desktop.md	
@@ -1,14 +1,14 @@
-Linux 有问必答--如何在桌面版 Ubuntu 中用命令行更改系统代理设置
+Linux 有问必答:如何在桌面版 Ubuntu 中用命令行更改系统代理设置
 ================================================================================
-> **问题**: 我经常需要在桌面版 Ubuntu 中更改系统代理设置,但我不想通过繁琐的 GUI 菜单链:"系统设置" -> "网络" -> "网络代理"。在命令行中有更方便的方法更改桌面版的代理设置吗?
+> **问题**: 我经常需要在桌面版 Ubuntu 中更改系统代理设置,但我不想通过繁琐的 GUI 菜单点击:"系统设置" -> "网络" -> "网络代理"。在命令行中有更方便的方法更改桌面版的代理设置吗?
 
-在桌面版 Ubuntu 中,它的桌面环境设置,包括系统代理设置,都存储在 DConf 数据库,这是简单的键值对存储。如果你想通过系统设置菜单修改桌面属性,更改会持久保存在后端的 DConf 数据库。在 Ubuntu 中更改 DConf 数据库有基于图像用户界面和非图形用户界面的两种方式。系统设置或者 dconf-editor 是访问 DConf 数据库的图形方法,而 gsettings 或 dconf 就是能更改数据库的命令行工具。
+在桌面版 Ubuntu 中,它的桌面环境设置,包括系统代理设置,都存储在 DConf 数据库,这是简单的键值对存储。如果你想通过系统设置菜单修改桌面属性,更改会持久保存在后端的 DConf 数据库。在 Ubuntu 中更改 DConf 数据库有基于图像用户界面和非图形用户界面的两种方式。系统设置或者 `dconf-editor` 是访问 DConf 数据库的图形方法,而 `gsettings` 或 `dconf` 就是能更改数据库的命令行工具。
 
-下面介绍如何用 gsettings 从命令行更改系统代理设置。
+下面介绍如何用 `gsettings` 从命令行更改系统代理设置。
 
 ![](https://farm6.staticflickr.com/5460/17872782271_68e5267a4a_c.jpg)
 
-gsetting 读写特定 Dconf 设置的基本用法如下:
+`gsettings` 读写特定 Dconf 设置的基本用法如下:
 
 更改 DConf 设置:
 
@@ -53,7 +53,7 @@ gsetting 读写特定 Dconf 设置的基本用法如下:
 
 ### 在命令行中清除系统代理设置 ###
 
-最后,清除所有 手动/自动 代理设置,还原为无代理设置:
+最后,清除所有“手动/自动”代理设置,还原为无代理设置:
 
     $ gsettings set org.gnome.system.proxy mode 'none' 
 
@@ -63,7 +63,7 @@ via: http://ask.xmodulo.com/change-system-proxy-settings-command-line-ubuntu-des
 
 作者:[Dan Nanni][a]
 译者:[ictlyh](https://github.com/ictlyh)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md b/published/201506/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md
similarity index 86%
rename from translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md
rename to published/201506/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md
index def6860616..273d603c98 100644
--- a/translated/tech/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md	
+++ b/published/201506/20150521 Linux FAQs with Answers--How to install Unity Tweak Tool on Ubuntu desktop.md	
@@ -1,4 +1,4 @@
-Linux 有问必答--如何在桌面版 Ubuntu 中安装 Unity Tweak Tool
+Linux 有问必答:如何在桌面版 Ubuntu 中安装 Unity Tweak Tool
 ================================================================================
 > **问题**: 我试着给刚安装的桌面版 Ubuntu 自定制桌面。我想使用 Unity Tweak Tool。我怎样才能在 Ubuntu 上安装 Unity Tweak Tool 呢?
 
@@ -6,7 +6,7 @@ Linux 有问必答--如何在桌面版 Ubuntu 中安装 Unity Tweak Tool
 
 ![](https://farm6.staticflickr.com/5463/17684020389_25dc7f0db2_b.jpg)
 
-尽管 Unity Tweak Tool 是桌面版 Ubuntu 的重要工具,并没有在桌面版 Ubuntu 中预安装。为了能自定制 Unity 桌面,下面介绍一下如何在桌面版 Ubuntu 中安装 Unity Tweak Tool。
+尽管 Unity Tweak Tool 是桌面版 Ubuntu 的重要工具,但并没有在桌面版 Ubuntu 中预安装。为了能自定制 Unity 桌面,下面介绍一下如何在桌面版 Ubuntu 中安装 Unity Tweak Tool。
 
 ### 在 Ubuntu 13.04 或更高版本中安装 Unity Tweak Tool ###
 
@@ -34,7 +34,7 @@ via: http://ask.xmodulo.com/install-unity-tweak-tool-ubuntu-desktop.html
 
 作者:[Dan Nanni][a]
 译者:[ictlyh](https://github.com/ictlyh)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md b/published/201506/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md
similarity index 100%
rename from published/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md
rename to published/201506/20150521 Will Ubuntu Linux Hit 200 Million Users This Year.md
diff --git a/translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md b/published/201506/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md
similarity index 82%
rename from translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md
rename to published/201506/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md
index dc039ba551..72eae8b0bb 100644
--- a/translated/tech/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md	
+++ b/published/201506/20150525 Linux ntopng--Network Monitoring Tool Installation Screenshots.md	
@@ -1,8 +1,8 @@
-Linux ntopng——网络监控工具的安装(附截图)
+Linux 上网络监控工具 ntopng 的安装
 ================================================================================
-当今世界,人们的计算机都相互连接,互联互通。小到你的家庭局域网(LAN),大到最大的一个被我们称为的——互联网。当你管理一台联网的计算机时,你就是在管理最关键的组件之一。由于大多数开发出的应用程序都基于网络,网络就连接起了这些关键点。
+当今世界,人们的计算机都相互连接,互联互通。小到你的家庭局域网(LAN),大到最大的一个被我们称为互联网。当你管理一台联网的计算机时,你就是在管理最关键的组件之一。由于大多数开发出的应用程序都基于网络,网络就连接起了这些关键点。
 
-这就是为什么我们需要网络监控工具。最好的网络监控工具之一,它叫作ntop。来自[维基百科][1]的知识“ntop是一个网络探测器,它以与top显示进程般类似的方式显示网络使用率。在交互模式中,它显示了用户终端上的网络状态。在网页模式中,它作为网络服务器,创建网络状态的HTML转储文件。它支持NetFlow/sFlowemitter/collector,这是一个基于HTTP的客户端界面,用于创建ntop为中心的监控应用和RRD用于持续地存储通信数据”
+这就是为什么我们需要网络监控工具。ntop 是最好的网络监控工具之一。来自[维基百科][1]的知识“ntop是一个网络探测器,它以与top显示进程般类似的方式显示网络使用率。在交互模式中,它显示了用户终端上的网络状态。在网页模式中,它作为网络服务器,创建网络状态的HTML转储文件。它支持NetFlow/sFlowemitter/collector,这是一个基于HTTP的客户端界面,用于创建ntop为中心的监控应用,并使用RRD来持续存储通信数据”。
 
 15年后的今天,你将见到ntopng——下一代ntop。
 
@@ -15,7 +15,7 @@ Ntopng是一个基于网页的高速通信分析器和流量收集器。Ntopng
 从[ntopng网站][2]上,我们可以看到他们说它有众多的特性。这里列出了其中一些:
 
 - 按各种协议对网络通信排序
-- 显示网络通信和IPv4/v6激活的主机
+- 显示网络通信和IPv4/v6的激活主机
 - 持续不断以RRD格式存储定位主机的通信数据到磁盘
 - 通过nDPI,ntop的DPI框架,发现应用协议
 - 显示各种协议间的IP通信分布
@@ -24,11 +24,9 @@ Ntopng是一个基于网页的高速通信分析器和流量收集器。Ntopng
 - 报告按协议类型排序的IP协议使用率
 - 生成HTML5/AJAX网络通信数据
 
-### 安装 ###
+### 安装的先决条件 ###
 
-Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的下载页面][3]找到这些包。对于32位操作系统,你必须从源代码编译。本文在**CentOS 6.4 32位**版本上**测试过**。但是,它也可以在其它基于CentOS/RedHat的Linux版本上工作。让我们开始吧。
-
-#### 先决条件 ####
+Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[它们的下载页面][3]找到这些包。对于32位操作系统,你必须从源代码编译。本文在**CentOS 6.4 32位**版本上**测试过**。但是,它也可以在其它基于CentOS/RedHat的Linux版本上工作。让我们开始吧。
 
 #### 开发工具 ####
 
@@ -78,7 +76,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的
     # make
     # make install
 
-*由于ntopng是一个基于网页的应用,你的系统必须安装有工作良好的网络服务器*
+*由于ntopng是一个基于网页的应用,你的系统必须安装有工作良好的 Web 服务器*
 
 ### 为ntopng创建配置文件 ###
 
@@ -89,13 +87,16 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的
     # cd ntopng
     # vi ntopng.start
 
-    放入这些行:
-    --local-network “10.0.2.0/24”
+放入这些行:
+
+    --local-network "10.0.2.0/24"
     --interface 1
 
+---
     # vi ntopng.pid
 
-    放入该行:
+放入该行:
+    
     -G=/var/run/ntopng.pid
 
 保存这些文件,然后继续下一步。
@@ -128,7 +129,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的
 
 ![Ntopng Flows](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_flows.png)
 
-在**主机菜单**上,你可以看到连接到流的所有主机
+在**主机菜单**上,你可以看到连接到流的所有主机。
 
 ![Ntopng Hosts List](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_hoslist.png)
 
@@ -146,8 +147,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的
 
 ![Ntopng Apps](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_apps.png)
 
-**界面菜单**将引领你进入更多内部菜单。
-包菜单将给你显示包的分布大小。
+**界面菜单**将引领你进入更多内部菜单。包菜单将给你显示包的大小分布。
 
 ![Ntopng packets](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_packets.png)
 
@@ -157,7 +157,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的
 
 ![Ntopng protocols - detail](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_protocol_detail.png)
 
-你也可以通过使用**历史活跃度菜单**查看活跃度
+你也可以通过使用**历史活跃度菜单**查看活跃度。
 
 ![Ntopng Historical Activity](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_historical.png)
 
@@ -167,7 +167,7 @@ Ntop为CentOS和**基于64位**Ubuntu预编译好了包,你可以在[他们的
 
 ![Ntopng Users](http://blog.linoxide.com/wp-content/uploads/2013/11/ntopng_users.png)
 
-Ntopng为你提供了一个范围宽广的时间线,从5分钟到1年都可以。你只需要点击你想要现实的时间线。图标本身是可以点击的,你可以点击它来进行缩放。
+Ntopng为你提供了一个范围宽广的时间线,从5分钟到1年都可以。你只需要点击你想要显示的时间线。图表本身是可以点击的,你可以点击它来进行缩放。
 
 当然,ntopng能做的事比上面图片中展示的还要多得多。你也可以将定位和电子地图服务整合进来。在ntopng自己的网站上,有已付费的模块可供使用,如nprobe可以扩展ntopng可以提供给你的信息。更多关于ntopng的信息,你可以访问[ntopng网站][5]。
 
@@ -177,7 +177,7 @@ via: http://linoxide.com/monitoring-2/ntopng-network-monitoring-tool/
 
 作者:[Pungki Arianto][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/) 荣誉推出
 
diff --git a/published/201506/20150527 3 Open Source Python Shells.md b/published/201506/20150527 3 Open Source Python Shells.md
new file mode 100644
index 0000000000..86c6b7ee96
--- /dev/null
+++ b/published/201506/20150527 3 Open Source Python Shells.md	
@@ -0,0 +1,102 @@
+3个开源的Python Shell
+=========================================================================
+
+Python是一个高级、通用、结构化且强大的开源编程语言,广泛用于各种编程工作。它拥有一个全动态类型系统和自动内存管理,与Scheme,Ruby,Perl和Tcl的十分相似,避免编译型语言的许多复杂地方和难以理解。Python于1991年由Guido van Rossum创造,然后逐渐成长,流行。
+
+Python是一个非常实用,而且流行的计算机编程语言。使用一个如Python这样的解释型语言的好处之一就是,可以借助其交互的shell探索式地编程。你可以试着代码,而不必专门写一个脚本。但是Python shell也有一些局限性。基本来说,有许多很漂亮的Python shell可选择,都是在基础shell上扩展的。他们每一个都提供了一个极好的交互性的Python 体验。
+
+### bpython ###
+
+![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-bpython.png)
+
+对于Linux,BSD,OS X和Windows来说,bpython是一个不错的Python解释器的界面。
+
+其想法是提供给用户所有的内置功能,很像现在的IDE(集成开发环境),但是是在一个简单,轻量级的包里,可以在终端窗口里面运行。
+
+bpython并不追求创造任何新的或者开创性的东西。相反,它聚集了一些简洁的理念,关注于实用性和操作性。
+
+功能包括:
+	
+- 内置的语法高亮 - 使用Pygments排版你敲出的代码,并合理配色
+- 根据你的行为,显示自动补全的建议
+- 为任何Python函数列出所期望的参数 - 可以显示你调用的任何函数的参数列表
+- “Rewind”功能会调出内存里的最后一行代码并重新执行
+- 可以将你输入的代码送到pastebin
+- 可以将你输入的代码保存到一个文件
+- 自动缩进
+- 支持Python 3
+
+---
+
+- 网址: [www.bpython-interpreter.org][1]
+- 开发者: Bob Farrell and contributors
+- 证书: MIT License
+- 版本号: 0.14.1
+
+### IPython ###
+
+![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-ipython.png)
+
+IPython是Python shell的一个交互加强版。她提供了一个丰富的工具集合,帮助你交互式地充分利用Python。
+
+IPython可以用来取代标准的Python shell,也可以与标准Python科学和数值处理工具配合,用做一个科学计算(如Matlab或者Mathematical)的完整工作环境。她支持动态对象内省,有限的输入/输出提示,一个宏系统,会话日志,会话恢复,访问完整的系统外壳,详尽且彩色的追踪报告,自动圆括号补全,自动引号补全和可嵌入其他Python程序。
+
+功能包括:
+
+- 强大的交互Shell(基于终端或者Qt)
+- 一个基于浏览器的记事本,支持代码,富文本,数学表达式,内置图表和其他富媒介。
+- 支持交互式的数据可视化和使用GUI工具箱
+- 灵活,嵌入式的解释器可以加载进你自己的项目里
+- 易于使用,高效的并行运算工具
+
+---
+
+- 网址: [ipython.org][2]
+- 开发者: The IPython Development Team
+- 证书: BSD
+- 版本号: 3.1
+
+### DreamPie ###
+
+![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-DreamPie.png)
+
+DreamPie是一个为可靠性和趣味性设计的Python shell。
+
+DreamPie可以用于任何Python解释器(Jython,IronPython,PyPy)。
+
+功能包括:
+
+- 一个新式的交互shell:窗口被分成历史区域和代码区域,历史区域可以让你看到之前的命令及其输出,代码区域是里敲代码的地方。这样,你可以编辑任意多的代码,就好像在你最喜欢的编辑器里一样,并且适当时候可以执行它。你也可以从其他地方复制代码,编辑并马上运行它
+- “只复制代码”命令可以复制你想要的代码,以便你可以把它存入一个文件。代码已经用四个空格缩进进行格式化
+- 自动补全属性和文件名字
+- 自动显示函数参数和文档
+- 在结果历史中保存你最近的结果,备以后用
+- 可以自动折叠很长的输出,以便你可以专注于重要的地方
+- 保存会话的历史记录为一个HTML文件,备以后查询。你可以加载历史文件到DreamPie里,并且快速重复之前的命令。
+- 自动添加圆括号与可选的引号,当你在函数与方法后按下空格键。例如,键入execfile后按下空格会提示execfile("fn")
+- 支持交互的matplotlib绘图
+- 支持Python 2.5,Python 2.6,Python 3.1,Jython 2.5,IronPython 2.6和PyPy
+- 难以置信的快速反应
+
+--- 
+
+- 网址: [www.dreampie.org][3]
+- 开发者: Noam Yorav-Raphael
+- 证书: GNU GPL v3
+- 版本号: 1.2.1
+
+--------------------------------------------------------------------------------
+
+via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html
+
+作者:Frazer Kline
+译者:[wi-cuckoo](https://github.com/wi-cuckoo)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[1]:http://www.bpython-interpreter.org/
+[2]:http://ipython.org/
+[3]:http://www.dreampie.org/
+
+--------------------------------------------------------------------------------
diff --git a/translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md b/published/201506/20150527 3 Useful Hacks Every Linux User Must Know.md
similarity index 79%
rename from translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md
rename to published/201506/20150527 3 Useful Hacks Every Linux User Must Know.md
index 25c1ef3e3d..f4da7cf24b 100644
--- a/translated/tech/20150527 3 Useful Hacks Every Linux User Must Know.md	
+++ b/published/201506/20150527 3 Useful Hacks Every Linux User Must Know.md	
@@ -1,9 +1,10 @@
-每个Linux用户都应该知道的3个有用技巧
+Linux 用户的 3 个命令行小技巧
 ================================================================================
 Linux世界充满了乐趣,我们越深入进去,就会发现越多有趣的事物。我们会努力给你提供一些小技巧,让你和其他人有所不同,下面就是我们准备的3个小技巧。
 
-### 1. 如何在不使用Cron的情况调度Linux下的作业 ###
-在Linux下,调度一个作业/命令可以缩写为Cron。当我们需要调度一个作业时,我们会使用Cron,但你知道我们在不使用Cron的情况也可以调度一个在将来时间运行的作业吗?你可以按照如下建议操作……
+### 1. 如何在不使用Cron的情况调度Linux下的任务 ###
+
+在Linux下,调度一个任务/命令称之为Cron。当我们需要调度一个任务时,我们会使用Cron,但你知道我们在不使用Cron的情况也可以调度一个在将来时间运行的任务吗?你可以按照如下建议操作……
 
 每5秒钟运行一个命令(date)然后将结果写入到一个文件(data.txt)。为了实现这一点,我们可以直接在命令提示符运行如下单行脚本。
 
@@ -21,13 +22,13 @@ Linux世界充满了乐趣,我们越深入进去,就会发现越多有趣的
 
 类似地,我们可以这样运行任何脚本。下边的例子是每100秒运行一个名为`script_name.sh`的脚本。
 
-另外值得一提的是上边的脚本文件必须处于当前目录中,否则需要使用完整路径(`/home/$USER/…/script_name.sh`)。实现如上功能的单行脚本如下:
+另外值得一提的是上面提到的脚本文件必须处于当前目录中,否则需要使用完整路径(`/home/$USER/…/script_name.sh`)。实现如上功能的单行脚本如下:
 
     $ while true; do /bin/sh script_name.sh ; sleep 100 ; done &
 
 **总结**:上述的单行脚本并不是Cron的替代品,因为Cron工具支持众多选项,更加灵活,可定制性也更高。然而如果我们想运行某些测试,比如I/O评测,上述的单行脚本也管用。
 
-还可以参考:[11 Linux Cron Job Scheduling Examples][1]
+还可以参考:[Linux 下 11 个定时调度任务例子][1]
 
 ### 2. 如何不使用clear命令清空终端的内容 ###
 
@@ -37,23 +38,23 @@ Linux世界充满了乐趣,我们越深入进去,就会发现越多有趣的
 
 **总结**:因为`ctrl + l`是一个快捷键,我们不可以在脚本中使用。所以如果我们需要在脚本中清空屏幕内容,还是需要使用`clear`命令。但我能想到的所有其他情况,`ctrl + l`都更加有效。
 
-### 3. 运行一个命令,然后自动回到当前的工作目录 ###
+### 3. 在其它目录运行一个命令,然后自动返回当前工作目录 ###
 
-这是一个很多人可能不知道的令人吃惊的技巧。你可能想运行任何一个命令,然后再回到当前目录。你只需要将命令放在一个圆括号里。
+这是一个很多人可能不知道的令人吃惊的技巧。你可能想在其它目录运行任何一个命令,然后再回到当前目录。要实现这样的目的,你只需要将命令放在一个圆括号里。
 
 我们来看一个例子:
 
     avi@deb:~$ (cd /home/avi/Downloads/)
 
-#### 示例输出 ####
-
-    avi@deb:~
+示例输出:
+
+     avi@deb:~
 
 它首先会cd到Downloads目录,然后又回到了之前的家目录。也许你认为里边的命令根本没有执行,或者是出了某种错误,因为从命令提示符看不出任何变化。让我们简单修改一下这个命令:
 
     avi@deb:~$ (cd /home/avi/Downloads/ && ls -l)
-
-#### 示例输出 ####
+
+示例输出:
 
     -rw-r-----  1 avi  avi     54272 May  3 18:37 text1.txt
     -rw-r-----  1 avi  avi     54272 May  3 18:37 text2.txt
@@ -70,7 +71,7 @@ via: http://www.tecmint.com/useful-linux-hacks-commands/
 
 作者:[Avishek Kumar][a]
 译者:[goreliu](https://github.com/goreliu)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md b/published/201506/20150527 How To Check Laptop CPU Temperature In Ubuntu.md
similarity index 82%
rename from translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md
rename to published/201506/20150527 How To Check Laptop CPU Temperature In Ubuntu.md
index ace8999edb..c158770b3f 100644
--- a/translated/tech/20150527 How To Check Laptop CPU Temperature In Ubuntu.md	
+++ b/published/201506/20150527 How To Check Laptop CPU Temperature In Ubuntu.md	
@@ -2,9 +2,9 @@
 ================================================================================
 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Monitor_temperature_Ubuntu.png)
 
-笔记本过热是最近一个常见的问题。监控硬件温度或许可以帮助你诊断笔记本为什么会过热。本篇中,我们会**了解如何在Ubuntu中检查CPU的温度**。
+夏天到了,笔记本过热是最近一个常见的问题。监控硬件温度或许可以帮助你诊断笔记本为什么会过热。本篇中,我们会**了解如何在Ubuntu中检查CPU的温度**。
 
-我们将使用一个GUI工具[Psensor][1],它允许你在Linux中监控硬件温度。用Psensor你可以:
+我们将使用一个GUI工具[Psensor][1],它允许你在Linux中监控硬件温度。用Psensor你可以:
 
 - 监控cpu和主板的温度
 - 监控NVidia GPU的文档
@@ -17,7 +17,7 @@ Psensor最新的版本同样提供了Ubuntu中的指示小程序,这样使得
 
 ### 如何在Ubuntu 15.04 和 14.04中安装Psensor ###
 
-在安装Psensor前,你需要安装和配置[lm-sensors][2],一个用于硬件监控的命令行工具。如果你想要测量磁盘温度,你还需要安装[hddtemp][3]。要安装这些工具,运行下面的这些命令:
+在安装Psensor前,你需要安装和配置[lm-sensors][2],这是一个用于硬件监控的命令行工具。如果你想要测量磁盘温度,你还需要安装[hddtemp][3]。要安装这些工具,运行下面的这些命令:
 
     sudo apt-get install lm-sensors hddtemp
 
@@ -45,7 +45,7 @@ Psensor最新的版本同样提供了Ubuntu中的指示小程序,这样使得
 
     sudo apt-get install psensor
 
-安装完成后,在Unity Dash中运行程序。第一次运行时,你应该配置Psensor该监控什么状态。
+安装完成后,在Unity Dash中运行程序。第一次运行时,你应该配置Psensor该监控什么状态。
 
 ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/05/Psensor_Ubuntu.jpeg)
 
@@ -73,7 +73,7 @@ via: http://itsfoss.com/check-laptop-cpu-temperature-ubuntu/
 
 作者:[Abhishek][a]
 译者:[geekpi](https://github.com/geekpi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/published/201506/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/published/201506/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md
new file mode 100644
index 0000000000..e726ca1100
--- /dev/null
+++ b/published/201506/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md	
@@ -0,0 +1,226 @@
+如何在linux中用“OpenCart”创建自己的在线商店
+================================================================================
+在网络世界我们可以用电脑做所有事情,电子商务(e-commerce)即是其中之一。电子商务并不是什么新鲜事,它起源于早期的阿帕网,当时就出现了麻省理工学院和斯坦福大学人工智能实验室的学生之间的交易。
+
+近些年出现了上百家电子商务网站,如 Flipcart, eBay, Alibaba, Zappos, IndiaMART, Amazon, 等等。你想做一个自己的亚马逊和Flipcart这样的基于web的应用程序服务器吗?如果是!这个文章正适合你。
+
+Opencart是一个免费开源的使用PHP语言编写的电子商务程序,它可以用来架设一个类似于亚马逊和Flipcart的购物车系统。如果你想在线卖你的产品或想在关门时为你的客户提供服务,Opencart就是给你准备的。你可以使用可靠和专业Opencart应用程序建立一个成功的网上商店(网上商家)。
+
+### OpenCart 网页面板演示 ###
+
+- 商店前端 – [http://demo.opencart.com/][1]
+- 管理登录 – [http://demo.opencart.com/admin/][2]
+
+--
+	------------------ 管理登录 ------------------
+
+    用户名: demo
+    密码: demo
+
+#### Opencart的特点 ####
+
+Opencart是一个符合所有在线商家需求的应用程序。它具备您用来制作自己的电子商务网站的所有特性(见下文)。
+
+- 它是一个免费(如啤酒般免费)而开源(如言论般自由)的应用,在GNU GPL许可下发布。
+- 每个东西都有完善的文档,你不需要到谷歌喊救命。
+- 任意时间的支持和更新。
+- 支持无限数量的类别、产品和制造商。
+- 一切都是基于模板的。
+- 支持多语言和多币种。它确保你的产品遍及全球。
+- 内置产品评论和评级功能。
+- 支持可下载的产品(即电子书)。
+- 支持自动缩放图像。
+- 类似多税率(许多国家都是这样)、查看相关产品、资料页、装船重量计算,使用折扣优惠券,等等功能默认都有了。
+- 内置的备份和恢复工具。
+- 搜索引擎优化做的很好。
+- 发票打印、错误日志和销售报告等都做的很好。
+
+#### 系统需求 ####
+
+- Web 服务器 (首选 Apache HTTP服务器)
+- PHP (5.2 或以上)
+- 数据库 (首选MySQL,但是我这里用的是MariaDB)
+
+#### PHP需要的库和模块 ####
+
+这些扩展必须在您的系统上安装并启用,才能确保Opencart正确安装在web服务器上
+
+- Curl
+- Zip
+- Zlib
+- GD Library
+- Mcrypt
+- Mbstrings
+
+### 第一步: 安装 Apache、 PHP 和 MariaDB ###
+
+1. 像我说的,OpenCart需要一定的技术要求,比如在系统上安装Apache,PHP扩展和数据库(MySQL或MariaDB),才能正常运行Opencart。
+
+	让我们使用命令行安装Apache,PHP和MariaDB。
+
+	**安装 Apache**
+
+    	# apt-get install apache2 		 (在基于Debian系统上)
+    	# yum install httpd			 (在基于RedHat系统上)
+
+	**安装 PHP and Extensions**
+
+    	# apt-get install php5 libapache2-mod-php5 php5-curl php5-mcrypt 	(在基于Debian系统上)
+    	# yum install php php-mysql php5-curl php5-mcrypt			(在基于RedHat系统上)
+
+	**安装 MariaDB**
+
+    	# apt-get install mariadb-server mariadb-client				(在基于Debian系统上)
+    	# yum install mariadb-server mariadb					(在基于RedHat系统上)
+
+2. 在安装所有需要上面的东西后,你可以使用如下命令启动 Apache 和 MariaDB 服务。
+
+    	------------------- 在基于Debian系统上 ------------------- 
+    	# systemctl restart apache2.service					
+    	# systemctl restart mariadb.service	
+
+	--
+    	------------------- 在基于RedHat系统上 ------------------- 
+    	# systemctl restart httpd.service 		
+    	# systemctl restart mariadb.service 				
+
+### 第二步:下载和设置 OpenCart ###
+
+3. 最新版本的OpenCart(2.0.2.0)可以从[OpenCart 网站][3]下载,或直接从github获得。
+
+	作为一种选择,你可以使用wget命令直接从github库下载最新版本的OpenCart,如下所示。
+
+    	# wget https://github.com/opencart/opencart/archive/master.zip
+
+4. 下载压缩文件后,拷贝到Apache工作目录下(例如/var/www/html)然后解压缩master.zip文件。
+
+    	# cp master.zip /var/www/html/
+    	# cd /var/www/html
+    	# unzip master.zip
+
+5. 提取‘master.zip’文件后,切换到提取目录下,然后移动upload目录到应用程序的根文件夹(opencart-master)
+
+    	# cd opencart-master
+    	# mv -v upload/* ../opencart-master/
+
+6. 现在需要重命名或复制OpenCart配置文件,如下所示。
+
+    	# cp /var/www/html/opencart-master/admin/config-dist.php /var/www/html/opencart-master/admin/config.php
+    	# cp /var/www/html/opencart-master/config-dist.php /var/www/html/opencart-master/config.php
+
+7. 下一步,设置/var/www/html/opencart-master的文件和文件夹正确的权限。您需要提供RWX权限给文件和文件夹,用递归方式。
+
+    	# chmod 777 -R /var/www/html/opencart-master 
+
+	**重要**: 设置权限777可能是危险的,所以一旦你完成所有设置,递归恢复755权限到上层的文件夹。
+
+### 第三步: 创建 OpenCart 数据库 ###
+
+8. 下一步是给你的电子商务网站创建一个数据库(比如叫做 opencartdb)来存储数据。连接到数据库服务器并创建一个数据库和用户,并授予用户正确的权限以完全控制该数据库。
+
+    	# mysql -u root -p
+    	CREATE DATABASE opencartdb;
+    	CREATE USER 'opencartuser'@'localhost' IDENTIFIED BY 'mypassword';
+    	GRANT ALL PRIVILEDGES ON opencartdb.* TO 'opencartuser'@'localhost' IDENTIFIED by 'mypassword';
+
+### 第四步: OpenCart 网站安装 ###
+
+9. 一旦所有设置正确,到web浏览器地址栏输入`http://`访问OpenCart web安装。
+
+	点击“继续”,同意许可证协议。
+
+	![Accept OpenCart License](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-License.png)
+
+	*同意OpenCart许可证*
+
+10. 下一个屏幕是安装前服务器设置检查,查看服务器所需的所有模块是否安装正确并且有OpenCart文件的权限。
+
+	如果在第1和2区域有红色标志突出显示,这意味着你需要在服务器上正确安装这些组件满足web服务器的要求。
+
+	如果在第3和4区域有红色标志突出显示,这意味着你的文件有问题。如果一切正确配置您应该看到所有都是绿色标志(见下面),你可以按“继续”。
+
+	![Server Requirement Check](http://www.tecmint.com/wp-content/uploads/2015/05/Server-Checkup.png)
+
+	*服务器需求检查*
+
+11. 在下一个屏幕上输入数据库凭证信息,如数据库驱动类型、主机名、用户名、密码、数据库。你不应该改动数据库端口和前缀,除非你知道你在做什么。
+
+	另外输入管理员账号的用户名、密码和邮箱地址。注意这些凭证将用于管理员登录到Opencart管理面板,所以保证它的安全。完成后单击继续!
+
+	![OpenCart Database Details](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Database.png)
+
+	*OpenCart数据库详情*
+
+12. 下一个屏幕显示的信息如“Installation Complete”和“Ready to Start Selling”。这里还警告说,要记得删除安装目录,所有需要这个目录安装的设置已经完成。
+
+	![OpenCart Installation Completes](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Installation-Completes.png)
+
+	*OpenCart安装完成*
+
+	删除安装目录,你可以执行下面的命令。
+
+    	# rm -rf /var/www/html/opencart-master/install
+
+### 第四步: 进入OpenCart 及其管理界面 ###
+
+13. 现在打开浏览器到`http:///opencart-master/`然后你会看到类似下面的截屏。
+
+	![OpenCart Product Showcase](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart.jpg)
+
+	*OpenCart产品示例*
+
+14. 要登录到Opencart管理面板,你需要浏览`http:///opencart-master/admin`然后填写之前设置的凭证。
+
+	![OpenCart Admin Login](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Admin-Login.png)
+
+	*OpenCart管理登录*
+
+15. 如果全部OK你应该可以看到Opencart的控制台。
+
+	![OpenCart Dashboard](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Dashboard.png)
+
+	*OpenCart控制台*
+
+	在管理控制台可以设置很多选项,如类别、产品、选择、制造商、下载、评论、信息、扩展安装、运输、付款选项、订单总数、礼品券、贝宝、优惠券、子公司、营销、邮件、设计风格和设置、错误日志、内置分析等等。
+
+#### 测试了这个工具之后呢? ####
+
+如果您已经测试了这个应用程序,就会发现它可定制、灵活、稳定、易于维护和使用,您可能需要一个好的主机托管提供商托管你的OpenCart应用,以便保持24 x7的在线支持。尽管有很多选择,我们建议Hostgator主机提供商。(广告硬植-.-!,以下硬广和 LCTT 无关~)
+
+Hostgator是以服务和功能出名的域名注册和虚拟机托管提供商。它为你提供无限的磁盘空间、无限带宽、易于安装(一键安装脚本)、99.9%的正常运行时间、荣获24x7x365技术支持和45天退款保证,这意味着如果你不喜欢这个产品和服务就可以在45天内拿回你的采购费,注意这45天是一个长的测试时间。
+
+所以如果你有什么想卖的你可以免费地去做了(我的意思是免费,想想你会花在实体存储上的费用,然后比较其与建设虚拟商店的成本。你就会感受到它的免费了)。
+
+**注**: 当你从Hostgator购买虚拟主机(和/或域名)你将获得一个**25%折扣**。这只提供给Tecmint网站的读者。
+
+你所要做的就是在购买虚拟机支付时输入优惠码“**TecMint025**”。付款预览截屏优惠码以供参考用。
+
+![Hostgator 25% Discount - TecMint025](http://www.tecmint.com/wp-content/uploads/2015/05/Hostgator-Discount-Code.png)
+
+*[注册 Hostgator][4] (折扣码: TecMint025)*
+
+**注**: 还值得一提的,每个你从Hostgator购买的托管OpenCart的虚拟机,我们将得到少量的佣金,只是为了保持Tecmint存活 (通过支付带宽和托管服务器)。
+
+所以如果你使用上面的代码买它,你得到折扣,我们会得到少量收入。还要注意,你不会支付任何额外的费用,事实上你支付的账单总额将减少25%。
+
+### 总结 ###
+
+OpenCart是一个开箱可用的应用。它易于安装,您可以选择选择最适合的模板,添加你的产品然后你就成为了一个在线店主。
+
+很多社区开发的扩展(有免费和付费的)使它变得丰富。这是一个给那些想要建立一个保持24X7小时用户可访问的虚拟商店的美妙应用。让我们知道你对这个应用程序的体验吧。欢迎任何建议和反馈。
+
+--------------------------------------------------------------------------------
+
+via: http://www.tecmint.com/create-e-commerce-online-shopping-store-using-opencart-in-linux/
+
+作者:[Avishek Kumar][a]
+译者:[wyangsun](https://github.com/wyangsun)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.tecmint.com/author/avishek/
+[1]:http://demo.opencart.com/
+[2]:http://demo.opencart.com/admin/
+[3]:http://www.opencart.com/index.php?route=download/download/
+[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint
diff --git a/translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md b/published/201506/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md
similarity index 70%
rename from translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md
rename to published/201506/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md
index 20211ab6bf..91127c7e74 100644
--- a/translated/tech/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md	
+++ b/published/201506/20150527 How to Kill Linux Processes or Unresponsive Applications Using 'xkill' Command.md	
@@ -1,8 +1,9 @@
-如何使用xkill命令傻点Linux进程/未响应的程序
+如何使用xkill命令杀掉Linux进程/未响应的程序
 ================================================================================
+
 我们如何在Linux中杀掉一个资源/进程?很明显我们会找出资源的pid然后用kill命令。
 
-更准确一点,我们可以找到资源(这里就是terminal)的PID:
+说的更明白一点,我们可以找到某个资源(比如terminal)的PID:
 
     $ ps -A | grep -i terminal
     
@@ -14,7 +15,7 @@
 
 kill命令会发送一个信号给该pid的进程。
 
-另外一个方法是我们可以使用pkill命令,它可以基于进程的名字或者其他的属性来杀掉进程。同样我们要杀掉一个叫terminal的进程可以这么做:
+另外一个方法是我们可以使用pkill命令,它可以基于进程的名字或者其他的属性来杀掉进程。同样我们要杀掉一个叫terminal的进程可以这么做:
 
     $ pkill terminal
 
@@ -22,15 +23,15 @@ kill命令会发送一个信号给该pid的进程。
 
 pkill看上去更加容易上手,因为你你不用找出进程的pid。但是如果你要对系统做更好的控制,那么没有什么可以打败'kill'。使用kill命令可以更好地审视你要杀掉的进程。
 
-我们已经有一篇覆盖了[kill、pkill和killall命令][1]间细节的指导了。
+我们已经有一篇覆盖了[kill、pkill和killall命令][1]细节的指导了。
 
 对于那些运行X Server的人而言,有另外一个工具称为xkill可以将进程从X Window中杀掉而不必传递它的名字或者pid。
 
-xkill工具强制X server关闭于它客户端之间的联系,这可以让X resource关闭这个客户端。xkill是X11工具集中一个非常容易上手的杀掉无用窗口的工具。
+xkill工具强制X server关闭与它的客户程序之间的联系,其结果就是X resource关闭了这个客户程序。xkill是X11工具集中一个非常容易上手的杀掉无用窗口的工具。
 
-它支持的选项如在同时运行多个X Server时使用-display选项后面跟上显示号连接到指定的X server,使用-all(并不建议)杀掉所有在屏幕上的所遇顶层窗口,同时将帧(-frame)也计算在内。
+它支持的选项如在同时运行多个X Server时使用-display选项后面跟上显示号连接到指定的X server,使用-all(并不建议)杀掉所有在屏幕上的所有顶层窗口,以及帧(-frame)参数。
 
-要得到所有的客户端你可以运行:
+要列出所有的客户程序你可以运行:
 
     $ xlsclients
 
@@ -46,12 +47,11 @@ xkill工具强制X server关闭于它客户端之间的联系,这可以让X re
 
 如果后面没有跟上资源id,xkill会将鼠标指针变成一个特殊符号,类似于“X”。只需在你要杀掉的窗口上点击,它就会杀掉它与server端的通信,这个程序就被杀掉了。
 
-
     $ xkill
 
 ![Xkill Command](http://www.tecmint.com/wp-content/uploads/2015/05/Xkill.png)
 
-使用xkill杀掉进程
+*使用xkill杀掉进程*
 
 需要注意的是xkill并不能保证它的通信会被成功杀掉/退出。大多数程序会在与服务端的通信被关闭后杀掉。然而仍有少部分会继续运行。
 
@@ -63,7 +63,7 @@ xkill工具强制X server关闭于它客户端之间的联系,这可以让X re
 
 **我需要在linux命令行中使用xkill么**
 
-不是,你不必在命令行中运行xkill。你可以设置一个快捷键,并用它来调用xkill。
+不是,你不必非在命令行中运行xkill。你可以设置一个快捷键,并用它来调用xkill。
 
 下面是如何在典型的gnome3桌面中设置键盘快捷键。
 
@@ -71,13 +71,13 @@ xkill工具强制X server关闭于它客户端之间的联系,这可以让X re
 
 ![Gnome Settings](http://www.tecmint.com/wp-content/uploads/2015/05/22.png)
 
-Gnome 设置
+*Gnome 设置*
 
 ![Add Shortcut Key](http://www.tecmint.com/wp-content/uploads/2015/05/31.png)
 
-添加快捷键
+*添加快捷键*
 
-下次你要杀掉X资源只要用组合键就行了(Ctrl+Alt+Shift+x),你看到你的鼠标变成x了。点击想要杀掉的x资源就行了。
+下次你要杀掉一个X资源只要用组合键就行了(Ctrl+Alt+Shift+x),你看到你的鼠标变成x了。点击想要杀掉的x资源就行了。
 
 --------------------------------------------------------------------------------
 
@@ -85,9 +85,9 @@ via: http://www.tecmint.com/kill-processes-unresponsive-programs-in-ubuntu/
 
 作者:[Avishek Kumar][a]
 译者:[geekpi](https://github.com/geekpi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
 [a]:http://www.tecmint.com/author/avishek/
-[1]:http://www.tecmint.com/how-to-kill-a-process-in-linux/
+[1]:https://linux.cn/article-2116-1.html
diff --git a/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md b/published/201506/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md
similarity index 77%
rename from translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md
rename to published/201506/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md
index 391769edc2..1466c8c87e 100644
--- a/translated/tech/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md	
+++ b/published/201506/20150527 Linux FAQs with Answers--How to mount an LVM partition on Linux.md	
@@ -1,10 +1,10 @@
-Linux有问必答 -- 如何在Linux中挂载LVM分区
+Linux有问必答:如何在Linux中直接挂载LVM分区
 ================================================================================
 > **提问**: 我有一个USB盘包含了LVM分区。 我想要在Linux中访问这些LVM分区。我该如何在Linux中挂载LVM分区?
 
-】LVM是逻辑卷管理工具,它允许你使用逻辑卷和卷组的概念来管理磁盘空间。使用LVM相比传统分区最大的好处是弹性地位用户和程序分配空间而不用考虑每个物理磁盘的大小。
+LVM是逻辑卷管理工具,它允许你使用逻辑卷和卷组的概念来管理磁盘空间。使用LVM相比传统分区最大的好处是弹性地为用户和程序分配空间而不用考虑每个物理磁盘的大小。
 
-在LVM中,那些创建了逻辑分区的物理存储是传统的分区(比如:/dev/sda2,/dev/sdb1)。这些分区必须被初始化位“物理卷”并被标签(如,“Linux LVM”)来使它们可以在LVM中使用。一旦分区被标记被LVM分区,你不能直接用mount命令挂载。
+在LVM中,那些创建了逻辑分区的物理存储是传统的分区(比如:/dev/sda2,/dev/sdb1)。这些分区必须被初始化为“物理卷 PV”并加上卷标(如,“Linux LVM”)来使它们可以在LVM中使用。一旦分区被标记被LVM分区,你不能直接用mount命令挂载。
 
 如果你尝试挂载一个LVM分区(比如/dev/sdb2), 你会得到下面的错误。
 
@@ -16,9 +16,9 @@ Linux有问必答 -- 如何在Linux中挂载LVM分区
 
 ![](https://farm8.staticflickr.com/7696/17749902190_0a6d36821f_b.jpg)
 
-要正确地挂载LVM分区,你必须挂载分区创建的“逻辑分区”。下面就是如何做的。
+要正确地挂载LVM分区,你必须挂载分区中创建的“逻辑卷”。下面就是如何做的。
 
-=首先,用下面的命令检查可用的卷组:
+首先,用下面的命令检查可用的卷组:
 
     $ sudo pvs 
 
@@ -60,7 +60,9 @@ Linux有问必答 -- 如何在Linux中挂载LVM分区
 
 ![](https://farm8.staticflickr.com/7707/17938137591_cdb4cbfb43_b.jpg)
 
-如果你想要挂载一个特定的逻辑卷,使用“LV Path”下面的设备名(如:/dev/vg_ezsetupsystem40a8f02fadd0/lv_home)。
+*上图可以看到两个逻辑卷的名字:lv_root和lv_home*
+
+如果你想要挂载一个特定的逻辑卷,使用如下的“LV Path”的设备名(如:/dev/vg_ezsetupsystem40a8f02fadd0/lv_home)。
 
     $ sudo mount /dev/vg_ezsetupsystem40a8f02fadd0/lv_home /mnt 
 
@@ -82,7 +84,7 @@ via: http://ask.xmodulo.com/mount-lvm-partition-linux.html
 
 作者:[Dan Nanni][a]
 译者:[geekpi](https://github.com/geekpi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
 
 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
 
diff --git a/published/201506/20150528 11 pointless but awesome Linux terminal tricks.md b/published/201506/20150528 11 pointless but awesome Linux terminal tricks.md
new file mode 100644
index 0000000000..1fc526db5e
--- /dev/null
+++ b/published/201506/20150528 11 pointless but awesome Linux terminal tricks.md	
@@ -0,0 +1,104 @@
+11个无用而有趣的Linux终端彩蛋
+================================================================================
+这里有一些很酷的Linux终端彩蛋,其中的每一个看上去并没有实际用途,但很有趣。
+
+![](http://images.techhive.com/images/article/2015/05/slide_01-100587352-orig.png)
+
+### 只工作不玩耍…… ###
+
+当我们使用命令行工作时,Linux是功能和实用性最好的操作系统之一。想要执行一个特殊任务?可能一个程序或者脚本就可以帮你搞定。但就像一本书中说到的,只工作不玩耍聪明的孩子也会变傻。下边是我最喜欢的可以在终端做的没有实际用途的、傻傻的、恼人的、可笑的事情。
+
+### 让终端成为一个有态度的人 ###
+
+* 第一步)敲入`sudo visudo`
+* 第二步)在“Defaults”末尾(文件的前半部分)添加一行“Defaults insults”。
+* 第三步)保存文件。
+
+“我刚才对电脑做了什么?”你可能这样问自己。一定是美妙的事情吧。现在,在sudo命令提示提示下输出错误的口令,你的电脑就会呼唤你的名字。我最喜欢的一句:“听好了,煎饼一样的脑子,我没有时间听你胡说八道了。”
+
+![](http://images.techhive.com/images/article/2015/05/slide_02-100587353-orig.png)
+
+### apt-get moo ###
+
+![](http://images.techhive.com/images/article/2015/05/slide_03-100587354-orig.png)
+
+你看过这张截图?那就是运行`apt-get moo`(在基于Debian的系统)的结果。对,就是它了。不要对它抱太多幻想,你会失望的,我不骗你。但是这是Linux世界最被人熟知的彩蛋之一。所以我把它包含进来,并且放在前排,然后我也就不会收到5千封邮件,指责我把它遗漏了。
+
+### aptitude moo ###
+
+更有趣的是将moo应用到aptitude上。敲入`aptitude moo`(在Ubuntu及其衍生版),你对`moo`可以做什么事情的看法会有所变化。你还还会知道更多事情,尝试重新输入这条命令,但这次添加一个`-v`参数。这还没有结束,试着添加更多`v`,一次添加一个,直到抓狂的aptitude给了你想要的东西。
+
+![](http://images.techhive.com/images/article/2015/05/slide_04-100587355-orig.png)
+
+### Arch: 将吃豆人放入pacman ###
+
+这里有一个只为Arch爱好者准备的彩蛋。Pacman包管理工具已经很棒了,但我们可以让它变得更棒。
+
+* 第一步)打开“/etc/pacman.conf”文件。
+* 第二步)在“# Misc options”部分,去掉“Color”前的“#”。
+* 第三步)添加“ILoveCandy”。
+
+现在我们使用pacman安装新软件包时,进度条里会出现一个小吃豆人。真应该默认就这样的。
+
+![](http://images.techhive.com/images/article/2015/05/slide_05-100587356-orig.png)
+
+### Cowsay! ###
+
+`aptitude moo`的输出格式很漂亮,但我想你苦于不能自由自在地使用。输入`cowsay`,它会做到你想做的事情。你可以让牛说任何你喜欢的东西。而且不只可以用牛,还可以用Calvin、Beavis和Ghostbusters logo的ASCII的艺术,输入`cowsay -l`可以得到所有可用的参数。它是Linux世界的强大工具。像很多其他命令一样,你可以使用管道把其他程序的输出输送给它,比如`fortune | cowsay`,让这头牛变成哲学家。
+
+![](http://images.techhive.com/images/article/2015/05/slide_06-100587358-orig.png)
+
+### 变成3l33t h@x0r ###
+
+`nmap`并不是我们平时经常使用的基本命令。但如果你想蹂躏`nmap`的话,比如像人一样看起来像l33t。在任何`nmap`命令后添加`-oS`(比如`nmap -oS - google.com`)。现在你的`nmap`已经处于标准叫法是“[脚本玩具模式][1]”的模式了。Angelina Jolie和Keanu Reeves会为此骄傲的。
+
+![](http://images.techhive.com/images/article/2015/05/slide_07-100587359-orig.png)
+
+### 获得所有的Discordian日期 ###
+
+如果你们曾经坐在一起思考,“嗨!我想使用无用但异想天开的方式来书写今天的日期……”试试运行`ddate`。结果类似于“Today is Setting Orange, the 72nd day of Discord in the YOLD 3181”,这会让你的服务树日志平添不少趣味。
+
+注意:在技术层面,确实有一个[Discordian Calendar][2],理论上被[Discordianism][3]追随者所使用。这意味着我可能得罪某些人。或者不会,我不确定。不管怎样,`ddate`是一个方便的工具。
+
+![](http://images.techhive.com/images/article/2015/05/slide_08-100587360-orig.png)
+
+### 我可以在任何地方看到颜色!###
+
+厌倦了老旧的文本?想向世界展示出自己的个性?使用`lolcat`。安装它,然后在任何地方使用。它可以接收任何文本,然后将其转换成美轮美奂的彩虹效果。可以使用`fortune | lolcat`体验。
+
+![](http://images.techhive.com/images/article/2015/05/slide_09-100587361-orig.png)
+
+### 蒸汽机车 ###
+
+在你的终端显示蒸汽机车的ASCII图形。如果你需要它,安装并运行`sl`命令。`sl -l`可以看到一个袖珍版本的。或者,如果你真想在上边花费更多时间,运行`sl -h`。这会显示一个完整的或者,还包括乘客车厢。
+
+![](http://images.techhive.com/images/article/2015/05/slide_10-100587362-orig.png)
+
+### 将任何文本逆序输出 ###
+
+将任何文本使用管道输送给`rev`命令,它就会将文本内容逆序输出。`fortune | rev`会给你好运。当然,这不意味着rev会将幸运(fortune)转换成不幸。
+
+![](http://images.techhive.com/images/article/2015/05/slide_11-100587364-orig.png)
+
+### Matrix依然很酷,不是吗? ###
+
+想让你的终端显示滚动的文字、l33t和Matrix电影中的坠落数码?`cmatrix`是你的朋友。你甚至可以用它输出不同的颜色,非常华丽。使用`man cmatrix`学习使用方法。或者使用更好的方法,“man cmatrix | lolcat”。这确实是你在Linux终端可以做的最没实际用途却又精彩的事情了。
+
+![](http://images.techhive.com/images/article/2015/05/slide_12-100587366-orig.png)
+
+以上就是全部内容了。
+
+--------------------------------------------------------------------------------
+
+via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome-linux-terminal-tricks.html
+
+作者:[Bryan Lunduke][a]
+译者:[goreliu](https://github.com/goreliu)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.networkworld.com/author/Bryan-Lunduke/
+[1]:http://nmap.org/book/output-formats-script-kiddie.html
+[2]:http://en.wikipedia.org/wiki/Discordian_calendar
+[3]:http://en.wikipedia.org/wiki/Discordianism
\ No newline at end of file
diff --git a/published/201506/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/published/201506/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md
new file mode 100644
index 0000000000..89266f8b0d
--- /dev/null
+++ b/published/201506/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md	
@@ -0,0 +1,287 @@
+27 个 Linux 下软件包管理工具 DNF 命令例子
+================================================================================
+DNF即Dandified YUM,是基于RPM的Linux发行版的下一代软件包管理工具。它首先在Fedora 18中出现,并且在最近发行的Fedora 22中替代了[YUM工具集][1]。
+
+![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg)
+
+DNF致力于改善YUM的瓶颈,即性能、内存占用、依赖解决、速度和许多其他方面。DNF使用RPM、libsolv和hawkey库进行包管理。尽管它并未预装在CentOS和RHEL 7中,但您可以通过yum安装,并同时使用二者。
+
+您也许想阅读更多关于DNF的信息:
+
+- [使用DNF取代Yum背后的原因][2]
+
+最新的DNF稳定版本是2015年5月11日发布的1.0(在写这篇文章之前)。它(以及所有DNF之前版本)主要由Python编写,并以GPL v2许可证发布。
+
+### 安装DNF ###
+
+尽管Fedora 22官方已经过渡到了DNF,但DNF并不在RHEL/CentOS 7的默认仓库中。
+
+为了在RHEL/CentOS系统中安装DNF,您需要首先安装和开启epel-release仓库。
+
+    # yum install epel-release
+    或
+    # yum install epel-release -y
+
+尽管并不建议在使用yum时添上'-y'选项,因为最好还是看看什么将安装在您的系统中。但如果您对此并不在意,则您可以使用'-y'选项以自动化的安装而无需用户干预。
+
+接下来,使用yum命令从epel-realease仓库安装DNF包。
+
+    # yum install dnf
+
+在您装完dnf后,我会向您展示27个实用的dnf命令和例子,以便帮您更容易和高效的管理基于RPM包的发行版。
+
+### 1. 检查DNF版本 ###
+
+检查您的系统上安装的DNF版本。
+
+    # dnf --version
+
+![检查DNF版本](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif)
+
+### 2. 列出启用的DNF仓库 ###
+
+dnf命令中的'repolist'选项将显示您系统中所有启用的仓库。
+
+    # dnf repolist
+
+![检查所有开启的仓库](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif)
+
+### 3. 列出所有启用和禁用的DNF仓库 ###
+
+'repolist all'选项将显示您系统中所有启用/禁用的仓库。
+
+    # dnf repolist all
+
+![列出所有启用/禁用的仓库](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif)
+
+### 4. 用DNF列出所有可用的且已安装的软件包 ###
+
+'dnf list'命令将列出所有仓库中所有可用的软件包和您Linux系统中已安装的软件包。
+
+    # dnf list
+
+![用DNF列出所有的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png)
+
+### 5. 用DNF列出所有已安装的软件包 ###
+
+尽管'dnf list'命令将列出所有仓库中所有可用的软件包和已安装的软件包。然而像下面一样使用'list installed'选项将只列出已安装的软件包。
+
+    # dnf list installed
+
+![列出已安装的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png)
+
+### 6. 用DNF列出所有可用的软件包 ###
+
+类似的,可以用'list available'选项列出所有开启的仓库中所有可用的软件包。
+
+    # dnf list available
+
+![用DNF列出可用的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png)
+
+### 7. 使用DNF查找软件包 ###
+
+如果您不太清楚您想安装的软件包的名字,这种情况下,您可以使用'search'选项来搜索匹配该字符(例如,nano)和字符串的软件包。
+
+    # dnf search nano
+
+![通过关键字搜索软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif)
+
+### 8. 查看哪个软件包提供了某个文件/子软件包? ###
+
+dnf的选项'provides'能查找提供了某个文件/子软件包的软件包名。例如,如果您想找找哪个软件包提供了您系统中的'/bin/bash'文件,可以使用下面的命令
+
+    # dnf provides /bin/bash
+
+![查找提供文件的软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif)
+
+### 9. 使用DNF获得一个软件包的详细信息 ###
+
+如果您想在安装一个软件包前知道它的详细信息,您可以使用'info'来获得一个软件包的详细信息,例如:
+
+    # dnf info nano
+
+![用DNF查看软件信息](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif)
+
+### 10. 使用DNF安装软件包 ###
+
+想安装一个叫nano的软件包,只需运行下面的命令,它会为nano自动的解决和安装所有的依赖。
+
+    # dnf install nano
+
+![用DNF安装软件](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif)
+
+### 11. 使用DNF更新一个软件包 ###
+
+您可能只想更新一个特定的包(例如,systemd)并且保留系统内剩余软件包不变。
+
+    # dnf update systemd
+
+![更新一个软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif)
+
+### 12. 使用DNF检查系统更新 ###
+
+检查系统中安装的所有软件包的更新可以简单的使用如下命令:
+
+    # dnf check-update
+
+![检查系统更新](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif)
+
+### 13. 使用DNF更新系统中所有的软件包 ###
+
+您可以使用下面的命令来更新整个系统中所有已安装的软件包。
+
+    # dnf update
+    或
+    # dnf upgrade
+
+![更新系统](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif)
+
+### 14. 使用DNF来移除/删除一个软件包 ###
+
+您可以在dnf命令中使用'remove'或'erase'选项来移除任何不想要的软件包。
+
+    # dnf remove nano
+    或
+    # dnf erase nano
+
+![移除系统中的软件](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif)
+
+### 15. 使用DNF移除于依赖无用的软件包(Orphan Packages) ###
+
+这些为了满足依赖安装的软件包在相应的程序删除后便不再需要了。可以用过下面的命令来将它们删除。
+
+    # dnf autoremove
+
+![移除无用的依赖包](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif)
+
+### 16. 使用DNF移除缓存的软件包 ###
+
+我们在使用dnf时经常会碰到过期的头部信息和不完整的事务,它们会导致错误。我们可以使用下面的语句清理缓存的软件包和包含远程包信息的头部信息。
+
+    # dnf clean all
+
+![移除DNF缓存](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif)
+
+### 17. 获得特定DNF命令的帮助 ###
+
+您可能需要特定的DNF命令的帮助(例如,clean),可以通过下面的命令来得到:
+
+    # dnf help clean
+
+![获得某一命令帮助](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif)
+
+### 18. 列出所有DNF的命令和选项 ###
+
+要显示所有dnf的命令和选项,只需要:
+
+    # dnf help
+
+![获得命令选项帮助](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif)
+
+### 19. 查看DNF的历史记录 ###
+
+您可以调用'dnf history'来查看已经执行过的dnf命令的列表。这样您便可以知道什么被安装/移除及其时间戳。
+
+    # dnf history
+
+![查看历史记录](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif)
+
+### 20. 显示所有软件包组 ###
+
+'dnf grouplist'命令可以显示所有可用的或已安装的软件包,如果没有什么输出,则它会列出所有已知的软件包组。
+
+    # dnf grouplist
+
+![列出所有软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif)
+
+### 21. 使用DNF安装一个软件包组 ###
+
+要安装一组由许多软件打包在一起的软件包组(例如,Educational Softaware),只需要执行:
+
+    # dnf groupinstall 'Educational Software'
+
+![安装一个软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif)
+
+### 22. 更新一个软件包组 ###
+
+可以通过下面的命令来更新一个软件包组(例如,Educational Software):
+
+    # dnf groupupdate 'Educational Software'
+
+![更新软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif)
+
+### 23. 移除一个软件包组 ###
+
+可以使用下面的命令来移除一个软件包组(例如,Educational Software):
+
+    # dnf groupremove 'Educational Software'
+
+![移除软件包组](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif)
+
+### 24. 从某个特定的仓库安装一个软件包 ###
+
+DNF可以从任何特定的仓库(比如 epel)安装一个软件包(例如,phpmyadmin):
+
+    # dnf --enablerepo=epel install phpmyadmin
+
+![从特定的仓库安装软件](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif)
+
+### 25. 将已安装的软件包同步到稳定发行版 ###
+
+'dnf distro-sync'将同步所有已安装的软件包到所有开启的仓库中最近的稳定版本。如果没有选择软件包,则会同步所有已安装的软件包。
+
+    # dnf distro-sync
+
+![将包同步至稳定版](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif)
+
+### 26. 重新安装一个软件包 ###
+
+'dnf reinstall nano'命令将重新安装一个已经安装的软件包(例如,nano):
+
+    # dnf reinstall nano
+
+![重新安装软件包](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif)
+
+### 27. 降级一个软件包 ###
+
+选项'downgrade'将会使一个软件包(例如,acpid)回退到低版本。
+
+    # dnf downgrade acpid
+
+示例输出
+
+    Using metadata from Wed May 20 12:44:59 2015
+    No match for available package: acpid-2.0.19-5.el7.x86_64
+    Error: Nothing to do.
+
+**我观察到**:dnf不会按预想的那样降级一个软件包。这已做为一个bug被提交。
+
+### 结论 ###
+
+DNF是YUM管理器的优秀替代品。它试着自动做许多甚至不推荐有经验的Linux系统管理员做的工作。例如:
+
+- `--skip-broken`不被DNF识别,并且DNF中没有其替代命令。
+- 尽管您可能会运行dnf provides,但再也没有'resolvedep'命令了。
+- 没有'deplist'命令用来发现软件包依赖。
+- 您排除一个仓库意味着在所有操作上排除该仓库,而在yum中,排除一个仓库只在安装和升级等时刻排除他们。
+
+许多Linux用户对于Linux生态系统的走向不甚满意。首先[Systemd替换了init系统][3]v,现在DNF将于不久后替换YUM,首先是Fedora 22,接下来是RHEL和CentOS。
+
+您怎么看呢?是不是发行版和整个Linux生态系统并不注重用户并且在朝着与用户愿望相悖的方向前进呢?IT行业里有这样一句话 - “如果没有坏,为什么要修呢?”,System V和YUM都没有坏。
+
+上面便是这篇文章的全部了。请在下方留言以让我了解您的宝贵想法。点赞和分享以帮助我们传播。谢谢!
+
+--------------------------------------------------------------------------------
+
+via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/
+
+作者:[Avishek Kumar][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://www.tecmint.com/author/avishek/
+[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/
+[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/
+[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/
diff --git a/published/201506/20150528 Things To Do After Installing Fedora 22.md b/published/201506/20150528 Things To Do After Installing Fedora 22.md
new file mode 100644
index 0000000000..1a4ff0ff8a
--- /dev/null
+++ b/published/201506/20150528 Things To Do After Installing Fedora 22.md	
@@ -0,0 +1,237 @@
+安装 Fedora 22 后要做的事情
+================================================================================
+
+Red Hat操作系统的社区开发版的最新成员Fedora 22,已经于2015年5月26日发布了。对这个经典的Fedora发行版的发布充斥着各种猜测和预期,而最终Fedora 22推出了许多重大变化。
+
+就初始化进程而言,Systemd还是个新生儿,但它已经准备好替换古老的sysvinit这个一直是Linux生态系统一部分的模块。另外一个用户会碰到的重大改变存在于基本仓库的python版本中,这里提供了两种不同口味的python版本,2.x和3.x分支,各个都有其不同的偏好和优点。所以,那些偏好2.x口味的用户可能想要安装他们喜爱的python版本。自从Fedora 18开始 dandified YUM安装器(即 DNF)就准备替换过时陈旧的YUM安装器了,Fedora最后决定,现在就用DNF来替换YUM。
+
+### 1) 配置RPMFusion仓库 ###
+
+正如我已经提到过的,Fedora的意识形态很是严谨,它不会自带任何非自由组件。官方仓库不会提供一些包含有非自由组件的基本软件,比如像多媒体编码。因此,安装一些第三方仓库很有必要,这些仓库会为我们提供一些基本的软件。幸运的是,RPMFusion仓库前来拯救我们了。
+
+    $ sudo dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm
+
+### 2) 安装VLC媒体播放器 ###
+
+Fedora 22默认自带了媒体播放器,即 gnome视频播放器(以前叫做totem)。如果你觉得还好,那么我们可以跳过这一步继续往前走。但是,如果你像我一样,偏好使用最广泛的VLC,那么就去从RPMFusion仓库安装吧。安装方法如下:
+
+    sudo dnf install vlc -y
+
+### 3) 安装多媒体编码 ###
+
+刚刚我们说过,一些多媒体编码和插件不会随Fedora一起发送。现在,有谁想仅仅是因为专有编码而错过他们最爱的节目和电影?试试这个吧:
+
+    $ sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1
+
+### 4) 更新系统 ###
+
+Fedora是一个前锐的发行版,因此它会不断发布更新用以修复系统中出现的错误和漏洞。因而,保持系统更新到最新,是个不错的做法。
+
+    $ sudo dnf update -y
+
+### 5) 卸载你不需要的软件 ###
+
+Fedora预装了一些大多数用户都有用的软件包,但是对于更高级的用户,你可能知道到你并不需要它。要移除你不需要的包相当容易,只需使用以下命令——我选择卸载rhythmbox,因为我知道我不会用到它:
+
+    $ sudo dnf remove rhythmbox
+
+### 6) 安装Adobe Flash ###
+
+我们都希望Adobe Flash不要再存在了,因为它并不被认为是最安全的,或者存在资源问题,但是暂时先让它待着吧。Fedora 22安装Adobe Flash的唯一途径是从Adobe安装官方RPM,就像下面这样。
+
+你可以从[这里][1]下载RPM。下载完后,你可以直接右击并像下面这样打开:
+
+![Install Adobe Flash](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.50.42-PM.png)
+
+右击并选择“用软件安装打开”
+
+然后,只需在弹出窗口中点击安装:
+
+![Install Adobe](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.51.07-PM.png)
+
+*点击“安装”来完成安装Adobe定制RPM的过程*
+
+该过程完成后,“安装”按钮会变成“移除”,而此时安装也完成了。如果在此过程中你的浏览器开着,会提示你先把它关掉或在安装完成后重启以使修改生效。
+
+### 7) 用Gnome Boxes加速虚拟机 ###
+
+你刚刚安装了Fedora,你也很是喜欢,但是出于某些私人原因,你也许仍然需要Windows,或者你只是想玩玩另外一个Linux发行版。不管哪种情况,你都可以使用Gnome Boxes来简单地创建一个虚拟机或使用一个live发行版,Fedora 22提供了该软件。遵循以下步骤,使用你所选的ISO来开始吧!谁知道呢,也许你可以检验一下某个[Fedora Spin][2]。
+
+首先,打开Gnome Boxes,然后在顶部左边选择“新建”:
+
+![Add a new virtual machine (box)](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.24.46-PM.png)
+
+点击“新建”来开始添加一个新虚拟机的进程吧。
+
+接下来,点击打开文件并选择一个ISO:
+
+![Choose ISO](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.28.44-PM.png)
+
+*在点击了“选择文件或ISO”后,选择你的ISO。这里,我已经安装了一个Debian ISO。*
+
+最后,自定义VM设置或使用默认配置,然后点击“创建”。VM默认会启动,可用的VM会在Gnome Boxes以小缩略图的方式显示。
+
+![Create VM](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.31.11-PM.png)
+
+*自定义你自己的设置,或者也可以保持默认。完成后,点击“创建”,VM就一切就绪了。*
+
+### 8) 添加社交媒体和其它在线帐号 ###
+
+Gnome自带有不错的内建功能用于容纳帐号相关的东西,像Facebook,Google以及其它在线帐号。你可以通过Gnome设置应用访问在线帐号设置,可以在桌面上右键点击或在应用程序中找到该应用。然后,只需点击在线帐号,并添加你所选择的帐号。如果你要添加一个帐号,比如像Google,你可以用它来作为默认帐号,用来完成诸如发送邮件、日历提醒、相片和文档交互,以及诸如此类的更多事情。
+
+### 9) 安装KDE或另一个桌面环境 ###
+
+我们中的某些人不喜欢Gnome,那也没问题。在终端中运行以下命令来安装KDE所需的一切来替换它。这些指令也可以用以安装xfce、lxde或其它桌面环境。
+
+    $ sudo dnf install @kde-desktop
+
+安装完成后,登出。当你点击你的用户名时,注意那个表示设置的小齿轮。点击它,然后选择“Plasma”。当你再次登录时,一个全新的KDE桌面就会欢迎你。
+
+![Plasma on Fedora 22](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-11.32.27-PM.png)
+
+*刚刚安装到Fedora 22上的Plasma环境*
+
+####在 Fedora 22中安装 Cinnamon桌面:####
+
+打开SSH终端,输入或粘帖如下命令并回车:
+
+	sudo dnf install @cinnamon-desktop
+
+####在 Fedora 22中安装 MATE桌面:####
+
+打开SSH终端,输入或粘帖如下命令并回车: 
+
+	sudo dnf install @mate-desktop
+
+####在 Fedora 22中安装 XFCE桌面:####
+
+打开SSH终端,输入或粘帖如下命令并回车:
+
+	sudo dnf install @xfce-desktop
+
+####在 Fedora 22中安装 LXDE桌面:####
+
+打开SSH终端,输入或粘帖如下命令并回车:
+
+	sudo dnf install @lxde-desktop
+
+### 10) 定制桌面并优化设置 ###
+
+默认的 Gnome 带有一张黑色背景和一个新的锁屏,幸运的是,很容易通过下面的方式来改变:
+
+![change desktop](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-28-at-7.17.29-AM-1024x767.png)
+
+*右键点击桌面,然后点修改背景*
+
+![Desktop or lock screen](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-28-at-7.17.52-AM-1024x769.png)
+
+*你会看到这个窗口,这里你选择新的桌面背景或锁屏图片*
+
+进一步,如果你点击“设置”,你会看到一个菜单展示你所以可以修改的设置。举个例子,在笔记本电脑上,你可以修改电源设置来控制合上笔记本电脑时的动作。
+
+
+### 11) 安装 Fedy 4.0###
+
+Fedy 可以帮助用户和系统管理员来监控系统的运作,并让他们可以控制系统如其所预期的工作。这里有一行脚本可以安装最新版本的 Fedy。打开终端,输入或粘帖如下行并按下回车。
+
+	su -c "curl https://satya164.github.io/fedy/fedy-installer -o fedy-installer && chmod +x fedy-installer && ./fedy-installer"
+
+### 12) 安装 Java###
+
+使用如下命令可以很容易的安装 Java。
+
+	sudo dnf install java -y
+
+它会根据你的系统架构自动安装32位或64位的 Java 发行版。
+
+### 13) 在 Fedora 22 上安装浏览器 ###
+
+Fedora 22的默认浏览器是 Firefox,不过其它的浏览器也各有优缺点。最终用户选择浏览器会有种种原因。这里我们提供一些在 Fedora 22上安装其它浏览器的方法。
+
+#### 安装 Google Chrome####
+
+使用你惯用的编辑器,在 yum 库目录中打开或创建  google-chrome.repo 文件。
+
+	sudo gedit /etc/yum.repos.d/google-chrome.repo
+
+加入以下内容并保存。
+
+	[google-chrome]
+	name=google-chrome
+	baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
+	enabled=1
+	gpgcheck=1
+	gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
+
+现在 yum 就配置好可以找到稳定版本的 Chrome 了,使用如下命令安装它。
+
+	sudo dnf install google-chrome-stable
+
+#### 安装 Tor 浏览器 ####
+
+在 Fedora 22 中安装 Tor 有一点棘手,在 /etc/yum.repos.d 目录中打开或创建 torproject.repo 文件。
+
+	sudo gedit /etc/yum.repos.d/torproject.repo
+
+插入以下内容。 
+
+	[tor]
+	name=Tor repo
+	enabled=1
+	baseurl=https://deb.torproject.org/torproject.org/rpm/fc/22/$basearch/
+	gpgcheck=1
+	gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
+
+	[tor-source]
+	name=Tor source repo
+	enabled=1
+	autorefresh=0
+	baseurl=https://deb.torproject.org/torproject.org/rpm/fc/22/SRPMS
+	gpgcheck=1
+	gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc
+
+也许会问到 GPG 键的指纹,它应该如下。
+
+	3B9E EEB9 7B1E 827B CF0A 0D96 8AF5 653C 5AC0 01F1
+
+不幸的是,在 EPEL 和 Fedora 仓库中有一个相同名字的软件包,你需要明确排除这个来避免安装/删除/修改它。所以,在/etc/yum.repos.d/epel.repo 中加入 `Exclude=tor`  一行。
+
+最后,使用如下命令来安装 Tor。
+
+	sudo dnf install tor
+
+安装完成,启动服务。
+
+	sudo service tor start
+
+#### 安装 Vivaldi####
+
+根据你的系统架构下载32位或64位的  Vivaldi 浏览器。
+
+	sudo wget https://vivaldi.com/download/Vivaldi_TP3.1.0.162.9-1.i386.rpm
+	sudo wget https://vivaldi.com/download/Vivaldi_TP3.1.0.162.9-1.x86_64.rpm
+
+使用下列命令安装下载的 RPM。
+
+	sudo rpm -ivh Vivaldi_TP3.1.0.162.9-1.i386.rpm
+	sudo rpm -ivh Vivaldi_TP3.1.0.162.9-1.x86_64.rpm
+
+
+### 尾声 ###
+
+就是这样了,一切就绪。使用新系统吧,试试新东西。如果你找不到与你喜好的东西,linux赋予你自由修改它的权利。Fedora自带有最新的Gnome Shell作为其桌面环境,如果你觉得太臃肿而不喜欢,那么试试KDE或一些轻量级的DE,像Cinnamon、xfce之类。愿你的Fedora之旅十分开心并且没有困扰!!
+
+--------------------------------------------------------------------------------
+
+via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/
+
+作者:[Jonathan DeMasi][a]
+译者:[GOLinux](https://github.com/GOLinux)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://linoxide.com/author/jonathande/
+[1]:https://get.adobe.com/flashplayer/
+[2]:http://spins.fedoraproject.org/
+[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html
diff --git a/published/201506/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md b/published/201506/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md
new file mode 100644
index 0000000000..e8fd8c6dbd
--- /dev/null
+++ b/published/201506/20150603 Arc Is a Gorgeous GTK Theme for Linux Desktops.md	
@@ -0,0 +1,57 @@
+一款很棒的GTK桌面主题:Arc
+================================================================================
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/arc-gtk-theme.jpg)
+
+距离本站上次推荐的GTK主题已经过了很久了。但是看到上图中的Arc主题后,就值得打破冷场了。我们不能不推荐它!
+
+### Arc GTK主题 ###
+
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/see-through-theme.png)
+
+*透明,并不符合每个人的口味*
+
+Arc是一个扁平化主题并有微妙的配色方案,窗口的选中区域是透明的,如GTK的顶栏和Nautilus的侧边栏。
+
+它的效果不像我们之前介绍的主题那样将程序渲染的像那么混乱。有点像 OSX Yosemite,效果用的不多但是很好。
+
+与之伴随的图标集(称为Vertex)同样工作的很好。
+
+**是的它支持Unity**
+
+Arc主题支持基于GTK3和GTK2桌面环境,包含Gnome Shell(当然了)和标准的Ubuntu Unity。
+
+它可以很好地游刃于轻量级的Budgie和elementary的Pantheon桌面之间,并且与Cinnamon配合也不错。
+
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/Screen-Shot-2015-06-02-at-18.07.15.png)
+
+*Arc中的开关、滑块和小挂件*
+
+它并不容易下载与安装- *understatement klaxon* - 因为它还在密集开发中。
+
+安装包需要GTK 3.14及以上,这意味着Ubuntu 14.04 LTS和14.10的用户无法使用了。
+
+那些使用Ubuntu 15.04的用户可以使用这个主题。你可以添加ppa或者双击.deb包来安装。
+
+如果你喜欢它,你需要卷起你的袖子并查看github上的编译指导。
+
+- [Github中Arc安装指导][1]
+
+更新6/7:现在可以使用软件库来安装它(由 openSUSE 用户 Horst1380 创建,也可用于 Ubuntu 用户),也可以下载预打包的 .deb 文件。
+
+-  [Horst31890 的 Arc 主题库][2]
+-  [下载 Arc 主题 .deb][3]
+
+--------------------------------------------------------------------------------
+
+via: http://www.omgubuntu.co.uk/2015/06/arc-gtk-theme
+
+作者:[Joey-Elijah Sneddon][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://plus.google.com/117485690627814051450/?rel=author
+[1]:https://github.com/horst3180/Arc-theme
+[2]:http://software.opensuse.org/download.html?project=home%3AHorst3180&package=arc-theme
+[3]:http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_15.04/all/arc-theme_1433786431.697b2c3_all.deb
\ No newline at end of file
diff --git a/published/201506/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md b/published/201506/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md
new file mode 100644
index 0000000000..edcc62b86f
--- /dev/null
+++ b/published/201506/20150603 Here's How to Install the Beautiful Arc GTK+ Flat Theme on Linux.md	
@@ -0,0 +1,43 @@
+如何在 Linux 中安装漂亮的 GTK+ 扁平化主题 Arc
+================================================================================
+
+**今天我们将向你介绍最新发布的GTK+主题,它拥有透明和扁平元素,并且与多个桌面环境和Linux发行版兼容。[这个主题叫Arc][1]。**
+
+开始讲细节之前,我建议你快速浏览一下下面的图,这样你有会对这个主题就会有一个基本的概念了。同样你应该知道它目前可以工作在GTK+ 2.x、GTK+ 3.x、GNOME-Shell、 Budgie、 Unity和Pantheon用户界面,它们都使用了GNOME 体系。
+
+![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-2.jpg)
+
+![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-3.jpg)
+
+![](http://i1-news.softpedia-static.com/images/news2/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143-4.jpg)
+
+同样、Arc主题的开发者告诉我们它已经成功地在Ubuntu 15.04(Vivid Vervet)、 Arch Linux、 elementary OS 0.3 Freya、 Fedora 21、 Fedora 22、 Debian GNU/Linux 8.0 (Jessie)、 Debian Testing、 Debian Unstable、 openSUSE 13.2、 openSUSE Tumbleweed和Gentoo测试过了。
+
+### 要求和安装指导 ###
+
+要构建Arc主题,你需要先安装一些包,比如autoconf、 automake、 pkg-config (对于Fedora则是pkgconfig)、基于Debian/Ubuntu-based发行版的libgtk-3-dev或者基于RPM的gtk3-devel、 git、 gtk2-engines-pixbuf和gtk-engine-murrine (对于Fedora则是gtk-murrine-engine)。
+
+Arc主题还没有二进制包,因此你需要从git仓库中取下最新的源码并编译。这样,打开终端并运行下面的命令,一行行地输入,并在每行的末尾按下回车键并等待上一步完成来继续下一步。
+
+    git clone https://github.com/horst3180/arc-theme --depth 1 && cd arc-theme
+    git fetch --tags
+    git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
+    ./autogen.sh --prefix=/usr
+    sudo make install
+
+就是这样!此时你已经在你的GNU/Linux发行版中安装了Arc主题,如果你使用GNOME可以使用GONME Tweak工具,如果你使用Ubuntu的Unity可以使用Unity Tweak工具来激活主题。玩得开心但不要忘了在下面的评论栏里留下你的截图。
+
+
+
+--------------------------------------------------------------------------------
+
+via: http://news.softpedia.com/news/Here-s-How-to-Install-the-Beautiful-Arc-GTK-plus-Flat-Theme-on-Linux-483143.shtml
+
+作者:[Marius Nestor][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[caroline](https://github.com/carolinewuyan)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://news.softpedia.com/editors/browse/marius-nestor
+[1]:https://github.com/horst3180/Arc-theme
diff --git a/published/201506/20150604 12 Globally Recognized Linux Certifications.md b/published/201506/20150604 12 Globally Recognized Linux Certifications.md
new file mode 100644
index 0000000000..3b1ed918ba
--- /dev/null
+++ b/published/201506/20150604 12 Globally Recognized Linux Certifications.md	
@@ -0,0 +1,172 @@
+12 个全球认可的 Linux 认证
+================================================================================
+大家好,今天我们将会认识一些非常有价值的全球认可的Linux认证。Linux认证是不同的Linux专业机构在全球范围内进行的认证程序。Linux认证可以让Linux专业人才可以在服务器领域或者相关公司等等这些地方更容易获得Linux相关的工作。Linux认证评估一个人在Linux的各个领域里的专业程度。有很多不错的Linux专业机构提供不同的Linux认证。但是,在公司谋取一份工作时全球仅有少数被非常认可的Linux认证含金量很高,这些工作包括管理服务器,虚拟化,安装系统与软件,配置程序,应用支持和其他Linux操作系统相关的东西。随着全球使用Linux操作系统的服务器的增长,拉动了对于Linux专业人才的需求。为了更好的证明Linux专业技术水平,在全球看来,更好的、著名的认证总是有着更高的优先级。
+
+这里是一些全球认可的Linux认证,我们接下来将会一一谈到。
+
+### 1. CompTIA Linxu+ ###
+
+CompTIA Linux+ 是LPI(Linux Professional Institute,Linux专业委员会)主办的一个Linux认证,在全世界范围内提供培训。其提供的Linux相关知识,可以用于从事一大批Linux相关专业的工作,如Linux管理员、高级网络管理员、系统管理员、Linux数据库管理员和Web管理员。如果任何人想从事安装和维护Linux操作系统,该课程会帮助他达到认证要求,并且通过提供对Linux系统更宽阔的认识,能够为通过考试做好准备。LPI的CompTIA Linux+认证的主要目的就是,提供给证书持有者足够扎实的,关于安装软件、操作、管理和设备排障的知识。我们可以付出一定的费用、时间和努力,完成CompTIA Linux+,同时获得三个业内认可的证书:**LPI LPIC-1**和**SUSE Certified Linux Administrator (CLA)**证书。
+
+- **认证代码** : LX0-103,LX0-104(2015年3月30日启动)或者LX0-101,LX0-102
+- 题目数量:每次考试60道题
+- 题目类型:多选
+- 考试时长:90分钟
+- 要求:A+,Network+,并且有至少12个月的Linux管理经验
+- 分数线:500 (对于200-800的范围来说)
+- 语言:英语,将来会有德语,葡萄牙语,繁体中文,西班牙。
+- 有效期:认证后三年有效
+
+**注意**:不同系列的考试不能合并。如果你考的是LX0-101,那么你必须考LX0-102完成认证。同样的,LX0-103和LX0-104又是一个系列。LX0-103和LX0-104系列是LX0-101和LX0-102系列的升级版。
+
+### 2. LPIC ###
+
+LPIC,全称Linux专业委员会认证( Linux Professional Institute Certification),是Linux专业委员会的一个Linux认证程序。这是一个多级别的认证程序,要求在每个级别通过一系列(通常是两个)的认证考试。该认证有三个级别,包括初级水平认证 **LPIC-1** ,高级水平认证 **LPIC-2**和最高水平认证 **LPIC-3**。前两个认证侧重于 **Linux系统管理**,而最后一个认证侧重一些专业技能,包括虚拟化和安全。为了得到 **LPIC-3** 认证,一个持有有效的 **LPIC-1** 与**LPIC-2** 认证的考生必须通过300复杂环境测试、303安全测试、304虚拟化测试和高可用性测试中的一个。**LPIC-1**认证按照证书持有者可以通过运行Linux,使用命令行界面和基本的网络知识安装,维护,配置等任务而设计,LPIC-2测试考生是否作为管理中小型混合网络的候选人。LPIC-3认证是为企业级Linux专业技能设计所设计,代表了最高的专业水平和不针对特定 Linux 发行版的行业认证。
+
+- **认证代码**:LPIC-1(101和102),LPIC-2(201和202)和LPIC-3(300,303或者304)
+- 题目类型:60个多项选择
+- 考试时长:90分钟
+- 要求:无,建议有 Linux Essentials 认证
+- 分数线:500(在200-800的范围内)
+- 语言:LPIC-1:英语,德语,意大利语,葡萄牙语,西班牙语(现代),汉语(简体),汉语(繁体),日语
+- LPIC-2:英语,德语,葡萄牙语,日语
+- LPIC-3:英语,日语
+- 有效期:退休之后五年内仍然有效
+
+### 3.Oracle Linux OCA ###
+
+Oracle联合认证(OCA)为个人而定制,适用于那些想证明其部署和管理Oracle Linux操作系统的知识牢固的人。该认证专业知识仅仅针对Oracle Linux发行版,这个系统完全是为Oracle产品特别剪裁的,可以运行Oracle设计的系统,包括Oracle Exadata数据库服务器,Oracle Exalytics In-Memory 服务器,Oracle Exalogic 均衡云,和Oracle数据库应用等。Oracle Linux的“坚不可摧企业内核”为企业应用带来了高性能、高扩展性和稳定性。OCA认证覆盖了如管理本地磁盘设备、管理文件系统、安装和移除Solaris包与补丁,优化系统启动过程和系统进程。这是拿到OCP证书系列的第一步。OCA认证以其前身为Sun Certified Solaris Associate(SCSAS)而为人所知。
+
+- **认证代码**:OCA
+- 题目类型:75道多项选择
+- 考试时长:120分钟
+- 要求:无
+- 分数线:64%
+- 有效期:永远有效
+
+### 4. Oracle Linux OCP ###
+
+Oracle专业认证(OCP)是Oracle公司为Oracle Linux提供的一个认证,覆盖更多的进阶知识和技能,对于一个Oracle Linux管理员来说。它囊括的知识有配置网络接口、管理交换分区配置、崩溃转储、管理软件、数据库和重要文件。OCP认证是技术性专业知识和专业技能的基准测试,这些知识与技能需要在公司里广泛用于开发、部署和管理应用、中间件和数据库。Oracle Linux OCP的工作机会在增长,这得益于工作市场和经济发展。根据考试纲领,证书持有者有能力胜任安全管理、为Oracle 数据库准备Oracle Linux系统、排除故障和进行恢复操作、安装软件包、安装和配置内核模块、维护交换空间、完成用户和组管理、创建文件系统、配置逻辑卷管理(LVM)、文件分享服务等等。
+
+- **认证代码**:OCP
+- 题目类型:60至80道多项选择题
+- 考试时长:120分钟
+- 要求:Oracle Linux OCA
+- 分数线:64%
+- 有效期:永远有效
+
+### 5. RHCSA ###
+
+RHCSA是红帽公司作为红帽认证系统工程师推出的一个认证程序。RHCSA们是指一些拥有在著名的红帽Linux环境下完成核心系统管理技能和能力的人。这是一个入门级的认证程序,关注在系统管理上的实际胜任能力,包括安装、配置一个红帽Linux系统,接入一个可用的网络提供网络服务。一个红帽认证的系统管理员可以理解和使用基本的工具,用以处理文件、目录、命令行环境和文档;操作运行中的系统,包括以不同的启动级别启动、识别进程、开启和停止虚拟机和控制服务;使用分区和逻辑卷配置本地存储;创建和配置文件系统和文件系统属性,包括权限、加密、访问控制列表和网络文件系统;部署配置和维护系统,包括软件安装、更新和核心服务;管理用户和组,包括使用一个中心的目录用于验证;安全性的工作,包括基本的基本防火墙和SELinux配置。要获得RHCE和其他认证,首先得认证过RHCSA。
+
+- **认证代码**:RHCSA
+- 课程代码:RH124,RH134和RH199
+- 考试代码:EX200
+- 考试时长:21-22小时,取决于选择的课程
+- 要求:无。有一些Linux基础知识更好
+- 分数线:300总分,210过(70%)
+- 有效期:3年
+
+### 6. RHCE ###
+
+RHCE,也叫做红帽认证工程师,是一个中到高级水平的认证程序,为一些想要学习更多技能和知识,成为一个负责红帽企业Linux的高级系统管理员的RHCSA开设的,RHCE应该有能力、知识和技能来配置静态路由、包过滤、NAT、设定内核运行参数、配置一个ISCSI初始化程序,生成并发送系统用量报告、使用shell脚本自动完成系统维护任务、配置系统日志,包括远程日志、提供网络服务如HTTP/HTTPS、FTP、NFS、SMB、SMTP、SSH和NTP等等。推荐希望获得更多高级水平的认证的RHCSA们、已经完成系统管理员I,II和III、或者已经完成RHCE 快速跟进培训的人们参加认证。
+
+- **认证代码**:RHCE
+- 课程代码:RH124,RH134,RH254和RH199
+- 考试代码:EX200和EX300
+- 考试时长:21-22个小时,取决于所选课程
+- 要求:一个RHCSA证书
+- 分数线:300总分,210过(70%)
+- 有效期:3年
+
+### 7. RHCA ###
+
+RHCA即红帽认证架构师,是红帽公司的一个认证程序。它的关注点在系统管理的实际能力,包括安装和配置一个红帽Linux系统,并加入到一个可用网络中运行网络服务。RHCA是所有红帽认证中最高水平的认证。考生需要选择他们希望针对的领域,或者选择合格的红帽认证的任意组合来创建一个他们自己的领域。这里有三个主要的领域:数据中心、云和应用平台。精通数据中心领域的RHCA能够运行、管理数据中心;而熟悉云的可以创建、配置和管理私有云和混合云、云应用平台以及使用红帽企业Linux平台的灵活存储方案;精通应用平台集合的RHCA拥有技能如安装、配置和管理红帽JBoss企业应用平台和应用,云应用平台和混合云环境,借助红帽的OpenShift企业版,使用红帽JBoss数据虚拟化技术从多个资源里组合数据。
+
+- **认证代码**:RHCA
+- 课程代码:CL210,CL220.CL280,RH236,RH318,RH413,RH436,RH442,JB248和JB450
+- 考试代码:EX333,EX401,EX423或者EX318,EX436和EX442
+- 考试时长:21-22个小时,取决于所选课程
+- 要求:未过期的RHCE证书
+- 分数线:300总分,210过(70%)
+- 有效期:3年
+
+### 8. SUSE CLA ###
+
+SUSE认证Linux管理员(SUSE CLA)是SUSE推出的一个初级认证,关注点在SUSE Linux企业服务器环境下的日常任务管理。为了获得SUSE CLA认证,不用必须完成课程任务,只需要通过考试就能获得认证。SUSE CLA们能够、也有技术去使用Linux桌面、定位并利用帮助资源、管理Linux文件系统、用Linux Shell和命令行工作、安装SLE 11 SP22、管理系统安装、硬件、备份和恢复、用YaST管理Linux、Linux进程和服务、存储、配置网络、远程接入、SLE 11 SP2监控,任务自动化和管理用户访问和安全工作。我们可以同时获得SUSE CLA,LPIC-1和CompTIA Linux认证,因为SUSE,Linux Professional Institute和CompATI合作提供了这个同时获得三个Linux认证的机会。
+
+- **认证代码**:SUSE CLA
+- 课程代码:3115,3116
+- 考试代码:050-720,050-710
+- 问题类型:多项选择
+- 考试时长:90分钟
+- 要求:无
+- 分数线:512
+
+### 9. SUSE CLP ###
+
+SUSE认证Linux专业人员(CLP)是一个认证程序,为那些希望获得关于SUSE Linux企业服务器更多高级且专业的知识的人而服务。SUSE CLP是通过SUSE CLA认证后的下一步。应该通过CLA的考试并拥有证书,然后通过完成CLP的考试才能获得CLP的认证。通过SUSE CLP认证的人员有能力完成安装和配置SLES 11系统、维护文件系统、管理软件包、进程、打印、配置基础网络服务、samba、Web服务器、使用IPv6、创建和运行bash shell脚本。
+
+- **认证代码**:SUSE CLP
+- 课程代码:3115,3116和3117
+- 考试代码:050-721,050-697
+- 考试类型:手写
+- 考试时长:180分钟
+- 要求:SUSE CLA 认证
+
+### 10. SUSE CLE ###
+
+SUSE认证Linux工程师(CLE)是一个工程师级别的高级认证,为那些已经通过CLE考试的人准备。为了获得CLE认证,人们需要已经获得SUSE CLA和CLP的认证。获得CLE认证的人员拥有架设复杂SUSE Linux企业服务器环境的技能。CLE认证过的人可以配置基本的网络服务、管理打印、配置和使用Open LDAP、samba、IPv6、完成服务器健康检测和性能调优、创建和执行shell脚本、部署SUSE Linux企业板、通过Xen实现虚拟化等等。
+
+- **认证代码**:SUSE CLE
+- 课程代码:3107
+- 考试代码:050-723
+- 考试类型:手写
+- 考试时长:120分钟
+- 要求:SUSE CLP 10或者11证书
+
+### 11. LFCS ###
+
+Linux基金会认证系统管理员(LFCS)认证考生使用Linux和通过终端环境使用Linux的知识。LFCS是Linux基金会的一个认证程序,为使用Linux操作系统工作的系统管理员和工程师准备。Linux基金会联合业内专家、Linux内核社区,测试考生的核心领域、关键技能、知识和应用能力。通过LFCS认证的人员拥有一些技能、知识和能力,包括在命令行下编辑和操作文件、管理和处理文件系统与存储的错误、聚合分区作为LVM设备、配置交换分区、管理网络文件系统、管理用户帐号/权限和属组、创建并执行bash shell脚本、安装/升级/移除软件包等等。
+
+- **认证代码**:LFCS
+- 课程代码:LFCS201,LFCS220(可选)
+- 考试代码:LFCS 考试
+- 考试时长:2小时
+- 要求:无
+- 分数线:74%
+- 语言:英语
+- 有效期:两年
+
+### 12. LFCE ###
+
+Linux基金会认证工程师(LFCE),是Linux基金会为Linux工程师推出的认证。相比于LFCS,通过LFCE认证的人员在Linux方面拥有更大范围的技能。这是一个工程师级别的高级认证程序。LFCE认证的人具备一些网络管理方面的技能和能力,如配置网络服务、配置包过滤、监控网络性能、IP流量、配置文件系统和文件服务、网络文件系统、从仓库安装/升级软件包、管理网络安全、配置iptables、http服务、代理服务、邮件服务等等。由于其为高级工程级别的认证程序,所以普遍认为相比LFCS,学习和通过的难度更大些。
+
+- **认证代码**:LFCE
+- 课程代码:LFS230
+- 考试代码:LFCE 考试
+- 考试时长:2小时
+- 要求:认证过LFCS
+- 分数线:72%
+- 语言:英语
+- 有效期:2年
+
+### 我们发现的情况(这仅仅是我们的观点)###
+
+最近的调查表明,在不同的高端招聘代理中,称80%的Linux工作描述更倾向于红帽的认证。如果你是一个学生/新手,并且想学习Linux,那么我们建议选择越来越流行的Linux基金会认证,或者CompTIA Linux也可以是一个选择。如果你已经了解了oracle或suse,或者在他们的产品上工作,那oracle/suse的认证会更好些,如果你在公司里工作了,这些认证会对你的职业生涯成长有帮助:-)
+
+### 总结 ###
+
+在这个世界上,成千上万的大公司正在运行跑着Linux操作系统的服务器和主框架机,为了在这些服务器上管理、配置和工作,总是存在着对Linux技术/专业知识高度认证的需求。这些国际上承认的认证对某些人在Linux的职业生涯扮演很重要的角色。这些遍布全球的公司运行着Linux,需要Linux工程师、系统管理员和已经获得认证且在Linux相关领域干得不错的人员。全球认可的Linux认证,对于专业知识和职业生涯的辉煌都是重中之重,所以好好准备考试并获得认证,对于在Linux建立职业生涯是一个很好的选择。如果你有任何问题,想法,反馈,请写在下方的评论框里,让我们好知道哪些东西需要添加或者改进。谢谢!:-)
+
+--------------------------------------------------------------------------------
+
+via: http://linoxide.com/linux-how-to/12-globally-recognized-linux-certifications/
+
+作者:[Arun Pyasi][a]
+译者:[wi-cuckoo](https://github.com/wi-cuckoo)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://linoxide.com/author/arunp/
diff --git a/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md b/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md
new file mode 100644
index 0000000000..915e6aff8f
--- /dev/null
+++ b/published/201506/20150604 How To Install Unity 8 Desktop Preview In Ubuntu.md	
@@ -0,0 +1,77 @@
+在Ubuntu中安装Unity 8桌面预览版
+================================================================================
+![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Unity_8.jpeg)
+
+如果你一直关注新闻,那么就知道Ubuntu将会切换到带有[Unity 8][2]桌面的[Mir显示服务器][1]。然而,在尚未确定运行在 Mir 上的Unity 8是否会出现在[Ubuntu 15.10 Willy Werewolf][3]之前,有了一个Unity 8的预览版本可供你体验和测试。通过官方PPA,可以很容易地**安装Unity 8到Ubuntu 14.04,14.10和15.04中**。
+
+到目前为止,开发者已经可以通过[ISO][4](主要途径)获得该Unity 8预览来进行测试。不过Canonical也通过[LXC容器][5]发布了它。通过该方法,你可以使用Unity 8桌面会话,让它像其它桌面环境一样运行在Mir显示服务器上。就像你[在Ubuntu中安装Mate桌面][6],然后从LightDm登录屏幕选择桌面会话一样。
+
+想要试试Unity 8?让我们来看怎样安装它吧。
+
+**注意: 它是一个实验性预览,可能不是所有人都可以让它正确工作的。**
+
+### 安装Unity 8桌面到Ubuntu ###
+
+下面是安装并使用Unity 8的步骤:
+
+#### 步骤 1: 安装Unity 8到Ubuntu 12.04和14.04 ####
+
+如果你正运行着Ubuntu 12.04和14.04,那么你必须使用官方PPA来安装Unity 8。使用以下命令进行安装:
+
+    sudo apt-add-repository ppa:unity8-desktop-session-team/unity8-preview-lxc
+    sudo apt-get update
+    sudo apt-get upgrade
+    sudo apt-get install unity8-lxc
+
+#### 步骤 1: 安装Unity 8到Ubuntu 14.10和15.04 ####
+
+如果你正运行着Ubuntu 14.10或15.04,那么Unity 8 LXC已经在源中准备好。你只需要运行以下命令:
+
+    sudo apt-get update
+    sudo apt-get install unity8-lxc
+
+#### 步骤 2: 设置Unity 8桌面预览LXC ####
+
+安装Unity 8 LXC后,该对它进行设置,下面的命令就可达到目的:
+
+    sudo unity8-lxc-setup
+
+它将花费一些时间来设置,所以,耐心点。它会下载ISO,然后解压缩,接着完成最后一些必要的设置来让它工作。它也会安装一个LightDM的轻度修改版本。这一切都搞定后,需要重启。
+
+#### 步骤 3: 选择Unity 8 ####
+
+重启后,在登录屏幕,点击你的登录旁边的Ubuntu图标:
+
+![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/08/Change_Desktop_Environment_Ubuntu.jpeg)
+
+你应该可以在这看到Unity 8的选项,选择它:
+
+![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Select_Unity8.jpeg)
+
+### 卸载Unity 8 LXC ###
+
+如果你发现Unity 8毛病太多,或者你不喜欢它,那么你可以以相同的方式切换回默认Unity版本。此外,你也可以通过下面的命令移除Unity 8:
+
+    sudo apt-get remove unity8-lxc
+
+该命令会将Unity 8选项从LightDM屏幕移除,但是配置仍然保留着。
+
+以上就是你在Ubuntu中安装带有Mir的Unity 8的全部过程,试玩后请分享你关于Unity 8的想法哦!
+
+--------------------------------------------------------------------------------
+
+via: http://itsfoss.com/install-unity-8-desktop-ubuntu/
+
+作者:[Abhishek][a]
+译者:[GOLinux](https://github.com/GOLinux)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://itsfoss.com/author/abhishek/
+[1]:http://en.wikipedia.org/wiki/Mir_%28software%29
+[2]:https://wiki.ubuntu.com/Unity8Desktop
+[3]:http://itsfoss.com/ubuntu-15-10-codename/
+[4]:https://wiki.ubuntu.com/Unity8DesktopIso
+[5]:https://wiki.ubuntu.com/Unity8inLXC
+[6]:http://itsfoss.com/install-mate-desktop-ubuntu-14-04/
diff --git a/published/201506/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md b/published/201506/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md
new file mode 100644
index 0000000000..9bb73fc944
--- /dev/null
+++ b/published/201506/20150604 Read about The Document Foundation achievements in 2014--download the Annual Report.md	
@@ -0,0 +1,32 @@
+下载年度报告,了解The Document Foundation2014年的成果
+================================================================================
+![](https://documentfoundation.files.wordpress.com/2015/06/tdf-report.jpg)
+
+The Document Foundation (TDF)郑重地发布了2014年度报告,你可以点击这里下载: [http://tdf.io/report2014][1] (3.2 MB PDF)。高清质量的可以点击这里下载 [http://tdf.io/report2014hq][2] (15.9 MB PDF)。
+
+TDF年度报告中,以回顾2014年开始了这篇报告,其中包括了TDF和LibreOffice的精彩集锦,并且总结了财务情况和预算。
+
+该报告涉及到项目和活动的会议包括:2014年在伯尔尼的LibreOffice大会,在布鲁塞尔、大加那利岛、巴黎、波士顿和土鲁斯的认证项目、网站与质量保证、Hackfests项目等,本土语言项目,基础设施,文档项目,市场设计与营销。
+
+该报告涉及到的软件开发活动和代码包括:工程指导委员会的活动,LibreOffice的开发,文档解放项目,LibreOffice的安卓移植。
+
+报告的最后一部分则把焦点对准了那些做出了极大贡献的人们,他们是TDF的工作人员,董事会成员,委员会成员,委托组织成员,TDF的核心成员和咨询委员会成员。
+
+TDF 2014年度报告的编辑工作由Sophie Gautier, Alexander Werner, Christian Lohmaier, Florian Effenberger, Italo Vignoli 和 Robinson Tryon完成,由Barak Paz设计样式,Libreoffice社区协助完成。
+
+
+为了最大程度的传播该文档,采用了CC3 认证发布,除非特殊标注,TDF成员和自由软件基金会拥有其所有权。
+
+--------------------------------------------------------------------------------
+
+via: http://blog.documentfoundation.org/2015/06/03/read-about-the-document-foundation-achievements-in-2014-download-the-annual-report/
+
+作者:italovignoli
+译者:[sevenot](https://github.com/sevenot)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[1]:https://wiki.documentfoundation.org/File:TDF2014AnnualReport.pdf
+[2]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportHQ.pdf
+[3]:https://wiki.documentfoundation.org/File:TDF2014AnnualReportDE.pdf
\ No newline at end of file
diff --git a/published/201506/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md b/published/201506/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md
new file mode 100644
index 0000000000..952b673c41
--- /dev/null
+++ b/published/201506/20150604 Ubuntu's Juju Now Supports systemd and Google Cloud Platform.md	
@@ -0,0 +1,29 @@
+Ubuntu下的Juju现在支持systemd和Google Cloud Platform了
+================================================================================
+> Juju已经更新到1.23.3了
+
+**Cononical旗下的Ubuntu认证公共云总监Udi Nachmany宣布了juju新版本的发布,一个开源的、解决方案驱动的Ubuntu下的协同工具。**
+
+根据[声明][1]和官方[发布公告][2],Juju 1.23.3是一个主要版本,它打包了那些你想要在云上扩展和管理的包,而不需太多操作。
+
+Juju 1.23.3显著的功能是包含了对GCE的支持,支持systemd初始化系统,支持Ubuntu 15.04(Vivid Vervet),新的好玩的功能和对受限网络的代理支持。
+
+另外,juju的发布带来了一个新的样式恢复、新的消息、新的块和实验性地支持Service Leader Elections,还有Ubuntu MAS和AWS上的LXC容器和KVM实例。
+
+Udi Nachmany说:“在一个相关告示中,如果你正在使用Google云平台,你可能已经注意到了Google最近发布了云启动器。如果你观察的足够仔细,你也会注意到你可以使用这个非常友好的UI来启动你的Ubuntu虚拟机。”
+
+![](http://i1-news.softpedia-static.com/images/news2/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279-2.jpg)
+
+--------------------------------------------------------------------------------
+
+via: http://linux.softpedia.com/blog/Ubuntu-s-Juju-Now-Supports-systemd-and-Google-Cloud-Platform-483279.shtml
+
+作者:[Marius Nestor][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://news.softpedia.com/editors/browse/marius-nestor
+[1]:http://insights.ubuntu.com/2015/06/03/juju-support-for-google-cloud-platform/
+[2]:https://jujucharms.com/docs/devel/reference-release-notes
diff --git a/published/201506/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md b/published/201506/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md
new file mode 100644
index 0000000000..2007daec95
--- /dev/null
+++ b/published/201506/20150610 How to Clear RAM Memory Cache Buffer and Swap Space on Linux.md	
@@ -0,0 +1,106 @@
+在Linux上如何清除内存的 Cache、Buffer 和交换空间
+============================================
+
+像任何其他的操作系统一样,GNU/Linux 已经实现的内存管理不仅有效,而且更好。但是,如果有任何进程正在蚕食你的内存,而你想要清除它的话,Linux 提供了一个刷新或清除RAM缓存方法。
+
+![Clear RAM Cache and Swap in Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Clear-RAM-Cache-in-Linux.jpg)
+
+### 如何在 Linux 中清除缓存(Cache)?###
+
+每个 Linux 系统有三种选项来清除缓存而不需要中断任何进程或服务。
+
+(LCTT 译注:Cache,译作“缓存”,指 CPU 和内存之间高速缓存。Buffer,译作“缓冲区”,指在写入磁盘前的存储再内存中的内容。在本文中,Buffer 和 Cache 有时候会通指。)
+
+1. 仅清除页面缓存(PageCache)
+
+		# sync; echo 1 > /proc/sys/vm/drop_caches		
+		
+2. 清除目录项和inode
+		
+    	# sync; echo 2 > /proc/sys/vm/drop_caches		
+		
+3. 清除页面缓存,目录项和inode
+		
+    	# sync; echo 3 > /proc/sys/vm/drop_caches 
+
+
+上述命令的说明:
+
+sync 将刷新文件系统缓冲区(buffer),命令通过“;”分隔,顺序执行,shell在执行序列中的下一个命令之前会等待命令的终止。正如内核文档中提到的,写入到drop_cache将清空缓存而不会杀死任何应用程序/服务,[echo命令][1]做写入文件的工作。
+
+如果你必须清除磁盘高速缓存,第一个命令在企业和生产环境中是最安全,`"...echo 1> ..."`只会清除页面缓存。
+在生产环境中不建议使用上面的第三个选项`"...echo 3 > ..."` ,除非你明确自己在做什么,因为它会清除缓存页,目录项和inodes。
+
+**在Linux上释放也许被内核所使用的缓冲区(Buffer)和缓存(Cache)是否是个好主意?**
+
+当你设置许多设定想要检查效果时,如果它实际上是专门针对 I/O 范围的基准测试,那么你可能需要清除缓冲区和缓存。你可以如上所示删除缓存,无需重新启动系统(即无需停机)。
+
+Linux被设计成它在寻找磁盘之前到磁盘缓存寻找的方式。如果它发现该资源在缓存中,则该请求不会发送到磁盘。如果我们清理缓存,磁盘缓存就起不到作用了,系统会到磁盘上寻找资源。
+
+此外,当清除缓存后它也将减慢系统运行速度,系统会将每一个被请求的资源再次加载到磁盘缓存中。
+
+
+现在,我们将创建一个 shell 脚本,通过一个 cron 调度任务在每天下午2点自动清除RAM缓存。如下创建一个 shell 脚本 clearcache.sh 并在其中添加以下行:
+
+	#!/bin/bash
+	# 注意,我们这里使用了 "echo 3",但是不推荐使用在产品环境中,应该使用 "echo 1"
+	echo "echo 3 > /proc/sys/vm/drop_caches"
+
+给clearcache.sh文件设置执行权限
+
+	# chmod 755 clearcache.sh
+
+现在,当你需要清除内存缓存时只需要调用脚本。
+
+现在设置一个每天下午2点的定时任务来清除RAM缓存,打开crontab进行编辑。
+
+	# crontab -e
+
+添加以下行,保存并退出。
+
+	0 3 * * * /path/to/clearcache.sh
+
+有关如何创建一个定时任务,更多细节你可以查看我们的文章 [11 个定时调度任务的例子][2]。
+
+**在生产环境的服务器上自动清除RAM是否是一个好主意?**
+
+不!它不是。想想一个情况,当你已经预定脚本在每天下午2点来清除内存缓存。那么其时该脚本会执行并刷新你的内存缓存。在某一天由于某些原因,可能您的网站的在线用户会超过预期地从你的服务器请求资源。
+
+
+而在这时,按计划调度的脚本运行了,并清除了缓存中的一切。当所有的用户都从磁盘读取数据时,这将导致服务器崩溃并损坏数据库。因此,清除缓存仅在必要时并且在你的预料之中,否则你就是个呆瓜系统管理员。
+
+###如何清除Linux的交换空间?###
+
+如果你想清除掉的空间,你可以运行下面的命令:
+
+	# swapoff -a && swapon -a
+
+此外,了解有关风险后,您可以将上面的命令添加到cron中。
+
+现在,我们将上面两种命令结合成一个命令,写成正确的脚本来同时清除RAM缓存和交换空间。
+
+	# echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
+
+或
+
+	su -c 'echo 3 > /proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'
+
+在测试上面的命令之前,我们在执行脚本前后运行“free -m” 来检查缓存。
+
+![Clear RAM Cache and Swap Space](http://www.tecmint.com/wp-content/uploads/2015/05/Clear-RAM-Cache.gif)
+
+就是这样,如果你喜欢这篇文章,不要忘记向我们提供您宝贵的意见,让我们知道,您认为在企业和生产环境中清除内存缓存和缓冲区是否是一个好主意?
+
+--------------------------------------------------------------------------------		
+		
+via: http://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/		
+		
+作者:[Avishek Kumar][a]
+译者:[strugglingyouth](https://github.com/strugglingyouth)
+校对:[wxy](https://github.com/wxy)
+		
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出		
+		
+[a]:http://www.tecmint.com/author/avishek/
+[1]:https://linux.cn/article-3592-1.html
+[2]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/
\ No newline at end of file
diff --git a/published/201506/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md b/published/201506/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md
new file mode 100644
index 0000000000..db6e61da65
--- /dev/null
+++ b/published/201506/20150610 How to Install nginx and google pagespeed on Ubuntu 15.04 Vivid Vervet.md	
@@ -0,0 +1,128 @@
+如何在 Ubuntu 15.04 中安装 nginx 和 google pagespeed
+================================================================================
+Nginx (engine-x)是一个开源的高性能 HTTP 服务器、反向代理和 IMAP/POP3 代理服务器。nginx 杰出的功能有:稳定、丰富的功能集、简单的配置和低资源消耗。nginx 被用于一些高性能网站并在站长之间变得越来越流行。本教程会从源码构建一个带有 google paespeed 模块的用于 Ubuntu 15.04 的 nginx .deb 安装包。
+
+pagespeed 是一个由 google 开发的 web 服务器模块来加速网站响应时间、优化 html 和减少页面加载时间。ngx_pagespeed 的功能如下:
+
+- 图像优化:去除元数据、动态缩放、重压缩。
+- CSS 与 JavaScript 压缩、串联、内联、外联。
+- 小资源内联
+- 图像与 JavaScript 延迟加载
+- HTML 重写
+- 缓存生命期插件
+
+更多请见 [https://developers.google.com/speed/pagespeed/module/][1]。
+
+### 前置要求 ###
+
+- Ubuntu Server 15.04 64位
+- root 权限
+
+本篇我们将要:
+
+- 安装必备软件包
+- 安装带 ngx_pagespeed 的 nginx
+- 测试
+
+#### 安装必备包 ####
+
+	sudo apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev
+
+### 安装带 ngx_pagespeed 的 nginx ###
+
+#### 第一步 - 添加nginx仓库####
+
+    vim /etc/apt/sources.list.d/nginx.list
+
+加入下面的行:
+
+    deb http://nginx.org/packages/ubuntu/ trusty nginx
+    deb-src http://nginx.org/packages/ubuntu/ trusty nginx
+
+更新仓库:
+
+    sudo apt-get update
+
+注意:如果你看到信息:GPG error [...] NO_PUBKEY [...] 等等
+
+请添加key:
+
+    sudo sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys KEYNUMBER
+    sudo apt-get update
+
+####第二步 - 从仓库下载 nginx 1.8####
+
+    sudo su
+    cd ~
+    mkdir -p ~/new/nginx_source/
+    cd ~/new/nginx_source/
+    apt-get source nginx
+    apt-get build-dep nginx
+
+#### 第三步 - 下载 Pagespeed####
+
+    cd ~
+    mkdir -p ~/new/ngx_pagespeed/
+    cd ~/new/ngx_pagespeed/
+    ngx_version=1.9.32.3
+    wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${ngx_version}-beta.zip
+    unzip release-${ngx_version}-beta.zip
+    
+    cd ngx_pagespeed-release-1.9.32.3-beta/
+    wget https://dl.google.com/dl/page-speed/psol/${ngx_version}.tar.gz
+    tar -xzf 1.9.32.3.tar.gz
+
+####第四步 - 配置 nginx 来编译 Pagespeed####
+
+    cd ~/new/nginx_source/nginx-1.8.0/debin/
+    vim rules
+
+在两处 CFLAGS `.configure` 下添加模块:
+
+    --add-module=../../ngx_pagespeed/ngx_pagespeed-release-1.9.32.3-beta \
+
+![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/1.png)
+
+![adding pagespeed to nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/2.png)
+
+####第五步 - 打包 nginx 软件包并安装####
+
+    cd ~/new/nginx_source/nginx-1.8.0/
+    dpkg-buildpackage -b
+
+dpkg-buildpackage 会编译 ~/new/ngix_source/ 为 nginx.deb。打包完成后,看一下目录:
+
+    cd ~/new/ngix_source/
+    ls
+
+![nginx builded with pagespeed](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/3.png)
+
+接着安装 nginx。
+
+    dpkg -i nginx_1.8.0-1~trusty_amd64.deb
+
+![Install nginx](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/4.png)
+
+### 测试 ###
+
+运行 nginx -V 测试 nginx 是否已经自带 ngx_pagespeed。
+
+    nginx -V
+
+![nginx -V](https://www.howtoforge.com/images/nginx_pagespeed_ubuntu_15_04/big/5.png)
+
+### 总结 ###
+
+稳定、快速、开源的 nginx 支持许多不同的优化模块。这其中之一是 google 开发的‘pagespeed’。不像 apache,nginx 模块不是动态加载的,因此你必须在编译之前就选择好需要的模块。
+
+--------------------------------------------------------------------------------
+
+via: https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-15-04/
+
+作者:Muhammad Arul
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[1]:https://developers.google.com/speed/pagespeed/module/
diff --git a/published/201506/20150610 Install Android Studio on Ubuntu 15.04.md b/published/201506/20150610 Install Android Studio on Ubuntu 15.04.md
new file mode 100644
index 0000000000..111291ebd2
--- /dev/null
+++ b/published/201506/20150610 Install Android Studio on Ubuntu 15.04.md	
@@ -0,0 +1,62 @@
+在Ubuntu 15.04下安装Android Studio
+================================================================================
+
+![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/23.png)
+
+Android Studio是官方为了Android应用开发者而发布的IDE,它基于IntelliJ的IDEA。
+
+### Android Studio的功能 ###
+
+- 灵活的基于Gradle的建构系统
+
+- 针对不同手机编译多个版本的apk
+
+- 代码模板功能构建出各种常用的应用
+
+- 支持拖动编辑主题的富布局编辑器
+
+- lint工具可以捕捉到应用的性能、可用性、版本冲突或者其他问题
+
+- 代码混淆和应用签名功能
+
+- 内置 Google Cloud Platform 的支持,可以轻易的融入Google Cloud Messaging 和 App Engine支持
+
+- 还有更多
+
+### 在 Ubuntu 15.04 上安装 Android Studio ###
+
+打开terminal,输入以下命令
+
+    sudo apt-add-repository ppa:paolorotolo/android-studio
+    sudo apt-get update
+    sudo apt-get install android-studio
+
+如果要把Android Studio添加到启动栏,你需要如下操作
+
+打开Android Studio,点击Configure选择Create Desktop Entry,这样Android Studio应该在dash中创建快捷方式了。
+
+### 截图 ###
+
+![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/12.png)
+
+![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/31.png)
+
+![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/41.png)
+
+![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/5.png)
+
+![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/6.png)
+
+![](http://www.ubuntugeek.com/wp-content/uploads/2015/05/7.png)
+
+--------------------------------------------------------------------------------
+
+via: http://www.ubuntugeek.com/install-android-studio-on-ubuntu-15-04.html
+
+作者:[ruchi][a]
+译者:[NearTan](https://github.com/NearTan)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.ubuntugeek.com/author/ubuntufix
\ No newline at end of file
diff --git a/published/201506/20150612 Inside NGINX--How We Designed for Performance and Scale.md b/published/201506/20150612 Inside NGINX--How We Designed for Performance and Scale.md
new file mode 100644
index 0000000000..ffa8dc6d7e
--- /dev/null
+++ b/published/201506/20150612 Inside NGINX--How We Designed for Performance and Scale.md	
@@ -0,0 +1,175 @@
+深入 NGINX: 我们如何设计性能和扩展
+================================================================================
+
+NGINX 能在 web 性能中取得领先地位,这是由于其软件设计所决定的。许多 web 服务器和应用程序服务器使用一个简单的线程或基于流程的架构,NGINX 立足于一个复杂的事件驱动的体系结构,使它能够在现代硬件上扩展到成千上万的并发连接。
+
+这张[深入 NGINX][1] 的信息图从高层次的流程架构深度挖掘说明了 NGINX 如何在单一进程里保持多个连接。这篇博客进一步详细地解释了这一切是如何工作的。
+
+### 知识 – NGINX进程模型 ###
+
+![Master Process](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.36.30-PM.png)
+
+为了更好的理解这个设计,你需要理解 NGINX 如何运行的。NGINX 有一个主进程(它执行特权操作,如读取配置和绑定端口)和一些工作进程与辅助进程。
+
+    # service nginx restart
+    * Restarting nginx
+    # ps -ef --forest | grep nginx
+    root     32475     1  0 13:36 ?        00:00:00 nginx: master process /usr/sbin/nginx \
+                                                    -c /etc/nginx/nginx.conf
+    nginx    32476 32475  0 13:36 ?        00:00:00  \_ nginx: worker process
+    nginx    32477 32475  0 13:36 ?        00:00:00  \_ nginx: worker process
+    nginx    32479 32475  0 13:36 ?        00:00:00  \_ nginx: worker process
+    nginx    32480 32475  0 13:36 ?        00:00:00  \_ nginx: worker process
+    nginx    32481 32475  0 13:36 ?        00:00:00  \_ nginx: cache manager process
+    nginx    32482 32475  0 13:36 ?        00:00:00  \_ nginx: cache loader process
+
+在四核服务器,NGINX 主进程创建了4个工作进程和两个管理磁盘内容缓存的缓存辅助进程。
+
+### 为什么架构很重要? ###
+
+任何 Unix 应用程序的根本基础是线程或进程。(从 Linux 操作系统的角度来看,线程和进程大多是相同的,主要的区别是他们共享内存的程度。)一个线程或进程是一个自包含的指令集,操作系统可以在一个 CPU 核心上调度运行它们。大多数复杂的应用程序并行运行多个线程或进程有两个原因:
+
+- 它们可以同时使用更多的计算核心。
+- 线程或进程可以轻松实现并行操作。(例如,在同一时刻保持多连接)。
+
+进程和线程消耗资源。他们每个都使用内存和其他系统资源,他们会在 CPU 核心中换入和换出(一个操作可以叫做上下文切换)。大多数现代服务器可以并行保持上百个小型的、活动的线程或进程,但是一旦内存耗尽或高 I/O 压力引起大量的上下文切换会导致性能严重下降。 
+
+网络应用程序设计的常用方法是为每个连接分配一个线程或进程。此体系结构简单、容易实现,但是当应用程序需要处理成千上万的并发连接时这种结构就不具备扩展性。
+
+### NGINX 如何工作? ###
+
+NGINX 使用一种可预测的进程模式来分配可使用的硬件资源:
+
+- 主进程(master)执行特权操作,如读取配置和绑定端口,然后创建少量的子进程(如下的三种类型)。
+- 缓存加载器进程(cache loader)在加载磁盘缓存到内存中时开始运行,然后退出。适当的调度,所以其资源需求很低。
+- 缓存管理器进程(cache manager)定期裁剪磁盘缓存中的记录来保持他们在配置的大小之内。
+- 工作进程(worker)做所有的工作!他们保持网络连接、读写内容到磁盘,与上游服务器通信。
+
+在大多数情况下 NGINX 的配置建议:每个 CPU 核心运行一个工作进程,这样最有效地利用硬件资源。你可以在配置中包含 [worker_processes auto][2]指令配置:
+
+    worker_processes auto;
+
+当一个 NGINX 服务处于活动状态,只有工作进程在忙碌。每个工作进程以非阻塞方式保持多连接,以减少上下文交换。
+
+每个工作进程是一个单一线程并且独立运行,它们会获取新连接并处理之。这些进程可以使用共享内存通信来共享缓存数据、会话持久性数据及其它共享资源。(在 NGINX 1.7.11 及其以后版本,还有一个可选的线程池,工作进程可以转让阻塞的操作给它。更多的细节,参见“[NGINX 线程池可以爆增9倍性能!][16]”。对于 NGINX Plus 用户,该功能计划在今年晚些时候加入到 R7 版本中。)
+
+### NGINX 工作进程内部 ###
+
+![](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.39.48-PM.png)
+
+每个 NGINX 工作进程按照 NGINX 配置初始化,并由主进程提供一组监听端口。
+
+NGINX 工作进程首先在监听套接字上等待事件([accept_mutex][3] 和[内核套接字分片][4])。事件被新进来的连接初始化。这些连接被分配到一个状态机 – HTTP 状态机是最常用的,但 NGINX 也实现了流式(原始 TCP )状态机和几种邮件协议(SMTP、IMAP和POP3)的状态机。
+
+![Internet Requests](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.32-PM.png)
+
+状态机本质上是一组指令,告诉 NGINX 如何处理一个请求。大多数 web 服务器像 NGINX 一样使用类似的状态机来实现相同的功能 - 区别在于实现。
+
+### 调度状态机 ###
+
+把状态机想象成国际象棋的规则。每个 HTTP 事务是一个象棋游戏。一方面棋盘是 web 服务器 —— 一位大师可以非常迅速地做出决定。另一方面是远程客户端 —— 在一个相对较慢的网络下 web 浏览器访问网站或应用程序。
+
+不管怎样,这个游戏规则很复杂。例如,web 服务器可能需要与各方沟通(代理一个上游的应用程序)或与身份验证服务器对话。web 服务器的第三方模块甚至可以扩展游戏规则。
+
+#### 一个阻塞状态机 ####
+
+回忆我们之前的描述,一个进程或线程就像一套独立的指令集,操作系统可以在一个 CPU 核心上调度运行它。大多数 web 服务器和 web 应用使用每个连接一个进程或者每个连接一个线程的模式来玩这个“象棋游戏”。每个进程或线程都包含玩完“一个游戏”的指令。在服务器运行该进程的期间,其大部分的时间都是“阻塞的” —— 等待客户端完成它的下一步行动。
+
+![Blocking I/O](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.40.52-PM.png)
+
+1. web 服务器进程在监听套接字上监听新连接(客户端发起新“游戏”)
+1. 当它获得一个新游戏,就玩这个游戏,每走一步去等待客户端响应时就阻塞了。
+1. 游戏完成后,web 服务器进程可能会等待是否有客户机想要开始一个新游戏(这里指的是一个“保持的”连接)。如果这个连接关闭了(客户端断开或者发生超时),web 服务器进程会返回并监听一个新“游戏”。
+
+要记住最重要的一点是每个活动的 HTTP 连接(每局棋)需要一个专用的进程或线程(象棋高手)。这个结构简单容并且易扩展第三方模块(“新规则”)。然而,还是有巨大的不平衡:尤其是轻量级 HTTP 连接其实就是一个文件描述符和小块内存,映射到一个单独的线程或进程,这是一个非常重量级的系统对象。这种方式易于编程,但太过浪费。
+
+#### NGINX是一个真正的象棋大师 ####
+
+也许你听过[同时表演赛][5]游戏,有一个象棋大师同时对战许多对手?
+
+![Kiril Georgiev](http://cdn.nginx.com/wp-content/uploads/2015/06/Kiril-Georgiev.gif)
+
+*[列夫·吉奥吉夫在保加利亚的索非亚同时对阵360人][6]。他的最终成绩是284胜70平6负。*
+
+这就是 NGINX 工作进程如何“下棋”的。每个工作进程(记住 - 通常每个CPU核心上有一个工作进程)是一个可同时对战上百人(事实是,成百上千)的象棋大师。
+
+![Event-driven Architecture](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.13-PM.png)
+
+1. 工作进程在监听和连接套接字上等待事件。
+1. 事件发生在套接字上,并且由工作进程处理它们:
+	- 在监听套接字的事件意味着一个客户端已经开始了一局新棋局。工作进程创建了一个新连接套接字。
+	- 在连接套接字的事件意味着客户端已经下了一步棋。工作进程及时响应。
+
+一个工作进程在网络流量上从不阻塞,等待它的“对手”(客户端)做出反应。当它下了一步,工作进程立即继续其他的游戏,在那里工作进程正在处理下一步,或者在门口欢迎一个新玩家。
+
+#### 为什么这个比阻塞式多进程架构更快? ####
+
+NGINX 每个工作进程很好的扩展支撑了成百上千的连接。每个连接在工作进程中创建另外一个文件描述符和消耗一小部分额外内存。每个连接有很少的额外开销。NGINX 进程可以固定在某个 CPU 上。上下文交换非常罕见,一般只发生在没有工作要做时。
+
+在阻塞方式,每个进程一个连接的方法中,每个连接需要大量额外的资源和开销,并且上下文切换(从一个进程切换到另一个)非常频繁。
+
+更详细的解释,看看这篇关于 NGINX 架构的[文章][7],它由NGINX公司开发副总裁及共同创始人 Andrew Alexeev 写的。
+
+通过适当的[系统优化][8],NGINX 的每个工作进程可以扩展来处理成千上万的并发 HTTP 连接,并能脸不红心不跳的承受峰值流量(大量涌入的新“游戏”)。
+
+### 更新配置和升级 NGINX ###
+
+NGINX 的进程体系架构使用少量的工作进程,有助于有效的更新配置文件甚至 NGINX 程序本身。
+
+![Updating Configuration](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.33-PM.png)
+
+更新 NGINX 配置文件是非常简单、轻量、可靠的操作。典型的就是运行命令 `nginx –s reload`,所做的就是检查磁盘上的配置并发送 SIGHUP 信号给主进程。
+
+当主进程接收到一个 SIGHUP 信号,它会做两件事:
+
+- 重载配置文件和分支出一组新的工作进程。这些新的工作进程立即开始接受连接和处理流量(使用新的配置设置)
+- 通知旧的工作进程优雅的退出。工作进程停止接受新的连接。当前的 http 请求一旦完成,工作进程就彻底关闭这个连接(那就是,没有残存的“保持”连接)。一旦所有连接关闭,这个工作进程就退出。
+
+这个重载过程能引发一个 CPU 和内存使用的小峰值,但是跟活动连接加载的资源相比它一般不易察觉。每秒钟你可以多次重载配置(很多 NGINX 用户都这么做)。非常罕见的情况下,有很多世代的工作进程等待关闭连接时会发生问题,但即使是那样也很快被解决了。
+
+NGINX 的程序升级过程中拿到了高可用性圣杯 —— 你可以随随时更新这个软件,不会丢失连接,停机,或者中断服务。
+
+![New Binary](http://cdn.nginx.com/wp-content/uploads/2015/06/Screen-Shot-2015-06-08-at-12.41.51-PM.png)
+
+程序升级过程类似于平滑重载配置的方法。一个新的 NGINX 主进程与原主进程并行运行,然后他们共享监听套接字。两个进程都是活动的,并且各自的工作进程处理流量。然后你可以通知旧的主进程和它的工作进程优雅的退出。
+
+整个过程的详细描述在 [NGINX 管理][9]。
+
+### 结论 ###
+
+[深入 NGINX 信息图][10] 提供一个 NGINX 功能实现的高层面概览,但在这简单的解释的背后是超过十年的创新和优化,使得 NGINX 在广泛的硬件上提供尽可能最好的性能同时保持了现代 Web 应用程序所需要的安全性和可靠性。
+
+如果你想阅读更多关于NGINX的优化,查看这些优秀的资源:
+
+- [安装和 NGINX 性能调优][11] (webinar; Speaker Deck 上的[讲义][12])
+- [NGINX 性能调优][13]
+- [开源应用架构: NGINX 篇][14]
+- [NGINX 1.9.1 中的套接字分片][15] (使用 SO_REUSEPORT 套接字选项)
+
+--------------------------------------------------------------------------------
+
+via: http://nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale/
+
+作者:[Owen Garrett][a]
+译者:[wyangsun](https://github.com/wyangsun)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://nginx.com/author/owen/
+[1]:http://nginx.com/resources/library/infographic-inside-nginx/
+[2]:http://nginx.org/en/docs/ngx_core_module.html#worker_processes
+[3]:http://nginx.org/en/docs/ngx_core_module.html#accept_mutex
+[4]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/
+[5]:http://en.wikipedia.org/wiki/Simultaneous_exhibition
+[6]:http://gambit.blogs.nytimes.com/2009/03/03/in-chess-records-were-made-to-be-broken/
+[7]:http://www.aosabook.org/en/nginx.html
+[8]:http://nginx.com/blog/tuning-nginx/
+[9]:http://nginx.org/en/docs/control.html
+[10]:http://nginx.com/resources/library/infographic-inside-nginx/
+[11]:http://nginx.com/resources/webinars/installing-tuning-nginx/
+[12]:https://speakerdeck.com/nginx/nginx-installation-and-tuning
+[13]:http://nginx.com/blog/tuning-nginx/
+[14]:http://www.aosabook.org/en/nginx.html
+[15]:http://nginx.com/blog/socket-sharding-nginx-release-1-9-1/
+[16]:http://nginx.com/blog/thread-pools-boost-performance-9x/
diff --git a/published/201506/20150615 PHP at 20--From pet project to powerhouse.md b/published/201506/20150615 PHP at 20--From pet project to powerhouse.md
new file mode 100644
index 0000000000..55470bd389
--- /dev/null
+++ b/published/201506/20150615 PHP at 20--From pet project to powerhouse.md	
@@ -0,0 +1,84 @@
+PHP 20岁了:从玩具到巨头
+=============================================================================
+
+> 曾经的‘丑小鸭工程’已经转变为一个互联网巨头,感谢灵活、务实和充满活力的开发者社区。
+
+当Rasmus Lerdorf发布“[一个用C写的小型紧凑的CGI可执行程序集合][2]”时, 他没有想到他的创造会对网络发展产生多大的影响。今年在Miami举行的SunshinePHP大会上,Lerdorf做了开场演讲,他自嘲到,“在1995年的时候,我以为我已经在 Web 上解除了C API的束缚。显然,事情并非那样,我们全成了C程序员了。”
+
+![](http://images.techhive.com/images/article/2015/06/13049862325_8c97a11878_z-100590275-primary.idge.jpg)
+
+题图来自: [Steve Jurvetson via Flickr][1]
+
+实际上,当Lerdorf发布个人主页工具(Personal Home Page Tools,即 PHP 名字的来源)的1.0版本时,那时的网络还是如此的年轻。直到那年的十一月份HTML 2.0还没有公布,而且HTTP/1.0也是次年的五月份才出现。那时,NCSA HTTPd是使用最广泛的网络服务器,而网景的Navigator则是最流行的网络浏览器,八月份的时候,IE1.0才刚刚出现。换句话说,PHP的开端刚好撞上了浏览器战争的前夜。
+
+早些时候,我们谈论了一大堆关于PHP对网络发展的影响。回到那时候,当说到用于网络应用的服务器端处理,我们的选择是有限的。PHP满足了我们对于一种工具的需求,这就是可以使得我们在网络上做一些动态的事情。它的实用的灵活性只受限于我们的想像力,PHP从那时起便与网络共同成长。现在,PHP占据了网络语言的超过80%的份额,已经是成熟的脚本语言,特别适合解决网络问题。她独一无二的血统讲述了一个故事,实用高于理论,解决问题高于纯正。
+
+### 把我们钩住的网络魔力 ###
+
+PHP一开始并不是一门编程语言,从她的设计就很明显不是 -- 或者她本来就缺乏相关特性,正如那些贬低者指出的那样。最初,她是作为一种API帮助网络开发者能够接入底层的C语言封装库。第一个版本是一组小的CGI可执行程序,提供表单处理功能,可以访问查询参数和mSQL数据库。而且她可以如此容易地处理一个网络应用的数据库,证明了其在激发我们对于PHP的兴趣和PHP后来的支配地位的关键作用。
+
+到了第二版 -- 即 PHP/FI -- 数据库的支持已经扩展到包括PostgreSQL、MySQL、Oracle、Sybase等等。她通过封装他们的C语言库来支持各种数据库,将他们作为PHP库的一部分。PHP/FI也封装了GD库,可以创建并管理GIF图像。她可以作为一个Apache模块运行,或者编译进FastCGI支持,并且她引入的 PHP 编程语言支持变量、数组、语言结构和函数。对于那个时候大多数在网络这块工作的人来说,PHP是我们一直在寻求的那款“胶水”。
+
+当PHP吸纳越来越多的编程语言功能,演变为第三版和之后的版本时,她从来没有失去这种黏合的特性。通过仓库如PECL(PHP Extension Community Library),PHP可以把各种库都连在一起,将他们的函数引入到PHP层面。这种将组件结合在一起的能力,成为PHP之美的一个重要方面,使之不会受限于其源代码上。
+
+### 网络,一个码农们的社区 ###
+
+PHP在网络发展上的持续影响并不局限于能用这种语言干什么。PHP如何完成工作,谁参与进来 -- 这些都是PHP传奇中很重要的部分。
+
+早在1997年,PHP的用户群体开始形成。其中最早的是美国中西部PHP用户组(后来叫做 Chiago PHP),并[1997年二月份的时候举行了第一次聚会][4]。这是一个充满生气、饱含激情的开发者社区形成的开端,聚合成一种吸引力 -- 在网络上的一个小工具就可以帮助他们解决问题。PHP这种普遍存在的特性使得她成为网络开发一个很自然的选择。在分享主导的世界里,她开始盛行,而且低入的门槛对于许多早期的网络开发者来说是十分有吸引力的。
+
+伴随着社区的成长,为开发者带来了一堆工具和资源。这一年是2000年,出现了PHP的一个转折点,它见证了第一次PHP开发者大会,聚集了编程语言的核心开发者,他们在Tel Aviv见面,讨论即将到来的4.0版本的发布。PHP扩展和应用仓库(PEAR)也于2000年发起,它提供了高质量的用户代码包,依据标准和最佳操作。第一届PHP大会PHP Kongress不久之后在德国举行。[PHPDeveloper.org][5]也随后上线,直到今天,这都是PHP社区里最权威的新闻资源。
+
+这个社区的势头表明了接下来几年里PHP成长的关键所在。随着网络开发产业的爆发,PHP也获得发展。PHP开始为更多、更大的网站提供动力。越来越多的用户群在世界各地开花。邮件列表、在线论坛、IRC、大会,以及如php[architect]、德国PHP杂志、国际PHP杂志等商业杂志 -- PHP社区的活力在完成网络工作的方式上有极其重要的影响:共同地,开放地,倡导代码共享。
+
+然后,在10年前,PHP 5发布后不久,在网络发展史上一个有趣地事情发生了,它导致了PHP社区如何构建库和应用的转变:Ruby on Rails发布了。
+
+### 框架的异军突起 ###
+
+用于Ruby编程语言的Ruby on Rails框架在MVC(模型-视图-控制)架构模型上获得了不断增长的焦点与关注。Mojavi PHP框架几年前已经使用MVC模型了,但是Ruby on Rails的高明之处在于巩固了MVC。框架引爆了PHP社区,并且框架已经改变了开发者构建PHP应用程序的方式。
+
+许多重要的项目和发展已经发端,这归功于PHP社区框架的生长。[PHP框架互用性组织][6]成立于2009年,致力于在框架间建立编码标准,命名约定与最佳操作。编纂这些标准和操作帮助为开发者在使用成员项目的代码时提供了越来越多的互用性软件。互用性意味着每个框架可以拆分为组块和独立的库,也可以作为整体的框架在一起使用。互用性带来了另一个重要的里程碑:Composer项目于2011年诞生了。
+
+从Node.js的NPM和Ruby的Bundler获得灵感,Composer开辟了PHP应用开发的新纪元,创造了一次PHP“文艺复兴”。它激发了包互用性、标准命名约定、编码标准的采用、覆盖测试的提升。它是任何现代PHP应用中的一个基本工具。
+
+### 加速和创新的需要 ###
+
+如今,PHP社区有一个生机勃勃应用和库的生态系统,有一些被广泛安装的PHP应用包括WordPress,Drupal,Joomla和MediaWiki。从小型的夫妻店站点到whitehouse.gov和Wikipeida,这些应用支撑了各种不同规模的业务的网站。在Alexa前十的站点中,有6个使用PHP,在一天内为数十亿的页面访问提供服务。因此,PHP应用已成为需要加速的首选,并且许多创新也加入到PHP的核心来提升性能。
+
+在2010年,Facebook公开了其用作PHP源对源的编译器的HipHop,可以翻译PHP代码为C++代码,并且编译为一个单独的可执行二进制应用。Facebook的规模和成长需要从标准互用的PHP代码迁移到更快、最佳的可执行的代码。尽管如此,由于PHP的易用和快速开发周期,Facebook还想继续使用PHP。HipHop后来进化为HHVM,这是一个针对PHP的JIT(just-in-time)编译基础的执行引擎,其包含一个基于PHP的新的语言:[Hack][7]。
+
+Facebook的创新以及其他的VM项目是在引擎水平上的比较,其引起了关于Zend引擎未来的讨论。Zend引擎依然是PHP的内核和语言规范。在2014年,它创建了一个语言规范项目,“提供一个完整的,简明的语句定义,和PHP语言的语义学”,使得对编译器项目来说,创建互用的PHP实现成为可能。
+
+下一个PHP的主要版本成为了激烈争论的话题,他们提出了一个叫做phpng(下一代)的项目,来清理,重构,优化和改进PHP代码基础,这也展示了对实际应用的性能的实质提升。由于之前有一个未发布的PHP 6.0版本,因此在决定命名下一个主要版本叫做“PHP 7”后,就合并了phpng分支,并制定了开发PHP 7的计划,以增加很多语言中拥有的功能,如scalar和返回类型提示。
+
+随着[今天第一版PHP 7 alpha发布][8],基准检测程序显示她在许多方面[与HHVM的一样好或者拥有更好的性能][9],PHP正与现代网络开发需求保持一致的步伐。同样地,PHP-FIG继续创新和推动框架与库的协作 -- 最近由于[PSR-7][10]的采纳,这将会改变PHP项目处理HTTP的方式。用户组、会议、公众和如[PHPMentoring.org][11]这样的布道者继续在PHP开发者社区提倡最好的操作、编码标准和测试。
+
+PHP从各个方面见证了网络的成熟,而且PHP自己也成熟了。曾经一个简单的低级C语言库的API封装,PHP以她自己的方式,已经成为一个羽翼丰满的编程语言。她的开发者社区是一个充满生气、乐于助人、在实用方面引以为傲,并且欢迎新人的地方。PHP已经经受了20年的考验,而且目前在语言与社区里的活跃性,会保证她在接下来的几年里将会是一个密切相关的、积极有用的的语言。
+
+在Rasmus Lerdorf的SunshinePHP的演讲中,他回忆到,“我会想到我会在20年之后讨论当初做的这个愚蠢的小项目吗?没有。”
+
+这里向Lerdorf和PHP社区的其他人致敬,感谢他们把这个“愚蠢的小项目”变成了一个如今网络上持久、强大的组件。
+
+--------------------------------------------------------------------------------
+
+via: http://www.infoworld.com/article/2933858/php/php-at-20-from-pet-project-to-powerhouse.html
+
+作者:[Ben Ramsey][a]
+译者:[wi-cuckoo](https://github.com/wi-cuckoo)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.infoworld.com/author/Ben-Ramsey/
+[1]:https://www.flickr.com/photos/jurvetson/13049862325
+[2]:https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/PyJ25gZ6z7A/M9FkTUVDfcwJ
+[3]:http://w3techs.com/technologies/overview/programming_language/all
+[4]:http://web.archive.org/web/20061215165756/http://chiphpug.php.net/mpug.htm
+[5]:http://www.phpdeveloper.org/
+[6]:http://www.php-fig.org/
+[7]:http://www.infoworld.com/article/2610885/facebook-q-a--hack-brings-static-typing-to-php-world.html
+[8]:https://wiki.php.net/todo/php70#timetable
+[9]:http://talks.php.net/velocity15
+[10]:http://www.php-fig.org/psr/psr-7/
+[11]:http://phpmentoring.org/
+
diff --git a/published/201506/20150617 The Art of Command Line.md b/published/201506/20150617 The Art of Command Line.md
new file mode 100644
index 0000000000..8a4d9a0d98
--- /dev/null
+++ b/published/201506/20150617 The Art of Command Line.md	
@@ -0,0 +1,433 @@
+命令行艺术
+================================================================================
+
+![curl -s 'https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md' | egrep -o '`\w+`' | tr -d '`' | cowsay -W50](https://github.com/jlevy/the-art-of-command-line/raw/master/cowsay.png)
+
+
+流畅地使用命令行是一个常被忽略的技能,或被认为是神秘的奥义。但是,它会以明显而微妙的方式改善你作为工程师的灵活度和生产力。这是我在 Linux 上工作时发现的有用的命令行使用小窍门和笔记的精粹。有些小窍门是很基础的,而有些是相当地特别、复杂、或者晦涩难懂。这篇文章不长,但是如果你可以使用并记得这里的所有内容,那么你就懂得很多了。
+
+其中大部分[最初](http://www.quora.com/What-are-some-lesser-known-but-useful-Unix-commands)[出现](http://www.quora.com/What-are-the-most-useful-Swiss-army-knife-one-liners-on-Unix)在[Quora](http://www.quora.com/What-are-some-time-saving-tips-that-every-Linux-user-should-know)上,但是考虑到兴趣所在,似乎更应该放到 Github 上,这里的人比我更能提出改进建议。如果你看到一个错误,或者更好的某种东西,请提交问题或 PR!(当然,提交前请看看必读小节和已有的 PR/Issue。)
+
+## 必读
+
+范围:
+
+- 本文是针对初学者和专业人员的,选题目标是覆盖面广(全都很重要)、有针对性(大多数情况下都给出具体实例)而简洁(避免不必要内容以及你能在其它地方轻松找到的离题的内容)。每个小窍门在某种情形下都很必需的,或者能比替代品大大节省时间。
+- 这是为 Linux 写的。绝大部分条目都可以同样应用到 MacOS(或者甚至 Cygwin)。
+- 主要针对交互式 Bash,尽管大多数小窍门也可以应用到其它 shell,以及常规 Bash 脚本。
+- 包括了“标准的”UNIX 命令以及那些需要安装的软件包(它们很重要,值得安装)。
+
+注意:
+
+- 为了能在一篇文章内展示尽量多的东西,一些具体的信息会被放到引用页里。你可以使用 Google 来获得进一步的内容。(如果需要的话,)你可以使用 `apt-get`/`yum`/`dnf`/`pacman`/`pip`/`brew` 来安装这些新的程序。
+- 使用 [Explainshell][1] 来获取命令、参数、管道等内容的解释。
+
+## 基础
+
+- 学习基本 Bash 技能。实际上,键入`man bash`,然后至少浏览一遍所有内容;它很容易理解,没那么长。其它 shell 也不错,但是 Bash 很强大,而且到处都可以找到(如果在你自己的笔记本上*只*学习 zsh、fish 之类,会在很多情形下受到限制,比如使用现存的服务器时)。
+
+- 至少学好一种基于文本的编辑器。理想的一个是 Vim(`vi`),因为在终端中编辑时随时都能找到它(即使大多数时候你在使用 Emacs、一个大型的 IDE、或一个现代的时髦编辑器)。
+
+- 学习怎样使用 `man` 来阅读文档(好奇的话,用 `man man` 来列出分区号,比如 1 是常规命令,5 是文件描述,8 用于管理员)。用 `apropos` 找到帮助页。了解哪些命令不是可执行程序,而是 Bash 内置的,你可以用 `help` 和 `help -d` 得到帮助。
+
+- 学习使用 `>` 和 `<` 来进行输出和输入重定向,以及使用 `|` 来管道重定向,学习关于 stdout 和 stderr 的东西。
+
+- 学习 `*`(也许还有 `?` 和 `{`...`}` )文件通配扩展和应用,以及双引号 `"` 和单引号 `'` 之间的区别。(更多内容请参看下面关于变量扩展部分)。
+
+- 熟悉 Bash 作业管理:`&`, **ctrl-z**, **ctrl-c**, `jobs`, `fg`, `bg`, `kill` 等等。
+
+- 掌握`ssh`,以及通过 `ssh-agent`,`ssh-add` 等进行无密码验证的基础技能。
+
+- 基本的文件管理:`ls` 和 `ls -l`(特别是,知道`ls -l`各个列的意义),`less`, `head`, `tail` 和 `tail -f`(或者更好的`less +F`),`ln` 和 `ln -s`(知道硬链接和软链接的区别,以及硬链接相对于软链接的优势),`chown`,`chmod`,`du`(用于查看磁盘使用率的快速摘要:`du -sk *`)。文件系统管理:`df`, `mount`,`fdisk`,`mkfs`,`lsblk`。
+
+- 基本的网络管理: `ip` 或 `ifconfig`,`dig`。
+
+- 熟知正则表达式,以及各种使用`grep`/`egrep`的选项。`-i`,`-o`,`-A` 和 `-B` 选项值得掌握。
+
+- 学会使用 `apt-get`,`yum` ,`dnf` 或 `pacman`(这取决于你的发行版)来查找并安装软件包。确保你可以用 `pip` 来安装基于 Python 的命令行工具(下面的一些东西可以很容易地通过 `pip` 安装)。
+
+
+## 日常使用
+
+- 在Bash中,使用 **tab** 补完参数,使用 **ctrl-r** 来搜索命令历史。
+
+- 在Bash中,使用 **ctrl-w** 来删除最后的单词,使用 **ctrl-u** 来删除整行,返回行首。使用 **alt-b** 和 **alt-f** 来逐词移动,使用 **ctrl-k** 来清除到行尾的内容,以及使用 **ctrl-l** 清屏。参见 `man readline` 来查看 Bash 中所有默认的键盘绑定,有很多。例如,**alt-.** 可以循环显示先前的参数,而**alt-** 扩展通配。(LCTT 译注:关于 Bash 下的快捷键,可以参阅: https://linux.cn/article-5660-1.html )
+
+- 另外,如果你喜欢 vi 风格的键盘绑定,可以使用 `set -o vi`。
+
+- 要查看最近用过的命令,请使用  `history` 。 有许多缩写形式,比如 `!$`(上次的参数)和`!!`(上次的命令),虽然使用 `ctrl-r` 和 `alt-.` 更容易些。(LCTT 译注:关于历史扩展功能,可以参阅: https://linux.cn/article-5658-1.html )
+
+- 返回先前的工作目录: `cd -`
+
+- 如果你命令输入到一半,但是改变主意了,可以敲 **alt-#** 来添加一个 `#` 到开头,然后将该命令作为注释输入(或者使用快捷键 **ctrl-a**, **#**,**enter** 输入)。然后,你可以在后面通过命令历史来回到该命令。 
+
+- 使用 `xargs`(或 `parallel`),它很强大。注意,你可以控制每行(`-L`)执行多少个项目,以及并行执行(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用 `xargs echo`。同时,使用 `-I{}` 也很方便。样例:
+```bash
+      find . -name '*.py' | xargs grep some_function
+      cat hosts | xargs -I{} ssh root@{} hostname
+```
+
+- `pstree -p` 对于显示进程树很有帮助。
+
+- 使用 `pgrep` 和 `pkill` 来按名称查找进程或给指定名称的进程发送信号(`-f` 很有帮助)。
+
+- 掌握各种可以发送给进程的信号。例如,要挂起进程,可以使用 `kill -STOP [pid]`。完整的列表可以查阅 `man 7 signal`。
+
+- 如果你想要一个后台进程一直保持运行,使用 `nohup` 或 `disown`。
+
+- 通过 `netstat -lntp` 或 `ss -plat` 检查哪些进程在监听(用于 TCP,对 UDP 使用 `-u` 替代 `-t`)。
+
+- `lsof`来查看打开的套接字和文件。
+
+- 在 Bash 脚本中,使用 `set -x` 调试脚本输出。尽可能使用严格模式。使用 `set -e` 在遇到错误时退出。也可以使用 `set -o pipefail`,对错误进行严格处理(虽然该话题有点微妙)。对于更复杂的脚本,也可以使用 `trap`。
+
+- 在 Bash 脚本中,子 shell(写在括号中的)是组合命令的便利的方式。一个常见的例子是临时移动到一个不同的工作目录,如:
+```bash
+      # 在当前目录做些事
+      (cd /some/other/dir; other-command)
+      # 继续回到原目录
+```
+
+- 注意,在 Bash 中有大量的各种各样的变量扩展。检查一个变量是否存在:`${name:?error message}`。例如,如果一个Bash脚本要求一个单一参数,只需写 `input_file=${1:?usage: $0 input_file}`。算术扩展:`i=$(( (i + 1) % 5 ))`。序列: `{1..10}`。修剪字符串:`${var%suffix}` 和 `${var#prefix}`。例如,if `var=foo.pdf` ,那么 `echo ${var%.pdf}.txt` 会输出 `foo.txt`。
+
+- 命令的输出可以通过 `<(some command)` 作为一个文件来处理。例如,将本地的 `/etc/hosts` 和远程的比较:
+```sh
+      diff /etc/hosts <(ssh somehost cat /etc/hosts)
+```
+
+- 了解 Bash 中的“嵌入文档”,就像在 `cat <logfile 2>&1` 同时重定向标准输出和标准错误。通常,要确保某个命令不再为标准输入打开文件句柄,而是将它捆绑到你所在的终端,添加 ` foo:
+      rename 's/\.bak$//' *.bak
+      # 文件和目录的全名 foo -> bar:
+      repren --full --preserve-case --from foo --to bar .
+```
+
+- 使用 `shuf` 来从某个文件中打乱或随机选择行。
+
+- 了解 `sort` 的选项。知道这些键是怎么工作的(`-t`和`-k`)。特别是,注意你需要写`-k1,1`来只通过第一个字段排序;`-k1`意味着根据整行排序。
+
+- 稳定排序(`sort -s`)会很有用。例如,要首先按字段2排序,然后再按字段1排序,你可以使用 `sort -k1,1 | sort -s -k2,2`
+
+- 如果你曾经需要在 Bash 命令行中写一个水平制表符(如,用于 -t 参数的排序),按**ctrl-v** **[Tab]**,或者写`$'\t'`(后面的更好,因为你可以复制/粘贴)。
+
+- 对源代码进行补丁的标准工具是 `diff` 和 `patch`。 用 `diffstat` 来统计 diff 情况。注意 `diff -r` 可以用于整个目录,所以可以用 `diff -r tree1 tree2 | diffstat` 来统计(两个目录的)差异。
+
+- 对于二进制文件,使用 `hd` 进行简单十六进制转储,以及 `bvi` 用于二进制编辑。
+
+- 还是用于二进制文件,`strings`(加上 `grep` 等)可以让你找出一点文本。
+
+- 对于二进制文件的差异(delta 压缩),可以使用 `xdelta3`。
+
+- 要转换文本编码,试试 `iconv` 吧,或者对于更高级的用途使用 `uconv`;它支持一些高级的 Unicode 的东西。例如,这个命令可以转换为小写并移除所有重音符号(通过扩展和丢弃):
+```sh
+      uconv -f utf-8 -t utf-8 -x '::Any-Lower; ::Any-NFD; [:Nonspacing Mark:] >; ::Any-NFC; ' < input.txt > output.txt
+```
+
+- 要将文件分割成几个部分,来看看 `split`(按大小分割)和 `csplit`(按格式分割)吧。
+
+- 使用 `zless`,`zmore`,`zcat` 和 `zgrep` 来操作压缩文件。
+
+## 系统调试
+
+- 对于 Web 调试,`curl` 和 `curl -I` 很方便灵活,或者也可以使用它们的同行 `wget`,或者更现代的 [`httpie`](https://github.com/jakubroztocil/httpie)。
+
+- 要了解磁盘、CPU、网络的状态,使用 `iostat`,`netstat`,`top`(或更好的 `htop`)和(特别是)`dstat`。它们对于快速获知系统中发生的状况很好用。
+
+- 对于更深层次的系统总览,可以使用 [`glances`](https://github.com/nicolargo/glances)。它会在一个终端窗口中为你呈现几个系统层次的统计数据,对于快速检查各个子系统很有帮助。
+
+- 要了解内存状态,可以运行 `free` 和 `vmstat`,看懂它们的输出结果吧。特别是,要知道“cached”值是Linux内核为文件缓存所占有的内存,因此,要有效地统计“free”值。
+
+- Java 系统调试是一件截然不同的事,但是对于 Oracle 系统以及其它一些 JVM 而言,不过是一个简单的小把戏,你可以运行 `kill -3 `,然后一个完整的堆栈追踪和内存堆的摘要(包括常规的垃圾收集细节,这很有用)将被转储到stderr/logs。
+
+- 使用 `mtr` 作路由追踪更好,可以识别网络问题。
+
+- 对于查看磁盘满载的原因,`ncdu` 会比常规命令如 `du -sh *` 更节省时间。
+
+- 要查找占用带宽的套接字和进程,试试 `iftop` 或 `nethogs` 吧。
+
+- (Apache附带的)`ab`工具对于临时应急检查网络服务器性能很有帮助。对于更复杂的负载测试,可以试试 `siege`。
+
+- 对于更仔细的网络调试,可以用 `wireshark`,`tshark` 或 `ngrep`。
+
+- 掌握 `strace` 和 `ltrace`。如果某个程序失败、挂起或崩溃,而你又不知道原因,或者如果你想要获得性能的大概信息,这些工具会很有帮助。注意,分析选项(`-c`)和使用 `-p` 关联运行进程。
+
+- 掌握 `ldd` 来查看共享库等。
+
+- 知道如何使用 `gdb` 来连接到一个运行着的进程并获取其堆栈追踪信息。
+
+- 使用 `/proc`。当调试当前的问题时,它有时候出奇地有帮助。样例:`/proc/cpuinfo`,`/proc/xxx/cwd`,`/proc/xxx/exe`,`/proc/xxx/fd/`,`/proc/xxx/smaps`。
+
+- 当调试过去某个东西为何出错时,`sar` 会非常有帮助。它显示了 CPU、内存、网络等的历史统计数据。
+
+- 对于更深层的系统和性能分析,看看 `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)),[`perf`](http://en.wikipedia.org/wiki/Perf_(Linux)) 和 [`sysdig`](https://github.com/draios/sysdig) 吧。
+
+- 确认是正在使用的 Linux 发行版版本(支持大多数发行版):`lsb_release -a`。
+
+- 每当某个东西的行为异常时(可能是硬件或者驱动器问题),使用`dmesg`。
+
+## 单行程序
+
+这是将命令连成一行的一些样例:
+
+- 有时候通过 `sort`/`uniq` 对文本文件做交集、并集和差集运算时,这个例子会相当有帮助。假定 `a` 和 `b` 是已经进行了唯一性处理的文本文件。这会很快,而且可以处理任意大小的文件,总计可达数千兆字节。(Sort不受内存限制,不过如果 `/tmp` 放在一个很小的根分区的话,你可能需要使用 `-T` 选项。)也可参见上面关于`LC_ALL`的注解和 `-u` 选项(参见下面例子更清晰)。
+
+	```bash
+      cat a b | sort | uniq > c   # c 是 a 和 b 的并集
+      cat a b | sort | uniq -d > c   # c 是 a 和 b 的交集
+      cat a b b | sort | uniq -u > c   # c 是 a 减去 b 的差集
+```
+- 使用 `grep . *` 来可视化查看一个目录中的所有文件的所有内容,例如,对于放满配置文件的目录: `/sys`, `/proc`, `/etc`。
+
+- 对某个文本文件的第三列中所有数据进行求和(该例子可能比同等功能的Python要快3倍,而且代码也少于其3倍):
+```sh
+      awk '{ x += $3 } END { print x }' myfile
+```
+
+- 如果想要查看某个文件树的大小/日期,该例子就像一个递归`ls -l`,但是比`ls -lR`要更容易读懂:
+```sh
+      find . -type f -ls
+```
+
+- 只要可以,请使用 `xargs` 或 `parallel`。注意,你可以控制每行(`-L`)执行多少个项目,以及并行执行(`-P`)。如果你不确定它是否会做正确的事情,可以首先使用 `xargs echo`。同时,使用 `-I{}` 也很方便。样例:
+```sh
+      find . -name '*.py' | xargs grep some_function
+      cat hosts | xargs -I{} ssh root@{} hostname
+```
+
+- 比如说,你有一个文本文件,如 Web 服务器的日志,在某些行中出现了某个特定的值,如 URL 中出现的 `acct_id` 参数。如果你想要统计有多少个 `acct_id` 的请求:
+```sh
+      cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn
+```
+
+- 运行该函数来获得来自本文的随机提示(解析Markdown并从中提取某个项目):
+```sh
+      function taocl() {
+        curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md |
+          pandoc -f markdown -t html |
+          xmlstarlet fo --html --dropdtd |
+          xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" |
+          xmlstarlet unesc | fmt -80
+      }
+```
+
+
+## 晦涩难懂,但却有用
+
+- `expr`:实施算术或布林操作,或者求正则表达式的值
+
+- `m4`:简单的宏处理器
+
+- `yes`:大量打印一个字符串
+
+- `cal`:漂亮的日历
+
+- `env`:(以特定的环境变量设置)运行一个命令(脚本中很有用)
+
+- `look`:查找以某个字符串开头的英文单词(或文件中的行)
+
+- `cut ` 和 `paste` 以及 `join`:数据处理
+
+- `fmt`:格式化文本段落
+
+- `pr`:格式化文本为页/列
+
+- `fold`:文本折行
+
+- `column`:格式化文本为列或表
+
+- `expand` 和 `unexpand`:在制表符和空格间转换
+
+- `nl`:添加行号
+
+- `seq`:打印数字
+
+- `bc`:计算器
+
+- `factor`:分解质因子
+
+- `gpg`:加密并为文件签名
+
+- `toe`:terminfo 条目表
+
+- `nc`:网络调试和数据传输
+
+- `socat`:套接字中继和 tcp 端口转发(类似 `netcat`)
+
+- `slurm`:网络流量可视化
+
+- `dd`:在文件或设备间移动数据
+
+- `file`:识别文件类型
+
+- `tree`:以树形显示目录及子目录;类似 `ls`,但是是递归的。
+
+- `stat`:文件信息
+
+- `tac`:逆序打印文件
+
+- `shuf`:从文件中随机选择行
+
+- `comm`:逐行对比分类排序的文件
+
+- `hd`和`bvi`:转储或编辑二进制文件
+
+- `strings`:从二进制文件提取文本
+
+- `tr`:字符转译或处理
+
+- `iconv `或`uconv`:文本编码转换
+
+- `split `和`csplit`:分割文件
+
+- `units`:单位转换和计算;将每双周(fortnigh)一浪(浪,furlong,长度单位,约201米)转换为每瞬(blink)一缇(缇,twip,一种和屏幕无关的长度单位)(参见: /usr/share/units/definitions.units)(LCTT 译注:这都是神马单位啊!)
+
+- `7z`:高比率文件压缩
+
+- `ldd`:动态库信息
+
+- `nm`:目标文件的符号
+
+- `ab`:Web 服务器基准测试
+
+- `strace`:系统调用调试
+
+- `mtr`:用于网络调试的更好的路由追踪软件
+
+- `cssh`:可视化并发 shell
+
+- `rsync`:通过 SSH 同步文件和文件夹 
+
+- `wireshark` 和 `tshark`:抓包和网络调试
+
+- `ngrep`:从网络层摘取信息
+
+- `host` 和 `dig`:DNS查询
+
+- `lsof`:处理文件描述符和套接字信息
+
+- `dstat`:有用的系统统计数据
+
+- [`glances`](https://github.com/nicolargo/glances):高级,多个子系统概览
+
+- `iostat`:CPU和磁盘使用率统计
+
+- `htop`:top的改进版
+
+- `last`:登录历史
+
+- `w`:谁登录进来了
+
+- `id`:用户/组身份信息
+
+- `sar`:历史系统统计数据
+
+- `iftop`或`nethogs`:按套接口或进程的网络使用率
+
+- `ss`:套接口统计数据
+
+- `dmesg`:启动和系统错误信息
+
+- `hdparm`:SATA/ATA 磁盘操作/改善性能
+
+- `lsb_release`:Linux 发行版信息
+
+- `lsblk`:列出块设备,以树形展示你的磁盘和分区
+
+- `lshw`:硬件信息
+
+- `fortune`,`ddate` 和 `sl`:嗯,好吧,它取决于你是否认为蒸汽机车和 Zippy 引用“有用”
+
+
+## 更多资源
+
+- [超棒的shell](https://github.com/alebcay/awesome-shell): 一个shell工具和资源一览表。
+- [严格模式](http://redsymbol.net/articles/unofficial-bash-strict-mode/) 用于写出更佳的shell脚本。
+
+
+## 免责声明
+
+除了非常小的任务外,其它都写出了代码供大家阅读。伴随力量而来的是责任。事实是,你*能*在Bash中做的,并不意味着是你所应该做的!;)
+
+--------------------------------------------------------------------------------
+
+via: https://github.com/jlevy/the-art-of-command-line
+
+作者:[jlevy][a]
+译者:[GOLinux](https://github.com/GOLinux)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://github.com/jlevy
+[1]:http://explainshell.com/
+
diff --git a/published/201506/20150623 Linux Kernel 4.1 Released This Is What's New.md b/published/201506/20150623 Linux Kernel 4.1 Released This Is What's New.md
new file mode 100644
index 0000000000..f49951e253
--- /dev/null
+++ b/published/201506/20150623 Linux Kernel 4.1 Released This Is What's New.md	
@@ -0,0 +1,61 @@
+Linux 4.1 带来了什么新东西?
+================================================================================
+**一个新的Linux内核已经发布了 - 全世界为之心跳(我们想把它说的诗意一些)**
+
+Linus Torvalds(除了他不会有谁了)在Linux邮件列表(当然不会在别的地方)中[宣布][1],在大概两个月后迎来了[第一个4.x系列的Linux内核的发布][2]。
+
+像每次发布前那样,Linux 4.1带来了很多的改变。它们包括了硬件兼容性、电源管理、文件系统性能、以及你从没听说过的处理器的技术修复。
+
+Linux 4.1 已经进入将在10月发布的 Ubuntu 15.10 。
+
+### Linux 4.1 有哪些新东西 ###
+
+![Tux got mail](http://www.omgubuntu.co.uk/wp-content/uploads/2015/06/linux-kernel-4-11-350x200.jpg)
+
+*Tux 收到了邮件*
+
+这个标题只是说说而已,我们不是简单地将发布公告贴到这里。
+
+我们会从(大量、冗长以及那些不明觉厉的的技术的)更改日志去挑选一些对桌面用户而言,不见得夸张但或许有用的亮点。
+
+#### 电源管理 ####
+
+你可以在Linux 4.1中找到的面向用户的一大特性是对 Intel 的 Cherry Trail 和 Bay Trai 芯片、Soc及Intel计算棒等设备的性能及能效的提升。
+
+传闻建议是Linux 4.1给出了新的Intel硬件组合,和更长电池寿命。这么多的进步自然不可能针对所有芯片,它只对特定芯片和系统(和高端的)有用,但仍旧是一个令人兴奋的消息。
+
+**Linux 4.1 亮点包括:**
+
+- ext4 有了文件系统层面的加密(感谢Google)
+- 罗技游戏手柄lg4ff驱动改进了‘力反馈’
+- 东芝笔记本驱动进行了USB睡眠充电和背光改进
+- Xbox One控制器支持Rumble
+- Wacom平板驱动改进了电源报告
+- 各种针对arm和x86设备电源管理改进
+- Samsung Exynos 3250 电源管理改进
+- 支持Bamboo平板
+- 联想OneLink Pro Dock获得USB支持
+- 支持Realtek 8723A、 8723B、 8761A、 8821 Wi-Fi网卡
+
+### Ubuntu中安装Linux 4.1 ###
+
+虽然这次发布的内核被标记为稳定,但是Ubuntu用户并不需要迫切地安装它。
+
+但如果你等不及了并且技术足够熟练,你可以从[Canonical的主干内核归档][3]中下载合适的软件包来安装Linux 4.1(或者冒着风险使用第三方PPA)。
+
+10月发布的Ubuntu 15.10 Wily Werewolf将会基于Ubuntu Kernel 4.1.x(Ubuntu内核是基于Linux内核加上Ubuntu没被上流接受的独有补丁)。
+
+--------------------------------------------------------------------------------
+
+via: http://www.omgubuntu.co.uk/2015/06/linux-4-1-kernel-new-features
+
+作者:[Joey-Elijah Sneddon][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://plus.google.com/117485690627814051450/?rel=author
+[1]:https://lkml.org/lkml/2015/6/22/8
+[2]:http://www.omgubuntu.co.uk/2015/04/linux-kernel-4-0-new-features
+[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
diff --git a/published/201506/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md b/published/201506/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md
new file mode 100644
index 0000000000..0f770d2ee4
--- /dev/null
+++ b/published/201506/20150626 15 Useful MySQL or MariaDB Performance Tuning and Optimization Tips.md	
@@ -0,0 +1,285 @@
+15 个有用的 MySQL/MariaDB 性能调整和优化技巧
+================================================================================
+MySQL 是一个强大的开源关系数据库管理系统(简称 RDBMS)。它发布于 1995 年(20年前)。它采用结构化查询语言(SQL),这可能是数据库内容管理中最流行的选择。最新的 MySQL 版本是 5.6.25,于 2015 年 5 月 29 日发布。
+
+关于 MySQL 一个有趣的事实是它的名字来自于 Michael Widenius(MySQL 的创始人)的女儿“ My”。尽管有许多关于 MySQL 有趣的传闻,不过本文主要是向你展示一些有用的实践,以帮助你管理你的 MySQL 服务器。
+
+![MySQL 性能优化](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning1.png)
+
+*MySQL 性能优化*
+
+2009 年 4 月,MySQL 被 Oracle 收购。其结果是MySQL 社区分裂,创建了一个叫 MariaDB 的分支 。创建该分支的主要原因是为了保持这个项目可以在 GPL 下的自由。
+
+今天,MySQL 和 MariaDB 是用于类似 WordPress、Joomla、Magento 和其他 web 应用程序的最流行的 RDMS 之一(如果不是最多的)。
+
+这篇文章将告诉你一些基本的,但非常有用的关于如何优化 MySQL/MariaDB 性能的技巧。注意,本文假定您已经安装了 MySQL 或 MariaDB。如果你仍然不知道如何在系统上安装它们,你可以按照以下说明去安装:
+
+- [在 RHEL/CentOS 7 上安装 LAMP][1]
+- [在 Fedora 22 上安装 LAMP][2]
+- [在 Ubuntu 15.04 安装 LAMP][3]
+- [在 Debian 8 上安装 MariaDB][4]
+- [在 Gentoo Linux 上安装 MariaDB][5]
+- [在 Arch Linux 上安装 MariaDB][6]
+
+**重要提示**: 在开始之前,不要盲目的接受这些建议。每个 MySQL 设置都是不同的,在进行任何更改之前需要慎重考虑。
+
+你需要明白这些:
+
+- MySQL/MariaDB 配置文件位于 `/etc/my.cnf`。 每次更改此文件后你需要重启 MySQL 服务,以使更改生效。
+- 这篇文章使用 MySQL 5.6 版本。
+
+### 1. 启用 InnoDB 的每张表一个数据文件设置 ###
+
+首先,有一个重要的解释, InnoDB 是一个存储引擎。MySQL 和 MariaDB 使用 InnoDB 作为默认存储引擎。以前,MySQL 使用系统表空间来保存数据库中的表和索引。这意味着服务器唯一的目的就是数据库处理,它们的存储盘不用于其它目的。
+
+InnoDB 提供了更灵活的方式,它把每个数据库的信息保存在一个 `.ibd` 数据文件中。每个 .idb 文件代表它自己的表空间。通过这样的方式可以更快地完成类似 “TRUNCATE” 的数据库操作,当删除或截断一个数据库表时,你也可以回收未使用的空间。     
+
+这样配置的另一个好处是你可以将某些数据库表放在一个单独的存储设备。这可以大大提升你磁盘的 I/O 负载。
+
+MySQL 5.6及以上的版本默认启用 `innodb_file_per_table`。你可以在 /etc/my.cnf 文件中看到。该指令看起来是这样的:
+
+    innodb_file_per_table=1
+
+### 2. 将 MySQL 数据库数据存储到独立分区上  ###
+
+**注意**:此设置只在 MySQL 上有效, 在 MariaDB 上无效。
+
+有时候操作系统的读/写会降低你 MySQL 服务器的性能,尤其是如果操作系统和数据库的数据位于同一块磁盘上。因此,我建议你使用单独的磁盘(最好是 SSD)用于 MySQL 服务。
+
+要完成这步,你需要将新的磁盘连接到你的计算机/服务器上。对于这篇文章,我假定磁盘挂在到 /dev/sdb。
+
+####下一步是准备新的分区:
+
+    # fdisk /dev/sdb
+
+现在按 “N” 来创建新的分区。接着按 “P”,使其创建为主分区。在此之后,从 1-4 设置分区号。之后,你可以选择分区大小。这里按 enter。在下一步,你需要配置分区的大小。
+
+如果你希望使用全部的磁盘,再按一次 enter。否则,你可以手动设置新分区的大小。准备就绪后按 “w” 保存更改。现在,我们需要为我们的新分区创建一个文件系统。这可以用下面命令轻松地完成:
+
+    # mkfs.ext4 /dev/sdb1
+
+现在我们会挂载新分区到一个目录。我在根目录下创建了一个名为 “ssd” 的目录:
+
+    # mkdir /ssd/
+
+挂载新分区到刚才创建的目录下:
+
+    # mount /dev/sdb1  /ssd/
+
+你可以在 /etc/fstab 文件中添加如下行设置为开机自动挂载:
+
+    /dev/sdb1 /ssd ext3 defaults 0 0
+
+####现在我们将 MySQL 移动到新磁盘中
+
+首先停止 MySQL 服务:
+
+    # service mysqld stop
+
+我建议你​​同时停止 Apache/nginx,以防止任何试图写入数据库的操作:
+
+    # service httpd stop
+    # service nginx stop
+
+现在复制整个 MySQL 目录到新分区中:
+
+    # cp /var/lib/mysql /ssd/ -Rp
+
+这可能需要一段时间,具体取决于你的 MySQL 数据库的大小。一旦这个过程完成后重命名 MySQL 目录:
+
+    # mv /var/lib/mysql /var/lib/mysql-backup
+
+然后创建一个符号链接:
+
+    # ln -s /ssd/mysql /var/lib/mysql
+
+现在启动你的 MySQL 和 web 服务:
+
+    # service mysqld start
+    # service httpd start
+    # service nginx start
+
+以后你的数据库将使用新的磁盘访问。
+
+### 3. 优化使用 InnoDB 的缓冲池 ###
+
+InnoDB 引擎在内存中有一个缓冲池用于缓存数据和索引。这当然有助于你更快地执行 MySQL/MariaDB 查询语句。选择合适的内存大小需要一些重要的决策并对系统的内存消耗有较多的认识。
+
+下面是你需要考虑的:
+
+- 其它的进程需要消耗多少内存。这包括你的系统进程,页表,套接字缓冲。 
+- 你的服务器是否专门用于 MySQL 还是你运行着其它非常消耗内存的服务。
+
+在一个专用的机器上,你可能会把 60-70% 的内存分配给 `innodb_buffer_pool_size`。如果你打算在一个机器上运行更多的服务,你应该重新考虑专门用于 `innodb_buffer_pool_size` 的内存大小。
+
+你需要设置 my.cnf 中的此项:
+
+    innodb_buffer_pool_size
+
+### 4. 在 MySQL 中避免使用 Swappiness ###
+
+“交换”是一个当系统移动部分内存到一个称为 “交换空间” 的特殊磁盘空间时的过程。通常当你的系统用完物理内存后就会出现这种情况,系统将信息写入磁盘而不是释放一些内存。正如你猜测的磁盘比你的内存要慢得多。
+
+该选项默认情况下是启用的:
+
+    # sysctl vm.swappiness 
+    
+    vm.swappiness = 60
+
+运行以下命令关闭 swappiness:
+
+    # sysctl -w vm.swappiness=0
+
+### 5. 设置 MySQL 的最大连接数 ###
+
+`max_connections` 指令告诉你当前你的服务器允许多少并发连接。MySQL/MariaDB 服务器允许有 SUPER  权限的用户在最大连接之外再建立一个连接。只有当执行 MySQL 请求的时候才会建立连接,执行完成后会关闭连接并被新的连接取代。
+
+请记住,太多的连接会导致内存的使用量过高并且会锁住你的 MySQL 服务器。一般小网站需要 100-200 的连接数,而较大可能需要 500-800 甚至更多。这里的值很大程度上取决于你 MySQL/MariaDB 的使用情况。
+
+你可以动态地改变 `max_connections` 的值而无需重启MySQL服务器:
+
+    # mysql -u root -p
+    mysql> set global max_connections = 300;
+
+### 6. 配置 MySQL 的线程缓存数量 ###
+
+ `thread_cache_size` 指令用来设置你服务器缓存的线程数量。当客户端断开连接时,如果当前线程数小于  `thread_cache_size`,它的线程将被放入缓存中。下一个请求通过使用缓存池中的线程来完成。 
+
+要提高服务器的性能,你可以设置 `thread_cache_size` 的值相对高一些。你可以通过以下方法来查看线程缓存命中率:
+
+    mysql> show status like 'Threads_created';
+    mysql> show status like 'Connections';
+
+你可以用以下公式来计算线程池的命中率:
+
+    100 - ((Threads_created / Connections) * 100)
+
+如果你得到一个较低的数字,这意味着大多数 mysql 连接使用新的线程,而不是从缓存加载。在这种情况下,你需要增加 `thread_cache_size`。
+
+这里有一个好处是可以动态地改变 `thread_cache_size` 而无需重启 MySQL 服务。你可以通过以下方式来实现:
+
+    mysql> set global thread_cache_size = 16;
+
+### 7. 禁用 MySQL 的 DNS 反向查询 ###
+
+默认情况下当新的连接出现时,MySQL/MariaDB 会进行 DNS 查询解析用户的 IP 地址/主机名。对于每个客户端连接,它的 IP 都会被解析为主机名。然后,主机名又被反解析为 IP 来验证两者是否一致。
+
+当 DNS 配置错误或服务器出现问题时,这很可能会导致延迟。这就是为什么要关闭 DNS 的反向查询的原因,你可以在你的配置文件中添加以下选项去设定:
+
+    [mysqld]
+    # Skip reverse DNS lookup of clients
+    skip-name-resolve
+
+更改后你需要重启 MySQL 服务。
+
+### 8. 配置 MySQL 的查询缓存容量 ###
+
+如果你有很多重复的查询并且数据不经常改变 – 请使用缓存查询。 人们常常不理解 `query_cache_size` 的实际含义而将此值设置为 GB 级,这实际上会降低服务器的性能。
+
+背后的原因是,在更新过程中线程需要锁定缓存。通常设置为 200-300 MB应该足够了。如果你的网站比较小的,你可以尝试给 64M 并在以后及时去增加。
+
+在你的 MySQL 配置文件中添加以下设置:
+
+    query_cache_type = 1
+    query_cache_limit = 256K
+    query_cache_min_res_unit = 2k
+    query_cache_size = 80M
+
+### 9. 配置临时表容量和内存表最大容量 ###
+
+`tmp_table_size` 和 `max_heap_table_size` 这两个变量的大小应该相同,它们可以让你避免磁盘写入。`tmp_table_size` 是内置内存表的最大空间。如果表的大小超出限值将会被转换为磁盘上的 MyISAM 表。
+
+这会影响数据库的性能。管理员通常建议在服务器上设置这两个值为每 GB 内存给 64M。
+
+    [mysqld]
+    tmp_table_size= 64M
+    max_heap_table_size= 64M
+
+### 10. 启用 MySQL 慢查询日志 ###
+
+记录慢查询可以帮助你定位数据库中的问题并帮助你调试。这可以通过在你的 MySQL 配置文件中添加以下值来启用:
+
+    slow-query-log = 1
+    slow-query-log-file = /var/lib/mysql/mysql-slow.log
+    long_query_time = 1
+
+第一个变量启用慢查询日志,第二个告诉 MySQL 实际的日志文件存储位置。使用 `long_query_time` 来定义完成 MySQL 查询多少用时算长。
+
+### 11. 检查 MySQL 的空闲连接 ###
+
+空闲连接会消耗资源,可以的话应该被终止或者刷新。空闲连接是指处于 “sleep” 状态并且保持了很长一段时间的连接。你可以通过运行以下命令查看空闲连接:
+
+    # mysqladmin processlist -u root -p | grep “Sleep”
+
+这会显示处于睡眠状态的进程列表。当代码使用持久连接到数据库时会出现这种情况。使用 PHP 调用 mysql_pconnect 可以打开这个连接,执行完查询之后,删除认证信息并保持连接为打开状态。这会导致每个线程的缓冲都被保存在内存中,直到该线程结束。
+
+首先你要做的就是检查代码问题并修复它。如果你不能访问正在运行的代码,你可以修改 `wait_timeout` 变量。默认值是 28800 秒,而你可以安全地将其降低到 60 :
+
+    wait_timeout=60
+
+### 12. 为 MySQL 选择正确的文件系统 ###
+
+选择正确的文件系统对数据库至关重要。在这里你需要考虑的最重要的事情是 - 数据的完整性,性能和易管理性。
+
+按照 MariaDB 的建议,最好的文件系统是XFS、ext4 和 Btrfs。它们都是可以使用超大文件和大容量存储卷的企业级日志型文件系统。
+
+下面你可以找到一些关于这三个文件系统的有用信息:
+
+| 文件系统       | XFS | Ext4 | Btrfs |
+|---------------|-----|------|-------|
+| 文件系统最大容量 | 8EB | 1EB  | 16EB  |
+| 最大文件大小		| 8EB | 16TB | 16EB  |
+
+
+我们的这篇文章详细介绍了 Linux 文件系统的利与弊: [Linux 文件系统解析][7]。
+
+### 13. 设置 MySQL 允许的最大数据包 ###
+
+MySQL 把数据拆分成包。通常一个包就是发送到客户端的一行数据。`max_allowed_pa​​cket` 变量定义了可以被发送的最大的包。
+
+此值设置得过低可能会导致查询速度变得非常慢,然后你会在 MySQL 的错误日志看到一个错误。建议将该值设置为最大包的大小。
+
+### 14. 测试 MySQL 的性能优化 ###
+
+你应该定期检查 MySQL/MariaDB 的性能。这将帮助你了解资源的使用情况是否发生了改变或需要进行改进。
+
+有大量的测试工具可用,但我推荐你一个简单易用的。该工具被称为 mysqltuner。
+
+使用下面的命令下载并运行它:
+
+    # wget https://github.com/major/MySQLTuner-perl/tarball/master
+    # tar xf master
+    # cd major-MySQLTuner-perl-993bc18/
+    # ./mysqltuner.pl 
+
+你将收到有关 MySQL 使用的详细报告和推荐提示。下面是默认 MariaDB 安装的输出样例:
+
+![MySQL 性能优化](http://www.tecmint.com/wp-content/uploads/2015/06/MySQL-Performance-Tuning.png)
+
+### 15. 优化和修复 MySQL 数据库 ###
+
+有时候 MySQL/MariaDB 数据库中的表很容易崩溃,尤其是服务器意外关机、文件系统突然崩溃或复制过程中仍然访问数据库。幸运的是,有一个称为 'mysqlcheck' 的免费开源工具,它会自动检查、修复和优化 Linux 中数据库的所有表。
+
+    # mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
+    # mysqlcheck -u root -p --auto-repair --check --optimize databasename
+
+就是这些!我希望上述文章对你有用,并帮助你优化你的 MySQL 服务器。一如往常,如果你有任何疑问或评论,请在下面的评论部分提交。
+
+--------------------------------------------------------------------------------
+
+via: http://www.tecmint.com/mysql-mariadb-performance-tuning-and-optimization/
+
+作者:[Marin Todorov][a]
+译者:[strugglingyouth](https://github.com/strugglingyouth)
+校对:[ictlyh](https://github.com/ictlyh)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.tecmint.com/author/marintodorov89/
+[1]:http://www.tecmint.com/install-lamp-in-centos-7/
+[2]:http://www.tecmint.com/install-lamp-linux-apache-mysql-php-on-fedora-22/
+[3]:http://www.tecmint.com/install-lamp-on-ubuntu-15-04/
+[4]:http://www.tecmint.com/install-mariadb-in-debian/
+[5]:http://www.tecmint.com/install-lemp-in-gentoo-linux/
+[6]:http://www.tecmint.com/install-lamp-in-arch-linux/
+[7]:http://www.tecmint.com/linux-file-system-explained/
diff --git a/published/20150601 How to monitor Linux servers with SNMP and Cacti.md b/published/20150601 How to monitor Linux servers with SNMP and Cacti.md
new file mode 100644
index 0000000000..68bf72ad98
--- /dev/null
+++ b/published/20150601 How to monitor Linux servers with SNMP and Cacti.md	
@@ -0,0 +1,181 @@
+使用 SNMP 和 Cacti 监控 Linux 服务器
+================================================================================
+SNMP(简单网络管理协议)用于收集设备内部发生的数据,如负载、磁盘状态、带宽之类。像Cacti这样的网络监控工具用这些数据来生成图标以达到监控的目的。
+
+在一个典型的Cacti和SNMP部署中,会有一台或多台启用了SNMP的设备,以及一台独立的用来从那些设备收集SNMP回馈的监控服务器。请记住,所有需要监控的设备必须启用SNMP。在本教程中,出于演示目的,我们将在同一台Linux服务器上配置Cacti和SNMP。
+
+### 在Debian或Ubuntu上配置SNMP ###
+
+要在基于Debian的系统上安装SNMP代理(snmpd),请运行以下命令:
+
+    root@server:~# apt-get install snmpd
+
+然后,如下编辑配置文件。
+
+    root@server:~# vim /etc/snmp/snmpd.conf
+
+----------
+
+    # 使snmpd 监听再所有接口上
+    agentAddress  udp:161
+    
+    # 定义一个只读的 community 'myCommunity' 和源网络
+    rocommunity myCommunity 172.17.1.0/24
+    
+    sysLocation    Earth
+    sysContact     email@domain.tld
+
+在编辑完配置文件后,重启snmpd。
+
+    root@server:~# service snmpd restart
+
+### 在CentOS或RHEL上配置SNMP ###
+
+要安装SNMP工具和库,请运行以下命令。
+
+    root@server:~# sudo yum install net-snmp
+
+然后,如下编辑SNMP配置文件。
+
+    root@server:~# vim /etc/snmp/snmpd.conf
+
+----------
+
+    # 定义一个使用 community 'myCommunity' 和源网络 172.17.1.0/24 的用户 'myUser'
+    com2sec myUser 172.17.1.0/24 myCommunity
+    
+    # 将 myUser 加到 'myGroup' 组,定义组权限
+    group    myGroup    v1        myUser
+    group    myGroup    v2c        myUser
+    view all included .1
+    access myGroup    ""    any    noauth     exact    all    all    none
+
+----------
+
+    root@server:~# service snmpd restart
+    root@server:~# chkconfig snmpd on
+
+重启snmpd服务,然后添加到启动服务列表。
+
+### 测试SNMP ###
+
+SNMP可以通过运行snmpwalk命令进行测试。如果SNMP已经配置成功,该命令会生成大量输出。
+
+    root@server:~# snmpwalk -c myCommunity 172.17.1.44 -v1
+
+----------
+
+    iso.3.6.1.2.1.1.1.0 = STRING: "Linux mrtg 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64"
+    iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
+    iso.3.6.1.2.1.1.3.0 = Timeticks: (2097) 0:00:20.97
+    
+    ~~ 输出截断 ~~
+    
+    iso.3.6.1.2.1.92.1.1.2.0 = Gauge32: 1440
+    iso.3.6.1.2.1.92.1.2.1.0 = Counter32: 1
+    iso.3.6.1.2.1.92.1.2.2.0 = Counter32: 0
+    iso.3.6.1.2.1.92.1.3.1.1.2.7.100.101.102.97.117.108.116.1 = Timeticks: (1) 0:00:00.01
+    iso.3.6.1.2.1.92.1.3.1.1.3.7.100.101.102.97.117.108.116.1 = Hex-STRING: 07 DD 0B 12 00 39 27 00 2B 06 00 
+
+### 配置带有SNMP的Cacti ###
+
+在本教程中,我们将在同一台Linux服务器上设置Cacti和SNMP。所以,到刚刚配置SNMP的Linux服务器上去[安装Cacti][2]吧。
+
+安装完后,Cacti网页界面可以通过“http://172.17.1.44/cacti ”来访问,当然,在你的环境中,请将IP地址换成你的服务器的地址。
+
+![](http://farm6.staticflickr.com/5512/10972747655_0298f6ce6c_z.jpg)
+
+![](http://farm6.staticflickr.com/5532/10972982543_67e15433b8_z.jpg)
+
+安装过程中Cacti的路径一般都是正确的,但是如有必要,请再次检查以下。
+
+![](http://farm4.staticflickr.com/3764/10972920304_138670d3cf_z.jpg)
+
+在首次安装过程中,Cacti默认的用户名和密码是“admin”和“admin”。在首次登录后会强制你修改密码。
+
+![](http://farm6.staticflickr.com/5542/10972747775_531fe445ef_o.png)
+
+### 添加设备到Cacti并管理 ###
+
+Cacti将根据先前配置的SNMP字符串注册设备。在本教程中,我们将只添加启用了SNMP的本地服务器。
+
+要添加设备,我们必须以管理员登录,然后转到Cacti管理员面板中的控制台。点击 控制台 > 设备。
+
+![](http://farm8.staticflickr.com/7411/10972747855_b464972e56_z.jpg)
+
+那里可能已经有一个名为‘localhost’的设备。我们不需要它,因为我们要创建全新的图表。我们可以将该设备从列表中删除,使用“添加”按钮来添加新设备。
+
+![](http://farm8.staticflickr.com/7373/10972747895_977e0eccd6_z.jpg)
+
+接下来,我们设置设备参数。
+
+![](http://farm8.staticflickr.com/7400/10972747935_df03500de7_z.jpg)
+
+现在设备已经添加,我们来指定想要创建的图表模板。你可以在该页面的最后部分中找到这块内容。
+
+![](http://farm4.staticflickr.com/3773/10972747955_083101e6ab_z.jpg)
+
+然后,我们继续来创建图表。
+
+![](http://farm4.staticflickr.com/3734/10972747985_fae6b78888.jpg)
+
+这里,我们创建用于平均负载、RAM和硬盘、处理器的图表。
+
+![](http://farm8.staticflickr.com/7374/10972920484_ed6b33b8b8_z.jpg)
+
+### 接口的图表和64位计数器 ###
+
+默认情况下,Cacti在SNMP查询中使用32位计数器。32位计数器对于大多数带宽图表而言已经足够了,但是对于超过100Mbps的带宽,它就无能为力了。如果已经知道带宽会超过100Mbps,建议你使用64位计数器。使用64位计数器一点也不麻烦。
+
+![](http://farm8.staticflickr.com/7320/10972982813_120fe1f3d0_z.jpg)
+
+**注意**: Cacti会花费大约15分钟来产生新图表,除了耐心等待,你别无选择。
+
+### 创建图表树 ###
+
+这些截图展示了如何创建图表树,以及如何添加图表到这些树中。
+
+![](http://farm8.staticflickr.com/7429/10972748045_ca06bec889_z.jpg)
+
+![](http://farm3.staticflickr.com/2833/10972920584_f33624862a_z.jpg)
+
+![](http://farm6.staticflickr.com/5548/10972836666_f31e4de0e7_z.jpg)
+
+![](http://farm4.staticflickr.com/3786/10972836776_1675611740_z.jpg)
+
+我们可以验证图表树中的图表。
+
+![](http://farm4.staticflickr.com/3707/10972836836_3dabe56765_z.jpg)
+
+### 用户管理 ###
+
+最后,我们创建一个只具有查看我们刚创建的图表权限的用户。Cacti内建了用户管理系统,而且是高度可定制的。
+
+![](http://farm8.staticflickr.com/7313/10972920624_61e13157f9_z.jpg)
+
+![](http://farm6.staticflickr.com/5536/10972920644_59a9797685_z.jpg)
+
+![](http://farm3.staticflickr.com/2872/10972920744_24f75fb5a8_z.jpg)
+
+在完成这些步骤后,我们可以使用‘user1’来登录进去,并验证只有该用户可以查看该图表。
+
+![](http://farm8.staticflickr.com/7423/10972748265_c2608b3683_z.jpg)
+
+![](http://farm4.staticflickr.com/3763/10972748335_9cd012c6fe_z.jpg)
+
+至此,我们在网络监控系统中部署了一台Cacti服务器。Cacti服务器比较稳定,可以处理大量图表而不会出问题。
+
+希望本文对你有所帮助。
+
+--------------------------------------------------------------------------------
+
+via: http://xmodulo.com/monitor-linux-servers-snmp-cacti.html
+
+作者:[Sarmed Rahman][a]
+译者:[GOLinux](https://github.com/GOLinux)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://xmodulo.com/author/sarmed
+[1]:https://linux.cn/article-4683-1.html
diff --git a/published/20150601 How to monitor common services with Nagios.md b/published/20150601 How to monitor common services with Nagios.md
new file mode 100644
index 0000000000..4f6523f0ce
--- /dev/null
+++ b/published/20150601 How to monitor common services with Nagios.md	
@@ -0,0 +1,267 @@
+如何用 Nagios 监控通用服务
+================================================================================
+Nagios内置了很多脚本来监控服务。本篇会使用其中一些来检查通用服务如MySql、Apache、DNS等等。
+
+为了保证本篇集中在系统监控,我们不会在这里配置主机组或者模板,它们已经在 [前面的教程][1]中覆盖了,它们可以满足需要了。
+
+### 在命令行中运行Nagios ###
+
+通常建议在添加到Nagios前,先在命令行中运行Nagios服务检测脚本。它会给出执行是否成功以及脚本的输出将会看上去的样子。
+
+这些脚本存储在 /etc/nagios-plugins/config/ ,可执行文件在 /usr/lib/nagios/plugins/。
+
+下面就是该怎么做
+
+    root@nagios:~# cd /etc/nagios-plugins/config/
+
+提供的脚本包含了语法帮助。示例包含了部分输出。
+
+    root@nagios:~# cat /etc/nagios-plugins/config/tcp_udp.cfg
+
+----------
+
+    # 'check_tcp' command definition
+    define command{
+            command_name    check_tcp
+            command_line    /usr/lib/nagios/plugins/check_tcp -H '$HOSTADDRESS$' -p '$ARG1$'
+
+了解了语法,TCP 80端口可以用下面的方法检查。
+
+    root@nagios:~# /usr/lib/nagios/plugins/check_tcp -H 10.10.10.1 -p 80
+
+----------
+
+    TCP OK - 0.000 second response time on port 80|time=0.000222s;;;0.000000;10.000000
+
+### 示例拓扑  ###
+
+本片中使用下面三台服务器。每台服务器运行多个通用服务。Nagios服务器现在运行的是Ubuntu。
+
+- Server 1 (10.10.10.1) : MySQL, Apache2
+- Server 2 (10.10.10.2) : Postfix, Apache2
+- Server 3 (10.10.10.3) : DNS 
+
+首先,这些服务器被定义在了Nagios中。
+
+    root@nagios:~# vim /etc/nagios3/conf.d/example.cfg
+
+----------
+
+    define host{
+            use                     generic-host            
+            host_name               test-server-1
+            alias                   test-server-1
+            address                 10.10.10.1
+            }
+    
+    define host{
+            use                     generic-host            
+            host_name               test-server-2
+            alias                   test-server-2
+            address                 10.10.10.2
+            }
+    
+    define host{
+            use                     generic-host            
+            host_name               test-server-3
+            alias                   test-server-3
+            address                 10.10.10.3
+            }
+
+### 监控MySQL服务 ###
+
+#### MySQL 监控需要 ####
+
+- 通过检查3306端口来检测MySQL是否运行中。
+- 检测特定的数据库'testDB'是否可用。
+
+#### MySQL 服务器设置 ####
+
+开始检测MySQL时,需要记住MySQL默认只监听回环接口127.0.0.1。这增加了数据库的安全。手动调节需要告诉MySQL该监听什么其他接口。下面是该怎么做。
+
+这个设置要在所有的MySQL服务器上完成。
+
+    root@nagios:~# vim /etc/mysql/my.cnf
+
+下面这行被注释掉以监听所有网络接口。
+
+    #bind-address           = 127.0.0.1
+
+同样,MySQL也不会让任意主机来连接它。需要为localhost和“任意”主机创建MySQL用户‘nagios’,接着在所有的数据库中为这个用户授予ALL权限,会这将在会用在监控中。
+
+下面的设置对所有的MySQL服务器都已经设置。
+
+    root@nagios:~# mysql -u root –p
+    ## MySQL root 密码 ##
+
+在MySQL服务器中创建'nagios@localhost'用户。
+
+    mysql> CREATE USER 'nagios'@'localhost' IDENTIFIED BY 'nagios-pass';
+    mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'localhost';
+
+创建'nagios@任意主机'用户。(LCTT 译注:实际上这两个是同一个用户,只是分别授权给localhost和任意主机的访问;因为它们所用的密码的同一个,修改任何一个,另外一个也相应变化。)
+
+    mysql> CREATE USER 'nagios'@'%' IDENTIFIED BY 'nagios-pass';
+    mysql> GRANT ALL PRIVILEGES ON *.* TO 'nagios'@'%';
+     
+    mysql> FLUSH PRIVILEGES;
+
+这使MySQL监听所有的网络接口,同样接受来自用户'nagios'的进入连接。
+
+请注意,这种修改可能有安全隐患,所以需要提示几点:
+
+- 这个设置将会暴露MySQL给所有的接口,包括外网。确保只有合法的网络访问是非常重要的。应该使用防火墙和TCP wrapper等过滤器。
+- MySQL用户‘nagios’的密码应该非常强。如果只有几台Nagios服务器,那么应该创建'nagios@服务器名'用户而不是任意用户的'nagios@%'。
+
+#### 对MySQL的Nagios配置 ####
+
+按如下配置来做一些调整。
+
+    root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg
+
+----------
+
+    define service{
+    use			generic-service
+    host_name		test-server-1
+    ;hostgroup can be used instead as well
+    
+    service_description		Check MYSQL via TCP port
+    check_command			check_tcp!3306
+            }
+    
+    define service{
+    use				generic-service
+    host_name			test-server-1
+    ;hostgroup can be used instead as well
+    
+    service_description	Check availability of database 'testDB'
+    check_command	check_mysql_database!nagios!nagios-pass!testDB
+    ;check_mysql!userName!userPassword!databaseName
+            }
+
+这样,Nagios就可以同时监控MySQL服务器及其数据库的可用性。
+
+### 监控Apache服务器 ###
+
+Nagios同样也可以监控Apache服务。
+
+#### Apache监控需要 ####
+
+- 监控apache服务是否可用
+
+这个任务非常简单因为Nagios有一个内置命令。
+
+    root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg
+
+----------
+
+    define service{
+    use			generic-service
+    host_name		test-server-1, test-server-2
+    service_description	Check Apache Web Server
+    check_command		check_http
+            }
+
+现在就非常简单了。
+
+### 监控DNS服务 ###
+
+Nagios通过向DNS服务器查询一个完全限定域名(FQDN),或者使用dig工具来查询。默认用于查询的FQDN的是www.google.com,但是这个可以按需改变。按照下面的文件修改来完成这个任务。
+
+    root@nagios:~# vim /etc/nagios-plugins/config/dns.cfg
+
+----------
+
+    ## The -H portion can be modified to replace Google ##
+    define command{
+    command_name    check_dns
+    command_line    /usr/lib/nagios/plugins/check_dns -H www.google.com -s '$HOSTADDRESS$'
+    }
+
+编辑下面的行。
+
+    root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg
+
+----------
+
+    ## Nagios asks server-3 to resolve the IP for google.com ##
+    define service{
+    use                             generic-service
+    host_name                       test-server-3
+    service_description     Check DNS
+    check_command           check_dns
+            }
+    
+    ## Nagios asks server-3 to dig google.com ##
+    define service{
+    use                             generic-service
+    host_name                       test-server-3
+    service_description     Check DNS via dig
+    check_command           check_dig!www.google.com
+            }
+
+### 监控邮件服务器 ###
+
+Nagios可以监控不同的邮件服务组件如SMTP、POP、IMAP和mailq。之前提过,server-2设置了Postfix邮件服务。Nagios将被配置来监控SMTP和邮件队列。
+
+    root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg
+
+----------
+
+    define service{
+    use                     generic-service
+    host_name               test-server-2
+    service_description     Check SMTP
+    check_command           check_smtp
+            }
+    
+    define service{
+    use                     generic-service
+    host_name               test-server-2
+    service_description     Check Mail Queue
+    check_command           check_mailq_postfix!50!100
+    					;warning at 50, critical at 100
+            }
+
+下面的截屏显示了目前配置监控服务的概览。
+
+![](http://farm8.staticflickr.com/7333/11428095956_2868bbdfcc_z.jpg)
+
+### 基于端口自定义监控程序 ###
+
+让我们假设如下定制程序同样运行在网络中,监听着一个特定的端口。
+
+- 测试1号服务器:定制程序(TCP端口 12345)
+
+做一些小的调整,Nagios也可以帮助我们监控这个程序。
+
+    root@nagios:~# vim /etc/nagios3/conf.d/services_nagios2.cfg
+
+----------
+
+    define service{
+    use                     generic-service
+    host_name               test-server-1
+    service_description     Check server 1 custom application
+    check_command           check_tcp!12345
+            }
+
+在结束之前的提示,Nagios可以监控网络很多其他的方面。存储在/etc/nagios-plugins/config/中的脚本为Nagios提供了很棒的能力。
+
+一些Nagios提供的脚本被仅限于本地服务器,比如,服务器负载、进程并发数量、登录用户数量等。这些检查可以提供Nagios服务器内有用的信息。
+
+希望这篇文章对你有用。
+
+--------------------------------------------------------------------------------
+
+via: http://xmodulo.com/monitor-common-services-nagios.html
+
+作者:[Sarmed Rahman][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://xmodulo.com/author/sarmed
+[1]:https://linux.cn/article-2436-1.html
\ No newline at end of file
diff --git a/published/20150604 How to access SQLite database in Perl.md b/published/20150604 How to access SQLite database in Perl.md
new file mode 100644
index 0000000000..82283b9857
--- /dev/null
+++ b/published/20150604 How to access SQLite database in Perl.md	
@@ -0,0 +1,173 @@
+如何用Perl访问SQLite数据库
+================================================================================
+SQLite是一个零配置、无服务端、基于文件的事务型数据库系统。由于它的轻量级,自包含和紧凑的设计,所以当你想要集成数据库到你的程序中时,SQLite是一个非常不错的选择。在这篇文章中,我会展示如何用Perl脚本来创建和访问SQLite数据库。我演示的Perl代码片段是完整的,所以你可以很简单地修改并集成到你的项目中。
+
+![](https://farm1.staticflickr.com/552/18444614631_9e7fce8243_c.jpg)
+
+### 访问SQLite的准备 ###
+
+我会使用SQLite DBI Perl驱动来连接到SQLite3。因此你需要在Linux中安装它(和SQLite3一起)。
+
+**Debian、 Ubuntu 或者 Linux Mint**
+
+    $ sudo apt-get install sqlite3 libdbd-sqlite3-perl
+
+**CentOS、 Fedora 或者 RHEL**
+
+    $ sudo yum install sqlite perl-DBD-SQLite
+
+安装后,你可以检查SQLite驱动可以通过下面的脚本访问到。
+
+    #!/usr/bin/perl
+    
+    my @drv = DBI->available_drivers();
+    print join("\n", @drv), "\n";
+
+如果你运行脚本,你应该会看见下面的输出。
+
+    DBM
+    ExampleP
+    File
+    Gofer
+    Proxy
+    SQLite
+    Sponge
+
+### Perl SQLite 访问示例 ###
+
+下面就是Perl访问SQLite的示例。这个Perl脚本会演示下面这些SQLite数据库的常规管理。
+
+- 创建和连接SQLite数据库
+- 在SQLite数据库中创建新表
+- 在表中插入行
+- 在表中搜索和迭代行
+- 在表中更新行
+- 在表中删除行
+
+-
+
+    use DBI;
+    use strict;
+     
+    # 定义数据库名称和驱动
+    my $driver   = "SQLite";
+    my $db_name = "xmodulo.db";
+    my $dbd = "DBI:$driver:dbname=$db_name";
+     
+    # sqlite 没有用户名密码的概念
+    my $username = "";
+    my $password = "";
+     
+    # 创建并连接到数据库
+    # 以下创建的文件名为 xmodulo.db
+    my $dbh = DBI->connect($dbd, $username, $password, { RaiseError => 1 })
+                          or die $DBI::errstr;
+    print STDERR "Database opened successfully\n";
+     
+    # 创建表
+    my $stmt = qq(CREATE TABLE IF NOT EXISTS NETWORK
+                 (ID INTEGER PRIMARY KEY     AUTOINCREMENT,
+                  HOSTNAME       TEXT    NOT NULL,
+                  IPADDRESS      INT     NOT NULL,
+                  OS             CHAR(50),
+                  CPULOAD        REAL););
+    my $ret = $dbh->do($stmt);
+    if($ret < 0) {
+       print STDERR $DBI::errstr;
+    } else {
+       print STDERR "Table created successfully\n";
+    }
+     
+    # 插入三行到表中
+    $stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD)
+               VALUES ('xmodulo', 16843009, 'Ubuntu 14.10', 0.0));
+    $ret = $dbh->do($stmt) or die $DBI::errstr;
+     
+    $stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD)
+               VALUES ('bert', 16843010, 'CentOS 7', 0.0));
+    $ret = $dbh->do($stmt) or die $DBI::errstr;
+     
+    $stmt = qq(INSERT INTO NETWORK (HOSTNAME,IPADDRESS,OS,CPULOAD)
+               VALUES ('puppy', 16843011, 'Ubuntu 14.10', 0.0));
+    $ret = $dbh->do($stmt) or die $DBI::errstr;
+     
+    # 在表中检索行
+    $stmt = qq(SELECT id, hostname, os, cpuload from NETWORK;);
+    my $obj = $dbh->prepare($stmt);
+    $ret = $obj->execute() or die $DBI::errstr;
+     
+    if($ret < 0) {
+       print STDERR $DBI::errstr;
+    }
+    while(my @row = $obj->fetchrow_array()) {
+          print "ID: ". $row[0] . "\n";
+          print "HOSTNAME: ". $row[1] ."\n";
+          print "OS: ". $row[2] ."\n";
+          print "CPULOAD: ". $row[3] ."\n\n";
+    }
+     
+    # 更新表中的某行
+    $stmt = qq(UPDATE NETWORK set CPULOAD = 50 where OS='Ubuntu 14.10';);
+    $ret = $dbh->do($stmt) or die $DBI::errstr;
+     
+    if( $ret < 0 ) {
+       print STDERR $DBI::errstr;
+    } else {
+       print STDERR "A total of $ret rows updated\n";
+    }
+     
+    # 从表中删除某行
+    $stmt = qq(DELETE from NETWORK where ID=2;);
+    $ret = $dbh->do($stmt) or die $DBI::errstr;
+     
+    if($ret < 0) {
+       print STDERR $DBI::errstr;
+    } else {
+       print STDERR "A total of $ret rows deleted\n";
+    }
+     
+    # 断开数据库连接
+    $dbh->disconnect();
+    print STDERR "Exit the database\n";
+
+上面的Perl脚本运行成功后会创建一个叫“xmodulo.db”的数据库文件,并会有下面的输出。
+
+    Database opened successfully
+    Table created successfully
+    ID: 1
+    HOSTNAME: xmodulo
+    OS: Ubuntu 14.10
+    CPULOAD: 0
+    
+    ID: 2
+    HOSTNAME: bert
+    OS: CentOS 7
+    CPULOAD: 0
+    
+    ID: 3
+    HOSTNAME: puppy
+    OS: Ubuntu 14.10
+    CPULOAD: 0
+    
+    A total of 2 rows updated
+    A total of 1 rows deleted
+    Exit the database
+
+### 错误定位 ###
+
+如果你尝试没有安装SQLite DBI驱动的情况下使用Perl访问SQLite的话,你会遇到下面的错误。你必须按开始说的安装DBI驱动。
+
+    Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./script.pl line 3.
+    BEGIN failed--compilation aborted at ./script.pl line 3.
+
+--------------------------------------------------------------------------------
+
+via: http://xmodulo.com/access-sqlite-database-perl.html
+
+作者:[Dan Nanni][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://xmodulo.com/author/nanni
diff --git a/published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md b/published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md
new file mode 100644
index 0000000000..93a8868639
--- /dev/null
+++ b/published/20150610 How to Manipulate Filenames Having Spaces and Special Characters in Linux.md	
@@ -0,0 +1,432 @@
+Linux 下如何处理包含空格和特殊字符的文件名
+================================================================================
+我们经常会看到文件名和文件夹名。大多数时候文件/文件夹的名字和内容相关并以数字和字母开头。字母加数字的文件名最常见,应用也很广泛,但总会需要处理一些包含特殊字符的文件名/文件夹名。
+
+** 注意 **:我们可能有各种类型的文件,但是为了简单以及方便实现,在本文中我们只用文本文件(.txt)做演示。
+
+最常见的文件名例子:
+
+    abc.txt
+    avi.txt
+    debian.txt
+    ...
+
+数字文件名例子:
+
+    121.txt
+    3221.txt
+    674659.txt
+    ...
+
+字母数字文件名例子:
+
+    eg84235.txt
+    3kf43nl2.txt
+    2323ddw.txt
+    ...
+
+包含特殊字符的文件名的例子,并不常见:
+
+    #232.txt
+    #bkf.txt
+    #bjsd3469.txt
+    #121nkfd.txt
+    -2232.txt
+    -fbjdew.txt
+    -gi32kj.txt
+    --321.txt
+    --bk34.txt
+    ...
+
+一个显而易见的问题是 - 在这个星球上有谁会创建和处理包含井号`(#)`,分号`(;)`,破折号`(-)`或其他特殊字符的文件/文件夹啊。
+
+我和你想的一样,这种文件名确实不常见,不过在你必须得处理这种文件名的时候你的 shell 也不应该出错或罢工。而且技术上来说,Linux 下的一切比如文件夹、驱动器或其他所有的都被当作文件处理。
+
+### 处理名字包含破折号(-)的文件 ###
+
+创建以破折号`(-)`开头的文件,比如 -abx.txt。
+
+    $ touch -abc.txt
+
+#### 测试输出 ####
+
+    touch: invalid option -- 'b'
+    Try 'touch --help' for more information.
+
+出现上面错误的原因是,shell 把破折号`(-)`之后的内容认作参数了,而很明显没有这样的参数,所以报错。
+
+要解决这个问题,我们得告诉 Bash shell(是的,这里以及本文后面的大多数例子都是基于 BASH 环境)不要将特殊字符(这里是破折号)后的字符解释为参数。
+
+有两种方法解决这个错误:
+
+    $ touch -- -abc.txt		[方法 #1]
+    $ touch ./-abc.txt		[方法 #2]
+
+你可以通过运行命令 ls 或 [ls -l][1] 列出详细信息来检查通过上面两种方式创建的文件。
+
+    $ ls -l
+    
+    total 0
+    -rw-r--r-- 1 avi avi 0 Jun  8 11:05 -abc.txt
+
+要编辑上述文件可以这样:
+
+    $ nano -- -abc.txt 
+    或者 
+    $ nano ./-abc.txt 
+
+**注意**:你可以将 nano 替换为任何其他你喜欢的编辑器比如说 vim:
+
+    $ vim -- -abc.txt 
+    或者 
+    $ vim ./-abc.txt 
+
+如果只是简单地移动文件可以这样:
+
+    $ mv -- -abc.txt -a.txt
+    或者
+    $ mv -- -a.txt -abc.txt
+
+删除这种文件,可以这样:
+
+    $ rm -- -abc.txt
+    或者
+    $ rm ./-abc.txt 
+
+如果一个目录下有大量这种名字包含破折号的文件,要一次全部删除的话,可以这样:
+
+    $ rm ./-*
+
+**重要:**
+
+1. 上面讨论的规则可以同样应用于名字中包含任意数量以及任意位置的连接符号的文件。就是说,-a-b-c.txt,ab-c.txt,abc-.txt,等等。
+
+2. 上面讨论的规则可以同样应用于名字中包含任意数量以及任意位置连接符号的文件夹,除了一种情况,在删除一个文件夹的时候你得这样使用`rm -rf`:
+
+    $ rm -rf -- -abc
+    或者
+    $ rm -rf ./-abc
+
+### 处理名字包含井号(#)的文件 ###
+
+符号`#`在 BASH 里有非常特别的含义。`#`之后的一切都会被认为是评论,因此会被 BASH 忽略。
+
+**通过例子来加深理解:**
+
+创建一个名字是 #abc.txt 的文件:
+
+    $ touch #abc.txt
+
+#### 测试输出 ####
+
+    touch: missing file operand
+    Try 'touch --help' for more information.
+
+出现上面错误的原因是,BASH 将 #abc.txt 解释为评论而忽略了。所以[命令 touch][2]没有收到任何文件作为参数,所以导致这个错误。
+
+要解决这个问题,你可能需要告诉 BASH 不要将 # 解释为评论。
+
+    $ touch ./#abc.txt
+    或者
+    $ touch '#abc.txt'
+
+检查刚创建的文件:
+
+    $ ls -l
+    
+    total 0
+    -rw-r--r-- 1 avi avi 0 Jun  8 12:14 #abc.txt
+
+现在创建名字中除了开头的其他地方包含 # 的文件。
+
+    $ touch ./a#bc.txt
+    $ touch ./abc#.txt    
+    或者
+    $ touch 'a#bc.txt'
+    $ touch 'abc#.txt'
+
+运行 ‘ls -l‘ 来检查:
+
+    $ ls -l
+    
+    total 0
+    -rw-r--r-- 1 avi avi 0 Jun  8 12:16 a#bc.txt
+    -rw-r--r-- 1 avi avi 0 Jun  8 12:16 abc#.txt
+
+如果同时创建两个文件(比如 a 和 #bc)会怎么样:
+
+    $ touch a.txt #bc.txt
+
+检查刚创建的文件:
+
+    $ ls -l
+    
+    total 0
+    -rw-r--r-- 1 avi avi 0 Jun  8 12:18 a.txt
+
+很明显上面的例子中只创建了文件 `a` 而文件 `#bc` 被忽略了。对于上面的情况我们可以这样做,
+
+    $ touch a.txt ./#bc.txt
+    或者
+    $ touch a.txt '#bc.txt'
+
+检查一下:
+
+    $ ls -l
+    
+    total 0
+    -rw-r--r-- 1 avi avi 0 Jun  8 12:20 a.txt
+    -rw-r--r-- 1 avi avi 0 Jun  8 12:20 #bc.txt
+
+可以这样移动文件:
+
+    $ mv ./#bc.txt ./#cd.txt
+    或者
+    $ mv '#bc.txt' '#cd.txt'
+
+这样拷贝:
+
+    $ cp ./#cd.txt ./#de.txt
+    或者
+    $ cp '#cd.txt' '#de.txt'
+
+可以使用你喜欢的编辑器来编辑文件:
+
+    $ vi ./#cd.txt
+    或者
+    $ vi '#cd.txt'
+
+    $ nano ./#cd.txt
+    或者
+    $ nano '#cd.txt'
+
+这样删除:
+
+    $ rm ./#bc.txt 
+    或者
+    $ rm '#bc.txt'
+
+要删除所有以井号(#)开头的文件,可以这样:
+
+    # rm ./#*
+
+### 处理名字包含分号(;)的文件 ###
+
+如果你还不知道的话,分号在 BASH 里起到命令分隔的作用,其他 shell 可能也是一样的。分号作为分隔符可以让你一次执行几个命令。你碰到过名字包含分号的文件吗?如果没有的话,这里有例子。
+
+创建一个名字包含分号的文件。
+
+    $ touch ;abc.txt
+
+#### 测试输出 ####
+
+    touch: missing file operand
+    Try 'touch --help' for more information.
+    bash: abc.txt: command not found
+
+出现上面错误的原因是,在运行上面命令的时候 BASH 会把 touch 解释为一个命令但是在分号前没有任何文件参数,所以报告错误。然后报告的另一个错误找不到命令 `abc.txt`,只是因为在分号后 BASH 会期望另一个新的命令,而 `abc.txt` 并不是一个命令。
+
+要解决这个问题,我们得告诉 BASH 不要将分号解释为命令分隔符,例如:
+
+    $ touch ./';abc.txt'
+    或者
+    $ touch ';abc.txt'
+
+**注意**:我们将文件名用单引号 '' 包含起来。这样可以告诉 BASH 分号 ; 是文件名的一部分而不是命令分隔符。
+
+对名字包含分号的文件和文件夹的其他操作(就是,拷贝、移动、删除)可以直接将名字用单引号包含起来就好了。
+
+### 处理名字包含其他特殊字符的文件/文件夹 ###
+
+#### 文件名包含加号 (+) ####
+
+不需要任何特殊处理,按平时的方式做就好了,比如下面测试的文件名。
+
+    $ touch +12.txt 
+
+#### 文件名包含美元符 ($) ####
+
+你需要将文件名用单引号括起来,像处理分号那样的方式。然后就很简单了。
+
+    $ touch '$12.txt'
+
+#### 文件名包含百分号 (%) ####
+
+不需要任何特殊处理,当作一个普通文件就可以了。
+
+    $ touch %12.txt
+
+#### 文件名包含星号 (*) ####
+
+需要用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改。)
+
+    $ touch *12.txt
+
+注意:当你需要删除星号开头的文件时,千万不要用类似下面的命令。
+
+    $ rm *
+    或者
+    $ rm -rf *
+
+而是用这样的命令,(LCTT 译注:此处原文有误,已修改)
+
+    $ rm ./'*.txt'
+
+#### 文件名包含叹号 (!) ####
+
+只要将文件名用单引号括起来,其他的就一样了。
+
+    $ touch '!12.txt'
+
+#### 文件名包含小老鼠 (@) ####
+
+没有什么特别的,可以将名字包含小老鼠的文件当作普通文件。
+
+    $ touch '@12.txt'
+
+#### 文件名包含 ^ ####
+
+不需要特殊处理。可以将名字包含 ^ 的文件当作普通文件。
+
+    $ touch ^12.txt
+
+#### 文件名包含 (&) ####
+
+将文件名用单引号括起来,然后就可以操作了。
+
+    $ touch '&12.txt'
+
+#### 文件名包含括号 () ####
+
+如果文件名包含括号,你需要将文件名用单引号括起来。
+
+    $ touch '(12.txt)'
+
+#### 文件名包含花括号 {} ####
+
+用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改)
+
+    $ touch '{12.txt}'
+
+#### 文件名包含尖括号 <> ####
+
+名字包含尖括号的文件需要用单引号括起来。
+
+    $ touch '<12.txt>'
+
+#### 文件名包含方括号 [ ] ####
+
+用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改)
+
+    $ touch '[12.txt]'
+
+#### 文件名包含下划线 (_) ####
+
+这个非常普遍,不需要特殊对待。当作普通文件随意处理。
+
+    $ touch _12.txt
+
+#### 文件名包含等号 (=) ####
+
+用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改)
+
+    $ touch '=12.txt'
+
+#### 处理反斜杠 (\) ####
+
+反斜杠会告诉 shell 忽略后面字符的特殊含义。你必须将文件名用单引号括起来,就像处理分号那样。其他的就没什么了。
+
+    $ touch '\12.txt'
+
+#### 包含斜杠的特殊情形 ####
+
+除非你的文件系统有问题,否则你不能创建名字包含斜杠的文件。没办法转义斜杠。
+
+所以如果你能创建类似 ‘/12.txt’ 或者 ‘b/c.txt’ 这样的文件,那要么你的文件系统有问题,或者支持 Unicode,这样你可以创建包含斜杠的文件。只是这样并不是真的斜杠,而是一个看起来像斜杠的 Unicode 字符。
+
+#### 文件名包含问号 (?) ####
+
+用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改)
+
+    $ touch '?12.txt'
+
+#### 文件名包含点 (.) ####
+
+在 Linux 里以点 `(.)` 开头的文件非常特别,被称为点文件。它们通常是隐藏的配置文件或系统文件。你需要使用 ls 命令的 ‘-a‘ 或 ‘-A‘ 开关来查看这种文件。
+
+创建,编辑,重命名和删除这种文件很直接。
+
+    $ touch .12.txt
+
+注意:在 Linux 里你可能碰到名字包含许多点 `(.)` 的文件。不像其他操作系统,文件名里的点并不意味着分隔名字和扩展后缀。你可以创建名字包含多个点的文件:
+
+    $ touch 1.2.3.4.5.6.7.8.9.10.txt
+
+检查一下:
+
+    $ ls -l
+    
+    total 0
+    -rw-r--r-- 1 avi avi 0 Jun  8 14:32 1.2.3.4.5.6.7.8.9.10.txt
+
+#### 文件名包含逗号 (,) ####
+
+你可以在文件名中使用逗号,可以有任意多个而不用特殊对待。就像平时普通名字文件那样处理。
+
+    $ touch ,12.txt
+    或者
+    $ touch ,12,.txt
+
+#### 文件名包含冒号 (:) ####
+
+用单引号括起来或使用反斜杠转义。(LCTT 译注:此处原文有误,已修改)
+
+    $ touch ':12.txt'
+    或者
+    $ touch ':12:.txt'
+
+#### 文件名包含引号(单引号和双引号) ####
+
+要在文件名里使用引号,我们需要使用交替规则。例如,如果你需要在文件名里使用单引号,那就用双引号把文件名括起来。而如果你需要在文件名里使用双引号,那就用单引号把文件名括起来。(LCTT 译注:或者如果单引号和双引号混杂的情况,你也可以用反斜杠转义。)
+
+    $ touch "15'.txt"
+    
+    以及
+    
+    $ touch '15".txt'
+
+#### 文件名包含波浪号 (~) ####
+
+Linux 下一些像 emacs 这样的文本编辑器在编辑文件的时候会创建备份文件。这个备份文件的名字是在原文件名后面附加一个波浪号。你可以在文件名任意位置使用波浪号,例如:
+
+    $ touch ~1a.txt
+    或者
+    $touch 2b~.txt
+
+#### 文件名包含空格 ####
+
+创建名字的字符/单词之间包含空格的文件,比如 “hi my name is avishek.txt”。
+
+最好不要在文件名里使用空格,如果你必须要分隔可读的名字,可以使用下划线或横杠。不过,你还是需要创建这样的文件的话,你可以用反斜杠来转义下一个字符。要创建上面名字的文件可以这样做。
+
+    $ touch hi\ my\ name\ is\ avishek.txt
+    
+    hi my name is avishek.txt
+
+我已经尝试覆盖你可能碰到的所有情况。上面大多数测试都在 BASH Shell 里完成,可能在其他 shell 下会有差异。
+
+如果你觉得我遗漏了什么(这很正常也符合人性),请把你的建议发表到下面的评论里。保持联系,多评论。不要走开!求点赞求分享求扩散!
+
+--------------------------------------------------------------------------------
+
+via: http://www.tecmint.com/manage-linux-filenames-with-special-characters/
+
+作者:[Avishek Kumar][a]
+译者:[zpl1025](https://github.com/zpl1025)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.tecmint.com/author/avishek/
+[1]:https://linux.cn/article-5349-1.html
+[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/
diff --git a/published/20150610 How to secure your Linux server.md b/published/20150610 How to secure your Linux server.md
new file mode 100644
index 0000000000..e6fcb4449a
--- /dev/null
+++ b/published/20150610 How to secure your Linux server.md	
@@ -0,0 +1,239 @@
+Linux 服务器安全技巧
+================================================================================
+
+毋庸置疑,对于系统管理员,提高服务器的安全性是最重要的事情之一。因此,也就有了许多针对这个话题而生的文章、博客和论坛帖子。
+
+一台服务器由大量功能各异的部件组成,这一点使得很难根据每个人的需求去提供定制的解决方案。这篇文章尽可能涵盖一些有所裨益的小技巧来帮助管理员保证服务器和用户安全。
+
+有一些常识是每个系统管理员都应该烂熟于心的,所以下面的几点在本文将不会提及:
+
+- 务必保证系统是**最新的**
+- 经常更换密码 - 使用数字、字母和非字母的符号组合
+- 给予用户**最小**的权限,满足他们日常使用所需即可
+- 只安装那些真正需要的软件包
+
+下面是一些更有意思的内容:
+
+### 更改SSH默认端口 ###
+
+在搭建好一台全新的服务器后要做的第一件事情就是更改SSH的默认端口。这个小小的改动能够使你的服务器避免受到成千上万的暴力攻击(LCTT 译注:不更改默认端口相当于黑客们知道你家的门牌号,这样他们只需要一把一把的试钥匙就可能打开你家的锁)。
+
+要更改默认的SSH端口,先打开sshd_config文件:
+
+    sudo vim /etc/ssh/sshd_config
+
+找到下面这行:
+
+    #Port 22
+
+“#”号表示这行是注释。首先删除#号,然后把端口号改成目的端口。端口号不能超过65535,确保要指定的端口号没有被系统或其它服务占用。建议在[维基百科]上查看常用端口号列表。在本文中,使用这个端口号:
+
+    Port 16543
+
+然后保存并关闭文件,等待更改生效。
+
+接下来的一步是:
+
+### 使用SSH密钥认证 ###
+
+在通过SSH访问服务器时,使用SSH密钥进行认证是尤其重要的。这样做为服务器增加了额外的保护,确保只有那些拥有密钥的人才能访问服务器。
+
+在本地机器上运行下面命令以生成SSH密钥:
+
+    ssh-keygen -t rsa
+
+你会看到下面的输出,询问要将密钥写到哪一个文件里,并且设置一个密码:
+
+    Generating public/private rsa key pair.
+    Enter file in which to save the key (/root/.ssh/id_rsa): my_key
+    Enter passphrase (empty for no passphrase): 
+    Enter same passphrase again: 
+    Your identification has been saved in my_key.
+    Your public key has been saved in my_key.pub.
+    The key fingerprint is:
+    SHA256:MqD/pzzTRsCjZb6mpfjyrr5v1pJLBcgprR5tjNoI20A
+
+完成之后,就得到两个文件:
+
+my_key
+
+my_key.pub
+
+接下来把my\_key.pub拷贝到~/.ssh/authorized\_key中
+
+    cp my_key.pub ~/.ssh/authorized_keys
+
+然后使用下面命令将密钥上传到服务器:
+
+    scp -P16543 authorized_keys user@yourserver-ip:/home/user/.ssh/
+
+至此,你就可以从这台本地机器上无密码地访问服务器了。
+
+### 关闭SSH的密码认证 ###
+
+既然已经有了SSH密钥,那么关闭SSH的密码认证就会更安全了。再次打开并编辑sshd_config,按如下设置:
+
+    ChallengeResponseAuthentication no
+    PasswordAuthentication no
+    UsePAM no
+
+### 关闭Root登录 ###
+
+下面关键的一步是关闭root用户的直接访问,而使用sudo或su来执行管理员任务。首先需要添加一个有root权限的新用户,所以编辑这个路径下的sudoers文件:
+
+    /etc/sudoers/
+
+推荐使用如**visudo**这样的命令编辑该文件,因为它会在关闭文件之前检查任何可能出现的语法错误。当你在编辑文件时出错了,这就很有用了。
+
+接下来赋予某个用户root权限。在本文中,使用用户**sysadmin**。确保在编辑后这个文件时使用的用户是系统已有的用户。找到下面这行:
+
+    root ALL=(ALL) ALL
+
+拷贝这行,然后粘贴在下一行,然后把root更改为“sysadmin”,如下所示:
+
+    root ALL=(ALL) ALL
+    sysadmin ALL=(ALL) ALL
+
+现在解释一下这行的每一个选项的含义:
+
+    (1) root  (2)ALL=(3)(ALL) (4)ALL
+
+(1) 指定用户
+
+(2) 指定用户使用sudo的终端
+
+(3) 指定用户可以担任的用户角色
+
+(4) 这个用户可以使用的命令
+
+(LCTT 译注:所以上面的配置是意思是:root 用户可以在任何终端担任任何用户,执行任何命令。)
+
+使用这个配置可以给用户访问一些系统工具的权限。
+
+这时,可以放心保存文件了。
+
+为了关闭通过SSH直接访问root,需要再次打开**sshd_config**,找到下面这行:
+
+    #PermitRootLogin yes
+
+更改为:
+
+    PermitRootLogin no
+
+然后保存文件,重启sshd守护进程使改动生效。执行下面命令即可:
+
+    sudo /etc/init.d/sshd restart
+
+### 设置防火墙 ###
+
+防火墙有助于过滤出入端口和阻止使用暴力法的登录尝试。我倾向于使用SCF(Config Server Firewall)这个强力防火墙。它使用了iptables,易于管理,而且对于不擅于输入命令的用户提供了web界面。
+
+要安装CSF,先登录到服务器,切换到这个目录下:
+
+    cd /usr/local/src/
+
+然后以root权限执行下面命令:
+
+    wget https://download.configserver.com/csf.tgz
+    tar -xzf csf.tgz
+    cd csf
+    sh install.sh
+
+只需等待安装程序完成,然后编辑CSF的配置文件:
+
+    /etc/csf/csf.conf
+
+默认情况下CSF是以测试模式运行。通过将“TESTING”的值设置成0,切换到product模式。
+
+    TESTING = "0"
+
+下面要设置的就是服务器上允许通过的端口。在csf.conf中定位到下面的部分,根据需要修改端口:
+
+    # 允许入站的 TCP 端口
+    TCP_IN = "20,21,25,53,80,110,143,443,465,587,993,995,16543"
+    # 允许出站的 TCP 端口
+    TCP_OUT = "20,21,22,25,53,80,110,113,443,587,993,995,16543"
+    # 允许入站的 UDP 端口
+    UDP_IN = "20,21,53"
+    # 允许出站的 UDP 端口
+    # 要允许发出 traceroute 请求,请加 33434:33523 端口范围到该列表 
+    UDP_OUT = "20,21,53,113,123"
+
+请根据需要逐一设置,推荐只使用那些需要的端口,避免设置对端口进行大范围设置。此外,也要避免使用不安全服务的不安全端口。比如只允许端口465和587来发送电子邮件,取代默认的SMTP端口25。(LCTT 译注:前提是你的邮件服务器支持 SMTPS)
+
+**重要**:千万不要忘记允许自定义的 ssh 端口。
+
+允许你的IP地址通过防火墙,而绝不被屏蔽,这一点很重要。IP地址定义在下面的文件中:
+
+    /etc/csf/csf.ignore
+
+被屏蔽了的IP地址会出现在这个文件中:
+
+    /etc/csf/csf.deny
+
+一旦完成更改,使用这个命令重启csf:
+
+    sudo /etc/init.d/csf restart
+
+下面是在某台服务器上的csf.deny文件的部分内容,来说明CSF是很有用的:
+
+    211.216.48.205 # lfd: (sshd) Failed SSH login from 211.216.48.205 (KR/Korea, Republic of/-): 5 in the last 3600 secs - Fri Mar 6 00:30:35 2015
+    103.41.124.53 # lfd: (sshd) Failed SSH login from 103.41.124.53 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 01:06:46 2015
+    103.41.124.42 # lfd: (sshd) Failed SSH login from 103.41.124.42 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 01:59:04 2015
+    103.41.124.26 # lfd: (sshd) Failed SSH login from 103.41.124.26 (HK/Hong Kong/-): 5 in the last 3600 secs - Fri Mar 6 02:48:26 2015
+    109.169.74.58 # lfd: (sshd) Failed SSH login from 109.169.74.58 (GB/United Kingdom/mail2.algeos.com): 5 in the last 3600 secs - Fri Mar 6 03:49:03 2015
+
+可以看到,尝试通过暴力法登录的IP地址都被屏蔽了,真是眼不见心不烦啊!
+
+### 锁住账户 ###
+
+如果某个账户在很长一段时间内都不会被使用了,那么可以将其锁住以防止其它人访问。使用如下命令:
+
+    passwd -l accountName
+
+当然,这个账户依然可以被root用户使用(LCTT 译注:可用 su 切换为该账号)。
+
+### 了解服务器上的服务 ###
+
+服务器的本质是为各种服务提供访问功能。使服务器只运行所需的服务,关闭没有使用的服务。这样做不仅会释放一些系统资源,而且也会使服务器变得更加安全。比如,如果只是运行一个简单的服务器,显然不需要X显示或者桌面环境。如果不需要Windows网络共享功能,则可以放心关闭Samba。
+
+使用下面的命令能查看伴随系统启动而启动的服务:
+
+    chkconfig --list | grep "3:on"
+
+如果系统运行了**systemd**,执行这条命令:
+
+    systemctl list-unit-files --type=service | grep enabled
+
+然后使用下面的命令关闭服务:
+
+    chkconfig service off
+    或
+    systemctl disable service
+
+在上面的例子中,把“service”替换成真正想要停止的服务名称。实例如下:
+
+    chkconfig httpd off
+    或
+    systemctl disable httpd
+
+### 小结 ###
+
+这篇文章的目的是涵盖一些通用的安全步骤以便帮助你保护服务器。你可以采取更多方式去增强对服务器的保护。请记住保证服务器安全是你的责任,在维护服务器安全时尽量做出明智的选择,尽管并没有什么容易的方式去完成这件事情,而建立“完善的”安全需要花费大量的时间和测试直到达到想要的结果。
+
+--------------------------------------------------------------------------------
+
+via: http://www.linuxveda.com/2015/06/03/secure-linux-server/
+
+作者:[Marin Todorow][a]
+译者:[KayGuoWhu](https://github.com/KayGuoWhu)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.linuxveda.com/author/marin_todorov/
+[1]:http://en.wikipedia.org/wiki/Port_%28computer_networking%29#Common_port_numbers
+
+
+
+
diff --git a/published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md b/published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md
new file mode 100644
index 0000000000..b537db3854
--- /dev/null
+++ b/published/20150610 watch--Repeat Linux or Unix Commands Regular Intervals.md	
@@ -0,0 +1,129 @@
+watch:定期重复Linux / Unix命令
+================================================================================
+服务器管理员需要维护系统并保持更新和安全。每天需要运行大量的指令。有些系统进程会记录日志。这些日志不断更新。为了检查这些更新,需要重复地执行命令。比如,为了读取一个日志文件需要使用head、tail、cat等命令。这些命令需要重复地执行。而watch命令可以用于定期地执行一个命令。
+
+### Watch 命令 ###
+
+watch是一个简单的命令,只有几个选项。watch命令的基本语法是:
+
+    watch [-dhvt] [-n ] [--differences[=cumulative]] [--help] [--interval=] [--no-title] [--version] 
+
+watch命令默认每隔2秒执行后面参数给出的命令。这个时间根据的是命令执行结束到上次执行的间隔来算的。比如,watch命令可以用于监测日志更新,更新是在文件的后面追加新的内容,因此可以用tail命令来检测文件的更新(LCTT 译注:可以直接使用 `tail -f` 主动跟踪某个文件的更新,而不用使用 watch。)。这个命令会持续地运行直到你按下 `CTRL + C`回到提示符。
+
+### 例子 ###
+
+每两秒监测 errors/notices/warning 生成的情况。
+
+    watch tail /var/log/messages
+
+![tail messages](http://blog.linoxide.com/wp-content/uploads/2015/06/1.png)
+
+按指定的时间间隔监测磁盘的使用率。
+
+    watch df -h
+
+![df -h](http://blog.linoxide.com/wp-content/uploads/2015/06/2.png)
+
+对磁盘管理员而言,关注高I/O等待导致的磁盘操作尤其是mysql事务是很重要的。 
+
+    watch mysqladmin processlist
+
+![processlist](http://blog.linoxide.com/wp-content/uploads/2015/06/3.png)
+
+监测服务器负载和运行时间。
+
+    watch uptime
+
+![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png)
+
+监测exim给用户发送通知的队列大小。
+
+    watch exim -bpc
+
+![exim -bpc](http://blog.linoxide.com/wp-content/uploads/2015/06/9.png)
+
+### 1) 指定延迟 ###
+
+    watch [-n ] 
+
+命令默认运行的时间间隔可用-n改变,下面的命令会在5秒后运行后面的命令:
+
+    watch -n 5 date
+
+![date 5 seconds](http://blog.linoxide.com/wp-content/uploads/2015/06/4b.png)
+
+### 2) 连续输出比较###
+
+如果你使用-d选项,它会累次地高亮第一次和下一次命令之间输出的差别。
+
+    watch [-d or --differences[=cumulative]] 
+
+例子 1,用下面的命令连续地输出时间并观察高亮出来的不同部分。
+
+    watch -n 15 -d date
+
+第一次执行date的输出会被记录,15秒后会重复运行命令。
+
+![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6.png)
+
+在下一次执行时,可以看到输出除了被高亮的秒数从14到29之外其他的都一样。
+
+![Difference A](http://blog.linoxide.com/wp-content/uploads/2015/06/6b.png)
+
+例子 2,让我们来体验一下两个连续的“uptime”命令输出的不同。
+
+    watch -n 20 -d uptime
+
+![uptime](http://blog.linoxide.com/wp-content/uploads/2015/06/10.png)
+
+现在列出了时间和3个负载快照之间的不同。
+
+![10b](http://blog.linoxide.com/wp-content/uploads/2015/06/10b.png)
+
+### 3) 不带标题输出 ###
+
+如果你不希望显示更多关于延迟和实际命令的信息可以使用-t选项。
+
+    watch [-t or --no-title] 
+
+让我们看下下面例子命令的输出:
+
+    watch -t date
+
+![watch without title](http://blog.linoxide.com/wp-content/uploads/2015/06/7t.png)
+
+### Watch 帮助 ###
+
+可以在ssh中输入下面的命令来得到watch的简要帮助。
+
+    watch -h [or --help]
+
+![watch help](http://blog.linoxide.com/wp-content/uploads/2015/06/8h.png)
+
+### Watch 版本 ###
+
+在ssh终端中运行下面的命令来检查watch的版本。
+
+    watch -v [--version]
+
+![version](http://blog.linoxide.com/wp-content/uploads/2015/06/11.png)
+
+**不足**
+
+不幸的是,在终端大小调整时,屏幕不能在下次运行前重画。所有用--difference高亮的内容也会在更新时丢失。
+
+### 总结 ###
+
+watch对系统管理员而言是一个非常强大的工具,因为它可以用于监控、日志、运维、性能和系统运行时的吞吐量。人们可以非常简单地格式化和推延watch的输出。任何Linux命令/程序或脚本可以按照所需监测和连续输出。
+
+--------------------------------------------------------------------------------
+
+via: http://linoxide.com/linux-command/linux-watch-command/
+
+作者:[Aun Raza][a]
+译者:[geekpi](https://github.com/geekpi)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://linoxide.com/author/arunrz/
diff --git a/published/20150615 How to combine two graphs on Cacti.md b/published/20150615 How to combine two graphs on Cacti.md
new file mode 100644
index 0000000000..78e52a0639
--- /dev/null
+++ b/published/20150615 How to combine two graphs on Cacti.md	
@@ -0,0 +1,91 @@
+如何在 Cacti 中合并两幅图片
+================================================================================
+[Cacti][1] 是一个很棒的开源网络监视系统,它广泛使用于图形化地展示网络元素,例如带宽、存储、处理器和内存使用。使用它的基于Web 的界面,你可以轻松地创建和组织各种图表。然而,它默认并没有提供一些高级功能,例如合并图片、使用多个来源创建聚合图形、迁移 Cacti 到另一台服务器。使用 Cacti 的这些功能你还需要一些经验。在该教程中,我们会看到如何在将两幅 Cacti 图片合并为一幅。
+
+看看这个例子。在过去的 6 个月中,客户端 A 连接到了交换机 A 的端口 5。端口 5 发生了错误,因此客户端迁移到了端口 6。由于 Cacti 为每个接口/元素使用不同的图,客户端的带宽历史会分成端口 5 和端口 6。结果是对于一个客户端我们有两幅图片 - 一幅是 6 个月的旧数据,另一幅保存了后续的数据。
+
+在这种情况下,我们实际上可以合并两幅图片将旧数据加到新的图中,使得用一个单独的图为一个用户保存历史的和新数据。本教程将会解释如何做到这一点。
+
+Cacti 将每幅图片的数据保存在它自己的 RRD(round robin database,循环数据库)文件中。当请求一幅图片时,根据保存在对应 RRD 文件中的值生成图。在 Ubuntu/Debian 系统中,RRD 文件保存在 `/var/lib/cacti/rra`,在 CentOS/RHEL 系统中则是 `/var/www/cacti/rra`。
+
+合并图片背后的思想是更改这些 RRD 文件使得旧 RRD 文件中的值能追加到新的 RRD 文件中。
+
+### 情景 ###
+
+一个客户端的服务在 eth0 上运行了超过一年。由于硬件损坏,客户端迁移到了另一台服务器的 eth1 接口。我们想展示新接口的带宽,同时保留超过一年的历史数据。该客户端希望只在一幅图中显示。
+
+### 确定图的 RRD 文件 ###
+
+图合并的首个步骤是确定与图相关联的 RRD 文件。我们可以通过以调试模式打开图检查文件。要做到这点,在 Cacti 的菜单中: 控制台 > 管理图 > 选择图 > 打开图调试模式。
+
+#### 旧图: ####
+
+![](https://farm4.staticflickr.com/3853/18795518096_f50a78d082_c.jpg)
+
+#### 新图: ####
+
+![](https://farm4.staticflickr.com/3674/18634036918_5c4118c4b9_c.jpg)
+
+从样例输出(基于 Debian 系统)中,我们可以确定两幅图片的 RRD 文件:
+
+- **旧图**: /var/lib/cacti/rra/old_graph_traffic_in_8.rrd
+- **新图**: /var/lib/cacti/rra/new_graph_traffic_in_10.rrd 
+
+### 准备脚本 ###
+
+我们会用一个 [RRD 剪接脚本][2] 来合并两个 RRD 文件。下载该 PHP 脚本,并安装到 /var/lib/cacti/rra/rrdsplice.php (Debian/Ubuntu 系统) 或 /var/www/cacti/rra/rrdsplice.php (CentOS/RHEL 系统)。
+
+下一步,确认 Apache 用户拥有该文件。
+
+在 Debian 或 Ubuntu 系统中,运行下面的命令:
+
+    # chown www-data:www-data rrdsplice.php
+
+并更新 rrdsplice.php。查找下面的行:
+
+    chown($finrrd, "apache");
+
+用下面的语句替换:
+
+    chown($finrrd, "www-data");
+
+在 CentOS 或 RHEL 系统中,运行下面的命令即可:
+
+    # chown apache:apache rrdsplice.php
+
+### 合并两幅图 ###
+
+通过不带任何参数运行该脚本可以获得脚本的使用语法。
+
+    # cd /path/to/rrdsplice.php
+    # php rrdsplice.php 
+
+----------
+
+    USAGE: rrdsplice.php --oldrrd=file --newrrd=file --finrrd=file
+
+现在我们准备好合并两个 RRD 文件了。只需要指定旧 RRD 文件和新 RRD 文件的名称。我们会将合并后的结果重写到新 RRD 文件中。
+
+    # php rrdsplice.php --oldrrd=old_graph_traffic_in_8.rrd --newrrd=new_graph_traffic_in_10.rrd --finrrd=new_graph_traffic_in_10.rrd 
+
+现在旧 RRD 文件中的数据已经追加到了新 RRD 文件中。Cacti 会将任何新数据写到新 RRD 文件中。如果我们点击图,我们可以发现也已经添加了旧图的周、月、年记录。下面图表中的第二幅图显示了旧图的周记录。
+
+![](https://farm6.staticflickr.com/5493/18821787015_6730164068_b.jpg)
+
+总之,该教程显示了如何简单地将两幅 Cacti 图片合并为一幅。当服务迁移到另一个设备/接口,我们希望只处理一幅图片而不是两幅时,这个小技巧非常有用。该脚本非常方便,因为它可以不管源设备是不是相同都可以合并图片,例如 Cisco 1800 路由器和 Cisco 2960 交换机。
+
+希望这些能对你有所帮助。
+
+--------------------------------------------------------------------------------
+
+via: http://xmodulo.com/combine-two-graphs-cacti.html
+
+作者:[Sarmed Rahman][a]
+译者:[ictlyh](https://github.com/ictlyh)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://xmodulo.com/author/sarmed
+[1]:https://linux.cn/article-5746-1.html
+[2]:http://svn.cacti.net/viewvc/developers/thewitness/rrdsplice/rrdsplice.php
\ No newline at end of file
diff --git a/published/20150616 Linux Humor on the Command-line.md b/published/20150616 Linux Humor on the Command-line.md
new file mode 100644
index 0000000000..e998e31f05
--- /dev/null
+++ b/published/20150616 Linux Humor on the Command-line.md	
@@ -0,0 +1,127 @@
+Linux命令行中的幽默
+================================================================================
+图形桌面总是很养眼的,它增强了可视化体验,有时也能够提升了某些软件的功能,让软件变得更有趣。但是,在命令行下工作也不需要总是很古板,如果您想在命令行下寻找些乐趣,那么有很多命令给您带来趣味。
+
+Linux是个有趣的操作系统。它提供大量的小型开源工具,从平淡无奇的软件到稀奇古怪的应用。正是这些工具的功能和琳琅满目的选择帮助Linux脱颖而出。让我们一起来看看下面这七个小工具吧。
+
+### 七彩虹:lolcat ###
+
+![lolcat](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-lolcat.png)
+
+lolcat是一个用于将文件或标准输入连接到标准输出(类似常见的cat)的程序,但是它会为输出添加七彩的颜色。
+
+lolcat通常和其他诸如toilet或figlet等生成文本的应用结合使用。这个软件不应被误认为是一个或多个猫的图像的宏。
+
+lolcat由Moe编写。
+
+网址: [github.com][1]
+
+### 牛郎的牛:cowsay ###
+
+![cowsay](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-cowsay.png)
+
+cowsay是一个可配置的开源软件,它用ASCII码生成奶牛的图片,并可以在对话气泡中显示消息。cowsay是用Perl写的。
+
+cowsay并不仅仅只能显示奶牛。它能生成预先制作的图片或者其他动物,包括鸭子、考拉、麋鹿、小马、绵羊、剑龙和火鸡,以及奶酪、雪人和骷髅。
+
+有一个叫cowthink的应用,与对话的气泡不同,它能在生成奶牛的同时生成思考的气泡。
+
+功能包括:
+
+- 让脚本变得更有趣
+- Borg模式
+- 可以更改奶牛看起来的样子,比如让奶牛看起来贪婪、偏执、固执、疲倦、古怪、年轻等
+- 图形版变体:xcowsay
+
+网址: [nog.net][2]
+
+### 傻狗:doge ###
+
+![doge](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-doge.png)
+
+doge是一个简单的每日信息脚本,它基于有些愚蠢但很有趣的doge的梗。它随机的打印一些在语法上有误的句子,有时这些句子基于您电脑中的东西。
+
+doge是一个在2013年非常流行的互联网潮流元素(梗)。这个梗通常由一幅日本柴犬的图片和彩色的文字组成。这些文字故意用一种蹩脚的语气写成了一些互联网的独白。
+
+- 随机的用不同的颜色和蹩脚的英语写下随机的句子
+- 终端中的柴犬效果非常棒
+- 可以获得系统数据,比如主机名、运行中的程序、当前用户、$EDITOR
+- 如果您安装了lolcat,您可以用它作为点缀: `while true; do doge | lolcat -a -d 100 -s 100 -p 1; done`
+- 支持标准输入: `ls /usr/bin | doge` 将显示一些 /usr/bin下的可执行文件。哇噢,还有许多命令行的开关可以过滤词语以及控制词语的频率。
+
+网址: [github.com/thiderman/doge][3]
+
+### 水族箱:ASCIIQuarium ###
+
+![Asciiquarium](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-Asciiquarium.png)
+
+ASCIIQuarium是一个以ASCII码方式画出的水族馆/海洋动画。享受生活在您电脑中水底的奇妙生物吧。
+
+想运行ASCIIQuarium,您需要安装Perl的curses包以及Term::Animation模块。请使用`sudo apt-get install libcurses-perl`来安装前者,使用sudo cpan Term::Animation来安装后者。两个命令都需要在终端中运行。
+
+功能包括:
+
+- 五彩的鱼儿
+- 有趣的动画,包括钓鱼钩
+- 还有许多的天鹅、鸭子、海豚和船只
+
+网址: [www.robobunny.com][4]
+
+### 蒸汽机车:sl ###
+
+![sl](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-sl.png)
+
+sl是一个有趣的终端应用,它为那些意外的错将ls输成sl的用户显示一个动画。
+
+我打字通常非常草率,更喜欢速度而不是准确性。但错别字在命令行中是非常危险的。因此sl扮演了一个提醒者,提醒我们注意错误输入的这种坏习惯。它总是会让人咯咯的笑。
+
+功能包括:
+
+- 使用 -F, 火车在飞翔
+- 使用 -l, 显示一个小型的火车
+- 使用 -a, 看上去发生了意外
+
+网址: [github.com/mtoyoda/sl][5]
+
+### 火焰:aafire ###
+
+![aafire](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-aafire.png)
+
+aafire在终端中显示燃烧的ASCII火焰。它展示了aalib库的强大能力,一个ascii艺术库显示出来。
+
+网址: [aa-project.sourceforge.net/aalib][6]
+
+### 矩阵:CMatrix ###
+
+![CMatrix](http://www.linuxlinks.com/portal/content/reviews/Misc/Screenshot-CMatrix.png)
+
+CMatrix是一个基于ncurses的程序,它模拟《黑客帝国》(一部电影)中的画面。如果您在一个山洞里度过了上个15年,那么您可能不知道这部1999年的美国科幻电影,主角为 Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss, Hugo Weaving和 Joe Pantoliano。
+
+它可以在终端设置为132x300的情况下工作,并且可以以同样的速率进行滚动或者以用户定义的速度进行异步的滚动。
+
+功能包括:
+
+- 修改文本颜色
+- 使用粗体字符
+- 异步滚动
+- 使用老式的滚动效果
+- 屏幕保护程序模式
+
+网址: [www.asty.org/cmatrix][7]
+
+--------------------------------------------------------------------------------
+
+via: http://www.linuxlinks.com/article/20150614112018846/Humor.html
+
+译者:[wwy-hust](https://github.com/wwy-hust)
+校对:[Caroline](https://github.com/carolinewuyan)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[1]:https://github.com/busyloop/lolcat
+[2]:https://web.archive.org/web/20120225123719/http://www.nog.net/%7Etony/warez/cowsay.shtml
+[3]:https://github.com/thiderman/doge
+[4]:http://www.robobunny.com/projects/asciiquarium/html/
+[5]:https://github.com/mtoyoda/sl
+[6]:http://aa-project.sourceforge.net/aalib/
+[7]:http://www.asty.org/cmatrix/
diff --git a/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md b/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md
new file mode 100644
index 0000000000..6df604eac1
--- /dev/null
+++ b/published/20150617 Tor Browser--An Ultimate Web Browser for Anonymous Web Browsing in Linux.md	
@@ -0,0 +1,215 @@
+Tor浏览器:Linux下用于匿名Web浏览的终极浏览器
+================================================================================
+我们大多数人都在上网方面花费很多时间。上网使用的应用程序主要是浏览器,更确切的说是一个Web浏览器。我们在网络上的大部分活动要以客户端/服务器的方式登录,这个过程会包括IP地址、地理信息、搜索、活动以及许多潜在的信息,这些信息如果以其他方式被故意使用,会存在潜在的危险性。
+
+![在Linux中安装Tor浏览器](http://www.tecmint.com/wp-content/uploads/2014/04/Install-tor-browser-in-linux.jpg)
+
+*Tor浏览器:匿名浏览器*
+
+此外,美国国家安全局(NSA)这样的国际间谍机构会记录我们的数字足迹。更不必说受到控制的代理服务器也会被用来做为数据搜集服务器。并且大多数企业和公司不会允许您访问代理服务器(使您能保障自己的隐私)。
+
+因此,我们需要的最好是一个小型、独立、可携带的应用程序,它能达到匿名的效果。Tor浏览器便是这样的一个应用,它拥有上面提到的所有功能,甚至不止于此。
+
+这篇文章里我们会讨论Tor浏览器,它的功能、使用方式、领域、安装以及其他关于Tor浏览器的重要方面。
+
+### 什么是Tor浏览器? ###
+
+Tor是一个自由分发的应用软件,以BSD许可证发布,通过其安全可靠的洋葱式的结构,允许用户匿名的进行网络浏览。从前,由于它的结构和运作机制,Tor被称为‘洋葱路由器’。这个应用是由C语言写成的。
+
+#### Tor浏览器的功能 ####
+
+- 跨平台可用。例如,这个应用程序在Linux、Windows和Mac下都可用。
+- 在发送数据到因特网前进行复杂的数据加密。
+- 在客户端进行数据自动解密。
+- 它是火狐浏览器和Tor工程的结合。
+- 对服务器和网站提供匿名性。
+- 可以访问被限制的网站。
+- 无需暴露源IP便可以执行任务。
+- 可以将数据路由至/从防火墙后隐藏的服务和应用程序。
+- 便携性 - 可以直接从USB存储棒上运行一个预配置的web浏览器。无需本地安装。
+- 在x86和x86_64平台均可用
+- 可以配置为一个运行在“localhost”的“9050”端口上的“socks4a”代理来让FTP跑在Tor 上。
+- Tor拥有处理上千的中继和上百万用户的能力。
+
+#### Tor浏览器如何工作? ####
+
+Tor的工作方式基于洋葱路由的概念。洋葱路由的结构类似洋葱,它的每一层都嵌套在另一层里面,就像洋葱一样。这种嵌套的结构负责多次加密数据并将其通过虚拟电路进行发送。在客户端一侧每一层都在将他传递到下一层之前解密数据。最后一层在将原始数据传递到目的地前解密最里面一层的加密数据。
+
+在这个过程里,这种解密整个层的功能设计的如此高明以至于无法追踪IP以及用户的地理位置,因此可以限制任何人观察您访问站点的网络连接。
+
+所有这些过程看起来有些复杂,但用户使用Tor浏览器时没有必要担心。实际上,Tor浏览器的功能像其他浏览器一样(尤其是Mozilla的Firefox)。
+
+### 在Linux中安装Tor浏览器 ###
+
+就像上面讨论的一样,Tor浏览器在Linux和Windows以及Mac下都可用。用户需要根据系统和架构的不同在下面的链接处下载最新的版本(例如,Tor浏览器4.0.4)。
+
+- [https://www.torproject.org/download/download-easy.html.en][1]
+
+在下载Tor浏览器后,按说我们需要安装它,但是Tor的好处是我们不需要安装它。它能直接从随身设备中运行,并且该浏览器可以被预配置。这意味着插件和运行的特性可以完美的移植。
+
+下载打包文件(*.tar.xz)后我们需要解压它。
+
+**32位系统**
+
+    $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux32-4.0.4_en-US.tar.xz
+    $ tar xpvf tor-browser-linux32-4.0.4_en-US.tar.xz
+
+**64位系统**
+
+    $ wget https://www.torproject.org/dist/torbrowser/4.0.4/tor-browser-linux64-4.0.4_en-US.tar.xz
+    $ tar -xpvf tor-browser-linux64-4.0.4_en-US.tar.xz 
+
+**注意** : 在上面的命令中,我们使用‘$‘意味着这个压缩包应以普通用户而不是root用户来解压。我们强烈建议您不要以root用户解压和运行Tor浏览器。
+
+###开始使用Tor浏览器###
+
+在成功的解压后,我们便可以将解压后的浏览器移动到任何地方/USB存储设备中。并从解压的文件夹以非root用户直接运行‘start-tor-browser’。
+
+    $ cd tor-browser_en-US
+    $ ./start-tor-browser
+
+![开始使用Tor浏览器](http://www.tecmint.com/wp-content/uploads/2014/04/Starting-Tor-Network.jpg)
+
+*开始使用Tor浏览器*
+
+####1. 尝试连接到Tor网络####
+
+点击“连接”之后Tor将按照设置帮您做剩下的事情。**
+
+![连接到Tor网络](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Network-Settings.jpg)
+
+*连接到Tor网络*
+
+####2. 欢迎窗口/标签。####
+
+![Tor欢迎界面](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Welcome-Screen.png)
+
+*Tor欢迎界面*
+
+**3. 用Tor浏览器在Youtube上看视频**
+
+![在Youtube上看视频](http://www.tecmint.com/wp-content/uploads/2014/04/Watching-Video-on-Youtube.jpg)
+
+*在Youtube上看视频*
+
+####4. 打开银行网址以进行在线购物和交易####
+
+![浏览银行站点](http://www.tecmint.com/wp-content/uploads/2014/04/Browsing-Site.jpg)
+
+*浏览银行站点*
+
+####5. 浏览器显示我当前的代理IP####
+
+注意其中的文字为“Proxy Server detected”。**
+
+![检查IP地址](http://www.tecmint.com/wp-content/uploads/2014/04/Checking-IP-Address.jpg)
+
+*检查IP地址*
+
+**注意**: 每次您想运行Tor时,您需要在文本模式上运行Tor启动脚本。并且该终端在您运行Tor时会一直被占用。如何克服这些,并创建一个桌面/Dock栏图标呢?
+
+####6. 我们需要在解压的文件夹中创建`tor.desktop`####
+
+$ touch tor.desktop
+
+接着使用您喜欢的编辑器编辑这个文件,加入下面的文本,这里我使用nano。
+
+    $ nano tor.desktop 
+
+----------
+
+    #!/usr/bin/env xdg-open
+    [Desktop Entry]
+    Encoding=UTF-8
+    Name=Tor
+    Comment=Anonymous Browse
+    Type=Application
+    Terminal=false
+    Exec=/home/avi/Downloads/tor-browser_en-US/start-tor-browser
+    Icon=/home/avi/Downloads/tor-browser_en-US/Browser/browser/icons/mozicon128.png
+    StartupNotify=true
+    Categories=Network;WebBrowser;
+
+**注意**: 确保将上面的tor浏览器的路径替换为您的环境中的路径。
+
+####7. 一旦搞定后,您就可以双击`tor.desktop`文件来运行Tor浏览器了####
+
+您可能需要在第一次运行时信任该文件。
+
+![Tor应用启动器](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-Application-Launcher.jpg)
+
+*Tor应用启动器*
+
+####8. 一旦您选择了信任,请注意`tor.desktop`文件的图标则会改变###
+
+![Tor图标已改变](http://www.tecmint.com/wp-content/uploads/2014/04/Tor-icon-changed.jpg)
+
+*Tor图标已改变*
+
+####9. 您可以通过拖拽`tor.desktop`的图标在桌面和Dock栏中创建快捷方式####
+
+![在桌面添加Tor快捷方式](http://www.tecmint.com/wp-content/uploads/2014/04/Add-Tor-Shortcut-on-Desktop.jpg)
+
+*在桌面添加Tor快捷方式*
+
+####10. 关于Tor浏览器####
+
+![关于Tor浏览器](http://www.tecmint.com/wp-content/uploads/2014/04/About-Tor-Browser.jpg)
+
+*关于Tor浏览器*
+
+**注意**: 如果您在使用旧版本的Tor,您可以从上面的窗口更新它。
+
+#### 应用的可用性和领域 ####
+
+- 匿名使用网络。
+- 浏览被封锁的页面。
+- 连接其他应用,即(FTP)来保证网络安全的访问。
+
+#### 关于Tor浏览器的争论 ####
+
+- 在Tor应用的边界上并没有什么安全措施。比如,数据入口点和出口点。
+- 一项2011年的研究发现一种特殊的针对Tor浏览器的攻击可以得到BitTorrent用户的IP地址。
+- 在一些研究中发现某些特定的协议有泄漏IP地址的倾向。
+- 早些的Tor版本绑定了旧版本的Firefox浏览器,这被证明较易受JavaScript攻击。
+- Tor浏览器运行起来比较慢。
+
+#### 真实世界中Tor浏览器的实现 ####
+
+- [Vuze BitTorrent Client][3]
+- Anonymous Os
+- Os’es from Scratch
+- whonix 等
+
+#### Tor浏览器的未来 ####
+
+Tor浏览器是前途无量的。也许第一个该类应用程序的实现是非常出色的,但Tor浏览器必须加大对支持、伸缩性、以及对近期的攻击进行数据安全的研究的投入。这个应用程序是未来的需要。
+
+#### 下载免费的电子书 ####
+
+非官方的Tor私密浏览指南:
+
+[![](http://img.tradepub.com/free/w_make129/images/w_make129c4.gif)][2]
+
+### 结论 ###
+
+如果您工作的部门不允许您访问某网站,或者如果您不希望别人知道您的私人事务,或您不想向NSA提供您的个人数字足迹,那么Tor浏览器在目前是必须的。
+
+**注意**: Tor浏览器提供的安全性不能抵御病毒、木马或其他类似这样的安全威胁。写这篇文章的目的也不是希望通过在互联网上隐藏我们的身份来放纵非法活动。这篇文章纯粹是为了教学的目的,作者和Tecmint均不会为任何非法的使用负责。这是用户自己的责任。
+
+Tor浏览器是一个非常不错的应用,您值得尝试!这就是我要说的全部了,我还会在这里写一些您感兴趣的文章,所以请继续关注。别忘了在留言区提供给我们您有价值的反馈。
+
+--------------------------------------------------------------------------------
+
+via: http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/
+
+作者:[Avishek Kumar][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://www.tecmint.com/author/avishek/
+[1]:https://www.torproject.org/download/download-easy.html.en
+[2]:http://tecmint.tradepub.com/free/w_make129/prgm.cgi
+[3]:http://www.tecmint.com/install-vuze-torrent-client-in-linux/
\ No newline at end of file
diff --git a/published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md b/published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md
new file mode 100644
index 0000000000..e9de420c7d
--- /dev/null
+++ b/published/20150618 How to Setup Node.JS on Ubuntu 15.04 with Different Methods.md	
@@ -0,0 +1,263 @@
+在Ubuntu下安装Node.JS的不同方式
+================================================================================
+
+如果你要在Ubuntu 15.04上安装Node.js的话,这篇教程对你来说肯定很重要。Node.js从本质上来说就是一个运行在服务端上的封装好了输入输出流的javascript程序。Node.js巧妙的使用单线程的事件循环来处理高吞吐量和非阻塞IO。同时它也是一个提供了通过操作系统读写文件和网络操作功能的平台层。所以这篇文章将展示在Ubuntu 15.04 server上不同的安装Node.Js的方式。
+
+### 安装Node.JS 的方法###
+
+有许多安装Node.JS的不同的方法,我们可以选择其一。通过本篇文章我们将手把手带着你在Ubuntu 15.04上安装Node.Js,在此之前请卸载旧版本的包以免发生包冲突。
+
+- 从源代码安装Node.JS
+- 用包管理器安装Node.JS
+- 从Github远程库安装Node.JS
+- 用NVM安装Node.JS
+
+### 1) 从源代码安装Node.JS ###
+
+让我们开始从源代码安装Node.JS之前,请确认系统上的所有的依赖包都已经更新到最新版本。然后跟着以下步骤来开始安装:
+
+#### 步骤1: 升级系统 ####
+
+用以下命令来升级系统,并且安装一些Node.JS必要的包。
+
+    root@ubuntu-15:~# apt-get update
+
+    root@ubuntu-15:~# apt-get install python gcc make g++
+
+#### 步骤2: 获取Node.JS的源代码 ####
+
+安装好依赖包之后我们可以从官方网站上下载Node.JS的源代码。下载以及解压的命令如下:
+
+    root@ubuntu-15:~# wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz
+    root@ubuntu-15:~# tar zxvf node-v0.12.4.tar.gz
+
+#### 步骤3: 开始安装 ####
+
+现在我们进入源代码的目录,然后运行.configure文件
+
+![NodeJS Configure](http://blog.linoxide.com/wp-content/uploads/2015/06/13.png)
+
+    root@ubuntu-15:~# ls
+    node-v0.12.4 node-v0.12.4.tar.gz
+    root@ubuntu-15:~# cd node-v0.12.4/
+    root@ubuntu-15:~/node-v0.12.4# ./configure
+    root@ubuntu-15:~/node-v0.12.4# make install
+
+#### 安装后测试 ####
+
+只要运行一下上面的命令就顺利安装好了Node.JS,现在我们来确认一下版本信息和测试以下Node.JS是否可以运行输出。
+
+    root@ubuntu-15:~/node-v0.12.4# node -v
+    v0.12.4
+
+![Node.Js Test](http://blog.linoxide.com/wp-content/uploads/2015/06/21.png)
+
+创建一个以.js为扩展名的文件然后用Node的命令运行
+
+    root@ubuntu-15:~/node-v0.12.4# touch helo_test.js
+    root@ubuntu-15:~/node-v0.12.4# vim helo_test.js
+    console.log('Hello World');
+
+现在我们用Node的命令运行文件
+
+    root@ubuntu-15:~/node-v0.12.4# node helo_test.js
+    Hello World
+
+输出的结果证明我们已经成功的在Ubuntu 15.04安装好了Node.JS,同时我们也能运行JavaScript文件。
+
+### 2) 利用包管理器安装Node.JS ###
+
+在Ubuntu下用包管理器安装Node.JS是非常简单的,只要增加NodeSource的个人软件包档案(PPA)即可。
+
+我们将下面通过PPA安装Node.JS
+
+#### 步骤1: 用curl获取源代码 ####
+
+在我们用curl获取源代码之前,我们必须先升级操作系统,然后用curl命令获取NodeSource添加到本地仓库。
+
+    root@ubuntu-15:~#apt-get update
+    root@ubuntu-15:~# curl -sL https://deb.nodesource.com/setup | sudo bash -
+
+curl将运行以下任务
+
+    ## Installing the NodeSource Node.js 0.10 repo...
+    ## Populating apt-get cache...
+    ## Confirming "vivid" is supported...
+    ## Adding the NodeSource signing key to your keyring...
+    ## Creating apt sources list file for the NodeSource Node.js 0.10 repo...
+    ## Running `apt-get update` for you...
+    Fetched 6,411 B in 5s (1,077 B/s)
+    Reading package lists... Done
+    ## Run `apt-get install nodejs` (as root) to install Node.js 0.10 and npm
+
+#### 步骤2: 安装NodeJS和NPM ####
+
+运行以上命令之后如果输出如上所示,我们可以用apt-get命令来安装NodeJS和NPM包。
+
+    root@ubuntu-15:~# apt-get install nodejs
+
+![NodeJS Install](http://blog.linoxide.com/wp-content/uploads/2015/06/31.png)
+
+#### 步骤3: 安装一些必备的工具 ####
+
+通过以下命令来安装编译安装一些我们必需的本地插件。
+
+    root@ubuntu-15:~# apt-get install -y build-essential
+
+#### 通过Node.JS Shell来测试 ####
+
+测试Node.JS的步骤与之前使用源代码安装相似,通过以下node命令来确认Node.JS是否完全安装好:
+
+    root@ubuntu-15:~# node
+    > console.log('Node.js Installed Using Package Manager');
+    Node.js Installed Using Package Manager
+
+----------
+
+    root@ubuntu-15:~# node
+    > a = [1,2,3,4,5]
+    [ 1, 2, 3, 4, 5 ]
+    > typeof a
+    'object'
+    > 5 + 2
+    7
+    >
+    (^C again to quit)
+    >
+    root@ubuntu-15:~#
+
+#### 使用NodeJS应用进行简单的测试 ####
+
+REPL是一个Node.js的shell,任何有效的JavaScript代码都能在REPL下运行通过。所以让我们看看在Node.JS下的REPL是什么样子吧。
+
+    root@ubuntu-15:~# node
+    > var repl = require("repl");
+    undefined
+    > repl.start("> ");
+
+    Press Enter and it will show out put like this:
+    > { domain: null,
+    _events: {},
+    _maxListeners: 10,
+    useGlobal: false,
+    ignoreUndefined: false,
+    eval: [Function],
+    inputStream:
+    { _connecting: false,
+    _handle:
+    { fd: 0,
+    writeQueueSize: 0,
+    owner: [Circular],
+    onread: [Function: onread],
+    reading: true },
+    _readableState:
+    { highWaterMark: 0,
+    buffer: [],
+    length: 0,
+    pipes: null,
+    ...
+    ...
+
+以下是可以在REPL下使用的命令列表
+
+![REPL Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/4.png)
+
+#### 使用NodeJS的包管理器 ####
+
+NPM是一个提供给node脚本持续生命力的命令行工具,它能通过package.json来安装和管理依赖包。最开始从初始化命令init开始
+
+    root@ubuntu-15:~# npm init
+
+![NPM starting](http://blog.linoxide.com/wp-content/uploads/2015/06/51.png)
+
+### 3) 从Github远程库安装Node.JS ###
+
+在这个方法中我们需要一些步骤来把Node.JS从Github的远程的仓库克隆到本地仓库目录
+
+在开始克隆(clone)包到本地并且配制之前,我们要先安装以下依赖包
+
+    root@ubuntu-15:~# apt-get install g++ curl make libssl-dev apache2-utils git-core
+
+现在我们开始用git命令克隆到本地并且转到配制目录
+
+    root@ubuntu-15:~# git clone git://github.com/ry/node.git
+    root@ubuntu-15:~# cd node/
+
+![Git Clone NodeJS](http://blog.linoxide.com/wp-content/uploads/2015/06/61.png)
+
+clone仓库之后,通过运行.config命令来编译生成完整的安装包。
+
+    root@ubuntu-15:~# ./configure
+
+![Configure Node](http://blog.linoxide.com/wp-content/uploads/2015/06/7.png)
+
+运行make install命令之后耐心等待几分钟,程序将会安装好Node.JS。
+
+    root@ubuntu-15:~/node# make install
+
+    root@ubuntu-15:~/node# node -v
+    v0.13.0-pre
+
+#### 测试Node.JS ####
+
+    root@ubuntu-15:~/node# node
+    > a = [1,2,3,4,5,6,7]
+    [ 1, 2, 3, 4, 5, 6, 7 ]
+    > typeof a
+    'object'
+    > 6 + 5
+    11
+    >
+    (^C again to quit)
+    >
+    root@ubuntu-15:~/node#
+
+### 4) 通过NVM安装Node.JS ###
+
+在最后一种方法中我们我们将用NVM来比较容易安装Node.JS。安装和配制Node.JS,这是最好的方法之一,它可以供我们选择要安装的版本。
+
+在安装之前,请确认本机以前的安装包已经被卸载。
+
+#### 步骤1: 安装依赖包 ####
+
+首先升级Ubuntu Server系统,然后安装以下安装Node.JS和使用NVM所要依赖的包。用curl命令从git上下载NVM到本地仓库:
+
+    root@ubuntu-15:~# apt-get install build-essential libssl-dev
+    root@ubuntu-15:~# curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
+
+![NVM Curl](http://blog.linoxide.com/wp-content/uploads/2015/06/81.png)
+
+#### 步骤2: 修改Home环境 ####
+
+用curl从NVM下载必需的包到用户的home目录之后,我们需要修改bash的配置文件添加NVM,之后只要重新登录中断或者用如下命令更新即可。
+
+    root@ubuntu-15:~# source ~/.profile
+
+现在我们可以用NVM来设置默认的NVM的版本,或者用如下命令来指定之前版本:
+
+    root@ubuntu-15:~# nvm ls
+    root@ubuntu-15:~# nvm alias default 0.12.4
+
+![NVM Default](http://blog.linoxide.com/wp-content/uploads/2015/06/91.png)
+
+#### 步骤3: 使用NVM ####
+
+我们已经通过NVM成功的安装了Node.JS,所以我们现在可以使用各种有用的命令。
+
+![NVM Manual](http://blog.linoxide.com/wp-content/uploads/2015/06/101.png)
+
+### 总结 ###
+
+现在我们已经准备好了在服务端安装Node.JS,你可以从我们说的四种方式中选择最合适你的方式在最新的Ubuntu 15.04上来安装Node.JS,安装好之后你就可以利用Node.JS来编写你的代码。
+
+--------------------------------------------------------------------------------
+
+via: http://linoxide.com/ubuntu-how-to/setup-node-js-ubuntu-15-04-different-methods/
+
+作者:[Kashif Siddique][a]
+译者:[NearTan](https://github.com/NearTan)
+校对:[wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://linoxide.com/author/kashifs/
\ No newline at end of file
diff --git a/published/20150618 What will be the future of Linux without Linus.md b/published/20150618 What will be the future of Linux without Linus.md
new file mode 100644
index 0000000000..ff30e8b4cf
--- /dev/null
+++ b/published/20150618 What will be the future of Linux without Linus.md	
@@ -0,0 +1,186 @@
+没有 Linus,Linux 的未来是什么样子?
+==============================================================================
+![](http://i2.wp.com/www.linuxveda.com/wp-content/uploads/2015/06/linus-torvalds-painting.jpg)
+
+这次采访是《Linux For You》杂志在2007年进行的,现在我们发表在这里是为了存档的目的。
+
+**Q:对于 Linux 内核,未来的计划/道路/提升是怎样的?**
+
+Linus:我从来没有太多的预见性 — 与其从宏大的计划上看未来,我倾向于从一个相对短的时间框架,比如“几个月之后的事情”。我是一个忠实的‘细节成败论’的信仰者,如果你抓住了细节,再大的问题也会大事化小,小事化无。
+
+所以,对于五年后内核会是什么样,我真的没有任何远见 — 仅仅是希望我们能够持续专注于Linux的发展。实际上,对于我个人来说,我最担心的事情之一甚至不是技术问题,而是确保这个‘过程’正常,这样人们才可以相互协作好。
+
+**Q:你怎么看 Linux 和 Solaris 之间的关系在未来的发展?它会如何使用户受益?**
+
+Linus:我并没有看到太多交叉的地方,除了我认为 Solaris 会使用更多的 Linux 用户空间工具(对我自己来说并没有太多关注这个,因为我真的只关心内核)。Linux 桌面比起传统 Solaris 桌面好多了,而且我希望 Solaris 移植越来越多的 Linux 的东西,朝着一个更加类 Linux 的模式前进。(LCTT 译注:时至今日,我们还需要讨论 Solaris 吗?/cry ,但是当时,整个开源社区确实期望接受 Solaris 一些遗产。)
+
+从纯内核方面讲,许可证的存在意味着没有太多的合作空间,但是如果这种情况发生改变将会变得很有趣。Sun 已经声称将在 GPL(v2 或 v3)下授权 Solaris,如果这种许可证的差异消失,那么会导致一些有趣的技术出现。但对此,我持观望态度。
+
+**Q:现在 GPL v3 已经完成并发布了,你是否预见有什么情况会鼓励你开始移植内核到 Solaris 上去?或者,从你的角度看,它是否很糟糕以至于你从来没考虑过它?**
+
+Linus:我觉得相比于早先的草稿,v3 有了很多提高,并且我也不认为它是一个糟糕的许可证。我只是认为它没有 GPLv2 一样‘伟大’。
+
+所以,如果没有 GPLv2,我觉得自己将会使用 GPLv3。不过,既然我已经有了一个更好的选择,我为什么还要考虑它呢?
+
+这就是说,我始终秉承实用主义精神,并且我认为“ GPLv3 不像 GPLv2 一样好”这件事并不是一个‘非黑即白’的问题。这就像是一个天平,如果 GPLv3 有了其他的优点作为砝码,很有可能那些优点会让我对 GPLv3 更偏爱一些。
+
+恕我直言,我到现在还并没有看到任何优点,但是如果 Solaris 真的在 GPLv3 下发布,可能避免不必要的许可证不兼容性这一条就分量足够了,足以值得我们去尝试将 Linux 的内核重新在 GPLv3 许可证下发布。不过,请不要误解,我认为这是不大可能的。但是我确实想澄清我本质上并不是一个许可证偏执者。我认为 GPLv2 是毫无疑问的好许可证,但是许可证并不是一切。(LCTT 译注:事实上,Solaris/OpenSolaris 最终也没采用 GPL 许可协议发布,而 20100年之后,已经没有什么动静了。而 Linux 内核最终也没有更换到 GPLv3 上。)
+
+总的来说,我使用很多其他许可证下的程序。我可能没有把任何一个我自己做的项目放在 BSD(或 X11—MIT)许可证下,但是我认为它是一个伟大的许可证,对于其他项目来说,它可能是最佳的选择。
+
+**Q:目前有没有任何你想特别提出作为 Linux 内核的关键贡献者的印度人?**
+
+(LCTT 译注:本篇访谈中提到多次印度,是因为访谈者是印度人。)
+
+Linus:我不得不承认,我并没有与来自印度的任何人直接合作过,尽管我已经非常有意识地努力建立一个规模庞大的内核开发团队,这样我不用总是独自工作。
+
+我相信大多数人的社交基本上是受限制的,只对很少的人十分了解(比如你最亲近的家人和朋友),我也努力构造这样一个开发模型来改变这种状况:通过一个‘开发者网络’,人们可以在此互动,可能是与一批你信任的人,而且那些人反过来与他们信任的一群人互动。
+
+所以,我偶然会与上百个发给我一两个不确定的补丁的开发者联系。我试着去建立一些由我熟知的人组成的小团体,我认为那就是人们工作的方式,当然也是我喜欢工作的方式。
+
+同时,坦白地说,我甚至不知道许多与我一起工作的人生活在哪里。地理位置成了十分次要的东西。所以我很确信与我工作最紧密的前10—15个人中,没有印度的,可能这话稍后传到公众耳里,然后被指出确实有一些人来自那里!
+
+**Q:因为 Linux 的内核开发对你依赖如此严重,你如何计划组织或重组,让它在没有你的情况下继续发展,假设你决定花更多的时间在你自己的生活和家庭上面的话?**
+
+Linus:现在 Linux 比我重要得多,为了今天这一步我已经工作了很长时间。是的,我仍然十分密切地参与其中,而且我对其有着想当大的日常影响,我最终会是这样一个人——在某种程度上,扮演着许多内核开发活跃者的中心;但是,我不会说 Linux “严重依赖”于我。
+
+所以,如果我得了心脏病并且明天就死了(很高兴没这种可能:我显然在任何方面都很健康),人们肯定会注意到,但是有成千上万的人为内核工作,并且不止一两个人能够毫无困难地接替我的角色。
+
+**Q:印度是软件工程师的主要产地之一,但是我们没有在 Linux 领域做太多贡献。你觉得为什么印度人没有积极参与Linux?如果我们鼓励印度人参与并为 Linux 做更大的贡献,你觉得如何?你会乐意用你个人作为榜样激励印度工程师吗?**
+
+Linus:对我来说,这确实是一个不好回答的问题。参与开源取决于两方面的基础条件:信息流和文化(用你的话说是互联网和教育),我甚至不知道这其中哪个是最大的障碍。
+
+在很多方面,至少在那些印度讲英语文化的地方,参与 Linux 和其他开源项目是相对容易的,如果仅仅是由于语言门槛的话。这当然比起亚洲的许多地方,甚至欧洲的一些地方要容易些。
+
+当然,这只是一些人,并不等同于印度的大部分群体,而且我自己关于印度的情况也知道不多,甚至没法不太负责的猜测最好的途径是什么。我猜一个热情的本地用户社区会是最好的途径,而且我猜测你们已经拥有这样的社区了。
+
+至于我的‘偶像’形象,我自己不以为然。我不是一个伟大的公众演讲者,而且我最近些年已经避免出游,因为被看做符号化的‘偶像’让我很不自在。我就是一个工程师而已,而且我仅仅是喜欢我做的事情,并与社会上其他人一起工作。
+
+**Q:什么样的理由会让你考虑去访问印度?**
+
+Linus:如前一个回答中提到,我十分讨厌公开演讲,所以我才想避免开会等等这些事。我更愿意某天去印度度个假,但是如果我这样做,我可能悄悄地干 — 出行之前不告诉任何人,仅仅作为一个游客去游览印度!(LCTT 译注:所以 Linus 不来中国的道理是同样的,除非在中国召开一次世界性的 LinuxCon。)
+
+**Q:最近你好像在抨击 Subversion 与 CVS,质问他们的架构基础。现在你已经从 Subversion 和 CVS 社区那里得到回应,你是否改变了看法,还是说并没有被说服?**
+
+Linus:因为我发现这个争论很有趣,所以我想做一个强硬的声明。换句话说,我确实‘喜欢’争论。并不是不经思考的,但是我确实想要让争论更热烈些,而不仅仅是完全的柏拉图式的。
+
+做出强硬的争论有时会引来一个非常合理的反驳,然后我会很高兴地说:“噢,好吧,你是对的。”
+
+但是话说回来,对 SVN/CVS 并不会发生这种情况。我怀疑很多人并不是真的很喜欢 CVS,所以我真的不觉得会有谁坚持认为 CVS 就是一切,而不是一个老旧系统。要是我知道之前就有人这样认为的话,我就不会那么不礼貌地反对 SVN(嘿,这么说没错 — 我真的不是一个非常礼貌的家伙!),我不相信任何人会认为 SVN 是‘好的’。
+
+我认为,SVN 就是一个‘还好’的经典案例。人们过去经常使用 SVN,并且它也‘还好’地广泛使用,但是它的‘还好’就如 DOS 与 Windows 的‘还好’一样。不是什么伟大的技术,只是普遍适用而已,同时它对人们来说运行良好,看着十分熟悉。但是很少有人以此为傲,或者对其感到兴奋。
+
+Git,从另外方面讲,其身后有一些‘UNIX 哲学’,这和 UNIX 无关。实质上,就像原始的 UNIX,在它身后有一个基本理念。对 UNIX 来说,最底层的哲学就是,“所有东西只是一个文件”。对 Git 来说,“则是每个东西只是内容寻址数据库中的一个对象”。
+
+**Q:现在如此多的发行是好事还是坏事?选择是很有意思的,但是选择太多了就是干扰。相较于这么多的人每天花费数小时去构建成百上千的发行版,如果人们可以一起来支持少数的发行版,这样在企业级市场去挑战微软是不是更容易些呢?对此你怎么看?**
+
+Linus:我认为多个发行版是开源不可回避的部分。它会造成困惑吗?当然。它会变得低效率吗?是的。但是我喜欢拿它与政治比较:‘民主’也有那些令人困惑的选择,往往没有任何一个选择是你‘真正’想要的。而且有时候,如果你不需要操心选举、不同党派和联合等等方面的困惑的话,你可能会感觉事情更加容易一些,更有效率一些。
+
+但是最后我想说,选择可能会导致低效率,但是它也让每个人至少保留了‘所谓的’诚信。我们可能都希望我们的政治家更诚信,我们也希望不同的发行版可以让我们有一天有其他的选择,而如果没有选择的话,事情可能会更糟。
+
+**Q:为什么你觉得 CFS 比 SD 更好?**
+
+Linus:一部分原因是我与 Ingo [Molnar] 工作过很长一段时间,也就是说,我了解他,并且知道他会对发生的任何问题非常负责。那种品质是非常重要的。
+
+但是一部分原因就简单的与用户有关,大多数人实际上表示 CFS 比 SD 好。包括许多 3D 游戏方面(这是人们声称 SD 最强的一点)。
+
+尽管如此,我认为并不是任何一段代码都十分‘完美’。最好的情况是,想成为 SD 支持者的人会努力提高 SD,从而通过其它方式取得了平衡 — 而我们会保持两个阵营都尝试有趣的事情,因为内部的竞争会刺激他们。
+
+**Q:在 Google 的一次关于 Git 的访谈中,有人问你如何将当前集中存放的超大代码库迁移到 git 上,而不用将开发工作停止六个月。你对此的回答是什么?**
+
+Linus:啊哈,那个问题我在现场没有听清楚(在录音里,问题会听得更清楚些),当我回头去听录制的音频,注意到了我没有回答他的问题,但是我觉得这问题他问过。
+
+无论如何,我们确实有很多导入的工具,所以你实际上可以仅仅是将一个大的项目从任何其他的早期的 SCM (源代码控制系统)导入到 git 里,但问题显然不是经常以导入动作本身结束,而是需要‘习惯’这种新模式!
+
+坦白来说,我认为关于如何‘习惯它’没有任何其他答案,而只能是去开始使用和尝试它。显然,你不会冒险率先导入你现有的最大、最重要的项目,那确实会导致工作停顿下来,然后使得每个人都很不高兴。
+
+所以没有任何理智健全的人会拥护在一夜之间将一切移到 git 上去,并强迫人们改变他们的环境。是的,你需要从公司里的小项目开始,可能是一些由一个小组主要控制和维护的项目,然后开始转移其到 git。这是你能让人们习惯这种模式的方式,你应该以一个核心的组开始,他们知道 git 如何工作,如何在公司里面使用它。
+
+接着,你就会铺展开来。并不需要一次到位。你会导入越来越多的项目 — 甚至是在你公司里采用‘单一大型仓库’模式;那个仓库基本上是作为许多模块的集合,因为让每个人去检查每件事不是一个可执行的工作模型(除非这个‘每件事’并不非常大)。
+
+所以,你基本上只会一次转移一个模块,直到你发现使用 git 是如此酸爽,这时你可以移植余下的所有(或者‘余下’的太旧了,没有人用了)。
+
+git 最赞的一个功能是,它实际上可以同很多其他 SCM 相处很好。很多 git 用户使用它的时候,与他们一起工作的人并没有发现,因为他们看到 git 的结果,会联想到一些传统的 SCM 上去。
+
+**Q:Linux 用了你在 Transmeta(全美达)上实现备用指令集的经验吗?[Transmeta Crusoe 芯片看起来像一个非常轻量级的 CPU — 记得有一台 Burroughs B1000 解释器,它实际上实现了多个虚拟机。有的用于系统软件,有的用于 Cobol,还有的用于 Fortran;如果没错的话,那么人们可以在芯片上实现 Burroughs 6/7000 或者 HP3000 类似的堆栈架构,或适用于 JVM 的指令集,等等。(LCTT 译注:Linus 于 1997-2003 期间就职于全美达)]**
+
+Linus:我们确实有一些备选的结构集合,不过我不打算谈论太多这个,我可以说的是我们已经做了一个混合结构集合的公开演示。我们有一个技术展示,在那里你同时可以跑 x86 指令和 Java 字节码(实际上,它是一个轻量的扩展 pico—java,iirc)。
+
+我想我们展示的这个应用会在 Linux 上运行 DOOM,这里 Linux 的部分是一个完全标准 x86 发行版。但是 DOOM 的二进制程序是一个特定的编译版本,它实际上编译为 pico-java 代码。而 CPU 最终以相同的方式来运行它们——从 JIT 到原生 VLIW 指令集。
+
+(选择 DOOM 的原因仅仅是其源代码可用,并且游戏的核心部分非常小,足以很容易拿它来做一个验证 — 而且它也显然看起来十分有趣。)
+
+有更多的事情是在内部运作,但是我不能谈论他们。而且实际上,就我个人而言,对 Java 不怎么感冒。
+
+**Q:386BSD 衍生了 NetBSD,FreeBSD 和 OpenBSD,在 Linux 出现之前已经发展不错了,但是 Linux 传播比 386BSD 及其衍生者更为广泛。这在多大程度上左右你对许可证的选择,这个选择的发展过程是怎样的?你不认为比起 GPLv2 来,是 GPLv3 创造了发展空间,迄今为止,让 Linux 比 BSD 变得更好?**
+
+Linus:我认为这不仅是一个许可证问题,也是一个社区及人格问题。BSD 的许可证总是鼓励分叉,但是这也意味着,如果某些人取得了成功并做了商业性的分叉,他并不需要将他的修改返回来。因此,哪怕实际上这种事情没有(而实际上,这种事情的确发生了,比如 BSDi),人们也难以建立彼此信任。 
+
+相比之下,GPLv2 也鼓励分叉,但是它不仅仅鼓励分叉出去,它也鼓励(并‘要求’)能够融合回来。所以,我们现在达到了新的层次的信任:你‘知道’每个人都被许可证所约束,所以每个人都不会占你便宜。
+
+所以,在我看来,GPLv2 作为许可证来说,它允许人们在要求总是回馈贡献的前提下,在另外的方面取得了最大可能的自由。没有人能阻止你对源代码的改进。
+
+那么,BSD 许可证是更‘自由’的吗?是的,毫无疑问。但是我不会在我在意的任何项目里面使用 BSD 许可证,因为我不仅仅想要自由,我也想要信任,可以让我总是能使用其他人为我的项目所写的代码。
+
+所以对于我来说,GPLv2 最终在‘尽可能自由’上取得了完美的平衡,这样,我们做到了让每个人都能信任,他们总是可以取得源代码并使用它。
+
+这就是为什么我认为 GPLv3 最终并没多大意思,它不再是那种‘返回源代码’的信任;它退化成了‘我写了这些代码,所以我能控制你如何使用它’。
+
+换言之,我只是觉得 GPLv3 太狭隘和自私了。我认为 GPLv2 在‘自由’和‘信任’之间取得伟大的平衡。它不如 BSD 许可证自由,但是它让你安心回馈,而且它符合我认为的‘以德报德’:我给你源代码,你也回馈我源代码。
+
+而 GPLv3 试着控制源代码的‘使用’。现在它就是“我给你我的源代码,如果你使用它的话,你就准备好让我对你的设备动手动脚吧”,看见了没?在我看来,不但小气,而且小心眼。
+
+**Q:-rt 代码树的功能正在缓慢而稳定地逐渐集成到主线代码中。你对将剩余的 -rt 树合并到主线代码的看法是什么?(我说的不是 CFS)**
+
+Linus: 我不能保证来自 -rt 的一切‘都’会被合并进入标准内核(有一些部分肯定不适合常规的内核),不过是的,这些年来我们实际上将它的大部分都集成进去了,剩下的部分最终以后也会合并进去。
+
+我提倡高效工作,但是我同时也很保守。我退回了一些激进的合并请求,只是因为我需要确保它们对我们所有人都有意义,不仅仅是用于极端情况下的实时环境,而且也对并不需要这种环境的‘普通’用户有用。这解释了为什么这个过程相当缓慢却稳定不断地合并代码,因为它需要足够稳定和有意义。
+
+顺便说一句,这不仅仅是针对 -rt ,它也出现在许多开发中。-rt 出现这种情况是因为它是更‘直接’的内核项目,而且也是因为它的一个主要开发者直接参与到了常规内核开发。通常其它功能的迁移(安全、虚拟内核变化、虚拟化,等等)也遵循类似的方式:他们针对特定的环境进行开发,然后这些功能片段缓慢而稳步地合并到标准内核。
+
+**Q:我对 Linux 内核所支持的文件系统发展很感兴趣。你觉得 Reiser4、XFS4、ZFS 以及 Oracle 的新项目哪个更有前途?这些天 ZFS 有不少新闻,Reiser4 也发布了很不错的性能基准测试,XFS4 正紧随其后,而 Oracle 发布的那个也有很多像 Sun 的 ZFS 一样的特性。我们将走向何方呢?以你的观点来看,哪个文件系统更有前途?**
+
+Linus: 实际上,就在昨天我们发现了一个 git 的性能问题,有一个用户发现他采用 ZFS 要比 UFS 慢一个数量级(不是在 Linux 下,git 已经得到了许多关注,甚至是来自内核开发团队之外)。所以,我认为许多‘新文件系统’的拥护者部分原因是因为他们了解到旧文件系统的不足,然后(有点不切实际地)期望一个‘崭新的、改进的’文件系统能使一切都完美。
+
+最后,这是一个永无止境的领域,看看谁是最终的赢家——也许并不需要(看起来不需要)一个赢家。几乎总是这样,对文件系统的选择最终取决于负载和环境。
+
+相比你提到的这些文件系统,我个人对基于闪存的硬盘很快就可以供甚至是‘普通’用户使用的这个事实更感到兴奋。当然,它们仍然很昂贵(而且相当的小),但是基于闪存的存储和传统硬盘的性能完全不可同日而语,我怀疑它们最终将对文件系统的设计有巨大的影响。而现在,多数文件系统的设计都是在考虑如何处理硬盘延迟。
+
+**Q:操作系统变得越来越不重要。你说过好几次用户根本不应该‘看见’操作系统。应用更为重要。基于浏览器的应用,如 Google 的办公软件影响力越来越大。你认为操作系统将走向何方?**
+
+Linus:我并不真的认可‘浏览器 OS’,因为我认为人们总是需要在本地做一些事情。也许是因为安全,或者仅仅是因为隐私的原因。而且即便当到处可以接入时,它也并不是‘无处不在’。
+
+所以我认为,整个‘Web OS’这件事有一部分是真实的,但是另外一部分人们也许忘记了操作系统已经存在了几十年,它已经相当稳定,而且它的发展是有目共睹的。人们真的不应该期望操作系统有魔法般的变化,现在已经不是操作系统刚刚起步的六十年代,甚至连硬件也和过去完全不同了!
+
+所以,别指望一场革命。我认为操作系统将在很大程度上继续它们所擅长的,当然,我们也会进步,但是我不认为会从根本上改变。也许会发生巨变的是界面和操作系统顶层的那些东西(当然,操作系统下面的硬件也会继续进步),这显然才是人们所关心的。
+
+至于操作系统?它显然是应该尽可能隐藏起来的东西。你真的不应该在意它,除非你特别想知道在机器里面真正在发生什么。
+
+**Q:最近我听说你正在使用一台 PPC G4/5 作为个人计算机,你使用它来做什么?为什么呢?**
+
+Linus:我最终放弃了那台 PowerPC,因为没有人能在这台工作站上做到更多,特别是,自从 x86-64 开始变得越来越强大了。所以这些天,我在用一台标准的 PC,里面是一个普通的 Core 2 Duo CPU。
+
+在其它架构下运行是非常有趣的(alpha 作为我的主要架构运行了好几年,所以这并不是第一次),但是这种 CPU 得当成商品买得到才行。我认为,唯一能取代 x86 架构的,也许未来十年并不需要使用 x86 作为主要架构,我认为或许是 ARM,这得益于移动设备市场的发展。
+
+**Q:Linux 对你意味着什么?一种业余爱好、哲学、人生意义、工作、最好的操作系统,还是什么?**
+
+Linus:它是所有的这一切。它是爱好,而且是具有深刻意义的爱好。最好的爱好是你‘真的’非常在意它。这些日子里,它显然也是我的工作,我非常高兴工作和兴趣能合二为一。
+
+我不了解所谓的‘哲学’,我并不真的是因为深层次的道德或哲学的原因才做的 Linux,但是可以肯定的是,对开源的深层思考是我非常重视的。所以我并不是因为什么明确的理由做 Linux,也不能说是它在激励我,但是我的确在思考开源是如何工作。
+
+**Q:微软的‘黑衣人’有没有和你交谈过?**
+
+Linus:我从来没有真正和微软交谈过,没有。我偶尔会和一些微软的人出现再同一个会议上(我比以前参加的会议更多了),但是我从来和他们没有任何关系。我认为彼此都很谨慎吧。
+
+--------------------------------------------------------------------------------
+
+via: http://www.linuxveda.com/2015/06/17/what-happens-to-linux-after-linus/
+
+作者:[Swapnil Bhartiya][a]
+译者:[wi-cuckoo](https://github.com/wi-cuckoo),[wxy](https://github.com/wxy)
+校对:mahua, [wxy](https://github.com/wxy)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://www.linuxveda.com/author/arnieswap/
+
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
deleted file mode 100644
index 3cdb43d879..0000000000
--- a/sources/share/20141013 Compact Text Editors Great for Remote Editing and Much More.md	
+++ /dev/null
@@ -1,219 +0,0 @@
-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.
-
-Whatever the level of sophistication of the editor, they typically have a common set of functionality, such as searching/replacing text, formatting text, importing files, as well as moving text within the file.
-
-All of these text editors are console based applications which make them ideal for editing files on remote machines. Textadept also provides a graphical user interface, but remains fast and minimalist.
-
-Console based applications are also light on system resources (very useful on low spec machines), can be faster and more efficient than their graphical counterparts, they do not stop working when X needs to be restarted, and are great for scripting purposes.
-
-I have selected my favorite open source text editors that are frugal on system resources.
-
-----------
-
-### Textadept ###
-
-![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Textadept.png)
-
-Textadept is a fast, minimalist, and extensible cross-platform open source text editor for programmers. This open source application is written in a mixture of C and Lua and has been optimized for speed and minimalism over the years.
-
-Textadept is an ideal editor for programmers who want endless extensibility options without sacrificing speed or succumbing to code bloat and featuritis.
-
-There is also a version available for the terminal, which only depends on ncurses; great for editing on remote machines.
-
-#### Features include: ####
-
-
-- Lightweight
-- Minimal design maximizes screen real estate
-- Self-contained executable – no installation necessary
-- Entirely keyboard driven
-- Unlimited split views (GUI version) split the editor window as many times as you like either horizontally or vertically. Please note that Textadept is not a tabbed editor
-- Support for over 80 programming languages
-- Powerful snippets and key commands
-- Code autocompletion and API lookup
-- Unparalleled extensibility
-- Bookmarks
-- Find and Replace
-- Find in Files
-- Buffer-based word completion
-- Adeptsense autocomplete symbols for programming languages and display API documentation
-- Themes: light, dark, and term
-- Uses lexers to assign names to buffer elements like comments, strings, and keywords
-- Sessions
-- Snapopen
-- Available modules include support for Java, Python, Ruby and recent file lists
-- Conforms with the Gnome HIG Human Interface Guidelines
-- Modules include support for Java, Python, Ruby and recent file lists
-- Support for editing Lua code. Syntax autocomplete and LuaDoc is available for many Textadept objects as well as Lua’s standard libraries
-
-- Website: [foicica.com/textadept][1]
-- Developer: Mitchell and contributors
-- License: MIT License
-- Version Number: 7.7
-
-----------
-
-### Vim ###
-
-![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-vim.png)
-
-Vim is an advanced text editor that seeks to provide the power of the editor 'Vi', with a more complete feature set.
-
-This editor is very useful for editing programs and other plain ASCII files. All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be defined by the user, and the mouse can be used.
-
-Vim is often called a "programmer's editor," and is so useful for programming that many consider it to be an entire Integrated Development Environment. However, this application is not only intended for programmers. Vim is highly regarded for all kinds of text editing, from composing email to editing configuration files.
-
-Vim's interface is based on commands given in a text user interface. Although its graphical user interface, gVim, adds menus and toolbars for commonly used commands, the software's entire functionality is still reliant on its command line mode.
-
-#### Features include:  ####
-
-
-- 3 modes:
-- - Command mode
-- - Insert mode
-- - Command line mode
-- Unlimited undo
-- Multiple windows and buffers
-- Flexible insert mode
-- Syntax highlighting highlight portions of the buffer in different colors or styles, based on the type of file being edited
-- Interactive commands
-- - Marking a line
-- - vi line buffers
-- - Shift a block of code
-- Block operators
-- Command line history
-- Extended regular expressions
-- Edit compressed/archive files (gzip, bzip2, zip, tar)
-- Filename completion
-- Block operations
-- Jump tags
-- Folding text
-- Indenting
-- ctags and cscope intergration
-- 100% vi compatibility mode
-- Plugins to add/extend functionality
-- Macros
-- vimscript, Vim's internal scripting language
-- Unicode support
-- Multi-language support
-- Integrated On-line help
-
-- Website: [www.vim.org][2]
-- Developer: Bram Moolenaar
-- License: GNU GPL compatible (charityware)
-- Version Number: 7.4
-
-----------
-
-### ne ###
-
-![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-ne.png)
-
-ne is a full screen open source text editor. It is intended to be an easier to learn alternative to vi, yet still portable across POSIX-compliant operating systems.
-
-ne is easy to use for the beginner, but powerful and fully configurable for the wizard, and most sparing in its resource usage.
-
-#### Features include:  ####
-
-
-- Three user interfaces: control keystrokes, command line, and menus; keystrokes and menus are completely configurable
-- Syntax highlighting
-- Full support for UTF-8 files, including multiple-column characters
-- The number of documents and clips, the dimensions of the display, and the file/line lengths are limited only by the integer size of the machine
-- Simple scripting language where scripts can be generated via an idiotproof record/play method
-- Unlimited undo/redo capability (can be disabled with a command)
-- Automatic preferences system based on the extension of the file name being edited
-- Automatic completion of prefixes using words in your documents as dictionary
-- File requester with completion features for easy file retrieval;
-- Extended regular expression search and replace à la emacs and vi
-- A very compact memory model easily load and modify very large files
-- Editing of binary files
-
-- Website: [ne.di.unimi.it][3]
-- Developer: Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis
-- License: GNU GPL v3
-- Version Number: 2.5
-
-----------
-
-### Zile ###
-
-![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-Zile.png)
-
-Zile Is Lossy Emacs (Zile) is a small Emacs clone. Zile is a customizable, self-documenting real-time display editor. Zile was written to be as similar as possible to Emacs; every Emacs user should feel comfortable with Zile.
-
-Zile is distinguished by a very small RAM memory footprint, of approximately 130kB, and quick editing sessions. It is 8-bit clean, allowing it to be used on any sort of file.
-
-#### Features include:  ####
-
-- Small but fast and powerful
-- Multi buffer editing with multi level undo
-- Multi window
-- Killing, yanking and registers
-- Minibuffer completion
-- Auto fill (word wrap)
-- Registers
-- Looks like Emacs. Key sequences, function and variable names are identical with Emacs's
-- Killing
-- Yanking
-- Auto line ending detection
-
-- Website: [www.gnu.org/software/zile][4]
-- Developer: Reuben Thomas, Sandro Sigala, David A. Capello
-- License: GNU GPL v2
-- Version Number: 2.4.11
-
-----------
-
-### nano ###
-
-![](http://www.linuxlinks.com/portal/content/reviews/Editors/Screenshot-nano.png)
-
-nano is a curses-based text editor. It is a clone of Pico, the editor of the Pine email client.
-
-The nano project was started in 1999 due to licensing issues with the Pine suite (Pine was not distributed under a free software license), and also because Pico lacked some essential features.
-
-nano aims to emulate the functionality and easy-to-use interface of Pico, while offering additional functionality, but without the tight mailer integration of the Pine/Pico package.
-
-nano, like Pico, is keyboard-oriented, controlled with control keys.
-
-#### Features include:  ####
-
-- Interactive search and replace
-- Color syntax highlighting
-- Go to line and column number
-- Auto-indentation
-- Feature toggles
-- UTF-8 support
-- Mixed file format auto-conversion
-- Verbatim input mode
-- Multiple file buffers
-- Smooth scrolling
-- Bracket matching
-- Customizable quoting string
-- Backup files
-- Internationalization support
-- Filename tab completion
-
-- Website: [nano-editor.org][5]
-- Developer: Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger
-- License: GNU GPL v3
-- Version Number: 2.2.6
-
---------------------------------------------------------------------------------
-
-via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html
-
-作者:Frazer Kline
-译者:[runningwater](https://github.com/runningwater)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
-
-[1]:http://foicica.com/textadept/
-[2]:http://www.vim.org/
-[3]:http://ne.di.unimi.it/
-[4]:http://www.gnu.org/software/zile/
-[5]:http://nano-editor.org/
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 3ab7f47b79..f8322fb1af 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 @@
+Translating by H-mudcup
 10 Truly Amusing Easter Eggs in Linux
 ================================================================================
 ![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG)
diff --git a/sources/share/20150527 3 Open Source Python Shells.md b/sources/share/20150527 3 Open Source Python Shells.md
deleted file mode 100644
index c510096670..0000000000
--- a/sources/share/20150527 3 Open Source Python Shells.md	
+++ /dev/null
@@ -1,99 +0,0 @@
-3 Open Source Python Shells
-================================================================================
-Python is a high-level, general-purpose, structured, powerful, open source programming language that is used for a wide variety of programming tasks. It features a fully dynamic type system and automatic memory management, similar to that of Scheme, Ruby, Perl, and Tcl, avoiding many of the complexities and overheads of compiled languages. The language was created by Guido van Rossum in 1991, and continues to grow in popularity.
-
-Python is a very useful and popular computer language. One of the benefits of using an interpreted language such as Python is exploratory programming with its interactive shell. You can try out code without having to write a script. But there are limitations with the Python shell. Fortunately, there are some excellent alternative Python shells that extend on the basic shell. They each offer an excellent interactive Python experience.
-
-----------
-
-### bpython ###
-
-![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-bpython.png)
-
-bpython is a fancy interface to the Python interpreter for Linux, BSD, OS X and Windows.
-
-The idea is to provide the user with all the features in-line, much like modern IDEs, but in a simple, lightweight package that can be run in a terminal window.
-
-bpython doesn't seek to create anything new or groundbreaking. Instead, it brings together a few neat ideas and focuses on practicality and usefulness.
-
-Features include:
-
-- In-line syntax highlighting - uses Pygments for lexing the code as you type, and colours appropriately
-- Readline-like autocomplete with suggestions displayed as you type
-- Expected parameter list for any Python function - seeks to display a list of parameters for any function you call
-- "Rewind" function to pop the last line of code from memory and re-evaluate
-- Send the code you've entered off to a pastebin
-- Save the code you've entered to a file
-- Auto-indentation
-- Python 3 support
-
-- Website: [www.bpython-interpreter.org][1]
-- Developer: Bob Farrell and contributors
-- License: MIT License
-- Version Number: 0.14.1
-
-----------
-
-### IPython ###
-
-![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-ipython.png)
-
-IPython is an enhanced interactive Python shell. It provides a rich toolkit to help you make the most out of using Python interactively.
-
-IPython can be used as a replacement for the standard Python shell, or it can be used as a complete working environment for scientific computing (like Matlab or Mathematica) when paired with the standard Python scientific and numerical tools. It supports dynamic object introspections, numbered input/output prompts, a macro system, session logging, session restoring, complete system shell access, verbose and colored traceback reports, auto-parentheses, auto-quoting, and is embeddable in other Python programs.
-
-Features include:
-
-- Powerful interactive shells (terminal and Qt-based)
-- A browser-based notebook with support for code, rich text, mathematical expressions, inline plots and other rich media
-- Support for interactive data visualization and use of GUI toolkits
-- Flexible, embeddable interpreters to load into your own projects
-- Easy to use, high performance tools for parallel computing
-
-- Website: [ipython.org][2]
-- Developer: The IPython Development Team
-- License: BSD
-- Version Number: 3.1
-
-----------
-
-### DreamPie ###
-
-![](http://www.linuxlinks.com/portal/content/reviews/Programming/Screenshot-DreamPie.png)
-
-DreamPie is a Python shell which is designed to be reliable and fun.
-
-DreamPie can use just about any Python interpreter (Jython, IronPython, PyPy).
-
-Features include:
-
-- New concept for an interactive shell: the window is divided into the history box, which lets you view previous commands and their output, and the code box, where you write your code. This allows you to edit any amount of code, just like in your favorite editor, and execute it when it's ready. You can also copy code from anywhere, edit it and run it instantly
-- The Copy code only command will copy the code you want to keep, so you can save it in a file. The code is already formatted nicely with a four-space indentation
-- Automatic completion of attributes and file names
-- Automatically displays function arguments and documentation
-- Keeps your recent results in the result history, for later use
-- Can automatically fold long outputs, so you can concentrate on what's important
-- Save the history of the session as an HTML file, for future reference. You can then load the history file into DreamPie, and quickly redo previous commands
-- Automatically adds parentheses and optionally quotes when you press space after functions and methods. For example, type execfile fn and get execfile("fn")
-- Supports interactive plotting with matplotlib
-- Xupport for Python 2.5, Python 2.6, Python 3.1, Jython 2.5, IronPython 2.6, and PyPy
-- Extremely fast and responsive.
-
-- Website: [www.dreampie.org][3]
-- Developer: Noam Yorav-Raphael
-- License: GNU GPL v3
-- Version Number: 1.2.1
-
---------------------------------------------------------------------------------
-
-via: http://www.linuxlinks.com/article/20150523032756576/PythonShells.html
-
-作者:Frazer Kline
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[1]:http://www.bpython-interpreter.org/
-[2]:http://ipython.org/
-[3]:http://www.dreampie.org/
\ No newline at end of file
diff --git a/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md b/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md
new file mode 100644
index 0000000000..638482a144
--- /dev/null
+++ b/sources/share/20150610 Tickr Is An Open-Source RSS News Ticker for Linux Desktops.md	
@@ -0,0 +1,95 @@
+Tickr Is An Open-Source RSS News Ticker for Linux Desktops
+================================================================================
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/rss-tickr.jpg)
+
+**Latest! Latest! Read all about it!**
+
+Alright, so the app we’re highlighting today isn’t quite the binary version of an old newspaper seller — but it is a great way to have the latest news brought to you, on your desktop.
+
+Tick is a GTK-based news ticker for the Linux desktop that scrolls the latest headlines and article titles from your favourite RSS feeds in horizontal strip that you can place anywhere on your desktop.
+
+Call me Joey Calamezzo; I put mine on the bottom TV news station style.
+
+“Over to you, sub-heading.”
+
+### RSS — Remember That? ###
+
+“Thanks paragraph ending.”
+
+In an era of push notifications, social media, and clickbait, cajoling us into reading the latest mind-blowing, humanity saving listicle ASAP, RSS can seem a bit old hat.
+
+For me? Well, RSS lives up to its name of Really Simple Syndication. It’s the easiest, most manageable way to have news  come to me. I can manage and read stuff when I want; there’s no urgency to view lest the tweet vanish into the stream or the push notification vanish.
+
+The beauty of Tickr is in its utility. You can have a constant stream of news trundling along the bottom of your screen, which you can passively glance at from time to time.
+
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/tickr-close-up-750x58.jpg)
+
+There’s no pressure to ‘read’ or ‘mark all read’ or any of that. When you see something you want to read you just click it to open it in a web browser.
+
+### Setting it Up ###
+
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/tickr-rss-settings.jpg)
+
+Although Tickr is available to install from the Ubuntu Software Centre it hasn’t been updated for a long time. Nowhere is this sense of abandonment more keenly felt than when opening the unwieldy and unintuitive configuration panel.
+
+To open it:
+
+1. Right click on the Tickr bar
+1. Go to Edit > Preferences
+1. Adjust the various settings
+
+Row after row of options and settings, few of which seem to make sense at first. But poke and prod around and you’ll controls for pretty much everything, including:
+
+- Set scrolling speed
+- Choose behaviour when mousing over
+- Feed update frequency
+- Font, including font sizes and color
+- Separator character  (‘delineator’)
+- Position of Tickr on screen
+- Color and opacity of Tickr bar
+- Choose how many articles each feed displays
+
+One ‘quirk’ worth mentioning is that pressing the ‘Apply’ only updates the on-screen Tickr to preview changes. For changes to take effect when you exit the Preferences window you need to click ‘OK’.
+
+Getting the bar to sit flush on your display can also take a fair bit of tweaking, especially on Unity.
+
+Press the “full width button” to have the app auto-detect your screen width. By default when placed at the top or bottom it leaves a 25px gap (the app was created back in the days of GNOME 2.x desktops). After hitting the top or bottom buttons just add an extra 25 pixels to the input box compensate for this.
+
+Other options available include: choose which browser articles open in; whether Tickr appears within a regular window frame; whether a clock is shown; and how often the app checks feed for articles.
+
+#### Adding Feeds ####
+
+Tickr comes with a built-in list of over 30 different feeds, ranging from technology blogs to mainstream news services.
+
+![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/feed-picker-750x398.jpg)
+
+You can select as many of these as you like to show headlines in the on screen ticker. If you want to add your own feeds you can: –
+
+1. Right click on the Tickr bar
+1. Go to File > Open Feed
+1. Enter Feed URL
+1. Click ‘Add/Upd’ button
+1. Click ‘OK (select)’
+
+To set  how many items from each feed shows in the ticker change the “Read N items max per feed” in the other preferences window.
+
+### Install Tickr in Ubuntu 14.04 LTS and Up ###
+
+So that’s Tickr. It’s not going to change the world but it will keep you abreast of what’s happening in it.
+
+To install it in Ubuntu 14.04 LTS or later head to the Ubuntu Software Centre but clicking the button below.
+
+- [Click to install Tickr form the Ubuntu Software Center][1]
+
+--------------------------------------------------------------------------------
+
+via: http://www.omgubuntu.co.uk/2015/06/tickr-open-source-desktop-rss-news-ticker
+
+作者:[Joey-Elijah Sneddon][a]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://plus.google.com/117485690627814051450/?rel=author
+[1]:apt://tickr
\ No newline at end of file
diff --git a/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md
new file mode 100644
index 0000000000..c6fe06832a
--- /dev/null
+++ b/sources/share/20150629 Backup with these DeDuplicating Encryption Tools.md	
@@ -0,0 +1,158 @@
+Backup with these DeDuplicating Encryption Tools
+================================================================================
+Data is growing both in volume and value. It is becoming increasingly important to be able to back up and restore this information quickly and reliably. As society has adapted to technology and learned how to depend on computers and mobile devices, there are few that can deal with the reality of losing important data. Of firms that suffer the loss of data, 30% fold within a year, 70% cease trading within five years. This highlights the value of data.
+
+With data growing in volume, improving storage utilization is pretty important. In computing, data deduplication is a specialized data compression technique for eliminating duplicate copies of repeating data. This technique therefore improves storage utilization.
+
+Data is not only of interest to its creator. Governments, competitors, criminals, snoopers may be very keen to access your data. They might want to steal your data, extort money from you, or see what you are up to. Enryption is essential to protect your data.
+
+So the solution is a deduplicating encrypting backup software.
+
+Making file backups is an essential activity for all users, yet many users do not take adequate steps to protect their data. Whether a computer is being used in a corporate environment, or for private use, the machine's hard disk may fail without any warning signs. Alternatively, some data loss occurs as a result of human error. Without regular backups being made, data will inevitably be lost even if the services of a specialist recovery organisation are used.
+
+This article provides a quick roundup of 6 deduplicating encryption backup tools. 
+
+----------
+
+### Attic ###
+
+Attic is a deduplicating, encrypted, authenticated and compressed backup program written in Python. The main goal of Attic is to provide an efficient and secure way to backup data. The data deduplication technique used makes Attic suitable for daily backups since only the changes are stored. 
+
+Features include: 
+
+- Easy to use
+- Space efficient storage variable block size deduplication is used to reduce the number of bytes stored by detecting redundant data
+- Optional data encryption using 256-bit AES encryption. Data integrity and authenticity is verified using HMAC-SHA256
+- Off-site backups with SDSH
+- Backups mountable as filesystems
+
+Website: [attic-backup.org][1]
+
+----------
+
+### Borg ###
+
+Borg is a fork of Attic. It is a secure open source backup program designed for efficient data storage where only new or modified data is stored.
+
+The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique used makes Borg suitable for daily backups since only the changes are stored. The authenticated encryption makes it suitable for backups to not fully trusted targets.
+
+Borg is written in Python. Borg was created in May 2015 in response to the difficulty of getting new code or larger changes incorporated into Attic.
+
+Features include:
+
+- Easy to use
+- Space efficient storage variable block size deduplication is used to reduce the number of bytes stored by detecting redundant data
+- Optional data encryption using 256-bit AES encryption. Data integrity and authenticity is verified using HMAC-SHA256
+- Off-site backups with SDSH
+- Backups mountable as filesystems
+
+Borg is not compatible with Attic.
+
+Website: [borgbackup.github.io/borgbackup][2]
+
+----------
+
+### Obnam ###
+
+Obnam (OBligatory NAMe) is an easy to use, secure Python based backup program. Backups can be stored on local hard disks, or online via the SSH SFTP protocol. The backup server, if used, does not require any special software, on top of SSH.
+
+Obnam performs de-duplication by splitting up file data into chunks, and storing those individually. Generations are incremental backups; Every backup generation looks like a fresh snapshot, but is really incremental. Obnam is developed by Lars Wirzenius.
+
+Features include:
+
+- Easy to use
+- Snapshot backups
+- Data de-duplication, across files, and backup generations
+- Encrypted backups, using GnuPG
+- Backup multiple clients to a single repository
+- Backup checkpoints (creates a "save" every 100MBs or so)
+- Number of options for performance tuning including lru-size and/or upload-queue-size
+- MD5 checksum algorithm for recognising duplicate data chunks
+- Store backups to a server via SFTP
+- Supports both push (i.e. Run on the client) and pull (i.e. Run on the server) methods
+
+Website: [obnam.org][3]
+
+----------
+
+### Duplicity ###
+
+Duplicity incrementally backs up files and directory by encrypting tar-format volumes with GnuPG and uploading them to a remote (or local) file server. To transmit data it can use ssh/scp, local file access, rsync, ftp, and Amazon S3.
+
+Because duplicity uses librsync, the incremental archives are space efficient and only record the parts of files that have changed since the last backup. As the software uses GnuPG to encrypt and/or sign these archives, they will be safe from spying and/or modification by the server.
+
+Currently duplicity supports deleted files, full unix permissions, directories, symbolic links, fifos, etc.
+
+The duplicity package also includes the rdiffdir utility. Rdiffdir is an extension of librsync's rdiff to directories; it can be used to produce signatures and deltas of directories as well as regular files.
+
+Features include:
+
+- Simple to use
+- Encrypted and signed archives (using GnuPG)
+- Bandwidth and space efficient, using the rsync algorithm
+- Standard file format
+- Choice of remote protocol
+    - Local storage
+    - scp/ssh
+    - ftp
+    - rsync
+    - HSI
+    - WebDAV
+    - Amazon S3
+
+Website: [duplicity.nongnu.org][4]
+
+----------
+
+### ZBackup ###
+
+ZBackup is a versatile globally-deduplicating backup tool.
+
+Features include:
+
+- Parallel LZMA or LZO compression of the stored data. You can mix LZMA and LZO in a repository
+- Built-in AES encryption of the stored data
+- Possibility to delete old backup data
+- Use of a 64-bit rolling hash, keeping the amount of soft collisions to zero
+- Repository consists of immutable files. No existing files are ever modified
+- Written in C++ only with only modest library dependencies
+- Safe to use in production
+- Possibility to exchange data between repos without recompression
+- Uses a 64-bit modified Rabin-Karp rolling hash
+
+Website: [zbackup.org][5]
+
+----------
+
+### bup ###
+
+bup is a program written in Python that backs things up. It's short for "backup". It provides an efficient way to backup a system based on the git packfile format, providing fast incremental saves and global deduplication (among and within files, including virtual machine images).
+
+bup is released under the LGPL version 2 license.
+
+Features include:
+
+- Global deduplication (among and within files, including virtual machine images)
+- Uses a rolling checksum algorithm (similar to rsync) to split large files into chunks
+- Uses the packfile format from git
+- Writes packfiles directly offering fast incremental saves
+- Can use "par2" redundancy to recover corrupted backups
+- Mount your bup repository as a FUSE filesystem
+
+Website: [bup.github.io][6]
+
+--------------------------------------------------------------------------------
+
+via: http://www.linuxlinks.com/article/20150628060000607/BackupTools.html
+
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[1]:https://attic-backup.org/
+[2]:https://borgbackup.github.io/borgbackup/
+[3]:http://obnam.org/
+[4]:http://duplicity.nongnu.org/
+[5]:http://zbackup.org/
+[6]:https://bup.github.io/
\ No newline at end of file
diff --git a/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md
new file mode 100644
index 0000000000..cfb84d8866
--- /dev/null
+++ b/sources/share/20150629 First Stable Version Of Atom Code Editor Has Been Released.md	
@@ -0,0 +1,69 @@
+sevenot translating
+First Stable Version Of Atom Code Editor Has Been Released
+================================================================================
+![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable.png)
+
+[Atom 1.0][1] is here. One of the [best open source code editors][2], [Atom][3] was available for public uses for almost a year but this is the first stable version of the most talked about text/code editor of recent times. Promoted as the “hackable text editor for 21st century”, this project of [Github][4] has already been downloaded 1.5 million times in the past and currently it has over 350,000 monthly active users.
+
+### It’s been a long time ###
+
+Rome was not built in a day and neither was Atom. Since it was first conceptualized in 2008 till the first stable release this month, it has taken several years and hundreds of contributors from across the globe, along with main developers working on Atom core. A quick look at the journey of Atom can be seen in the picture below:
+
+![Image credit: Atom](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/06/Atom_stable_timeline.jpeg)
+Image credit: Atom
+
+### Back to the future ###
+
+This launch of Atom 1.0 is announced with a retro video showing the capabilities of the editor. Resembling to 70’s science fiction TV series, this will be the coolest video you are going to watch today :)
+
+注:youtube视频,不行做个链接吧
+
+
+### Features of Atom text editor ###
+
+- Cross-platform editing
+- Built-in package manager
+- Smart autocompletion
+- File system browser
+- Multiple panes
+- Find and replace
+- Highly customizable
+- Modern look
+
+### Get Atom 1.0 ###
+
+Atom 1.0 is available for Linux, Windows and Mac OS X. For Debian based Linux distributions such as Ubuntu and Linux Mint, Atom provides .deb binaries. For Fedora, it also has .rpm binaries. You can also get the source code, if you like. The links below will let you download the latest stable version.
+
+- [Atom .deb][5]
+- [Atom .rpm][6]
+- [Atom Source Code][7]
+
+If you prefer, you can [install Atom in Ubuntu using PPA][8]. The PPA is not official though.
+
+注:下面是一个调查,可以发布的时候在文章内发布个调查
+
+#### Are you excited about Atom? ####
+
+- Oh Yes! This is the best thing that could happen to programmers.
+- Not really. I have seen better editors.
+- Don't care. My default text editor does the job just fine.
+
+--------------------------------------------------------------------------------
+
+via: http://itsfoss.com/atom-stable-released/
+
+作者:[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://blog.atom.io/2015/06/25/atom-1-0.html
+[2]:http://itsfoss.com/best-modern-open-source-code-editors-for-linux/
+[3]:https://atom.io/
+[4]:https://github.com/
+[5]:https://atom.io/download/deb
+[6]:https://atom.io/download/rpm
+[7]:https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md
+[8]:http://itsfoss.com/install-atom-text-editor-ubuntu-1404-linux-mint-17/
diff --git a/sources/talk/20141211 Open source all over the world.md b/sources/talk/20141211 Open source all over the world.md
deleted file mode 100644
index bd306edd5a..0000000000
--- a/sources/talk/20141211 Open source all over the world.md	
+++ /dev/null
@@ -1,148 +0,0 @@
-Open source all over the world
-================================================================================
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png)
-
-Image by : opensource.com
-
-After a full day at the annual meeting of the Opensource.com [Community Moderators][1], it was time for the the last item on the agenda which simply said "Special Guest: TBD." [Jason Hibbets][2], project lead and community manager for [Opensource.com][3], stood up and began explaining, "In case it wasn't going to happen, I didn't want to say who it was. Months ago I asked for any dates he'd be in town. I got two, and picked one. This was one day out of three weeks that Jim was in town."
-
-The moderators, in town from all over the world for the [All Things Open conference][4], stirred at the table. Their chairs squeaked and snuck a few inches edgewise.
-
-"We're going to get a half hour to hear from him and take a couple questions," said Jason.
-
-The door opened, and as if it had been waiting for him the whole time, the only vacant seat at the head of the table was soon occupied by a tall fellow.
-
-"How is everyone doing?" said the man. No suit, just a button down shirt and slacks.
-
-The next tallest man in the room, [Jeff Mackanic][5], senior director of Global Awareness at Red Hat, explained that the majority of the Community Moderator team was present today. He asked everyone to quickly introduce themselves.
-
-"[Jen Wike Huger][6]. Content Manager for Opensource.com. Happy to have everyone here."
-
-"[Nicole][7]. Vice president of education at [ByWater Solutions][8]. We do FOSS for libraries. I travel and teach people how to use software."
-
-"[Robin][9]. I've been participating in the Moderator program since 2013. I do lots of stuff for OSDC and work in the [City of the Hague][10], maintaining their [website][11]."
-
-"[Marcus Hanwell][12]. Originally from England, I'm now at [Kitware][13]. I'm the technology lead on FOSS science software. I work with national labs and use things like [Titan][14] Z doing [GPU programming][15]. I've worked with [Gentoo][16] and [KDE][17]. Most of all, I'm passionate about joining FOSS and open science."
-
-"[Phil Shapiro][18]. I administrate 28 Linux work stations at a small library in D.C. I consider these folks my coworkers and colleagues. And it's wonderful to know that we can all feed into the energy and share ideas. My main interests are how FOSS intersects with dignity, and enhancing dignity."
-
-"[Joshua Holm][19]. I spend most of my time staring at system updates and helping people search for jobs on the Internet."
-
-"[Mel Chernoff][20]: I work here at Red Hat, primarily on the [government][21] channel with [Jason Hibbets][22] and [Mark Bohannon][23]."
-
-"[Scott Nesbitt][24]: I write for many things, but have been using FOSS for long time. I'm a 'mere mortal' just trying to be more productive, not a sysadmin or programmer. I help people meld FOSS into their business and personal lives."
-
-"[Luis Ibanez][25]: I just joined [Google]26], but I'm interested in DIY and FOSS."
-
-"[Remy DeCausemaker][27]: Resident Hackademic at the [RIT MAGIC Center][28] and Adjunct Professor for the [Department of Interactive Games and Media][29]. Been writing for Opensource.com for about four years now."
-
-"You teach courses for the [new FOSS Minor then][30]," said Jim. "Very cool."
-
-"[Jason Baker][31]. I'm a Red Hat cloud expert, mostly doing work around [OpenStack][32]."
-
-"[Mark Bohannan][33]. I'm with Red Hat Global Public Policy, and I work out of Washington. Like Mel, I spend a good deal of time writing for, or finding folks from, the legal and government channels. I've found an excellent outlet to discuss positive things happening in government."
-
-"[Jason Hibbets][34]. I organize the organized chaos here."
-
-The room has a good chuckle.
-
-"I organize this chaos too, you could say," says the brownish-red haired fellow with a gleaming white smile. The laughs grow then quieten. Breaths become baited.
-
-I sat to his left and had a moment to look up from transcribing to glance up. I noticed the hint of a smile behind the knowing eyes of a man who has led the company since January 2008, [Jim Whitehurst][35], president and CEO of Red Hat.
-
-"I have one of the greatest jobs on Earth," began Whitehurst, as he leaned back, crossed his legs, and put his arms behind his head. "I get to lead Red Hat, travel around the world and see what goes on. In my seven years here, the amazing thing about FOSS, and, broadly open innovation, is that it has left the fringe. And now, I would argue, IT is in the same place that FOSS was in its early days. We are seeing FOSS going from an alternative to driving innovation. Our customers are seeing it, too. They're using FOSS not because it is cheaper, but because it provides them with control and innovative solutions. It's a global phenomenon, too. For instance, I was just in India, and discovered that, for them, there were two reasons for embracing of open source: one, access to innovation, and two, the market is somewhat different and wanting full control.”
-
-"The [Bombay Stock Exchange][36] wants to own all the source and control it. That is not something you would have heard five years ago in a stock exchange, anywhere. Back then, the early knock on FOSS was that it was creating free copies of things that already existed.' If you look today, virtually everything in big data is happening in FOSS. Almost any new framework, language, and methodology, including mobile (though excluding devices), are all happening first in open source.”
-
-"This is because users have reached size and scale. It's not just Red Hat—it's [Google][37], [Amazon][38], [Facebook][39], and others, they want to solve their own problems, and do it the open source way. And forget licensing—open source is much more than that. We've built a vehicle, and a set of norms. Things like [Hadoop][40], [Cassandra][41], and other tools. Fact is, open source drives innovation. For example, Hadoop was in production before any vendor realized there was a problem of that scale that needed to be solved. They actually have the wherewithal to solve their own problems, and the social tech and principles to do that. "Open source is now the default technology for many categories. This is especially true as the world moves more and more to content importance, such as [3D printing][42] and other physical products that take information content and apply it.”
-
-"We have this cool thing in one area, source code, but it is limited. But there are still many opportunities in different industries. We must ask ourselves, 'What can open source do for education, government, and legal? What are the parallels? And what can other areas learn with us?'"
-
-"There's also the matter of content. Content is now free, and we can invest in more free content, sure. But we need free content that has a business model built around it. That is something that more people should care about. If you believe open innovation is better, then we need more models."
-
-"Education worries me with its fixation on 'content' rather than 'communities.' For example, everywhere I go, I hear university presidents say, 'Wait, education is going to be free?!' The fact that FOSS is free for downstream is great, but the upstream is really powerful. Distributing free courses is great, but we need communities to iterate and make it better. That is something that a lot of different people are doing, and Opensource.com is a place to share what is going on in this space. The question is not so much 'How do we take content?' as it is 'How do you build and distribute it? How do you make sure it is a living thing that gets better, and can morph for different areas?'"
-
-"But the potential to change the world is limitless, and it's amazing how much progress we've already made. Six years ago we were obsessed about defining a mission statement. We started by saying, 'We are the leader,' but that was the wrong word, because it implied control. Active participant didn't quite get it either... [Máirín Duffy][43] came up with the word [catalyst][44]. And so, we became Red Hat, the company that creates environments to agitate action and catalyze direction.”
-
-"Opensource.com is a catalyst in other areas, and that is what Opensource.com is about. I hope you see yourselves this way, too. The quality of content then, when we started, versus now, is incredible. You can see it getting better every quarter. Thank you for investing your time. Thank you for being catalysts. This is a chance for us all to make the world a better place. And I'd love to hear from you."
-
-I stole a glimpse of everyone at the table: more than a few people had tears in their eyes.
-
-Then, Whitehurst revisits the open education topic of conversation again. "Taking it to an extreme, let's say you have a course about the book [Ulysses][45]. Here, you can explore how to crowdsource a model and get people to work together within the course. Well, it's the same with a piece of code: people work together, and the code itself gets better over time."
-
-At this point, I get to have my say. Words like fundamental and possibly irreconcilable came up when discussing the differences between FOSS and academic communities.
-
-**Remy**: "Retraction is career death." Releasing data or code with your paper could be devastating if you make a mistake. School has always been about avoiding failure and divining 'right answers'. Copying is cheating. Wheels are recreated from scratch ritualistically. In FOSS, you work to fail fastest, but in academia, you invite invalidation."
-
-**Nicole**: "There are a lot of egos in academia. You need a release manager."
-
-**Marcus**: "To collaborate, you have to show the bits you don't understand, and that happens behind closed doors. The reward model is all about what you can take credit for. We need to change the reward model. Publish as much as you can. We release eventually, but we want to release early."
-
-**Luis**: "Make teamwork and sharing a priority. And Red Hat can say that to them more."
-
-**Jim**: "Is there an active role that companies can play in that?"
-
-[Phil Shapiro][46]: "I'm interested in tipping points in FOSS. It drives me nuts that the Fed hasn't switched to [LibreOffice][47]. We're not spending tax dollars on software, and certainly shouldn't be spending on word processing or Microsoft Office."
-
-**Jim**: "We have advocated for that. A lot. Can we do more? That's a valid question. Primarily, we've made progress in the places we have products. We have a solid franchise in government. We are larger per IT spend there than the private sector. Banks and telcos are further along than the government. We've done better in Europe, and I think they have less lobbying dollars at work there, than here. This next generation of computing is almost like a 'do-over'. We are making great progress elsewhere, but it is concerning."
-
-Suddenly, the door to the room opened. Jim turned and nodded towards his executive assistant standing in the doorway; it was time for his next meeting. He uncrossed his legs, leaned forward, and stood. He thanked everyone again for their work and dedication, smiled, and was out the door... leaving us all a bit more inspired.
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source
-
-作者:[Remy][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
-
-[a]:https://opensource.com/users/remyd
-[1]:http://opensource.com/community-moderator-program
-[2]:https://twitter.com/jhibbets
-[3]:http://opensource.com/
-[4]:http://allthingsopen.org/
-[5]:http://opensource.com/users/mackanic
-[6]:https://twitter.com/JenWike
-[7]:http://opensource.com/users/nengard
-[8]:http://bywatersolutions.com/
-[9]:http://opensource.com/life/13/7/community-spotlight-robin-muilwijk
-[10]:https://en.wikipedia.org/wiki/The_Hague
-[11]:http://www.denhaag.nl/en.htm
-[12]:https://twitter.com/mhanwell
-[13]:http://www.kitware.com/
-[14]:http://www.nvidia.com/gtx-700-graphics-cards/gtx-titan-z/
-[15]:https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units
-[16]:https://www.gentoo.org/
-[17]:http://kde.org/
-[18]:https://twitter.com/philshapiro
-[19]:http://opensource.com/community/13/9/contributor-spotlight-joshua-holm
-[20]:http://opensource.com/users/melanie
-[21]:http://opensource.com/government
-[22]:https://twitter.com/jhibbets
-[23]:https://twitter.com/markbotech
-[24]:http://scottnesbitt.me/
-[25]:http://opensource.com/users/luis-ibanez
-[26]:http://google.com/
-[27]:http://twitter.com/remy_d
-[28]:http://foss.rit.edu/
-[29]:http://igm.rit.edu/
-[30]:http://www.rit.edu/news/story.php?id=50590
-[31]:https://twitter.com/jehb
-[32]:http://openstack.org/
-[33]:https://twitter.com/markbotech
-[34]:https://twitter.com/jhibbets
-[35]:http://www.redhat.com/en/about/company/management/james-whitehurst
-[36]:http://www.bseindia.com/
-[37]:http://google.com/
-[38]:https://mail.corp.redhat.com/service/home/%7E/Amazon
-[39]:https://mail.corp.redhat.com/service/home/%7E/Facebook
-[40]:https://hadoop.apache.org/
-[41]:https://cassandra.apache.org/
-[42]:https://en.wikipedia.org/wiki/3D_printing
-[43]:https://twitter.com/mairin
-[44]:http://jobs.redhat.com/life-at-red-hat/our-culture/
-[45]:http://www.gutenberg.org/ebooks/4300
-[46]:https://twitter.com/philshapiro
-[47]:http://libreoffice.org/
diff --git a/sources/talk/20150128 The top 10 rookie open source projects.md b/sources/talk/20150128 The top 10 rookie open source projects.md
deleted file mode 100644
index 0dfcb07a48..0000000000
--- a/sources/talk/20150128 The top 10 rookie open source projects.md	
+++ /dev/null
@@ -1,153 +0,0 @@
-The top 10 rookie open source projects
-================================================================================
-Black Duck presents its Open Source Rookies of the Year -- the 10 most exciting, active new projects germinated by the global open source community 
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_01-100564902-orig.jpeg)
-
-### Open Source Rookies of the Year ###
-
-Each year sees the start of thousands of new open source projects. Only a handful gets real traction. Some projects gain momentum by building on existing, well-known technologies; others truly break new ground. Many projects are created to solve a simple development problem, while others begin with loftier intentions shared by like-minded developers around the world.
-
-Since 2009, the open source software logistics company Black Duck has identified the [Open Source Rookies of the Year][1], based on activity tracked by its [Open Hub][2] (formerly Ohloh) site. This year, we're delighted to present 10 winners and two honorable mentions for 2015, selected from thousands of open source projects. Using a weighted scoring system, points were awarded based on project activity, the pace of commits, and several other factors.
-
-Open source has become the industry's engine of innovation. This year, for example, growth in projects related to Docker containerization trumped every other rookie area -- and not coincidentally reflected the most exciting area of enterprise technology overall. At the very least, the projects described here provide a window on what the global open source developer community is thinking, which is fast becoming a good indicator of where we're headed.
-
-### 2015 Open Source Rookie of the Year: DebOps ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_02-100564903-orig.jpeg)
-
-[DebOps][3] is a collection of [Ansible][4] playbooks and roles, scalable from one container to an entire data center. Founder Maciej Delmanowski open-sourced DebOps to ensure his work outlived his current work environment and could grow in strength and depth from outside contributors.
-
-DebOps began at a small university in Poland that ran its own data center, where everything was configured by hand. Crashes sometimes led to days of downtime -- and Delmanowski realized that a configuration management system was needed. Starting with a Debian base, DebOps is a group of Ansible playbooks that configure an entire data infrastructure. The project has been implemented in many different working environments, and the founders plan to continue supporting and improving it as time goes on.
-
-### 2015 Open Source Rookie of the Year: Code Combat ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_03-100564904-gallery.idge.jpg)
-
-The traditional pen-and-paper way of learning falls short for technical subjects. Games, however, are all about engagement -- which is why the founders of [CodeCombat][5] went about creating a multiplayer programming game to teach people how to code.
-
-At its inception, CodeCombat was an idea for a startup, but the founders decided to create an open source project instead. The idea blossomed within the community, and the project gained contributors at a steady rate. A mere two months after its launch, the game was accepted into Google’s Summer of Code. The game reaches a broad audience and is available in 45 languages. CodeCombat hopes to become the standard for people who want to learn to code and have fun at the same time.
-
-### 2015 Open Source Rookie of the Year: Storj ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_04-100564905-gallery.idge.jpg)
-
-[Storj][6] is a peer-to-peer cloud storage network that implements end-to-end encryption, enabling users to transfer and share data without reliance on a third party. Based on bitcoin blockchain technology and peer-to-peer protocols, Storj provides secure, private, and encrypted cloud storage.
-
-Opponents of cloud-based data storage worry about cost efficiencies and vulnerability to attack. Intended to address both concerns, Storj is a private cloud storage marketplace where space is purchased and traded via Storjcoin X (SJCX). Files uploaded to Storj are shredded, encrypted, and stored across the community. File owners are the sole individuals who possess keys to the encrypted information.
-
-The proof of concept for this decentralized cloud storage marketplace was first presented at the Texas Bitcoin Conference Hackathon in 2014. After winning first place in the hackathon, the project founders and leaders used open forums, Reddit, bitcoin forums, and social media to grow an active community, now an essential part of the Storj decision-making process.
-
-### 2015 Open Source Rookie of the Year: Neovim ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_05-100564906-orig.jpg)
-
-Since its inception in 1991, Vim has been a beloved text editor adopted by millions of software developers. [Neovim][6] is the next generation.
-
-The software development ecosystem has experienced exponential growth and innovation over the past 23 years. Neovim founder Thiago de Arruda knew that Vim was lacking in modern-day features and development speed. Although determined to preserve the signature features of Vim, the community behind Neovim seeks to improve and evolve the technology of its favorite text editor. Crowdfunding initially enabled de Arruda to focus six uninterrupted months on launching this endeavor. He credits the Neovim community for supporting the project and for inspiring him to continue contributing.
-
-### 2015 Open Source Rookie of the Year: CockroachDB ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_06-100564907-orig.jpg)
-
-Former Googlers are bringing a big-company data solution to open source in the form of [CockroachDB][8], a scalable, geo-replicated, transactional data store.
-
-To maintain the terabytes of data transacted over its global online properties, Google developed Spanner. This powerful tool provides Google with scalability, survivability, and transactionality -- qualities that the team behind CockroachDB is serving up to the open source community. Like an actual cockroach, CockroachDB can survive without its head, tolerating the failure of any node. This open source project has a devoted community of experienced contributors, actively cultivated by the founders via social media, GitHub, networking, conferences, and meet-ups.
-
-### 2015 Open Source Rookie of the Year: Kubernetes ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_07-100564908-orig.jpg)
-
-In introducing containerized software development to the open source community, [Docker][9] has become the backbone of a strong, innovative set of tools and technologies. [Kubernetes][10], which Google introduced last June, is an open source container management tool used to accelerate development and simplify operations.
-
-Google has been using containers for years in its internal operations. At the summer 2014 DockerCon, the Internet giant open-sourced Kubernetes, which was developed to meet the needs of the exponentially growing Docker ecosystem. Through collaborations with other organizations and projects, such as Red Hat and CoreOS, Kubernetes project managers have grown their project to be the No. 1 downloaded tool on the Docker Hub. The Kubernetes team hopes to expand the project and grow the community, so software developers can spend less time managing infrastructure and more time building the apps they want.
-
-### 2015 Open Source Rookie of the Year: Open Bazaar ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_08-100564909-orig.jpg)
-
-[OpenBazaar][11] is a decentralized marketplace for trading with anyone using bitcoin. The proof of concept for OpenBazaar was born at a hackathon, where its founders combined BitTorent, bitcoin, and traditional financial server methodologies to create a censorship-resistant trading platform. The OpenBazaar team sought new members, and before long they were able to expand the OpenBazaar community immensely. The table stakes of OpenBazaar -- transparency and a common goal to revolutionize trade and commerce -- are helping founders and contributors work toward a real-world, uncontrolled, and decentralized marketplace.
-
-### 2015 Open Source Rookie of the Year: IPFS ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_09-100564910-orig.jpg)
-
-[IPFS (InterPlanetary File System)][12] is a global, versioned, peer-to-peer file system.It synthesizes many of the ideas behind Git, BitTorrent, and HTTP to bring a new data and data structure transport protocol to the open Web.
-
-Open source is known for developing simple solutions to complex problems that result in many innovations, but these powerful projects represent only one slice of the open source community. IFPS belong to a more radical group whose proof of concept seems daring, outrageous, and even unattainable -- in this case, a peer-to-peer distributed file system that seeks to connect all computing devices. This possible HTTP replacement maintains a community through multiple mediums, including the Git community and an IRC channel that has more than 100 current contributors. This “crazy” idea will be available for alpha testing in 2015.
-
-### 2015 Open Source Rookie of the Year: cAdvisor ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_10-100564911-orig.jpg)
-
-[cAdvisor (Container Advisor)][13] is a daemon that collects, aggregates, processes, and exports information about running containers, providing container users with an understanding of resource usage and performance characteristics. For each container, cAdvisor keeps resource isolation parameters, historical resource usage, histograms of complete historical resource usage, and network statistics. This data is exported by container and across machines.
-
-cAdvisor can run on most Linux distros and supports many container types, including Docker. It has become the de facto monitoring agent for containers, has been integrated into many systems, and is one of the most downloaded images on the Docker Hub. The team hopes to grow cAdvisor to understand application performance more deeply and to integrate this information into clusterwide systems.
-
-### 2015 Open Source Rookie of the Year: Terraform ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_11-100564912-orig.jpg)
-
-[Terraform][14] provides a common configuration to launch infrastructure, from physical and virtual servers to email and DNS providers. The idea is to encompass everything from custom in-house solutions to services offered by public cloud platforms. Once launched, Terraform enables ops to change infrastructure safely and efficiently as the configuration evolves.
-
-Working at a devops company, Terraform.io's founders identified a pain point in codifying the knowledge required to build a complete data center, from plugged-in servers to a fully networked and functional data center. Infrastructure is described using a high-level configuration syntax, which allows a blueprint of your data center to be versioned and treated as you would any other code. Sponsorship from the well-respected open source company HashiCorp helped launch the project.
-
-### Honorable mention: Docker Fig ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_12-100564913-orig.jpg)
-
-[Fig][15] provides fast, isolated development environments using [Docker][16]. It moves the configuration required to orchestrate Docker into a simple fig.yml file. It handles all the work of building and running containers and forwarding their ports, as well as sharing volumes and linking them.
-
-Orchard formed Fig last year to create a new system of tools to make Docker work. It was developed as a way of setting up development environments with Docker, enabling users to define the exact environment for their apps, while also running databases and caches inside Docker. Fig solved a major pain point for developers. Docker fully supports this open source project and [recently purchased Orchard][17] to expand the reach of Fig.
-
-### Honorable mention: Drone ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_13-100564916-orig.jpg)
-
-[Drone][18] is a Continuous Integration platform built on Docker and [written in Go][19]. The Drone project grew out of frustration with existing available technologies and processes for setting up development environments.
-
-Drone provides a simple approach to automated testing and continuous delivery: Simply pick a Docker image tailored to your needs, connect GitHub, and commit. Drone uses Docker containers to provision isolated testing environments, giving every project complete control over its stack without the burden of traditional server administration. The community behind Drone is 100 contributors strong and hopes to bring this project to the enterprise and to mobile app development.
-
-### Open source rookies ###
-
-![](http://images.techhive.com/images/article/2015/01/open_source_rookies_14-100564941-orig.jpg)
-
-- [Open Source Rookies of the 2014 Year][20]
-- [InfoWorld's 2015 Technology of the Year Award winners][21]
-- [Bossies: The Best of Open Source Software Awards][22]
-- [15 essential open source tools for Windows admins][23]
-
---------------------------------------------------------------------------------
-
-via: http://www.infoworld.com/article/2875439/open-source-software/the-top-10-rookie-open-source-projects.html
-
-作者:[Black Duck Software][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
-
-[a]:http://www.infoworld.com/author/Black-Duck-Software/
-[1]:https://www.blackducksoftware.com/open-source-rookies
-[2]:https://www.openhub.net/
-[3]:https://github.com/debops/debops
-[4]:http://www.infoworld.com/article/2612397/data-center/review--ansible-orchestration-is-a-veteran-unix-admin-s-dream.html
-[5]:https://codecombat.com/
-[6]:http://storj.io/
-[7]:http://neovim.org/
-[8]:https://github.com/cockroachdb/cockroach
-[9]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker
-[10]:http://kubernetes.io/
-[11]:https://openbazaar.org/
-[12]:http://ipfs.io/
-[13]:https://github.com/google/cadvisor
-[14]:https://www.terraform.io/
-[15]:http://www.fig.sh/
-[16]:http://www.infoworld.com/resources/16373/application-virtualization/the-beginners-guide-to-docker
-[17]:http://www.infoworld.com/article/2608546/application-virtualization/docker-acquires-orchard-in-a-sign-of-rising-ambitions.html
-[18]:https://drone.io/
-[19]:http://www.infoworld.com/article/2683845/google-go/164121-Fast-guide-to-Go-programming.html
-[20]:https://www.blackducksoftware.com/open-source-rookies
-[21]:http://www.infoworld.com/article/2871935/application-development/infoworlds-2015-technology-of-the-year-award-winners.html
-[22]:http://www.infoworld.com/article/2688104/open-source-software/article.html
-[23]:http://www.infoworld.com/article/2854954/microsoft-windows/15-essential-open-source-tools-for-windows-admins.html
\ No newline at end of file
diff --git a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md b/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md
deleted file mode 100644
index 6333fea9a7..0000000000
--- a/sources/talk/20150304 ​No reboot patching comes to Linux 4.0.md	
+++ /dev/null
@@ -1,58 +0,0 @@
-​No reboot patching comes to Linux 4.0
-================================================================================
->  **Summary**:With the new Linux 4.0 kernel, you'll need to reboot Linux less often than ever.
-
-With [Linux 4.0][1], you may never need to reboot your operating system again.
-
-![Using Linux means never having to reboot. -- SUSE ](http://zdnet4.cbsistatic.com/hub/i/r/2015/03/02/5e766833-454b-45b5-a8f7-a55d21e9d26a/resize/270x270/4d0774552c342a1507784ef802619b71/livepatching.jpg)
-Using Linux means never having to reboot. -- SUSE 
-
-One reason to love Linux on your servers or in your data-center is that you so seldom needed to reboot it. True, critical patches require a reboot, but you could go months without rebooting. Now, with the latest changes to the Linux kernel you may be able to go years between reboots.
-
-This is actually a feature that was available in Linux in 2009 thanks to a program called [Ksplice][2]. This program compares the original and patched kernels and then uses a customized kernel module to patch the new code into the running kernel. Each Ksplice-enabled kernel comes with a special set of flags for each function that will be patched. The [Ksplice process][3] then watches for a moment when the code for the function being patched isn't in use, and ta-da, the patch is made and your server runs on. 
-
-[Oracle acquired Ksplice][4] in 2011, and kept it just for its own [Oracle Linux][5], a [Red Hat Enterprise Linux (RHEL)][6] clone, and as a RHEL subscription service. That left all the other enterprise and server Linux back where they started.
-
-Then [KernelCare released a service that could provide bootless patches][7] for most enterprise Linux distros. This program use proprietary software and is only available as a service with a monthly fee. That was a long way from satisfying many Linux system administrators.
-
-So, [Red Hat][8] and [SUSE][9] both started working on their own purely open-source means of giving Linux the ability to keep running even while critical patches were being installed. Red Hat's program was named [kpatch][10], while SUSE' is named [kGraft][11]. 
-
-The two companies took different approaches. Kpatch issues a stop_machine() command. After that it looks at the stack of existing processes using [ftrace][12] and, if the patch can be made safely, it redirects the running code to the patched functions and then removes the now outdated code.
-
-Kgraft also uses ftrace, but it works on the thread level. When an old function is called it makes sure the thread reaches a point that it can switch to the new function.
-
-While the end result is the same, the operating system keeps running while patches are made, there are significant differences in performance. Kpatch takes from one to forty milliseconds, while kGraft might take several minutes but there's never even a millisecond of down time. 
-
-At the Linux Plumbers Conference in October 2014, the two groups got together and started work on a way to [patch Linux without rebooting that combines the best of both programs][13]. Essentially, what they ended up doing was putting both kpatch and kGraft in the 4.0 Linux kernel.
-
-Jiri Kosina, a SUSE software engineer and Linux kernel developer, explained, that live-patching in the Linux kernel will "provides a basic infrastructure for function "live patching" (i.e. code redirection), including API [application programming interface] for kernel modules containing the actual patches, and API/ABI [application binary interface] for userspace to be able to operate on the patches. This is "relatively simple and minimalistic, as it's making use of existing kernel infrastructure (namely ftrace) as much as possible. It's also self-contained, in a sense that it doesn't hook itself in any other kernel subsystem (it doesn't even touch any other code)."
-
-The release candidate for Linux 4.0 is now out. Kosina stated that "It's now implemented for x86 only as a reference architecture, but support for powerpc, s390 and arm is already in the works." And, indeed, the source code for these architectures is already in the [Live Patching Git code][14].
-
-Simply having the code in there is just the start. Your Linux distribution will have to support it with patches that can make use of it. With both Red Hat and SUSE behind it, live patching will soon be the default in all serious business Linux distributions. 
-
---------------------------------------------------------------------------------
-
-via: http://www.zdnet.com/article/no-reboot-patching-comes-to-linux-4-0/#ftag=RSSbaffb68
-
-作者:[Steven J. Vaughan-Nichols][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
-
-[a]:http://www.zdnet.com/meet-the-team/us/sjvn/
-[1]:http://www.zdnet.com/article/linux-kernel-turns-over-release-odometer-to-4-0/
-[2]:http://www.computerworld.com/article/2466389/open-source-tools/never-reboot-again-with-linux-and-ksplice.html
-[3]:http://www.ksplice.com/
-[4]:http://www.zdnet.com/article/oracle-acquires-zero-downtime-linux-upgrade-software/
-[5]:http://www.oracle.com/us/technologies/linux/overview/index.html
-[6]:http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
-[7]:http://www.zdnet.com/article/kernelcare-new-no-reboot-linux-patching-system/
-[8]:http://www.redhat.com/
-[9]:http://www.suse.com/
-[10]:http://rhelblog.redhat.com/2014/02/26/kpatch/
-[11]:http://www.zdnet.com/article/suse-gets-live-patching/
-[12]:http://elinux.org/Ftrace
-[13]:http://linuxplumbersconf.org/2014/wp-content/uploads/2014/10/LPC2014_LivePatching.txt
-[14]:https://kernel.googlesource.com/pub/scm/linux/kernel/git/jikos/livepatching/+/9ec0de0ee0c9f0ffe4f72da9158194121cc22807
\ No newline at end of file
diff --git a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md
deleted file mode 100644
index d29a75cb69..0000000000
--- a/sources/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md	
+++ /dev/null
@@ -1,98 +0,0 @@
-Comparative Introduction To FreeBSD For Linux Users
-================================================================================
-![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg)
-
-### Introduction ###
-
-BSD was originally derived from UNIX and currently, there are various number of Unix-like operating systems descended from the BSD. While, FreeBSD is the most widely used open source Berkeley Software Distribution (BSD distribution). As it is implicitly said it is a free and open source Unix-like-operating system and a public server platform. FreeBSD source code is generally released under a permissive BSD license. It is true that it has similarities with Linux but we cannot deny that they differs in other points.
-
-The remainder of this article is organized as follows: the description of FreeBSD will be treated in our first section.  The similarities between FreeBSD and Linux will be briefly described in the second section. While their differences will be discussed in the third section. And a comparison of their features will be summarized in our last section.
-
-### FreeBSD description ###
-
-#### History ####
-
-- The first version of FreeBSD was released in 1993, while its first CD-ROM distributed was FreeBSD1.0 on December 1993. Then, FreeBSD 2.1.0 was released in 1995 which gained the satisfaction of all users. Actually, many IT companies use FreeBSD and are satisfied where we can list those companies: IBM, Nokia, NetApp and Juniper Networks.
-
-#### License ####
-
-- Concerning its license, FreeBSD is released under various source licenses. Its newest code called Kernel is released under the two-clause BSD license, offering the possibility to use and redistribute FreeBSD with absolute freedom. Other codes are released three- and four-clause BSD license and some others are released under GPL and CDDL.
-
-#### Users ####
-
-- One of the important feature of FreeBSD, we can mention the various categories of its users. In fact, it is possible to use FreeBSD as a mail server, web server, FTP server and as a router due to the significant set of server-related software accompanied with it. Furthermore, ARM, PowerPC and MIPS are supported by FreeBSD so it is possible to use x86 and s86-64.
-
-### FreeBSD and Linux similarities ###
-
-FreeBSD and Linux are two free and open source systems. Indeed, their users can easily check and modify the source code with an absolute freedom. To add, FreeBSD and Linux, both of them are derived from Unix.-like because they have a kernel, internals, and libraries programmed using algorithms derived from historic AT&T Unix. While FreeBSD’s roots are similar to Unix systems, Linux is released as a free Unix-like option. Various tools and applications can be found either in FreeBSD or in Linux in fact, they almost share the same functionality.
-
-Furthermore, FreeBSD can run big number of Linux applications. It has a Linux compatibility layer that can be installed. This Linux compatibility layer can be installed while compiling FreeBSD with AAC Compact Linux or downloading compiled FreeBSD systems with a Linux compatibility program such as: aac_linux.ko. Which is not the same case with Linux, Linux cannot run FreeBSD software.
-
-At the end, we can mention that both of them have the same goal but have also some differences which we will outline in the next section.
-
-### FreeBSD and Linux differences ###
-
-Currently, no criteria of choice between FreeBSD and Linux is clear for most users. Since, they share almost the same applications. Those two operating systems are as mentioned previously UNIX-like.
-
-In this section, we will list the most important differences of those two systems.
-
-#### License ####
-
-- The first difference point between those two compared systems consist on their license.  To start by Linux license, it is released under the GPL license which offers the possibility to view, distribute and change the source code with an absolute freedom. The GPL license helps users to prevent the distribution of binary-only source. Which is the case with FreeBSD, which is licensed under BSD license. This kind of license is more restrictive and easily allows the distribution of binary-only source. The BSD license is more permissive that the GPL since no derivative work is required to maintain the licensing terms. Means any user can use, distribute and modify the code without need to have the previous version of code before changing made. They only need to have the original license of BSD.
-- Depending on the needs of each user, a selection can be made between those two types of license. Starting by BSD license which is more preferred by many users due to its special features. In fact, this license gives the possibility to sell each software licensed under it and retain the source code. Passing now to the GPL license, which requires some care of each user has a software released under it.
-- To be able to choose between those two software, it is required to understand the licensing of both of them to more understand the methodology used in their development, to distinguish between their features and know which one will fit user’s need.
-
-#### Control ####
-
-- Since FreeBSD and Linux are released under two different type of license, the Linux Torvalds control the Linux kernel which is not the same case with FreeBSD which is not controlled. Personally, I prefer to use FreeBSD instead of Linux since it is an absolute free software, no control permission exists. But it is not enough there is other differences between Linux and FreeBSD, help you to choose between both of them. As an advice don’t choose one of them, follow us and then give us your choice.
-
-#### Operating system ####
-
-- Linux concentrates only on the kernel system which is not the case with FreeBSD while the whole operating system is maintained. The kernel and a set of software, some of them are developed by the FreeBSD team, are maintained as one unit. Indeed, the FreeBSD developers have the possibility to manage the essential operating systems remotely and efficiently.
-- With Linux, there is some difficulties while managing a system. Since, the different components maintained will be from different sources so the Linux developers need to assemble them into groups having the same functionality.
-- FreeBSD and Linux both of them give the possibility to have a big set of optional software and distributions but they differ on the way they are managed. With FreeBSD, they are managed together while with Linux they will be maintained separately.
-
-#### Hardware support ####
-
-- Concerning the hardware support, Linux is better than FreeBSD. It doesn’t mean that FreeBSD hasn’t the capability to support hardware as Linux. They differ just on the manner. It depends on your need as usual. So if you are searching for the newest solution, the FreeBSD will fit your needs but if you are looking for greatest graphs, it is better to use Linux.
-
-#### FreeBSD origin Vs Linux origin ####
-
-- The origin of each system is also another point of distinction between both of them. As I said previously Linux is an alternative of the operating system Unix, written by Linus Trovalds and assisted by a special group of hackers across the Net. Linux has all the needed features in a modern Unix, such as virtual memory, shared libraries, demand loading, proper memory management and many others. It is released under the General Public License.
-- FreeBSD also shared many important features of its Unix heritage. FreeBSD as a type of the Berkeley Software Distribution, the distribution of the Unix developed at the University of California. The most important reason under developing BSD is to replace the AT&T operating system by an open source alternative giving the user the ability to use BSD without carry about the obtaining of the AT&T license.
-- The problem of licensing, is the most important worry of developers. They try to offer the maximum open source clone of Unix. Which influences the choice of users regarding the degree of open source of each system as FreeBSD gives more freedom than Linux regarding its use since it is released under BSD license.
-
-#### Supported Package ####
-
-- From the user’s perspective, another difference between our two compared systems, is their availability and support of the packaged software and source installed software. The Linux distributions provide just the pre-compiled binary packages which is not the same case with FreeBSD, which has the pre-built packages and the build system for the compilation and installation through their available open source. Due to its ports, FreeBSD gives you the possibility to choose between the default making of pre-compiled packages and your ability to customize your software while it is compiled.
-- Those ports enable you to build all the software available with FreeBSD. Furthermore, there is an hierarchy of organization all of them due to the directories /usr/ports where you can find the location of the source files and some documentation about the way to use FreeBSD correctly.
-- The ports as mentioned give the possibility produce the packages version of software. Instead of having just the pre-compiled packages using Linux, FreeBSD gives you the possibility to have the source-built and the pre-packages software. You can manage your system using the two installation methods.
-
-#### FreeBSD Vs Linux common Tools ####
-
-- A huge number of common tools are available while using FreeBSD and are fully own made by the FreeBSD team. In contrast, the Linux tools are from the GNU that is why there is some control during their usage.
-- The fact that FreeBSD is released under BSD license is so beneficial and useful. Since, you have the ability to maintain the core operating system, control the development of these applications. Same of those tools are similar to BSD and Unix tools from where they were derived which is not the same case with GNU suite, which want to just make them less backwards compatible.
-
-#### The Standard Shell ####
-
-- The tcsh shell is used by default with FreeBSD. Which is an evaluated version fo csh. Since, the FreeBSD is released under the BSD license, it is not recommended to use the bash shell which is a GNU component. The only difference between bash and tcsh shell consists on the scripting feature which can’t be made by tcsh. Indeed, the sh shell is more recommended for the FreeBSD use since it is more reliable and prevents some issues of scripting can be occurred using the tcsh or csh shell.
-
-#### A More Stratified Filesystem ####
-
-- As it was mentioned previously, base operating system and optional components can be easily distinguished using the FreeBSD system. Which causes some specification of their organization. In Linux, /bin, /sbin, /usr/bin, or usr/sbin are the directories for executable systems. With FreeBSD it is not the case. There are some additional specifications concerning their organization. The base system are putted in one of the directories mentioned above while the ports and packages are placed in /usr/local/bin or /usr/local/sbin. This methodology helps to recognize and distinguish between an application considered as a base system or a port.
-
-### Conclusion ###
-
-FreeBSD and Linux those two free and open source systems, share various similarities but they also differ in several points. The list giving above isn’t given to say that one of them is better than the other. In fact, FreeBSD and Linux, each one of them has its features and specifications that make it a special regarding the other. And you what is your opinion? Have you already used one on them or both? If yes what is your feedback and if no after reading our description what do you think? Sound off and give us and the fellow readers your opinion.
-
---------------------------------------------------------------------------------
-
-via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/
-
-作者:[anismaj][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
-
-[a]:https://www.unixmen.com/author/anis/
\ No newline at end of file
diff --git a/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md
deleted file mode 100644
index 9abc2f721f..0000000000
--- a/sources/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md	
+++ /dev/null
@@ -1,58 +0,0 @@
-translating wi-cuckoo
-Is Linux Better than OS X? GNU, Open Source and Apple in History
-================================================================================
-> Tensions between the free software/open source community and Apple date back to the 1980s, Linux's founder called the core of Mac OS X "a piece of crap" and other anecdotes from software history.
-
-![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/untitled_2.png)
-
-Open source fans have long had a rocky relationship with Microsoft. Everyone knows that. But, in many ways, the tension between Apple and supporters of free or open source software is even starker—even if it receives much less attention in the press.
-
-To be sure, not all open source advocates have an aversion to Apple. Anecdotally, I've seen plenty of Linux hackers sporting iPhones and iPads. In fact, some Linux users like Apple's OS X so much that they've [created a number of Linux distributions][1] designed to look just like it. (So has the [North Korean government][2], incidentally.)
-
-But relations between the Cult of Mac and the Cult of Tux—that is, the Linux community (not to mention the other, smaller segments of the free and open source software world)—have not always been completely peaceable. And that's by no means a new phenomenon, as I'm discovering as I research the history of Linux and the Free Software Foundation.
-
-### GNU vs. Apple ###
-
-The ill will dates to at least the late 1980s. By June 1988, [GNU][3], the project launched by Richard Stallman to build a completely free Unix-like operating system whose source code would be freely shared, was [strongly criticizing][4] Apple's lawsuit against [Hewlett-Packard][5] (HPQ) and [Microsoft][6] (MSFT) over what Apple claimed was improper copying of the "look and feel" of the Macintosh operating system. If Apple prevailed, GNU warned, the company "will use this new power over the public to put an end to free software that could substitute for commercial software."
-
-At the time, GNU fought against the lawsuit (which meant, ironically, that GNU was supporting Microsoft, though those were different times) by distributing "[Keep Your Lawyers Off My Computer" buttons][7]. It also urged GNU supporters to boycott Apple, warning that, even if Macintoshes seemed like good computers, Apple's success in the lawsuit could provide the company with a monopoly in the market that would greatly increase the price of computers.
-
-Apple eventually [lost the lawsuit][8], but not until 1994, after which GNU [dropped its Apple boycott][9]. In the interim, GNU remained critical of the company. In the early 1990s, even after it began promoting GNU software programs for use on other personal computing platforms, including MS-DOS PCs, [GNU affirmed][10] that, until Apple ceased pursuing a "monopoly" over computers with user interfaces similar to those of the Macintosh, "we will not provide any support for Apple machines." (It's therefore ironic that a fair amount of the software that made it into OS X, the Unix-like operating system that Apple introduced later in the 1990s, came from GNU. But that's another story.)
-
-### Torvalds on Jobs ###
-
-Despite his more laissez-faire attitude toward most issues, Linus Torvalds, the creator of the Linux kernel, was no less charitable in his attitudes toward Apple than Stallman and GNU had been. In his 2001 book "Just for Fun: The Story of an Accidental Revolutionary," Torvalds described meeting with Steve Jobs circa 1997, at the latter's invitation, to discuss Mac OS X, which Apple was then developing but had not yet released publicly.
-
-"Basically, Jobs started off by trying to tell me that on the desktop there were just two players, Microsoft and Apple, and that he thought that the best thing I could do for Linux was to get in bed with Apple and try to get the open source people behind Mac OS X," Torvalds wrote.
-
-This courting apparently turned Torvalds off quite a bit. One point of disagreement centered on Torvalds's technical disdain for Mach, the kernel on which Apple was then building its new OS X operating system, which Torvalds called "a piece of crap. It contains all the design mistakes you can make, and managed to even make up a few of its own."
-
-But more off-putting, apparently, was the way Jobs was approaching open source in developing OS X (which had many open source programs at its core): "He sort of played down the flaw in the setup: Who cares if the basic operating system, the real low-core stuff, is open source if you then have the Mac layer on top, which is not open source?"
-
-All in all, Torvalds concluded, Jobs "didn't use very many arguments. He just basically took it for granted that I would be interested" in collaborating with Apple. "He was clueless, unable to imagine that there could be entire segments of the human race who weren't the least bit concerned about increasing the Mac's market share. I think he was truly surprised at how little I cared about how big a market the Mac had—or how big a market Microsoft has."
-
-Torvalds doesn't speak for all Linux users, of course. And his views on OS X and Apple may have softened since 2001. But the fact that, in the early 2000s, the Linux community's leading figure exhibited so much disdain for Apple and the hubris of its chief says something significant about how deeply seated tensions between the Apple world and the open source/free software world are.
-
-Both of these historical tidbits offer insight into the great debate regarding the actual value of Apple's products—whether the company thrives on the quality of the hardware and software it creates, or merely benefits from exceptional marketing acumen that allows it to sell products for much more than their non-Apple functional equivalents are worth. But I'll stay out of that debate, for now.
-
---------------------------------------------------------------------------------
-
-via: http://thevarguy.com/open-source-application-software-companies/051815/linux-better-os-x-gnu-open-source-and-apple-
-
-作者:[Christopher 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]:https://www.linux.com/news/software/applications/773516-the-mac-ifying-of-the-linux-desktop/
-[2]:http://thevarguy.com/open-source-application-software-companies/010615/north-koreas-red-star-linux-os-made-apples-image
-[3]:http://gnu.org/
-[4]:https://www.gnu.org/bulletins/bull5.html
-[5]:http://www.hp.com/
-[6]:http://www.microsoft.com/
-[7]:http://www.duntemann.com/AppleSnakeButton.jpg
-[8]:http://www.freibrun.com/articles/articl12.htm
-[9]:https://www.gnu.org/bulletins/bull18.html#SEC6
-[10]:https://www.gnu.org/bulletins/bull12.html
diff --git a/sources/tech/20141219 What is good audio editing software on Linux.md b/sources/tech/20141219 What is good audio editing software on Linux.md
deleted file mode 100644
index ccc6a0883b..0000000000
--- a/sources/tech/20141219 What is good audio editing software on Linux.md	
+++ /dev/null
@@ -1,82 +0,0 @@
-What is good audio editing software on Linux
-================================================================================
-
-Whether you are an amateur musician or just a student recording his professor, you need to edit and work with audio recordings. If for a long time such task was exclusively attributed to Macintosh, this time is over, and Linux now has what it takes to do the job. In short, here is a non-exhaustive list of good audio editing software, fit for different tasks and needs.
-
-### 1. Audacity ###
-
-![](https://farm9.staticflickr.com/8572/15405018653_83ba3e718d_c.jpg)
-
-Let's get started head on with my personal favorite. [Audacity][1] works on Windows, Mac, and Linux. It is open source. It is easy to use. You get it: Audacity is almost perfect. This program lets you manipulate the audio waveform from a clean interface. In short, you can overlay tracks, cut and edit them easily, apply effects, perform advanced sound analysis, and finally export to a plethora of format. The reason I like it so much is that it combines both basic features with more complicated ones, but maintain an easy leaning curve. However, it is not a fully optimized software for hardcore musicians, or people with professional knowledge.
-
-### 2. Jokosher ###
-
-![](https://farm8.staticflickr.com/7524/15998875136_82903a9b4a_c.jpg)
-
-On a different level, [Jokosher][2] focuses more on the multi-track aspect for musical artists. Developed in Python and using the GTK+ interface with GStreamer for audio back-end, Jokosher really impressed me with its slick interface and its extensions. If the editing features are not the most advanced, the language is clear and directed to musicians. And I really like the association between tracks and instruments for example. In short, if you are starting as a musician, it might be a good place to get some experience before moving on to more complex suites.
-
-### 3. Ardour ###
-
-![](https://farm9.staticflickr.com/8577/16024644385_d8cd8073a3_c.jpg)
-
-And talking about compex suites, [Ardour][3] is complete software for recording, editing, and mixing. Designed this time to appeal to all professionals, Ardour features in term of sound routing and plugins go way beyond my comprehension. So if you are looking for a beast and are not afraid to tame it, Ardour is probably a good pick. Again, the interface contributes to its charm, as well as its extensive documentation. I particularly appreciated the first-launch configuration tool.
-
-### 4. Kwave ###
-
-![](https://farm8.staticflickr.com/7557/15402389884_633a8b04c5_c.jpg)
-
-For all KDE lovers, [KWave][4] corresponds to your idea of design and features. There are plenty of shortcuts and interesting options, like memory management. Even if the few effects are nice, we are more dealing with a simple tool to cut/paste audio together. It becomes shard not to compare it with Audacity unfortunately. And on top of that, the interface did not appeal to me that much. 
-
-### 5. Qtractor ###
-
-![](https://farm8.staticflickr.com/7551/16022707501_68c39f37e5_c.jpg)
-
-If Kwave is too simplistic for you but a Qt-based program really has some appeal, then [Qtractor][5] might be your option. It aims to be "simple enough for the average home user, and yet powerful enough for the professional user." Indeed the quantity of features and options is almost overwhelming. My favorite being of course customizable shortcuts. Apart from that, Qtractor is probably one of my favorite tools to deal with MIDI files.
-
-### 6. LMMS ###
-
-![](https://farm8.staticflickr.com/7509/15838603239_ef0ecbc8d2_c.jpg)
-
-Standing for Linux MultiMedia Studio, LMMS is directly targeted for music production. If you do not have prior experience and do not want to spend too much time getting some, go elsewhere. LMMS is one of those complex but powerful software that only a few will truly master. The number of features and effects is simply too long to list, but if I had to pick one, I would say that the Freeboy plugin to emulate Game Boy sound system is just magical. Past that, go see their amazing documentation.
-
-### 7. Traverso ###
-
-![](https://farm8.staticflickr.com/7537/15838603279_70ee925057_c.jpg)
-
-Finally, Traverso stood out to me for its unlimited track count and its direct integration with CD burning capacities. Aside from that, it appeared to me as a middle man between a simplistic software and a professional program. The interface is very KDE-like, and the keyboard configuration is always welcome. And cherry on the cake, Traverso monitors your resources and make sure that your CPU or hard drive does not go overboard.
-
-To conclude, it is always a pleasure to see such a large diversity of applications on Linux. It makes finding the software that best fits your needs always possible. While my personal favorite stays Audacity, I was very surprised by the design of programs like LMMS or Jokosher.
-
-Did we miss one? What do you use for audio editing on Linux? And why? Let us know in the comments.
-
---------------------------------------------------------------------------------
-
-via: http://xmodulo.com/good-audio-editing-software-linux.html
-
-作者:[Adrien Brochard][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/adrien
-[1]:http://audacity.sourceforge.net/
-[2]:https://launchpad.net/jokosher/
-[3]:http://ardour.org/
-[4]:http://kwave.sourceforge.net/
-[5]:http://qtractor.sourceforge.net/qtractor-index.html
-[6]:
-[7]:
-[8]:
-[9]:
-[10]:
-[11]:
-[12]:
-[13]:
-[14]:
-[15]:
-[16]:
-[17]:
-[18]:
-[19]:
-[20]:
diff --git a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md b/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md
deleted file mode 100644
index c55a04c12c..0000000000
--- a/sources/tech/20150126 Installing Cisco Packet tracer in Linux.md	
+++ /dev/null
@@ -1,197 +0,0 @@
-Installing Cisco Packet tracer in Linux 
-================================================================================
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/Main_picture.png)
-
-### What is Cisco Packet tracer ? ###
-
-**Cisco Packet tracer** is a powerful network simulator tool which used to trained while we do some Cisco certifications. It provide us good Interface view for every router’s, and networking devices which with many options same as using the physical machines we can use unlimited devices in a network. We can create multiple network in single project to get trained like a professionals. packet tracer will provide us with simulated application layer protocols such as **HTTP**, **DNS**, Routing with **RIP**, **OSPF**, **EIGRP** etc.
-
-Now it has been released including **ASA 5505 firewall** with command line configurations. Packet tracer available commonly for Windows, but not for Linux distributions. Here we can download and get install Cisco package tracer.
-
-#### Newly released version of Cisco packet tracer: ####
-
-The next Cisco Packet Tracer version will be Cisco Packet Tracer 6.2 currently it’s under development.
-
-### My Environment Setup: ###
-
-**Hostname**                :           desktop1.unixmen.com
-
-**IP address**               :           192.168.0.167
-
-**Operating system**    :           Ubuntu 14.04 LTS Desktop
-
-    # hostname
-
-    # ifconfig | grep inet
-
-    # lsb_release -a
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_001.png)
-
-### Step 1: First we need to download the Cisco Packet tracer. ###
-
-To download Packet Tracer from official website we need to have a token, sign into Cisco NetSpace and select CCNA > Cisco Packet Tracer from the Offerings menu to start the download. If we don’t have a token you can get from below link which i have uploaded in Dropbox.
-
-Official Website: [https://www.netacad.com/][1]
-
-Many of them don’t have a token to download packet tracer. For that i have uploaded it in dropbox you can get packet tracer from below URL.
-
-[Download Cisco Packet Tracer 6.1.1][2]
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_002.png)
-
-### Step 2: Install Java: ###
-
-To get install packet tracer we need to have install Java, To get install java we can use the default or add the PPA repository and update the package cache to get install java.
-
-Install the default jre using
-
-        # sudo apt-get install default-jre
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_003.png)
-
-(or)
-
-Use the below step to get install Java Run-time and set the Environment.
-
-Download Java from official website : [Download Java][3]
-
-    # tar -zxvf jre-8u31-linux-x64.tar.gz
-
-    # sudo mkdir -p /usr/lib/jvm
-
-    # sudo mv -v jre1.8.0_31 /usr/lib/jvm/
-
-    # cd /usr/lib/jvm/
-
-    # sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.8.0_31/bin/java" 1
-
-    # sudo update-alternatives --set "java" "/usr/lib/jvm/jre1.8.0_31/bin/java"
-
-Set the environment for java by editing the profile file and add the location. While we adding in profile file java will available for every user’s in our machine.
-
-    # sudo vi /etc/profile
-
-Add the following entries to the bottom of your /etc/profile file:
-
-    export JAVA_HOME=/usr/lib/jvm/jre1.8.0_31
-    export PATH=$PATH:/usr/java/jre1.8.0_31/bin
-
-Run the below command to activate java path immediately.
-
-    # . /etc/profile
-
-Check for the Java version and Environment:
-
-    # echo $JAVA_HOME
-
-    # java -version
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_004.png)
-
-### Step 3: Enable 32bit architecture support: ###
-
-For Packet tracer we need some of 32bit packages. To get install 32bit packages we need to install some of dependencies using below commands.
-
-    # sudo dpkg --add-architecture i386
-    # sudo apt-get update
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_005.png)
-
-    # sudo apt-get install libc6:i386
-
-    # sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
-
-    # sudo apt-get install libnss3-1d:i386 libqt4-qt3support:i386 libssl1.0.0:i386 libqtwebkit4:i386 libqt4-scripttools:i386
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_006.png)
-
-### Step 4: Extract and install the package: ###
-
-Extract the downloaded package using tar command.
-
-    # mv Cisco\ Packet\ Tracer\ 6.1.1\ Linux.tar.gz\?dl\=0 Cisco_Packet_tracer.tar.gz
-
-    # tar -zxvf Cisco_Packet_tracer.tar.gz
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_007.png)
-
-Navigate to the extracted directory
-
-    # cd PacketTracer611Student
-
-Now it’s time to start the installation , Installation is very simple and just take few seconds.
-
-    # sudo ./install
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_008.png)
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_009.png)
-
-To working with Package tracer we need to set the environment for that Cisco have provided the environment script, We need to run the script using root user to set the environment variable.
-
-    # sudo ./set_ptenv.sh
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_010.png)
-
-That’s it for installation step’s. next we need to create a Desktop Icon for Packet tracer.
-
-Create the Desktop Icon by creating desktop file under.
-
-    # sudo su
-
-    # cd /usr/share/applications
-
-    # sudo vim packettracer.desktop
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_011.png)
-
-Append the Below content to the file using vim editor or your favourite one.
-
-    [Desktop Entry]
-     Name= Packettracer
-     Comment=Networking
-     GenericName=Cisco Packettracer
-     Exec=/opt/packettracer/packettracer
-     Icon=/usr/share/icons/packettracer.jpeg
-     StartupNotify=true
-     Terminal=false
-     Type=Application
-
-Save and quit using wq!
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_012.png)
-
-### Step 5: Run the packet tracer ###
-
-    # sudo packettracer
-
-That’s it we have successfully installed the packet tracer in Linux, These above steps are suitable for every debian based Linux distributions.
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_013.png)
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/pkt_014.png)
-
-### Resources ###
-
-Home page:[Netacad][4]
-
-### Conclusion: ###
-
-Here we have seen how to install packet tracer in Linux distribution, Hope you have find a way to get install your favorite Simulator in Linux.
-
---------------------------------------------------------------------------------
-
-via: http://www.unixmen.com/installing-cisco-packet-tracer-linux/
-
-作者:[babin][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/babin/
-[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/
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
deleted file mode 100644
index 1d5d3cd0d9..0000000000
--- a/sources/tech/20150126 iptraf--A TCP or UDP Network Monitoring Utility.md	
+++ /dev/null
@@ -1,64 +0,0 @@
-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.
-
-Its ncurses-based user interface also saves users from remembering command line switches.
-
-### Features ###
-
-- An IP traffic monitor that shows information on the IP traffic passing over your network. Includes TCP flag information, packet and byte counts, ICMP details, OSPF packet types.
-- General and detailed interface statistics showing IP, TCP, UDP, ICMP, non-IP and other IP packet counts, IP checksum errors, interface activity, packet size counts.
-- A TCP and UDP service monitor showing counts of incoming and outgoing packets for common TCP and UDP application ports
-- A LAN statistics module that discovers active hosts and shows statistics showing the data activity on them
-- TCP, UDP, and other protocol display filters, allowing you to view only traffic you’re interested in.
-- Logging
-- Supports Ethernet, FDDI, ISDN, SLIP, PPP, and loopback interface types.
-- Utilizes the built-in raw socket interface of the Linux kernel, allowing it to be used over a wide range of supported network cards.
-- Full-screen, menu-driven operation.
-
-To install
-
-### Ubuntu and it’s derivatives ###
-
-    sudo apt-get install iptraf
-
-### Arch Linux and Its derivatives ###
-
-    sudo pacman -S iptra
-
-### Fedora and its derivatives ###
-
-    sudo yum install iptraf
-
-### Usage ###
-
-If the **iptraf** command is issued without any command-line options, the program comes up in interactive mode, with the various facilities accessed through the main menu.
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_1.png)
-
-Menu for easy navigation.
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_2.png)
-
-Selecting interfaces to monitor.
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_3.png)
-
-Traffic from interface **ppp0**
-
-![](http://180016988.r.cdn77.net/wp-content/uploads/2015/01/iptraf_4.png)
-
-Enjoy!
-
---------------------------------------------------------------------------------
-
-via: http://www.unixmen.com/iptraf-tcpudp-network-monitoring-utility/
-
-作者:[Enock Seth Nyamador][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/seth/
-[1]:http://iptraf.seul.org/about.html
diff --git a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md b/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md
deleted file mode 100644
index e9e8ecb4eb..0000000000
--- a/sources/tech/20150127 25 Useful Apache '.htaccess' Tricks to Secure and Customize Websites.md	
+++ /dev/null
@@ -1,422 +0,0 @@
-25 Useful Apache ‘.htaccess’ Tricks to Secure and Customize Websites
-================================================================================
-Websites are important parts of our lives. They serve the means to expand businesses, share knowledge and lots more. Earlier restricted to providing only static contents, with introduction of dynamic client and server side scripting languages and continued advancement of existing static language like html to html5, adding every bit of dynamicity is possible to the websites and what left is expected to follow soon in near future.
-
-With websites, comes the need of a unit that can display these websites to a huge set of audience all over the globe. This need is fulfilled by the servers that provide means to host a website. This includes a list of servers like: Apache HTTP Server, Joomla, and WordPress that allow one to host their websites.
-
-![Apache htaccess Tricks](http://www.tecmint.com/wp-content/uploads/2015/01/htaccess-tricks.jpg)
-25 htaccess Tricks
-
-One who wants to host a website can create a local server of his own or can contact any of above mentioned or any another server administrator to host his website. But the actual issue starts from this point. Performance of a website depends mainly on following factors:
-
-- Bandwidth consumed by the website.
-- How secure is the website against hackers.
-- Optimism when it comes to data search through the database
-- User-friendliness when it comes to displaying navigation menus and providing more UI features.
-
-Alongside this, various factors that govern success of servers in hosting websites are:
-
-- Amount of data compression achieved for a particular website.
-- Ability to simultaneously serve multiple clients asking for a same or different website.
-- Securing the confidential data entered on the websites like: emails, credit card details and so on.
-- Allowing more and more options to enhance dynamicity to a website.
-
-This article deals with one such feature provided by the servers that help enhance performance of websites along with securing them from bad bots, hotlinks etc. i.e. ‘.htaccess‘ file.
-
-### What is .htaccess? ###
-
-htaccess (or hypertext access) are the files that provide options for website owners to control the server environment variables and other parameters to enhance functionality of their websites. These files can reside in any and every directory in the directory tree of the website and provide features to the directory and the files and folders inside it.
-
-What are these features? Well these are the server directives i.e. the lines that instruct server to perform a specific task, and these directives apply only to the files and folders inside the folder in which this file is placed. These files are hidden by default as all Operating System and the web servers are configured to ignore them by default but making the hidden files visible can make you see this very special file. What type of parameters can be controlled is the topic of discussion of subsequent sections.
-
-Note: If .htaccess file is placed in /apache/home/www/Gunjit/ directory then it will provide directives for all the files and folders in that directory, but if this directory contains another folder namely: /Gunjit/images/ which again has another .htaccess file then the directives in this folder will override those provided by the master .htaccess file (or file in the folder up in hierarchy).
-
-### Apache Server and .htaccess files ###
-
-Apache HTTP Server colloquially called Apache was named after a Native American Tribe Apache to respect its superior skills in warfare strategy. Build on C/C++ and XML it is cross-platform web server which is based on NCSA HTTPd server and has a key role in growth and advancement of World Wide Web.
-
-Most commonly used on UNIX, Apache is available for wide variety of platforms including FreeBSD, Linux, Windows, Mac OS, Novel Netware etc. In 2009, Apache became the first server to serve more than 100 million websites.
-
-Apache server has one .htaccess file per user in www/ directory. Although these files are hidden but can be made visible if required. In www/ directory there are a number of folders each pertaining to a website named on user’s or owner’s name. Apart from this you can have one .htaccess file in each folder which configured files in that folder as stated above.
-
-How to configure htaccess file on Apache server is as follows…
-
-### Configuration on Apache Server ###
-
-There can be two cases:
-
-#### Hosting website on own server ####
-
-In this case, if .htaccess files are not enabled, you can enable .htaccess files by simply going to httpd.conf (Default configuration file for Apache HTTP Daemon) and finding the  section.
-
-    
-
-And locate the line that says…
-
-    AllowOverride None 
-
-And correct it to.
-
-    AllowOverride All
-
-Now, on restarting Apache, .htaccess will work.
-
-#### Hosting website on different hosting provider server ####
-
-In this case it is better to consult the hosting admin, if they allow access to .htaccess files.
-
-### 25 ‘.htaccess’ Tricks of Apache Web Server for Websites ###
-
-#### 1. How to enable mod_rewrite in .htaccess file ####
-
-mod_rewrite option allows you to use redirections and hiding your true URL with redirecting to some other URL. This option can prove very useful allowing you to replace the lengthy and long URL’s to short and easy to remember ones.
-
-To allow mod_rewrite just have a practice to add the following line as the first line of your .htaccess file.
-
-    Options +FollowSymLinks
-
-This option allows you to follow symbolic links and thus enable the mod_rewrite option on the website. Replacing the URL with short and crispy one is presented later on.
-
-#### 2. How to Allow or Deny Access to Websites ####
-
-htaccess file can allow or deny access of website or a folder or files in the directory in which it is placed by using order, allow and deny keywords.
-
-**Allowing access to only 192.168.3.1 IP**
-
-    Order Allow, Deny
-    Deny from All
-    Allow from 192.168.3.1
-    
-    OR
-    
-    Order Allow, Deny
-    Allow from 192.168.3.1
-
-Order keyword here specifies the order in which allow, deny access would be processed. For the above ‘Order’ statement, the Allow statements would be processed first and then the deny statements would be processed.
-
-**Denying access to only one IP Address**
-
-The below lines provide the means to allow access of the website to all the users accept one with IP Address: 192.168.3.1.
-
-    rder Allow, Deny
-    Deny from 192.168.3.1
-    Allow from All
-    
-    OR
-    
-    
-    Order Deny, Allow
-    Deny from 192.168.3.1
-
-#### 3. Generate Apache Error documents for different error codes. ####
-
-Using some simple lines, we can fix the error document that run on different error codes generated by the server when user/client requests a page not available on the website like most of us would have seen the ‘404 Page not found’ page in their web browser. ‘.htaccess’ files specify what action to take in case of such error conditions.
-
-To do this, the following lines are needed to be added to the ‘.htaccess’ files:
-
-    ErrorDocument  
-
-‘ErrorDocument’ is a keyword, error-code can be any of 401, 403, 404, 500 or any valid error representing code and lastly, ‘path-of-document’ represents the path on the local machine (in case you are using your own local server) or on the server (in case you are using any other’s server to host your website).
-
-**Example:**
-
-    ErrorDocument 404 /error-docs/error-404.html
-
-The above line sets the document ‘error-404.html’ placed in error-docs folder to be displayed in case the 404 error is reported by the server for any invalid request for a page by the client.
-
-rrorDocument 404 "404 Page not found

The page you request is not present. Check the URL you have typed

" - -The above representation is also correct which places the string representing a usual html file. - -#### 4. Setting/Unsetting Apache server environment variables #### - -In .htaccess file you can set or unset the global environment variables that server allow to be modified by the hosters of the websites. For setting or unsetting the environment variables you need to add the following lines to your .htaccess files. - -**Setting the Environment variables** - - SetEnv OWNER “Gunjit Khera” - -Unsetting the Environment variables - - UnsetEnv OWNER - -#### 5. Defining different MIME types for files #### - -MIME (Multipurpose Internet Multimedia Extensions) are the types that are recognized by the browser by default when running any web page. You can define MIME types for your website in .htaccess files, so that different types of files as defined by you can be recognized and run by the server. - - - AddType application/javascript js - AddType application/x-font-ttf ttf ttc - - -Here, mod_mime.c is the module for controlling definitions of different MIME types and if you have this module installed on your system then you can use this module to define different MIME types for different extensions used in your website so that server can understand them. - -#### 6. How to Limit the size of Uploads and Downloads in Apache #### - -.htaccess files allow you the feature to control the amount of data being uploaded or downloaded by a particular client from your website. For this you just need to append the following lines to your .htaccess file: - - php_value upload_max_filesize 20M - php_value post_max_size 20M - php_value max_execution_time 200 - php_value max_input_time 200 - -The above lines set maximum upload size, maximum size of data being posted, maximum execution time i.e. the maximum time the a user is allowed to execute a website on his local machine, maximum time constrain within on the input time. - -#### 7. Making Users to download .mp3 and other files before playing on your website. #### - -Mostly, people play songs on websites before downloading them to check the song quality etc. Being a smart seller you can add a feature that can come in very handy for you which will not let any user play songs or videos online and users have to download them for playing. This is very useful as online playing of songs and videos consumes a lot of bandwidth. - -Following lines are needed to be added to be added to your .htaccess file: - - AddType application/octet-stream .mp3 .zip - -#### 8. Setting Directory Index for Website #### - -Most of website developers would already know that the first page that is displayed i.e. the home page of a website is named as ‘index.html’ .Many of us would have seen this also. But how is this set? - -.htaccess file provides a way to list a set of pages which would be scanned in order when a client requests to visit home page of the website and accordingly any one of the listed set of pages if found would be listed as the home page of the website and displayed to the user. - -Following line is needed to be added to produce the desired effect. - - DirectoryIndex index.html index.php yourpage.php - -The above line specifies that if any request for visiting the home page comes by any visitor then the above listed pages will be searched in order in the directory firstly: index.html which if found will be displayed as the sites home page, otherwise list will proceed to the next page i.e. index.php and so on till the last page you have entered in the list. - -#### 9. How to enable GZip compression for Files to save site’s bandwidth. #### - -This is a common observation that heavy sites generally run bit slowly than light weight sites that take less amount of space. This is just because for a heavy site it takes time to load the huge script files and images before displaying them on the client’s web browser. - -This is a common mechanism that when a browser requests a web page, server provides the browser with that webpage and now to locally display that web page, the browser has to download that page and then run the script inside that page. - -What GZip compression does here is saving the time required to serve a single customer thus increasing the bandwidth. The source files of the website on the server are kept in compressed form and when the request comes from a user then these files are transferred in compressed form which are then uncompressed and executed on the server. This improves the bandwidth constrain. - -Following lines can allow you to compress the source files of your website but this requires mod_deflate.c module to be installed on your server. - - - AddOutputFilterByType DEFLATE text/plain - AddOutputFilterByType DEFLATE text/html - AddOutputFilterByType DEFLATE text/xml - AddOutputFilterByType DEFLATE application/html - AddOutputFilterByType DEFLATE application/javascript - AddOutputFilterByType DEFLATE application/x-javascript - - -#### 10. Playing with the File types. #### - -There are certain conditions that the server assumes by default. Like: .php files are run on the server, similarly .txt files say for example are meant to be displayed. Like this we can make some executable cgi-scripts or files to be simply displayed as the source code on our website instead of being executed. - -To do this observe the following lines from a .htaccess file. - - RemoveHandler cgi-script .php .pl .py - AddType text/plain .php .pl .py - -These lines tell the server that .pl (perl script), .php (PHP file) and .py (Python file) are meant to just be displayed and not executed as cgi-scripts. - -#### 11. Setting the Time Zone for Apache server #### - -The power and importance of .htaccess files can be seen by the fact that this can be used to set the Time Zone of the server accordingly. This can be done by setting a global Environment variable ‘TZ’ of the list of global environment variables that are provided by the server to each of the hosted website for modification. - -Due to this reason only, we can see time on the websites (that display it) according to our time zone. May be some other person hosting his website on the server would have the timezone set according to the location where he lives. - -Following lines set the Time Zone of the Server. - - SetEnv TZ India/Kolkata - -#### 12. How to enable Cache Control on Website #### - -A very interesting feature of browser, most have observed is that on opening one website simultaneously more than one time, the latter one opens fast as compared to the first time. But how is this possible? Well in this case, the browser stores some frequently visited pages in its cache for faster access later on. - -But for how long? Well this answer depends on you i.e. on the time you set in your .htaccess file for Cache control. The .htaccess file can specify the amount of time for which the pages of website can stay in the browser’s cache and after expiration of time, it must revalidate i.e. pages would be deleted from the Cache and recreated the next time user visits the site. - -Following lines implement Cache Control for your website. - - - Header Set Cache-Control "max-age=3600, public" - - - Header Set Cache-Control "public" - Header Set Expires "Sat, 24 Jan 2015 16:00:00 GMT" - - -The above lines allow caching of the pages which are inside the directory in which .htaccess files are placed for 1 hour. - -#### 13. Configuring a single file, the option. #### - -Usually the content in .htaccess files apply to all the files and folders inside the directory in which the file is placed, but you can also provide some special permissions to a special file, like denying access to that file only or so on. - -For this you need to add tag to your file in a way like this: - - - Order allow, deny - Deny from 188.100.100.0 - - -This is a simple case of denying a file ‘conf.html’ from access by IP 188.100.100.0, but you can add any or every feature described for .htaccess file till now including the features yet to be described to the file like: Cache-control, GZip compression. - -This feature is used by most of the servers to secure .htaccess files which is the reason why we are not able to see the .htaccess files on the browsers. How the files are authenticated is demonstrated in subsequent heading. - -#### 14. Enabling CGI scripts to run outside of cgi-bin folder. #### - -Usually servers run CGI scripts that are located inside the cgi-bin folder but, you can enable running of CGI scripts located in your desired folder but just adding following lines to .htaccess file located in the desired folder and if not, then creating one, appending following lines: - - AddHandler cgi-script .cgi - Options +ExecCGI - -#### 15. How to enable SSI on Website with .htaccess #### - -Server side includes as the name suggests would be related to something included at the server side. But what? Generally when we have many pages in our website and we have a navigation menu on our home page that displays links to other pages then, we can enable SSI (Server Size Includes) option that allows all the pages displayed in the navigation menu to be included with the home page completely. - -The SSI allows inclusion of multiple pages as if content they contain is a part of a single page so that any editing needed to be done is done in one file only which saves a lot of disk space. This option is by default enabled on servers but for .shtml files. - -In case you want to enable it for .html files you need to add following lines: - - AddHandler server-parsed .html - -After this following in the html file would lead to SSI. - - - -#### 16. How to Prevent website Directory Listing #### - -To prevent any client being able to list the directories of the website on the server at his local machine add following lines to the file inside the directory you don’t want to get listed. - - Options -Indexes - -#### 17. Changing Default charset and language headers. #### - -.htaccess files allow you to modify the character set used i.e. ASCII or UNICODE, UTF-8 etc. for your website along with the default language used for the display of content. - -Following server’s global environment variables allow you to achieve above feature. - - AddDefaultCharset UTF-8 - DefaultLanguage en-US - -**Re-writing URL’s: Redirection Rules** - -Re-writing feature simply means replacing the long and un-rememberable URL’s with short and easy to remember ones. But, before going into this topic there are some rules and some conventions for special symbols used later on in this article. - -**Special Symbols:** - - Symbol Meaning - ^ - Start of the string - $ - End of the String - | - Or [a|b] – a or b - [a-z] - Any of the letter between a to z - + - One or more occurrence of previous letter - * - Zero or more occurrence of previous letter - ? - Zero or one occurrence of previous letter - -**Constants and their meaning:** - - Constant Meaning - NC - No-case or case sensitive - L - Last rule – stop processing further rules - R - Temporary redirect to new URL - R=301 - Permanent redirect to new URL - F - Forbidden, send 403 header to the user - P - Proxy – grab remote content in substitution section and return it - G - Gone, no longer exists - S=x - Skip next x rules - T=mime-type - Force specified MIME type - E=var:value - Set environment variable var to value - H=handler - Set handler - PT - Pass through – in case of URL’s with additional headers. - QSA - Append query string from requested to substituted URL - -#### 18. Redirecting a non-www URL to a www URL. #### - -Before starting with the explanation, lets first see the lines that are needed to be added to .htaccess file to enable this feature. - - RewriteEngine ON - RewriteCond %{HTTP_HOST} ^abc\.net$ - RewriteRule (.*) http://www.abc.net/$1 [R=301,L] - -The above lines enable the Rewrite Engine and then in second line check all those URL’s that pertain to host abc.net or have the HTTP_HOST environment variable set to “abc.net”. - -For all such URL’s the code permanently redirects them (as R=301 rule is enabled) to the new URL http://www.abc.net/$1 where $1 is the non-www URL having host as abc.net. The non-www URL is the one in bracket and is referred by $1. - -#### 19. Redirecting entire website to https. #### - -Following lines will help you transfer entire website to https: - - RewriteEngine ON - RewriteCond %{HTTPS} !on - RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} - -The above lines enable the re-write engine and then check the value of HTTPS environment variable. If it is on then re-write the entire pages of the website to https. - -#### 20. A custom redirection example #### - -For example, redirect url ‘http://www.abc.net?p=100&q=20 ‘ to ‘http://www.abc.net/10020pq’. - - RewriteEngine ON - RewriteRule ^http://www.abc.net/([0-9]+)([0-9]+)pq$ ^http://www.abc.net?p=$1&q=$2 - -In above lines, $1 represents the first bracket and $2 represents the second bracket. - -#### 21. Renaming the htaccess file #### - -For preventing the .htaccess file from the intruders and other people from viewing those files you can rename that file so that it is not accessed by client’s browser. The line that does this is: - - AccessFileName htac.cess - -#### 22. How to Prevent Image Hotlinking for your Website #### - -Another problem that is major factor of large bandwidth consumption by the websites is the problem of hot links which are links to your websites by other websites for display of images mostly of your website which consumes your bandwidth. This problem is also called as ‘bandwidth theft’. - -A common observation is when a site displays the image contained in some other site due to this hot-linking your site needs to be loaded and at the stake of your site’s bandwidth, the other site’s images are displayed. To prevent this for like: images such as: .gif, .jpeg etc. following lines of code would help: - - RewriteEngine ON - RewriteCond %{HTTP_REFERER} !^$ - RewriteCond %{HTTP_REFERERER} !^http://(www\.)?mydomain.com/.*$ [NC] - RewriteRule \.(gif|jpeg|png)$ - [F]. - -The above lines check if the HTTP_REFERER is not set to blank or not set to any of the links in your websites. If this is happening then all the images in your page are replaced by 403 forbidden. - -#### 23. How to Redirect Users to Maintenance Page. #### - -In case your website is down for maintenance and you want to notify all your clients that need to access your websites about this then for such cases you can add following lines to your .htaccess websites that allow only admin access and replace the site pages having links to any .jpg, .css, .gif, .js etc. - - RewriteCond %{REQUEST_URI} !^/admin/ [NC] - RewriteCond %{REQUEST_URI} !^((.*).css|(.*).js|(.*).png|(.*).jpg) [NC] - RewriteRule ^(.*)$ /ErrorDocs/Maintainence_Page.html - [NC,L,U,QSA] - -These lines check if the Requested URL contains any request for any admin page i.e. one starting with ‘/admin/’ or any request to ‘.png, .jpg, .js, .css’ pages and for any such requests it replaces that page to ‘ErrorDocs/Maintainence_Page.html’. - -#### 24. Mapping IP Address to Domain Name #### - -Name servers are the servers that convert a specific IP Address to a domain name. This mapping can also be specified in the .htaccess files in the following manner. - - For Mapping L.M.N.O address to a domain name www.hellovisit.com - RewriteCond %{HTTP_HOST} ^L\.M\.N\.O$ [NC] - RewriteRule ^(.*)$ http://www.hellovisit.com/$1 [L,R=301] - -The above lines check if the host for any page is having the IP Address as: L.M.N.O and if so the page is mapped to the domain name http://www.hellovisit.com by the third line by permanent redirection. - -#### 25. FilesMatch Tag #### - -Like tag that is used to apply conditions to a single file, can be used to match to a group of files and apply some conditions to the group of files as below: - - - Order Allow, Deny - Deny from All - - -### Conclusion ### - -The list of tricks that can be done with .htaccess files is much more. Thus, this gives us an idea how powerful this file is and how much security and dynamicity and other features it can give to your website. - -We’ve tried our best to cover as much as htaccess tricks in this article, but incase if we’ve missed any important trick, or you most welcome to post your htaccess ideas and tricks that you know via comments section below – we will include those in our article too… - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/apache-htaccess-tricks/ - -作者:[Gunjit Khera][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/gunjitk94/ \ No newline at end of file diff --git a/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md b/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md deleted file mode 100644 index 58a0841280..0000000000 --- a/sources/tech/20150209 How to access Feedly RSS feed from the command line on Linux.md +++ /dev/null @@ -1,106 +0,0 @@ -How to access Feedly RSS feed from the command line on Linux -================================================================================ -In case you didn't know, [Feedly][1] is one of the most popular online news aggregation services. It offers seamlessly unified news reading experience across desktops, Android and iOS devices via browser extensions and mobile apps. Feedly took on the demise of Google Reader in 2013, quickly gaining a lot of then Google Reader users. I was one of them, and Feedly has remained my default RSS reader since then. - -While I appreciate the sleek interface of Feedly's browser extensions and mobile apps, there is yet another way to access Feedly: Linux command-line. That's right. You can access Feedly's news feed from the command line. Sounds geeky? Well, at least for system admins who live on headless servers, this can be pretty useful. - -Enter [Feednix][2]. This open-source software is a Feedly's unofficial command-line client written in C++. It allows you to browse Feedly's news feed in ncurses-based terminal interface. By default, Feednix is linked with a console-based browser called w3m to allow you to read articles within a terminal environment. You can choose to read from your favorite web browser though. - -In this tutorial, I am going to demonstrate how to install and configure Feednix to access Feedly from the command line. - -### Install Feednix on Linux ### - -You can build Feednix from the source using the following instructions. At the moment, the "Ubuntu-stable" branch of the official Github repository has the most up-to-date code. So let's use this branch to build it. - -As prerequisites, you will need to install a couple of development libraries, as well as w3m browser. - -#### Debian, Ubuntu or Linux Mint #### - - $ sudo apt-get install git automake g++ make libncursesw5-dev libjsoncpp-dev libcurl4-gnutls-dev w3m - $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git - $ cd Feednix - $ ./autogen.sh - $ ./configure - $ make - $ sudo make install - -#### Fedora #### - - $ sudo yum groupinstall "C Development Tools and Libraries" - $ sudo yum install gcc-c++ git automake make ncurses-devel jsoncpp-devel libcurl-devel w3m - $ git clone -b Ubuntu-stable https://github.com/Jarkore/Feednix.git - $ cd Feednix - $ ./autogen.sh - $ ./configure - $ make - $ sudo make install - -Arch Linux - -On Arch Linux, you can easily install Feednix from [AUR][3]. - -### Configure Feednix for the First Time ### - -After installing it, launch Feednix as follows. - - $ feednix - -The first time you run Feednix, it will pop up a web browser window, where you need to sign up to create a Feedly's user ID and its corresponding developer access token. If you are running Feednix in a desktop-less environment, open a web browser on another computer, and go to https://feedly.com/v3/auth/dev. - -![](https://farm8.staticflickr.com/7427/15825106524_42883b3e32_b.jpg) - -Once you sign in, you will see your Feedly user ID generated. - -![](https://www.flickr.com/photos/xmodulo/15827565143/) - -To retrieve an access token, you need to follow the token link sent to your email address in your browser. Only then will you see the window showing your user ID, access token, and its expiration date. Be aware that access token is quite long (more than 200 characters). The token appears in a horizontally scrollable text box, so make sure to copy the whole access token string. - -![](https://farm9.staticflickr.com/8605/16446685812_9098df494b_b.jpg) - -Paste your user ID and access token into the Feednix' command-line prompt. - - [Enter User ID] >> XXXXXX - [Enter token] >> YYYYY - -After successful authentication, you will see an initial Feednix screen with two panes. The left-side "Categories" pane shows a list of news categories, while the right-side "Posts" pane displays a list of news articles in the current category. - -![](https://farm8.staticflickr.com/7412/16421639256_deb8e2d276_c.jpg) - -### Read News in Feednix ### - -Here I am going to briefly describe how to access Feedly via Feednix. - -#### Navigate Feednix #### - -As I mentioned, the top screen of Feednix consists of two panes. To switch focus between the two panes, use TAB key. To move up and down the list within a pane, use 'j' and 'k' keys, respectively. These keyboard shorcuts are obviously inspired by Vim text editor. - -#### Read an Article #### - -To read a particular article, press 'o' key at the current article. It will invoke w2m browser, and load the article inside the browser. Once you are done reading, press 'q' to quit the browser, and come back to Feednix. If your environment can open a web browser, you can press 'O' to load an article on your default web browser such as Firefox. - -![](https://farm8.staticflickr.com/7406/16445870201_b98e8da6d9_b.jpg) - -#### Subscribe to a News Feed #### - -You can add any arbitrary RSS news feed to your Feedly account from Feednix interface. To do so, simply press 'a' key. This will show "[ENTER FEED]:" prompt at the bottom of the screen. After typing the RSS feed, go ahead and fill in the name of the feed and its preferred category. - -![](https://farm8.staticflickr.com/7324/16421639296_b52ed3c52e_c.jpg) - -#### Summary #### - -As you can see, Feednix is a quite convenient and easy-to-use command-line RSS reader. If you are a command-line junkie as well as a regular Feedly user, Feednix is definitely worth trying. I have been communicating with the creator of Feednix, Jarkore, to troubleshoot some issue. As far as I can tell, he is very active in responding to bug reports and fixing bugs. I encourage you to try out Feednix and let him know your feedback. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/feedly-rss-feed-command-line-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]:https://feedly.com/ -[2]:https://github.com/Jarkore/Feednix -[3]:https://aur.archlinux.org/packages/feednix/ \ No newline at end of file diff --git a/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md b/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md deleted file mode 100644 index 29bb770e5d..0000000000 --- a/sources/tech/20150211 Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules.md +++ /dev/null @@ -1,270 +0,0 @@ -Protect Apache Against Brute Force or DDoS Attacks Using Mod_Security and Mod_evasive Modules -================================================================================ -For those of you in the hosting business, or if you’re hosting your own servers and exposing them to the Internet, securing your systems against attackers must be a high priority. - -mod_security (an open source intrusion detection and prevention engine for web applications that integrates seamlessly with the web server) and mod_evasive are two very important tools that can be used to protect a web server against brute force or (D)DoS attacks. - -mod_evasive, as its name suggests, provides evasive capabilities while under attack, acting as an umbrella that shields web servers from such threats. - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Mod_Security-Mod_evasive-in-CentOS.jpg) -Install Mod_Security and Mod_Evasive to Protect Apache - -In this article we will discuss how to install, configure, and put them into play along with Apache on RHEL/CentOS 6 and 7 as well as Fedora 21-15. In addition, we will simulate attacks in order to verify that the server reacts accordingly. - -This assumes that you have a LAMP server installed on your system. If not, please check this article before proceeding further. - -- [Install LAMP stack in RHEL/CentOS 7][1] - -You will also need to setup iptables as the default [firewall][2] front-end instead of firewalld if you’re running RHEL/CentOS 7 or Fedora 21. We do this in order to use the same tool in both RHEL/CentOS 7/6 and Fedora 21. - -### Step 1: Installing Iptables Firewall on RHEL/CentOS 7 and Fedora 21 ### - -To begin, stop and disable firewalld: - - # systemctl stop firewalld - # systemctl disable firewalld - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-Firewalld-Service.png) -Disable Firewalld Service - -Then install the iptables-services package before enabling iptables: - - # yum update && yum install iptables-services - # systemctl enable iptables - # systemctl start iptables - # systemctl status iptables - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Install-Iptables-Firewall.png) -Install Iptables Firewall - -### Step 2: Installing Mod_Security and Mod_evasive ### - -In addition to having a LAMP setup already in place, you will also have to [enable the EPEL repository][3] in RHEL/CentOS 7/6 in order to install both packages. Fedora users don’t need to enable any repo, because epel is a already part of Fedora project. - - # yum update && yum install mod_security mod_evasive - -When the installation is complete, you will find the configuration files for both tools in /etc/httpd/conf.d. - - # ls -l /etc/httpd/conf.d - -![](http://www.tecmint.com/wp-content/uploads/2012/06/mod_security-mod_evasive-Configurations.png) -mod_security + mod_evasive Configurations - -Now, in order to integrate these two modules with Apache and have it load them when it starts, make sure the following lines appear in the top level section of mod_evasive.conf and mod_security.conf, respectively: - - LoadModule evasive20_module modules/mod_evasive24.so - LoadModule security2_module modules/mod_security2.so - -Note that modules/mod_security2.so and modules/mod_evasive24.so are the relative paths, from the /etc/httpd directory to the source file of the module. You can verify this (and change it, if needed) by listing the contents of the /etc/httpd/modules directory: - - # cd /etc/httpd/modules - # pwd - # ls -l | grep -Ei '(evasive|security)' - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Verify-mod_security-mod_evasive-Modules.png) -Verify mod_security + mod_evasive Modules - -Then restart Apache and verify that it loads mod_evasive and mod_security: - - # service httpd restart [On RHEL/CentOS 6 and Fedora 20-18] - # systemctl restart httpd [On RHEL/CentOS 7 and Fedora 21] - ----------- - - [Dump a list of loaded Static and Shared Modules] - - # httpd -M | grep -Ei '(evasive|security)' - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Check-mod_security-mod_evasive-Loaded.png) -Check mod_security + mod_evasive Modules Loaded - -### Step 3: Installing A Core Rule Set and Configuring Mod_Security ### - -In few words, a Core Rule Set (aka CRS) provides the web server with instructions on how to behave under certain conditions. The developer firm of mod_security provide a free CRS called OWASP ([Open Web Application Security Project][4]) ModSecurity CRS that can be downloaded and installed as follows. - -1. Download the OWASP CRS to a directory created for that purpose. - - # mkdir /etc/httpd/crs-tecmint - # cd /etc/httpd/crs-tecmint - # wget https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Download-mod_security-Core-Rules.png) -Download mod_security Core Rules - -2. Untar the CRS file and change the name of the directory for one of our convenience. - - # tar xzf master - # mv SpiderLabs-owasp-modsecurity-crs-ebe8790 owasp-modsecurity-crs - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Extract-mod_security-Core-Rules.png) -Extract mod_security Core Rules - -3. Now it’s time to configure mod_security. Copy the sample file with rules (owasp-modsecurity-crs/modsecurity_crs_10_setup.conf.example) into another file without the .example extension: - - # cp modsecurity_crs_10_setup.conf.example modsecurity_crs_10_setup.conf - -and tell Apache to use this file along with the module by inserting the following lines in the web server’s main configuration file /etc/httpd/conf/httpd.conf file. If you chose to unpack the tarball in another directory you will need to edit the paths following the Include directives: - - - Include crs-tecmint/owasp-modsecurity-crs/modsecurity_crs_10_setup.conf - Include crs-tecmint/owasp-modsecurity-crs/base_rules/*.conf - - -Finally, it is recommended that we create our own configuration file within the /etc/httpd/modsecurity.d directory where we will place our customized directives (we will name it tecmint.conf in the following example) instead of modifying the CRS files directly. Doing so will allow for easier upgrading the CRSs as new versions are released. - - - SecRuleEngine On - SecRequestBodyAccess On - SecResponseBodyAccess On - SecResponseBodyMimeType text/plain text/html text/xml application/octet-stream - SecDataDir /tmp - - -You can refer to the [SpiderLabs’ ModSecurity GitHub][5] repository for a complete explanatory guide of mod_security configuration directives. - -### Step 4: Configuring Mod_Evasive ### - -mod_evasive is configured using directives in /etc/httpd/conf.d/mod_evasive.conf. Since there are no rules to update during a package upgrade, we don’t need a separate file to add customized directives, as opposed to mod_security. - -The default mod_evasive.conf file has the following directives enabled (note that this file is heavily commented, so we have stripped out the comments to highlight the configuration directives below): - - - DOSHashTableSize 3097 - DOSPageCount 2 - DOSSiteCount 50 - DOSPageInterval 1 - DOSSiteInterval 1 - DOSBlockingPeriod 10 - - -Explanation of the directives: - -- DOSHashTableSize: This directive specifies the size of the hash table that is used to keep track of activity on a per-IP address basis. Increasing this number will provide a faster look up of the sites that the client has visited in the past, but may impact overall performance if it is set too high. -- DOSPageCount: Legitimate number of identical requests to a specific URI (for example, any file that is being served by Apache) that can be made by a visitor over the DOSPageInterval interval. -- DOSSiteCount: Similar to DOSPageCount, but refers to how many overall requests can be made to the entire site over the DOSSiteInterval interval. -- DOSBlockingPeriod: If a visitor exceeds the limits set by DOSSPageCount or DOSSiteCount, his source IP address will be blacklisted during the DOSBlockingPeriod amount of time. During DOSBlockingPeriod, any requests coming from that IP address will encounter a 403 Forbidden error. - -Feel free to experiment with these values so that your web server will be able to handle the required amount and type of traffic. - -**Only a small caveat**: if these values are not set properly, you run the risk of ending up blocking legitimate visitors. - -You may also want to consider other useful directives: - -#### DOSEmailNotify #### - -If you have a mail server up and running, you can send out warning messages via Apache. Note that you will need to grant the apache user SELinux permission to send emails if SELinux is set to enforcing. You can do so by running - - # setsebool -P httpd_can_sendmail 1 - -Next, add this directive in the mod_evasive.conf file with the rest of the other directives: - - DOSEmailNotify you@yourdomain.com - -If this value is set and your mail server is working properly, an email will be sent to the address specified whenever an IP address becomes blacklisted. - -#### DOSSystemCommand #### - -This needs a valid system command as argument, - - DOSSystemCommand
- -This directive specifies a command to be executed whenever an IP address becomes blacklisted. It is often used in conjunction with a shell script that adds a firewall rule to block further connections coming from that IP address. - -**Write a shell script that handles IP blacklisting at the firewall level** - -When an IP address becomes blacklisted, we need to block future connections coming from it. We will use the following shell script that performs this job. Create a directory named scripts-tecmint (or whatever name of your choice) in /usr/local/bin and a file called ban_ip.sh in that directory. - - #!/bin/sh - # IP that will be blocked, as detected by mod_evasive - IP=$1 - # Full path to iptables - IPTABLES="/sbin/iptables" - # mod_evasive lock directory - MOD_EVASIVE_LOGDIR=/var/log/mod_evasive - # Add the following firewall rule (block all traffic coming from $IP) - $IPTABLES -I INPUT -s $IP -j DROP - # Remove lock file for future checks - rm -f "$MOD_EVASIVE_LOGDIR"/dos-"$IP" - -Our DOSSystemCommand directive should read as follows: - - DOSSystemCommand "sudo /usr/local/bin/scripts-tecmint/ban_ip.sh %s" - -In the line above, %s represents the offending IP as detected by mod_evasive. - -**Add the apache user to the sudoers file** - -Note that all of this just won’t work unless you to give permissions to user apache to run our script (and that script only!) without a terminal and password. As usual, you can just type visudo as root to access the /etc/sudoers file and then add the following 2 lines as shown in the image below: - - apache ALL=NOPASSWD: /usr/local/bin/scripts-tecmint/ban_ip.sh - Defaults:apache !requiretty - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Add-Apache-User-to-Sudoers.png) -Add Apache User to Sudoers - -**IMPORTANT**: As a default security policy, you can only run sudo in a terminal. Since in this case we need to use sudo without a tty, we have to comment out the line that is highlighted in the following image: - - #Defaults requiretty - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Disable-tty-for-Sudo.png) -Disable tty for Sudo - -Finally, restart the web server: - - # service httpd restart [On RHEL/CentOS 6 and Fedora 20-18] - # systemctl restart httpd [On RHEL/CentOS 7 and Fedora 21] - -### Step 4: Simulating an DDoS Attacks on Apache ### - -There are several tools that you can use to simulate an external attack on your server. You can just google for “tools for simulating ddos attacks” to find several of them. - -Note that you, and only you, will be held responsible for the results of your simulation. Do not even think of launching a simulated attack to a server that you’re not hosting within your own network. - -Should you want to do the same with a VPS that is hosted by someone else, you need to appropriately warn your hosting provider or ask permission for such a traffic flood to go through their networks. Tecmint.com is not, by any means, responsible for your acts! - -In addition, launching a simulated DoS attack from only one host does not represent a real life attack. To simulate such, you would need to target your server from several clients at the same time. - -Our test environment is composed of a CentOS 7 server [IP 192.168.0.17] and a Windows host from which we will launch the attack [IP 192.168.0.103]: - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Confirm-Host-IPAddress.png) -Confirm Host IPAddress - -Please play the video below and follow the steps outlined in the indicated order to simulate a simple DoS attack: - -注:youtube视频,发布的时候不行做个链接吧 - - -Then the offending IP is blocked by iptables: - -![](http://www.tecmint.com/wp-content/uploads/2012/06/Blocked-Attacker-IP.png) -Blocked Attacker IP - -### Conclusion ### - -With mod_security and mod_evasive enabled, the simulated attack causes the CPU and RAM to experiment a temporary usage peak for only a couple of seconds before the source IPs are blacklisted and blocked by the firewall. Without these tools, the simulation will surely knock down the server very fast and render it unusable during the duration of the attack. - -We would love to hear if you’re planning on using (or have used in the past) these tools. We always look forward to hearing from you, so don’t hesitate to leave your comments and questions, if any, using the form below. - -### Reference Links ### - -- [https://www.modsecurity.org/][6] -- [http://www.zdziarski.com/blog/?page_id=442][7] - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/protect-apache-using-mod_security-and-mod_evasive-on-rhel-centos-fedora/ - -作者:[Gabriel Cánepa][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/gacanepa/ -[1]:http://www.tecmint.com/install-lamp-in-centos-7/ -[2]:http://www.tecmint.com/configure-firewalld-in-centos-7/ -[3]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ -[4]:https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project -[5]:https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#Configuration_Directives -[6]:https://www.modsecurity.org/ -[7]:http://www.zdziarski.com/blog/?page_id=442 \ No newline at end of file diff --git a/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md b/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md deleted file mode 100644 index 64e872c4b7..0000000000 --- a/sources/tech/20150225 How to make remote incremental backup of LUKS-encrypted disk or partition.md +++ /dev/null @@ -1,80 +0,0 @@ -How to make remote incremental backup of LUKS-encrypted disk/partition -================================================================================ -Some of us have our hard drives at home or on a [VPS][1] encrypted by [Linux Unified Key Setup (LUKS)][2] for security reasons, and these drives can quickly grow to tens or hundreds of GBs in size. So while we enjoy the security of our LUKS device, we may start to think about a possible remote backup solution. For secure off-site backup, we will need something that operates at the block level of the encrypted LUKS device, and not at the un-encrypted file system level. So in the end we find ourselves in a situation where we will need to transfer the entire LUKS device (let's say 200GB for example) each time we want to make a backup. Clearly not feasible. How can we deal with this problem? - -### A Solution: Bdsync ### - -This is when a brilliant open-source tool called [Bdsync][3] (thanks to Rolf Fokkens) comes to our rescue. As the name implies, Bdsync can synchronize "block devices" over network. For fast synchronization, Bdsync generates and compares MD5 checksums of blocks in the local/remote block devices, and sync only the differences. What rsync can do at the file system level, Bdsync can do it at the block device level. Naturally, it works with encrypted LUKS devices as well. Pretty neat! - -Using Bdsync, the first-time backup will copy the entire LUKS block device to a remote host, so it will take a lot of time to finish. However, after that initial backup, if we make some new files on the LUKS device, the second backup will be finished quickly because we will need to copy only that blocks which have been changed. Classic incremental backup at play! - -### Install Bdsync on Linux ### - -Bdsync is not included in the standard repositories of [Linux][4] distributions. Thus you need to build it from the source. Use the following distro-specific instructions to install Bdsync and its man page on your system. - -#### Debian, Ubuntu or Linux Mint #### - - $ sudo apt-get install git gcc libssl-dev - $ git clone https://github.com/TargetHolding/bdsync.git - $ cd bdsync - $ make - $ sudo cp bdsync /usr/local/sbin - $ sudo mkdir -p /usr/local/man/man1 - $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' - -#### Fedora or CentOS/RHEL #### - - $ sudo yum install git gcc openssl-devel - $ git clone https://github.com/TargetHolding/bdsync.git - $ cd bdsync - $ make - $ sudo cp bdsync /usr/local/sbin - $ sudo mkdir -p /usr/local/man/man1 - $ sudo sh -c 'gzip -c bdsync.1 > /usr/local/man/man1/bdsync.1.gz' - -### Perform Off-site Incremental Backup of LUKS-Encrypted Device ### - -I assume that you have already provisioned a LUKS-encrypted block device as a backup source (e.g., /dev/LOCDEV). I also assume that you have a remote host where the source device will be backed up (e.g., as /dev/REMDEV). - -You need to access the root account on both systems, and set up [password-less SSH access][5] from the local host to a remote host. Finally, you need to install Bdsync on both hosts. - -To initiate a remote backup process on the local host, we execute the following command as the root: - - # bdsync "ssh root@remote_host bdsync --server" /dev/LOCDEV /dev/REMDEV | gzip > /some_local_path/DEV.bdsync.gz - -Some explanations are needed here. Bdsync client will open an SSH connection to the remote host as the root, and execute Bdsync client with --server option. As clarified, /dev/LOCDEV is our source LUKS block device on the local host, and /dev/REMDEV is the target block device on the remote host. They could be /dev/sda (for an entire disk) or /dev/sda2 (for a single partition). The output of the local Bdsync client is then piped to gzip, which creates DEV.bdsync.gz (so-called binary patch file) in the local host. - -The first time you run the above command, it will take very long time, depending on your Internet/LAN speed and the size of /dev/LOCDEV. Remember that you must have two block devices (/dev/LOCDEV and /dev/REMDEV) with the same size. - -The next step is to copy the generated patch file from the local host to the remote host. Using scp is one possibility: - - # scp /some_local_path/DEV.bdsync.gz root@remote_host:/remote_path - -The final step is to execute the following command on the remote host, which will apply the patch file to /dev/REMDEV: - - # gzip -d < /remote_path/DEV.bdsync.gz | bdsync --patch=/dev/DSTDEV - -I recommend doing some tests with small partitions (without any important data) before deploying Bdsync with real data. After you fully understand how the entire setup works, you can start backing up real data. - -### Conclusion ### - -In conclusion, we showed how to use Bdsync to perform incremental backups for LUKS devices. Like rsync, only a fraction of data, not the entire LUKS device, is needed to be pushed to an off-site backup site at each backup, which saves bandwidth and backup time. Rest assured that all the data transfer is secured by SSH or SCP, on top of the fact that the device itself is encrypted by LUKS. It is also possible to improve this setup by using a dedicated user (instead of the root) who can run bdsync. We can also use bdsync for ANY block device, such as LVM volumes or RAID disks, and can easily set up Bdsync to back up local disks on to USB drives as well. As you can see, its possibility is limitless! - -Feel free to share your thought. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/remote-incremental-backup-luks-encrypted-disk-partition.html - -作者:[Iulian Murgulet][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/iulian -[1]:http://xmodulo.com/go/digitalocean -[2]:http://xmodulo.com/how-to-create-encrypted-disk-partition-on-linux.html -[3]:http://bdsync.rolf-fokkens.nl/ -[4]:http://xmodulo.com/recommend/linuxbook -[5]:http://xmodulo.com/how-to-enable-ssh-login-without.html \ No newline at end of file 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 deleted file mode 100644 index a0c77c21f9..0000000000 --- a/sources/tech/20150316 How to Test Your Internet Speed Bidirectionally from Command Line Using 'Speedtest-CLI' Tool.md +++ /dev/null @@ -1,132 +0,0 @@ -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. - -What about headless server, where isn’t any web based browser and the main point is, most of the servers are headless. The another bottleneck of such web browser based speed testing is that, you can’t schedule the speed testing at regular interval. Here comes an application “Speedtest-cli” that removes such bottlenecks and let you test the speed of Internet connection from command line. - -#### What is Speedtest-cli #### - -The application is basically a script developed in Python programming Language. It measures Internet Bandwidth speed bidirectionally. It used speedtest.net infrastructure to measure the speed. Speedtest-cli is able to list server based upon physical distance, test against specific server, and gives you URL to share the result of your internet speed test. - -To install latest speedtest-cli tool in Linux systems, you must have Python 2.4-3.4 or higher version installed on the system. - -### Install speedtest-cli in Linux ### - -There are two ways to install speedtest-cli tool. The first method involves the use of `python-pip` package while the second method is to download the Python script, make it executable and run, here I will cover both ways…. - -#### Install speedtest-cli Using pythin-pip #### - -First you need to install `python-pip` package, then afterwards you can install the speedtest-cli tool using pip command as shown below. - - $ sudo apt-get install python-pip - $ sudo pip install speedtest-cli - -To upgrade speedtest-cli, at later stage, use. - - $ sudo pip install speedtest-cli --upgrade - -#### Install speedtest-cli Using Python Script #### - -First download the python script from github using wget command, unpack the downloaded file (master.zip) and extract it.. - - $ wget https://github.com/sivel/speedtest-cli/archive/master.zip - $ unzip master.zip - -After extracting the file, go to the extracted directory `speedtest-cli-master` and make the script file executable. - - $ cd speedtest-cli-master/ - $ chmod 755 speedtest_cli.py - -Next, move the executable to `/usr/bin` folder, so that you don’t need to type the full path everytime. - - $ sudo mv speedtest_cli.py /usr/bin/ - -### Testing Internet Connection Speed with speedtest-cli ### - -**1. To test Download and Upload speed of your internet connection, run the `speedtest-cli` command without any argument as shown below.** - - $ speedtest_cli.py - -![Test Download Upload Speed in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Download-Upload-Speed-in-Linux1.png) -Test Download Upload Speed in Linux - -**2. To check the speed result in bytes in place of bits.** - - $ speedtest_cli.py --bytes - -![Test Internet Speed in Bytes](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Speed-in-Bytes.png) -Test Internet Speed in Bytes - -**3. Share your bandwidth speed with your friends or family. You are provided with a link that can be used to download an image.** - -![Share Internet Speed Results](http://www.tecmint.com/wp-content/uploads/2015/03/Share-Internet-Speed-Results.png) -Share Internet Speed Results - -The following picture is a sample speed test result generated using above command. - -![Speed Test Results](http://www.tecmint.com/wp-content/uploads/2015/03/Speed-Test-Results.png) -Speed Test Results - -**4. Don’t need any additional information other than Ping, Download and upload?** - - $ speedtest_cli.py --simple - -![Test Ping Download Upload Speed](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Ping-Download-Upload-Speed1.png) -Test Ping Download Upload Speed - -**5. List the `speedtest.net` server based upon physical distance. The distance in km is mentioned.** - - $ speedtest_cli.py --list - -![Check Speedtest.net Servers](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Speedtest-Servers.png) -Check Speedtest.net Servers - -**6. The last stage generated a huge list of servers sorted on the basis of distance. How to get desired output? Say I only want to see the speedtest.net server located in Mumbai (India).** - - $ speedtest_cli.py --list | grep -i Mumbai - -![Check Nearest Server](http://www.tecmint.com/wp-content/uploads/2015/03/Check-Nearest-Server.png) -Check Nearest Server - -**7. Test connection speed against a specific server. Use Server Id generated in example 5 and example 6 in above.** - - $ speedtest_cli.py --server [server ID] - $ speedtest_cli.py --server [5060] ## Here server ID 5060 is used in the example. - -![Test Connection Against Server](http://www.tecmint.com/wp-content/uploads/2015/03/Test-Connection-Against-Server.png) -Test Connection Against Server - -**8. To check the version number and help of `speedtest-cli` tool.** - - $ speedtest_cli.py --version - -![Check SpeedCli Version](http://www.tecmint.com/wp-content/uploads/2015/03/Check-SpeedCLi-Version.png) -Check SpeedCli Version - - $ speedtest_cli.py --help - -![SpeedCli Help](http://www.tecmint.com/wp-content/uploads/2015/03/SpeedCli-Help.png) -SpeedCli Help - -**Note:** Latency reported by tool is not its goal and one should not rely on it. The relative latency values output is responsible for server selected to be tested against. CPU and Memory capacity will influence the result to certain extent. - -### Conclusion ### - -The tool is must for system administrators and developers. A simple script which runs without any issue. I must say that the application is wonderful, lightweight and do what it promises. I disliked Speedtest.net for the reason it was using flash, but speedtest-cli gave me a reason to love them. - -speedtest_cli is a third party application and should not be used to automatically record the bandwidth speed. Speedtest.net is used by millions of users and it is a good idea to [Set Your Own Speedtest Mini Server][1]. - -That’s all for now, till then stay tuned and connected to Tecmint. Don’t forget to give your valuable feedback in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/check-internet-speed-from-command-line-in-linux/ - -作者:[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/speedtest-mini-server-to-test-bandwidth-speed/ 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 deleted file mode 100644 index ecfb639d54..0000000000 --- a/sources/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md +++ /dev/null @@ -1,268 +0,0 @@ -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) - -In our [previous article we told you what LVM is and what you may want to use it for][1], and today we are going to walk you through some of the key management tools of LVM so you will be confident when setting up or expanding your installation. - -As stated before, LVM is a abstraction layer between your operating system and physical hard drives. What that means is your physical hard drives and partitions are no longer tied to the hard drives and partitions they reside on. Rather, the hard drives and partitions that your operating system sees can be any number of separate hard drives pooled together or in a software RAID. - -To manage LVM there are GUI tools available but to really understand what is happening with your LVM configuration it is probably best to know what the command line tools are. This will be especially useful if you are managing LVM on a server or distribution that does not offer GUI tools. - -Most of the commands in LVM are very similar to each other. Each valid command is preceded by one of the following: - -- Physical Volume = pv -- Volume Group = vg -- Logical Volume = lv - -The physical volume commands are for adding or removing hard drives in volume groups. Volume group commands are for changing what abstracted set of physical partitions are presented to your operating in logical volumes. Logical volume commands will present the volume groups as partitions so that your operating system can use the designated space. - -### Downloadable LVM Cheat Sheet ### - -To help you understand what commands are available for each prefix we made a LVM cheat sheet. We will cover some of the commands in this article, but there is still a lot you can do that won’t be covered here. - -All commands on this list will need to be run as root because you are changing system wide settings that will affect the entire machine. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/lvm-cheatsheet.png) - -### How to View Current LVM Information ### - -The first thing you may need to do is check how your LVM is set up. The s and display commands work with physical volumes (pv), volume groups (vg), and logical volumes (lv) so it is a good place to start when trying to figure out the current settings. - -The display command will format the information so it’s easier to understand than the s command. For each command you will see the name and path of the pv/vg and it should also give information about free and used space. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/539x225xpvdisplay.png.pagespeed.ic.u2XV5LBTYa.png) - -The most important information will be the PV name and VG name. With those two pieces of information we can continue working on the LVM setup. - -### Creating a Logical Volume ### - -Logical volumes are the partitions that your operating system uses in LVM. To create a logical volume we first need to have a physical volume and volume group. Here are all of the steps necessary to create a new logical volume. - -#### Create physical volume #### - -We will start from scratch with a brand new hard drive with no partitions or information on it. Start by finding which disk you will be working with. (/dev/sda, sdb, etc.) - -> Note: Remember all of the commands will need to be run as root or by adding ‘sudo’ to the beginning of the command. - - fdisk -l - -If your hard drive has never been formatted or partitioned before you will probably see something like this in the fdisk output. This is completely fine because we are going to create the needed partitions in the next steps. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/fdisk.png.pagespeed.ce.AmAEsxm-7Q.png) - -Our new disk is located at /dev/sdb so lets use fdisk to create a new partition on the drive. - -There are a plethora of tools that can create a new partition with a GUI, [including Gparted][2], but since we have the terminal open already, we will use fdisk to create the needed partition. - -From a terminal type the following commands: - - fdisk /dev/sdb - -This will put you in a special fdisk prompt. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x145xfdisk00.png.pagespeed.ic.I7S8bjoXQG.png) - -Enter the commands in the order given to create a new primary partition that uses 100% of the new hard drive and is ready for LVM. If you need to change the partition size or want multiple partions I suggest using GParted or reading about fdisk on your own. - -**Warning: The following steps will format your hard drive. Make sure you don’t have any information on this hard drive before following these steps.** - -- n = create new partition -- p = creates primary partition -- 1 = makes partition the first on the disk - -Push enter twice to accept the default first cylinder and last cylinder. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/562x216xfdisk01.png.pagespeed.ic.DsSZ38kWcA.png) - -To prepare the partition to be used by LVM use the following two commands. - -- t = change partition type -- 8e = changes to LVM partition type - -Verify and write the information to the hard drive. - -- p = view partition setup so we can review before writing changes to disk -- w = write changes to disk - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/560x339xfdisk03.png.pagespeed.ic.FC8foICZsb.png) - -After those commands, the fdisk prompt should exit and you will be back to the bash prompt of your terminal. - -Enter pvcreate /dev/sdb1 to create a LVM physical volume on the partition we just created. - -You may be asking why we didn’t format the partition with a file system but don’t worry, that step comes later. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/pvcreate.png.pagespeed.ce.W7VAr-ig3t.png) - -#### Create volume Group #### - -Now that we have a partition designated and physical volume created we need to create the volume group. Luckily this only takes one command. - - vgcreate vgpool /dev/sdb1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgcreate.png.pagespeed.ce.fVLzSmPZou.png) - -Vgpool is the name of the new volume group we created. You can name it whatever you’d like but it is recommended to put vg at the front of the label so if you reference it later you will know it is a volume group. - -#### Create logical volume #### - -To create the logical volume that LVM will use: - - lvcreate -L 3G -n lvstuff vgpool - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvcreate.png.pagespeed.ce.vupLB-LJEW.png) - -The -L command designates the size of the logical volume, in this case 3 GB, and the -n command names the volume. Vgpool is referenced so that the lvcreate command knows what volume to get the space from. - -#### Format and Mount the Logical Volume #### - -One final step is to format the new logical volume with a file system. If you want help choosing a Linux file system, read our [how to that can help you choose the best file system for your needs][3]. - - mkfs -t ext3 /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/571x424xmkfs.png.pagespeed.ic.ERMan1Mz0P.png) - -Create a mount point and then mount the volume somewhere you can use it. - - mkdir /mnt/stuff - mount -t ext3 /dev/vgpool/lvstuff /mnt/stuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/510x69xmount.png.pagespeed.ic.k0i1tvqgcV.png) - -#### Resizing a Logical Volume #### - -One of the benefits of logical volumes is you can make your shares physically bigger or smaller without having to move everything to a bigger hard drive. Instead, you can add a new hard drive and extend your volume group on the fly. Or if you have a hard drive that isn’t used you can remove it from the volume group to shrink your logical volume. - -There are three basic tools for making physical volumes, volume groups, and logical volumes bigger or smaller. - -Note: Each of these commands will need to be preceded by pv, vg, or lv depending on what you are working with. - -- resize – can shrink or expand physical volumes and logical volumes but not volume groups -- extend – can make volume groups and logical volumes bigger but not smaller -- reduce – can make volume groups and logical volumes smaller but not bigger - -Let’s walk through an example of how to add a new hard drive to the logical volume “lvstuff” we just created. - -#### Install and Format new Hard Drive #### - -To install a new hard drive follow the steps above to create a new partition and add change it’s partition type to LVM (8e). Then use pvcreate to create a physical volume that LVM can recognize. - -#### Add New Hard Drive to Volume Group #### - -To add the new hard drive to a volume group you just need to know what your new partition is, /dev/sdc1 in our case, and the name of the volume group you want to add it to. - -This will add the new physical volume to the existing volume group. - - vgextend vgpool /dev/sdc1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgextend.png.pagespeed.ce.atRPT1yg5f.png) - -#### Extend Logical Volume #### - -To resize the logical volume we need to say how much we want to extend by size instead of by device. In our example we just added a 8 GB hard drive to our 3 GB vgpool. To make that space usable we can use lvextend or lvresize. - - lvextend -L8G /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvextend1.png.pagespeed.ce.6scXbQVUTT.png) - -While this command will work you will see that it will actually resize our logical volume to 8 GB instead of adding 8 GB to the existing volume like we wanted. To add the last 3 available gigabytes you need to use the following command. - - lvextend -L+3G /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/430x85xlvextend2.png.pagespeed.ic.7aBiTBrW03.png) - -Now our logical volume is 11 GB in size. - -#### Extend File System #### - -The logical volume is 11 GB but the file system on that volume is still only 3 GB. To make the file system use the entire 11 GB available you have to use the command resize2fs. Just point resize2fs to the 11 GB logical volume and it will do the magic for you. - - resize2fs /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/650x150xresize2fs.png.pagespeed.ic.Mx74EdMuk_.png) - -**Note: If you are using a different file system besides ext3/4 please see your file systems resize tools.** - -#### Shrink Logical Volume #### - -If you wanted to remove a hard drive from a volume group you would need to follow the above steps in reverse order and use lvreduce and vgreduce instead. - -1. resize file system (make sure to move files to a safe area of the hard drive before resizing) -1. reduce logical volume (instead of + to extend you can also use – to reduce by size) -1. remove hard drive from volume group with vgreduce - -#### Backing up a Logical Volume #### - -Snapshots is a feature that some newer advanced file systems come with but ext3/4 lacks the ability to do snapshots on the fly. One of the coolest things about LVM snapshots is your file system is never taken offline and you can have as many as you want without taking up extra hard drive space. - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-2.png.pagespeed.ic.VtOUuqYX1W.png) - -When LVM takes a snapshot, a picture is taken of exactly how the logical volume looks and that picture can be used to make a copy on a different hard drive. While a copy is being made, any new information that needs to be added to the logical volume is written to the disk just like normal, but changes are tracked so that the original picture never gets destroyed. - -To create a snapshot we need to create a new logical volume with enough free space to hold any new information that will be written to the logical volume while we make a backup. If the drive is not actively being written to you can use a very small amount of storage. Once we are done with our backup we just remove the temporary logical volume and the original logical volume will continue on as normal. - -#### Create New Snapshot #### - -To create a snapshot of lvstuff use the lvcreate command like before but use the -s flag. - - lvcreate -L512M -s -n lvstuffbackup /dev/vgpool/lvstuff - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/597x68xlvcreate-snapshot.png.pagespeed.ic.Rw2ivtcpPg.png) - -Here we created a logical volume with only 512 MB because the drive isn’t being actively used. The 512 MB will store any new writes while we make our backup. - -#### Mount New Snapshot #### - -Just like before we need to create a mount point and mount the new snapshot so we can copy files from it. - - mkdir /mnt/lvstuffbackup - mount /dev/vgpool/lvstuffbackup /mnt/lvstuffbackup - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/565x68xmount-snapshot.png.pagespeed.ic.pVMkhK1o4x.png) - -#### Copy Snapshot and Delete Logical Volume #### - -All you have left to do is copy all of the files from /mnt/lvstuffbackup/ to an external hard drive or tar it up so it is all in one file. - -**Note: tar -c will create an archive and -f will say the location and file name of the archive. For help with the tar command use man tar in the terminal.** - - tar -cf /home/rothgar/Backup/lvstuff-ss /mnt/lvstuffbackup/ - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x67xsnapshot-backup.png.pagespeed.ic.tw-2AK_lfZ.png) - -Remember that while the backup is taking place all of the files that would be written to lvstuff are being tracked in the temporary logical volume we created earlier. Make sure you have enough free space while the backup is happening. - -Once the backup finishes, unmount the volume and remove the temporary snapshot. - - umount /mnt/lvstuffbackup - lvremove /dev/vgpool/lvstuffbackup/ - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/630x102xlvremove.png.pagespeed.ic.yBWk47X6lF.png) - -#### Deleting a Logical Volume #### - -To delete a logical volume you need to first make sure the volume is unmounted, and then you can use lvremove to delete it. You can also remove a volume group once the logical volumes have been deleted and a physical volume after the volume group is deleted. - -Here are all the commands using the volumes and groups we’ve created. - - umount /mnt/lvstuff - lvremove /dev/vgpool/lvstuff - vgremove vgpool - pvremove /dev/sdb1 /dev/sdc1 - -![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/580x185xdelete-lvm.png.pagespeed.ic.3zJTo0Zu9k.png) - -That should cover most of what you need to know to use LVM. If you’ve got some experience on the topic, be sure to share your wisdom in the comments. - --------------------------------------------------------------------------------- - -via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ - -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ -[2]:http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/ -[3]:http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/ \ No newline at end of file diff --git a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md b/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md deleted file mode 100644 index d89c91832e..0000000000 --- a/sources/tech/20150331 How to set up remote desktop on Linux VPS using x2go.md +++ /dev/null @@ -1,137 +0,0 @@ -How to set up remote desktop on Linux VPS using x2go -================================================================================ -As everything is moved to the cloud, virtualized remote desktop becomes increasingly popular in the industry as a way to enhance employee's productivity. Especially for those who need to roam constantly across multiple locations and devices, remote desktop allows them to stay connected seamlessly to their work environment. Remote desktop is attractive for employers as well, achieving increased agility and flexibility in work environments, lower IT cost due to hardware consolidation, desktop security hardening, and so on. - -In the world of Linux, of course there is no shortage of choices for settings up remote desktop environment, with many protocols (e.g., RDP, RFB, NX) and server/client implementations (e.g., [TigerVNC][1], RealVNC, FreeNX, x2go, X11vnc, TeamViewer) available. - -Standing out from the pack is [X2Go][2], an open-source (GPLv2) implementation of NX-based remote desktop server and client. In this tutorial, I am going to demonstrate **how to set up remote desktop environment for [Linux VPS][3] using X2Go**. - -### What is X2Go? ### - -The history of X2Go goes back to NoMachine's NX technology. The NX remote desktop protocol was designed to deal with low bandwidth and high latency network connections by leveraging aggressive compression and caching. Later, NX was turned into closed-source while NX libraries were made GPL-ed. This has led to open-source implementation of several NX-based remote desktop solutions, and one of them is X2Go. - -What benefits does X2Go bring to the table, compared to other solutions such as VNC? X2Go inherits all the advanced features of NX technology, so naturally it works well over slow network connections. Besides, X2Go boasts of an excellent track record of ensuring security with its built-in SSH-based encryption. No longer need to set up an SSH tunnel [manually][4]. X2Go comes with audio support out of box, which means that music playback at the remote desktop is delivered (via PulseAudio) over network, and fed into local speakers. On usability front, an application that you run on remote desktop can be seamlessly rendered as a separate window on your local desktop, giving you an illusion that the application is actually running on the local desktop. As you can see, these are some of [its powerful features][5] lacking in VNC based solutions. - -### X2GO's Desktop Environment Compatibility ### - -As with other remote desktop servers, there are [known compatibility issues][6] for X2Go server. Desktop environments like KDE3/4, Xfce, MATE and LXDE are the most friendly to X2Go server. However, your mileage may vary with other desktop managers. For example, the later versions of GNOME 3, KDE5, Unity are known to be not compatible with X2Go. If the desktop manager of your remote host is compatible with X2Go, you can follow the rest of the tutorial. - -### Install X2Go Server on Linux ### - -X2Go consists of remote desktop server and client components. Let's start with X2Go server installation. I assume that you already have an X2Go-compatible desktop manager up and running on a remote host, where we will be installing X2Go server. - -Note that X2Go server component does not have a separate service that needs to be started upon boot. You just need to make sure that SSH service is up and running. - -#### Ubuntu or Linux Mint: #### - -Configure X2Go PPA repository. X2Go PPA is available for Ubuntu 14.04 and higher. - - $ sudo add-apt-repository ppa:x2go/stable - $ sudo apt-get update - $ sudo apt-get install x2goserver x2goserver-xsession - -#### Debian (Wheezy): #### - - $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E - $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" - $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" - $ sudo apt-get update - $ sudo apt-get install x2goserver x2goserver-xsession - -#### Fedora: #### - - $ sudo yum install x2goserver x2goserver-xsession - -#### CentOS/RHEL: #### - -Enable [EPEL respository][7] first, and then run: - - $ sudo yum install x2goserver x2goserver-xsession - -### Install X2Go Client on Linux ### - -On a local host where you will be connecting to remote desktop, install X2GO client as follows. - -#### Ubuntu or Linux Mint: #### - -Configure X2Go PPA repository. X2Go PPA is available for Ubuntu 14.04 and higher. - - $ sudo add-apt-repository ppa:x2go/stable - $ sudo apt-get update - $ sudo apt-get install x2goclient - -Debian (Wheezy): - - $ sudo apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E - $ sudo sh -c "echo deb http://packages.x2go.org/debian wheezy main > /etc/apt/sources.list.d/x2go.list" - $ sudo sh -c "echo deb-src http://packages.x2go.org/debian wheezy main >> /etc/apt/sources.list.d/x2go.list" - $ sudo apt-get update - $ sudo apt-get install x2goclient - -#### Fedora: #### - - $ sudo yum install x2goclient - -CentOS/RHEL: - -Enable EPEL respository first, and then run: - - $ sudo yum install x2goclient - -### Connect to Remote Desktop with X2Go Client ### - -Now it's time to connect to your remote desktop. On the local host, simply run the following command or use desktop launcher to start X2Go client. - - $ x2goclient - -Enter the remote host's IP address and SSH user name. Also, specify session type (i.e., desktop manager of a remote host). - -![](https://farm9.staticflickr.com/8730/16365755693_75f3d544e9_b.jpg) - -If you want, you can customize other things (by pressing other tabs), like connection speed, compression, screen resolution, and so on. - -![](https://farm9.staticflickr.com/8699/16984498482_665b975eca_b.jpg) - -![](https://farm9.staticflickr.com/8694/16985838755_1b7df1eb78_b.jpg) - -When you initiate a remote desktop connection, you will be asked to log in. Type your SSH login and password. - -![](https://farm9.staticflickr.com/8754/16984498432_1c8068b817_b.jpg) - -Upon successful login, you will see the remote desktop screen. - -![](https://farm9.staticflickr.com/8752/16798126858_1ab083ba80_c.jpg) - -If you want to test X2Go's seamless window feature, choose "Single application" as session type, and specify the path to an executable on the remote host. In this example, I choose Dolphin file manager on a remote KDE host. - -![](https://farm8.staticflickr.com/7584/16798393920_128c3af9c5_b.jpg) - -Once you are successfully connected, you will see a remote application window open on your local desktop, not the entire remote desktop screen. - -![](https://farm9.staticflickr.com/8742/16365755713_7b90cf65f0_c.jpg) - -### Conclusion ### - -In this tutorial, I demonstrated how to set up X2Go remote desktop on [Linux VPS][8] instance. As you can see, the whole setup process is pretty much painless (if you are using a right desktop environment). While there are some desktop-specific quirkiness, X2Go is a solid remote desktop solution which is secure, feature-rich, fast, and free. - -What feature is the most appealing to you in X2Go? Please share your thought. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/x2go-remote-desktop-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://ask.xmodulo.com/centos-remote-desktop-vps.html -[2]:http://wiki.x2go.org/ -[3]:http://xmodulo.com/go/digitalocean -[4]:http://xmodulo.com/how-to-set-up-vnc-over-ssh.html -[5]:http://wiki.x2go.org/doku.php/doc:newtox2go -[6]:http://wiki.x2go.org/doku.php/doc:de-compat -[7]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html -[8]:http://xmodulo.com/go/digitalocean diff --git a/sources/tech/20150401 ZMap Documentation.md b/sources/tech/20150401 ZMap Documentation.md index d2aa316c1f..b773fb4aaf 100644 --- a/sources/tech/20150401 ZMap Documentation.md +++ b/sources/tech/20150401 ZMap Documentation.md @@ -1,3 +1,5 @@ +translating... + ZMap Documentation ================================================================================ 1. Getting Started with ZMap diff --git a/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md b/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md deleted file mode 100644 index d291f34511..0000000000 --- a/sources/tech/20150410 7 Command Line Tools for Browsing Websites and Downloading Files in Linux.md +++ /dev/null @@ -1,152 +0,0 @@ -7 Command Line Tools for Browsing Websites and Downloading Files in Linux -================================================================================ -In the last article, we have covered few useful tools like ‘rTorrent‘, ‘wget‘, ‘cURL‘, ‘w3m‘, and ‘Elinks‘. We got lots of response to cover few other tools of same genre, if you’ve missed the first part you can go through it.. - -- [5 Command Line Tools for Downloading Files and Browsing Websites][1] - -This article aims at making you aware of several other Linux command Line browsing and downloading applications, which will help you to browse and download files within the Linux shell. - -### 1. links ### - -Links is an open source web browser written in C programming Language. It is available for all major platforms viz., Linux, Windows, OS X and OS/2. This browser is text based as well as graphical. The text based links web browser is shipped by most of the standard Linux distributions by default. If links is not installed in your system by default you may install it from the repo. Elinks is a fork of links. - - # apt-get install links - # yum install links - -After installing links, you can browse any websites within the terminal as shown below in the screen cast.. - - # links www.tecmint.com - -Use UP and DOWN arrow keys to navigate. Right arrow Key on a link will redirect you to that link and Left arrow key will bring you back to the last page. To QUIT press q. - -Here is how it seems to access Tecmint using links tool. - -![](http://www.tecmint.com/wp-content/uploads/2015/04/links-browse-websites-terminal.gif) - -If you are interested in installing GUI of links, you may need to download latest source tarball (i.e. version 2.9) from [http://links.twibright.com/download/][2]. - -Alternatively, you may use following wget command to download and install as suggested below. - - # wget http://links.twibright.com/download/links-2.9.tar.gz - # tar -xvf links-2.9.tar.gz - # cd links-2.9 - # ./configure –enable-graphics - # make - # make install - -**Note**: You need to install packages (libpng, libjpeg, TIFF library, SVGAlib, XFree86, C Compiler and make), if not already installed to successfully compile the package. - -### 2. links2 ### - -Links2 is a graphical web browser version of Twibright Labs Links web browser. This browser has support for mouse and clicks. Designed specially for speed without any CSS support, fairly good HTML and JavaScript support with limitations. - -To install links2. - - # apt-get install links2 - # yum install links2 - -### 3. lynx ### - -A text based web browser released under GNU GPLv2 license and written in ISO C. lynx is highly configurable web browser and Savior for many SYSAdmin. It has the reputation of being the oldest web browser that is being used and still actively developed. - -To install lynx. - - # apt-get install lynx - # yum install lynx - -After installing lynx, type the following command to browse the website as shown below in the screen cast.. - - # lynx www.tecmint.com - -![](http://www.tecmint.com/wp-content/uploads/2015/04/lynx-commandline-web-browsing.gif) - -If you are interested in knowing a bit more about links and lynx web browser, you may like to visit the below link: - -- [Web Browsing with Lynx and Links Command Line Tools][3] - -### 4. youtube-dl ### - -youtube-dl is a platform independent application which can be used to download videos from youtube and a few other sites. Written primarily in python and released under GNU GPL License, the application works out of the box. (Since youtube don’t allow you to download videos, it may be illegal to use it. Check the laws before you start using this.) - -To install youtube-dl. - - # apt-get install youtube-dl - # yum install youtube-dl - -After installing, try to download files from the Youtube site, as shown in the below screen cast. - - # youtube-dl https://www.youtube.com/watch?v=ql4SEy_4xws - -![](http://www.tecmint.com/wp-content/uploads/2015/04/download-youtube-videos-from-terminal.gif) - -If you are interested in knowing more about youtube-dl you may like to visit the below link: - -- [YouTube-DL – A Command Line Youtube Video Downloader for Linux][4] - -### 5. fetch ### - -It is a command utility for unix-like operating system that is used for URL retrieval. It supports a lot of options like fetching ipv4 only address, ipv6 only address, no redirect, exit after successful file retrieval request, retry, etc. - -Fetch can be Downloaded and installed from the link below - -- [http://sourceforge.net/projects/fetch/?source=typ_redirect][5] - -But before you compile and run it, you should install HTTP Fetcher. Download HTTP Fetcher from the link below. - -- [http://sourceforge.net/projects/http-fetcher/?source=typ_redirect][6] - -### 6. Axel ### - -Axel is a command-line based download accelerator for Linux. Axel makes it possible to download a file at much faster speed through single connection request for multiple copies of files in small chunks through multiple http and ftp connections. - -To install Axel. - - # apt-get install axel - # yum install axel - -After axel installed, you may use following command to download any given file, as shown in the screen cast. - - # axel http://mirror.cse.iitk.ac.in/archlinux/iso/2015.04.01/archlinux-2015.04.01-dual.iso - -![](http://www.tecmint.com/wp-content/uploads/2015/04/download-accelarator-for-linux.gif) - -### 7. aria2 ### - -aria2 is a command-line based download utility that is lightweight and support multi-protocol (HTTP, HTTPS, FTP, BitTorrent and Metalink). It can use metalinks files to simultaneously download ISO files from more than one server. It can serve as a Bit torrent client as well. - -To install aria2. - - # apt-get install aria2 - # yum install aria2 - -Once aria2 installed, you can fire up the following command to download any given file… - - # aria2c http://cdimage.debian.org/debian-cd/7.8.0/multi-arch/iso-cd/debian-7.8.0-amd64-i386-netinst.iso - -![Aria2: Command Line Download Manager for Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Download-Files-in-Terminal.gif) -Aria2: Command Line Download Manager for Linux - -If you’re interested to know more at aria2 and their switches, read the following article. - -- [Aria2 – A Multi-Protocol Command-Line Download Manager for Linux][7] - -That’s all for now. I’ll be here again with another interesting topic you people will love to read. Till then stay tuned and connected to Tecmint. 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/command-line-web-browser-download-file-in-linux/ - -作者:[Avishek Kumar][a] -译者:[wangjiezhe](https://github.com/wangjiezhe) -校对:[校对者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/linux-command-line-tools-for-downloading-files/ -[2]:http://links.twibright.com/download/ -[3]:http://www.tecmint.com/command-line-web-browsers/ -[4]:http://www.tecmint.com/install-youtube-dl-command-line-video-download-tool/ -[5]:http://sourceforge.net/projects/fetch/?source=typ_redirect -[6]:http://sourceforge.net/projects/http-fetcher/?source=typ_redirect -[7]:http://www.tecmint.com/install-aria2-a-multi-protocol-command-line-download-manager-in-rhel-centos-fedora/ 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 b67f5aee26..7eeb33676b 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,4 @@ +2q1w2007申领 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. diff --git a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md b/sources/tech/20150515 How to Install Percona Server on CentOS 7.md deleted file mode 100644 index 03affe787e..0000000000 --- a/sources/tech/20150515 How to Install Percona Server on CentOS 7.md +++ /dev/null @@ -1,188 +0,0 @@ -How to Install Percona Server on CentOS 7 -================================================================================ -In this article we are going to learn about percona server, an opensource drop-in replacement for MySQL and also for MariaDB. The InnoDB database engine make it very attractive and a good alternative if you need performance, reliability and a cost efficient solution - -In the following sections I am going to cover the installation of the percona server on the CentOS 7, I will also cover the steps needed to make backup of your current data, configuration and how to restore your backup. - -### Table of contents ### - -1. What is and why use percona -1. Backup your databases -1. Remove previous SQL server -1. Installing Percona binaries -1. Configuring Percona -1. Securing your environment -1. Restore your backup - -### 1. What is and why use Percona ### - -Percona is an opensource alternative to the MySQL and MariaDB databases, it's a fork of the MySQL with many improvements and unique features that makes it more reliable, powerful and faster than MySQL, and yet is fully compatible with it, you can even use replication between Oracle's MySQL and Percona. - -#### Features exclusive to Percona #### - -- Partitioned Adaptive Hash Search -- Fast Checksum Algorithm -- Buffer Pool Pre-Load -- Support for FlashCache - -#### MySQL Enterprise and Percona specific features #### - -- Import Tables From Different Servers -- PAM authentication -- Audit Log -- Threadpool - -Now that you are pretty excited to see all these good things together, we are going show you how to install and do basic configuration of Percona Server. - -### 2. Backup your databases ### - -The following, command creates a mydatabases.sql file with the SQL commands to recreate/restore salesdb and employeedb databases, replace the databases names to reflect your setup, skip if this is a brand new setup - - mysqldump -u root -p --databases employeedb salesdb > mydatabases.sql - -Copy the current configuration file, you can also skip this in fresh setups - - cp my.cnf my.cnf.bkp - -### 3. Remove your previous SQL Server ### - -Stop the MySQL/MariaDB if it's running. - - systemctl stop mysql.service - -Uninstall MariaDB and MySQL - - yum remove MariaDB-server MariaDB-client MariaDB-shared mysql mysql-server - -Move / Rename the MariaDB files in **/var/lib/mysql**, it's a safer and faster than just removing, it's like a 2nd level instant backup. :) - - mv /var/lib/mysql /var/lib/mysql_mariadb - -### 4. Installing Percona binaries ### - -You can choose from a number of options on how to install Percona, in a CentOS system it's generally a better idea to use yum or RPM, so these are the way that are covered by this article, compiling and install from sources are not covered by this article. - -Installing from Yum repository: - -First you need to set the Percona's Yum repository with this: - - yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm - -And then install Percona with: - - yum install Percona-Server-client-56 Percona-Server-server-56 - -The above command installs Percona server and clients, shared libraries, possibly Perl and perl modules such as DBI::MySQL, if that are not already installed, and also other dependencies as needed. - -Installing from RPM package: - -We can download all rpm packages with the help of wget: - - wget -r -l 1 -nd -A rpm -R "*devel*,*debuginfo*" \ http://www.percona.com/downloads/Percona-Server-5.5/Percona-Server-5.5.42-37.1/binary/redhat/7/x86_64/ - -And with rpm utility, you install all the packages once: - - rpm -ivh Percona-Server-server-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-client-55-5.5.42-rel37.1.el7.x86_64.rpm \ Percona-Server-shared-55-5.5.42-rel37.1.el7.x86_64.rpm - -Note the backslash '\' on the end of the sentences on the above commands, if you install individual packages, remember that to met dependencies, the shared package must be installed before client and client before server. - -### 5. Configuring Percona Server ### - -#### Restoring previous configuration #### - -As we are moving from MariaDB, you can just restore the backup of my.cnf file that you made in earlier steps. - - cp /etc/my.cnf.bkp /etc/my.cnf - -#### Creating a new my.cnf #### - -If you need a new configuration file that fit your needs or if you don't have made a copy of my.cnf, you can use this wizard, it will generate for you, through simple steps. - -Here is a sample my.cnf file that comes with Percona-Server package - - # Percona Server template configuration - - [mysqld] - # - # Remove leading # and set to the amount of RAM for the most important data - # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. - # innodb_buffer_pool_size = 128M - # - # Remove leading # to turn on a very important data integrity option: logging - # changes to the binary log between backups. - # log_bin - # - # Remove leading # to set options mainly useful for reporting servers. - # The server defaults are faster for transactions and fast SELECTs. - # Adjust sizes as needed, experiment to find the optimal values. - # join_buffer_size = 128M - # sort_buffer_size = 2M - # read_rnd_buffer_size = 2M - datadir=/var/lib/mysql - socket=/var/lib/mysql/mysql.sock - - # Disabling symbolic-links is recommended to prevent assorted security risks - symbolic-links=0 - - [mysqld_safe] - log-error=/var/log/mysqld.log - pid-file=/var/run/mysqld/mysqld.pid - -After making your my.cnf file fit your needs, it's time to start the service: - - systemctl restart mysql.service - -If everything goes fine, your server is now up and ready to ready to receive SQL commands, you can try the following command to check: - - mysql -u root -p -e 'SHOW VARIABLES LIKE "version_comment"' - -If you can't start the service, you can look for a reason in **/var/log/mysql/mysqld.log** this file is set by the **log-error** option in my.cnf's **[mysqld_safe]** session. - - tail /var/log/mysql/mysqld.log - -You can also take a look in a file inside **/var/lib/mysql/** with name in the form of **[hostname].err** as the following example: - - tail /var/lib/mysql/centos7.err - -If this also fail in show what is wrong, you can also try strace: - - yum install strace && systemctl stop mysql.service && strace -f -f mysqld_safe - -The above command is extremely verbous and it's output is quite low level but can show you the reason you can't start service in most times. - -### 6. Securing your environment ### - -Ok, you now have your RDBMS ready to receive SQL queries, but it's not a good idea to put your precious data on a server without minimum security, it's better to make it safer with mysql_secure_instalation, this utility helps in removing unused default features, also set the root main password and make access restrictions for using this user. -Just invoke it by the shell and follow instructions on the screen. - - mysql_secure_install - -### 7. Restore your backup ### - -If you are coming from a previous setup, now you can restore your databases, just use mysqldump once again. - - mysqldump -u root -p < mydatabases.sql - -Congratulations, you just installed Percona on your CentOS Linux, your server is now fully ready for use; You can now use your service as it was MySQL, and your services are fully compatible with it. - -### Conclusion ### - -There is a lot of things to configure in order to achieve better performance, but here is some straightforward options to improve your setup. When using innodb engine it's also a good idea to set the **innodb_file_per_table** option **on**, it gonna distribute table indexes in a file per table basis, it means that each table have it's own index file, it makes the overall system, more robust and easier to repair. - -Other option to have in mind is the **innodb_buffer_pool_size** option, InnoDB should have large enough to your datasets, and some value **between 70% and 80%** of the total available memory should be reasonable. - -By setting the **innodb-flush-method** to **O_DIRECT** you disable write cache, if you have **RAID**, this should be set to improved performance as this cache is already done in a lower level. - -If your data is not that critical and you don't need fully **ACID** compliant transactions, you can adjust to 2 the option **innodb_flush_log_at_trx_commit**, this will also lead to improved performance. - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/percona-server-centos-7/ - -作者:[Carlos Alberto][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/carlosal/ \ No newline at end of file diff --git a/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md b/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md deleted file mode 100644 index 5731cd69f4..0000000000 --- a/sources/tech/20150515 Install 'Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity.md +++ /dev/null @@ -1,181 +0,0 @@ -FSSlc translating - -Install ‘Tails 1.4′ Linux Operating System to Preserve Privacy and Anonymity -================================================================================ -In this Internet world and the world of Internet we perform most of our task online be it Ticket booking, Money transfer, Studies, Business, Entertainment, Social Networking and what not. We spend a major part of our time online daily. It has been getting hard to remain anonymous with each passing day specially when backdoors are being planted by organizations like NSA (National Security Agency) who are putting their nose in between every thing that we come across online. We have least or no privacy online. All the searches are logged upon the basis of user Internet surfing activity and machine activity. - -A wonderful browser from Tor project is used by millions which help us surfing the web anonymously however it is not difficult to trace your browsing habits and hence tor alone is not the guarantee of your safety online. You may like to check Tor features and installation instructions here: - -- [Anonymous Web Browsing using Tor][1] - -There is a operating system named Tails by Tor Projects. Tails (The Amnesic Incognito Live System) is a live operating system, based on Debian Linux distribution, which mainly focused on preserving privacy and anonymity on the web while browsing internet, means all it’s outgoing connection are forced to pass through the Tor and direct (non-anonymous) requests are blocked. The system is designed to run from any boot-able media be it USB stick or DVD. - -The latest stable release of Tails OS is 1.4 which was released on May 12, 2015. Powered by open source Monolithic Linux Kernel and built on top of Debian GNU/Linux Tails aims at Personal Computer Market and includes GNOME 3 as default user Interface. - -#### Features of Tails OS 1.4 #### - -- Tails is a free operating system, free as in beer and free as in speech. -- Built on top of Debian/GNU Linux. The most widely used OS that is Universal. -- Security Focused Distribution. -- Windows 8 camouflage. -- Need not to be installed and browse Internet anonymously using Live Tails CD/DVD. -- Leave no trace on the computer, while tails is running. -- Advanced cryptographic tools used to encrypt everything that concerns viz., files, emails, etc. -- Sends and Receive traffic through tor network. -- In true sense it provides privacy for anyone, anywhere. -- Comes with several applications ready to be used from Live Environment. -- All the softwares comes per-configured to connect to INTERNET only through Tor network. -- Any application that tries to connect to Internet without Tor Network is blocked, automatically. -- Restricts someone who is watching what sites you visit and restricts sites to learn your geographical location. -- Connect to websites that are blocked and/or censored. -- Designed specially not to use space used by parent OS even when there is free swap space. -- The whole OS loads on RAM and is flushed when we reboot/shutdown. Hence no trace of running. -- Advanced security implementation by encrypting USB disk, HTTPS ans Encrypt and sign emails and documents. - -#### What can you expect in Tails 1.4 #### - -- Tor Browser 4.5 with a security Slider. -- Tor Upgraded to version 0.2.6.7. -- Several Security holes fixed. -- Many of the bug fixed and patches applied to Applications like curl, OpenJDK 7, tor Network, openldap, etc. - -To get a complete list of change logs you may visit [HERE][2] - -**Note**: It is strongly recommended to upgrade to Tails 1.4, if you’re using any older version of Tails. - -#### Why should I use Tails Operating System #### - -You need Tails because you need: - -- Freedom from network surveillance -- Defend freedom, privacy and confidentiality -- Security aka traffic analysis - -This tutorial will walk through the installation of Tails 1.4 OS with a short review. - -### Tails 1.4 Installation Guide ### - -1. To download the latest Tails OS 1.4, you may use wget command to download directly. - - $ wget http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso - -Alternatively you may download Tails 1.4 Direct ISO image or use a Torrent Client to pull the iso image file for you. Here is the link to both downloads: - -- [tails-i386-1.4.iso][3] -- [tails-i386-1.4.torrent][4] - -2. After downloading, verify ISO Integrity by matching SHA256 checksum with the SHA256SUM provided on the official website.. - - $ sha256sum tails-i386-1.4.iso - - 339c8712768c831e59c4b1523002b83ccb98a4fe62f6a221fee3a15e779ca65d - -If you are interested in knowing OpenPGP, checking Tails signing key against Debian keyring and anything related to Tails cryptographic signature, you may like to point your browser [HERE][5]. - -3. Next you need to write the image to USB stick or DVD ROM. You may like to check the article, [How to Create Live Bootable USB][6] for details on how to make a flash drive bootable and write ISO to it. - -4. Insert the Tails OS Bootable flash drive or DVD ROM in the disk and boot from it (select from BIOS to boot). The first screen – two options to select from ‘Live‘ and ‘Live (failsafe)‘. Select ‘Live‘ and press Enter. - -![Tails Boot Menu](http://www.tecmint.com/wp-content/uploads/2015/05/1.png) -Tails Boot Menu - -5. Just before login. You have two options. Click ‘More Options‘ if you want to configure and set advanced options else click ‘No‘. - -![Tails Welcome Screen](http://www.tecmint.com/wp-content/uploads/2015/05/2.png) -Tails Welcome Screen - -6. After clicking Advanced option, you need to setup root password. This is important if you want to upgrade it. This root password is valid till you shutdown/reboot the machine. - -Also you may enable Windows Camouflage, if you want to run this OS on a public place, so that it seems as you are running Windows 8 operating system. Good option indeed! Is not it? Also you have a option to configure Network and Mac Address. Click ‘Login‘ when done!. - -![Tails OS Configuration](http://www.tecmint.com/wp-content/uploads/2015/05/3.png) -Tails OS Configuration - -7. This is Tails GNU/Linux OS camouflaged by Windows Skin. - -![Tails Windows Look](http://www.tecmint.com/wp-content/uploads/2015/05/4.jpg) -Tails Windows Look - -8. It will start Tor Network in the background. Check the Notification on the top-right corner of the screen – Tor is Ready / You are now connected to the Internet. - -Also check what it contains under Internet Menu. Notice – It has Tor Browser (safe) and Unsafe Web Browser (Where incoming and outgoing data don’t pass through TOR Network) along with other applications. - -![Tails Menu and Tools](http://www.tecmint.com/wp-content/uploads/2015/05/5.jpg) -Tails Menu and Tools - -9. Click Tor and check your IP Address. It confirms my physical location is not shared and my privacy is intact. - -![Check Privacy on Tails](http://www.tecmint.com/wp-content/uploads/2015/05/6.jpg) -Check Privacy on Tails - -10. You may Invoke Tails Installer to clone & Install, Clone & Upgrade and Upgrade from ISO. - -![Tails Installer Options](http://www.tecmint.com/wp-content/uploads/2015/05/7.jpg) -Tails Installer Options - -11. The other option was to select Tor without any advanced option, just before login (Check step #5 above). - -![Tails Without Advance Option](http://www.tecmint.com/wp-content/uploads/2015/05/8.png) -Tails Without Advance Option - -12. You will get log-in to Gnome3 Desktop Environment. - -![Tails Gnome Desktop](http://www.tecmint.com/wp-content/uploads/2015/05/9.png) -Tails Gnome Desktop - -13. If you click to Launch Unsafe browser in Camouflage or without Camouflage, you will be notified. - -![Tails Browsing Notification](http://www.tecmint.com/wp-content/uploads/2015/05/10.png) -Tails Browsing Notification - -If you do, this is what you get in a Browser. - -![Tails Browsing Alert](http://www.tecmint.com/wp-content/uploads/2015/05/11.png) -Tails Browsing Alert - -#### Is Tails for me? #### - -To get the above question answered, first answer a few question. - -- Do you need your privacy to be intact while you are online? -- Do you want to remain hidden from Identity thieves? -- Do you want somebody to put your nose in between your private chat online? -- Do you really want to show your geographical location to anybody there? -- Do you carry out banking transactions online? -- Are you happy with the censorship by government and ISP? - -If the answer to any of the above question is ‘YES‘ you preferably need Tails. If answer to all the above question is ‘NO‘ you perhaps don’t need it. - -To know more about Tails? Point your browser to user Documentation : [https://tails.boum.org/doc/index.en.html][7] - -### Conclusion ### - -Tails is an OS which is must for those who work in an unsafe environment. An OS focused on security yet contains bundles of Application – Gnome Desktop, Tor, Firefox (Iceweasel), Network Manager, Pidgin, Claws mail, Liferea feed addregator, Gobby, Aircrack-ng, I2P. - -It also contain several tools for Encryption and Privacy Under the Hood, viz., LUKS, GNUPG, PWGen, Shamir’s Secret Sharing, Virtual Keyboard (against Hardware Keylogging), MAT, KeePassX Password Manager, etc. - -That’s all for now. Keep Connected to Tecmint. Share your thoughts on Tails GNU/Linux Operating System. What do you think about the future of the Project? Also test it Locally and let us know your experience. - -You may run it in [Virtualbox][8] as well. Remember Tails loads the whole OS in RAM hence give enough RAM to run Tails in VM. - -I tested in 1GB Environment and it worked without lagging. Thanks to all our readers for their Support. In making Tecmint a one place for all Linux related stuffs your co-operation is needed. Kudos! - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/install-tails-1-4-linux-operating-system-to-preserve-privacy-and-anonymity/ - -作者:[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/ -[1]:http://www.tecmint.com/tor-browser-for-anonymous-web-browsing/ -[2]:https://tails.boum.org/news/version_1.4/index.en.html -[3]:http://dl.amnesia.boum.org/tails/stable/tails-i386-1.4/tails-i386-1.4.iso -[4]:https://tails.boum.org/torrents/files/tails-i386-1.4.torrent -[5]:https://tails.boum.org/download/index.en.html#verify -[6]:http://www.tecmint.com/install-linux-from-usb-device/ -[7]:https://tails.boum.org/doc/index.en.html -[8]:http://www.tecmint.com/install-virtualbox-on-redhat-centos-fedora/ diff --git a/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md b/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md new file mode 100644 index 0000000000..837a7a2e73 --- /dev/null +++ b/sources/tech/20150515 Install Plex Media Server On Ubuntu or CentOS 7.1 or Fedora 22.md @@ -0,0 +1,191 @@ +Install Plex Media Server On Ubuntu / CentOS 7.1 / Fedora 22 +================================================================================ +In this article we will show you how easily you can setup Plex Home Media Server on major Linux distributions with their latest releases. After its successful installation of Plex you will be able to use your centralized home media playback system that streams its media to many Plex player Apps and the Plex Home will allows you to setup your environment by adding your devices and to setup a group of users that all can use Plex Together. So let’s start its installation first on Ubuntu 15.04. + +### Basic System Resources ### + +System resources mainly depend on the type and number of devices that you are planning to connect with the server. So according to our requirements we will be using as following system resources and software for a standalone server. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + +
Plex Home Media Server
Base Operating SystemUbuntu 15.04 / CentOS 7.1 / Fedora 22 Work Station
Plex Media ServerVersion 0.9.12.3.1173-937aac3
RAM and CPU1 GB  , 2.0 GHZ
Hard Disk30 GB
+ +### Plex Media Server 0.9.12.3 on Ubuntu 15.04 ### + +We are now ready to start the installations process of Plex Media Server on Ubuntu so let’s start with the following steps to get it ready. + +#### Step 1: System Update #### + +Login to your server with root privileges Make your that your system is upto date if not then do by using below command. + + root@ubuntu-15:~#apt-get update + +#### Step 2: Download the Latest Plex Media Server Package #### + +Create a new directory and download .deb plex Media Package in it from the official website of Plex for Ubuntu using wget command. + + root@ubuntu-15:~# cd /plex/ + root@ubuntu-15:/plex# + root@ubuntu-15:/plex# wget https://downloads.plex.tv/plex-media-server/0.9.12.3.1173-937aac3/plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb + +#### Step 3: Install the Debian Package of Plex Media Server #### + +Now within the same directory run following command to start installation of debian package and then check the status of plekmediaserver. + + root@ubuntu-15:/plex# dpkg -i plexmediaserver_0.9.12.3.1173-937aac3_amd64.deb + +---------- + + root@ubuntu-15:~# service plexmediaserver status + +![Plexmediaserver Service](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-status.png) + +### Plex Home Media Web App Setup on Ubuntu 15.04 ### + +Let's open your web browser within your localhost network and open the Web Interface with your localhost IP and port 32400 and do following steps to configure it: + + http://172.25.10.179:32400/web + http://localhost:32400/web + +#### Step 1:Sign UP before Login #### + +After you have access to the web interface of Plesk Media Server make sure to Sign Up and set your username email ID and Password to login as. + +![Plex Sign In](http://blog.linoxide.com/wp-content/uploads/2015/06/PMS-Login.png) + +#### Step 2: Enter Your Pin to Secure Your Plex Media Home User #### + +![Plex User Pin](http://blog.linoxide.com/wp-content/uploads/2015/06/333.png) + +Now you have successfully configured your user under Plex Home Media. + +![Welcome To Plex](http://blog.linoxide.com/wp-content/uploads/2015/06/3333.png) + +### Opening Plex Web App on Devices Other than Localhost Server ### + +As we have seen in our Plex media home page that it indicates that "You do not have permissions to access this server". Its because of we are on a different network than the Server computer. + +![Plex Server Permissions](http://blog.linoxide.com/wp-content/uploads/2015/06/33.png) + +Now we need to resolve this permissions issue so that we can have access to server on the devices other than the hosted server by doing following setup. + +### Setup SSH Tunnel for Windows System to access Linux Server ### + +First we need to set up a SSH tunnel so that we can access things as if they were local. This is only necessary for the initial setup. + +If you are using Windows as your local system and server on Linux then we can setup SSH-Tunneling using Putty as shown. + +![Plex SSH Tunnel](http://blog.linoxide.com/wp-content/uploads/2015/06/ssh-tunnel.png) + +**Once you have the SSH tunnel set up:** + +Open your Web browser window and type following URL in the address bar. + + http://localhost:8888/web + +The browser will connect to the server and load the Plex Web App with same functionality as on local. +Agree to the terms of Services and start + +![Agree to Plex term](http://blog.linoxide.com/wp-content/uploads/2015/06/5.png) + +Now a fully functional Plex Home Media Server is ready to add new media libraries, channels, playlists etc. + +![PMS Settings](http://blog.linoxide.com/wp-content/uploads/2015/06/8.png) + +### Plex Media Server 0.9.12.3 on CentOS 7.1 ### + +We will follow the same steps on CentOS-7.1 that we did for the installation of Plex Home Media Server on Ubuntu 15.04. + +So lets start with Plex Media Servers Package Installation. + +#### Step 1: Plex Media Server Installation #### + +To install Plex Media Server on centOS 7.1 we need to download the .rpm package from the official website of Plex. So we will use wget command to download .rpm package for this purpose in a new directory. + + [root@linux-tutorials ~]# cd /plex + [root@linux-tutorials plex]# wget https://downloads.plex.tv/plex-media-server/0.9.12.3.1173-937aac3/plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + +#### Step 2: Install .RPM Package #### + +After completion of complete download package we will install this package using rpm command within the same direcory where we installed the .rpm package. + + [root@linux-tutorials plex]# ls + plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + [root@linux-tutorials plex]# rpm -i plexmediaserver-0.9.12.3.1173-937aac3.x86_64.rpm + +#### Step 3: Start Plexmediaservice #### + +We have successfully installed Plex Media Server Now we just need to restart its service and then enable it permanently. + + [root@linux-tutorials plex]# systemctl start plexmediaserver.service + [root@linux-tutorials plex]# systemctl enable plexmediaserver.service + [root@linux-tutorials plex]# systemctl status plexmediaserver.service + +### Plex Home Media Web App Setup on CentOS-7.1 ### + +Now we just need to repeat all steps that we performed during the Web app setup of Ubuntu. +So let's Open a new window in your web browser and access the Plex Media Server Web app using localhost or IP or your Plex server. + + http://172.20.3.174:32400/web + http://localhost:32400/web + +Then to get full permissions on the server you need to repeat the steps to create the SSH-Tunnel. +After signing up with new user account we will be able to access its all features and can add new users, add new libraries and setup it per our needs. + +![Plex Device Centos](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-devices-centos.png) + +### Plex Media Server 0.9.12.3 on Fedora 22 Work Station ### + +The Basic steps to download and install Plex Media Server are the same as its we did for in CentOS 7.1. +We just need to download its .rpm package and then install it with rpm command. + +![PMS Installation](http://blog.linoxide.com/wp-content/uploads/2015/06/plex-on-fedora.png) + +### Plex Home Media Web App Setup on Fedora 22 Work Station ### + +We had setup Plex Media Server on the same host so we don't need to setup SSH-Tunnel in this time scenario. Just open the web browser in your Fedora 22 Workstation with default port 32400 of Plex Home Media Server and accept the Plex Terms of Services Agreement. + +![Plex Agreement](http://blog.linoxide.com/wp-content/uploads/2015/06/Plex-Terms.png) + +**Welcome to Plex Home Media Server on Fedora 22 Workstation** + +Lets login with your plex account and start with adding your libraries for your favorite movie channels , create your playlists, add your photos and enjoy with many other features of Plex Home Media Server. + +![Plex Add Libraries](http://blog.linoxide.com/wp-content/uploads/2015/06/create-library.png) + +### Conclusion ### + +We had successfully installed and configured Plex Media Server on Major Linux Distributions. So, Plex Home Media Server has always been a best choice for media management. Its so simple to setup on cross platform as we did for Ubuntu, CentOS and Fedora. It has simplifies the tasks of organizing your media content and streaming to other computers and devices then to share it with your friends. + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/tools/install-plex-media-server-ubuntu-centos-7-1-fedora-22/ + +作者:[Kashif Siddique][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/kashifs/ \ No newline at end of file diff --git a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md b/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md deleted file mode 100644 index 436b28f79f..0000000000 --- a/sources/tech/20150526 20 Useful Terminal Emulators for Linux.md +++ /dev/null @@ -1,301 +0,0 @@ -Translating by ZTinoZ -20 Useful Terminal Emulators for Linux -================================================================================ -A Terminal emulator is a computer program that reproduces a video terminal within some other display structure. In other words the Terminal emulator has an ability to make a dumb machine appear like a client computer networked to the server. The terminal emulator allows an end user to access console as well as its applications such as text user interface and command line interface. - -![Linux Terminal Emulators](http://www.tecmint.com/wp-content/uploads/2014/01/Linux-Terminal-Emulators1.jpeg) - -20 Linux Terminal Emulators - -You may find huge number of terminal emulators to choose from this open source world. Some of them offers large range of features while others offers less features. To give a better understanding to the quality of software that are available, we have gathered a list of marvelous terminal emulator for Linux. Each title provides its description and feature along with screenshot of the software with relevant download link. - -### 1. Terminator ### - -Terminator is an advanced and powerful terminal emulator which supports multiple terminals windows. This emulator is fully customizable. You can change the size, colour, give different shapes to the terminal. Its very user friendly and fun to use. - -#### Features of Terminator #### - -- Customize your profiles and colour schemes, set the size to fit your needs. -- Use plugins to get even more functionality. -- Several key-shortcuts are available to speed up common activities. -- Split the terminal window into several virtual terminals and re-size them as needed. - -![Terminator Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Terminator-Emulator.jpeg) - -Terminator Terminal - -- [Terminator Homepage][1] -- [Download and Installation Instructions][2] - -### 2. Tilda ### - -Tilda is a stylish drop-down terminal based on GTK+. With the help of a single key press you can launch a new or hide Tilda window. However, you can add colors of your choice to change the look of the text and Terminal background. - -#### Features of Tilda #### - - Interface with Highly customization option. - You can set the transparency level for Tilda window. - Excellent built-in colour schemes. - -![Tilda Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Tilda-Emulator.jpeg) - -Tilda Terminal - -- [Tilda Homepage][3] - -### 3. Guake ### - -Guake is a python based drop-down terminal created for the GNOME Desktop Environment. It is invoked by pressing a single keystroke, and can make it hidden by pressing same keystroke again. Its design was determined from FPS (First Person Shooter) games such as Quake and one of its main target is be easy to reach. - -Guake is very much similar to Yakuaka and Tilda, but it’s an experiment to mix the best of them into a single GTK-based program. Guake has been written in python from scratch using a little piece in C (global hotkeys stuff). - -![Guake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Guake-Terminal.jpeg) - -Guake Terminal - -- [Guake Homepage][4] - -### 4. Yakuake ### - -Yakuake (Yet Another Kuake) is a KDE based drop-down terminal emulator very much similar to Guake terminal emulator in functionality. It’s design was inspired from fps consoles games such as Quake. - -Yakuake is basically a KDE application, which can be easily installed on KDE desktop, but if you try to install Yakuake in GNOME desktop, it will prompt you to install huge number of dependency packages. - -#### Yakuake Features #### - -- Fluently turn down from the top of your screen -- Tabbed interface -- Configurable dimensions and animation speed -- Customizable - -![Yakuake Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Yakuake-Terminal.jpeg) - -Yakuake Terminal - -- [Yakuake Homepage][5] - -### 5. ROXTerm ### - -ROXterm is yet another lightweight terminal emulator designed to provide similar features to gnome-terminal. It was originally constructed to have lesser footprints and faster start-up time by not using the Gnome libraries and by using a independent applet to bring the configuration interface (GUI), but over the time it’s role has shifted to bringing a higher range of features for power users. - -However, it is more customizable than gnome-terminal and anticipated more at “power” users who make excessive use of terminals. It is easily integrated with GNOME desktop environment and provides features like drag & drop of items into terminal. - -![Roxterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Roxterm-Terminal.jpeg) - -Roxterm Terminal - -- [ROXTerm Homepage][6] - -### 6. Eterm ### - -Eterm is a lightest color terminal emulator designed as a replacement for xterm. It is developed with a Freedom of Choice ideology, leaving as much power, flexibility, and freedom as workable in the hands of the user. - -![Eterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Eterm-Terminal.jpeg) - -Eterm Terminal - -- [Eterm Homepage][7] - -### 7. Rxvt ### - -Rxvt stands for extended virtual terminal is a color terminal emulator application for Linux intended as an xterm replacement for power users who don’t need to have a feature such as Tektronix 4014 emulation and toolkit-style configurability. - -![Rxvt Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Rxvt-Terminal.jpeg) - -Rxvt Terminal - -- [Rxvt Homepage][8] - -### 8. Wterm ### - -Wterm is a another light weight color terminal emulator based on rxvt project. It includes features such as background images, transparency, reverse transparency and an considerable set or runtime options are accessible resulting in a very high customizable terminal emulator. - -![wterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/wterm-Terminal-.jpeg) - -wterm Terminal - -- [Wterm Homepage][9] - -### 9. LXTerminal ### - -LXTerminal is a default VTE-based terminal emulator for LXDE (Lightweight X Desktop Environment) without any unnecessary dependency. The terminal has got some nice features such as. -LXTerminal Features - -- Multiple tabs support -- Supports common commands like cp, cd, dir, mkdir, mvdir. -- Feature to hide the menu bar for saving space -- Change the color scheme. - -![lxterminal Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/lxterminal-Terminal.jpeg) - -lxterminal Terminal - -- [LXTerminal Homepage][10] - -### 10. Konsole ### - -Konsole is yet another powerful KDE based free terminal emulator was originally created by Lars Doelle. -Konsole Features - -- Multiple Tabbed terminals. -- Translucent backgrounds. -- Support for Split-view mode. -- Directory and SSH bookmarking. -- Customizable color schemes. -- Customizable key bindings. -- Notification alerts about activity in a terminal. -- Incremental search -- Support for Dolphin file manager -- Export of output in plain text or HTML format. - -![Konsole Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Konsole-Terminal.jpeg) - -Konsole Terminal - -- [Konsole Homepage][11] - -### 11. TermKit ### - -TermKit is a elegant terminal that aims to construct aspects of the GUI with the command line based application using WebKit rendering engine mostly used in web browsers like Google Chrome and Chromium. TermKit is originally designed for Mac and Windows, but due to TermKit fork by Floby which you can now able to install it under Linux based distributions and experience the power of TermKit. - -![TermKit Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/TermKit-Terminal.jpeg) - -TermKit Terminal - -- [TermKit Homepage][12] - -12. st - -st is a simple terminal implementation for X Window. - -![st terminal](http://www.tecmint.com/wp-content/uploads/2014/01/st-terminal.png) - -st terminal - -- [st Homepage][13] - -### 13. Gnome-Terminal ### - -GNOME terminal is a built-in terminal emulator for GNOME desktop environment developed by Havoc Pennington and others. It allow users to run commands using a real Linux shell while remaining on the on the GNOME environment. GNOME Terminal emulates the xterm terminal emulator and brings a few similar features. - -The Gnome terminal supports multiple profiles, where users can able to create multiple profiles for his/her account and can customize configuration options such as fonts, colors, background image, behavior, etc. per account and define a name to each profile. It also supports mouse events, url detection, multiple tabs, etc. - -![Gnome Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Gnome-terminal.jpg) - -Gnome Terminal - -- [Gnome Terminal][14] - -### 14. Final Term ### - -Final Term is a open source stylish terminal emulator that has some exciting capabilities and handy features into one single beautiful interface. It is still under development, but provides significant features such as Semantic text menus, Smart command completion, GUI terminal controls, Omnipotent keybindings, Color support and many more. The following animated screen grab demonstrates some of their features. Please click on image to view demo. - -![FinalTerm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/FinalTerm.gif) - -FinalTerm Terminal - -- [Final Term][15] - -### 15. Terminology ### - -Terminology is yet another new modern terminal emulator created for the Enlightenment desktop, but also can be used in different desktop environments. It has some awesome unique features, which do not have in any other terminal emulator. - -Apart features, terminology offers even more things that you wouldn’t assume from a other terminal emulators, like preview thumbnails of images, videos and documents, it also allows you to see those files directly from Terminology. - -You can watch a following demonstrations video created by the Terminology developer (the video quality isn’t clear, but still it’s enough to get the idea about Terminology). - - - -- [Terminology][16] - -### 16. Xfce4 terminal ### - -Xfce terminal is a lightweight modern and easy to use terminal emulator specially designed for Xfce desktop environment. The latest release of xfce terminal has some new cool features such as search dialog, tab color changer, drop-down console like Guake or Yakuake and many more. - -![Xfce Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xfce-terminal.jpg) - -Xfce Terminal - -- [Xfce4 Terminal][17] - -### 17. xterm ### - -The xterm application is a standard terminal emulator for the X Window System. It maintain DEC VT102 and Tektronix 4014 compatible terminals for applications that can’t use the window system directly. - -![xterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/xterm.jpg) - -xterm Terminal - -- [xterm][18] - -### 18. LilyTerm ### - -The LilyTerm is a another less known open source terminal emulator based off of libvte that desire to be fast and lightweight. LilyTerm also include some key features such as: - -- Support for tabbing, coloring and reordering tabs -- Ability to manage tabs through keybindings -- Support for background transparency and saturation. -- Support for user specific profile creation. -- Several customization options for profiles. -- Extensive UTF-8 support. - -![Lilyterm Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/Lilyterm.jpg) - -Lilyterm Terminal - -- [LilyTerm][19] - -### 19. Sakura ### - -The sakura is a another less known Unix style terminal emulator developed for command line purpose as well as text-based terminal programs. Sakura is based on GTK and livte and provides not more advanced features but some customization options such as multiple tab support, custom text color, font and background images, speedy command processing and few more. - -![Sakura Terminal](http://www.tecmint.com/wp-content/uploads/2014/01/sakura.jpg) - -Sakura Terminal - -- [Sakura][20] - -### 20. rxvt-unicode ### - -The rxvt-unicode (also known as urxvt) is a yet another highly customizable, lightweight and fast terminal emulator with xft and unicode support was developed by Marc Lehmann. It got some outstanding features such as support for international language via Unicode, the ability to display multiple font types and support for Perl extensions. - -![rxvt unicode](http://www.tecmint.com/wp-content/uploads/2014/01/rxvt-unicode.png) - -rxvt unicode - -- [rxvt-unicode][21] - -If you know any other capable Linux terminal emulators that I’ve not included in the above list, please do share with me using our comment section. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/linux-terminal-emulators/ - -作者:[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]:https://launchpad.net/terminator -[2]:http://www.tecmint.com/terminator-a-linux-terminal-emulator-to-manage-multiple-terminal-windows/ -[3]:http://tilda.sourceforge.net/tildaabout.php -[4]:https://github.com/Guake/guake -[5]:http://extragear.kde.org/apps/yakuake/ -[6]:http://roxterm.sourceforge.net/index.php?page=index&lang=en -[7]:http://www.eterm.org/ -[8]:http://sourceforge.net/projects/rxvt/ -[9]:http://sourceforge.net/projects/wterm/ -[10]:http://wiki.lxde.org/en/LXTerminal -[11]:http://konsole.kde.org/ -[12]:https://github.com/unconed/TermKit -[13]:http://st.suckless.org/ -[14]:https://help.gnome.org/users/gnome-terminal/stable/ -[15]:http://finalterm.org/ -[16]:http://www.enlightenment.org/p.php?p=about/terminology -[17]:http://docs.xfce.org/apps/terminal/start -[18]:http://invisible-island.net/xterm/ -[19]:http://lilyterm.luna.com.tw/ -[20]:https://launchpad.net/sakura -[21]:http://software.schmorp.de/pkg/rxvt-unicode diff --git a/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md b/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md deleted file mode 100644 index ad673a03e0..0000000000 --- a/sources/tech/20150527 How to Create Own Online Shopping Store Using 'OpenCart' in Linux.md +++ /dev/null @@ -1,225 +0,0 @@ -How to Create Own Online Shopping Store Using “OpenCart” in Linux -================================================================================ -In the Internet world we are doing everything using a computer. Electronic Commerce aka e-commerce is one one of them. E-Commerce is nothing new and it started in the early days of ARPANET, where ARPANET used to arrange sale between students of Massachusetts Institute of Technology and Stanford Artificial Intelligence Laboratory. - -These days there are some 100’s of E-Commerce site viz., Flipcart, eBay, Alibaba, Zappos, IndiaMART, Amazon, etc. Have you thought of making your own Amazon and Flipcart like web-based Application Server? If yes! This article is for you. - -Opencart is a free and open source E-Commerce Application written in PHP, which can be used to develop a shopping cart system similar to Amazon and Flipcart. If you want to sell your products online or want to serve your customers even when you are closed Opencart is for you. You can build a successful online store (for online merchants) using reliable and professional Opencart Application. - -### OpenCart Web Panel Demo ### - -- Store Front – [http://demo.opencart.com/][1] -- Admin Login – [http://demo.opencart.com/admin/][2] - - ------------------ Admin Login ------------------ - Username: demo - Password: demo - -#### Features of Opencart #### - -Opencart is an application that meets all the requirements of an online merchant. It has all the features (see below) using which you can make your own E-Commerce Website. - -- It is a Free (as in beer) and Open Source (as in speech) Application released under GNU GPL License. -- Everything is well documented, means you don’t need to Google and shout for help. -- Free Life time support and updates. -- Unlimited number of categories, Products and manufacturer supported. -- Everything is Template based. -- Multi-Language and Multi-Currency Supported. It ensures your product gets a global reach. -- Built-in Product Review and Rating Features. -- Downloadable Products (viz., ebook) supported. -- Automatic Image Resizing supported. -- Features like Multi tax Rates (as in various country), Viewing Related Products, Information Page, Shipping Weight Calculation, Availing Discount Coupons, etc are well implemented by default. -- Built-in Backup and Restore tools. -- Well implemented SEO. -- Invoice Printing, Error Log and sales report are supported as well. - -#### System Requirements #### - -- Web Server (Apache HTTP Server Preferred) -- PHP (5.2 and above). -- Database (MySQLi Preferred but I am using MariaDB). - -#### Required PHP Libraries and Modules #### - -These extensions must be installed and enabled on your system to install Opencart properly on the web server. - -- Curl -- Zip -- Zlib -- GD Library -- Mcrypt -- Mbstrings - -### Step 1: Installing Apache, PHP and MariaDB ### - -1. As I said, OpenCart requires certain technical requirements such as Apache, PHP with extensions and Database (MySQL or MariaDB) to be installed on the system, in order to run Opencart properly. - -Let’s install Apache, PHP and MariaDB using following Command. - -**Install Apache** - - # apt-get install apache2 (On Debian based Systems) - # yum install httpd (On RedHat based Systems) - -**Install PHP and Extensions** - - # apt-get install php5 libapache2-mod-php5 php5-curl php5-mcrypt (On Debian based Systems) - # yum install php php-mysql php5-curl php5-mcrypt (On RedHat based Systems) - -**Install MariaDB** - - # apt-get install mariadb-server mariadb-client (On Debian based Systems) - # yum install mariadb-server mariadb (On RedHat based Systems) - -2. After installing all the above required things, you can start the Apache and MariaDB services using following commands. - - ------------------- On Debian based Systems ------------------- - # systemctl restart apache2.service - # systemctl restart mariadb.service - ----------- - - ------------------- On RedHat based Systems ------------------- - # systemctl restart httpd.service - # systemctl restart mariadb.service - -### Step 2: Downloading and Setting OpenCart ### - -3. The most recent version of OpenCart (2.0.2.0) can be obtained from [OpenCart website][3] or directly from github. - -Alternatively, you may use following wget command to download the latest version of OpenCart directly from github repository as shown below. - - # wget https://github.com/opencart/opencart/archive/master.zip - -4. After downloading zip file, copy to Apache Working directory (i.e. /var/www/html) and unzip the master.zip file. - - # cp master.zip /var/www/html/ - # cd /var/www/html - # unzip master.zip - -5. After extracting ‘master.zip‘ file, cd to extracted directory and move the content of upload directory to the root of the application folder (opencart-master). - - # cd opencart-master - # mv -v upload/* ../opencart-master/ - -6. Now you need to rename or copy OpenCart configuration files as shown below. - - # cp /var/www/html/opencart-master/admin/config-dist.php /var/www/html/opencart-master/admin/config.php - # cp /var/www/html/opencart-master/config-dist.php /var/www/html/opencart-master/config.php - -7. Next, set correct Permissions to the files and folders of /var/www/html/opencart-master. You need to provide RWX permission to all the files and folders there, recursively. - - # chmod 777 -R /var/www/html/opencart-master - -**Important**: Setting permission 777 may be dangerous, so as soon as you finish setting up everything, revert back to permission 755 recursively on the above folder. - -### Step 3: Creating OpenCart Database ### - -8. Next step is to create a database (say opencartdb) for the E-Commerce site to store data on the database. Connect to databaser server and create a database, user and grant correct privileges on the user to have full control over the database. - - # mysql -u root -p - CREATE DATABASE opencartdb; - CREATE USER 'opencartuser'@'localhost' IDENTIFIED BY 'mypassword'; - GRANT ALL PRIVILEDGES ON opencartdb.* TO 'opencartuser'@'localhost' IDENTIFIED by 'mypassword'; - -### Step 4: OpenCart Web Installation ### - -9. Once everything set correctly, navigate to the web browser and type `http://` to access the OpenCart web installation. - -Click ‘CONTINUE‘ to Agree the License Agreement. - -![Accept OpenCart License](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-License.png) - -Accept OpenCart License - -10. The next screen is Pre-installation Server Setup Check, to see that the server has all the required modules are installed properly and have correct permission on the OpenCart files. - -If any red marks are highlighted on #1 or #2, that means you need to install those components properly on the server to meet web server requirements. - -If there are any red marks on #3 or #4, that means there is issue with your files. If everything is correctly configured you should see all green marks are visible (as seen below), you may press “Continue“. - -![Server Requirement Check](http://www.tecmint.com/wp-content/uploads/2015/05/Server-Checkup.png) - -Server Requirement Check - -11. On the next screen enter your Database Credentials like Database Driver, Hostname, User-name, Password, database. You should not touch db_port and Prefix, until and unless you know what you are doing. - -Also Enter User_name, Password and Email Address for Administrative account. Note these credentials will be used for logging in to Opencart Admin Panel as root, so keep it safe. Click continue when done! - -![OpenCart Database Details](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Database.png) - -OpenCart Database Details - -12. The next screen shows message like “Installation Complete” with the Tag Line Ready to Start Selling. Also it warns to delete the installation directory, as everything required to setup using this directory has been accomplished. - -![OpenCart Installation Completes](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Installation-Completes.png) - -OpenCart Installation Completes - -To Remove install directory, you may like to run the below command. - - # rm -rf /var/www/html/opencart-master/install - -### Step 4: Access OpenCart Web and Admin ### - -13. Now point your browser to `http:///opencart-master/` and you would see something like the below screenshot. - -![OpenCart Product Showcase](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart.jpg) - -OpenCart Product Showcase - -14. In order to login to Opencart Admin Panel, point your browser to http:///opencart-master/admin and fill the Admin Credentials you input, while setting it up. - -![OpenCart Admin Login](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Admin-Login.png) - -OpenCart Admin Login - -15. If everything ok! You should be able to see the Admin Dashboard of Opencart. - -![OpenCart Dashboard](http://www.tecmint.com/wp-content/uploads/2015/05/OpenCart-Dashboard.png) - -OpenCart Dashboard - -Here in Admin Dashboard you may set up a lots of options like categories, product, options, Manufacturers, Downloads, Review, Information, Extension Installer, Shipping, Payment options, order totals, gift voucher, Paypal, Coupons, Affiliates, marketing, mails, Design and Settings, Error logs, in-built analytics and what not. - -#### What after testing the tools? #### - -If you have already tested the Application and finds it customizable, flexible, Rock Solid, Easy to maintain and use, you may need a good hosting provider to host OpenCart application, that remains live 24X7 support. Though there are a lot of options for hosting providers we recommend Hostgator. - -Hostgator is a Domain Registrant and Hosting Provider that is very well known for the service and feature it provides. It Provides you with UNLIMITED Disk Space, UNLIMITED Bandwidth, Easy to install (1-click install script), 99.9% Uptime, Award winning 24x7x365 Technical Support and 45 days money back guarantee, which means if you didn’t like the product and service you get your money back within 45 days of purchasing and mind it 45 days is a long time to Test. - -So if you have something to sell you can do it for free (by free I mean, Think of the cost you would spend on getting a physical store and then compare it with virtual store setting-up cost. You will feel its free). - -**Note**: When you buy hosting (and/or Domain) from Hostgator you will get a **Flat 25% OFF**. This offer is valid only for the readers of Tecmint Site. - -All you have to do is to Enter Promocode “**TecMint025**” during the payment of hosting. For reference see the preview of payment screen with promo code. - -![Hostgator 25% Discount - TecMint025](http://www.tecmint.com/wp-content/uploads/2015/05/Hostgator-Discount-Code.png) - -[Sign up for Hostgator][4] (Coupon code: TecMint025) - -**Note**: Also worth mentioning, that for each hosting you buy from Hostgator to host OpenCart, we will get a small amount of commission, just to keep Tecmint Live (by Paying Bandwidth and hosting charges of server). - -So If you buy it using the above code, you get discount and we will get a small amount. Also note that you won’t pay anything extra, infact you will be paying 25% less on total bill. - -### Conclusion ### - -OpenCart is an application that performs out-of-the box. It is easy to install and you have the option to choose best suited templates, add your products and you become an online merchant. - -A lots of community made extensions(free and paid) makes it rich. It is a wonderful application for those who want to setup a virtual store and remain accessible to their customer 24X7. Let me know yours experience with the application. Any suggestion and feedback is welcome as well. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/create-e-commerce-online-shopping-store-using-opencart-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/ -[1]:http://demo.opencart.com/ -[2]:http://demo.opencart.com/admin/ -[3]:http://www.opencart.com/index.php?route=download/download/ -[4]:http://secure.hostgator.com/%7Eaffiliat/cgi-bin/affiliates/clickthru.cgi?id=tecmint \ No newline at end of file diff --git a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md b/sources/tech/20150527 How to edit your documents collaboratively on Linux.md deleted file mode 100644 index 91d2bf6441..0000000000 --- a/sources/tech/20150527 How to edit your documents collaboratively on Linux.md +++ /dev/null @@ -1,122 +0,0 @@ -How to edit your documents collaboratively on Linux -================================================================================ -> "Developed many years before by some high-strung, compulsive assistant, the Bulletin was simply a Word document that lived in a shared folder both Emily and I could access. Only one of us could open it at a time and add a new message, thought, or question to the itemized list. Then we'd print out the updated version and place it on the clipboard that sat on the shelf over my desk, removing the old ones as we went." ("The Devil Wears Prada" by Lauren Weisberger) - -Even today such a "collaborative editing" is in use where only one person can open a shared file, make changes to it, and then inform others about what and when was modified. - -ONLYOFFICE is an open source online office suite integrated with different management tools for documents, emails, events, tasks and client relations. - -Using ONLYOFFICE office suite, a group of people can edit text, spreadsheet or presentation within a browser simultaneously. Leave comments directly in their document and interact with each other using the integrated chat. And, finally, save the document as a PDF file for further printing. As an added bonus, it gives the possibility to view the document history and restore the previous revision/version if needed. - -In this tutorial, I will describe how to deploy your own online office suite using [ONLYOFFICE Free Edition][1], an ONLYOFFICE self-hosted version distributed under GNU AGPL v3. - -### Installing ONLYOFFICE on Linux ### - -ONLYOFFICE installation requires the presence of mono (version 4.0.0 or later), nodejs, libstdc++6, nginx and mysql-server in your Linux system. To simplify the installation process and avoid dependency errors, I install ONLYOFFICE using Docker. In this case there is only one dependency to be installed - [Docker][2]. - -Just to remind, Docker is an open-source project that automates the deployment of applications inside software containers. If Docker is not available on your Linux system, install it first by referring to Docker installation instructions for [Debian-based][3] or [Red-Hat based][4] systems. - -Note that you will need Docker 1.4.1 or later. To check the installed Docker version, use the following command. - - $ docker version - -To try ONLYOFFICE inside a Docker container, simply execute the following commands: - - $ sudo docker run -i -t -d --name onlyoffice-document-server onlyoffice/documentserver - $ sudo docker run -i -t -d -p 80:80 -p 443:443 --link onlyoffice-document-server:document_server onlyoffice/communityserver - -These commands will download the [official ONLYOFFICE Docker image][5] with all dependencies needed for its correct work. - -It's also possible to install [ONLYOFFICE Online Editors][6] separately on a Linux server, and easily integrate it into your website or cloud application via API provided. - -### Running a Self-Hosted Online Office ### - -To open your online office, enter localhost (http://IP-Address/) in the address bar of your browser. The Welcome page will open: - -![](https://farm9.staticflickr.com/8815/18116525656_795821c73b_c.jpg) - -Enter a password and specify the email address you will use to access your office the next time. - -### Editing Your Documents Online ### - -First, click the Documents link to open **the My Documents** folder. - -![](https://farm8.staticflickr.com/7781/17956640089_d3df0b18cd_c.jpg) - -#### STEP 1. Select a Document to Edit #### - -To create a new document right there, click on the **Create** button in the upper left corner, and choose the file type from the drop-down list. To edit a file stored on your hard disk drive, upload it to **Documents** clicking the **Upload** button next to **Create** button. - -![](https://farm9.staticflickr.com/8836/17956640109_ed8be735df_c.jpg) - -#### STEP 2. Share your Document #### - -Use the **Share** button to the right side if you are in the **My Documents** folder, or follow **File >> Document Info ... >> Change Access Rights** if you are inside your document. - -In the opened **Sharing Settings** window, click on the **People outside portal** link on the left, open the access to the document, and give full access to it by enabling the **Full Access** radio button. - -Finally, choose a way to share the link to your document, send it via email or one of the available social networks: Google+, Facebook, or Twitter. - -![](https://farm8.staticflickr.com/7766/17522306273_c8a9022c75_c.jpg) - -#### STEP 3. Start the Collaborative Editing #### - -To start co-editing the document, the invited person just needs to follow the provided link. - -The text passages edited by your co-editors will be automatically marked with dashed lines of different colors. - -![](https://farm8.staticflickr.com/7790/18139370292_7ef57aae8f_c.jpg) - -As soon as one of your collaborators saves his/her changes, you will see a note appearing in the left upper corner of the top toolbar, indicating that there areupdates. - -![](https://farm8.staticflickr.com/7778/18143984831_3dd42a9672_c.jpg) - -To save your changes and get updates, click on the **Save** icon. All the updates will then be highlighted. - -![](https://farm8.staticflickr.com/7796/17955172970_e53460b8a6_c.jpg) - -#### STEP 4. Interact with your Co-editors #### - -To leave some comments, select a text passage with the mouse, right-click on it and, and choose the **Add comment** option from the context menu. - -![](https://farm8.staticflickr.com/7771/17956640359_c4e2858dc8_c.jpg) - -To interact with co-editors in real time, use the integrated chat instead. All the users who currently edit the document will be listed on the **Chat** panel. To open it, click on the **Chat** icon at the left-side bar. To start a discussion, enter your message into an appropriate field on the **Chat** panel. - -![](https://farm8.staticflickr.com/7794/18116394026_d93b00e4f8_c.jpg) - -### Useful Tips ### - -As final notes, here are some useful tips for you to take full advantage of ONLYOFFICE. - -#### Tip #1. Editing your Docs from Cloud Storage Services, Like ownCloud #### - -If you store your documents in other web resources like Box, Dropbox, Google Drive, OneDrive, SharePoint or ownCloud, you can easily synchronize them with the ONLYOFFICE. - -In the opened 'Documents' module, click one of the icons under the **Add the account** caption: Google, Box, DropBox, OneDrive, ownCloud or 'Add account', and enter the requested data. - -#### Tip #2. Editing Your Docs on iPad #### - -To add some changes to your document on the go, I use ONLYOFFICE Documents app for iPad. You can download and install it from [iTune][7], then you need to enter your ONLYOFFICE portal address, email and password to access your documents. The feature set is almost the same. - -To evaluate ONLYOFFICE Online Editors features, you can use the [cloud version][8] for personal use. - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/edit-documents-collaboratively-linux.html - -作者:[Tatiana Kochedykova][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://xmodulo.com/author/tatiana -[1]:http://www.onlyoffice.org/ -[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]:https://registry.hub.docker.com/u/onlyoffice/communityserver/ -[6]:http://onlyoffice.org/sources#document -[7]:https://itunes.apple.com/us/app/onlyoffice-documents/id944896972 -[8]:https://personal.onlyoffice.com/ \ No newline at end of file diff --git a/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md b/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md index ea827ec74e..77292a03ee 100644 --- a/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md +++ b/sources/tech/20150527 Howto Manage Host Using Docker Machine in a VirtualBox.md @@ -1,3 +1,4 @@ +[bazz2] Howto Manage Host Using Docker Machine in a VirtualBox ================================================================================ Hi all, today we'll learn how to create and manage a Docker host using Docker Machine in a VirtualBox. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. This API works for provisioning Docker on a local machine, on a virtual machine in the data center, or on a public cloud instance. Docker Machine is supported on Windows, OSX, and Linux and is available for installation as one standalone binary. It enables us to take full advantage of ecosystem partners providing Docker-ready infrastructure, while still accessing everything through the same interface. It makes people able to deploy the docker containers in the respective platform pretty fast and in pretty easy way with just a single command. @@ -110,4 +111,4 @@ via: http://linoxide.com/linux-how-to/host-virtualbox-docker-machine/ [a]:http://linoxide.com/author/arunp/ [1]:https://github.com/docker/machine/releases -[2]:https://github.com/boot2docker/boot2docker \ No newline at end of file +[2]:https://github.com/boot2docker/boot2docker diff --git a/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md b/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md deleted file mode 100644 index 74baa5fb5b..0000000000 --- a/sources/tech/20150528 11 pointless but awesome Linux terminal tricks.md +++ /dev/null @@ -1,108 +0,0 @@ -Translating by goreliu ... - -11 pointless but awesome Linux terminal tricks -================================================================================ -Here are some great Linux terminal tips and tricks, each one as pointless as it is awesome. - -![](http://images.techhive.com/images/article/2015/05/slide_01-100587352-orig.png) - -### All work and no play... ### - -Linux is one of the most astoundingly functional and utilitarian Operating Systems around when it comes to working from the command line. Need to perform a particular task? Odds are there is an application or script you can use to get it done. Right from the terminal. But, as they say in the good book, "All work and no play make Jack really bored or something." So here is a collection of my favorite pointless, stupid, annoying or amusing things that you can do right in your Linux Terminal. - -![](http://images.techhive.com/images/article/2015/05/slide_02-100587353-orig.png) - -### Give the terminal an attitude ### - -Step 1) Type "sudo visudo". - -Step 2) At the bottom of the "Defaults" (near the top of the file) add, on a new line, "Defaults insults". - -Step 3) Save the file. - -"What did I just do to my computer?" you may be asking yourself. Something wonderful. Now, whenever you issue a sudo command and misstype your password, your computer will call you names. My favorite: "Listen, burrito brains, I don't have time to listen to this trash." - -![](http://images.techhive.com/images/article/2015/05/slide_03-100587354-orig.png) - -### apt-get moo ### - -That screenshot you see? That's what typing "apt-get moo" (on a Debian-based system) does. That's it. Don't go looking for this to do something fancy. It won't. That, I kid you not, is it. But it's one of the most commonly known little Easter eggs on Linux. So I include it here, right near the beginning, so I won't get 5,000 emails telling me I missed it in this list. - -![](http://images.techhive.com/images/article/2015/05/slide_04-100587355-orig.png) - -### aptitude moo ### - -A bit more entertaining is aptitude's take on "moo." Type "aptitude moo" (on Ubuntu and the like) and you'll be corrected about thinking "moo" would do anything. But you know better. Try the same command again, this time with an optional "-v" attribute. Don't stop there. Add v's, one at a time, until aptitude gives you what you want. - -![](http://images.techhive.com/images/article/2015/05/slide_05-100587356-orig.png) - -### Arch: Put Pac-Man in pacman ### - -This is one just for the Arch-lovers out there. The de facto package manager, pacman, is pretty fantastic already. Let's make it even better. - -Step 1) Open "/etc/pacman.conf". - -Step 2) In the "# Misc options", remove the "#" from in front of "Color". - -Step 3) Add "ILoveCandy". - -Now the progress for installing new packages, in pacman, will include a little tiny Pac-Man. Which should really just be the default anyway. - -![](http://images.techhive.com/images/article/2015/05/slide_06-100587358-orig.png) - -### Cowsay! ### - -Making aptitude moo is neat, I guess, but you really can't use it for much. Enter "cowsay." It does what you think. You make a cow say things. Anything you like. And it's not even limited to cows. Calvin, Beavis, and the Ghostbusters logo are all available in full ASCII art glory – type "cowsay -l" for a full list of what's available in this, Linux's most powerful tool. Remember that, like most great terminal applications, you can pipe the output from other applications straight into cowsay (ala "fortune | cowsay"). - -![](http://images.techhive.com/images/article/2015/05/slide_07-100587359-orig.png) - -### Become an 3l33t h@x0r ### - -Typing "nmap" isn't something one typically needs to do on a day-to-day basis. But when one does need to "whip out the nmap," one wants to look as l33t as humanly possible. Add a "-oS" to any nmap command (such as "nmap -oS - google.com"). Bam. You're now in what is officially known as "[Script Kiddie Mode][1]." Angelina Jolie and Keanu Reeves would be proud. - -![](http://images.techhive.com/images/article/2015/05/slide_08-100587360-orig.png) - -### Getting all Discordian ddate ### - -If you've ever been sitting around thinking, "Hey! I want today's date to be written in an essentially useless, but whimsical, way"…try typing "ddate". Results like "Today is Setting Orange, the 72nd day of Discord in the YOLD 3181," can really spice up your server logs. - -Note: Technically, this is a real thing called the [Discordian Calendar][2], used (in theory) by the followers of [Discordianism][3]. Which means I probably offended somebody. Or maybe not. I'm not really sure. Either way, ddate is a handy tool in any office. - -![](http://images.techhive.com/images/article/2015/05/slide_09-100587361-orig.png) - -### I See Colors Everywhere! ### - -Tired of boring old text? Looking to spruce things up and show the world your true style? lolcat. Install it. Use it. Everywhere. It takes any text input and turns it into a rainbow of wonder and enchantment. Piping text into lolcat (ala "fortune | lolcat") is sure to liven up any party. - -![](http://images.techhive.com/images/article/2015/05/slide_10-100587362-orig.png) - -### The Steam Locomotive ### - -Animated ASCII art steam locomotive in your terminal. You want this. You need this. Install and run "sl". Use "sl -l" for a tiny version. Or, if you want to really spend some time on this, "sl-h". This is the full train, including passenger cars. - -![](http://images.techhive.com/images/article/2015/05/slide_11-100587364-orig.png) - -### Reverse any text ### - -Pipe the output of any text into "rev" and it will reverse the text. "fortune | rev" gives you a fortune. In reverse. Which is, as odd as it may seem, not a misfortune. - -![](http://images.techhive.com/images/article/2015/05/slide_12-100587366-orig.png) - -### The Matrix is still cool, right? ### - -Want your terminal to do that scrolling text, l33t, Matrix-y thing? "cmatrix" is your friend. You can even have it output different colors, which is snazzy. Learn how by typing "man cmatrix". Or, better yet, "man cmatrix | lolcat". Which, really, is the most pointless (but wonderful) thing you can do in the Linux Terminal. So that's where I leave you. - --------------------------------------------------------------------------------- - -via: http://www.networkworld.com/article/2926630/linux/11-pointless-but-awesome-linux-terminal-tricks.html - -作者:[Bryan Lunduke][a] -译者:[goreliu](https://github.com/goreliu) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.networkworld.com/author/Bryan-Lunduke/ -[1]:http://nmap.org/book/output-formats-script-kiddie.html -[2]:http://en.wikipedia.org/wiki/Discordian_calendar -[3]:http://en.wikipedia.org/wiki/Discordianism \ No newline at end of file diff --git a/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md b/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md deleted file mode 100644 index 2ada2ac4cd..0000000000 --- a/sources/tech/20150528 27 'DNF' Fork of Yum Commands for RPM Package Management in Linux.md +++ /dev/null @@ -1,289 +0,0 @@ -translating by wwy-hust - -27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux -================================================================================ -DNF aka Dandified YUM is a next generation Package Manager for RPM based Distribution. It was first introduced in Fedora 18 and it is replaced [YUM utility][1] in recent release of Fedora 22. - -![](http://www.tecmint.com/wp-content/uploads/2015/05/linux-dnf-command-examples.jpg) - -DNF aims at improving the bottlenecks of YUM viz., Performance, Memory Usages, Dependency Resolution, Speed and lots of other factors. DNF does Package Management using RPM, libsolv and hawkey library. Though it does not come per-installed in CentOS and RHEL 7 you can yum, dnf and use it alongside the yum. - -You may like to read more about DNF here: - -- [Reasons Behind Replacing Yum with DNF][2] - -The latest stable release of DNF is 1.0 (at the time of writing of post) which was released on May 11, 2015. It (and all previous version of DNF) is mostly written in Python and is released under GPL v2 License. - -### Installation of DNF ### - -DNF in not available in the default repository of RHEL/CentOS 7. However Fedora 22 ships with DNF implemented officially. - -To install DNF on RHEL/CentOS systems, you need to first install and enable epel-release repository. - - # yum install epel-release - OR - # yum install epel-release -y - -Though it is not ethical to use ‘-y‘ with yum as it is recommended to see what is being installed in your system. However if this does not matter you much you may use ‘-y’ with yum to install everything automatically without user’s intervention. - -Next, install DNS package using yum command from epel-release repository. - - # yum install dnf - -After dnf installed successfully, it’s time to show you 27 practical usage of dnf commands with examples that will help you to manage packages in RPM based distribution easily and effectively. - -### 1. Check DNF Version ### - -Check the version of DNF installed on your System. - - # dnf --version - -![Check DNF Version](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-Version.gif) - -### 2. List Enabled DNF Repositories ### - -The option ‘repolist‘ with dnf command, will display all enabled repositories under your system. - - # dnf repolist - -![Check All Enabled Repositories](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Enabled-Repositories.gif) - -### 3. List all Enabled and Disabled DNF Repositories ### - -The option ‘repolist all‘ will print all the enabled/disabled repositories under your system. - - # dnf repolist all - -![List All Enabled/Disabled Repositories](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Repositories.gif) - -### 4. List all Available and Installed Packages using DNF ### - -The command “dnf list” will list all the available packages from all the repositories and installed packages on your Linux system. - - # dnf list - -![List All Packages using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Packages.png) - -### 5. List all Installed Packages using DNF ### - -While the “dnf list” command shows all the available/installed packages from all the repositories. However, you have the option to list only the installed packages using option “list installed” as shown below. - - # dnf list installed - -![List All Installed Packages](http://www.tecmint.com/wp-content/uploads/2015/05/List-Installed-Packages.png) - -### 6. List all Available Packages using DNF ### - -Similarly, the “list available” option, will list all the packages available to be installed from all the enabled repositories. - - # dnf list available - -![List Available Packages using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/List-Available-Packages.png) - -### 7. Search for a Package using DNF ### - -If incase, you’ve no idea about the package that you want install, in such situation you may use ‘search‘ option with dnf command to search for the package that matches the word or string (say nano). - - # dnf search nano - -![Search Package by Word](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package.gif) - -### 8. See what Provides a file/sub-package? ### - -The dnf option “provides” find the name of the package that provides specific file/sub-package. For example, if you would like to find what provides ‘/bin/bash‘ on your system? - - # dnf provides /bin/bash - -![Find File Sub Package](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Sub-Package.gif) - -### 9. Get Details of a Package using DNF ### - -Let’s assume you want to know the information of a package before installing it on the system, you may use “info” switch to get a detailed information about a package (say nano) as below. - - # dnf info nano - -![Check Package Information with DNF](http://www.tecmint.com/wp-content/uploads/2015/05/Check-Package-Information.gif) - -### 10. Install a Package with DNF ### - -To install a package called nano, just run the below command it will automatically resolve and install all required dependencies for package nano. - - # dnf install nano - -![Install Package using DNF](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-DNF.gif) - -### 11. Updating a Package using DNF ### - -You may update only a specific package (say systemd) and leave everything on the system untouched. - - # dnf update systemd - -![Update a Specific Package](http://www.tecmint.com/wp-content/uploads/2015/05/Update-a-Package.gif) - -### 12. Check for System Updates using DNF ### - -Check updates for all the system packages installed into the system simply as. - - # dnf check-update - -![Check For System Update](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-System-Update.gif) - -### 13. Update All System Packages using DNF ### - -You may update the whole system including all the installed packages with following commands. - - # dnf update - OR - # dnf upgrade - -![Update System](http://www.tecmint.com/wp-content/uploads/2015/05/Update-System.gif) - -### 14. Remove/Erase a Package using DNF ### - -To remove or erase any unwanted package (say nano), you may use “remove” or “erase” switch with dnf command to remove it. - - # dnf remove nano - OR - # dnf erase nano - -![Remove Package in Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Package.gif) - -### 15. Remove Orphan Packages using DNF ### - -Those packages that were installed to satisfy dependency may be useless if not being used by other applications. To remove those orphan packages execute the below command. - - # dnf autoremove - -![Remove Orphan Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Autoremove-Packages.gif) - -### 16. Remove Cached Packages using DNF ### - -A lot of time we encounter out-of-date headers and unfinished transactions which results into error while executing dnf. We may clean all the cached packages and headers containing remote package information simply by executing. - - # dnf clean all - -![Remove DNF Cache](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Cache-Packages.gif) - -### 17. Get Help on Specific DNF Command ### - -You may get help of any specific dnf command (say clean) just by executing the below command. - - # dnf help clean - -![Get DNF Command Help](http://www.tecmint.com/wp-content/uploads/2015/05/Help-on-DNF-Command.gif) - -### 18. List all DNF Commands and Options ### - -To list help on all available dnf commands and option simply type. - - # dnf help - -![Get Help on DNF Options](http://www.tecmint.com/wp-content/uploads/2015/05/DNF-Options.gif) - -### 19. View History of DNF ### - -You may call dnf history to look at the list of already executed dnf commands. This way you can be aware of what was installed/removed with time stamp. - - # dnf history - -![Check DNF History](http://www.tecmint.com/wp-content/uploads/2015/05/Check-DNF-History.gif) - -### 20. List all Group Packages ### - -The command “dnf grouplist” will print all available or installed packages, if nothing is mentioned, it will list all known groups. - - # dnf grouplist - -![List All Group Packages](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Group-Packages.gif) - -### 21. Install a Group Package using DNF ### - -To install a Group of packages bundled together as group package (say Educational Software) simply as. - - # dnf groupinstall 'Educational Software' - -![Install Group Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Group-Packages.gif) - -### 22. Update a Group Package ### - -Let’s update a Group Package (say Educational Software) by executing the below command. - - # dnf groupupdate 'Educational Software' - -![Update Group Package](http://www.tecmint.com/wp-content/uploads/2015/05/Update-Group-Package.gif) - -### 23. Remove a Group Package ### - -We can remove the group Package (say Educational Software) as. - - # dnf groupremove 'Educational Software' - -![Remove Group Package](http://www.tecmint.com/wp-content/uploads/2015/05/Remove-Group-Package.gif) - -### 24. Install a Package from Specific Repository ### - -DNF makes it possible to install any specific package (say phpmyadmin) from a repo (epel) as simply as, - - # dnf --enablerepo=epel install phpmyadmin - -![Install Package From Specific Repo](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Package-From-Specific-Repo.gif) - -### 25. Synchronize Installed Packages to Stable Release ### - -The command “dnf distro-sync” will provides necessary options to synchronize all installed packages to most recent stable version available from any enabled repository. If no package is selected, all installed packages are synchronized. - - # dnf distro-sync - -![Synchronize Packages to Stable Version](http://www.tecmint.com/wp-content/uploads/2015/05/Synchronize-Packages.gif) - -### 26. Reinstall a Package ### - -The command “dnf reinstall nano” will reinstall an already installed package (say nano). - - # dnf reinstall nano - -![ReInstall Package](http://www.tecmint.com/wp-content/uploads/2015/05/Re-Install-Package.gif) - -### 27. Downgrade a Package ### - -The option “downgrade” will downgrades the named package (say acpid) to lower version if possible. - - # dnf downgrade acpid - -Sample Output - - Using metadata from Wed May 20 12:44:59 2015 - No match for available package: acpid-2.0.19-5.el7.x86_64 - Error: Nothing to do. - -**My observation**: DNF does not downgraded the package as it is supposed to. It has also been reported as bug. - -### Conclusion ### - -DNF is the upper state of the end of the art Package Manager YUM. It tends to do a lot of processing automatically which is not going to be praised by many experienced Linux System Administrator, as I believe. As a matter of example: - -- `--skip-broken` is not recognized by DNF and there is no alternative. -- There is nothing like ‘resolvedep‘ command however you may run dnf provides. -- There is no ‘deplist‘ command to find package dependency. -- You exclude a repo, means the exclusion apply on all operations, unlike yum which excludes those repos only at the time of install and updates, etc. - -Several Linux users are not happy the way Linux Ecosystem is moving. First [Systemd removed init system][3] v and now DNF will be replacing YUM sooner in Fedora 22 and later in RHEL and CentOS. - -What do you think? are distributions and the whole Linux ecosystem is not valuing it’s users and moving against their will. Also it is often said in IT industry – “Why fix, If not broken?”, and neither init System V is broken nor YUM. - -That’s all for now. Please let me know your valuable thoughts in the comments below. Like and share us and help us get spread. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ - -作者:[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/ -[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ -[2]:http://www.tecmint.com/dnf-next-generation-package-management-utility-for-linux/ -[3]:http://www.tecmint.com/systemd-replaces-init-in-linux/ diff --git a/sources/tech/20150528 Things To Do After Installing Fedora 22.md b/sources/tech/20150528 Things To Do After Installing Fedora 22.md deleted file mode 100644 index 023869a9f3..0000000000 --- a/sources/tech/20150528 Things To Do After Installing Fedora 22.md +++ /dev/null @@ -1,115 +0,0 @@ -Translating by GOLinux! -Things To Do After Installing Fedora 22 -================================================================================ -Fedora 22 the latest entrant in the community developed line of Red hat operating systems is released on the 26th of May 2015. A lot of speculation and anticipation has been associated with this release of the venerable fedora. Well there are some major changes that are being proposed for Fedora 22. - -Systemd is the new kid in the block when it comes to initialization daemons, it is poised to replace the venerable sysvinit module that has long been a part of the Linux ecosystem. Another major change that users will come across in the base python version. Its just that python in available in two different flavors the 2.x and 3.x lines. Each has its fair share of quirks and benefits. So users who might prefer the 2.x flavor might want to install their favorite python. The dandified Yum installer that has been around since Fedora 18 is all set to replace the age old YUM installer. Fedora has finally decided that it is time that DNF replace YUM. - -### 1) Install VLC media player ### - -Fedora 22 comes with a default media player viz. gnome videos (previously known as totem). If that is fine by you we can skip this step and move ahead. However if you like me prefer the most widely used VLC you can go ahead and install it from the RPMFusion repos. You can do that with : - - sudo dnf install vlc -y - -### 2) Configure RPMFusion Repos ### - -As I already mentioned Fedora is very strict with its ideologies, it does not ship with any non-free components with it. The official repositories does not provide some essential software containing non-free components like multimedia codes. So it is necessary to install some 3rd party repositories which will provide us some essential software. Luckily RPMFusion repositories come to the rescue. - - $ sudo dnf install --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-22.noarch.rpm - -### 3) Install Multimedia Codecs ### - -As is said some multimedia codecs and plugins don't ship with fedora. Now who would like to miss out on their favorite shows and movies just because the codes are proprietary. Try this: - - $ sudo dnf install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer-plugins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 - -### 4) Update your system ### - -Fedora is a bleeding edge distribution and hence it releases updates which will fix bugs and loopholes present in your system continuously. Hence it is a good practice to keep your system up to date. - - $ sudo dnf update -y - -### 5) Uninstall software you may not need ### - -Fedora comes with a set of pre-chosen packages that most users can utilize, however for more advanced users, you may recognize that you do not need all of it. It's easy enough to remove any packages you don't need using the following command - I chose to uninstall rhythmbox because I know I won't use it: - - $ sudo dnf remove rhythmbox - -### 6) Install Adobe Flash ### - -We all wish Adobe Flash didn't exist anymore since it is not always know for being the most secure or resource efficient, but for awhile it's here to stay. The only way to install Adobe Flash for Fedora 22 is to install the official RPM from Adobe, as shown below. - -You can download the RPM [here][1]. After downloading the file, you can right click and open it like this: - -![Install Adobe Flash](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.50.42-PM.png) - -Right click and select "Open With Software Install" - -Then, simply click install on the window that pops up: - -![Install Adobe](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-9.51.07-PM.png) - -Click on "Install" to complete the process of installing the custom RPM from Adobe - -Once the process completes, the "Install" button will change to "Remove" and the installation should have finished. If your browser is open during the process, it may ask you to close it first or restart it after the install for the changes to take effect. - -### 7) Spin Up a VM with Gnome Boxes ### - -So you just installed Fedora and you're loving it, but maybe you need Windows still for something proprietary, or maybe you just want to play with another Linux distro. In any situation, you can use Gnome Boxes, provided with Fedora 22, to easily create a VM or use a live distribution. Follow the steps below to get started using an ISO of your choice! Who knows, maybe you can even check out a [Fedora Spin][2]. - -First open Gnome Boxes and select "New" in the top left: - -![Add a new virtual machine (box)](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.24.46-PM.png) - -Click "New" to start the process of adding a new virtual machine. - -Next, click to open a file and choose an ISO: - -![Choose ISO](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.28.44-PM.png) - -After choosing to select a file or ISO, select your ISO. In this case, I had a Debian ISO I installed - -Finally, customize the VM settings or use the defaults and click "Create." The VM will start by default and the available VMs will be available in Gnome Boxes as little thumbnails. - -![Create VM](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-10.31.11-PM.png) - -Customize the settings to whatever you choose, or keep the defaults. Click "Create" when you are done and the VM will be ready to go. - -### 8) Install Google Chrome ### - -Firefox is included with Fedora 22, but as with most software, everyone has their browser of choice. If yours happens to be Google Chrome, you can follow the instructions above for Adobe Flash player, however, obviously use the RPM from Google for whichever version of Chrome you download. The latest version can usually be found [here][3]. - -### 9) Add Social Media and Other Online Accounts ### - -Gnome has some nice built in functionality to accommodate accounts for things like Facebook, Google, and other online accounts. You can access the Online Accounts settings through the main Gnome Settings application. You can access the settings by right clicking on the desktop or by finding it in the applications. Then, simply click on Online Accounts and add the accounts of your choosing. If you add an account like Google, for example, you can use it as the default for things like sending email, calendar appointments, interacting with photos and documents, and more. - -### 10) Install KDE or another Desktop Environment ### - -Some of us just don't like Gnome, and that's okay. Run the following command in Terminal to install everything necessary to use KDE instead. The same instructions can be applied to xfce, lxde, or other desktop environments as well. - - $ sudo dnf install @kde-desktop - -After the install finishes, log out. When you click on your username, notice the little gear wheel that indicates settings. Click it and select "Plasma." When you log in again, you will be greeted by a fresh KDE desktop. - -![Plasma on Fedora 22](http://blog.linoxide.com/wp-content/uploads/2015/05/Screen-Shot-2015-05-27-at-11.32.27-PM.png) - -The Plasma environment after just installing it on Fedora 22 - -### Conclusion ### - -That’s it you are all set to go. Use the system and try out things. If you don't find something according to your liking, linux gives you the freedom to change them. Fedora comes with the latest Gnome shell as its desktop environment, too heavy for you and don't like it. Try KDE or some light weight DE like cinnamon, xfce etc. Wish you a very happy and hassle free Fedora experience. !! - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/things-do-after-installing-fedora-22/ - -作者:[Jonathan DeMasi][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/jonathande/ -[1]:https://get.adobe.com/flashplayer/ -[2]:http://spins.fedoraproject.org/ -[3]:https://www.google.com/intl/en/chrome/browser/desktop/index.html diff --git a/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md new file mode 100644 index 0000000000..ca51791986 --- /dev/null +++ b/sources/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md @@ -0,0 +1,209 @@ +translating by wwy-hust + +Nishita Agarwal Shares Her Interview Experience on Linux ‘iptables’ Firewall +================================================================================ +Nishita Agarwal, a frequent Tecmint Visitor shared her experience (Question and Answer) with us regarding the job interview she had just given in a privately owned hosting company in Pune, India. She was asked a lot of questions on a variety of topics however she is an expert in iptables and she wanted to share those questions and their answer (she gave) related to iptables to others who may be going to give interview in near future. + +![Linux Firewall Iptables Interview Questions](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) + +All the questions and their Answer are rewritten based upon the memory of Nishita Agarwal. + +> “Hello Friends! My name is **Nishita Agarwal**. I have Pursued Bachelor Degree in Technology. My area of Specialization is UNIX and Variants of UNIX (BSD, Linux) fascinates me since the time I heard it. I have 1+ years of experience in storage. I was looking for a job change which ended with a hosting company in Pune, India.” + +Here is the collection of what I was asked during the Interview. I’ve documented only those questions and their answer that were related to iptables based upon my memory. Hope this will help you in cracking your Interview. + +### 1. Have you heard of iptables and firewall in Linux? Any idea of what they are and for what it is used? ### + +> **Answer** : I’ve been using iptables for quite long time and I am aware of both iptables and firewall. Iptables is an application program mostly written in C Programming Language and is released under GNU General Public License. Written for System administration point of view, the latest stable release if iptables 1.4.21.iptables may be considered as firewall for UNIX like operating system which can be called as iptables/netfilter, more accurately. The Administrator interact with iptables via console/GUI front end tools to add and define firewall rules into predefined tables. Netfilter is a module built inside of kernel that do the job of filtering. +> +> Firewalld is the latest implementation of filtering rules in RHEL/CentOS 7 (may be implemented in other distributions which I may not be aware of). It has replaced iptables interface and connects to netfilter. + +### 2. Have you used some kind of GUI based front end tool for iptables or the Linux Command Line? ### + +> **Answer** : Though I have used both the GUI based front end tools for iptables like Shorewall in conjugation of [Webmin][1] in GUI and Direct access to iptables via console.And I must admit that direct access to iptables via Linux console gives a user immense power in the form of higher degree of flexibility and better understanding of what is going on in the background, if not anything other. GUI is for novice administrator while console is for experienced. + +### 3. What are the basic differences between between iptables and firewalld? ### + +> **Answer** : iptables and firewalld serves the same purpose (Packet Filtering) but with different approach. iptables flush the entire rules set each time a change is made unlike firewalld. Typically the location of iptables configuration lies at ‘/etc/sysconfig/iptables‘ whereas firewalld configuration lies at ‘/etc/firewalld/‘, which is a set of XML files.Configuring a XML based firewalld is easier as compared to configuration of iptables, however same task can be achieved using both the packet filtering application ie., iptables and firewalld. Firewalld runs iptables under its hood along with it’s own command line interface and configuration file that is XML based and said above. + +### 4. Would you replace iptables with firewalld on all your servers, if given a chance? ### + +> **Answer** : I am familiar with iptables and it’s working and if there is nothing that requires dynamic aspect of firewalld, there seems no reason to migrate all my configuration from iptables to firewalld.In most of the cases, so far I have never seen iptables creating an issue. Also the general rule of Information technology says “why fix if it is not broken”. However this is my personal thought and I would never mind implementing firewalld if the Organization is going to replace iptables with firewalld. + +### 5. You seems confident with iptables and the plus point is even we are using iptables on our server. ### + +What are the tables used in iptables? Give a brief description of the tables used in iptables and the chains they support. + +> **Answer** : Thanks for the recognition. Moving to question part, There are four tables used in iptables, namely they are: +> +> Nat Table +> Mangle Table +> Filter Table +> Raw Table +> +> Nat Table : Nat table is primarily used for Network Address Translation. Masqueraded packets get their IP address altered as per the rules in the table. Packets in the stream traverse Nat Table only once. ie., If a packet from a jet of Packets is masqueraded they rest of the packages in the stream will not traverse through this table again. It is recommended not to filter in this table. Chains Supported by NAT Table are PREROUTING Chain, POSTROUTING Chain and OUTPUT Chain. +> +> Mangle Table : As the name suggests, this table serves for mangling the packets. It is used for Special package alteration. It can be used to alter the content of different packets and their headers. Mangle table can’t be used for Masquerading. Supported chains are PREROUTING Chain, OUTPUT Chain, Forward Chain, INPUT Chain, POSTROUTING Chain. +> +> Filter Table : Filter Table is the default table used in iptables. It is used for filtering Packets. If no rules are defined, Filter Table is taken as default table and filtering is done on the basis of this table. Supported Chains are INPUT Chain, OUTPUT Chain, FORWARD Chain. +> +> Raw Table : Raw table comes into action when we want to configure packages that were exempted earlier. It supports PREROUTING Chain and OUTPUT Chain. + +### 6. What are the target values (that can be specified in target) in iptables and what they do, be brief! ### + +> **Answer** : Following are the target values that we can specify in target in iptables: +> +> ACCEPT : Accept Packets +> QUEUE : Paas Package to user space (place where application and drivers reside) +> DROP : Drop Packets +> RETURN : Return Control to calling chain and stop executing next set of rules for the current Packets in the chain. + + +### 7. Lets move to the technical aspects of iptables, by technical I means practical. ### + +How will you Check iptables rpm that is required to install iptables in CentOS?. + +> **Answer** : iptables rpm are included in standard CentOS installation and we do not need to install it separately. We can check the rpm as: +> +> # rpm -qa iptables +> +> iptables-1.4.21-13.el7.x86_64 +> +> If you need to install it, you may do yum to get it. +> +> # yum install iptables-services + +### 8. How to Check and ensure if iptables service is running? ### + +> **Answer** : To check the status of iptables, you may run the following command on the terminal. +> +> # service status iptables [On CentOS 6/5] +> # systemctl status iptables [On CentOS 7] +> +> If it is not running, the below command may be executed. +> +> ---------------- On CentOS 6/5 ---------------- +> # chkconfig --level 35 iptables on +> # service iptables start +> +> ---------------- On CentOS 7 ---------------- +> # systemctl enable iptables +> # systemctl start iptables +> +> We may also check if the iptables module is loaded or not, as: +> +> # lsmod | grep ip_tables + +### 9. How will you review the current Rules defined in iptables? ### + +> **Answer** : The current rules in iptables can be review as simple as: +> +> # iptables -L +> +> Sample Output +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +### 10. How will you flush all iptables rules or a particular chain? ### + +> **Answer** : To flush a particular iptables chain, you may use following commands. +> +> +> # iptables --flush OUTPUT +> +> To Flush all the iptables rules. +> +> # iptables --flush + +### 11. Add a rule in iptables to accept packets from a trusted IP Address (say 192.168.0.7) ### + +> **Answer** : The above scenario can be achieved simply by running the below command. +> +> # iptables -A INPUT -s 192.168.0.7 -j ACCEPT +> +> We may include standard slash or subnet mask in the source as: +> +> # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT +> # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT + +### 12. How to add rules to ACCEPT, REJECT, DENY and DROP ssh service in iptables. ### + +> **Answer** : Hoping ssh is running on port 22, which is also the default port for ssh, we can add rule to iptables as:To ACCEPT tcp packets for ssh service (port 22). +> +> # iptables -A INPUT -s -p tcp - -dport -j ACCEPT +> +> To REJECT tcp packets for ssh service (port 22). +> +> # iptables -A INPUT -s -p tcp - -dport -j REJECT +> +> To DENY tcp packets for ssh service (port 22). +> +> +> # iptables -A INPUT -s -p tcp - -dport -j DENY +> +> To DROP tcp packets for ssh service (port 22). +> +> +> # iptables -A INPUT -s -p tcp - -dport -j DROP + +### 13. Let me give you a scenario. Say there is a machine the local ip address of which is 192.168.0.6. You need to block connections on port 21, 22, 23, and 80 to your machine. What will you do? ### + +> **Answer** : Well all I need to use is the ‘multiport‘ option with iptables followed by port numbers to be blocked and the above scenario can be achieved in a single go as. +> +> # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 22,23,80,8080 -j DROP +> +> The written rules can be checked using the below command. +> +> # iptables -L +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +**Interviewer** : That’s all I wanted to ask. You are a valuable employee we won’t like to miss. I will recommend your name to the HR. If you have any question you may ask me. + +As a candidate I don’t wanted to kill the conversation hence keep asking about the projects I would be handling if selected and what are the other openings in the company. Not to mention HR round was not difficult to crack and I got the opportunity. + +Also I would like to thank Avishek and Ravi (whom I am a friend since long) for taking the time to document my interview. + +Friends! If you had given any such interview and you would like to share your interview experience to millions of Tecmint readers around the globe? then send your questions and answers to admin@tecmint.com. + +Thank you! Keep Connected. Also let me know if I could have answered a question more correctly than what I did. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ + +作者:[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/ +[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ diff --git a/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md b/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md new file mode 100644 index 0000000000..d07cd26428 --- /dev/null +++ b/sources/tech/20150612 How to Configure Swarm Native Clustering for Docker.md @@ -0,0 +1,95 @@ +How to Configure Swarm Native Clustering for Docker +================================================================================ +Hi everyone, today we'll learn about Swarm and how we can create native clusters using Docker with Swarm. [Docker Swarm][1] is a native clustering program for Docker which turns a pool of Docker hosts into a single virtual host. Swarm serves the standard Docker API, so any tool which can communicate with a Docker daemon can use Swarm to transparently scale to multiple hosts. Swarm follows the "batteries included but removable" principle as other Docker Projects. It ships with a simple scheduling backend out of the box, and as initial development settles, an API will develop to enable pluggable backends. The goal is to provide a smooth out-of-box experience for simple use cases, and allow swapping in more powerful backends, like Mesos, for large scale production deployments. Swarm is extremely easy to setup and get started. + +So, here are some features of Swarm 0.2 out of the box. + +1. Swarm 0.2.0 is about 85% compatible with the Docker Engine. +2. It supports Resource Management. +3. It has Advanced Scheduling feature with constraints and affinities. +4. It supports multiple Discovery Backends (hubs, consul, etcd, zookeeper) +5. It uses TLS encryption method for security and authentication. + +So, here are some very simple and easy steps on how we can use Swarm. + +### 1. Pre-requisites to run Swarm ### + +We must install Docker 1.4.0 or later on all nodes. While each node's IP need not be public, the Swarm manager must be able to access each node across the network. + +Note: Swarm is currently in beta, so things are likely to change. We don't recommend you use it in production yet. + +### 2. Creating Swarm Cluster ### + +Now, we'll create swarm cluster by running the below command. Each node will run a swarm node agent. The agent registers the referenced Docker daemon, monitors it, and updates the discovery backend with the node's status. The below command returns a token which is a unique cluster id, it will be used when starting the Swarm Agent on nodes. + + # docker run swarm create + +![Creating Swarm Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-swarm-cluster.png) + +### 3. Starting the Docker Daemon in each nodes ### + +We'll need to login into each node that we'll use to create clusters and start the Docker Daemon into it using flag -H . It ensures that the docker remote API on the node is available over TCP for the Swarm Manager. To do start the docker daemon, we'll need to run the following command inside the nodes. + + # docker -H tcp://0.0.0.0:2375 -d + +![Starting Docker Daemon](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-docker-daemon.png) + +### 4. Adding the Nodes ### + +After enabling Docker Daemon, we'll need to add the Swarm Nodes to the discovery service. We must ensure that node's IP must be accessible from the Swarm Manager. To do so, we'll need to run the following command. + + # docker run -d swarm join --addr=:2375 token:// + +![Adding Nodes to Cluster](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-nodes-to-cluster.png) + +**Note**: Here, we'll need to replace and with the IP address of the Node and the cluster ID we got from step 2. + +### 5. Starting the Swarm Manager ### + +Now, as we have got the nodes connected to the cluster. Now, we'll start the swarm manager, we'll need to run the following command in the node. + + # docker run -d -p :2375 swarm manage token:// + +![Starting Swarm Manager](http://blog.linoxide.com/wp-content/uploads/2015/05/starting-swarm-manager.png) + +### 6. Checking the Configuration ### + +Once the manager is running, we can check the configuration by running the following command. + + # docker -H tcp:// info + +![Accessing Swarm Clusters](http://blog.linoxide.com/wp-content/uploads/2015/05/accessing-swarm-cluster.png) + +**Note**: We'll need to replace with the ip address and port of the host running the swarm manager. + +### 7. Using the docker CLI to access nodes ### + +After everything is done perfectly as explained above, this part is the most important part of the Docker Swarm. We can use Docker CLI to access the nodes and run containers on them. + + # docker -H tcp:// info + # docker -H tcp:// run ... + +### 8. Listing nodes in the cluster ### + +We can get a list of all of the running nodes using the swarm list command. + + # docker run --rm swarm list token:// + +![Listing Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/listing-swarm-nodes.png) + +### Conclusion ### + +Swarm is really an awesome feature of docker that can be used for creating and managing clusters. It is pretty easy to setup and use. It is more beautiful when we use constraints and affinities on top of it. Advanced Scheduling is an awesome feature of it which applies filters to exclude nodes with ports, labels, health and it uses strategies to pick the best node. So, 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 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/configure-swarm-clustering-docker/ + +作者:[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://docs.docker.com/swarm/ \ No newline at end of file diff --git a/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md b/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md new file mode 100644 index 0000000000..6cdc510092 --- /dev/null +++ b/sources/tech/20150612 Linux_Logo--A Command Line Tool to Print Color ANSI Logos of Linux Distributions.md @@ -0,0 +1,183 @@ +Linux_Logo – A Command Line Tool to Print Color ANSI Logos of Linux Distributions +================================================================================ +linuxlogo or linux_logo is a Linux command line utility that generates a color ANSI picture of Distribution logo with a few system information. + +![Linux_Logo - Prints Color ANSI Logs of Linux Distro](http://www.tecmint.com/wp-content/uploads/2015/06/Linux_Logo.png) + +Linux_Logo – Prints Color ANSI Logs of Linux Distro + +This utility obtains System Information from /proc Filesystem. linuxlogo is capable of showing color ANSI image of various logos other than the host distribution logo. + +The System information associated with logo includes – Linux Kernel Version, Time when Kernel was last Compiled, Number/core of processor, Speed, Manufacturer and processor Generation. It also show information about total physical RAM. + +It is worth mentioning here that screenfetch is another tool of similar kind, which shows distribution logo and a more detailed and formatted system inform http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ation. We have already covered screenfetch long ago, which you may refer at: + +- [ScreenFetch – Generates Linux System Information][15] + +linux_logo and Screenfetch should not be compared to each other. While the output of screenfetch is more formatted and detailed, where linux_logo produce maximum number of color ANSI diagram, and option to format the output. + +linux_logo is written primarily in C programming Language, which displays linux logo in an X Window System and hence User Interface X11 aka X Window System should be installed. The software is released under GNU General Public License Version 2.0. + +For the purpose of this article, we’re using following testing environment to test the linux_logo utility. + + Operating System : Debian Jessie + Processor : i3 / x86_64 + +### Installing Linux Logo Utility in Linux ### + +**1. The linuxlogo package (stable version 5.11) is available to install from default package repository under all Linux distributions using apt, yum or dnf package manager as shown below.** + + # apt-get install linux_logo [On APT based Systems] + # yum install linux_logo [On Yum based Systems] + # dnf install linux_logo [On DNF based Systems] + OR + # dnf install linux_logo.x86_64 [For 64-bit architecture] + +**2. Once linuxlogo package has been installed, you can run the command `linuxlogo` to get the default logo for the distribution you are using..** + + # linux_logo + OR + # linuxlogo + +![Get Default OS Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Get-Default-OS-Logo.png) + +Get Default OS Logo + +**3. Use the option `[-a]`, not to print any fancy color. Useful if viewing linux_logo over black and white terminal.** + + # linux_logo -a + +![Black and White Linux Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Black-and-White-Linux-Logo.png) + +Black and White Linux Logo + +**4. Use option `[-l]` to print LOGO only and exclude all other System Information.** + +# linux_logo -l + +![Print Distribution Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Distribution-Logo.png) + +Print Distribution Logo + +**5. The `[-u]` switch will display system uptime.** + + # linux_logo -u + +![Print System Uptime](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Uptime.png) + +Print System Uptime + +**6. If you are interested in Load Average, use option `[-y]`. You may use more than one option at a time.** + + # linux_logo -y + +![Print System Load Average](http://www.tecmint.com/wp-content/uploads/2015/06/Print-System-Load-Average.png) + +Print System Load Average + +For more options and help on them, you may like to run. + + # linux_logo -h + +![Linuxlogo Options and Help](http://www.tecmint.com/wp-content/uploads/2015/06/linuxlogo-options.png) + +Linuxlogo Options and Help + +**7. There are a lots of built-in Logos for various Linux distributions. You may see all those logos using option `-L list` switch.** + + # linux_logo -L list + +![List of Linux Logos](http://www.tecmint.com/wp-content/uploads/2015/06/List-of-Linux-Logos.png) + +List of Linux Logos + +Now you want to print any of the logo from the list, you may use `-L NUM` or `-L NAME` to display selected logo. + +- -L NUM – will print logo with number NUM (deprecated). +- -L NAME – will print the logo with name NAME. + +For example, to display AIX Logo, you may use command as: + + # linux_logo -L 1 + OR + # linux_logo -L aix + +![Print AIX Logo](http://www.tecmint.com/wp-content/uploads/2015/06/Print-AIX-Logo.png) + +Print AIX Logo + +**Notice**: The `-L 1` in the command where 1 is the number at which AIX logo appears in the list, where `-L aix` is the name at which AIX logo appears in the list. + +Similarly, you may print any logo using these options, few examples to see.. + + # linux_logo -L 27 + # linux_logo -L 21 + +![Various Linux Logos](http://www.tecmint.com/wp-content/uploads/2015/06/Various-Linux-Logos.png) + +Various Linux Logos + +This way, you can use any of the logos just by using the number or name, that is against it. + +### Some Useful Tricks of Linux_logo ### + +**8. You may like to print your Linux distribution logo at login. To print default logo at login you may add the below line at the end of `~/.bashrc` file.** + + if [ -f /usr/bin/linux_logo ]; then linux_logo; fi + +**Notice**: If there isn’t any` ~/.bashrc` file, you may need to create one under user home directory. + +**9. After adding above line, just logout and re-login again to see the default logo of your Linux distribution.** + +![Print Logo on User Login](http://www.tecmint.com/wp-content/uploads/2015/06/Print-Logo-on-Login.png) + +Print Logo on User Login + +Also note, that you may print any logo, after login, simply by adding the below line. + + if [ -f /usr/bin/linux_logo ]; then linux_logo -L num; fi + +**Important**: Don’t forget to replace num with the number that is against the logo, you want to use. + +**10. You can also print your own logo by simply specifying the location of the logo as shown below.** + + # linux_logo -D /path/to/ASCII/logo + +**11. Print logo on Network Login.** + + # /usr/local/bin/linux_logo > /etc/issue.net + +You may like to use ASCII logo if there is no support for color filled ANSI Logo as: + + # /usr/local/bin/linux_logo -a > /etc/issue.net + +**12. Create a Penguin port – A set of port to answer connection. To create Penguin port Add the below line to file /etc/services file.** + + penguin 4444/tcp penguin + +Here ‘4444‘ is the port number which is currently free and not used by any resource. You may use a different port. + +Also add the below line to file /etc/inetd.conf file. + + penguin stream tcp nowait root /usr/local/bin/linux_logo + +Restart the service inetd as: + + # killall -HUP inetd + +Moreover linux_logo can be used in bootup script to fool the attacker as well as you can play a prank with your friend. This is a nice tool and I might use it in some of my scripts to get output as per distribution basis. + +Try it once and you won’t regret. Let us know what you think of this utility and how it can be useful for you. Keep Connected! Keep Commenting. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-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/ +[1]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ \ No newline at end of file diff --git a/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md b/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md new file mode 100644 index 0000000000..7915907e6a --- /dev/null +++ b/sources/tech/20150623 Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management.md @@ -0,0 +1,348 @@ +Shilpa Nair Shares Her Interview Experience on RedHat Linux Package Management +================================================================================ +**Shilpa Nair has just graduated in the year 2015. She went to apply for Trainee position in a National News Television located in Noida, Delhi. When she was in the last year of graduation and searching for help on her assignments she came across Tecmint. Since then she has been visiting Tecmint regularly.** + +![Linux Interview Questions on RPM](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Interview-Questions-on-RPM.jpeg) + +Linux Interview Questions on RPM + +All the questions and answers are rewritten based upon the memory of Shilpa Nair. + +> “Hi friends! I am Shilpa Nair from Delhi. I have completed my graduation very recently and was hunting for a Trainee role soon after my degree. I have developed a passion for UNIX since my early days in the collage and I was looking for a role that suits me and satisfies my soul. I was asked a lots of questions and most of them were basic questions related to RedHat Package Management.” + +Here are the questions, that I was asked and their corresponding answers. I am posting only those questions that are related to RedHat GNU/Linux Package Management, as they were mainly asked. + +### 1. How will you find if a package is installed or not? Say you have to find if ‘nano’ is installed or not, what will you do? ### + +> **Answer** : To find the package nano, weather installed or not, we can use rpm command with the option -q is for query and -a stands for all the installed packages. +> +> # rpm -qa nano +> OR +> # rpm -qa | grep -i nano +> +> nano-2.3.1-10.el7.x86_64 +> +> Also the package name must be complete, an incomplete package name will return the prompt without printing anything which means that package (incomplete package name) is not installed. It can be understood easily by the example below: +> +> We generally substitute vim command with vi. But if we find package vi/vim we will get no result on the standard output. +> +> # vi +> # vim +> +> However we can clearly see that the package is installed by firing vi/vim command. Here is culprit is incomplete file name. If we are not sure of the exact file-name we can use wildcard as: +> +> # rpm -qa vim* +> +> vim-minimal-7.4.160-1.el7.x86_64 +> +> This way we can find information about any package, if installed or not. + +### 2. How will you install a package XYZ using rpm? ### + +> **Answer** : We can install any package (*.rpm) using rpm command a shown below, here options -i (install), -v (verbose or display additional information) and -h (print hash mark during package installation). +> +> # rpm -ivh peazip-1.11-1.el6.rf.x86_64.rpm +> +> Preparing... ################################# [100%] +> Updating / installing... +> 1:peazip-1.11-1.el6.rf ################################# [100%] +> +> If upgrading a package from earlier version -U switch should be used, option -v and -h follows to make sure we get a verbose output along with hash Mark, that makes it readable. + +### 3. You have installed a package (say httpd) and now you want to see all the files and directories installed and created by the above package. What will you do? ### + +> **Answer** : We can list all the files (Linux treat everything as file including directories) installed by the package httpd using options -l (List all the files) and -q (is for query). +> +> # rpm -ql httpd +> +> /etc/httpd +> /etc/httpd/conf +> /etc/httpd/conf.d +> ... + +### 4. You are supposed to remove a package say postfix. What will you do? ### + +> **Answer** : First we need to know postfix was installed by what package. Find the package name that installed postfix using options -e erase/uninstall a package) and –v (verbose output). +> +> # rpm -qa postfix* +> +> postfix-2.10.1-6.el7.x86_64 +> +> and then remove postfix as: +> +> # rpm -ev postfix-2.10.1-6.el7.x86_64 +> +> Preparing packages... +> postfix-2:3.0.1-2.fc22.x86_64 + +### 5. Get detailed information about an installed package, means information like Version, Release, Install Date, Size, Summary and a brief description. ### + +> **Answer** : We can get detailed information about an installed package by using option -qa with rpm followed by package name. +> +> For example to find details of package openssh, all I need to do is: +> +> # rpm -qi openssh +> +> [root@tecmint tecmint]# rpm -qi openssh +> Name : openssh +> Version : 6.8p1 +> Release : 5.fc22 +> Architecture: x86_64 +> Install Date: Thursday 28 May 2015 12:34:50 PM IST +> Group : Applications/Internet +> Size : 1542057 +> License : BSD +> .... + +### 6. You are not sure about what are the configuration files provided by a specific package say httpd. How will you find list of all the configuration files provided by httpd and their location. ### + +> **Answer** : We need to run option -c followed by package name with rpm command and it will list the name of all the configuration file and their location. +> +> # rpm -qc httpd +> +> /etc/httpd/conf.d/autoindex.conf +> /etc/httpd/conf.d/userdir.conf +> /etc/httpd/conf.d/welcome.conf +> /etc/httpd/conf.modules.d/00-base.conf +> /etc/httpd/conf/httpd.conf +> /etc/sysconfig/httpd +> +> Similarly we can list all the associated document files as: +> +> # rpm -qd httpd +> +> /usr/share/doc/httpd/ABOUT_APACHE +> /usr/share/doc/httpd/CHANGES +> /usr/share/doc/httpd/LICENSE +> ... +> +> also, we can list the associated License file as: +> +> # rpm -qL openssh +> +> /usr/share/licenses/openssh/LICENCE +> +> Not to mention that the option -d and option -L in the above command stands for ‘documents‘ and ‘License‘, respectively. + +### 7. You came across a configuration file located at ‘/usr/share/alsa/cards/AACI.conf’ and you are not sure this configuration file is associated with what package. How will you find out the parent package name? ### + +> **Answer** : When a package is installed, the relevant information gets stored in the database. So it is easy to trace what provides the above package using option -qf (-f query packages owning files). +> +> # rpm -qf /usr/share/alsa/cards/AACI.conf +> alsa-lib-1.0.28-2.el7.x86_64 +> +> Similarly we can find (what provides) information about any sub-packge, document files and License files. + +### 8. How will you find list of recently installed software’s using rpm? ### + +> **Answer** : As said earlier, everything being installed is logged in database. So it is not difficult to query the rpm database and find the list of recently installed software’s. +> +> We can do this by running the below commands using option –last (prints the most recent installed software’s). +> +> # rpm -qa --last +> +> The above command will print all the packages installed in a order such that, the last installed software appears at the top. +> +> If our concern is to find out specific package, we can grep that package (say sqlite) from the list, simply as: +> +> # rpm -qa --last | grep -i sqlite +> +> sqlite-3.8.10.2-1.fc22.x86_64 Thursday 18 June 2015 05:05:43 PM IST +> +> We can also get a list of 10 most recently installed software simply as: +> +> # rpm -qa --last | head +> +> We can refine the result to output a more custom result simply as: +> +> # rpm -qa --last | head -n 2 +> +> In the above command -n represents number followed by a numeric value. The above command prints a list of 2 most recent installed software. + +### 9. Before installing a package, you are supposed to check its dependencies. What will you do? ### + +> **Answer** : To check the dependencies of a rpm package (XYZ.rpm), we can use switches -q (query package), -p (query a package file) and -R (Requires / List packages on which this package depends i.e., dependencies). +> +> # rpm -qpR gedit-3.16.1-1.fc22.i686.rpm +> +> /bin/sh +> /usr/bin/env +> glib2(x86-32) >= 2.40.0 +> gsettings-desktop-schemas +> gtk3(x86-32) >= 3.16 +> gtksourceview3(x86-32) >= 3.16 +> gvfs +> libX11.so.6 +> ... + +### 10. Is rpm a front-end Package Management Tool? ### + +> **Answer** : No! rpm is a back-end package management for RPM based Linux Distribution. +> +> [YUM][1] which stands for Yellowdog Updater Modified is the front-end for rpm. YUM automates the overall process of resolving dependencies and everything else. +> +> Very recently [DNF][2] (Dandified YUM) replaced YUM in Fedora 22. Though YUM is still available to be used in RHEL and CentOS, we can install dnf and use it alongside of YUM. DNF is said to have a lots of improvement over YUM. +> +> Good to know, you keep yourself updated. Lets move to the front-end part. + +### 11. How will you list all the enabled repolist on a system. ### + +> **Answer** : We can list all the enabled repos on a system simply using following commands. +> +> # yum repolist +> or +> # dnf repolist +> +> Last metadata expiration check performed 0:30:03 ago on Mon Jun 22 16:50:00 2015. +> repo id repo name status +> *fedora Fedora 22 - x86_64 44,762 +> ozonos Repository for Ozon OS 61 +> *updates Fedora 22 - x86_64 - Updates +> +> The above command will only list those repos that are enabled. If we need to list all the repos, enabled or not, we can do. +> +> # yum repolist all +> or +> # dnf repolist all +> +> Last metadata expiration check performed 0:29:45 ago on Mon Jun 22 16:50:00 2015. +> repo id repo name status +> *fedora Fedora 22 - x86_64 enabled: 44,762 +> fedora-debuginfo Fedora 22 - x86_64 - Debug disabled +> fedora-source Fedora 22 - Source disabled +> ozonos Repository for Ozon OS enabled: 61 +> *updates Fedora 22 - x86_64 - Updates enabled: 5,018 +> updates-debuginfo Fedora 22 - x86_64 - Updates - Debug + +### 12. How will you list all the available and installed packages on a system? ### + +> **Answer** : To list all the available packages on a system, we can do: +> +> # yum list available +> or +> # dnf list available +> +> ast metadata expiration check performed 0:34:09 ago on Mon Jun 22 16:50:00 2015. +> Available Packages +> 0ad.x86_64 0.0.18-1.fc22 fedora +> 0ad-data.noarch 0.0.18-1.fc22 fedora +> 0install.x86_64 2.6.1-2.fc21 fedora +> 0xFFFF.x86_64 0.3.9-11.fc22 fedora +> 2048-cli.x86_64 0.9-4.git20141214.723738c.fc22 fedora +> 2048-cli-nocurses.x86_64 0.9-4.git20141214.723738c.fc22 fedora +> .... +> +> To list all the installed Packages on a system, we can do. +> +> # yum list installed +> or +> # dnf list installed +> +> Last metadata expiration check performed 0:34:30 ago on Mon Jun 22 16:50:00 2015. +> Installed Packages +> GeoIP.x86_64 1.6.5-1.fc22 @System +> GeoIP-GeoLite-data.noarch 2015.05-1.fc22 @System +> NetworkManager.x86_64 1:1.0.2-1.fc22 @System +> NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System +> aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System +> .... +> +> To list all the available and installed packages on a system, we can do. +> +> # yum list +> or +> # dnf list +> +> Last metadata expiration check performed 0:32:56 ago on Mon Jun 22 16:50:00 2015. +> Installed Packages +> GeoIP.x86_64 1.6.5-1.fc22 @System +> GeoIP-GeoLite-data.noarch 2015.05-1.fc22 @System +> NetworkManager.x86_64 1:1.0.2-1.fc22 @System +> NetworkManager-libnm.x86_64 1:1.0.2-1.fc22 @System +> aajohan-comfortaa-fonts.noarch 2.004-4.fc22 @System +> acl.x86_64 2.2.52-7.fc22 @System +> .... + +### 13. How will you install and update a package and a group of packages separately on a system using YUM/DNF? ### + +> Answer : To Install a package (say nano), we can do, +> +> # yum install nano +> +> To Install a Group of Package (say Haskell), we can do. +> +> # yum groupinstall 'haskell' +> +> To update a package (say nano), we can do. +> +> # yum update nano +> +> To update a Group of Package (say Haskell), we can do. +> +> # yum groupupdate 'haskell' + +### 14. How will you SYNC all the installed packages on a system to stable release? ### + +> **Answer** : We can sync all the packages on a system (say CentOS or Fedora) to stable release as, +> +> # yum distro-sync [On CentOS/RHEL] +> or +> # dnf distro-sync [On Fedora 20 Onwards] + +Seems you have done a good homework before coming for the interview,Good!. Before proceeding further I just want to ask one more question. + +### 15. Are you familiar with YUM local repository? Have you tried making a Local YUM repository? Let me know in brief what you will do to create a local YUM repo. ### + +> **Answer** : First I would like to Thank you Sir for appreciation. Coming to question, I must admit that I am quiet familiar with Local YUM repositories and I have already implemented it for testing purpose in my local machine. +> +> 1. To set up Local YUM repository, we need to install the below three packages as: +> +> # yum install deltarpm python-deltarpm createrepo +> +> 2. Create a directory (say /home/$USER/rpm) and copy all the RPMs from RedHat/CentOS DVD to that folder. +> +> # mkdir /home/$USER/rpm +> # cp /path/to/rpm/on/DVD/*.rpm /home/$USER/rpm +> +> 3. Create base repository headers as. +> +> # createrepo -v /home/$USER/rpm +> +> 4. Create the .repo file (say abc.repo) at the location /etc/yum.repos.d simply as: +> +> cd /etc/yum.repos.d && cat << EOF > abc.repo +> [local-installation]name=yum-local +> baseurl=file:///home/$USER/rpm +> enabled=1 +> gpgcheck=0 +> EOF + +**Important**: Make sure to remove $USER with user_name. + +That’s all we need to do to create a Local YUM repository. We can now install applications from here, that is relatively fast, secure and most important don’t need an Internet connection. + +Okay! It was nice interviewing you. I am done. I am going to suggest your name to HR. You are a young and brilliant candidate we would like to have in our organization. If you have any question you may ask me. + +**Me**: Sir, it was really a very nice interview and I feel very lucky today, to have cracked the interview.. + +Obviously it didn’t end here. I asked a lots of questions like the project they are handling. What would be my role and responsibility and blah..blah..blah + +Friends, by the time all these were documented I have been called for HR round which is 3 days from now. Hope I do my best there as well. All your blessings will count. + +Thankyou friends and Tecmint for taking time and documenting my experience. Mates I believe Tecmint is doing some really extra-ordinary which must be praised. When we share ours experience with other, other get to know many things from us and we get to know our mistakes. + +It enhances our confidence level. If you have given any such interview recently, don’t keep it to yourself. Spread it! Let all of us know that. You may use the below form to share your experience with us. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-rpm-package-management-interview-questions/ + +作者:[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/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/dnf-commands-for-fedora-rpm-package-management/ \ No newline at end of file diff --git a/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md b/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md new file mode 100644 index 0000000000..47d33102e5 --- /dev/null +++ b/sources/tech/20150625 How to Provision Swarm Clusters using Docker Machine.md @@ -0,0 +1,125 @@ +How to Provision Swarm Clusters using Docker Machine +================================================================================ +Hi all, today we'll learn how we can deploy Swarm Clusters using Docker Machine. It serves the standard Docker API, so any tool which can communicate with a Docker daemon can use Swarm to transparently scale to multiple hosts. Docker Machine is an application that helps to create Docker hosts on our computer, on cloud providers and inside our own data center. It provides easy solution for creating servers, installing Docker on them and then configuring the Docker client according the users configuration and requirements. We can provision swarm clusters with any driver we need and is highly secured with TLS Encryption. + +Here are some quick and easy steps on how to provision swarm clusters with Docker Machine. + +### 1. Installing Docker Machine ### + +Docker Machine supports awesome on every Linux Operating System. First of all, we'll need to download the latest version of Docker Machine from the Github site . Here, we'll use curl to download the latest version of Docker Machine ie 0.2.0 . + +For 64 Bit Operating System + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-amd64 > /usr/local/bin/docker-machine + +For 32 Bit Operating System + + # curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_linux-i386 > /usr/local/bin/docker-machine + +After downloading the latest release of Docker Machine, we'll make the file named docker-machine under /usr/local/bin/ executable using the command below. + + # chmod +x /usr/local/bin/docker-machine + +After doing the above, we'll wanna ensure that we have successfully installed docker-machine. To check it, we can run the docker-machine -v which will give output of the version of docker-machine installed in our system. + + # docker-machine -v + +![Installing Docker Machine](http://blog.linoxide.com/wp-content/uploads/2015/05/installing-docker-machine.png) + +To enable Docker commands on our machines, make sure to install the Docker client as well by running the command below. + + # curl -L https://get.docker.com/builds/linux/x86_64/docker-latest > /usr/local/bin/docker + # chmod +x /usr/local/bin/docker + +### 2. Creating Machine ### + +After installing Machine into our working PC or device, we'll wanna go forward to create a machine using Docker Machine. Here, in this tutorial we'll gonna deploy a machine in the Digital Ocean Platform so we'll gonna use "digitalocean" as its Driver API then, docker swarm will be running into that Droplet which will be further configured as Swarm Master and another droplet will be created which will be configured as Swarm Node Agent. + +So, to create the machine, we'll need to run the following command. + + # docker-machine create --driver digitalocean --digitalocean-access-token linux-dev + +**Note**: Here, linux-dev is the name of the machine we are wanting to create. is a security key which can be generated from the Digital Ocean Control Panel of the account holder of Digital Ocean Cloud Platform. To retrieve that key, we simply need to login to our Digital Ocean Control Panel then click on API, then click on Generate New Token and give it a name tick on both Read and Write. Then we'll get a long hex key, thats the now, simply replace it into the command above. + +Now, to load the Machine configuration into the shell we are running the comamands, run the following command. + + # eval "$(docker-machine env linux-dev)" + +![Docker Machine Digitalocean Cloud](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-digitalocean-cloud.png) + +Then, we'll mark our machine as ACTIVE by running the below command. + + # docker-machine active linux-dev + +Now, we'll check whether its been marked as ACTIVE "*" or not. + + # docker-machine ls + +![Docker Machine Active List](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-active-list.png) + +### 3. Running Swarm Docker Image ### + +Now, after we finish creating the required machine. We'll gonna deploy swarm docker image in our active machine. This machine will run the docker image and will control over the Swarm master and node. To run the image, we can simply run the below command. + + # docker run swarm create + +![Docker Machine Swarm Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-create.png) + +If you are trying to run swarm docker image using **32 bit Operating System** in the computer where Docker Machine is running, we'll need to SSH into the Droplet. + + # docker-machine ssh + #docker run swarm create + #exit + +### 4. Creating Swarm Master ### + +Now, after our machine and swarm image is running into the machine, we'll now create a Swarm Master. This will also add the master as a node. To do so, here's the command below. + + # docker-machine create \ + -d digitalocean \ + --digitalocean-access-token + --swarm \ + --swarm-master \ + --swarm-discovery token:// \ + swarm-master + +![Docker Machine Swarm Master Create](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-master-create.png) + +### 5. Creating Swarm Nodes ### + +Now, we'll create a swarm node which will get connected with the Swarm Master. The command below will create a new droplet which will be named as swarm-node and will get connected with the Swarm Master as node. This will create a Swarm cluster across the two nodes. + + # docker-machine create \ + -d digitalocean \ + --digitalocean-access-token + --swarm \ + --swarm-discovery token:// \ + swarm-node + +![Docker Machine Swarm Nodes](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-machine-swarm-nodes.png) + +### 6. Connecting to the Swarm Master ### + +We, now connect to the Swarm Master so that we can deploy Docker containers across the nodes as per the requirement and configuration. To load the Swarm Master's Machine configuration into our environment, we can run the below command. + + # eval "$(docker-machine env --swarm swarm-master)" + +After that, we can run the required containers of our choice across the nodes. Here, we'll check if everything went fine or not. So, we'll run **docker info** to check the information about the Swarm Clusters. + + # docker info + +### Conclusion ### + +We can pretty easily create Swarm Cluster with Docker Machine. This method is a lot productive because it reduces a lot of time of a system admin or users. In this article, we successfully provisioned clusters by creating a master and a node using a machine with Digital Ocean as driver. It can be created using any driver like VirtualBox, Google Cloud Computing, Amazon Web Service, Microsoft Azure and more according to the need and requirement of the user and the connection is highly secured with TLS Encryption. 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 :-) + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/provision-swarm-clusters-using-docker-machine/ + +作者:[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/ \ No newline at end of file diff --git a/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md new file mode 100644 index 0000000000..ac4f53cf6f --- /dev/null +++ b/sources/tech/20150629 Autojump--An Advanced 'cd' Command to Quickly Navigate Linux Filesystem.md @@ -0,0 +1,224 @@ +FSSlc Translating + +Autojump – An Advanced ‘cd’ Command to Quickly Navigate Linux Filesystem +================================================================================ +Those Linux users who mainly work with Linux command Line via console/terminal feels the real power of Linux. However it may sometimes be painful to navigate inside Linux Hierarchical file system, specially for the newbies. + +There is a Linux Command-line utility called ‘autojump‘ written in Python, which is an advanced version of Linux ‘[cd][1]‘ command. + +![Autojump Command](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Command.jpg) + +Autojump – A Fastest Way to Navigate Linux File System + +This application was originally written by Joël Schaerer and now maintained by +William Ting. + +Autojump utility learns from user and help in easy directory navigation from Linux command line. Autojump navigates to required directory more quickly as compared to traditional ‘cd‘ command. + +#### Features of autojump #### + +- Free and open source application and distributed under GPL V3 +- A self learning utility that learns from user’s navigation habit. +- Faster navigation. No need to include sub-directories name. +- Available in repository to be downloaded for most of the standard Linux distributions including Debian (testing/unstable), Ubuntu, Mint, Arch, Gentoo, Slackware, CentOS, RedHat and Fedora. +- Available for other platform as well, like OS X(Using Homebrew) and Windows (enabled by clink) +- Using autojump you may jump to any specific directory or to a child directory. Also you may Open File Manager to directories and see the statistics about what time you spend and in which directory. + +#### Prerequisites #### + +- Python Version 2.6+ + +### Step 1: Do a Full System Update ### + +1. Do a system Update/Upgrade as a **root** user to ensure you have the latest version of Python installed. + + # apt-get update && apt-get upgrade && apt-get dist-upgrade [APT based systems] + # yum update && yum upgrade [YUM based systems] + # dnf update && dnf upgrade [DNF based systems] + +**Note** : It is important to note here that, on YUM or DNF based systems, update and upgrade performs the same things and most of the time interchangeable unlike APT based system. + +### Step 2: Download and Install Autojump ### + +2. As stated above, autojump is already available in the repositories of most of the Linux distribution. You may just install it using the Package Manager. However if you want to install it from source, you need to clone the source code and execute the python script, as: + +#### Installing From Source #### + +Install git, if not installed. It is required to clone git. + + # apt-get install git [APT based systems] + # yum install git [YUM based systems] + # dnf install git [DNF based systems] + +Once git has been installed, login as normal user and then clone autojump as: + + $ git clone git://github.com/joelthelion/autojump.git + +Next, switch to the downloaded directory using cd command. + + $ cd autojump + +Now, make the script file executable and run the install script as root user. + + # chmod 755 install.py + # ./install.py + +#### Installing from Repositories #### + +3. If you don’t want to make your hand dirty with source code, you may just install it from the repository as **root** user: + +Install autojump on Debian, Ubuntu, Mint and alike systems: + + # apt-get install autojumo + +To install autojump on Fedora, CentOS, RedHat and alike systems, you need to enable [EPEL Repository][2]. + + # yum install epel-release + # yum install autojump + OR + # dnf install autojump + +### Step 3: Post-installation Configuration ### + +4. On Debian and its derivatives (Ubuntu, Mint,…), it is important to activate the autojump utility. + +To activate autojump utility temporarily, i.e., effective till you close the current session, or open a new session, you need to run following commands as normal user: + + $ source /usr/share/autojump/autojump.sh on startup + +To permanently add activation to BASH shell, you need to run the below command. + + $ echo '. /usr/share/autojump/autojump.sh' >> ~/.bashrc + +### Step 4: Autojump Pretesting and Usage ### + +5. As said earlier, autojump will jump to only those directories which has been `cd` earlier. So before we start testing we are going to ‘cd‘ a few directories and create a few as well. Here is what I did. + + $ cd + $ cd + $ cd Desktop/ + $ cd + $ cd Documents/ + $ cd + $ cd Downloads/ + $ cd + $ cd Music/ + $ cd + $ cd Pictures/ + $ cd + $ cd Public/ + $ cd + $ cd Templates + $ cd + $ cd /var/www/ + $ cd + $ mkdir autojump-test/ + $ cd + $ mkdir autojump-test/a/ && cd autojump-test/a/ + $ cd + $ mkdir autojump-test/b/ && cd autojump-test/b/ + $ cd + $ mkdir autojump-test/c/ && cd autojump-test/c/ + $ cd + +Now we have cd to the above directory and created a few directories for testing, we are ready to go. + +**Point to Remember** : The usage of j is a wrapper around autojump. You may use j in place of autojump command and vice versa. + +6. Check the version of installed autojump using -v option. + + $ j -v + or + $ autojump -v + +![Check Autojump Version](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Autojump-Version.png) + +Check Autojump Version + +7. Jump to a previously visited directory ‘/var/www‘. + + $ j www + +![Jump To Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-To-Directory.png) + +Jump To Directory + +8. Jump to previously visited child directory ‘/home/avi/autojump-test/b‘ without typing sub-directory name. + + $ jc b + +![Jump to Child Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Child-Directory.png) + +Jump to Child Directory + +9. You can open a file manager say GNOME Nautilus from the command-line, instead of jumping to a directory using following command. + + $ jo www + +![Jump to Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Jump-to-Direcotory.png) + +Jump to Directory + +![Open Directory in File Browser](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Directory-in-File-Browser.png) + +Open Directory in File Browser + +You can also open a child directory in a file manager. + + $ jco c + +![Open Child Directory](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory1.png) + +Open Child Directory + +![Open Child Directory in File Browser](http://www.tecmint.com/wp-content/uploads/2015/06/Open-Child-Directory-in-File-Browser1.png) + +Open Child Directory in File Browser + +10. Check stats of each folder key weight and overall key weight along with total directory weight. Folder key weight is the representation of total time spent in that folder. Directory weight if the number of directory in list. + + $ j --stat + +![Check Directory Statistics](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Statistics.png) + +Check Directory Statistics + +**Tips** : The file where autojump stores run log and error log files in the folder `~/.local/share/autojump/`. Don’t overwrite these files, else you may loose all your stats. + + $ ls -l ~/.local/share/autojump/ + +![Autojump Logs](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-Logs.png) + +Autojump Logs + +11. You may seek help, if required simply as: + + $ j --help + +![Autojump Help and Options](http://www.tecmint.com/wp-content/uploads/2015/06/Autojump-help-options.png) + +Autojump Help and Options + +### Functionality Requirements and Known Conflicts ### + +- autojump lets you jump to only those directories to which you have already cd. Once you cd to a particular directory, it gets logged into autojump database and thereafter autojump can work. You can not jump to a directory to which you have not cd, after setting up autojump, no matter what. +- You can not jump to a directory, the name of which begins with a dash (-). You may consider to read my post on [Manipulation of files and directories][3] that start with ‘-‘ or other special characters” +- In BASH Shell autojump keeps track of directories by modifying $PROMPT_COMMAND. It is strictly recommended not to overwrite $PROMPT_COMMAND. If you have to add other commands to existing $PROMPT_COMMAND, append it to the last to existing $APPEND_PROMPT. + +### Conclusion: ### + +autojump is a must utility if you are a command-line user. It eases a lots of things. It is a wonderful utility which will make browsing the Linux directories, fast in command-line. Try it yourself and let me know your valuable feedback in the comments below. Keep Connected, Keep Sharing. Like and share us and help us get spread. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/autojump-a-quickest-way-to-navigate-linux-filesystem/ + +作者:[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/ +[1]:http://www.tecmint.com/cd-command-in-linux/ +[2]:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/ +[3]:http://www.tecmint.com/manage-linux-filenames-with-special-characters/ diff --git a/sources/tech/20150706 PHP Security.md b/sources/tech/20150706 PHP Security.md new file mode 100644 index 0000000000..b942069678 --- /dev/null +++ b/sources/tech/20150706 PHP Security.md @@ -0,0 +1,359 @@ +PHP Security +================================================================================ +![](http://www.codeproject.com/KB/PHP/363897/php_security.jpg) + +### Introduction ### + +When offering an Internet service, you must always keep security in mind as you develop your code. It may appear that most PHP scripts aren't sensitive to security concerns; this is mainly due to the large number of inexperienced programmers working in the language. However, there is no reason for you to have an inconsistent security policy based on a rough guess at your code's significance. The moment you put anything financially interesting on your server, it becomes likely that someone will try to casually hack it. Create a forum program or any sort of shopping cart, and the probability of attack rises to a dead certainty. + +### Background ### + +Here are a few general security guidelines for securing your web content: + +#### Don't trust forms #### + +Hacking forms is trivial. Yes, by using a silly JavaScript trick, you may be able to limit your form to allow only the numbers 1 through 5 in a rating field. The moment someone turns JavaScript off in their browser or posts custom form data, your client-side validation flies out the window. + +Users interact with your scripts primarily through form parameters, and therefore they're the biggest security risk. What's the lesson? Always validate the data that gets passed to any PHP script in the PHP script. In this article, we show you how to analyze and protect against cross-site scripting (XSS) attacks, which can hijack your user's credentials (and worse). You'll also see how to prevent the MySQL injection attacks that can taint or destroy your data. + +#### Don't trust users #### + +Assume that every piece of data your website gathers is laden with harmful code. Sanitize every piece, even if you're positive that nobody would ever try to attack your site. + +#### Turn off global variables #### + +The biggest security hole you can have is having the register_globals configuration parameter enabled. Mercifully, it's turned off by default in PHP 4.2 and later. If **register_globals** is on, then you can disable this feature by turning the register_globals variable to Off in your server's php.ini file : + + register_globals = Off + +Novice programmers view registered globals as a convenience, but they don't realize how dangerous this setting is. A server with global variables enabled automatically assigns global variables to any form parameters. For an idea of how this works and why this is dangerous, let's look at an example. + +Let's say that you have a script named process.php that enters form data into your user database. The original form looked like this: + + + +When running process.php, PHP with registered globals enabled places the value of this parameter into the $username variable. This saves some typing over accessing them through **$_POST['username']** or **$_GET['username']**. Unfortunately, this also leaves you open to security problems, because PHP sets a variable for any value sent to the script via a GET or POST parameter, and that is a big problem if you didn't explicitly initialize the variable and you don't want someone to manipulate it. + +Take the script below, for example—if the $authorized variable is true, it shows confidential data to the user. Under normal circumstances, the $authorized variable is set to true only if the user has been properly authenticated via the hypothetical authenticated_user() function. But if you have **register_globals** active, anyone could send a GET parameter such as authorized=1 to override this: + + + +The moral of the story is that you should pull form data from predefined server variables. All data passed on to your web page via a posted form is automatically stored in a large array called $_POST, and all GET data is stored in a large array called **$_GET**. File upload information is stored in a special array called $_FILES. In addition, there is a combined variable called $_REQUEST. + +To access the username field from a POST method form, use **$_POST['username']**. Use **$_GET['username']** if the username is in the URL. If you don't care where the value came from, use **$_REQUEST['username']**. + + + +$_REQUEST is a union of the $_GET, $_POST, and $_COOKIE arrays. If you have two or more values of the same parameter name, be careful of which one PHP uses. The default order is cookie, POST, then GET. + +#### Recommended Security Configuration Options #### + +There are several PHP configuration settings that affect security features. Here are the ones that should obviously be used for production servers: + +- **register_globals** set to off +- **safe_mode** set to off +- **error_reporting** set to off. This is visible error reporting that sends a message to the user's browser if something goes wrong. For production servers, use error logging instead. Development servers can enable error logging as long as they're behind a firewall. +- Disable these functions: system(), exec(), passthru(), shell_exec(), proc_open(), and popen(). +- **open_basedir** set for both the /tmp directory (so that session information can be stored) and the web root so that scripts cannot access files outside a selected area. +- **expose_php** set to off. This feature adds a PHP signature that includes the version number to the Apache headers. +- **allow_url_fopen** set to off. This isn't strictly necessary if you're careful about how you access files in your code—that is, you validate all input parameters. +- **allow_url_include** set to off. There's really no sane reason for anyone to want to access include files via HTTP. + +In general, if you find code that wants to use these features, you shouldn't trust it. Be especially careful of anything that wants to use a function such as system()—it's almost certainly flawed. + +With these settings now behind us, let's look at some specific attacks and the methods that will help you protect your server. + +### SQL Injection Attacks ### + +Because the queries that PHP passes to MySQL databases are written in the powerful SQL programming language, you run the risk of someone attempting an SQL injection attack by using MySQL in web query parameters. By inserting malicious SQL code fragments into form parameters, an attacker attempts to break into (or disable) your server. + +Let's say that you have a form parameter that you eventually place into a variable named $product, and you create some SQL like this: + + $sql = "select * from pinfo where product = '$product'"; + +If that parameter came straight from the form, use database-specific escapes with PHP's native functions, like this: + + $sql = 'Select * from pinfo where product = '"' + mysql_real_escape_string($product) . '"'; + +If you don't, someone might just decide to throw this fragment into the form parameter: + + 39'; DROP pinfo; SELECT 'FOO + +Then the result of $sql is: + + select product from pinfo where product = '39'; DROP pinfo; SELECT 'FOO' + +Because the semicolon is MySQL's statement delimiter, the database processes these three statements: + + select * from pinfo where product = '39' + DROP pinfo + SELECT 'FOO' + +Well, there goes your table. + +Note that this particular syntax won't actually work with PHP and MySQL, because the **mysql_query()** function allows just one statement to be processed per request. However, a subquery will still work. + +To prevent SQL injection attacks, do two things: + +- Always validate all parameters. For example, if something needs to be a number, make sure that it's a number. +- Always use the mysql_real_escape_string() function on data to escape any quotes or double quotes in your data. + +**Note: To automatically escape any form data, you can turn on Magic Quotes.** + +Some MySQL damage can be avoided by restricting your MySQL user privileges. Any MySQL account can be restricted to only do certain kinds of queries on selected tables. For example, you could create a MySQL user who can select rows but nothing else. However, this is not terribly useful for dynamic data, and, furthermore, if you have sensitive customer information, it might be possible for someone to have access to some data that you didn't intend to make available. For example, a user accessing account data could try to inject some code that accesses another account number instead of the one assigned to the current session. + +### Preventing Basic XSS Attacks ### + +XSS stands for cross-site scripting. Unlike most attacks, this exploit works on the client side. The most basic form of XSS is to put some JavaScript in user-submitted content to steal the data in a user's cookie. Since most sites use cookies and sessions to identify visitors, the stolen data can then be used to impersonate that user—which is deeply troublesome when it's a typical user account, and downright disastrous if it's the administrative account. If you don't use cookies or session IDs on your site, your users aren't vulnerable, but you should still be aware of how this attack works. + +Unlike MySQL injection attacks, XSS attacks are difficult to prevent. Yahoo!, eBay, Apple, and Microsoft have all been affected by XSS. Although the attack doesn't involve PHP, you can use PHP to strip user data in order to prevent attacks. To stop an XSS attack, you have to restrict and filter the data a user submits to your site. It is for this precise reason that most online bulletin boards don't allow the use of HTML tags in posts and instead replace them with custom tag formats such as **[b]** and **[linkto]**. + +Let's look at a simple script that illustrates how to prevent some of these attacks. For a more complete solution, use SafeHTML, discussed later in this article. + + function transform_HTML($string, $length = null) { + // Helps prevent XSS attacks + // Remove dead space. + $string = trim($string); + // Prevent potential Unicode codec problems. + $string = utf8_decode($string); + // HTMLize HTML-specific characters. + $string = htmlentities($string, ENT_NOQUOTES); + $string = str_replace("#", "#", $string); + $string = str_replace("%", "%", $string); + $length = intval($length); + if ($length > 0) { + $string = substr($string, 0, $length); + } + return $string; + } + +This function transforms HTML-specific characters into HTML literals. A browser renders any HTML run through this script as text with no markup. For example, consider this HTML string: + + Bold Text + +Normally, this HTML would render as follows: + + Bold Text + +However, when run through **transform_HTML()**, it renders as the original input. The reason is that the tag characters are HTML entities in the processed string. The resulting string from **HTML()** in plaintext looks like this: + + <STRONG>Bold Text</STRONG> + +The essential piece of this function is the htmlentities() function call that transforms <, >, and & into their entity equivalents of **<**, **>**, and **&**. Although this takes care of the most common attacks, experienced XSS hackers have another sneaky trick up their sleeve: Encoding their malicious scripts in hexadecimal or UTF-8 instead of normal ASCII text, hoping to circumvent your filters. They can send the code along as a GET variable in the URL, saying, "Hey, this is hexadecimal code, but could you run it for me anyway?" A hexadecimal example looks something like this: + + + +But when the browser renders that information, it turns out to be: + + + +To prevent this, transform_HTML() takes the additional steps of converting # and % signs into their entity, shutting down hex attacks, and converting UTF-8–encoded data. + +Finally, just in case someone tries to overload a string with a very long input, hoping to crash something, you can add an optional $length parameter to trim the string to the maximum length you specify. + +### Using SafeHTML ### + +The problem with the previous script is that it is simple, and it does not allow for any kind of user markup. Unfortunately, there are hundreds of ways to try to sneak JavaScript past someone's filters, and short of stripping all HTML from someone's input, there's no way of stopping it. + +Currently, there's no single script that's guaranteed to be unbreakable, though there are some that are better than most. There are two approaches to security, whitelisting and blacklisting, and whitelisting tends to be less complicated and more effective. + +One whitelisting solution is the SafeHTML anti-XSS parser from PixelApes. + +SafeHTML is smart enough to recognize valid HTML, so it can hunt and strip any dangerous tags. It does its parsing with another package called HTMLSax. + +To install and use SafeHTML, do the following: + +1. Go to [http://pixel-apes.com/safehtml/?page=safehtml][1] and download the latest version of SafeHTML. +1. Put the files in the classes directory on your server. This directory contains everything that SafeHTML and HTMLSax need to function. +1. Include the SafeHTML class file (safehtml.php) in your script. +1. Create a new SafeHTML object called $safehtml. +1. Sanitize your data with the $safehtml->parse() method. + +Here's a complete example: + + alert('XSS Attack')"; + // Create a safehtml object. + $safehtml = new safehtml(); + // Parse and sanitize the data. + $safe_data = $safehtml->parse($data); + // Display result. + echo 'The sanitized data is
' . $safe_data; + ?> + +If you want to sanitize any other data in your script, you don't have to create a new object; just use the $safehtml->parse() method throughout your script. + +#### What Can Go Wrong? #### + +The biggest mistake you can make is assuming that this class completely shuts down XSS attacks. SafeHTML is a fairly complex script that checks for almost everything, but nothing is guaranteed. You still want to do the parameter validation that applies to your site. For example, this class doesn't check the length of a given variable to ensure that it fits into a database field. It doesn't check for buffer overflow problems. + +XSS hackers are creative and use a variety of approaches to try to accomplish their objectives. Just look at RSnake's XSS tutorial at [http://ha.ckers.org/xss.html][2] to see how many ways there are to try to sneak code past someone's filters. The SafeHTML project has good programmers working overtime to try to stop XSS attacks, and it has a solid approach, but there's no guarantee that someone won't come up with some weird and fresh approach that could short-circuit its filters. + +**Note: For an example of the powerful effects of XSS attacks, check out [http://namb.la/popular/tech.html][3], which shows a step-by-step approach to creating the JavaScript XSS worm that overloaded the MySpace servers. ** + +### Protecting Data with a One-Way Hash ### + +This script performs a one-way transformation on data—in other words, it can make a hash signature of someone's password, but you can't ever decrypt it and go back to the original password. Why would you want to do that? The application is in storing passwords. An administrator doesn't need to know users' passwords—in fact, it's a good idea that only the user knows his or her password. The system (and the system alone) should be able to identify a correct password; this has been the Unix password security model for years. One-way password security works as follows: + +1. When a user or administrator creates or changes an account password, the system hashes the password and stores the result. The host system discards the plaintext password. +1. When the user logs in to a system via any means, the entered password is again hashed. +1. The host system throws away the plaintext password entered. +1. This newly hashed password is compared against the stored hash. +1. If the hashed passwords match, then the system grants access. + +The host system does this without ever knowing the original password; in fact, the original value is completely irrelevant. As a side effect, should someone break into your system and steal your password database, the intruder will have a bunch of hashed passwords without any way of reversing them to find the originals. Of course, given enough time, computer power, and poorly chosen user passwords, an attacker could probably use a dictionary attack to figure out the passwords. Therefore, don't make it easy for people to get their hands on your password database, and if someone does, have everyone change their passwords. + +#### Encryption Vs Hashing #### + +Technically speaking, this process is not encryption. It is a hash, which is different from encryption for two reasons: + +Unlike in encryption, data cannot be decrypted. + +It's possible (but extremely unlikely) that two different strings will produce the same hash. There's no guarantee that a hash is unique, so don't try to use a hash as something like a unique key in a database. + + function hash_ish($string) { + return md5($string); + } + +The md5() function returns a 32-character hexadecimal string, based on the RSA Data Security Inc. Message-Digest Algorithm (also known, conveniently enough, as MD5). You can then insert that 32-character string into your database, compare it against other md5'd strings, or just adore its 32-character perfection. + +#### Hacking the Script #### + +It is virtually impossible to decrypt MD5 data. That is, it's very hard. However, you still need good passwords, because it's still easy to make a database of hashes for the entire dictionary. There are online MD5 dictionaries where you can enter **06d80eb0c50b49a509b49f2424e8c805** and get a result of "dog." Thus, even though MD5s can't technically be decrypted, they're still vulnerable—and if someone gets your password database, you can be sure that they'll be consulting an MD5 dictionary. Thus, it's in your best interests when creating password-based systems that the passwords are long (a minimum of six characters and preferably eight) and contain both letters and numbers. And make sure that the password isn't in the dictionary. + +### Encrypting Data with Mcrypt ### + +MD5 hashes work just fine if you never need to see your data in readable form. Unfortunately, that's not always an option—if you offer to store someone's credit card information in encrypted format, you need to decrypt it at some later point. + +One of the easiest solutions is the Mcrypt module, an add-in for PHP that allows high-grade encryption. The Mcrypt library offers more than 30 ciphers to use in encryption and the possibility of a passphrase that ensures that only you (or, optionally, your users) can decrypt data. + +Let's see some hands-on use. The following script contains functions that use Mcrypt to encrypt and decrypt data: + + + +The **mcrypt()** function requires several pieces of information: + +- The data to encrypted. +- The passphrase used to encrypt and unlock your data, also known as the key. +- The cipher used to encrypt the data, which is the specific algorithm used to encrypt the data. This script uses **MCRYPT_SERPENT_256**, but you can choose from an array of fancy-sounding ciphers, including **MCRYPT_TWOFISH192**, **MCRYPT_RC2**, **MCRYPT_DES**, and **MCRYPT_LOKI97**. +- The mode used to encrypt the data. There are several modes you can use, including Electronic Codebook and Cipher Feedback. This script uses **MCRYPT_MODE_CBC**, Cipher Block Chaining. +- An **initialization vector**—also known as an IV, or a seed—an additional bit of binary data used to seed the encryption algorithm. That is, it's something extra thrown in to make the algorithm harder to crack. +- The length of the string needed for the key and IV, which vary by cipher and block. Use the **mcrypt_get_key_size()** and **mcrypt_get_block_size()** functions to find the appropriate length; then trim the key value to the appropriate length with a handy **substr()** function. (If the key is shorter than the required value, don't worry—Mcrypt pads it with zeros.) + +If someone steals both your data and your passphrase, they can just cycle through the ciphers until finding the one that works. Thus, we apply the additional security of using the **md5()** function on the key before we use it, so even having both data and passphrase won't get the intruder what she wants. + +An intruder would need the function, the data, and the passphrase all at once—and if that is the case, they probably have complete access to your server, and you're hosed anyway. + +There's a small data storage format problem here. Mcrypt returns its encrypted data in an ugly binary format that causes horrific errors when you try to store it in certain MySQL fields. Therefore, we use the **base64encode()** and **base64decode()** functions to transform the data into a SQL-compatible alphabetical format and retrieve rows. + +#### Hacking the Script #### + +In addition to experimenting with various encryption methods, you can add some convenience to this script. For example, rather than providing the key and mode every time, you could declare them as global constants in an included file. + +### Generating Random Passwords ### + +Random (but difficult-to-guess) strings are important in user security. For example, if someone loses a password and you're using MD5 hashes, you won't be able to, nor should you want to, look it up. Instead, you should generate a secure random password and send that to the user. Another application for random number generation is creating activation links in order to access your site's services. Here is a function that creates a password: + + 0) && + (! is_null($num_chars))) { + $password = ''; + $accepted_chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; + // Seed the generator if necessary. + srand(((int)((double)microtime()*1000003)) ); + for ($i=0; $i<=$num_chars; $i++) { + $random_number = rand(0, (strlen($accepted_chars) -1)); + $password .= $accepted_chars[$random_number] ; + } + return $password; + } + } + ?> + +#### Using the Script #### + +The **make_password()** function returns a string, so all you need to do is supply the length of the string as an argument: + + + +The function works as follows: + +- The function makes sure that **$num_chars** is a positive nonzero integer. +- The function initializes the **$password** variable to an empty string. +- The function initializes the **$accepted_chars** variable to the list of characters the password may contain. This script uses all lowercase letters and the numbers 0 through 9, but you can choose any set of characters you like. +- The random number generator needs a seed, so it gets a bunch of random-like values. (This isn't strictly necessary on PHP 4.2 and later.) +- The function loops **$num_chars** times, one iteration for each character in the password to generate. +- For each new character, the script looks at the length of **$accepted_chars**, chooses a number between 0 and the length, and adds the character at that index in **$accepted_chars** to $password. +- After the loop completes, the function returns **$password**. + +### License ### + +This article, along with any associated source code and files, is licensed under [The Code Project Open License (CPOL)][4] + +-------------------------------------------------------------------------------- + +via: http://www.codeproject.com/Articles/363897/PHP-Security + +作者:[SamarRizvi][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.codeproject.com/script/Membership/View.aspx?mid=7483622 +[1]:http://pixel-apes.com/safehtml/?page=safehtml +[2]:http://ha.ckers.org/xss.html +[3]:http://namb.la/popular/tech.html +[4]:http://www.codeproject.com/info/cpol10.aspx \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md new file mode 100644 index 0000000000..0155034c35 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 01--Reviewing Essential Commands and System Documentation.md @@ -0,0 +1,315 @@ +[translating by xiqingongzi] + +RHCSA Series: Reviewing Essential Commands & System Documentation – Part 1 +================================================================================ +RHCSA (Red Hat Certified System Administrator) is a certification exam from Red Hat company, which provides an open source operating system and software to the enterprise community, It also provides support, training and consulting services for the organizations. + +![RHCSA Exam Guide](http://www.tecmint.com/wp-content/uploads/2015/02/RHCSA-Series-by-Tecmint.png) + +RHCSA Exam Preparation Guide + +RHCSA exam is the certification obtained from Red Hat Inc, after passing the exam (codename EX200). RHCSA exam is an upgrade to the RHCT (Red Hat Certified Technician) exam, and this upgrade is compulsory as the Red Hat Enterprise Linux was upgraded. The main variation between RHCT and RHCSA is that RHCT exam based on RHEL 5, whereas RHCSA certification is based on RHEL 6 and 7, the courseware of these two certifications are also vary to a certain level. + +This Red Hat Certified System Administrator (RHCSA) is essential to perform the following core system administration tasks needed in Red Hat Enterprise Linux environments: + +- Understand and use necessary tools for handling files, directories, command-environments line, and system-wide / packages documentation. +- Operate running systems, even in different run levels, identify and control processes, start and stop virtual machines. +- Set up local storage using partitions and logical volumes. +- Create and configure local and network file systems and its attributes (permissions, encryption, and ACLs). +- Setup, configure, and control systems, including installing, updating and removing software. +- Manage system users and groups, along with use of a centralized LDAP directory for authentication. +- Ensure system security, including basic firewall and SELinux configuration. + +To view fees and register for an exam in your country, check the [RHCSA Certification page][1]. + +To view fees and register for an exam in your country, check the RHCSA Certification page. + +In this 15-article RHCSA series, titled Preparation for the RHCSA (Red Hat Certified System Administrator) exam, we will going to cover the following topics on the latest releases of Red Hat Enterprise Linux 7. + +- Part 1: Reviewing Essential Commands & System Documentation +- Part 2: How to Perform File and Directory Management in RHEL 7 +- Part 3: How to Manage Users and Groups in RHEL 7 +- Part 4: Editing Text Files with Nano and Vim / Analyzing text with grep and regexps +- Part 5: Process Management in RHEL 7: boot, shutdown, and everything in between +- Part 6: Using ‘Parted’ and ‘SSM’ to Configure and Encrypt System Storage +- Part 7: Using ACLs (Access Control Lists) and Mounting Samba / NFS Shares +- Part 8: Securing SSH, Setting Hostname and Enabling Network Services +- Part 9: Installing, Configuring and Securing a Web and FTP Server +- Part 10: Yum Package Management, Automating Tasks with Cron and Monitoring System Logs +- Part 11: Firewall Essentials and Control Network Traffic Using FirewallD and Iptables +- Part 12: Automate RHEL 7 Installations Using ‘Kickstart’ +- Part 13: RHEL 7: What is SELinux and how it works? +- Part 14: Use LDAP-based authentication in RHEL 7 +- Part 15: Virtualization in RHEL 7: KVM and Virtual machine management + +In this Part 1 of the RHCSA series, we will explain how to enter and execute commands with the correct syntax in a shell prompt or terminal, and explained how to find, inspect, and use system documentation. + +![RHCSA: Reviewing Essential Linux Commands – Part 1](http://www.tecmint.com/wp-content/uploads/2015/02/Reviewing-Essential-Linux-Commands.png) + +RHCSA: Reviewing Essential Linux Commands – Part 1 + +#### Prerequisites: #### + +At least a slight degree of familiarity with basic Linux commands such as: + +- [cd command][2] (change directory) +- [ls command][3] (list directory) +- [cp command][4] (copy files) +- [mv command][5] (move or rename files) +- [touch command][6] (create empty files or update the timestamp of existing ones) +- rm command (delete files) +- mkdir command (make directory) + +The correct usage of some of them are anyway exemplified in this article, and you can find further information about each of them using the suggested methods in this article. + +Though not strictly required to start, as we will be discussing general commands and methods for information search in a Linux system, you should try to install RHEL 7 as explained in the following article. It will make things easier down the road. + +- [Red Hat Enterprise Linux (RHEL) 7 Installation Guide][7] + +### Interacting with the Linux Shell ### + +If we log into a Linux box using a text-mode login screen, chances are we will be dropped directly into our default shell. On the other hand, if we login using a graphical user interface (GUI), we will have to open a shell manually by starting a terminal. Either way, we will be presented with the user prompt and we can start typing and executing commands (a command is executed by pressing the Enter key after we have typed it). + +Commands are composed of two parts: + +- the name of the command itself, and +- arguments + +Certain arguments, called options (usually preceded by a hyphen), alter the behavior of the command in a particular way while other arguments specify the objects upon which the command operates. + +The type command can help us identify whether another certain command is built into the shell or if it is provided by a separate package. The need to make this distinction lies in the place where we will find more information about the command. For shell built-ins we need to look in the shell’s man page, whereas for other binaries we can refer to its own man page. + +![Check Shell built in Commands](http://www.tecmint.com/wp-content/uploads/2015/02/Check-shell-built-in-Commands.png) + +Check Shell built in Commands + +In the examples above, cd and type are shell built-ins, while top and less are binaries external to the shell itself (in this case, the location of the command executable is returned by type). + +Other well-known shell built-ins include: + +- [echo command][8]: Displays strings of text. +- [pwd command][9]: Prints the current working directory. + +![More Built in Shell Commands](http://www.tecmint.com/wp-content/uploads/2015/02/More-Built-in-Shell-Commands.png) + +More Built in Shell Commands + +**exec command** + +Runs an external program that we specify. Note that in most cases, this is better accomplished by just typing the name of the program we want to run, but the exec command has one special feature: rather than create a new process that runs alongside the shell, the new process replaces the shell, as can verified by subsequent. + + # ps -ef | grep [original PID of the shell process] + +When the new process terminates, the shell terminates with it. Run exec top and then hit the q key to quit top. You will notice that the shell session ends when you do, as shown in the following screencast: + +注:youtube视频 + + +**export command** + +Exports variables to the environment of subsequently executed commands. + +**history Command** + +Displays the command history list with line numbers. A command in the history list can be repeated by typing the command number preceded by an exclamation sign. If we need to edit a command in history list before executing it, we can press Ctrl + r and start typing the first letters associated with the command. When we see the command completed automatically, we can edit it as per our current need: + +注:youtube视频 + + +This list of commands is kept in our home directory in a file called .bash_history. The history facility is a useful resource for reducing the amount of typing, especially when combined with command line editing. By default, bash stores the last 500 commands you have entered, but this limit can be extended by using the HISTSIZE environment variable: + +![Linux history Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-history-Command.png) + +Linux history Command + +But this change as performed above, will not be persistent on our next boot. In order to preserve the change in the HISTSIZE variable, we need to edit the .bashrc file by hand: + + # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) + HISTSIZE=1000 + +**Important**: Keep in mind that these changes will not take effect until we restart our shell session. + +**alias command** + +With no arguments or with the -p option prints the list of aliases in the form alias name=value on standard output. When arguments are provided, an alias is defined for each name whose value is given. + +With alias, we can make up our own commands or modify existing ones by including desired options. For example, suppose we want to alias ls to ls –color=auto so that the output will display regular files, directories, symlinks, and so on, in different colors: + + # alias ls='ls --color=auto' + +![Linux alias Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-alias-Command.png) + +Linux alias Command + +**Note**: That you can assign any name to your “new command” and enclose as many commands as desired between single quotes, but in that case you need to separate them by semicolons, as follows: + + # alias myNewCommand='cd /usr/bin; ls; cd; clear' + +**exit command** + +The exit and logout commands both terminate the shell. The exit command terminates any shell, but the logout command terminates only login shells—that is, those that are launched automatically when you initiate a text-mode login. + +If we are ever in doubt as to what a program does, we can refer to its man page, which can be invoked using the man command. In addition, there are also man pages for important files (inittab, fstab, hosts, to name a few), library functions, shells, devices, and other features. + +#### Examples: #### + +- man uname (print system information, such as kernel name, processor, operating system type, architecture, and so on). +- man inittab (init daemon configuration). + +Another important source of information is provided by the info command, which is used to read info documents. These documents often provide more information than the man page. It is invoked by using the info keyword followed by a command name, such as: + + # info ls + # info cut + +In addition, the /usr/share/doc directory contains several subdirectories where further documentation can be found. They either contain plain-text files or other friendly formats. + +Make sure you make it a habit to use these three methods to look up information for commands. Pay special and careful attention to the syntax of each of them, which is explained in detail in the documentation. + +**Converting Tabs into Spaces with expand Command** + +Sometimes text files contain tabs but programs that need to process the files don’t cope well with tabs. Or maybe we just want to convert tabs into spaces. That’s where the expand tool (provided by the GNU coreutils package) comes in handy. + +For example, given the file NumbersList.txt, let’s run expand against it, changing tabs to one space, and display on standard output. + + # expand --tabs=1 NumbersList.txt + +![Linux expand Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-expand-Command.png) + +Linux expand Command + +The unexpand command performs the reverse operation (converts spaces into tabs). + +**Display the first lines of a file with head and the last lines with tail** + +By default, the head command followed by a filename, will display the first 10 lines of the said file. This behavior can be changed using the -n option and specifying a certain number of lines. + + # head -n3 /etc/passwd + # tail -n3 /etc/passwd + +![Linux head and tail Command](http://www.tecmint.com/wp-content/uploads/2015/02/Linux-head-and-tail-Command.png) + +Linux head and tail Command + +One of the most interesting features of tail is the possibility of displaying data (last lines) as the input file grows (tail -f my.log, where my.log is the file under observation). This is particularly useful when monitoring a log to which data is being continually added. + +Read More: [Manage Files Effectively using head and tail Commands][10] + +**Merging Lines with paste** + +The paste command merges files line by line, separating the lines from each file with tabs (by default), or another delimiter that can be specified (in the following example the fields in the output are separated by an equal sign). + + # paste -d= file1 file2 + +![Merge Files in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Merge-Files-in-Linux-with-paste-command.png) + +Merge Files in Linux + +**Breaking a file into pieces using split command** + +The split command is used split a file into two (or more) separate files, which are named according to a prefix of our choosing. The splitting can be defined by size, chunks, or number of lines, and the resulting files can have a numeric or alphabetic suffixes. In the following example, we will split bash.pdf into files of size 50 KB (-b 50KB), using numeric suffixes (-d): + + # split -b 50KB -d bash.pdf bash_ + +![Split Files in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Split-Files-in-Linux-with-split-command.png) + +Split Files in Linux + +You can merge the files to recreate the original file with the following command: + + # cat bash_00 bash_01 bash_02 bash_03 bash_04 bash_05 > bash.pdf + +**Translating characters with tr command** + +The tr command can be used to translate (change) characters on a one-by-one basis or using character ranges. In the following example we will use the same file2 as previously, and we will change: + +- lowercase o’s to uppercase, +- and all lowercase to uppercase + + # cat file2 | tr o O + # cat file2 | tr [a-z] [A-Z] + +![Translate Characters in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Translate-characters-in-Linux-with-tr-command.png) + +Translate Characters in Linux + +**Reporting or deleting duplicate lines with uniq and sort command** + +The uniq command allows us to report or remove duplicate lines in a file, writing to stdout by default. We must note that uniq does not detect repeated lines unless they are adjacent. Thus, uniq is commonly used along with a preceding sort (which is used to sort lines of text files). + +By default, sort takes the first field (separated by spaces) as key field. To specify a different key field, we need to use the -k option. Please note how the output returned by sort and uniq change as we change the key field in the following example: + + # cat file3 + # sort file3 | uniq + # sort -k2 file3 | uniq + # sort -k3 file3 | uniq + +![Remove Duplicate Lines in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Remove-Duplicate-Lines-in-file.png) + +Remove Duplicate Lines in Linux + +**Extracting text with cut command** + +The cut command extracts portions of input lines (from stdin or files) and displays the result on standard output, based on number of bytes (-b), characters (-c), or fields (-f). + +When using cut based on fields, the default field separator is a tab, but a different separator can be specified by using the -d option. + + # cut -d: -f1,3 /etc/passwd # Extract specific fields: 1 and 3 in this case + # cut -d: -f2-4 /etc/passwd # Extract range of fields: 2 through 4 in this example + +![Extract Text From a File in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/Extract-Text-from-a-file.png) + +Extract Text From a File in Linux + +Note that the output of the two examples above was truncated for brevity. + +**Reformatting files with fmt command** + +fmt is used to “clean up” files with a great amount of content or lines, or with varying degrees of indentation. The new paragraph formatting defaults to no more than 75 characters wide. You can change this with the -w (width) option, which set the line length to the specified number of characters. + +For example, let’s see what happens when we use fmt to display the /etc/passwd file setting the width of each line to 100 characters. Once again, output has been truncated for brevity. + + # fmt -w100 /etc/passwd + +![File Reformatting in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/File-Reformatting-in-Linux-with-fmt-command.png) + +File Reformatting in Linux + +**Formatting content for printing with pr command** + +pr paginates and displays in columns one or more files for printing. In other words, pr formats a file to make it look better when printed. For example, the following command: + + # ls -a /etc | pr -n --columns=3 -h "Files in /etc" + +Shows a listing of all the files found in /etc in a printer-friendly format (3 columns) with a custom header (indicated by the -h option), and numbered lines (-n). + +![File Formatting in Linux](http://www.tecmint.com/wp-content/uploads/2015/02/File-Formatting-in-Linux-with-pr-command.png) + +File Formatting in Linux + +### Summary ### + +In this article we have discussed how to enter and execute commands with the correct syntax in a shell prompt or terminal, and explained how to find, inspect, and use system documentation. As simple as it seems, it’s a large first step in your way to becoming a RHCSA. + +If you would like to add other commands that you use on a periodic basis and that have proven useful to fulfill your daily responsibilities, feel free to share them with the world by using the comment form below. Questions are also welcome. We look forward to hearing from you! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:https://www.redhat.com/en/services/certification/rhcsa +[2]:http://www.tecmint.com/cd-command-in-linux/ +[3]:http://www.tecmint.com/ls-command-interview-questions/ +[4]:http://www.tecmint.com/advanced-copy-command-shows-progress-bar-while-copying-files/ +[5]:http://www.tecmint.com/rename-multiple-files-in-linux/ +[6]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[7]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ +[8]:http://www.tecmint.com/echo-command-in-linux/ +[9]:http://www.tecmint.com/pwd-command-examples/ +[10]:http://www.tecmint.com/view-contents-of-file-in-linux/ diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md b/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md new file mode 100644 index 0000000000..7566862597 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 02--How to Perform File and Directory Management.md @@ -0,0 +1,322 @@ +RHCSA Series: How to Perform File and Directory Management – Part 2 +================================================================================ +In this article, RHCSA Part 2: File and directory management, we will review some essential skills that are required in the day-to-day tasks of a system administrator. + +![RHCSA: Perform File and Directory Management – Part 2](http://www.tecmint.com/wp-content/uploads/2015/03/RHCSA-Part2.png) + +RHCSA: Perform File and Directory Management – Part 2 + +### Create, Delete, Copy, and Move Files and Directories ### + +File and directory management is a critical competence that every system administrator should possess. This includes the ability to create / delete text files from scratch (the core of each program’s configuration) and directories (where you will organize files and other directories), and to find out the type of existing files. + +The [touch command][1] can be used not only to create empty files, but also to update the access and modification times of existing files. + +![touch command example](http://www.tecmint.com/wp-content/uploads/2015/03/touch-command-example.png) + +touch command example + +You can use `file [filename]` to determine a file’s type (this will come in handy before launching your preferred text editor to edit it). + +![file command example](http://www.tecmint.com/wp-content/uploads/2015/03/file-command-example.png) + +file command example + +and `rm [filename]` to delete it. + +![Linux rm command examples](http://www.tecmint.com/wp-content/uploads/2015/03/rm-command-examples.png) + +rm command example + +As for directories, you can create directories inside existing paths with `mkdir [directory]` or create a full path with `mkdir -p [/full/path/to/directory].` + +![mkdir command example](http://www.tecmint.com/wp-content/uploads/2015/03/mkdir-command-example.png) + +mkdir command example + +When it comes to removing directories, you need to make sure that they’re empty before issuing the `rmdir [directory]` command, or use the more powerful (handle with care!) `rm -rf [directory]`. This last option will force remove recursively the `[directory]` and all its contents – so use it at your own risk. + +### Input and Output Redirection and Pipelining ### + +The command line environment provides two very useful features that allows to redirect the input and output of commands from and to files, and to send the output of a command to another, called redirection and pipelining, respectively. + +To understand those two important concepts, we must first understand the three most important types of I/O (Input and Output) streams (or sequences) of characters, which are in fact special files, in the *nix sense of the word. + +- Standard input (aka stdin) is by default attached to the keyboard. In other words, the keyboard is the standard input device to enter commands to the command line. +- Standard output (aka stdout) is by default attached to the screen, the device that “receives” the output of commands and display them on the screen. +- Standard error (aka stderr), is where the status messages of a command is sent to by default, which is also the screen. + +In the following example, the output of `ls /var` is sent to stdout (the screen), as well as the result of ls /tecmint. But in the latter case, it is stderr that is shown. + +![Linux input output redirect](http://www.tecmint.com/wp-content/uploads/2015/03/Linux-input-output-redirect.png) + +Input and Output Example + +To more easily identify these special files, they are each assigned a file descriptor, an abstract representation that is used to access them. The essential thing to understand is that these files, just like others, can be redirected. What this means is that you can capture the output from a file or script and send it as input to another file, command, or script. This will allow you to store on disk, for example, the output of commands for later processing or analysis. + +To redirect stdin (fd 0), stdout (fd 1), or stderr (fd 2), the following operators are available. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Redirection OperatorEffect
>Redirects standard output to a file containing standard output. If the destination file exists, it will be overwritten.
>>Appends standard output to a file.
2>Redirects standard error to a file containing standard output. If the destination file exists, it will be overwritten.
2>>Appends standard error to the existing file.
&>Redirects both standard output and standard error to a file; if the specified file exists, it will be overwritten.
<Uses the specified file as standard input.
<>The specified file is used for both standard input and standard output.
+ +As opposed to redirection, pipelining is performed by adding a vertical bar `(|)` after a command and before another one. + +Remember: + +- Redirection is used to send the output of a command to a file, or to send a file as input to a command. +- Pipelining is used to send the output of a command to another command as input. + +#### Examples Of Redirection and Pipelining #### + +**Example 1: Redirecting the output of a command to a file** + +There will be times when you will need to iterate over a list of files. To do that, you can first save that list to a file and then read that file line by line. While it is true that you can iterate over the output of ls directly, this example serves to illustrate redirection. + + # ls -1 /var/mail > mail.txt + +![Redirect output of command tot a file](http://www.tecmint.com/wp-content/uploads/2015/03/Redirect-output-to-a-file.png) + +Redirect output of command tot a file + +**Example 2: Redirecting both stdout and stderr to /dev/null** + +In case we want to prevent both stdout and stderr to be displayed on the screen, we can redirect both file descriptors to `/dev/null`. Note how the output changes when the redirection is implemented for the same command. + + # ls /var /tecmint + # ls /var/ /tecmint &> /dev/null + +![Redirecting stdout and stderr ouput to /dev/null](http://www.tecmint.com/wp-content/uploads/2015/03/Redirecting-stdout-stderr-ouput.png) + +Redirecting stdout and stderr ouput to /dev/null + +#### Example 3: Using a file as input to a command #### + +While the classic syntax of the [cat command][2] is as follows. + + # cat [file(s)] + +You can also send a file as input, using the correct redirection operator. + + # cat < mail.txt + +![Linux cat command examples](http://www.tecmint.com/wp-content/uploads/2015/03/cat-command-examples.png) + +cat command example + +#### Example 4: Sending the output of a command as input to another #### + +If you have a large directory or process listing and want to be able to locate a certain file or process at a glance, you will want to pipeline the listing to grep. + +Note that we use to pipelines in the following example. The first one looks for the required keyword, while the second one will eliminate the actual `grep command` from the results. This example lists all the processes associated with the apache user. + + # ps -ef | grep apache | grep -v grep + +![Send output of command as input to another](http://www.tecmint.com/wp-content/uploads/2015/03/Send-output-of-command-as-input-to-another1.png) + +Send output of command as input to another + +### Archiving, Compressing, Unpacking, and Uncompressing Files ### + +If you need to transport, backup, or send via email a group of files, you will use an archiving (or grouping) tool such as [tar][3], typically used with a compression utility like gzip, bzip2, or xz. + +Your choice of a compression tool will be likely defined by the compression speed and rate of each one. Of these three compression tools, gzip is the oldest and provides the least compression, bzip2 provides improved compression, and xz is the newest and provides the best compression. Typically, files compressed with these utilities have .gz, .bz2, or .xz extensions, respectively. + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandAbbreviationDescription
–createcCreates a tar archive
–concatenateAAppends tar files to an archive
–appendrAppends non-tar files to an archive
–updateuAppends files that are newer than those in an archive
–diff or –comparedCompares an archive to files on disk
–listtLists the contents of a tarball
–extract or –getxExtracts files from an archive
+ +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Operation modifierAbbreviationDescription
directory dir CChanges to directory dir before performing operations
same-permissions and same-owner pPreserves permissions and ownership information, respectively.
–verbose vLists all files as they are read or extracted; if combined with –list, it also displays file sizes, ownership, and timestamps
exclude fileExcludes file from the archive. In this case, file can be an actual file or a pattern.
gzip or gunzip zCompresses an archive through gzip
–bzip2 jCompresses an archive through bzip2
–xz JCompresses an archive through xz
+ +#### Example 5: Creating a tarball and then compressing it using the three compression utilities #### + +You may want to compare the effectiveness of each tool before deciding to use one or another. Note that while compressing small files, or a few files, the results may not show much differences, but may give you a glimpse of what they have to offer. + + # tar cf ApacheLogs-$(date +%Y%m%d).tar /var/log/httpd/* # Create an ordinary tarball + # tar czf ApacheLogs-$(date +%Y%m%d).tar.gz /var/log/httpd/* # Create a tarball and compress with gzip + # tar cjf ApacheLogs-$(date +%Y%m%d).tar.bz2 /var/log/httpd/* # Create a tarball and compress with bzip2 + # tar cJf ApacheLogs-$(date +%Y%m%d).tar.xz /var/log/httpd/* # Create a tarball and compress with xz + +![Linux tar command examples](http://www.tecmint.com/wp-content/uploads/2015/03/tar-command-examples.png) + +tar command examples + +#### Example 6: Preserving original permissions and ownership while archiving and when #### + +If you are creating backups from users’ home directories, you will want to store the individual files with the original permissions and ownership instead of changing them to that of the user account or daemon performing the backup. The following example preserves these attributes while taking the backup of the contents in the `/var/log/httpd` directory: + + # tar cJf ApacheLogs-$(date +%Y%m%d).tar.xz /var/log/httpd/* --same-permissions --same-owner + +### Create Hard and Soft Links ### + +In Linux, there are two types of links to files: hard links and soft (aka symbolic) links. Since a hard link represents another name for an existing file and is identified by the same inode, it then points to the actual data, as opposed to symbolic links, which point to filenames instead. + +In addition, hard links do not occupy space on disk, while symbolic links do take a small amount of space to store the text of the link itself. The downside of hard links is that they can only be used to reference files within the filesystem where they are located because inodes are unique inside a filesystem. Symbolic links save the day, in that they point to another file or directory by name rather than by inode, and therefore can cross filesystem boundaries. + +The basic syntax to create links is similar in both cases: + + # ln TARGET LINK_NAME # Hard link named LINK_NAME to file named TARGET + # ln -s TARGET LINK_NAME # Soft link named LINK_NAME to file named TARGET + +#### Example 7: Creating hard and soft links #### + +There is no better way to visualize the relation between a file and a hard or symbolic link that point to it, than to create those links. In the following screenshot you will see that the file and the hard link that points to it share the same inode and both are identified by the same disk usage of 466 bytes. + +On the other hand, creating a hard link results in an extra disk usage of 5 bytes. Not that you’re going to run out of storage capacity, but this example is enough to illustrate the difference between a hard link and a soft link. + +![Difference between a hard link and a soft link](http://www.tecmint.com/wp-content/uploads/2015/03/hard-soft-link.png) + +Difference between a hard link and a soft link + +A typical usage of symbolic links is to reference a versioned file in a Linux system. Suppose there are several programs that need access to file fooX.Y, which is subject to frequent version updates (think of a library, for example). Instead of updating every single reference to fooX.Y every time there’s a version update, it is wiser, safer, and faster, to have programs look to a symbolic link named just foo, which in turn points to the actual fooX.Y. + +Thus, when X and Y change, you only need to edit the symbolic link foo with a new destination name instead of tracking every usage of the destination file and updating it. + +### Summary ### + +In this article we have reviewed some essential file and directory management skills that must be a part of every system administrator’s tool-set. Make sure to review other parts of this series as well in order to integrate these topics with the content covered in this tutorial. + +Feel free to let us know if you have any questions or comments. We are always more than glad to hear from our readers. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/file-and-directory-management-in-linux/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[2]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ +[3]:http://www.tecmint.com/18-tar-command-examples-in-linux/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md b/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md new file mode 100644 index 0000000000..be78c87e3a --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 03--How to Manage Users and Groups in RHEL 7.md @@ -0,0 +1,248 @@ +RHCSA Series: How to Manage Users and Groups in RHEL 7 – Part 3 +================================================================================ +Managing a RHEL 7 server, as it is the case with any other Linux server, will require that you know how to add, edit, suspend, or delete user accounts, and grant users the necessary permissions to files, directories, and other system resources to perform their assigned tasks. + +![User and Group Management in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/User-and-Group-Management-in-Linux.png) + +RHCSA: User and Group Management – Part 3 + +### Managing User Accounts ### + +To add a new user account to a RHEL 7 server, you can run either of the following two commands as root: + + # adduser [new_account] + # useradd [new_account] + +When a new user account is added, by default the following operations are performed. + +- His/her home directory is created (`/home/username` unless specified otherwise). +- These `.bash_logout`, `.bash_profile` and `.bashrc` hidden files are copied inside the user’s home directory, and will be used to provide environment variables for his/her user session. You can explore each of them for further details. +- A mail spool directory is created for the added user account. +- A group is created with the same name as the new user account. + +The full account summary is stored in the `/etc/passwd `file. This file holds a record per system user account and has the following format (fields are separated by a colon): + + [username]:[x]:[UID]:[GID]:[Comment]:[Home directory]:[Default shell] + +- These two fields `[username]` and `[Comment]` are self explanatory. +- The second filed ‘x’ indicates that the account is secured by a shadowed password (in `/etc/shadow`), which is used to logon as `[username]`. +- The fields `[UID]` and `[GID]` are integers that shows the User IDentification and the primary Group IDentification to which `[username]` belongs, equally. + +Finally, + +- The `[Home directory]` shows the absolute location of `[username]’s` home directory, and +- `[Default shell]` is the shell that is commit to this user when he/she logins into the system. + +Another important file that you must become familiar with is `/etc/group`, where group information is stored. As it is the case with `/etc/passwd`, there is one record per line and its fields are also delimited by a colon: + + [Group name]:[Group password]:[GID]:[Group members] + +where, + +- `[Group name]` is the name of group. +- Does this group use a group password? (An “x” means no). +- `[GID]`: same as in `/etc/passwd`. +- `[Group members]`: a list of users, separated by commas, that are members of each group. + +After adding an account, at anytime, you can edit the user’s account information using usermod, whose basic syntax is: + + # usermod [options] [username] + +Read Also: + +- [15 ‘useradd’ Command Examples][1] +- [15 ‘usermod’ Command Examples][2] + +#### EXAMPLE 1: Setting the expiry date for an account #### + +If you work for a company that has some kind of policy to enable account for a certain interval of time, or if you want to grant access to a limited period of time, you can use the `--expiredate` flag followed by a date in YYYY-MM-DD format. To verify that the change has been applied, you can compare the output of + + # chage -l [username] + +before and after updating the account expiry date, as shown in the following image. + +![Change User Account Information](http://www.tecmint.com/wp-content/uploads/2015/03/Change-User-Account-Information.png) + +Change User Account Information + +#### EXAMPLE 2: Adding the user to supplementary groups #### + +Besides the primary group that is created when a new user account is added to the system, a user can be added to supplementary groups using the combined -aG, or –append –groups options, followed by a comma separated list of groups. + +#### EXAMPLE 3: Changing the default location of the user’s home directory and / or changing its shell #### + +If for some reason you need to change the default location of the user’s home directory (other than /home/username), you will need to use the -d, or –home options, followed by the absolute path to the new home directory. + +If a user wants to use another shell other than bash (for example, sh), which gets assigned by default, use usermod with the –shell flag, followed by the path to the new shell. + +#### EXAMPLE 4: Displaying the groups an user is a member of #### + +After adding the user to a supplementary group, you can verify that it now actually belongs to such group(s): + + # groups [username] + # id [username] + +The following image depicts Examples 2 through 4: + +![Adding User to Supplementary Group](http://www.tecmint.com/wp-content/uploads/2015/03/Adding-User-to-Supplementary-Group.png) + +Adding User to Supplementary Group + +In the example above: + + # usermod --append --groups gacanepa,users --home /tmp --shell /bin/sh tecmint + +To remove a user from a group, omit the `--append` switch in the command above and list the groups you want the user to belong to following the `--groups` flag. + +#### EXAMPLE 5: Disabling account by locking password #### + +To disable an account, you will need to use either the -l (lowercase L) or the –lock option to lock a user’s password. This will prevent the user from being able to log on. + +#### EXAMPLE 6: Unlocking password #### + +When you need to re-enable the user so that he can log on to the server again, use the -u or the –unlock option to unlock a user’s password that was previously blocked, as explained in Example 5 above. + + # usermod --unlock tecmint + +The following image illustrates Examples 5 and 6: + +![Lock Unlock User Account](http://www.tecmint.com/wp-content/uploads/2015/03/Lock-Unlock-User-Account.png) + +Lock Unlock User Account + +#### EXAMPLE 7: Deleting a group or an user account #### + +To delete a group, you’ll want to use groupdel, whereas to delete a user account you will use userdel (add the –r switch if you also want to delete the contents of its home directory and mail spool): + + # groupdel [group_name] # Delete a group + # userdel -r [user_name] # Remove user_name from the system, along with his/her home directory and mail spool + +If there are files owned by group_name, they will not be deleted, but the group owner will be set to the GID of the group that was deleted. + +### Listing, Setting and Changing Standard ugo/rwx Permissions ### + +The well-known [ls command][3] is one of the best friends of any system administrator. When used with the -l flag, this tool allows you to view a list a directory’s contents in long (or detailed) format. + +However, this command can also be applied to a single file. Either way, the first 10 characters in the output of `ls -l` represent each file’s attributes. + +The first char of this 10-character sequence is used to indicate the file type: + +- – (hyphen): a regular file +- d: a directory +- l: a symbolic link +- c: a character device (which treats data as a stream of bytes, i.e. a terminal) +- b: a block device (which handles data in blocks, i.e. storage devices) + +The next nine characters of the file attributes, divided in groups of three from left to right, are called the file mode and indicate the read (r), write(w), and execute (x) permissions granted to the file’s owner, the file’s group owner, and the rest of the users (commonly referred to as “the world”), respectively. + +While the read permission on a file allows the same to be opened and read, the same permission on a directory allows its contents to be listed if the execute permission is also set. In addition, the execute permission in a file allows it to be handled as a program and run. + +File permissions are changed with the chmod command, whose basic syntax is as follows: + + # chmod [new_mode] file + +where new_mode is either an octal number or an expression that specifies the new permissions. Feel free to use the mode that works best for you in each case. Or perhaps you already have a preferred way to set a file’s permissions – so feel free to use the method that works best for you. + +The octal number can be calculated based on the binary equivalent, which can in turn be obtained from the desired file permissions for the owner of the file, the owner group, and the world.The presence of a certain permission equals a power of 2 (r=22, w=21, x=20), while its absence means 0. For example: + +![File Permissions](http://www.tecmint.com/wp-content/uploads/2015/03/File-Permissions.png) + +File Permissions + +To set the file’s permissions as indicated above in octal form, type: + + # chmod 744 myfile + +Please take a minute to compare our previous calculation to the actual output of `ls -l` after changing the file’s permissions: + +![Long List Format](http://www.tecmint.com/wp-content/uploads/2015/03/Long-List-Format.png) + +Long List Format + +#### EXAMPLE 8: Searching for files with 777 permissions #### + +As a security measure, you should make sure that files with 777 permissions (read, write, and execute for everyone) are avoided like the plague under normal circumstances. Although we will explain in a later tutorial how to more effectively locate all the files in your system with a certain permission set, you can -by now- combine ls with grep to obtain such information. + +In the following example, we will look for file with 777 permissions in the /etc directory only. Note that we will use pipelining as explained in [Part 2: File and Directory Management][4] of this RHCSA series: + + # ls -l /etc | grep rwxrwxrwx + +![Find All Files with 777 Permission](http://www.tecmint.com/wp-content/uploads/2015/03/Find-All-777-Files.png) + +Find All Files with 777 Permission + +#### EXAMPLE 9: Assigning a specific permission to all users #### + +Shell scripts, along with some binaries that all users should have access to (not just their corresponding owner and group), should have the execute bit set accordingly (please note that we will discuss a special case later): + + # chmod a+x script.sh + +**Note**: That we can also set a file’s mode using an expression that indicates the owner’s rights with the letter `u`, the group owner’s rights with the letter `g`, and the rest with `o`. All of these rights can be represented at the same time with the letter `a`. Permissions are granted (or revoked) with the `+` or `-` signs, respectively. + +![Set Execute Permission on File](http://www.tecmint.com/wp-content/uploads/2015/03/Set-Execute-Permission-on-File.png) + +Set Execute Permission on File + +A long directory listing also shows the file’s owner and its group owner in the first and second columns, respectively. This feature serves as a first-level access control method to files in a system: + +![Check File Owner and Group](http://www.tecmint.com/wp-content/uploads/2015/03/Check-File-Owner-and-Group.png) + +Check File Owner and Group + +To change file ownership, you will use the chown command. Note that you can change the file and group ownership at the same time or separately: + + # chown user:group file + +**Note**: That you can change the user or group, or the two attributes at the same time, as long as you don’t forget the colon, leaving user or group blank if you want to update the other attribute, for example: + + # chown :group file # Change group ownership only + # chown user: file # Change user ownership only + +#### EXAMPLE 10: Cloning permissions from one file to another #### + +If you would like to “clone” ownership from one file to another, you can do so using the –reference flag, as follows: + + # chown --reference=ref_file file + +where the owner and group of ref_file will be assigned to file as well: + +![Clone File Ownership](http://www.tecmint.com/wp-content/uploads/2015/03/Clone-File-Ownership.png) + +Clone File Ownership + +### Setting Up SETGID Directories for Collaboration ### + +Should you need to grant access to all the files owned by a certain group inside a specific directory, you will most likely use the approach of setting the setgid bit for such directory. When the setgid bit is set, the effective GID of the real user becomes that of the group owner. + +Thus, any user can access a file under the privileges granted to the group owner of such file. In addition, when the setgid bit is set on a directory, newly created files inherit the same group as the directory, and newly created subdirectories will also inherit the setgid bit of the parent directory. + + # chmod g+s [filename] + +To set the setgid in octal form, prepend the number 2 to the current (or desired) basic permissions. + + # chmod 2755 [directory] + +### Conclusion ### + +A solid knowledge of user and group management, along with standard and special Linux permissions, when coupled with practice, will allow you to quickly identify and troubleshoot issues with file permissions in your RHEL 7 server. + +I assure you that as you follow the steps outlined in this article and use the system documentation (as explained in [Part 1: Reviewing Essential Commands & System Documentation][5] of this series) you will master this essential competence of system administration. + +Feel free to let us know if you have any questions or comments using the form below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-manage-users-and-groups/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/add-users-in-linux/ +[2]:http://www.tecmint.com/usermod-command-examples/ +[3]:http://www.tecmint.com/ls-interview-questions/ +[4]:http://www.tecmint.com/file-and-directory-management-in-linux/ +[5]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md b/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md new file mode 100644 index 0000000000..1529fecf2e --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 04--Editing Text Files with Nano and Vim or Analyzing text with grep and regexps.md @@ -0,0 +1,254 @@ +RHCSA Series: Editing Text Files with Nano and Vim / Analyzing text with grep and regexps – Part 4 +================================================================================ +Every system administrator has to deal with text files as part of his daily responsibilities. That includes editing existing files (most likely configuration files), or creating new ones. It has been said that if you want to start a holy war in the Linux world, you can ask sysadmins what their favorite text editor is and why. We are not going to do that in this article, but will present a few tips that will be helpful to use two of the most widely used text editors in RHEL 7: nano (due to its simplicity and easiness of use, specially to new users), and vi/m (due to its several features that convert it into more than a simple editor). I am sure that you can find many more reasons to use one or the other, or perhaps some other editor such as emacs or pico. It’s entirely up to you. + +![Learn Nano and vi Editors](http://www.tecmint.com/wp-content/uploads/2015/03/Learn-Nano-and-vi-Editors.png) + +RHCSA: Editing Text Files with Nano and Vim – Part 4 + +### Editing Files with Nano Editor ### + +To launch nano, you can either just type nano at the command prompt, optionally followed by a filename (in this case, if the file exists, it will be opened in edition mode). If the file does not exist, or if we omit the filename, nano will also be opened in edition mode but will present a blank screen for us to start typing: + +![Nano Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Editor.png) + +Nano Editor + +As you can see in the previous image, nano displays at the bottom of the screen several functions that are available via the indicated shortcuts (^, aka caret, indicates the Ctrl key). To name a few of them: + +- Ctrl + G: brings up the help menu with a complete list of functions and descriptions:Ctrl + X: exits the current file. If changes have not been saved, they are discarded. +- Ctrl + R: lets you choose a file to insert its contents into the present file by specifying a full path. + +![Nano Editor Help Menu](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Help.png) + +Nano Editor Help Menu + +- Ctrl + O: saves changes made to a file. It will let you save the file with the same name or a different one. Then press Enter to confirm. + +![Nano Editor Save Changes Mode](http://www.tecmint.com/wp-content/uploads/2015/03/Nano-Save-Changes.png) + +Nano Editor Save Changes Mode + +- Ctrl + X: exits the current file. If changes have not been saved, they are discarded. +- Ctrl + R: lets you choose a file to insert its contents into the present file by specifying a full path. + +![Nano: Insert File Content to Parent File](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-File-Content.png) + +Nano: Insert File Content to Parent File + +will insert the contents of /etc/passwd into the current file. + +- Ctrl + K: cuts the current line. +- Ctrl + U: paste. +- Ctrl + C: cancels the current operation and places you at the previous screen. + +To easily navigate the opened file, nano provides the following features: + +- Ctrl + F and Ctrl + B move the cursor forward or backward, whereas Ctrl + P and Ctrl + N move it up or down one line at a time, respectively, just like the arrow keys. +- Ctrl + space and Alt + space move the cursor forward and backward one word at a time. + +Finally, + +- Ctrl + _ (underscore) and then entering X,Y will take you precisely to Line X, column Y, if you want to place the cursor at a specific place in the document. + +![Navigate to Line Numbers in Nano](http://www.tecmint.com/wp-content/uploads/2015/03/Column-Numbers.png) + +Navigate to Line Numbers in Nano + +The example above will take you to line 15, column 14 in the current document. + +If you can recall your early Linux days, specially if you came from Windows, you will probably agree that starting off with nano is the best way to go for a new user. + +### Editing Files with Vim Editor ### + +Vim is an improved version of vi, a famous text editor in Linux that is available on all POSIX-compliant *nix systems, such as RHEL 7. If you have the chance and can install vim, go ahead; if not, most (if not all) the tips given in this article should also work. + +One of vim’s distinguishing features is the different modes in which it operates: + + +- Command mode will allow you to browse through the file and enter commands, which are brief and case-sensitive combinations of one or more letters. If you need to repeat one of them a certain number of times, you can prefix it with a number (there are only a few exceptions to this rule). For example, yy (or Y, short for yank) copies the entire current line, whereas 4yy (or 4Y) copies the entire current line along with the next three lines (4 lines in total). +- In ex mode, you can manipulate files (including saving a current file and running outside programs or commands). To enter ex mode, we must type a colon (:) starting from command mode (or in other words, Esc + :), directly followed by the name of the ex-mode command that you want to use. +- In insert mode, which is accessed by typing the letter i, we simply enter text. Most keystrokes result in text appearing on the screen. +- We can always enter command mode (regardless of the mode we’re working on) by pressing the Esc key. + +Let’s see how we can perform the same operations that we outlined for nano in the previous section, but now with vim. Don’t forget to hit the Enter key to confirm the vim command! + +To access vim’s full manual from the command line, type :help while in command mode and then press Enter: + +![vim Edito Help Menu](http://www.tecmint.com/wp-content/uploads/2015/03/vim-Help-Menu.png) + +vim Edito Help Menu + +The upper section presents an index list of contents, with defined sections dedicated to specific topics about vim. To navigate to a section, place the cursor over it and press Ctrl + ] (closing square bracket). Note that the bottom section displays the current file. + +1. To save changes made to a file, run any of the following commands from command mode and it will do the trick: + + :wq! + :x! + ZZ (yes, double Z without the colon at the beginning) + +2. To exit discarding changes, use :q!. This command will also allow you to exit the help menu described above, and return to the current file in command mode. + +3. Cut N number of lines: type Ndd while in command mode. + +4. Copy M number of lines: type Myy while in command mode. + +5. Paste lines that were previously cutted or copied: press the P key while in command mode. + +6. To insert the contents of another file into the current one: + + :r filename + +For example, to insert the contents of `/etc/fstab`, do: + +![Insert Content of File in vi Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-Content-vi-Editor.png) + +Insert Content of File in vi Editor + +7. To insert the output of a command into the current document: + + :r! command + +For example, to insert the date and time in the line below the current position of the cursor: + +![Insert Time an Date in vi Editor](http://www.tecmint.com/wp-content/uploads/2015/03/Insert-Time-and-Date-in-vi-Editor.png) + +Insert Time an Date in vi Editor + +In another article that I wrote for, ([Part 2 of the LFCS series][1]), I explained in greater detail the keyboard shortcuts and functions available in vim. You may want to refer to that tutorial for further examples on how to use this powerful text editor. + +### Analyzing Text with Grep and Regular Expressions ### + +By now you have learned how to create and edit files using nano or vim. Say you become a text editor ninja, so to speak – now what? Among other things, you will also need how to search for regular expressions inside text. + +A regular expression (also known as “regex” or “regexp“) is a way of identifying a text string or pattern so that a program can compare the pattern against arbitrary text strings. Although the use of regular expressions along with grep would deserve an entire article on its own, let us review the basics here: + +**1. The simplest regular expression is an alphanumeric string (i.e., the word “svm”) or two (when two are present, you can use the | (OR) operator):** + + # grep -Ei 'svm|vmx' /proc/cpuinfo + +The presence of either of those two strings indicate that your processor supports virtualization: + +![Regular Expression Example](http://www.tecmint.com/wp-content/uploads/2015/03/Regular-Expression-Example.png) + +Regular Expression Example + +**2. A second kind of a regular expression is a range list, enclosed between square brackets.** + +For example, `c[aeiou]t` matches the strings cat, cet, cit, cot, and cut, whereas `[a-z]` and `[0-9]` match any lowercase letter or decimal digit, respectively. If you want to repeat the regular expression X certain number of times, type `{X}` immediately following the regexp. + +For example, let’s extract the UUIDs of storage devices from `/etc/fstab`: + + # grep -Ei '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}' -o /etc/fstab + +![Extract String from a File in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Extract-String-from-a-File.png) + +Extract String from a File + +The first expression in brackets `[0-9a-f]` is used to denote lowercase hexadecimal characters, and `{8}` is a quantifier that indicates the number of times that the preceding match should be repeated (the first sequence of characters in an UUID is a 8-character long hexadecimal string). + +The parentheses, the `{4}` quantifier, and the hyphen indicate that the next sequence is a 4-character long hexadecimal string, and the quantifier that follows `({3})` denote that the expression should be repeated 3 times. + +Finally, the last sequence of 12-character long hexadecimal string in the UUID is retrieved with `[0-9a-f]{12}`, and the -o option prints only the matched (non-empty) parts of the matching line in /etc/fstab. + +**3. POSIX character classes.** + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Character ClassMatches…
 [[:alnum:]] Any alphanumeric [a-zA-Z0-9] character
 [[:alpha:]] Any alphabetic [a-zA-Z] character
 [[:blank:]] Spaces or tabs
 [[:cntrl:]] Any control characters (ASCII 0 to 32)
 [[:digit:]] Any numeric digits [0-9]
 [[:graph:]] Any visible characters
 [[:lower:]] Any lowercase [a-z] character
 [[:print:]] Any non-control characters
 [[:space:]] Any whitespace
 [[:punct:]] Any punctuation marks
 [[:upper:]] Any uppercase [A-Z] character
 [[:xdigit:]] Any hex digits [0-9a-fA-F]
 [:word:] Any letters, numbers, and underscores [a-zA-Z0-9_]
+ +For example, we may be interested in finding out what the used UIDs and GIDs (refer to [Part 2][2] of this series to refresh your memory) are for real users that have been added to our system. Thus, we will search for sequences of 4 digits in /etc/passwd: + + # grep -Ei [[:digit:]]{4} /etc/passwd + +![Search For a String in File](http://www.tecmint.com/wp-content/uploads/2015/03/Search-For-String-in-File.png) + +Search For a String in File + +The above example may not be the best case of use of regular expressions in the real world, but it clearly illustrates how to use POSIX character classes to analyze text along with grep. + +### Conclusion ### + +In this article we have provided some tips to make the most of nano and vim, two text editors for the command-line users. Both tools are supported by extensive documentation, which you can consult in their respective official web sites (links given below) and using the suggestions given in [Part 1][3] of this series. + +#### Reference Links #### + +- [http://www.nano-editor.org/][4] +- [http://www.vim.org/][5] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-how-to-use-nano-vi-editors/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/vi-editor-usage/ +[2]:http://www.tecmint.com/file-and-directory-management-in-linux/ +[3]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ +[4]:http://www.nano-editor.org/ +[5]:http://www.vim.org/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md b/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md new file mode 100644 index 0000000000..2befb7bc55 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 05--Process Management in RHEL 7--Boot Shutdown and Everything in Between.md @@ -0,0 +1,216 @@ +RHCSA Series: Process Management in RHEL 7: Boot, Shutdown, and Everything in Between – Part 5 +================================================================================ +We will start this article with an overall and brief revision of what happens since the moment you press the Power button to turn on your RHEL 7 server until you are presented with the login screen in a command line interface. + +![RHEL 7 Boot Process](http://www.tecmint.com/wp-content/uploads/2015/03/RHEL-7-Boot-Process.png) + +Linux Boot Process + +**Please note that:** + +1. the same basic principles apply, with perhaps minor modifications, to other Linux distributions as well, and +2. the following description is not intended to represent an exhaustive explanation of the boot process, but only the fundamentals. + +### Linux Boot Process ### + +1. The POST (Power On Self Test) initializes and performs hardware checks. + +2. When the POST finishes, the system control is passed to the first stage boot loader, which is stored on either the boot sector of one of the hard disks (for older systems using BIOS and MBR), or a dedicated (U)EFI partition. + +3. The first stage boot loader then loads the second stage boot loader, most usually GRUB (GRand Unified Boot Loader), which resides inside /boot, which in turn loads the kernel and the initial RAM–based file system (also known as initramfs, which contains programs and binary files that perform the necessary actions needed to ultimately mount the actual root filesystem). + +4. We are presented with a splash screen that allows us to choose an operating system and kernel to boot: + +![RHEL 7 Boot Screen](http://www.tecmint.com/wp-content/uploads/2015/03/RHEL-7-Boot-Screen.png) + +Boot Menu Screen + +5. The kernel sets up the hardware attached to the system and once the root filesystem has been mounted, launches process with PID 1, which in turn will initialize other processes and present us with a login prompt. + +Note: That if we wish to do so at a later time, we can examine the specifics of this process using the [dmesg command][1] and filtering its output using the tools that we have explained in previous articles of this series. + +![Login Screen and Process PID](http://www.tecmint.com/wp-content/uploads/2015/03/Login-Screen-Process-PID.png) + +Login Screen and Process PID + +In the example above, we used the well-known ps command to display a list of current processes whose parent process (or in other words, the process that started them) is systemd (the system and service manager that most modern Linux distributions have switched to) during system startup: + + # ps -o ppid,pid,uname,comm --ppid=1 + +Remember that the -o flag (short for –format) allows you to present the output of ps in a customized format to suit your needs using the keywords specified in the STANDARD FORMAT SPECIFIERS section in man ps. + +Another case in which you will want to define the output of ps instead of going with the default is when you need to find processes that are causing a significant CPU and / or memory load, and sort them accordingly: + + # ps aux --sort=+pcpu # Sort by %CPU (ascending) + # ps aux --sort=-pcpu # Sort by %CPU (descending) + # ps aux --sort=+pmem # Sort by %MEM (ascending) + # ps aux --sort=-pmem # Sort by %MEM (descending) + # ps aux --sort=+pcpu,-pmem # Combine sort by %CPU (ascending) and %MEM (descending) + +![http://www.tecmint.com/wp-content/uploads/2015/03/ps-command-output.png](http://www.tecmint.com/wp-content/uploads/2015/03/ps-command-output.png) + +Customize ps Command Output + +### An Introduction to SystemD ### + +Few decisions in the Linux world have caused more controversies than the adoption of systemd by major Linux distributions. Systemd’s advocates name as its main advantages the following facts: + +Read Also: [The Story Behind ‘init’ and ‘systemd’][2] + +1. Systemd allows more processing to be done in parallel during system startup (as opposed to older SysVinit, which always tends to be slower because it starts processes one by one, checks if one depends on another, and then waits for daemons to launch so more services can start), and + +2. It works as a dynamic resource management in a running system. Thus, services are started when needed (to avoid consuming system resources if they are not being used) instead of being launched without a valid reason during boot. + +3. Backwards compatibility with SysVinit scripts. + +Systemd is controlled by the systemctl utility. If you come from a SysVinit background, chances are you will be familiar with: + +- the service tool, which -in those older systems- was used to manage SysVinit scripts, and +- the chkconfig utility, which served the purpose of updating and querying runlevel information for system services. +- shutdown, which you must have used several times to either restart or halt a running system. + +The following table shows the similarities between the use of these legacy tools and systemctl: + +注:表格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Legacy toolSystemctl equivalentDescription
service name startsystemctl start nameStart name (where name is a service)
service name stopsystemctl stop nameStop name
service name condrestartsystemctl try-restart nameRestarts name (if it’s already running)
service name restartsystemctl restart nameRestarts name
service name reloadsystemctl reload nameReloads the configuration for name
service name statussystemctl status nameDisplays the current status of name
service –status-allsystemctlDisplays the status of all current services
chkconfig name onsystemctl enable nameEnable name to run on startup as specified in the unit file (the file to which the symlink points). The process of enabling or disabling a service to start automatically on boot consists in adding or removing symbolic links inside the /etc/systemd/system directory.
chkconfig name offsystemctl disable nameDisables name to run on startup as specified in the unit file (the file to which the symlink points)
chkconfig –list namesystemctl is-enabled nameVerify whether name (a specific service) is currently enabled
chkconfig –listsystemctl –type=serviceDisplays all services and tells whether they are enabled or disabled
shutdown -h nowsystemctl poweroffPower-off the machine (halt)
shutdown -r nowsystemctl rebootReboot the system
+ +Systemd also introduced the concepts of units (which can be either a service, a mount point, a device, or a network socket) and targets (which is how systemd manages to start several related process at the same time, and can be considered -though not equal- as the equivalent of runlevels in SysVinit-based systems. + +### Summing Up ### + +Other tasks related with process management include, but may not be limited to, the ability to: + +**1. Adjust the execution priority as far as the use of system resources is concerned of a process:** + +This is accomplished through the renice utility, which alters the scheduling priority of one or more running processes. In simple terms, the scheduling priority is a feature that allows the kernel (present in versions => 2.6) to allocate system resources as per the assigned execution priority (aka niceness, in a range from -20 through 19) of a given process. + +The basic syntax of renice is as follows: + + # renice [-n] priority [-gpu] identifier + +In the generic command above, the first argument is the priority value to be used, whereas the other argument can be interpreted as process IDs (which is the default setting), process group IDs, user IDs, or user names. A normal user (other than root) can only modify the scheduling priority of a process he or she owns, and only increase the niceness level (which means taking up less system resources). + +![Renice Process in Linux](http://www.tecmint.com/wp-content/uploads/2015/03/Process-Scheduling-Priority.png) + +Process Scheduling Priority + +**2. Kill (or interrupt the normal execution) of a process as needed:** + +In more precise terms, killing a process entitles sending it a signal to either finish its execution gracefully (SIGTERM=15) or immediately (SIGKILL=9) through the [kill or pkill commands][3]. + +The difference between these two tools is that the former is used to terminate a specific process or a process group altogether, while the latter allows you to do the same based on name and other attributes. + +In addition, pkill comes bundled with pgrep, which shows you the PIDs that will be affected should pkill be used. For example, before running: + + # pkill -u gacanepa + +It may be useful to view at a glance which are the PIDs owned by gacanepa: + + # pgrep -l -u gacanepa + +![Find PIDs of User](http://www.tecmint.com/wp-content/uploads/2015/03/Find-PIDs-of-User.png) + +Find PIDs of User + +By default, both kill and pkill send the SIGTERM signal to the process. As we mentioned above, this signal can be ignored (while the process finishes its execution or for good), so when you seriously need to stop a running process with a valid reason, you will need to specify the SIGKILL signal on the command line: + + # kill -9 identifier # Kill a process or a process group + # kill -s SIGNAL identifier # Idem + # pkill -s SIGNAL identifier # Kill a process by name or other attributes + +### Conclusion ### + +In this article we have explained the basics of the boot process in a RHEL 7 system, and analyzed some of the tools that are available to help you with managing processes using common utilities and systemd-specific commands. + +Note that this list is not intended to cover all the bells and whistles of this topic, so feel free to add your own preferred tools and commands to this article using the comment form below. Questions and other comments are also welcome. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-boot-process-and-process-management/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/dmesg-commands/ +[2]:http://www.tecmint.com/systemd-replaces-init-in-linux/ +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md b/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md new file mode 100644 index 0000000000..474b707d23 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 06--Using 'Parted' and 'SSM' to Configure and Encrypt System Storage.md @@ -0,0 +1,269 @@ +RHCSA Series: Using ‘Parted’ and ‘SSM’ to Configure and Encrypt System Storage – Part 6 +================================================================================ +In this article we will discuss how to set up and configure local system storage in Red Hat Enterprise Linux 7 using classic tools and introducing the System Storage Manager (also known as SSM), which greatly simplifies this task. + +![Configure and Encrypt System Storage](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-and-Encrypt-System-Storage.png) + +RHCSA: Configure and Encrypt System Storage – Part 6 + +Please note that we will present this topic in this article but will continue its description and usage on the next one (Part 7) due to vastness of the subject. + +### Creating and Modifying Partitions in RHEL 7 ### + +In RHEL 7, parted is the default utility to work with partitions, and will allow you to: + +- Display the current partition table +- Manipulate (increase or decrease the size of) existing partitions +- Create partitions using free space or additional physical storage devices + +It is recommended that before attempting the creation of a new partition or the modification of an existing one, you should ensure that none of the partitions on the device are in use (`umount /dev/partition`), and if you’re using part of the device as swap you need to disable it (`swapoff -v /dev/partition`) during the process. + +The easiest way to do this is to boot RHEL in rescue mode using an installation media such as a RHEL 7 installation DVD or USB (Troubleshooting → Rescue a Red Hat Enterprise Linux system) and Select Skip when you’re prompted to choose an option to mount the existing Linux installation, and you will be presented with a command prompt where you can start typing the same commands as shown as follows during the creation of an ordinary partition in a physical device that is not being used. + +![RHEL 7 Rescue Mode](http://www.tecmint.com/wp-content/uploads/2015/04/RHEL-7-Rescue-Mode.png) + +RHEL 7 Rescue Mode + +To start parted, simply type. + + # parted /dev/sdb + +Where `/dev/sdb` is the device where you will create the new partition; next, type print to display the current drive’s partition table: + +![Creat New Partition](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Partition.png) + +Creat New Partition + +As you can see, in this example we are using a virtual drive of 5 GB. We will now proceed to create a 4 GB primary partition and then format it with the xfs filesystem, which is the default in RHEL 7. + +You can choose from a variety of file systems. You will need to manually create the partition with mkpart and then format it with mkfs.fstype as usual because mkpart does not support many modern filesystems out-of-the-box. + +In the following example we will set a label for the device and then create a primary partition `(p)` on `/dev/sdb`, which starts at the 0% percentage of the device and ends at 4000 MB (4 GB): + +![Set Partition Name in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Label-Partition.png) + +Label Partition Name + +Next, we will format the partition as xfs and print the partition table again to verify that changes were applied: + + # mkfs.xfs /dev/sdb1 + # parted /dev/sdb print + +![Format Partition in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Format-Partition-in-Linux.png) + +Format Partition as XFS Filesystem + +For older filesystems, you could use the resize command in parted to resize a partition. Unfortunately, this only applies to ext2, fat16, fat32, hfs, linux-swap, and reiserfs (if libreiserfs is installed). + +Thus, the only way to resize a partition is by deleting it and creating it again (so make sure you have a good backup of your data!). No wonder the default partitioning scheme in RHEL 7 is based on LVM. + +To remove a partition with parted: + + # parted /dev/sdb print + # parted /dev/sdb rm 1 + +![Remove Partition in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-Partition-in-Linux.png) + +Remove or Delete Partition + +### The Logical Volume Manager (LVM) ### + +Once a disk has been partitioned, it can be difficult or risky to change the partition sizes. For that reason, if we plan on resizing the partitions on our system, we should consider the possibility of using LVM instead of the classic partitioning system, where several physical devices can form a volume group that will host a defined number of logical volumes, which can be expanded or reduced without any hassle. + +In simple terms, you may find the following diagram useful to remember the basic architecture of LVM. + +![Basic Architecture of LVM](http://www.tecmint.com/wp-content/uploads/2015/04/LVM-Diagram.png) + +Basic Architecture of LVM + +#### Creating Physical Volumes, Volume Group and Logical Volumes #### + +Follow these steps in order to set up LVM using classic volume management tools. Since you can expand this topic reading the [LVM series on this site][1], I will only outline the basic steps to set up LVM, and then compare them to implementing the same functionality with SSM. + +**Note**: That we will use the whole disks `/dev/sdb` and `/dev/sdc` as PVs (Physical Volumes) but it’s entirely up to you if you want to do the same. + +**1. Create partitions `/dev/sdb1` and `/dev/sdc1` using 100% of the available disk space in /dev/sdb and /dev/sdc:** + + # parted /dev/sdb print + # parted /dev/sdc print + +![Create New Partitions](http://www.tecmint.com/wp-content/uploads/2015/04/Create-New-Partitions.png) + +Create New Partitions + +**2. Create 2 physical volumes on top of /dev/sdb1 and /dev/sdc1, respectively.** + + # pvcreate /dev/sdb1 + # pvcreate /dev/sdc1 + +![Create Two Physical Volumes](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Physical-Volumes.png) + +Create Two Physical Volumes + +Remember that you can use pvdisplay /dev/sd{b,c}1 to show information about the newly created PVs. + +**3. Create a VG on top of the PV that you created in the previous step:** + + # vgcreate tecmint_vg /dev/sd{b,c}1 + +![Create Volume Group in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Volume-Group.png) + +Create Volume Group + +Remember that you can use vgdisplay tecmint_vg to show information about the newly created VG. + +**4. Create three logical volumes on top of VG tecmint_vg, as follows:** + + # lvcreate -L 3G -n vol01_docs tecmint_vg [vol01_docs → 3 GB] + # lvcreate -L 1G -n vol02_logs tecmint_vg [vol02_logs → 1 GB] + # lvcreate -l 100%FREE -n vol03_homes tecmint_vg [vol03_homes → 6 GB] + +![Create Logical Volumes in LVM](http://www.tecmint.com/wp-content/uploads/2015/04/Create-Logical-Volumes.png) + +Create Logical Volumes + +Remember that you can use lvdisplay tecmint_vg to show information about the newly created LVs on top of VG tecmint_vg. + +**5. Format each of the logical volumes with xfs (do NOT use xfs if you’re planning on shrinking volumes later!):** + + # mkfs.xfs /dev/tecmint_vg/vol01_docs + # mkfs.xfs /dev/tecmint_vg/vol02_logs + # mkfs.xfs /dev/tecmint_vg/vol03_homes + +**6. Finally, mount them:** + + # mount /dev/tecmint_vg/vol01_docs /mnt/docs + # mount /dev/tecmint_vg/vol02_logs /mnt/logs + # mount /dev/tecmint_vg/vol03_homes /mnt/homes + +#### Removing Logical Volumes, Volume Group and Physical Volumes #### + +**7. Now we will reverse the LVM implementation and remove the LVs, the VG, and the PVs:** + + # lvremove /dev/tecmint_vg/vol01_docs + # lvremove /dev/tecmint_vg/vol02_logs + # lvremove /dev/tecmint_vg/vol03_homes + # vgremove /dev/tecmint_vg + # pvremove /dev/sd{b,c}1 + +**8. Now let’s install SSM and we will see how to perform the above in ONLY 1 STEP!** + + # yum update && yum install system-storage-manager + +We will use the same names and sizes as before: + + # ssm create -s 3G -n vol01_docs -p tecmint_vg --fstype ext4 /mnt/docs /dev/sd{b,c}1 + # ssm create -s 1G -n vol02_logs -p tecmint_vg --fstype ext4 /mnt/logs /dev/sd{b,c}1 + # ssm create -n vol03_homes -p tecmint_vg --fstype ext4 /mnt/homes /dev/sd{b,c}1 + +Yes! SSM will let you: + +- initialize block devices as physical volumes +- create a volume group +- create logical volumes +- format LVs, and +- mount them using only one command + +**9. We can now display the information about PVs, VGs, or LVs, respectively, as follows:** + + # ssm list dev + # ssm list pool + # ssm list vol + +![Check Information of PVs, VGs, or LVs](http://www.tecmint.com/wp-content/uploads/2015/04/Display-LVM-Information.png) + +Check Information of PVs, VGs, or LVs + +**10. As we already know, one of the distinguishing features of LVM is the possibility to resize (expand or decrease) logical volumes without downtime.** + +Say we are running out of space in vol02_logs but have plenty of space in vol03_homes. We will resize vol03_homes to 4 GB and expand vol02_logs to use the remaining space: + + # ssm resize -s 4G /dev/tecmint_vg/vol03_homes + +Run ssm list pool again and take note of the free space in tecmint_vg: + +![Check Volume Size](http://www.tecmint.com/wp-content/uploads/2015/04/Check-LVM-Free-Space.png) + +Check Volume Size + +Then do: + + # ssm resize -s+1.99 /dev/tecmint_vg/vol02_logs + +**Note**: that the plus sign after the -s flag indicates that the specified value should be added to the present value. + +**11. Removing logical volumes and volume groups is much easier with ssm as well. A simple,** + + # ssm remove tecmint_vg + +will return a prompt asking you to confirm the deletion of the VG and the LVs it contains: + +![Remove Logical Volume and Volume Group](http://www.tecmint.com/wp-content/uploads/2015/04/Remove-LV-VG.png) + +Remove Logical Volume and Volume Group + +### Managing Encrypted Volumes ### + +SSM also provides system administrators with the capability of managing encryption for new or existing volumes. You will need the cryptsetup package installed first: + + # yum update && yum install cryptsetup + +Then issue the following command to create an encrypted volume. You will be prompted to enter a passphrase to maximize security: + + # ssm create -s 3G -n vol01_docs -p tecmint_vg --fstype ext4 --encrypt luks /mnt/docs /dev/sd{b,c}1 + # ssm create -s 1G -n vol02_logs -p tecmint_vg --fstype ext4 --encrypt luks /mnt/logs /dev/sd{b,c}1 + # ssm create -n vol03_homes -p tecmint_vg --fstype ext4 --encrypt luks /mnt/homes /dev/sd{b,c}1 + +Our next task consists in adding the corresponding entries in /etc/fstab in order for those logical volumes to be available on boot. Rather than using the device identifier (/dev/something). + +We will use each LV’s UUID (so that our devices will still be uniquely identified should we add other logical volumes or devices), which we can find out with the blkid utility: + + # blkid -o value UUID /dev/tecmint_vg/vol01_docs + # blkid -o value UUID /dev/tecmint_vg/vol02_logs + # blkid -o value UUID /dev/tecmint_vg/vol03_homes + +In our case: + +![Find Logical Volume UUID](http://www.tecmint.com/wp-content/uploads/2015/04/Logical-Volume-UUID.png) + +Find Logical Volume UUID + +Next, create the /etc/crypttab file with the following contents (change the UUIDs for the ones that apply to your setup): + + docs UUID=ba77d113-f849-4ddf-8048-13860399fca8 none + logs UUID=58f89c5a-f694-4443-83d6-2e83878e30e4 none + homes UUID=92245af6-3f38-4e07-8dd8-787f4690d7ac none + +And insert the following entries in /etc/fstab. Note that device_name (/dev/mapper/device_name) is the mapper identifier that appears in the first column of /etc/crypttab. + + # Logical volume vol01_docs: + /dev/mapper/docs /mnt/docs ext4 defaults 0 2 + # Logical volume vol02_logs + /dev/mapper/logs /mnt/logs ext4 defaults 0 2 + # Logical volume vol03_homes + /dev/mapper/homes /mnt/homes ext4 defaults 0 2 + +Now reboot (systemctl reboot) and you will be prompted to enter the passphrase for each LV. Afterwards you can confirm that the mount operation was successful by checking the corresponding mount points: + +![Verify Logical Volume Mount Points](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-LV-Mount-Points.png) + +Verify Logical Volume Mount Points + +### Conclusion ### + +In this tutorial we have started to explore how to set up and configure system storage using classic volume management tools and SSM, which also integrates filesystem and encryption capabilities in one package. This makes SSM an invaluable tool for any sysadmin. + +Let us know if you have any questions or comments – feel free to use the form below to get in touch with us! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-create-format-resize-delete-and-encrypt-partitions-in-linux/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/create-lvm-storage-in-linux/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md b/sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md new file mode 100644 index 0000000000..d4801d9923 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 07--Using ACLs (Access Control Lists) and Mounting Samba or NFS Shares.md @@ -0,0 +1,212 @@ +RHCSA Series: Using ACLs (Access Control Lists) and Mounting Samba / NFS Shares – Part 7 +================================================================================ +In the last article ([RHCSA series Part 6][1]) we started explaining how to set up and configure local system storage using parted and ssm. + +![Configure ACL's and Mounting NFS / Samba Shares](http://www.tecmint.com/wp-content/uploads/2015/04/Configure-ACLs-and-Mounting-NFS-Samba-Shares.png) + +RHCSA Series:: Configure ACL’s and Mounting NFS / Samba Shares – Part 7 + +We also discussed how to create and mount encrypted volumes with a password during system boot. In addition, we warned you to avoid performing critical storage management operations on mounted filesystems. With that in mind we will now review the most used file system formats in Red Hat Enterprise Linux 7 and then proceed to cover the topics of mounting, using, and unmounting both manually and automatically network filesystems (CIFS and NFS), along with the implementation of access control lists for your system. + +#### Prerequisites #### + +Before proceeding further, please make sure you have a Samba server and a NFS server available (note that NFSv2 is no longer supported in RHEL 7). + +During this guide we will use a machine with IP 192.168.0.10 with both services running in it as server, and a RHEL 7 box as client with IP address 192.168.0.18. Later in the article we will tell you which packages you need to install on the client. + +### File System Formats in RHEL 7 ### + +Beginning with RHEL 7, XFS has been introduced as the default file system for all architectures due to its high performance and scalability. It currently supports a maximum filesystem size of 500 TB as per the latest tests performed by Red Hat and its partners for mainstream hardware. + +Also, XFS enables user_xattr (extended user attributes) and acl (POSIX access control lists) as default mount options, unlike ext3 or ext4 (ext2 is considered deprecated as of RHEL 7), which means that you don’t need to specify those options explicitly either on the command line or in /etc/fstab when mounting a XFS filesystem (if you want to disable such options in this last case, you have to explicitly use no_acl and no_user_xattr). + +Keep in mind that the extended user attributes can be assigned to files and directories for storing arbitrary additional information such as the mime type, character set or encoding of a file, whereas the access permissions for user attributes are defined by the regular file permission bits. + +#### Access Control Lists #### + +As every system administrator, either beginner or expert, is well acquainted with regular access permissions on files and directories, which specify certain privileges (read, write, and execute) for the owner, the group, and “the world” (all others). However, feel free to refer to [Part 3 of the RHCSA series][2] if you need to refresh your memory a little bit. + +However, since the standard ugo/rwx set does not allow to configure different permissions for different users, ACLs were introduced in order to define more detailed access rights for files and directories than those specified by regular permissions. + +In fact, ACL-defined permissions are a superset of the permissions specified by the file permission bits. Let’s see how all of this translates is applied in the real world. + +1. There are two types of ACLs: access ACLs, which can be applied to either a specific file or a directory), and default ACLs, which can only be applied to a directory. If files contained therein do not have a ACL set, they inherit the default ACL of their parent directory. + +2. To begin, ACLs can be configured per user, per group, or per an user not in the owning group of a file. + +3. ACLs are set (and removed) using setfacl, with either the -m or -x options, respectively. + +For example, let us create a group named tecmint and add users johndoe and davenull to it: + + # groupadd tecmint + # useradd johndoe + # useradd davenull + # usermod -a -G tecmint johndoe + # usermod -a -G tecmint davenull + +And let’s verify that both users belong to supplementary group tecmint: + + # id johndoe + # id davenull + +![Verify Users](http://www.tecmint.com/wp-content/uploads/2015/04/Verify-Users.png) + +Verify Users + +Let’s now create a directory called playground within /mnt, and a file named testfile.txt inside. We will set the group owner to tecmint and change its default ugo/rwx permissions to 770 (read, write, and execute permissions granted to both the owner and the group owner of the file): + + # mkdir /mnt/playground + # touch /mnt/playground/testfile.txt + # chmod 770 /mnt/playground/testfile.txt + +Then switch user to johndoe and davenull, in that order, and write to the file: + + echo "My name is John Doe" > /mnt/playground/testfile.txt + echo "My name is Dave Null" >> /mnt/playground/testfile.txt + +So far so good. Now let’s have user gacanepa write to the file – and the write operation will, which was to be expected. + +But what if we actually need user gacanepa (who is not a member of group tecmint) to have write permissions on /mnt/playground/testfile.txt? The first thing that may come to your mind is adding that user account to group tecmint. But that will give him write permissions on ALL files were the write bit is set for the group, and we don’t want that. We only want him to be able to write to /mnt/playground/testfile.txt. + + # touch /mnt/playground/testfile.txt + # chown :tecmint /mnt/playground/testfile.txt + # chmod 777 /mnt/playground/testfile.txt + # su johndoe + $ echo "My name is John Doe" > /mnt/playground/testfile.txt + $ su davenull + $ echo "My name is Dave Null" >> /mnt/playground/testfile.txt + $ su gacanepa + $ echo "My name is Gabriel Canepa" >> /mnt/playground/testfile.txt + +![Manage User Permissions](http://www.tecmint.com/wp-content/uploads/2015/04/User-Permissions.png) + +Manage User Permissions + +Let’s give user gacanepa read and write access to /mnt/playground/testfile.txt. + +Run as root, + + # setfacl -R -m u:gacanepa:rwx /mnt/playground + +and you’ll have successfully added an ACL that allows gacanepa to write to the test file. Then switch to user gacanepa and try to write to the file again: + + $ echo "My name is Gabriel Canepa" >> /mnt/playground/testfile.txt + +To view the ACLs for a specific file or directory, use getfacl: + + # getfacl /mnt/playground/testfile.txt + +![Check ACLs of Files](http://www.tecmint.com/wp-content/uploads/2015/04/Check-ACL-of-File.png) + +Check ACLs of Files + +To set a default ACL to a directory (which its contents will inherit unless overwritten otherwise), add d: before the rule and specify a directory instead of a file name: + + # setfacl -m d:o:r /mnt/playground + +The ACL above will allow users not in the owner group to have read access to the future contents of the /mnt/playground directory. Note the difference in the output of getfacl /mnt/playground before and after the change: + +![Set Default ACL in Linux](http://www.tecmint.com/wp-content/uploads/2015/04/Set-Default-ACL-in-Linux.png) + +Set Default ACL in Linux + +[Chapter 20 in the official RHEL 7 Storage Administration Guide][3] provides more ACL examples, and I highly recommend you take a look at it and have it handy as reference. + +#### Mounting NFS Network Shares #### + +To show the list of NFS shares available in your server, you can use the showmount command with the -e option, followed by the machine name or its IP address. This tool is included in the nfs-utils package: + + # yum update && yum install nfs-utils + +Then do: + + # showmount -e 192.168.0.10 + +and you will get a list of the available NFS shares on 192.168.0.10: + +![Check Available NFS Shares](http://www.tecmint.com/wp-content/uploads/2015/04/Mount-NFS-Shares.png) + +Check Available NFS Shares + +To mount NFS network shares on the local client using the command line on demand, use the following syntax: + + # mount -t nfs -o [options] remote_host:/remote/directory /local/directory + +which, in our case, translates to: + + # mount -t nfs 192.168.0.10:/NFS-SHARE /mnt/nfs + +If you get the following error message: “Job for rpc-statd.service failed. See “systemctl status rpc-statd.service” and “journalctl -xn” for details.”, make sure the rpcbind service is enabled and started in your system first: + + # systemctl enable rpcbind.socket + # systemctl restart rpcbind.service + +and then reboot. That should do the trick and you will be able to mount your NFS share as explained earlier. If you need to mount the NFS share automatically on system boot, add a valid entry to the /etc/fstab file: + + remote_host:/remote/directory /local/directory nfs options 0 0 + +The variables remote_host, /remote/directory, /local/directory, and options (which is optional) are the same ones used when manually mounting an NFS share from the command line. As per our previous example: + + 192.168.0.10:/NFS-SHARE /mnt/nfs nfs defaults 0 0 + +#### Mounting CIFS (Samba) Network Shares #### + +Samba represents the tool of choice to make a network share available in a network with *nix and Windows machines. To show the Samba shares that are available, use the smbclient command with the -L flag, followed by the machine name or its IP address. This tool is included in the samba-client package: + +You will be prompted for root’s password in the remote host: + + # smbclient -L 192.168.0.10 + +![Check Samba Shares](http://www.tecmint.com/wp-content/uploads/2015/04/Check-Samba-Shares.png) + +Check Samba Shares + +To mount Samba network shares on the local client you will need to install first the cifs-utils package: + + # yum update && yum install cifs-utils + +Then use the following syntax on the command line: + + # mount -t cifs -o credentials=/path/to/credentials/file //remote_host/samba_share /local/directory + +which, in our case, translates to: + + # mount -t cifs -o credentials=~/.smbcredentials //192.168.0.10/gacanepa /mnt/samba + +where smbcredentials: + + username=gacanepa + password=XXXXXX + +is a hidden file inside root’s home (/root/) with permissions set to 600, so that no one else but the owner of the file can read or write to it. + +Please note that the samba_share is the name of the Samba share as returned by smbclient -L remote_host as shown above. + +Now, if you need the Samba share to be available automatically on system boot, add a valid entry to the /etc/fstab file as follows: + + //remote_host:/samba_share /local/directory cifs options 0 0 + +The variables remote_host, /samba_share, /local/directory, and options (which is optional) are the same ones used when manually mounting a Samba share from the command line. Following the definitions given in our previous example: + + //192.168.0.10/gacanepa /mnt/samba cifs credentials=/root/smbcredentials,defaults 0 0 + +### Conclusion ### + +In this article we have explained how to set up ACLs in Linux, and discussed how to mount CIFS and NFS network shares in a RHEL 7 client. + +I recommend you to practice these concepts and even mix them (go ahead and try to set ACLs in mounted network shares) until you feel comfortable. If you have questions or comments feel free to use the form below to contact us anytime. Also, feel free to share this article through your social networks. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/rhcsa-exam-create-format-resize-delete-and-encrypt-partitions-in-linux/ +[2]:http://www.tecmint.com/rhcsa-exam-manage-users-and-groups/ +[3]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/ch-acls.html \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md b/sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md new file mode 100644 index 0000000000..a381b1c94a --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 08--Securing SSH, Setting Hostname and Enabling Network Services.md @@ -0,0 +1,215 @@ +RHCSA Series: Securing SSH, Setting Hostname and Enabling Network Services – Part 8 +================================================================================ +As a system administrator you will often have to log on to remote systems to perform a variety of administration tasks using a terminal emulator. You will rarely sit in front of a real (physical) terminal, so you need to set up a way to log on remotely to the machines that you will be asked to manage. + +In fact, that may be the last thing that you will have to do in front of a physical terminal. For security reasons, using Telnet for this purpose is not a good idea, as all traffic goes through the wire in unencrypted, plain text. + +In addition, in this article we will also review how to configure network services to start automatically at boot and learn how to set up network and hostname resolution statically or dynamically. + +![RHCSA: Secure SSH and Enable Network Services](http://www.tecmint.com/wp-content/uploads/2015/05/Secure-SSH-Server-and-Enable-Network-Services.png) + +RHCSA: Secure SSH and Enable Network Services – Part 8 + +### Installing and Securing SSH Communication ### + +For you to be able to log on remotely to a RHEL 7 box using SSH, you will have to install the openssh, openssh-clients and openssh-servers packages. The following command not only will install the remote login program, but also the secure file transfer tool, as well as the remote file copy utility: + + # yum update && yum install openssh openssh-clients openssh-servers + +Note that it’s a good idea to install the server counterparts as you may want to use the same machine as both client and server at some point or another. + +After installation, there is a couple of basic things that you need to take into account if you want to secure remote access to your SSH server. The following settings should be present in the `/etc/ssh/sshd_config` file. + +1. Change the port where the sshd daemon will listen on from 22 (the default value) to a high port (2000 or greater), but first make sure the chosen port is not being used. + +For example, let’s suppose you choose port 2500. Use [netstat][1] in order to check whether the chosen port is being used or not: + + # netstat -npltu | grep 2500 + +If netstat does not return anything, you can safely use port 2500 for sshd, and you should change the Port setting in the configuration file as follows: + + Port 2500 + +2. Only allow protocol 2: + +Protocol 2 + +3. Configure the authentication timeout to 2 minutes, do not allow root logins, and restrict to a minimum the list of users which are allowed to login via ssh: + + LoginGraceTime 2m + PermitRootLogin no + AllowUsers gacanepa + +4. If possible, use key-based instead of password authentication: + + PasswordAuthentication no + RSAAuthentication yes + PubkeyAuthentication yes + +This assumes that you have already created a key pair with your user name on your client machine and copied it to your server as explained here. + +- [Enable SSH Passwordless Login][2] + +### Configuring Networking and Name Resolution ### + +1. Every system administrator should be well acquainted with the following system-wide configuration files: + +- /etc/hosts is used to resolve names <---> IPs in small networks. + +Every line in the `/etc/hosts` file has the following structure: + + IP address - Hostname - FQDN + +For example, + + 192.168.0.10 laptop laptop.gabrielcanepa.com.ar + +2. `/etc/resolv.conf` specifies the IP addresses of DNS servers and the search domain, which is used for completing a given query name to a fully qualified domain name when no domain suffix is supplied. + +Under normal circumstances, you don’t need to edit this file as it is managed by the system. However, should you want to change DNS servers, be advised that you need to stick to the following structure in each line: + + nameserver - IP address + +For example, + + nameserver 8.8.8.8 + +3. 3. `/etc/host.conf` specifies the methods and the order by which hostnames are resolved within a network. In other words, tells the name resolver which services to use, and in what order. + +Although this file has several options, the most common and basic setup includes a line as follows: + + order bind,hosts + +Which indicates that the resolver should first look in the nameservers specified in `resolv.conf` and then to the `/etc/hosts` file for name resolution. + +4. `/etc/sysconfig/network` contains routing and global host information for all network interfaces. The following values may be used: + + NETWORKING=yes|no + HOSTNAME=value + +Where value should be the Fully Qualified Domain Name (FQDN). + + GATEWAY=XXX.XXX.XXX.XXX + +Where XXX.XXX.XXX.XXX is the IP address of the network’s gateway. + + GATEWAYDEV=value + +In a machine with multiple NICs, value is the gateway device, such as enp0s3. + +5. Files inside `/etc/sysconfig/network-scripts` (network adapters configuration files). + +Inside the directory mentioned previously, you will find several plain text files named. + + ifcfg-name + +Where name is the name of the NIC as returned by ip link show: + +![Check Network Link Status](http://www.tecmint.com/wp-content/uploads/2015/05/Check-IP-Address.png) + +Check Network Link Status + +For example: + +![Network Files](http://www.tecmint.com/wp-content/uploads/2015/05/Network-Files.png) + +Network Files + +Other than for the loopback interface, you can expect a similar configuration for your NICs. Note that some variables, if set, will override those present in `/etc/sysconfig/network` for this particular interface. Each line is commented for clarification in this article but in the actual file you should avoid comments: + + HWADDR=08:00:27:4E:59:37 # The MAC address of the NIC + TYPE=Ethernet # Type of connection + BOOTPROTO=static # This indicates that this NIC has been assigned a static IP. If this variable was set to dhcp, the NIC will be assigned an IP address by a DHCP server and thus the next two lines should not be present in that case. + IPADDR=192.168.0.18 + NETMASK=255.255.255.0 + GATEWAY=192.168.0.1 + NM_CONTROLLED=no # Should be added to the Ethernet interface to prevent NetworkManager from changing the file. + NAME=enp0s3 + UUID=14033805-98ef-4049-bc7b-d4bea76ed2eb + ONBOOT=yes # The operating system should bring up this NIC during boot + +### Setting Hostnames ### + +In Red Hat Enterprise Linux 7, the hostnamectl command is used to both query and set the system’s hostname. + +To display the current hostname, type: + + # hostnamectl status + +![Check System hostname in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/05/Check-System-hostname.png) + +Check System Hostname + +To change the hostname, use + + # hostnamectl set-hostname [new hostname] + +For example, + + # hostnamectl set-hostname cinderella + +For the changes to take effect you will need to restart the hostnamed daemon (that way you will not have to log off and on again in order to apply the change): + + # systemctl restart systemd-hostnamed + +![Set System Hostname in CentOS 7](http://www.tecmint.com/wp-content/uploads/2015/05/Set-System-Hostname.png) + +Set System Hostname + +In addition, RHEL 7 also includes the nmcli utility that can be used for the same purpose. To display the hostname, run: + + # nmcli general hostname + +and to change it: + + # nmcli general hostname [new hostname] + +For example, + + # nmcli general hostname rhel7 + +![Set Hostname Using nmcli Command](http://www.tecmint.com/wp-content/uploads/2015/05/nmcli-command.png) + +Set Hostname Using nmcli Command + +### Starting Network Services on Boot ### + +To wrap up, let us see how we can ensure that network services are started automatically on boot. In simple terms, this is done by creating symlinks to certain files specified in the [Install] section of the service configuration files. + +In the case of firewalld (/usr/lib/systemd/system/firewalld.service): + + [Install] + WantedBy=basic.target + Alias=dbus-org.fedoraproject.FirewallD1.service + +To enable the service: + + # systemctl enable firewalld + +On the other hand, disabling firewalld entitles removing the symlinks: + + # systemctl disable firewalld + +![Enable Service at System Boot](http://www.tecmint.com/wp-content/uploads/2015/05/Enable-Service-at-System-Boot.png) + +Enable Service at System Boot + +### Conclusion ### + +In this article we have summarized how to install and secure connections via SSH to a RHEL server, how to change its name, and finally how to ensure that network services are started on boot. If you notice that a certain service has failed to start properly, you can use systemctl status -l [service] and journalctl -xn to troubleshoot it. + +Feel free to let us know what you think about this article using the comment form below. Questions are also welcome. We look forward to hearing from you! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-series-secure-ssh-set-hostname-enable-network-services-in-rhel-7/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/20-netstat-commands-for-linux-network-management/ +[2]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 09--Installing, Configuring and Securing a Web and FTP Server.md b/sources/tech/RHCSA Series/RHCSA Series--Part 09--Installing, Configuring and Securing a Web and FTP Server.md new file mode 100644 index 0000000000..6a1e544de3 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 09--Installing, Configuring and Securing a Web and FTP Server.md @@ -0,0 +1,176 @@ +RHCSA Series: Installing, Configuring and Securing a Web and FTP Server – Part 9 +================================================================================ +A web server (also known as a HTTP server) is a service that handles content (most commonly web pages, but other types of documents as well) over to a client in a network. + +A FTP server is one of the oldest and most commonly used resources (even to this day) to make files available to clients on a network in cases where no authentication is necessary since FTP uses username and password without encryption. + +The web server available in RHEL 7 is version 2.4 of the Apache HTTP Server. As for the FTP server, we will use the Very Secure Ftp Daemon (aka vsftpd) to establish connections secured by TLS. + +![Configuring and Securing Apache and FTP Server](http://www.tecmint.com/wp-content/uploads/2015/05/Install-Configure-Secure-Apache-FTP-Server.png) + +RHCSA: Installing, Configuring and Securing Apache and FTP – Part 9 + +In this article we will explain how to install, configure, and secure a web server and a FTP server in RHEL 7. + +### Installing Apache and FTP Server ### + +In this guide we will use a RHEL 7 server with a static IP address of 192.168.0.18/24. To install Apache and VSFTPD, run the following command: + + # yum update && yum install httpd vsftpd + +When the installation completes, both services will be disabled initially, so we need to start them manually for the time being and enable them to start automatically beginning with the next boot: + + # systemctl start httpd + # systemctl enable httpd + # systemctl start vsftpd + # systemctl enable vsftpd + +In addition, we have to open ports 80 and 21, where the web and ftp daemons are listening, respectively, in order to allow access to those services from the outside: + + # firewall-cmd --zone=public --add-port=80/tcp --permanent + # firewall-cmd --zone=public --add-service=ftp --permanent + # firewall-cmd --reload + +To confirm that the web server is working properly, fire up your browser and enter the IP of the server. You should see the test page: + +![Confirm Apache Web Server](http://www.tecmint.com/wp-content/uploads/2015/05/Confirm-Apache-Web-Server.png) + +Confirm Apache Web Server + +As for the ftp server, we will have to configure it further, which we will do in a minute, before confirming that it’s working as expected. + +### Configuring and Securing Apache Web Server ### + +The main configuration file for Apache is located in `/etc/httpd/conf/httpd.conf`, but it may rely on other files present inside `/etc/httpd/conf.d`. + +Although the default configuration should be sufficient for most cases, it’s a good idea to become familiar with all the available options as described in the [official documentation][1]. + +As always, make a backup copy of the main configuration file before editing it: + + # cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.$(date +%Y%m%d) + +Then open it with your preferred text editor and look for the following variables: + +- ServerRoot: the directory where the server’s configuration, error, and log files are kept. +- Listen: instructs Apache to listen on specific IP address and / or ports. +- Include: allows the inclusion of other configuration files, which must exist. Otherwise, the server will fail, as opposed to the IncludeOptional directive, which is silently ignored if the specified configuration files do not exist. +- User and Group: the name of the user/group to run the httpd service as. +- DocumentRoot: The directory out of which Apache will serve your documents. By default, all requests are taken from this directory, but symbolic links and aliases may be used to point to other locations. +- ServerName: this directive sets the hostname (or IP address) and port that the server uses to identify itself. + +The first security measure will consist of creating a dedicated user and group (i.e. tecmint/tecmint) to run the web server as and changing the default port to a higher one (9000 in this case): + + ServerRoot "/etc/httpd" + Listen 192.168.0.18:9000 + User tecmint + Group tecmint + DocumentRoot "/var/www/html" + ServerName 192.168.0.18:9000 + +You can test the configuration file with. + + # apachectl configtest + +and if everything is OK, then restart the web server. + + # systemctl restart httpd + +and don’t forget to enable the new port (and disable the old one) in the firewall: + + # firewall-cmd --zone=public --remove-port=80/tcp --permanent + # firewall-cmd --zone=public --add-port=9000/tcp --permanent + # firewall-cmd --reload + +Note that, due to SELinux policies, you can only use the ports returned by + + # semanage port -l | grep -w '^http_port_t' + +for the web server. + +If you want to use another port (i.e. TCP port 8100), you will have to add it to SELinux port context for the httpd service: + +# semanage port -a -t http_port_t -p tcp 8100 + +![Add Apache Port to SELinux Policies](http://www.tecmint.com/wp-content/uploads/2015/05/Add-Apache-Port-to-SELinux-Policies.png) + +Add Apache Port to SELinux Policies + +To further secure your Apache installation, follow these steps: + +1. The user Apache is running as should not have access to a shell: + + # usermod -s /sbin/nologin tecmint + +2. Disable directory listing in order to prevent the browser from displaying the contents of a directory if there is no index.html present in that directory. + +Edit `/etc/httpd/conf/httpd.conf` (and the configuration files for virtual hosts, if any) and make sure that the Options directive, both at the top and at Directory block levels, is set to None: + + Options None + +3. Hide information about the web server and the operating system in HTTP responses. Edit /etc/httpd/conf/httpd.conf as follows: + + ServerTokens Prod + ServerSignature Off + +Now you are ready to start serving content from your /var/www/html directory. + +### Configuring and Securing FTP Server ### + +As in the case of Apache, the main configuration file for Vsftpd `(/etc/vsftpd/vsftpd.conf)` is well commented and while the default configuration should suffice for most applications, you should become acquainted with the documentation and the man page `(man vsftpd.conf)` in order to operate the ftp server more efficiently (I can’t emphasize that enough!). + +In our case, these are the directives used: + + anonymous_enable=NO + local_enable=YES + write_enable=YES + local_umask=022 + dirmessage_enable=YES + xferlog_enable=YES + connect_from_port_20=YES + xferlog_std_format=YES + chroot_local_user=YES + allow_writeable_chroot=YES + listen=NO + listen_ipv6=YES + pam_service_name=vsftpd + userlist_enable=YES + tcp_wrappers=YES + +By using `chroot_local_user=YES`, local users will be (by default) placed in a chroot’ed jail in their home directory right after login. This means that local users will not be able to access any files outside their corresponding home directories. + +Finally, to allow ftp to read files in the user’s home directory, set the following SELinux boolean: + + # setsebool -P ftp_home_dir on + +You can now connect to the ftp server using a client such as Filezilla: + +![Check FTP Connection](http://www.tecmint.com/wp-content/uploads/2015/05/Check-FTP-Connection.png) + +Check FTP Connection + +Note that the `/var/log/xferlo`g log records downloads and uploads, which concur with the above directory listing: + +![Monitor FTP Download and Upload](http://www.tecmint.com/wp-content/uploads/2015/05/Monitor-FTP-Download-Upload.png) + +Monitor FTP Download and Upload + +Read Also: [Limit FTP Network Bandwidth Used by Applications in a Linux System with Trickle][2] + +### Summary ### + +In this tutorial we have explained how to set up a web and a ftp server. Due to the vastness of the subject, it is not possible to cover all the aspects of these topics (i.e. virtual web hosts). Thus, I recommend you also check other excellent articles in this website about [Apache][3]. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/rhcsa-series-install-and-secure-apache-web-server-and-ftp-in-rhel/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://httpd.apache.org/docs/2.4/ +[2]:http://www.tecmint.com/manage-and-limit-downloadupload-bandwidth-with-trickle-in-linux/ +[3]:http://www.google.com/cse?cx=partner-pub-2601749019656699:2173448976&ie=UTF-8&q=virtual+hosts&sa=Search&gws_rd=cr&ei=Dy9EVbb0IdHisASnroG4Bw#gsc.tab=0&gsc.q=apache \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 10--Yum Package Management, Automating Tasks with Cron and Monitoring System Logs.md b/sources/tech/RHCSA Series/RHCSA Series--Part 10--Yum Package Management, Automating Tasks with Cron and Monitoring System Logs.md new file mode 100644 index 0000000000..04c7d7a29e --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 10--Yum Package Management, Automating Tasks with Cron and Monitoring System Logs.md @@ -0,0 +1,197 @@ +RHCSA Series: Yum Package Management, Automating Tasks with Cron and Monitoring System Logs – Part 10 +================================================================================ +In this article we will review how to install, update, and remove packages in Red Hat Enterprise Linux 7. We will also cover how to automate tasks using cron, and will finish this guide explaining how to locate and interpret system logs files with the focus of teaching you why all of these are essential skills for every system administrator. + +![Yum Package Management Cron Jobs Log Monitoring Linux](http://www.tecmint.com/wp-content/uploads/2015/05/Yum-Package-Management-Cron-Job-Log-Monitoring-Linux.jpg) + +RHCSA: Yum Package Management, Cron Job Scheduling and Log Monitoring – Part 10 + +### Managing Packages Via Yum ### + +To install a package along with all its dependencies that are not already installed, you will use: + + # yum -y install package_name(s) + +Where package_name(s) represent at least one real package name. + +For example, to install httpd and mlocate (in that order), type. + + # yum -y install httpd mlocate + +**Note**: That the letter y in the example above bypasses the confirmation prompts that yum presents before performing the actual download and installation of the requested programs. You can leave it out if you want. + +By default, yum will install the package with the architecture that matches the OS architecture, unless overridden by appending the package architecture to its name. + +For example, on a 64 bit system, yum install package will install the x86_64 version of package, whereas yum install package.x86 (if available) will install the 32-bit one. + +There will be times when you want to install a package but don’t know its exact name. The search all or search options can search the currently enabled repositories for a certain keyword in the package name and/or in its description as well, respectively. + +For example, + + # yum search log + +will search the installed repositories for packages with the word log in their names and summaries, whereas + + # yum search all log + +will look for the same keyword in the package description and url fields as well. + +Once the search returns a package listing, you may want to display further information about some of them before installing. That is when the info option will come in handy: + + # yum info logwatch + +![Search Package Information](http://www.tecmint.com/wp-content/uploads/2015/05/Search-Package-Information.png) + +Search Package Information + +You can regularly check for updates with the following command: + + # yum check-update + +The above command will return all the installed packages for which an update is available. In the example shown in the image below, only rhel-7-server-rpms has an update available: + +![Check For Package Updates](http://www.tecmint.com/wp-content/uploads/2015/05/Check-For-Updates.png) + +Check For Package Updates + +You can then update that package alone with, + + # yum update rhel-7-server-rpms + +If there are several packages that can be updated, yum update will update all of them at once. + +Now what happens when you know the name of an executable, such as ps2pdf, but don’t know which package provides it? You can find out with `yum whatprovides “*/[executable]”`: + + # yum whatprovides “*/ps2pdf” + +![Find Package Belongs to Which Package](http://www.tecmint.com/wp-content/uploads/2015/05/Find-Package-Information.png) + +Find Package Belongs to Which Package + +Now, when it comes to removing a package, you can do so with yum remove package. Easy, huh? This goes to show that yum is a complete and powerful package manager. + + # yum remove httpd + +Read Also: [20 Yum Commands to Manage RHEL 7 Package Management][1] + +### Good Old Plain RPM ### + +RPM (aka RPM Package Manager, or originally RedHat Package Manager) can also be used to install or update packages when they come in form of standalone `.rpm` packages. + +It is often utilized with the `-Uvh` flags to indicate that it should install the package if it’s not already present or attempt to update it if it’s installed `(-U)`, producing a verbose output `(-v)` and a progress bar with hash marks `(-h)` while the operation is being performed. For example, + + # rpm -Uvh package.rpm + +Another typical use of rpm is to produce a list of currently installed packages with code>rpm -qa (short for query all): + + # rpm -qa + +![Query All RPM Packages](http://www.tecmint.com/wp-content/uploads/2015/05/Query-All-RPM-Packages.png) + +Query All RPM Packages + +Read Also: [20 RPM Commands to Install Packages in RHEL 7][2] + +### Scheduling Tasks using Cron ### + +Linux and other Unix-like operating systems include a tool called cron that allows you to schedule tasks (i.e. commands or shell scripts) to run on a periodic basis. Cron checks every minute the /var/spool/cron directory for files which are named after accounts in /etc/passwd. + +When executing commands, any output is mailed to the owner of the crontab (or to the user specified in the MAILTO environment variable in the /etc/crontab, if it exists). + +Crontab files (which are created by typing crontab -e and pressing Enter) have the following format: + +![Crontab Entries](http://www.tecmint.com/wp-content/uploads/2015/05/Crontab-Format.png) + +Crontab Entries + +Thus, if we want to update the local file database (which is used by locate to find files by name or pattern) every second day of the month at 2:15 am, we need to add the following crontab entry: + + 15 02 2 * * /bin/updatedb + +The above crontab entry reads, “Run /bin/updatedb on the second day of the month, every month of the year, regardless of the day of the week, at 2:15 am”. As I’m sure you already guessed, the star symbol is used as a wildcard character. + +After adding a cron job, you can see that a file named root was added inside /var/spool/cron, as we mentioned earlier. That file lists all the tasks that the crond daemon should run: + + # ls -l /var/spool/cron + +![Check All Cron Jobs](http://www.tecmint.com/wp-content/uploads/2015/05/Check-All-Cron-Jobs.png) + +Check All Cron Jobs + +In the above image, the current user’s crontab can be displayed either using cat /var/spool/cron/root or, + + # crontab -l + +If you need to run a task on a more fine-grained basis (for example, twice a day or three times each month), cron can also help you to do that. + +For example, to run /my/script on the 1st and 15th of each month and send any output to /dev/null, you can add two crontab entries as follows: + + 01 00 1 * * /myscript > /dev/null 2>&1 + 01 00 15 * * /my/script > /dev/null 2>&1 + +But in order for the task to be easier to maintain, you can combine both entries into one: + + 01 00 1,15 * * /my/script > /dev/null 2>&1 + +Following the previous example, we can run /my/other/script at 1:30 am on the first day of the month every three months: + + 30 01 1 1,4,7,10 * /my/other/script > /dev/null 2>&1 + +But when you have to repeat a certain task every “x” minutes, hours, days, or months, you can divide the right position by the desired frequency. The following crontab entry has the exact same meaning as the previous one: + + 30 01 1 */3 * /my/other/script > /dev/null 2>&1 + +Or perhaps you need to run a certain job on a fixed frequency or after the system boots, for example. You can use one of the following string instead of the five fields to indicate the exact time when you want your job to run: + + @reboot Run when the system boots. + @yearly Run once a year, same as 00 00 1 1 *. + @monthly Run once a month, same as 00 00 1 * *. + @weekly Run once a week, same as 00 00 * * 0. + @daily Run once a day, same as 00 00 * * *. + @hourly Run once an hour, same as 00 * * * *. + +Read Also: [11 Commands to Schedule Cron Jobs in RHEL 7][3] + +### Locating and Checking Logs ### + +System logs are located (and rotated) inside the /var/log directory. According to the Linux Filesystem Hierarchy Standard, this directory contains miscellaneous log files, which are written to it or an appropriate subdirectory (such as audit, httpd, or samba in the image below) by the corresponding daemons during system operation: + + # ls /var/log + +![Linux Log Files Location](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-Log-Files.png) + +Linux Log Files Location + +Other interesting logs are [dmesg][4] (contains all messages from kernel ring buffer), secure (logs connection attempts that require user authentication), messages (system-wide messages) and wtmp (records of all user logins and logouts). + +Logs are very important in that they allow you to have a glimpse of what is going on at all times in your system, and what has happened in the past. They represent a priceless tool to troubleshoot and monitor a Linux server, and thus are often used with the `tail -f command` to display events, in real time, as they happen and are recorded in a log. + +For example, if you want to display kernel-related events, type the following command: + + # tail -f /var/log/dmesg + +Same if you want to view access to your web server: + + # tail -f /var/log/httpd/access.log + +### Summary ### + +If you know how to efficiently manage packages, schedule tasks, and where to look for information about the current and past operation of your system you can rest assure that you will not run into surprises very often. I hope this article has helped you learn or refresh your knowledge about these basic skills. + +Don’t hesitate to drop us a line using the contact form below if you have any questions or comments. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/yum-package-management-cron-job-scheduling-monitoring-linux-logs/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/20-practical-examples-of-rpm-commands-in-linux/ +[3]:http://www.tecmint.com/11-cron-scheduling-task-examples-in-linux/ +[4]:http://www.tecmint.com/dmesg-commands/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 11--Firewall Essentials and Network Traffic Control Using FirewallD and Iptables.md b/sources/tech/RHCSA Series/RHCSA Series--Part 11--Firewall Essentials and Network Traffic Control Using FirewallD and Iptables.md new file mode 100644 index 0000000000..fd27f4c6fc --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 11--Firewall Essentials and Network Traffic Control Using FirewallD and Iptables.md @@ -0,0 +1,191 @@ +RHCSA Series: Firewall Essentials and Network Traffic Control Using FirewallD and Iptables – Part 11 +================================================================================ +In simple words, a firewall is a security system that controls the incoming and outgoing traffic in a network based on a set of predefined rules (such as the packet destination / source or type of traffic, for example). + +![Control Network Traffic with FirewallD and Iptables](http://www.tecmint.com/wp-content/uploads/2015/05/Control-Network-Traffic-Using-Firewall.png) + +RHCSA: Control Network Traffic with FirewallD and Iptables – Part 11 + +In this article we will review the basics of firewalld, the default dynamic firewall daemon in Red Hat Enterprise Linux 7, and iptables service, the legacy firewall service for Linux, with which most system and network administrators are well acquainted, and which is also available in RHEL 7. + +### A Comparison Between FirewallD and Iptables ### + +Under the hood, both firewalld and the iptables service talk to the netfilter framework in the kernel through the same interface, not surprisingly, the iptables command. However, as opposed to the iptables service, firewalld can change the settings during normal system operation without existing connections being lost. + +Firewalld should be installed by default in your RHEL system, though it may not be running. You can verify with the following commands (firewall-config is the user interface configuration tool): + + # yum info firewalld firewall-config + +![Check FirewallD Information](http://www.tecmint.com/wp-content/uploads/2015/05/Check-FirewallD-Information.png) + +Check FirewallD Information + +and, + + # systemctl status -l firewalld.service + +![Check FirewallD Status](http://www.tecmint.com/wp-content/uploads/2015/05/Check-FirewallD-Status.png) + +Check FirewallD Status + +On the other hand, the iptables service is not included by default, but can be installed through. + + # yum update && yum install iptables-services + +Both daemons can be started and enabled to start on boot with the usual systemd commands: + + # systemctl start firewalld.service | iptables-service.service + # systemctl enable firewalld.service | iptables-service.service + +Read Also: [Useful Commands to Manage Systemd Services][1] + +As for the configuration files, the iptables service uses `/etc/sysconfig/iptables` (which will not exist if the package is not installed in your system). On a RHEL 7 box used as a cluster node, this file looks as follows: + +![Iptables Firewall Configuration](http://www.tecmint.com/wp-content/uploads/2015/05/Iptables-Rules.png) + +Iptables Firewall Configuration + +Whereas firewalld store its configuration across two directories, `/usr/lib/firewalld` and `/etc/firewalld`: + + # ls /usr/lib/firewalld /etc/firewalld + +![FirewallD Configuration](http://www.tecmint.com/wp-content/uploads/2015/05/Firewalld-configuration.png) + +FirewallD Configuration + +We will examine these configuration files further later in this article, after we add a few rules here and there. By now it will suffice to remind you that you can always find more information about both tools with. + + # man firewalld.conf + # man firewall-cmd + # man iptables + +Other than that, remember to take a look at [Reviewing Essential Commands & System Documentation – Part 1][2] of the current series, where I described several sources where you can get information about the packages installed on your RHEL 7 system. + +### Using Iptables to Control Network Traffic ### + +You may want to refer to [Configure Iptables Firewall – Part 8][3] of the Linux Foundation Certified Engineer (LFCE) series to refresh your memory about iptables internals before proceeding further. Thus, we will be able to jump in right into the examples. + +**Example 1: Allowing both incoming and outgoing web traffic** + +TCP ports 80 and 443 are the default ports used by the Apache web server to handle normal (HTTP) and secure (HTTPS) web traffic. You can allow incoming and outgoing web traffic through both ports on the enp0s3 interface as follows: + + # iptables -A INPUT -i enp0s3 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT + # iptables -A OUTPUT -o enp0s3 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT + # iptables -A INPUT -i enp0s3 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT + # iptables -A OUTPUT -o enp0s3 -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT + +**Example 2: Block all (or some) incoming connections from a specific network** + +There may be times when you need to block all (or some) type of traffic originating from a specific network, say 192.168.1.0/24 for example: + + # iptables -I INPUT -s 192.168.1.0/24 -j DROP + +will drop all packages coming from the 192.168.1.0/24 network, whereas, + + # iptables -A INPUT -s 192.168.1.0/24 --dport 22 -j ACCEPT + +will only allow incoming traffic through port 22. + +**Example 3: Redirect incoming traffic to another destination** + +If you use your RHEL 7 box not only as a software firewall, but also as the actual hardware-based one, so that it sits between two distinct networks, IP forwarding must have been already enabled in your system. If not, you need to edit `/etc/sysctl.conf` and set the value of net.ipv4.ip_forward to 1, as follows: + + net.ipv4.ip_forward = 1 + +then save the change, close your text editor and finally run the following command to apply the change: + + # sysctl -p /etc/sysctl.conf + +For example, you may have a printer installed at an internal box with IP 192.168.0.10, with the CUPS service listening on port 631 (both on the print server and on your firewall). In order to forward print requests from clients on the other side of the firewall, you should add the following iptables rule: + + # iptables -t nat -A PREROUTING -i enp0s3 -p tcp --dport 631 -j DNAT --to 192.168.0.10:631 + +Please keep in mind that iptables reads its rules sequentially, so make sure the default policies or later rules do not override those outlined in the examples above. + +### Getting Started with FirewallD ### + +One of the changes introduced with firewalld are zones. This concept allows to separate networks into different zones level of trust the user has decided to place on the devices and traffic within that network. + +To list the active zones: + + # firewall-cmd --get-active-zones + +In the example below, the public zone is active, and the enp0s3 interface has been assigned to it automatically. To view all the information about a particular zone: + + # firewall-cmd --zone=public --list-all + +![List all FirewallD Zones](http://www.tecmint.com/wp-content/uploads/2015/05/View-FirewallD-Zones.png) + +List all FirewallD Zones + +Since you can read more about zones in the [RHEL 7 Security guide][4], we will only list some specific examples here. + +**Example 4: Allowing services through the firewall** + +To get a list of the supported services, use. + + # firewall-cmd --get-services + +![List All Supported Services](http://www.tecmint.com/wp-content/uploads/2015/05/List-All-Supported-Services.png) + +List All Supported Services + +To allow http and https web traffic through the firewall, effective immediately and on subsequent boots: + + # firewall-cmd --zone=MyZone --add-service=http + # firewall-cmd --zone=MyZone --permanent --add-service=http + # firewall-cmd --zone=MyZone --add-service=https + # firewall-cmd --zone=MyZone --permanent --add-service=https + # firewall-cmd --reload + +If code>–zone is omitted, the default zone (you can check with firewall-cmd –get-default-zone) is used. + +To remove the rule, replace the word add with remove in the above commands. + +**Example 5: IP / Port forwarding** + +First off, you need to find out if masquerading is enabled for the desired zone: + + # firewall-cmd --zone=MyZone --query-masquerade + +In the image below, we can see that masquerading is enabled for the external zone, but not for public: + +![Check Masquerading Status in Firewalld](http://www.tecmint.com/wp-content/uploads/2015/05/Check-masquerading.png) + +Check Masquerading Status + +You can either enable masquerading for public: + + # firewall-cmd --zone=public --add-masquerade + +or use masquerading in external. Here’s what we would do to replicate Example 3 with firewalld: + + # firewall-cmd --zone=external --add-forward-port=port=631:proto=tcp:toport=631:toaddr=192.168.0.10 + +And don’t forget to reload the firewall. + +You can find further examples on [Part 9][5] of the RHCSA series, where we explained how to allow or disable the ports that are usually used by a web server and a ftp server, and how to change the corresponding rule when the default port for those services are changed. In addition, you may want to refer to the firewalld wiki for further examples. + +Read Also: [Useful FirewallD Examples to Configure Firewall in RHEL 7][6] + +### Conclusion ### + +In this article we have explained what a firewall is, what are the available services to implement one in RHEL 7, and provided a few examples that can help you get started with this task. If you have any comments, suggestions, or questions, feel free to let us know using the form below. Thank you in advance! + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/firewalld-vs-iptables-and-control-network-traffic-in-firewall/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ +[2]:http://www.tecmint.com/rhcsa-exam-reviewing-essential-commands-system-documentation/ +[3]:http://www.tecmint.com/configure-iptables-firewall/ +[4]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html +[5]:http://www.tecmint.com/rhcsa-series-install-and-secure-apache-web-server-and-ftp-in-rhel/ +[6]:http://www.tecmint.com/firewalld-rules-for-centos-7/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 12--Automate RHEL 7 Installations Using 'Kickstart'.md b/sources/tech/RHCSA Series/RHCSA Series--Part 12--Automate RHEL 7 Installations Using 'Kickstart'.md new file mode 100644 index 0000000000..a4365e311e --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 12--Automate RHEL 7 Installations Using 'Kickstart'.md @@ -0,0 +1,142 @@ +RHCSA Series: Automate RHEL 7 Installations Using ‘Kickstart’ – Part 12 +================================================================================ +Linux servers are rarely standalone boxes. Whether it is in a datacenter or in a lab environment, chances are that you have had to install several machines that will interact one with another in some way. If you multiply the time that it takes to install Red Hat Enterprise Linux 7 manually on a single server by the number of boxes that you need to set up, this can lead to a rather lengthy effort that can be avoided through the use of an unattended installation tool known as kickstart. + +In this article we will show what you need to use kickstart utility so that you can forget about babysitting servers during the installation process. + +![Automatic Kickstart Installation of RHEL 7](http://www.tecmint.com/wp-content/uploads/2015/05/Automatic-Kickstart-Installation-of-RHEL-7.jpg) + +RHCSA: Automatic Kickstart Installation of RHEL 7 + +#### Introducing Kickstart and Automated Installations #### + +Kickstart is an automated installation method used primarily by Red Hat Enterprise Linux (and other Fedora spin-offs, such as CentOS, Oracle Linux, etc.) to execute unattended operating system installation and configuration. Thus, kickstart installations allow system administrators to have identical systems, as far as installed package groups and system configuration are concerned, while sparing them the hassle of having to manually install each of them. + +### Preparing for a Kickstart Installation ### + +To perform a kickstart installation, we need to follow these steps: + +1. Create a Kickstart file, a plain text file with several predefined configuration options. + +2. Make the Kickstart file available on removable media, a hard drive or a network location. The client will use the rhel-server-7.0-x86_64-boot.iso file, whereas you will need to make the full ISO image (rhel-server-7.0-x86_64-dvd.iso) available from a network resource, such as a HTTP of FTP server (in our present case, we will use another RHEL 7 box with IP 192.168.0.18). + +3. Start the Kickstart installation + +To create a kickstart file, login to your Red Hat Customer Portal account, and use the [Kickstart configuration tool][1] to choose the desired installation options. Read each one of them carefully before scrolling down, and choose what best fits your needs: + +![Kickstart Configuration Tool](http://www.tecmint.com/wp-content/uploads/2015/05/Kickstart-Configuration-Tool.png) + +Kickstart Configuration Tool + +If you specify that the installation should be performed either through HTTP, FTP, or NFS, make sure the firewall on the server allows those services. + +Although you can use the Red Hat online tool to create a kickstart file, you can also create it manually using the following lines as reference. You will notice, for example, that the installation process will be in English, using the latin american keyboard layout and the America/Argentina/San_Luis time zone: + + lang en_US + keyboard la-latin1 + timezone America/Argentina/San_Luis --isUtc + rootpw $1$5sOtDvRo$In4KTmX7OmcOW9HUvWtfn0 --iscrypted + #platform x86, AMD64, or Intel EM64T + text + url --url=http://192.168.0.18//kickstart/media + bootloader --location=mbr --append="rhgb quiet crashkernel=auto" + zerombr + clearpart --all --initlabel + autopart + auth --passalgo=sha512 --useshadow + selinux --enforcing + firewall --enabled + firstboot --disable + %packages + @base + @backup-server + @print-server + %end + +In the online configuration tool, use 192.168.0.18 for HTTP Server and `/kickstart/tecmint.bin` for HTTP Directory in the Installation section after selecting HTTP as installation source. Finally, click the Download button at the right top corner to download the kickstart file. + +In the kickstart sample file above, you need to pay careful attention to. + + url --url=http://192.168.0.18//kickstart/media + +That directory is where you need to extract the contents of the DVD or ISO installation media. Before doing that, we will mount the ISO installation file in /media/rhel as a loop device: + + # mount -o loop /var/www/html/kickstart/rhel-server-7.0-x86_64-dvd.iso /media/rhel + +![Mount RHEL ISO Image](http://www.tecmint.com/wp-content/uploads/2015/05/Mount-RHEL-ISO-Image.png) + +Mount RHEL ISO Image + +Next, copy all the contents of /media/rhel to /var/www/html/kickstart/media: + + # cp -R /media/rhel /var/www/html/kickstart/media + +When you’re done, the directory listing and disk usage of /var/www/html/kickstart/media should look as follows: + +![Kickstart Media Files](http://www.tecmint.com/wp-content/uploads/2015/05/Kickstart-media-Files.png) + +Kickstart Media Files + +Now we’re ready to kick off the kickstart installation. + +Regardless of how you choose to create the kickstart file, it’s always a good idea to check its syntax before proceeding with the installation. To do that, install the pykickstart package. + + # yum update && yum install pykickstart + +And then use the ksvalidator utility to check the file: + + # ksvalidator /var/www/html/kickstart/tecmint.bin + +If the syntax is correct, you will not get any output, whereas if there’s an error in the file, you will get a warning notice indicating the line where the syntax is not correct or unknown. + +### Performing a Kickstart Installation ### + +To start, boot your client using the rhel-server-7.0-x86_64-boot.iso file. When the initial screen appears, select Install Red Hat Enterprise Linux 7.0 and press the Tab key to append the following stanza and press Enter: + + # inst.ks=http://192.168.0.18/kickstart/tecmint.bin + +![RHEL Kickstart Installation](http://www.tecmint.com/wp-content/uploads/2015/05/RHEL-Kickstart-Installation.png) + +RHEL Kickstart Installation + +Where tecmint.bin is the kickstart file created earlier. + +When you press Enter, the automated installation will begin, and you will see the list of packages that are being installed (the number and the names will differ depending on your choice of programs and package groups): + +![Automatic Kickstart Installation of RHEL 7](http://www.tecmint.com/wp-content/uploads/2015/05/Kickstart-Automatic-Installation.png) + +Automatic Kickstart Installation of RHEL 7 + +When the automated process ends, you will be prompted to remove the installation media and then you will be able to boot into your newly installed system: + +![RHEL 7 Boot Screen](http://www.tecmint.com/wp-content/uploads/2015/05/RHEL-7.png) + +RHEL 7 Boot Screen + +Although you can create your kickstart files manually as we mentioned earlier, you should consider using the recommended approach whenever possible. You can either use the online configuration tool, or the anaconda-ks.cfg file that is created by the installation process in root’s home directory. + +This file actually is a kickstart file, so you may want to install the first box manually with all the desired options (maybe modify the logical volumes layout or the file system on top of each one) and then use the resulting anaconda-ks.cfg file to automate the installation of the rest. + +In addition, using the online configuration tool or the anaconda-ks.cfg file to guide future installations will allow you to perform them using an encrypted root password out-of-the-box. + +### Conclusion ### + +Now that you know how to create kickstart files and how to use them to automate the installation of Red Hat Enterprise Linux 7 servers, you can forget about babysitting the installation process. This will give you time to do other things, or perhaps some leisure time if you’re lucky. + +Either way, let us know what you think about this article using the form below. Questions are also welcome! + +Read Also: [Automated Installations of Multiple RHEL/CentOS 7 Distributions using PXE and Kickstart][2] + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/automatic-rhel-installations-using-kickstart/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:https://access.redhat.com/labs/kickstartconfig/ +[2]:http://www.tecmint.com/multiple-centos-installations-using-kickstart/ \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 13--Mandatory Access Control Essentials with SELinux in RHEL 7.md b/sources/tech/RHCSA Series/RHCSA Series--Part 13--Mandatory Access Control Essentials with SELinux in RHEL 7.md new file mode 100644 index 0000000000..1a0d08df8f --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 13--Mandatory Access Control Essentials with SELinux in RHEL 7.md @@ -0,0 +1,176 @@ +RHCSA Series: Mandatory Access Control Essentials with SELinux in RHEL 7 – Part 13 +================================================================================ +During this series we have explored in detail at least two access control methods: standard ugo/rwx permissions ([Manage Users and Groups – Part 3][1]) and access control lists ([Configure ACL’s on File Systems – Part 7][2]). + +![RHCSA Exam: SELinux Essentials and Control FileSystem Access](http://www.tecmint.com/wp-content/uploads/2015/06/SELinux-Control-File-System-Access.png) + +RHCSA Exam: SELinux Essentials and Control FileSystem Access + +Although necessary as first level permissions and access control mechanisms, they have some limitations that are addressed by Security Enhanced Linux (aka SELinux for short). + +One of such limitations is that a user can expose a file or directory to a security breach through a poorly elaborated chmod command and thus cause an unexpected propagation of access rights. As a result, any process started by that user can do as it pleases with the files owned by the user, where finally a malicious or otherwise compromised software can achieve root-level access to the entire system. + +With those limitations in mind, the United States National Security Agency (NSA) first devised SELinux, a flexible mandatory access control method, to restrict the ability of processes to access or perform other operations on system objects (such as files, directories, network ports, etc) to the least permission model, which can be modified later as needed. In few words, each element of the system is given only the access required to function. + +In RHEL 7, SELinux is incorporated into the kernel itself and is enabled in Enforcing mode by default. In this article we will explain briefly the basic concepts associated with SELinux and its operation. + +### SELinux Modes ### + +SELinux can operate in three different ways: + +- Enforcing: SELinux denies access based on SELinux policy rules, a set of guidelines that control the security engine. +- Permissive: SELinux does not deny access, but denials are logged for actions that would have been denied if running in enforcing mode. +- Disabled (self-explanatory). + +The `getenforce` command displays the current mode of SELinux, whereas `setenforce` (followed by a 1 or a 0) is used to change the mode to Enforcing or Permissive, respectively, during the current session only. + +In order to achieve persistence across logouts and reboots, you will need to edit the `/etc/selinux/config` file and set the SELINUX variable to either enforcing, permissive, or disabled: + + # getenforce + # setenforce 0 + # getenforce + # setenforce 1 + # getenforce + # cat /etc/selinux/config + +![Set SELinux Mode](http://www.tecmint.com/wp-content/uploads/2015/05/Set-SELinux-Mode.png) + +Set SELinux Mode + +Typically you will use setenforce to toggle between SELinux modes (enforcing to permissive and back) as a first troubleshooting step. If SELinux is currently set to enforcing while you’re experiencing a certain problem, and the same goes away when you set it to permissive, you can be confident you’re looking at a SELinux permissions issue. + +### SELinux Contexts ### + +A SELinux context consists of an access control environment where decisions are made based on SELinux user, role, and type (and optionally a level): + +- A SELinux user complements a regular Linux user account by mapping it to a SELinux user account, which in turn is used in the SELinux context for processes in that session, in order to explicitly define their allowed roles and levels. +- The concept of role acts as an intermediary between domains and SELinux users in that it defines which process domains and file types can be accessed. This will shield your system against vulnerability to privilege escalation attacks. +- A type defines an SELinux file type or an SELinux process domain. Under normal circumstances, processes are prevented from accessing files that other processes use, and and from accessing other processes, thus access is only allowed if a specific SELinux policy rule exists that allows it. + +Let’s see how all of that works through the following examples. + +**EXAMPLE 1: Changing the default port for the sshd daemon** + +In [Securing SSH – Part 8][3] we explained that changing the default port where sshd listens on is one of the first security measures to secure your server against external attacks. Let’s edit the `/etc/ssh/sshd_config` file and set the port to 9999: + + Port 9999 + +Save the changes, and restart sshd: + + # systemctl restart sshd + # systemctl status sshd + +![Change SSH Port](http://www.tecmint.com/wp-content/uploads/2015/05/Change-SSH-Port.png) + +Restart SSH Service + +As you can see, sshd has failed to start. But what happened? + +A quick inspection of `/var/log/audit/audit.log` indicates that sshd has been denied permissions to start on port 9999 (SELinux log messages include the word “AVC” so that they might be easily identified from other messages) because that is a reserved port for the JBoss Management service: + + # cat /var/log/audit/audit.log | grep AVC | tail -1 + +![Inspect SSH Logs](http://www.tecmint.com/wp-content/uploads/2015/05/Inspect-SSH-Logs.png) + +Inspect SSH Logs + +At this point you could disable SELinux (but don’t!) as explained earlier and try to start sshd again, and it should work. However, the semanage utility can tell us what we need to change in order for us to be able to start sshd in whatever port we choose without issues. + +Run, + + # semanage port -l | grep ssh + +to get a list of the ports where SELinux allows sshd to listen on. + +![Semanage Tool](http://www.tecmint.com/wp-content/uploads/2015/05/SELinux-Permission.png) + +Semanage Tool + +So let’s change the port in /etc/ssh/sshd_config to Port 9998, add the port to the ssh_port_t context, and then restart the service: + + # semanage port -a -t ssh_port_t -p tcp 9998 + # systemctl restart sshd + # systemctl is-active sshd + +![Semanage Add Port](http://www.tecmint.com/wp-content/uploads/2015/05/Semenage-Add-Port.png) + +Semanage Add Port + +As you can see, the service was started successfully this time. This example illustrates the fact that SELinux controls the TCP port number to its own port type internal definitions. + +**EXAMPLE 2: Allowing httpd to send access sendmail** + +This is an example of SELinux managing a process accessing another process. If you were to implement mod_security and mod_evasive along with Apache in your RHEL 7 server, you need to allow httpd to access sendmail in order to send a mail notification in the wake of a (D)DoS attack. In the following command, omit the -P flag if you do not want the change to be persistent across reboots. + + # semanage boolean -1 | grep httpd_can_sendmail + # setsebool -P httpd_can_sendmail 1 + # semanage boolean -1 | grep httpd_can_sendmail + +![Allow Apache to Send Mails](http://www.tecmint.com/wp-content/uploads/2015/05/Allow-Apache-to-Send-Mails.png) + +Allow Apache to Send Mails + +As you can tell from the above example, SELinux boolean settings (or just booleans) are true / false rules embedded into SELinux policies. You can list all the booleans with `semanage boolean -l`, and alternatively pipe it to grep in order to filter the output. + +**EXAMPLE 3: Serving a static site from a directory other than the default one** + +Suppose you are serving a static website using a different directory than the default one (`/var/www/html`), say /websites (this could be the case if you’re storing your web files in a shared network drive, for example, and need to mount it at /websites). + +a). Create an index.html file inside /websites with the following contents: + + +

SELinux test

+ + +If you do, + + # ls -lZ /websites/index.html + +you will see that the index.html file has been labeled with the default_t SELinux type, which Apache can’t access: + +![Check SELinux File Permission](http://www.tecmint.com/wp-content/uploads/2015/05/Check-File-Permssion.png) + +Check SELinux File Permission + +b). Change the DocumentRoot directive in `/etc/httpd/conf/httpd.conf` to /websites and don’t forget to update the corresponding Directory block. Then, restart Apache. + +c). Browse to `http://`, and you should get a 503 Forbidden HTTP response. + +d). Next, change the label of /websites, recursively, to the httpd_sys_content_t type in order to grant Apache read-only access to that directory and its contents: + + # semanage fcontext -a -t httpd_sys_content_t "/websites(/.*)?" + +e). Finally, apply the SELinux policy created in d): + + # restorecon -R -v /websites + +Now restart Apache and browse to `http://` again and you will see the html file displayed correctly: + +![Verify Apache Page](http://www.tecmint.com/wp-content/uploads/2015/05/08part13.png) + +Verify Apache Page + +### Summary ### + +In this article we have gone through the basics of SELinux. Note that due to the vastness of the subject, a full detailed explanation is not possible in a single article, but we believe that the principles outlined in this guide will help you to move on to more advanced topics should you wish to do so. + +If I may, let me recommend two essential resources to start with: the [NSA SELinux page][4] and the [RHEL 7 SELinux User’s and Administrator’s][5] guide. + +Don’t hesitate to let us know if you have any questions or comments. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/selinux-essentials-and-control-filesystem-access/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/rhcsa-exam-manage-users-and-groups +[2]:http://www.tecmint.com/rhcsa-exam-configure-acls-and-mount-nfs-samba-shares/ +[3]:http://www.tecmint.com/rhcsa-series-secure-ssh-set-hostname-enable-network-services-in-rhel-7/ +[4]:https://www.nsa.gov/research/selinux/index.shtml +[5]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/SELinux_Users_and_Administrators_Guide/part_I-SELinux.html \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 14--Setting Up LDAP-based Authentication in RHEL 7.md b/sources/tech/RHCSA Series/RHCSA Series--Part 14--Setting Up LDAP-based Authentication in RHEL 7.md new file mode 100644 index 0000000000..36bf319b19 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 14--Setting Up LDAP-based Authentication in RHEL 7.md @@ -0,0 +1,275 @@ +RHCSA Series: Setting Up LDAP-based Authentication in RHEL 7 – Part 14 +================================================================================ +We will begin this article by outlining some LDAP basics (what it is, where it is used and why) and show how to set up a LDAP server and configure a client to authenticate against it using Red Hat Enterprise Linux 7 systems. + +![Setup LDAP Server and Client Authentication](http://www.tecmint.com/wp-content/uploads/2015/06/setup-ldap-server-and-configure-client-authentication.png) + +RHCSA Series: Setup LDAP Server and Client Authentication – Part 14 + +As we will see, there are several other possible application scenarios, but in this guide we will focus entirely on LDAP-based authentication. In addition, please keep in mind that due to the vastness of the subject, we will only cover its basics here, but you can refer to the documentation outlined in the summary for more in-depth details. + +For the same reason, you will note that I have decided to leave out several references to man pages of LDAP tools for the sake of brevity, but the corresponding explanations are at a fingertip’s distance (man ldapadd, for example). + +That said, let’s get started. + +**Our Testing Environment** + +Our test environment consists of two RHEL 7 boxes: + + Server: 192.168.0.18. FQDN: rhel7.mydomain.com + Client: 192.168.0.20. FQDN: ldapclient.mydomain.com + +If you want, you can use the machine installed in [Part 12: Automate RHEL 7 installations][1] using Kickstart as client. + +#### What is LDAP? #### + +LDAP stands for Lightweight Directory Access Protocol and consists in a set of protocols that allows a client to access, over a network, centrally stored information (such as a directory of login shells, absolute paths to home directories, and other typical system user information, for example) that should be accessible from different places or available to a large number of end users (another example would be a directory of home addresses and phone numbers of all employees in a company). + +Keeping such (and more) information centrally means it can be more easily maintained and accessed by everyone who has been granted permissions to use it. + +The following diagram offers a simplified diagram of LDAP, and is described below in greater detail: + +![LDAP Diagram](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Diagram.png) + +LDAP Diagram + +Explanation of above diagram in detail. + +- An entry in a LDAP directory represents a single unit or information and is uniquely identified by what is called a Distinguished Name. +- An attribute is a piece of information associated with an entry (for example, addresses, available contact phone numbers, and email addresses). +- Each attribute is assigned one or more values consisting in a space-separated list. A value that is unique per entry is called a Relative Distinguished Name. + +That being said, let’s proceed with the server and client installations. + +### Installing and Configuring a LDAP Server and Client ### + +In RHEL 7, LDAP is implemented by OpenLDAP. To install the server and client, use the following commands, respectively: + + # yum update && yum install openldap openldap-clients openldap-servers + # yum update && yum install openldap openldap-clients nss-pam-ldapd + +Once the installation is complete, there are some things we look at. The following steps should be performed on the server alone, unless explicitly noted: + +**1. Make sure SELinux does not get in the way by enabling the following booleans persistently, both on the server and the client:** + + # setsebool -P allow_ypbind=0 authlogin_nsswitch_use_ldap=0 + +Where allow_ypbind is required for LDAP-based authentication, and authlogin_nsswitch_use_ldap may be needed by some applications. + +**2. Enable and start the service:** + + # systemctl enable slapd.service + # systemctl start slapd.service + +Keep in mind that you can also disable, restart, or stop the service with [systemctl][2] as well: + + # systemctl disable slapd.service + # systemctl restart slapd.service + # systemctl stop slapd.service + +**3. Since the slapd service runs as the ldap user (which you can verify with ps -e -o pid,uname,comm | grep slapd), such user should own the /var/lib/ldap directory in order for the server to be able to modify entries created by administrative tools that can only be run as root (more on this in a minute).** + +Before changing the ownership of this directory recursively, copy the sample database configuration file for slapd into it: + + # cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG + # chown -R ldap:ldap /var/lib/ldap + +**4. Set up an OpenLDAP administrative user and assign a password:** + + # slappasswd + +as shown in the next image: + +![Set LDAP Admin Password](http://www.tecmint.com/wp-content/uploads/2015/06/Set-LDAP-Admin-Password.png) + +Set LDAP Admin Password + +and create an LDIF file (ldaprootpasswd.ldif) with the following contents: + + dn: olcDatabase={0}config,cn=config + changetype: modify + add: olcRootPW + olcRootPW: {SSHA}PASSWORD + +where: + +- PASSWORD is the hashed string obtained earlier. +- cn=config indicates global config options. +- olcDatabase indicates a specific database instance name and can be typically found inside /etc/openldap/slapd.d/cn=config. + +Referring to the theoretical background provided earlier, the `ldaprootpasswd.ldif` file will add an entry to the LDAP directory. In that entry, each line represents an attribute: value pair (where dn, changetype, add, and olcRootPW are the attributes and the strings to the right of each colon are their corresponding values). + +You may want to keep this in mind as we proceed further, and please note that we are using the same Common Names `(cn=)` throughout the rest of this article, where each step depends on the previous one. + +**5. Now, add the corresponding LDAP entry by specifying the URI referring to the ldap server, where only the protocol/host/port fields are allowed.** + + # ldapadd -H ldapi:/// -f ldaprootpasswd.ldif + +The output should be similar to: + +![LDAP Configuration](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Configuration.png) + +LDAP Configuration + +and import some basic LDAP definitions from the `/etc/openldap/schema` directory: + + # for def in cosine.ldif nis.ldif inetorgperson.ldif; do ldapadd -H ldapi:/// -f /etc/openldap/schema/$def; done + +![LDAP Definitions](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Definitions.png) + +LDAP Definitions + +**6. Have LDAP use your domain in its database.** + +Create another LDIF file, which we will call `ldapdomain.ldif`, with the following contents, replacing your domain (in the Domain Component dc=) and password as appropriate: + + dn: olcDatabase={1}monitor,cn=config + changetype: modify + replace: olcAccess + olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" + read by dn.base="cn=Manager,dc=mydomain,dc=com" read by * none + + dn: olcDatabase={2}hdb,cn=config + changetype: modify + replace: olcSuffix + olcSuffix: dc=mydomain,dc=com + + dn: olcDatabase={2}hdb,cn=config + changetype: modify + replace: olcRootDN + olcRootDN: cn=Manager,dc=mydomain,dc=com + + dn: olcDatabase={2}hdb,cn=config + changetype: modify + add: olcRootPW + olcRootPW: {SSHA}PASSWORD + + dn: olcDatabase={2}hdb,cn=config + changetype: modify + add: olcAccess + olcAccess: {0}to attrs=userPassword,shadowLastChange by + dn="cn=Manager,dc=mydomain,dc=com" write by anonymous auth by self write by * none + olcAccess: {1}to dn.base="" by * read + olcAccess: {2}to * by dn="cn=Manager,dc=mydomain,dc=com" write by * read + +Then load it as follows: + + # ldapmodify -H ldapi:/// -f ldapdomain.ldif + +![LDAP Domain Configuration](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Domain-Configuration.png) + +LDAP Domain Configuration + +**7. Now it’s time to add some entries to our LDAP directory. Attributes and values are separated by a colon `(:)` in the following file, which we’ll name `baseldapdomain.ldif`:** + + dn: dc=mydomain,dc=com + objectClass: top + objectClass: dcObject + objectclass: organization + o: mydomain com + dc: mydomain + + dn: cn=Manager,dc=mydomain,dc=com + objectClass: organizationalRole + cn: Manager + description: Directory Manager + + dn: ou=People,dc=mydomain,dc=com + objectClass: organizationalUnit + ou: People + + dn: ou=Group,dc=mydomain,dc=com + objectClass: organizationalUnit + ou: Group + +Add the entries to the LDAP directory: + + # ldapadd -x -D cn=Manager,dc=mydomain,dc=com -W -f baseldapdomain.ldif + +![Add LDAP Domain Attributes and Values](http://www.tecmint.com/wp-content/uploads/2015/06/Add-LDAP-Domain-Configuration.png) + +Add LDAP Domain Attributes and Values + +**8. Create a LDAP user called ldapuser (adduser ldapuser), then create the definitions for a LDAP group in `ldapgroup.ldif`.** + + # adduser ldapuser + # vi ldapgroup.ldif + +Add following content. + + dn: cn=Manager,ou=Group,dc=mydomain,dc=com + objectClass: top + objectClass: posixGroup + gidNumber: 1004 + +where gidNumber is the GID in /etc/group for ldapuser) and load it: + + # ldapadd -x -W -D "cn=Manager,dc=mydomain,dc=com" -f ldapgroup.ldif + +**9. Add a LDIF file with the definitions for user ldapuser (`ldapuser.ldif`):** + + dn: uid=ldapuser,ou=People,dc=mydomain,dc=com + objectClass: top + objectClass: account + objectClass: posixAccount + objectClass: shadowAccount + cn: ldapuser + uid: ldapuser + uidNumber: 1004 + gidNumber: 1004 + homeDirectory: /home/ldapuser + userPassword: {SSHA}fiN0YqzbDuDI0Fpqq9UudWmjZQY28S3M + loginShell: /bin/bash + gecos: ldapuser + shadowLastChange: 0 + shadowMax: 0 + shadowWarning: 0 + +and load it: + + # ldapadd -x -D cn=Manager,dc=mydomain,dc=com -W -f ldapuser.ldif + +![LDAP User Configuration](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-User-Configuration.png) + +LDAP User Configuration + +Likewise, you can delete the user entry you just created: + + # ldapdelete -x -W -D cn=Manager,dc=mydomain,dc=com "uid=ldapuser,ou=People,dc=mydomain,dc=com" + +**10. Allow communication through the firewall:** + + # firewall-cmd --add-service=ldap + +**11. Last, but not least, enable the client to authenticate using LDAP.** + +To help us in this final step, we will use the authconfig utility (an interface for configuring system authentication resources). + +Using the following command, the home directory for the requested user is created if it doesn’t exist after the authentication against the LDAP server succeeds: + + # authconfig --enableldap --enableldapauth --ldapserver=rhel7.mydomain.com --ldapbasedn="dc=mydomain,dc=com" --enablemkhomedir --update + +![LDAP Client Configuration](http://www.tecmint.com/wp-content/uploads/2015/06/LDAP-Client-Configuration.png) + +LDAP Client Configuration + +### Summary ### + +In this article we have explained how to set up basic authentication against a LDAP server. To further configure the setup described in the present guide, please refer to [Chapter 13 – LDAP Configuration][3] in the RHEL 7 System administrator’s guide, paying special attention to the security settings using TLS. + +Feel free to leave any questions you may have using the comment form below. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/setup-ldap-server-and-configure-client-authentication/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.tecmint.com/automatic-rhel-installations-using-kickstart/ +[2]:http://www.tecmint.com/manage-services-using-systemd-and-systemctl-in-linux/ +[3]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/ch-Directory_Servers.html \ No newline at end of file diff --git a/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md b/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md new file mode 100644 index 0000000000..d9e06bd876 --- /dev/null +++ b/sources/tech/RHCSA Series/RHCSA Series--Part 15--Essentials of Virtualization and Guest Administration with KVM.md @@ -0,0 +1,188 @@ +RHCSA Series: Essentials of Virtualization and Guest Administration with KVM – Part 15 +================================================================================ +If you look up the word virtualize in a dictionary, you will find that it means “to create a virtual (rather than actual) version of something”. In computing, the term virtualization refers to the possibility of running multiple operating systems simultaneously and isolated one from another, on top of the same physical (hardware) system, known in the virtualization schema as host. + +![KVM Virtualization Basics and KVM Guest Administration](http://www.tecmint.com/wp-content/uploads/2015/06/RHCSA-Part15.png) + +RHCSA Series: Essentials of Virtualization and Guest Administration with KVM – Part 15 + +Through the use of the virtual machine monitor (also known as hypervisor), virtual machines (referred to as guests) are provided virtual resources (i.e. CPU, RAM, storage, network interfaces, to name a few) from the underlying hardware. + +With that in mind, it is plain to see that one of the main advantages of virtualization is cost savings (in equipment and network infrastructure and in terms of maintenance effort) and a substantial reduction in the physical space required to accommodate all the necessary hardware. + +Since this brief how-to cannot cover all virtualization methods, I encourage you to refer to the documentation listed in the summary for further details on the subject. + +Please keep in mind that the present article is intended to be a starting point to learn the basics of virtualization in RHEL 7 using [KVM][1] (Kernel-based Virtual Machine) with command-line utilities, and not an in-depth discussion of the topic. + +### Verifying Hardware Requirements and Installing Packages ### + +In order to set up virtualization, your CPU must support it. You can verify whether your system meets the requirements with the following command: + + # grep -E 'svm|vmx' /proc/cpuinfo + +In the following screenshot we can see that the current system (with an AMD microprocessor) supports virtualization, as indicated by svm. If we had an Intel-based processor, we would see vmx instead in the results of the above command. + +![Check KVM Support](http://www.tecmint.com/wp-content/uploads/2015/06/Check-KVM-Support.png) + +Check KVM Support + +In addition, you will need to have virtualization capabilities enabled in the firmware of your host (BIOS or UEFI). + +Now install the necessary packages: + +- qemu-kvm is an open source virtualizer that provides hardware emulation for the KVM hypervisor whereas qemu-img provides a command line tool for manipulating disk images. +- libvirt includes the tools to interact with the virtualization capabilities of the operating system. +- libvirt-python contains a module that permits applications written in Python to use the interface supplied by libvirt. +- libguestfs-tools: miscellaneous system administrator command line tools for virtual machines. +- virt-install: other command-line utilities for virtual machine administration. + + # yum update && yum install qemu-kvm qemu-img libvirt libvirt-python libguestfs-tools virt-install + +Once the installation completes, make sure you start and enable the libvirtd service: + + # systemctl start libvirtd.service + # systemctl enable libvirtd.service + +By default, each virtual machine will only be able to communicate with the rest in the same physical server and with the host itself. To allow the guests to reach other machines inside our LAN and also the Internet, we need to set up a bridge interface in our host (say br0, for example) by, + +1. adding the following line to our main NIC configuration (most likely `/etc/sysconfig/network-scripts/ifcfg-enp0s3`): + + BRIDGE=br0 + +2. creating the configuration file for br0 (/etc/sysconfig/network-scripts/ifcfg-br0) with these contents (note that you may have to change the IP address, gateway address, and DNS information): + + DEVICE=br0 + TYPE=Bridge + BOOTPROTO=static + IPADDR=192.168.0.18 + NETMASK=255.255.255.0 + GATEWAY=192.168.0.1 + NM_CONTROLLED=no + DEFROUTE=yes + PEERDNS=yes + PEERROUTES=yes + IPV4_FAILURE_FATAL=no + IPV6INIT=yes + IPV6_AUTOCONF=yes + IPV6_DEFROUTE=yes + IPV6_PEERDNS=yes + IPV6_PEERROUTES=yes + IPV6_FAILURE_FATAL=no + NAME=br0 + ONBOOT=yes + DNS1=8.8.8.8 + DNS2=8.8.4.4 + +3. finally, enabling packet forwarding by making, in `/etc/sysctl.conf`, + + net.ipv4.ip_forward = 1 + +and loading the changes to the current kernel configuration: + + # sysctl -p + +Note that you may also need to tell firewalld that this kind of traffic should be allowed. Remember that you can refer to the article on that topic in this same series ([Part 11: Network Traffic Control Using FirewallD and Iptables][2]) if you need help to do that. + +### Creating VM Images ### + +By default, VM images will be created to `/var/lib/libvirt/images` and you are strongly advised to not change this unless you really need to, know what you’re doing, and want to handle SELinux settings yourself (such topic is out of the scope of this tutorial but you can refer to Part 13 of the RHCSA series: [Mandatory Access Control Essentials with SELinux][3] if you want to refresh your memory). + +This means that you need to make sure that you have allocated the necessary space in that filesystem to accommodate your virtual machines. + +The following command will create a virtual machine named `tecmint-virt01` with 1 virtual CPU, 1 GB (=1024 MB) of RAM, and 20 GB of disk space (represented by `/var/lib/libvirt/images/tecmint-virt01.img`) using the rhel-server-7.0-x86_64-dvd.iso image located inside /home/gacanepa/ISOs as installation media and the br0 as network bridge: + + # virt-install \ + --network bridge=br0 + --name tecmint-virt01 \ + --ram=1024 \ + --vcpus=1 \ + --disk path=/var/lib/libvirt/images/tecmint-virt01.img,size=20 \ + --graphics none \ + --cdrom /home/gacanepa/ISOs/rhel-server-7.0-x86_64-dvd.iso + --extra-args="console=tty0 console=ttyS0,115200" + +If the installation file was located in a HTTP server instead of an image stored in your disk, you will have to replace the –cdrom flag with –location and indicate the address of the online repository. + +As for the –graphics none option, it tells the installer to perform the installation in text-mode exclusively. You can omit that flag if you are using a GUI interface and a VNC window to access the main VM console. Finally, with –extra-args we are passing kernel boot parameters to the installer that set up a serial VM console. + +The installation should now proceed as a regular (real) server now. If not, please review the steps listed above. + +### Managing Virtual Machines ### + +These are some typical administration tasks that you, as a system administrator, will need to perform on your virtual machines. Note that all of the following commands need to be run from your host: + +**1. List all VMs:** + + # virsh list --all + +From the output of the above command you will have to note the Id for the virtual machine (although it will also return its name and current status) because you will need it for most administration tasks related to a particular VM. + +**2. Display information about a guest:** + + # virsh dominfo [VM Id] + +**3. Start, restart, or stop a guest operating system:** + + # virsh start | reboot | shutdown [VM Id] + +**4. Access a VM’s serial console if networking is not available and no X server is running on the host:** + + # virsh console [VM Id] + +**Note** that this will require that you add the serial console configuration information to the `/etc/grub.conf` file (refer to the argument passed to the –extra-args option when the VM was created). + +**5. Modify assigned memory or virtual CPUs:** + +First, shutdown the guest: + + # virsh shutdown [VM Id] + +Edit the VM configuration for RAM: + + # virsh edit [VM Id] + +Then modify + + [Memory size here without brackets] + +Restart the VM with the new settings: + + # virsh create /etc/libvirt/qemu/tecmint-virt01.xml + +Finally, change the memory dynamically: + + # virsh setmem [VM Id] [Memory size here without brackets] + +For CPU: + + # virsh edit [VM Id] + +Then modify + + [Number of CPUs here without brackets] + +For further commands and details, please refer to table 26.1 in Chapter 26 of the RHEL 5 Virtualization guide (that guide, though a bit old, includes an exhaustive list of virsh commands used for guest administration). + +### SUMMARY ### + +In this article we have covered some basic aspects of virtualization with KVM in RHEL 7, which is both a vast and a fascinating topic, and I hope it will be helpful as a starting guide for you to later explore more advanced subjects found in the official [RHEL virtualization][4] getting started and [deployment / administration guides][5]. + +In addition, you can refer to the preceding articles in [this KVM series][6] in order to clarify or expand some of the concepts explained here. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/kvm-virtualization-basics-and-guest-administration/ + +作者:[Gabriel Cánepa][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/gacanepa/ +[1]:http://www.linux-kvm.org/page/Main_Page +[2]:http://www.tecmint.com/firewalld-vs-iptables-and-control-network-traffic-in-firewall/ +[3]:http://www.tecmint.com/selinux-essentials-and-control-filesystem-access/ +[4]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Getting_Started_Guide/index.html +[5]:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_Administration_Guide/index.html +[6]:http://www.tecmint.com/install-and-configure-kvm-in-linux/ \ No newline at end of file diff --git a/translated/share/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md b/translated/share/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md deleted file mode 100644 index 5e5d0e213a..0000000000 --- a/translated/share/20150407 Top 6 Ways To Get Your iTunes Experience On Linux.md +++ /dev/null @@ -1,115 +0,0 @@ -六种在 Linux 上带来 iTunes 体验的方法 -Top 6 Ways To Get Your iTunes Experience On Linux -================================================================================ -![](http://cdn.makeuseof.com/wp-content/uploads/2015/04/itunes-linux-840x420.jpg?35dc20) - -随着你对 Linux 的熟悉(也许会成为你首要使用的操作系统),你最终会寻找能在Linux上有效管理音乐的工具。你首先想到了 iTunes,因为它是近几年最流行的音乐管理工具,但你马上会发现iTunes并没有Linux版本。而且,你会发现还有比 iTunes 更好的音乐管理工具。 -As you’re getting used to Linux (potentially as your new main operating system), you’ll eventually try to find a way to efficiently manage your music. iTunes comes to mind because it’s been the most popular way to manage music over the years, but you’ll quickly find out that iTunes isn’t available natively on Linux. Plus, better ways exist to manage your music now that it’s 2015. - -尽管如此,这并不意味着你就不能使用你喜欢的方式管理音乐。Linux 上有很多方式可以让你整理你的音乐库。以下六种,仅供参考: -However, that doesn’t automatically mean that you won’t be able to manage your music the way you want to. There’s plenty of other ways to keep tabs on your music library. Here’s six great ways to get it done. - -### 在WINE上运行iTunes ### -### iTunes via WINE ### - -尽管 iTunes 没有Linux版,你还是可以试试 [使用 WINE 运行 iTunes ][1] 或 PlayOnLinux 的。这些软件给本来只能运行于Windows下的应用程序添加了一个兼容层,这样就能让他们运行在Linux上了,但这样的方法效果十有分限。因此 [并非所有 Windows 应用程序都能使用WINE运行][2] - 但这还是一个值得尝试的方法。 -Even if iTunes isn’t available in Linux as a native application, you can still try to [get it to work under WINE][1] or PlayOnLinux. These pieces of software try to add a compatibility layer so that Windows applications work on Linux, but the results are far from perfect. Therefore, [not all Windows applications will run with WINE][2] — but it’s still worth a try. - -各个版本的iTunes结果可能给你不同的结果,但一般都遵循以下方法: -1. 安装WINE -1. 在WINE里运行iTunes安装程序 -1. 在网上搜索并解决你遇到的问题。 - -如果你在安装时遇到无法解决的问题,比如安装程序错误,或者安装好的程序运行不了,那是没办法的,WINE 就是这样 - -如果你想在 WINE 上运行 iTunes 但恰好运行不了的话,没问题。但如果你还想考虑运行一个原生的Linux的话,还有很多其他选择的。这些音乐管理软件狗能让你很方便的管理你的音乐并直接进行播放,还可以制作播放列表。 - -Each version of iTunes can give you different results, but the general process is as follows: - -1. Install WINE -1. Run the iTunes installer via WINE -1. Google and try to solve any problems you come across. - -Again, you might come across issues somewhere along the way which cannot be solved, such as the installer failing or the installed application refusing to run. That’s just how it is with WINE. - -If you really want to use iTunes and you happen to luck out with WINE, then that’s great. However, if you’d rather use a native Linux application or WINE didn’t work for you, then there are options here as well. Several “music library manager” programs are available to give you a quick oversight of your music and play it directly in the application, as well as make playlists. - -### [Amarok][3] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/amarok_main.jpg?35dc20) - -如果你使用KDE环境,我推荐 Amarok。它具有 [很多管理音乐的特性][4] 而且他还能与KDE桌面环境无缝兼容。它很有很多实用的特性如无缝兼容 Last.FM,文件跟踪,动态播放列表及个吃支持。它甚至会自动在你播放曲目时,自动下载艺术家封面。 - -If you use KDE, then I’d recommend Amarok. It has [plenty of features to manage your music][4] and tight desktop integration with KDE. It also has useful features such as Last.FM integration, file tracking, dynamic playlists, and script support. It can even pull up biographies of artists as you play their songs. - -### [Banshee][5] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/banshee_main.jpg?35dc20) - -如果你使用 GNOME 或其他任何基于 GTK 的桌面环境(他们十分常见)的话,我推荐使用使用Bansee作为 [全功能音乐库管理工具][6] 。它的功能与Amarok类似,也与Last.FM无缝兼容,支持网络广播,支持podcast,还有很多其他功能。选择 Amarok 还是 Bansee 要看你使用的桌面环境(这样才能无缝整合)。 - -If you use GNOME or any GTK-based desktop environment (they’re quite common), then I’d recommend Banshee as a [full-featured music library][6] manager. It has a very similar feature set as Amarok, including Last.FM integration, Internet radio support, podcast support, and much more. Amarok and Banshee are really among the top two choices, so which one you choose should depend on which desktop environment you’re using (for integration’s sake). - -### [Rhythmbox][7] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/rhythmbox_main.jpg?35dc20) - -Rhythmbox是一个 基于GTK的桌环境下更 [轻量级的音乐库替代品][8]。尽管如此,它也还是有一些特性的。它也支持Last.FM,同时还能无缝播放并与其他如 Nautilus, XChat,及Pidgin 等进行整合。 -Rhythmbox as a more [lightweight music library alternative][8] that is best used on GTK-based desktop environments. However, it still has quite a few features. You also get Last.FM support here, plus gapless playback and integration with various other applications such as Nautilus, XChat, and Pidgin. - -### [Clementine][9] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/clementine_main.jpg?35dc20) - -另一款叫 Clementine 的软件也值得我推荐,因为它的见面简洁、易用。它支持非常多的第三方服务例如Spotify,Digtal Imported 及Dropbox。Android系统上还有一款用作 Clementine 遥控的app。[Clementine是一个跨平台的][10] , 还支持Mac OS X 及 Windows。 -Another application called Clementine also gets my recommendation with its clean and intuitive interface. It has tons of support for third-party services such as Spotify, Digitally Imported, and Dropbox. There’s also an Android app you can use as a remote control for Clementine. [Clementine is cross-platform][10] and available for Windows and Mac OS X. - -这些程序都能很好的管理并播放你的音乐。唯一的问题是这些程序都不支持与 iOS 设备的整合, 而且目前还没有程序能做到这一点。但 iOS 经过很多改进后,已经足以不需要再连接到电脑了。 -They all are excellent at managing and playing your music. The only downside to all of these is that there is no iOS device integration, and there’s currently no modern application that can do that. However, iOS has received enough improvements that it’s virtually unnecessary to connect it to a computer anymore. - -### [Google Play Music][11] ### - -![](http://cdn.makeuseof.com/wp-content/uploads/2015/03/google_music.jpg?35dc20) - -最后,如果上面的那些程序还不能满足你的需求的花,你可以试试 Google Play Music。这个在线服务也可以用作能播放音乐的音乐库管理工具,但他还有几个额外的好处。你可以上传所有的音乐,并且在所有能上网的设备上获取这些音乐。这也意味着你不需要在电脑或者移动设备之间同步你的音乐(无论是 Android 还是 iOS 设备),因为你可以这些设备中使用Google Play Music。 如果你想要扩展你的去库,你可以订阅 All Access,但这并不是必须的。你不需要支付任何费用也可在你的曲库中储存20,000首 -Lastly, if none of those applications satisfy your needs, you can take a look at Google Play Music. This online service acts as a music library manager that can play your music, but it also has some extra benefits. You can upload all your music to it and have access on any device connected to the Internet. That also means that you won’t have to sync your music between your computer and your mobile device (no matter if Android or iOS) because you have access to Google Play Music from both. If you want to expand your library you can get the All Access subscription, but it’s not a requirement. You can use it simply as a music library completely free for up to 20,000 songs. - -#### 靠,居然没有 Spotify ?! #### -#### Wot, no Spotify?! #### - -尽管 Spotify 也是一款管理和听音乐的方法,我不推荐它的唯一原因是它事实上并不让你管理你的音乐。你不能将曲目上传到 Spotify - 只能它们给你提供的曲目。尽管它们提供了很多,但原理都不尽相同。 -The only reason why I don’t mention Spotify is that, although it’s also a great way to access and listen to music, it doesn’t really let you manage your own music. You can’t upload trakcs to Spotify — you have to listen to what they give you. Albeit they give you a lot, but it’s nonetheless a different mechanism. - -### 你还有其他选择 ### -### You Have Options ### - -以上六个软件应该可以在给你带来类似 iTunes 的功能了。这些软件主要是能让你管理和播放你的音乐库,但如果你还需要 iTunes 里的其他特性,其他Linux原生软件或许能满足这类需求。 - -With these six options, you should be able to get iTunes-like functionality on your desktop. These options focused mainly on managing and playing your music library, but if there are any other features that you need from iTunes, other Linux-native applications can take care of those needs. - -**你通常在Linux上使用哪些音乐?**在下方评论与我们分享吧! -**What music applications do you regularly use on Linux?** Let us know in the comments! - - --------------------------------------------------------------------------------- - -via: http://www.makeuseof.com/tag/top-6-ways-get-itunes-experience-linux/ - -作者:[Danny Stieben][a] -译者:[KevinSJ](https://github.com/KevinSJ) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[a]:http://www.makeuseof.com/tag/author/danny/ -[1]:http://www.makeuseof.com/tag/how-about-some-wine-with-your-linux/ -[2]:http://www.makeuseof.com/answers/does-wine-runs-all-windows-apps/ -[3]:https://amarok.kde.org/ -[4]:http://www.makeuseof.com/tag/control-music-amarok-linux/ -[5]:http://banshee.fm/ -[6]:http://www.makeuseof.com/tag/banshee-20-comprehensive-media-player-streamer-podcast-tool-linux/ -[7]:https://wiki.gnome.org/Apps/Rhythmbox -[8]:http://www.makeuseof.com/tag/play-manage-music-collection-rhythmbox-linux/ -[9]:https://www.clementine-player.org/ -[10]:http://www.makeuseof.com/tag/need-a-lightweight-music-player-without-sacrificing-features-clementine-cross-platform/ -[11]:http://music.google.com/ 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 deleted file mode 100644 index fa9ef01c54..0000000000 --- a/translated/share/20150429 What are good command line HTTP clients.md +++ /dev/null @@ -1,110 +0,0 @@ -什么是好的命令行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/ diff --git a/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md b/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md deleted file mode 100644 index ae5e6df6eb..0000000000 --- a/translated/share/20150515 This Ubuntu App Applies Instagram Style Filters to Your Photos.md +++ /dev/null @@ -1,74 +0,0 @@ -一个Ubuntu中给你的照片加Instagram风格滤镜的程序 -================================================================================ -**在Ubuntu中寻找一个给你的照片加Instagram风格的滤镜程序么?** - -拿起你的自拍棒跟着这个来。 - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/instagram-app.jpg) -XnRetro是一个照片编辑应用 - -### XnRetro 照片编辑器 ### - -**XnRetro** 是一个可以让你快速给你照片添加“类Instagram”效果的程序。 - -你知道我说的这些效果:划痕、噪点、框架、过处理、复古和怀旧色调(因为在这个数字时代,我们必须知道无尽的自拍不能称为怀旧的自己。) - -无论你认为这些效果是愚蠢的艺术价值或者创作的捷径,这些滤镜非常流行切可以帮助那些平平照片添加个性。 - - -#### XnRetro的功能 #### - -**XnRetro有下面那些功能** - -- 20色彩滤镜 -- 15中光效果(虚化、泄露等等) -- 28框架和边框 -- 5中插图 (带力度控制) -- Image adjustments for contrast, gamma, saturation, etc -- 对比度、伽马、饱和度等图像调整 -- 矩形修剪选项 - -![](http://www.omgubuntu.co.uk/wp-content/uploads/2015/05/Screen-Shot-2015-05-10-at-23.30.01-e1431297068833.png) -灯光效果调整 - -你可以(理论上)编辑。jpg或者.png文件并且直接在app中等想到社交媒体上。 - -我说“理论”上的意思是保存.jpg图像无法正常在linux版的程序上工作(你可以保存.png的图像)。相似的,大多数内置的社交链接失效或者无法导出。 - -要使用**15中光影效果**你需要在XnRetro的‘light’文件夹下重新保存.jpg文件成.png文件。编辑‘light.xml’来匹配新的文件名,点击保存那没灯光效果就可以没有问题的加载进XnRetro了。 - -> ‘用户友好的XnRetro很难打败-一旦你用顺之后。’ - -**XnRetro值得安装么?** - -XnRetro并不是完美的。它看上去很丑、很难正确的安装并且已经纪念没有更新了。 - -它还可以使用,输了保存.jpg文件外。同时也是那些像Gimp或者Shotwell的那些‘正规’图片调整工具的一个灵活替代品。 - -While web apps and Chrome Apps¹ like [Pixlr Touch Up][1] and [Polarr][2] offer similar features you may be looking for a truly native solution. -虽然web应用和Chrome Apps¹像[Pixlr Touch Up][1] 和 [Polarr][2]提供另外相似的功能,而你也许正在寻找真正原生的解决方案。 - -对于此,用户友好带有容易使用滤镜的XnRetro很难被打败。 - -### 下载Ubuntu下的XnRetro ### - -XnRetro没有可用的.deb安装包。它以二进制文件的形式发型,这意味着你需要每次双击程序来运行。它也只有32位的版本。 - -你可以使用下面的XnRetro下载链接。下载完成后你需要解压压缩包并进入。双击里面的‘xnretro’程序。 - -- [下载Linux版XnRetro (32位, tar.gz)][3] - --------------------------------------------------------------------------------- - -via: http://www.omgubuntu.co.uk/2015/05/instagram-photo-filters-ubuntu-desktop-app - -作者:[Joey-Elijah Sneddon][a] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/117485690627814051450/?rel=author -[1]:http://www.omgchrome.com/?s=pixlr -[2]:http://www.omgchrome.com/the-best-chrome-apps-of-2014/ -[3]:http://www.xnview.com/en/xnretro/#downloads diff --git a/translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md b/translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md new file mode 100644 index 0000000000..b2408dbeee --- /dev/null +++ b/translated/share/20150625 Screen Capture Made Easy with these Dedicated Tools.md @@ -0,0 +1,152 @@ +用这些专用工具让你截图更简单 +================================================================================ +"一图胜过千万句",这句二十世纪早期在美国应运而生的名言,说的是一张单一的静止图片所蕴含的信息足以匹敌大量的描述性文字。本质上说,图片所传递的信息量的确是比文字更有效更高效。 + +截图(或抓帧)是一种捕捉自计算机所录制可视化设备输出的快照或图片,屏幕捕捉软件能让计算机获取到截图。此类软件有很多用处,因为一张图片能很好地说明计算机软件的操作,截图在软件开发过程和文档中扮演了一个很重要的角色。或者,如果你的电脑有了个技术性问题,一张截图能让技术支持理解你碰到的这个问题。要写好计算机相关的文章、文档和教程,没有一款好的截图工具是几乎不可能的。如果你想在保存屏幕上任意一些零星的信息,特别是不方便打字时,截图也很有用。 + +在开源世界,Linux有许多专注于截图功能的工具供选择,基于图形的和控制台的都有。如果要说一个功能丰富的专用截图工具,那就来看看Shutter吧。这款工具是小型开源工具的杰出代表,当然也有其它的选择。 + +屏幕捕捉功能不仅仅只有专业的工具提供,GIMP和ImageMagick这两款主攻图像处理的工具,也能提供像样的屏幕捕捉功能。 + +---------- + +### Shutter ### + +![Shutter in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-Shutter1.png) + +Shutter是一款功能丰富的截图软件。你可以给你的特殊区域、窗口、整个屏幕甚至是网站截图 - 在其中应用不用的效果,比如用高亮的点在上面绘图,然后上传至一个图片托管网站,一切尽在这个小窗口内。 + +包含特性: + + +- 截图范围: + - 一块特殊区域 + - 窗口 + - 完整的桌面 + - 脚本生成的网页 +- 在截图中应用不同效果 +- 热键 +- 打印 +- 直接截图或指定一个延迟时间 +- 将截图保存至一个指定目录并用一个简便方法重命名它(用特殊的通配符) +- 完成集成在GNOME桌面中(TrayIcon等等) +- 当你截了一张图并以%设置了尺寸时,直接生成缩略图 +- Shutter会话选项: + - 会话中保持所有截图的痕迹 + - 复制截图至剪贴板 + - 打印截图 + - 删除截图 + - 重命名文件 +- 直接上传你的文件至图像托管网站(比如http://ubuntu-pics.de),取回所有需要的图像并将它们与其他人分享 +- 用内置的绘画工具直接编辑截图 + +- 主页: [shutter-project.org][1] +- 开发者: Mario Kemper和Shutter团队 +- 许可证: GNU GPL v3 +- 版本号: 0.93.1 + +---------- + +### HotShots ### + +![HotShots in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-HotShots.png) + +HotShots是一款捕捉屏幕并能以各种图片格式保存的软件,同时也能添加注释和图形数据(箭头、行、文本, ...)。 + +你也可以把你的作品上传到网上(FTP/一些web服务),HotShots是用Qt开发而成的。 + +HotShots无法从Ubuntu的Software Center中获取,不过用以下命令可以轻松地来安装它: + + sudo add-apt-repository ppa:ubuntuhandbook1/apps + + sudo apt-get update + + sudo apt-get install hotshots + +包含特性: + +- 简单易用 +- 全功能使用 +- 嵌入式编辑器 +- 热键 +- 内置放大功能 +- 徒手和多屏捕捉 +- 支持输出格式:Black & Whte (bw), Encapsulated PostScript (eps, epsf), Encapsulated PostScript Interchange (epsi), OpenEXR (exr), PC Paintbrush Exchange (pcx), Photoshop Document (psd), ras, rgb, rgba, Irix RGB (sgi), Truevision Targa (tga), eXperimental Computing Facility (xcf), Windows Bitmap (bmp), DirectDraw Surface (dds), Graphic Interchange Format (gif), Icon Image (ico), Joint Photographic Experts Group 2000 (jp2), Joint Photographic Experts Group (jpeg, jpg), Multiple-image Network Graphics (mng), Portable Pixmap (ppm), Scalable Vector Graphics (svg), svgz, Tagged Image File Format (tif, tiff), webp, X11 Bitmap (xbm), X11 Pixmap (xpm), and Khoros Visualization (xv) +- 国际化支持:巴斯克语、中文、捷克语、法语、加利西亚语、德语、希腊语、意大利语、日语、立陶宛语、波兰语、葡萄牙语、罗马尼亚语、俄罗斯语、塞尔维亚语、僧伽罗语、斯洛伐克语、西班牙语、土耳其语、乌克兰语和越南语 + +- 主页: [thehive.xbee.net][2] +- 开发者 xbee +- 许可证: GNU GPL v2 +- 版本号: 2.2.0 + +---------- + +### ScreenCloud ### + +![ScreenCloud in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-ScreenCloud.png) + +ScreenCloud是一款易于使用的开源截图工具。 + +在这款软件中,用户可以用三个热键中的其中一个或只需点击ScreenCloud托盘图标就能进行截图,用户也可以自行选择保存截图的地址。 + +如果你选择上传你的截图到screencloud主页,链接会自动复制到你的剪贴板上,你能通过email或在一个聊天对话框里和你的朋友同事分享它,他们肯定会点击这个链接来看你的截图的。 + +包含特性: + +- 捕捉整个屏幕,窗口和截选区域 +- 快速又简单:截取图片,粘贴链接,完成 +- 免费托管你的截图 +- 热键 +- 设置定时器延迟 +- 允许 '捕捉窗口边框' +- 启用/禁用通知 +- 设置开机自启动 +- 调整账户/上传/文件名/快捷方式的设置 +- 跨平台工具 +- 插件支持:保存至Dropbox,Imgur等等 +- 支持上传至FTP和SFTP服务器 + +- 主页: [screencloud.net][3] +- 开发者: Olav S Thoresen +- 许可证: GNU GPL v2 +- 版本号: 1.2.1 + +---------- + +### KSnapshot ### + +![KSnapShot in action](http://www.linuxlinks.com/portal/content/reviews/Graphics/Screenshot-KSnapshot.png) + +KSnapshot也是一款易于使用的截图工具,它能给整个桌面、一个单一窗口、窗口的一部分或一块所选区域捕捉图像。,图像能以各种不用的格式保存。 + +KSnapshot也允许用户用热键来进行截图。除了保存截图之外,它也可以被复制到剪贴板或用任何与图像文件关联的程序打开。 + +KSnapshot是KDE 4图形模块的一部分。 + +包含特性: + +- 以多种格式保存截图 +- 延迟截图 +- 剔除窗口装饰图案 +- 复制截图至剪贴板 +- 热键 +- 能用它的D-Bus界面进行脚本化 + +- 主页: [www.kde.org][4] +- 开发者: KDE, Richard J. Moore, Aaron J. Seigo, Matthias Ettrich +- 许可证: GNU GPL v2 +- 版本号: 0.8.2 + +-------------------------------------------------------------------------------- + +via: http://www.linuxlinks.com/article/2015062316235249/ScreenCapture.html + +译者:[ZTinoZ](https://github.com/ZTinoZ) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[1]:http://shutter-project.org/ +[2]:http://thehive.xbee.net/ +[3]:https://screencloud.net/ +[4]:https://www.kde.org/applications/graphics/ksnapshot/ diff --git a/translated/talk/20141211 Open source all over the world.md b/translated/talk/20141211 Open source all over the world.md new file mode 100644 index 0000000000..0abb08121f --- /dev/null +++ b/translated/talk/20141211 Open source all over the world.md @@ -0,0 +1,147 @@ +一个开源的世界 +================================================================================ +![](https://opensource.com/sites/default/files/styles/image-full-size/public/images/business/BUS_OpenSourceExperience_520x292_cm.png) + +图片来源 : opensource.com + +经过了一整天的Opensource.com[社区版主][1]年会,最后一项日程提了上来,内容只有“特邀嘉宾:待定”几个字。作为[Opensource.com][3]的项目负责人和社区管理员,[Jason Hibbets][2]起身解释道,“因为这个嘉宾有可能无法到场,因此我不想提前说是谁。在几个月前我问他何时有空过来,他给了我两个时间点,我选了其中一个。今天是这三周中Jim唯一能来的一天”。(译者注:Jim是指下文中提到的Jim Whitehurst,即红帽公司总裁兼首席执行官) + +这句话在版主们(Moderators)中引起一阵轰动,他们从世界各地赶来参加此次的[拥抱开源大会(All Things Open Conference)][4]。版主们纷纷往前挪动椅子,仔细聆听。 + +“他会首先作半个小时的演讲,然后会回答几个提问。”,Jason说道。 + +会场的门开着,似乎一直在等着这位大人物的出现。这时,会场前唯一一个空位上来了一位高个子。 + +“大家好!”,这个家伙开口了。他没穿正装,只是衬衫和休闲裤。 + +这时会场中第二高个子的人,红帽全球意识部门(Global Awareness)的高级主管[Jeff Mackanic][5],告诉他大部分社区版本今天都在场,然后让每个人开始作简单的自我介绍。 + +“我叫[Jen Wike Huger][6],负责Opensource.com的内容管理,很高兴见到大家。” + +“我叫[Nicole][7]。是[ByWater Solutions][8]的副总裁,我们在做免费的开源库。我到各地旅行并教会人们如何使用软件。” + +“我叫[Robin][9],从2013年开始参与版主项目。我在OSDC做了一些事情,工作是在[City of the Hague][10]维护[网站][11]。” + +“我叫[Marcus Hanwell][12],来自英格兰,在[Kitware][13]工作。同时,我是FOSS科学软件的技术总监,和国家实验室在[Titan][14] Z和[Gpu programming][15]方面合作。我主要使用[Gentoo][16]和[KDE][17]。最后,我很激动能加入FOSS和开源科学。” + +“我叫[Phil Shapiro][18],是华盛顿的一个小图书馆28个Linux工作站的管理员。我视各位为我的同事。非常高兴能一起交流分享,贡献力量。我主要关注FOSS和自豪感的关系,以及FOSS如何提升自豪感。” + +“我叫[Joshua Holm][19]。我大多数时间都在关注系统更新,以及帮助人们在网上找工作。” + +“我叫[Mel Chernoff][20],在红帽工作,和[Jason Hibbets]和[Mark Bohannon]一起主要关注政府渠道方面。” + +“我叫[Scott Nesbitt][24],写过很多东西,使用FOSS很久了。我是个普通人,不是系统管理员,也不是程序员,只希望能更加高效工作。我帮助人们在商业和生活中使用FOSS。” + +“我叫[Luis Ibanez][25],刚加入[Google][26]。我对DIY和FOSS感兴趣。” + +“我叫[Remy DeCausemaker][27],在[RIT MAGIC Center][28]的黑客学院(Resident Hackademic),也是[交互式游戏和媒体系][29]的一个兼职教授。现在为Opensource.com写作将近四年。” + +“你在[新FOSS Minor][30]教书?!”,Jim说道,“很酷!” + +“我叫[Jason Baker][31]。我是红慢的一个云专家,主要做[OpenStack][32]方面的工作。” + +“我叫[Mark Bohannan][33],是红帽全球开放协议的一员,在华盛顿外工作。和Mel一样,我花了相当多时间写作,也从法律和政府部门中找合作者。我做了一个很好的小册子来讨论正在发生在政府中的积极变化。” + +“我叫[Jason Hibbets][34],我组织了这次会议。” + +会场中一片笑声。 + +“我也组织了这片讨论,可以这么说,”这个棕红色头发笑容灿烂的家伙说道。笑声持续一会逐渐平息。 + +我当时在他左边,时不时从转录空隙中抬头看一眼,然后从眼神中注意到微笑背后暗示的那个自2008年1月起开始领导公司的人,红帽的CEO[Jim Whitehurst][35]。 + +“我有世界上最好的工作,”稍稍向后靠、叉腿抱头,Whitehurst开始了演讲。“我开始领导红帽,在世界各地旅行到处看看情况。在这里的七年中,FOSS和广泛的开源创新所发生的美好的事情是开源已经脱离了条条框框。我现在认为,IT正处在FOSS之前所在的位置。我们可以预见FOSS从一个替代走向创新驱动力。”用户也看到了这一点。他们用FOSS并不是因为它便宜,而是因为它能提供和创新的解决方案。这也十一个全球现象。比如,我刚才还在印度,然后发现那里的用户拥抱开源的两个理由:一个是创新,另一个是那里的市场有些特殊,需要完全的控制。 + +“[孟买证券交易所][36]想得到源代码并加以控制,五年前这在证券交易领域闻所未闻。那时FOSS正在重复发明轮子。今天看来,FOSS正在做几乎所有的结合了大数据的事物。几乎所有的新框架,语言和方法论,包括流动(尽管不包括设备),都首先发生在开源世界。” + +“这是因为用户数量已经达到了相当的规模。这不只是红帽遇到的情况,[Google][37],[Amazon][38],[Facebook][39]等也出现这样的情况。他们想解决自己的问题,用开源的方式。忘掉协议吧,开源绝不仅如此。我们建立了一个交通工具,一套规则,例如[Hadoop][40],[Cassandra][41]和其他工具。事实上,开源驱动创新。例如,Hadoop在厂商们意识的规模带来的问题。他们实际上有足够的资和资源金来解决自己的问题。”开源是许多领域的默认技术方案。这在一个更加注重内容的世界中更是如此,例如[3D打印][42]和其他使用信息内容的物理产品。” + +“源代码的开源确实很酷,但开源不应当仅限于此。在各行各业不同领域开源仍有可以用武之地。我们要问下自己:‘开源能够为教育,政府,法律带来什么?其它的呢?其它的领域如何能学习我们?’” + +“还有内容的问题。内容在现在是免费的,当然我们可以投资更多的免费内容,不过我们也需要商业模式围绕的内容。这是我们更应该关注的。如果你相信开放的创新能带来更好,那么我们需要更多的商业模式。” + +“教育让我担心其相比与‘社区’它更关注‘内容’。例如,无论我走到哪里,大学校长们都会说,‘等等,难道教育将会免费?!’对于下游来说FOSS免费很棒,但别忘了上游很强大。免费课程很棒,但我们同样需要社区来不断迭代和完善。这是很多人都在做的事情,Opensource.com是一个提供交流的社区。问题不是‘我们如何控制内容’,也不是‘如何建立和分发内容’,而是要确保它处在不断的完善当中,而且能给其他领域提供有价值的参考。” + +“改变世界的潜力是无穷无尽的,我们已经取得了很棒的进步。”六年前我们痴迷于制定宣言,我们说‘我们是领导者’。我们用错词了,因为那潜在意味着控制。积极的参与者们同样也不能很好理解……[Máirín Duffy][43]提出了[催化剂][44]这个词。然后我们组成了红帽,不断地促进行动,指引方向。” + +“Opensource.com也是其他领域的催化剂,而这正是它的本义所在,我希望你们也这样认为。当时的内容质量和现在比起来都令人难以置信。你可以看到每季度它都在进步。谢谢你们的时间!谢谢成为了催化剂!这是一个让世界变得更好的机会。我想听听你们的看法。” + +我瞥了一下桌子,发现几个人眼中带泪。 + +然后Whitehurst又回顾了大会的开放教育议题。“极端一点看,如果你有一门[Ulysses][45]的公开课。在这里你能和一群人一起合作体验课堂。这样就和代码块一样的:大家一起努力,代码随着时间不断改进。” + +在这一点上,我有发言权。当谈论其FOSS和学术团体之间的差异,向基础和可能的不调和这些词语都跳了出来。 + +**Remy**: “倒退带来死亡。如果你在论文或者发布的代码中烦了一个错误,有可能带来十分严重的后果。学校一直都是避免失败寻求正确答案的地方。复制意味着抄袭。轮子在一遍遍地教条地被发明。FOSS你能快速失败,但在学术界,你只能带来无效的结果。” + +**Nicole**: “学术界有太多自我的家伙,你们需要一个发布经理。” + +**Marcus**: “为了合作,你必须展示自己不懂的地方,这些发生在幕后。奖励模型是所有你信任的东西,我们需要改变它。尽可能多地发表,我们最后会发布,但希望能尽早地释放努力。” + +**Luis**: “团队和分享应该优先考虑,红帽可以多向它们强调这一点。” + +**Jim**: “还有公司在其中扮演积极角色吗?” + +[Phil Shapiro][46]: “我对FOSS的临界点感兴趣。联邦没有改用[LibreOffice][47]把我逼疯了。我们没有在软件上花税款,也不应当在字处理软件或者微软的Office上浪费税钱。” + +**Jim**: “我们经常提倡这一点。我们能做更多吗?这是个问题。首先,我们在我们的产品涉足的地方取得了进步。我们在政府中有坚实的专营权。我们比私有公司平均话费更多。银行和电信业都和政府挨着。我们在欧洲做的更好,我认为在那工作又更低的税。下一代计算就像‘终结者’,我们到处取得了进步,但仍然需要忧患意识。” + +突然,门开了。Jim转身向门口站着的执行助理点头。他要去参加下一场会了。他并拢双腿,站着向前微倾。然后,他再次向每个人的工作和奉献表示感谢,微笑着除了门……留给我们更多的激励。 +-------------------------------------------------------------------------------- + +via: https://opensource.com/business/14/12/jim-whitehurst-inspiration-open-source + +作者:[Remy][a] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/remyd +[1]:http://opensource.com/community-moderator-program +[2]:https://twitter.com/jhibbets +[3]:http://opensource.com/ +[4]:http://allthingsopen.org/ +[5]:http://opensource.com/users/mackanic +[6]:https://twitter.com/JenWike +[7]:http://opensource.com/users/nengard +[8]:http://bywatersolutions.com/ +[9]:http://opensource.com/life/13/7/community-spotlight-robin-muilwijk +[10]:https://en.wikipedia.org/wiki/The_Hague +[11]:http://www.denhaag.nl/en.htm +[12]:https://twitter.com/mhanwell +[13]:http://www.kitware.com/ +[14]:http://www.nvidia.com/gtx-700-graphics-cards/gtx-titan-z/ +[15]:https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units +[16]:https://www.gentoo.org/ +[17]:http://kde.org/ +[18]:https://twitter.com/philshapiro +[19]:http://opensource.com/community/13/9/contributor-spotlight-joshua-holm +[20]:http://opensource.com/users/melanie +[21]:http://opensource.com/government +[22]:https://twitter.com/jhibbets +[23]:https://twitter.com/markbotech +[24]:http://scottnesbitt.me/ +[25]:http://opensource.com/users/luis-ibanez +[26]:http://google.com/ +[27]:http://twitter.com/remy_d +[28]:http://foss.rit.edu/ +[29]:http://igm.rit.edu/ +[30]:http://www.rit.edu/news/story.php?id=50590 +[31]:https://twitter.com/jehb +[32]:http://openstack.org/ +[33]:https://twitter.com/markbotech +[34]:https://twitter.com/jhibbets +[35]:http://www.redhat.com/en/about/company/management/james-whitehurst +[36]:http://www.bseindia.com/ +[37]:http://google.com/ +[38]:https://mail.corp.redhat.com/service/home/%7E/Amazon +[39]:https://mail.corp.redhat.com/service/home/%7E/Facebook +[40]:https://hadoop.apache.org/ +[41]:https://cassandra.apache.org/ +[42]:https://en.wikipedia.org/wiki/3D_printing +[43]:https://twitter.com/mairin +[44]:http://jobs.redhat.com/life-at-red-hat/our-culture/ +[45]:http://www.gutenberg.org/ebooks/4300 +[46]:https://twitter.com/philshapiro +[47]:http://libreoffice.org/ diff --git a/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md b/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md new file mode 100644 index 0000000000..76368e1033 --- /dev/null +++ b/translated/talk/20150309 Comparative Introduction To FreeBSD For Linux Users.md @@ -0,0 +1,98 @@ +ԱȽϵķʽLinuxûFreeBSD +================================================================================ +![](https://1102047360.rsc.cdn77.org/wp-content/uploads/2015/03/FreeBSD-790x494.jpg) + +### ### + +BSDUNIX̳жĿǰUnixϵͳǻBSDġFreeBSDʹ㷺ĿԴа棨BSDа棩˼һһѿԴUnixϵͳǹƽ̨FreeBSDԴͨԿɵBSD֤LinuxкܶƵĵطǵóںܶ෽вͬ + +ĵಿ֯£FreeBSDڵһ֣FreeBSDLinuxƵڵڶ֣ǵڵۣǹܵۺܽһڡ + +### FreeBSD ### + +#### ʷ #### + +- FreeBSDĵһ汾1993꣬ĵһCD-ROMFreeBSD1.0Ҳ1993ꡣFreeBSD 2.1.01995귢һûʵIT˾ʹFreeBSDҺ⣬ǿгеһЩIBMNokiaNetAppJuniper Network + +#### ֤ #### + +- ֤FreeBSDԶֿԴ֤зµΪKernelĴBSD֤˷ʹú·FreeBSDľɡĴBSD֤зЩGPLCDDL֤ġ + +#### û #### + +- FreeBSDҪص֮һûʵϣFreeBSDΪʼWeb ServerFTPԼ·ȣֻҪзصɡFreeBSD֧ARMPowerPCMIPSx86x86-64ܹ + +### FreeBSDLinuxƴ ### + +FreeBSDLinuxѿԴʵϣǵûԺ׵ļ鲢޸Դ룬ûӵоԵɡңFreeBSDLinuxUnixϵͳǵںˡڲʹôʷϵAT&T Unix̳е㷨FreeBSDӸϸUnixϵͳLinuxΪѵUnixϵͳġ๤ӦöFreeBSDLinuxҵʵϣǼͬĹܡ + +⣬FreeBSDܹдLinuxӦá԰װһLinuxļݲ㣬ݲڱFreeBSDʱAAC Compact LinuxõͨѱLinuxݲFreeBSDϵͳлݳaac_linux.koͬFreeBSDǣLinux޷FreeBSD + +ע⵽ȻͬĿ꣬߻һЩ֮ͬһг + +### FreeBSDLinux ### + +Ŀǰڴû˵ûһѡFreeBSDLinux׼ΪźܶͬӦóΪǶUnixϵͳ + +һ£ǽгϵͳһЩҪIJ֮ͬ + +#### ֤ #### + +- ϵͳǵ֤LinuxGPL֤УΪûṩĶк޸ԴɣGPL֤ûжơFreeBSDBSD֤BSD֤GPLݣΪҪԸ֤ζκûܹʹá޸Ĵ룬ҲҪά֮ǰ֤ +- ֤ѡһ֡BSD֤ûʵϣ֤ʹûڱ֤ԴķԵͬʱԸ֤˵˵GPLҪÿʹԸ֤ûע⡣ +- Բ֤ͬѡҪ˽ǸԵ֤ԼǿеķۣӶ˽ԵѡʺԼġ + +#### #### + +- FreeBSDLinuxԲ֤ͬģLinus TorvaldsLinuxںˣFreeBSDȴLinuxͬδơҸ˸ʹFreeBSDLinuxΪFreeBSDǾɵûκοɵĴڡLinuxFreeBSDIJ֮ͬҽȲѡ񣬵ȶ걾ĺѡ + +#### ϵͳ #### + +- Linux۽ںϵͳFreeBSDͬFreeBSDϵͳάšFreeBSDں˺һFreeBSDŶӿΪһάʵϣFreeBSDԱܹԶҸЧĹIJϵͳ +- Linux棬ڹϵͳһЩѡڲͬɲͬԴάLinuxҪǻ㼯ܴﵽͬĹܡ +- FreeBSDLinuxûĿѡͷа棬ǹķʽͬFreeBSDͳһĹʽLinuxҪֱά + +#### Ӳ֧ #### + +- ˵Ӳ֧֣LinuxFreeBSDĸáⲻζFreeBSDûLinux֧ӲֻڹķʽͬͨˣѰµĽFreeBSDӦѰһĻʹLinux + +#### ԭFreeBSD Vs ԭLinux #### + +- ߵԭϵͳв֮ͬǰ˵ģLinuxһUnixϵͳLinux Torvaldsдϵ༫һЭʵֵġLinuxһִϵͳҪȫܣڴ桢⡢̬ءڴȡGPL֤ +- FreeBSDҲ̳UnixҪԡFreeBSDΪڼݴѧBSDһַа档BSDҪԭһԴϵͳAT&TϵͳӶûAT&T֤ʹõ +- ֤ǿĵ⡣ͼṩһ󻯿¡UnixĿԴϵͳӰûѡFreeBSDLinuxʹBSD֤зɡ + +#### ֵ֧ #### + +- ûĽǶһ߲ͬĵطԼԴ밲װĿԺ֧֡LinuxֻṩԤĶưFreeBSDͬṩԤİһṩԴͰװĹϵͳֲFreeBSDѡʹԤĬϣڱʱ +- ЩѡFreeBSDеңǵĹDzλģ/usr/portsҵԴļĵַԼһЩȷʹFreeBSDĵ +- ЩᵽĿѡ˲ͬ汾ĿԡFreeBSDͨԴ빹ԼԤLinuxһֻԤʹְװʽϵͳ + +#### FreeBSD Linux ù߱Ƚ #### + +- дijùFreeBSDϿãȤFreeBSDŶӵС෴ģLinuxGNUΪʲôʹһЩơ +- ʵFreeBSDõBSD֤dzáˣάIJϵͳЩӦóĿһЩǵ - BSDUnixĹߣͬGNU׼GNU׼ֻСݡ + +#### ׼ Shell #### + +- FreeBSDĬʹtcshcsh棬FreeBSDBSD֤У˲ʹGNU bash shellbashtcshtcshĽűܡʵϣǸƼFreeBSDʹsh shellΪӿɿԱһЩʹtcshcshʱֵĽű⡣ + +#### һӲλļϵͳ #### + +- ֮ǰᵽһʹFreeBSDʱϵͳԼѡԱ׵⵼һЩǵı׼Linux£/bin/sbin/usr/bin/usr/sbinǴſִļĿ¼FreeBSDͬһЩӵĶ֯Ĺ淶ϵͳ/usr/local/bin/usr/local/sbinĿ¼¡ַ԰ֻϵͳͿѡ + +### ### + +FreeBSDLinuxҿԴϵͳƵҲвͬ㡣гݲ˵ĸϵͳһáʵϣFreeBSDLinuxԼصͼʹϵͳôʲôأѾʹеijϵͳôΪǵĻķǷĻڶǵôԴĹ۵㡣 + +-------------------------------------------------------------------------------- + +via: https://www.unixmen.com/comparative-introduction-freebsd-linux-users/ + +ߣ[anismaj][a] +ߣ[wwy-hust](https://github.com/wwy-hust) +Уԣ[УID](https://github.com/УID) + + [LCTT](https://github.com/LCTT/TranslateProject) ԭ룬[Linuxй](http://linux.cn/) Ƴ + +[a]:https://www.unixmen.com/author/anis/ \ No newline at end of file diff --git a/translated/talk/20150310 FAQ--BSD.md b/translated/talk/20150310 FAQ--BSD.md deleted file mode 100644 index 97bcd4f246..0000000000 --- a/translated/talk/20150310 FAQ--BSD.md +++ /dev/null @@ -1,75 +0,0 @@ -BSD -================================================================================ -![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq1-large1.png) - -### ʷвͬڽFreeBSD... ### - -#### ôBirsa Seva Dalôأѵһӡȵ֯ô #### - -ȤάٿϡBSDҳΪ˽Цô۲а棨Berkeley Software Distributionһõĸ㷺IJϵͳ塣 - -#### ǸҿƲסԼôЩϵͳôأ #### - -죬ҪʹõBSDϵͳ֡ǶUnixǶԴҴൣηĽɫҲܵ͹վKDEFirefoxLibreOfficeApacheMySQL˵óֵĿԴǶȶȫ֧಻ͬӲ - -#### ϲ㣡ղGNU/Linux #### - -ǵģLinuxӵҸղᵽжҲΪʲôܶ˴BSDճʹУLinuxBSDû̫IJͬҪΪǶUnixΪúܶԵ¼ԶVimдһЩPython룬ʹMuttemailܲδʶʹBSDڿȹͨնʹ֪BSD - -ڿģͺ֤Ϊ˽ЩҪصȥBSDУBżǴѧУUniversity of California, Berkeley1980ǿԴUnixķԴء90x86PCУ˶ǵļͥаװUnixϵͳȤһ386BSDĿʱṩĹܡ - -#### ôеLinuxаǸʱأ #### - -ʵúãҲ֪һǰLinus TorvaldsѾںˣGNUĿʱĿԴϵͳLinusʱѾڸGNUںˣHurd386BSD̸ʱںһԱճܾͲᴴLinuxˡԣ90ͷ꣬Դϵͳû֪ĸϵͳʤ - -BSDһЩ鷳UnixĿAT&TͼǵĹлһЩ棬BSDַǵ֪ʶȨ1992һ׮ϽBSDĿ̡BSDԴķ֧뱻дʱGNU/LinuxѾḻ˹ܣȶˡ - -90BSD֤GNU/Linuxӳ죬ûЩ鷳ѾΪx86 PCı׼ˡ죬ǿܶʹLinux - -#### ᵽBSDȻ㷺ʹãô #### - -ǵġ386BSDĿͣˣֻŶķʽijɹĿFreeBSDΪʹ㷺BSD汾ĿǰǺLinuxƵϵͳͷ汾ȻNetBSD۽ڿֲԣڳ50ֲͬƽ̨ϣͬĴ汾һ汾OpenBSDNetBSDʼþΪߵĿڽǶΪNetBSDķ֧ˣ죬רעڰȫOpenBSDǶLinuxı׼˵OpenSSH - ԣLibreSSL - -#### ԣְ汾BSDLinuxаô #### - -ҲҲǣÿBSD汾ԼĴ⡢ͬĿŶӡǼ๲õĴ루ӲǸӵɫŵȱ໥IJϵͳ - -ᵽBSDĿģGNU/LinuxҪص㡣GNU/Linuxû˶иһЩŶGNU湤һЩŶڿںˣһЩڿűһЩдֲᣬһЩдȵȡĿģͨȱȨġɷа渺ʹжƺϡ - -BSD෴Ǵ뻯ԴпΪһ塣ںˡ⡢ϵͳĵҳһطͬķʽʹáBSD˿ƣص˲ϵͳһԺȶԡͨЩʹBSDľǿֲ֤ҳѾ÷dz걸 - -![](http://www.linuxvoice.com/wp-content/uploads/2015/02/faq2-large1.png) - -#### ѵBSDûʹGNU/Linuxκζô #### - -ǵģGCCʮGNU Compiler CollectionѾΪʵϵUnixϵͳ׼FreeBSDѾתʹLLVM/ClangˡֵעBSDһЩĿԴĿDzGNULinux˵X Window SystemXFree86X.orgPerlȵȡҿPOSIXһı׼LinuxϵijBSD汾ϱС - -ˣ԰LAMPLinuxApacheMySQLPHPеLijFreeBSDԻüͬĻԼһЩͬԣ磬ļϵͳַ֧棩FreeBSDдûNetflixÿṩݡFreeBSDһõ滷ijڷ棬ӵгѰĿɿԺܡ - -OpenBSDڰȫʮֱҪijϣСWebļйܡǽءNetBSDBSDҪаеһڼƽ̨ϣϵAmigasAcorn boxesʱڱԴ豸ҵӰ - -#### ȵȣô˽ԴԴأLinuxDzʵ #### - -Եģ̸GNU/LinuxҪͬBSD汾֤ȤBSD֤dz֪ͬGPL˵BSD̡BSD֤Ҫǣݴ룬£ĿԱȨ㻵ĵʱҪϡ - -ˣ֤ûκǿƴ뿪ԴGPLҪʹݴûǵ޸ҲԴһҪIJͬ˻ļۣBSDķ˿˵ǵ֤ɣΪôϸ񣩣GNU/GPLķ˿˵ǵ֤ŸɣΪɣ - -#### ѽô˵ѾҵȤܳЩɰBSD汾أ #### - -ѾԲµЩվ C [www.openbsd.org][1][www.freebsd.org][2][www.netbsd.org][3]ISOVirtualBoxǣȻʼˣѾһʱLinuxҪ˽Щⲻ̫ѡѰһЩָѺõĶPC-BSDPC-BSD([www.pcbsd.org][4])һFreeBSDĸԻư汾רע棬۵ͼλװͳ򵥵ף죡 - --------------------------------------------------------------------------------- - -via: http://www.linuxvoice.com/faq-bsd-2/ - -ߣ[Mike Saunders][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://www.linuxvoice.com/author/mike/ -[1]:http://www.openbsd.org/ -[2]:http://www.freebsd.org/ -[3]:http://www.netbsd.org/ -[4]:http://www.pcbsd.org/ diff --git a/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md b/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md new file mode 100644 index 0000000000..667a951f39 --- /dev/null +++ b/translated/talk/20150520 Is Linux Better than OS X GNU Open Source and Apple in History.md @@ -0,0 +1,57 @@ +Linux比Mac OS X更好吗?历史中的GNU,开源和Apple +============================================================================== +> 自由软件/开源社区与Apple之间的争论可以回溯到上世纪80年代,当时Linux的创始人称Mac OS X的核心就是"一个废物",还有其他一些软件历史上的轶事。 + +![](http://thevarguy.com/site-files/thevarguy.com/files/imagecache/medium_img/uploads/2015/05/untitled_2.png) + +开源拥护者们与微软之间有着很长,而且摇摆的关系。每个人都知道这个。但是,在许多方面,自由或者开源软件的支持者们与Apple之间的紧张关系则更加突出——尽管这很少受到媒体的关注。 + +需要说明的是,并不是所有的开源拥护者都厌恶苹果。Anecdotally(待译),我已经见过很多Linux的黑客玩弄iPhones和iPads。实际上,许多Linux用户是十分喜欢Apple的OS X系统的,以至于他们[创造了很多Linux的发行版][1],都设计得看起来像OS X。(顺便说下,[北朝鲜政府][2]就这样做了。) + +但是Mac的信徒与企鹅——即Linux社区(未提及自由与开源软件世界的小众群体)的信徒之间的关系,并不一直是完全的和谐。并且这绝不是一个新的现象,在我研究Linux历史和开源基金会的时候就发现了。 + +### GNU vs. Apple ### + +这场战争将回溯到至少上世界80年代后期。1988年6月,Richard Stallman发起了[GNU][3]项目,希望建立一个完全自由的类Unix操作系统,其源代码讲会免费共享,[[强烈指责][4]Apple对[Hewlett-Packard][5](HPQ)和[Microsoft][6](MSFT)的诉讼,称Apple的声明中,说别人对Macintosh操作系统的界面和体验的抄袭是不正确。如果Apple流行,GNU警告到,这家公司“将会借助大众的新力量终结掉自由软件,而自由软件可以成为商业软件的替代品。” + +那个时候,GNU对抗Apple的诉讼(这意味着,十分讽刺的是,GNU正在支持Microsoft,尽管当时的情况不一样),通过发布["让你的律师远离我的电脑”按钮][7]。同时呼吁GNU的支持者们抵制Apple,警告如果Macintoshes看起来是不错的计算机,但Apple一旦赢得了诉讼就会给市场带来垄断,这会极大地提高计算机的售价。 + +Apple最终[输掉了诉讼][8],但是直到1994年之后,GNU才[撤销对Apple的抵制][9]。这期间,GNU一直不断指责Apple。在上世纪90年代早期甚至之后,GNU开始发展GNU软件项目,可以在其他个人电脑平台包括MS-DOS上使用。[GNU 宣称][10],除非Apple停止在计算机领域垄断的野心,让用户界面可以模仿Macintosh的一些东西,否则“我们不会提供任何对Apple机器的支持。”(因此讽刺的是一大堆软件都开发了OS X和类Unix系统的版本,于是Apple在90年代后期介绍这些软件来自GNU。但是那是另外的故事了。) + +### Trovalds on Jobs ### + +除去他对大多数发行版比较自由放任的态度,Liuns Trovalds,Linux内核的创造者,相较于Stallman和GNU过去对Apple的态度没有多一点仁慈。在他2001年出版的书"Just For Fun: The Story of an Accidental Revolutionary"中,Trovalds描述到与Steve Jobs的一个会面,大约是1997年收到后者的邀请去讨论Mac OS X,Apple正在开发,但还没有公开发布。 + +"基本上,Jobs一开始就试图告诉我在桌面上的玩家就两个,Microsoft和Apple,而且他认为我能为Linux做的最好的事,就是从了Apple,努力让开源用户站到Mac OS X后面去"Trovalds写道。 + +这次谈判显然让Trovalds很不爽。争吵的一点集中在Trovalds对Mach技术上的藐视,对于Apple正在用于构建新的OS X操作系统的内核,Trovalds称其“一推废物。它包含了所有你能做到的设计错误,并且甚至打算只弥补一小部分。” + +但是更令人不快的是,显然是Jobs在开发OS X时入侵开源的方式(OS X的核心里上有很多开源程序):“他有点贬低了结构的瑕疵:谁在乎基础操作系统,真正的low-core东西是不是开源,如果你有Mac层在最上面,这不是开源?” + +一切的一切,Trovalds总结到,Jobs“并没有使用太多争论。他仅仅很简单地说着,胸有成竹地认为我会对与Apple合作感兴趣”。“他没有任何线索,不能去想像还会有人并不关心Mac市场份额的增长。我认为他真的感到惊讶了,当我表现出对Mac的市场有多大,或者Microsoft市场有多大的可怜的关心时。” + +当然,Trovalds并没有对所有Linux用户说起。他对于OS X和Apple的看法从2001年开始就渐渐软化了。但实际上,早在2000年,Linux社区的领导角色表现出对Apple和其高层的傲慢的深深的鄙视,可以看出一些重要的东西,关于Apple和开源/自由软件世界的矛盾是多么的根深蒂固。 + +从以上两则历史上的花边新闻中,可以看到关于Apple产品价值的重大争议,即是否该公司致力于提升软硬件的质量,或者仅仅是借市场的小聪明获利,后者会让Apple产品卖出更多的钱,**********(该处不知如何翻译)。但是不管怎样,我会暂时置身讨论之外。 + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/051815/linux-better-os-x-gnu-open-source-and-apple- + +作者:[Christopher Tozzi][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://thevarguy.com/author/christopher-tozzi +[1]:https://www.linux.com/news/software/applications/773516-the-mac-ifying-of-the-linux-desktop/ +[2]:http://thevarguy.com/open-source-application-software-companies/010615/north-koreas-red-star-linux-os-made-apples-image +[3]:http://gnu.org/ +[4]:https://www.gnu.org/bulletins/bull5.html +[5]:http://www.hp.com/ +[6]:http://www.microsoft.com/ +[7]:http://www.duntemann.com/AppleSnakeButton.jpg +[8]:http://www.freibrun.com/articles/articl12.htm +[9]:https://www.gnu.org/bulletins/bull18.html#SEC6 +[10]:https://www.gnu.org/bulletins/bull12.html diff --git a/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md b/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md new file mode 100644 index 0000000000..c3a84f5fcf --- /dev/null +++ b/translated/tech/20150318 How to Manage and Use LVM (Logical Volume Management) in Ubuntu.md @@ -0,0 +1,268 @@ +如何在 Ubuntu 中管理和使用 LVM(Logical Volume Management,逻辑卷管理) +================================================================================ +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-1.png.pagespeed.ic.VGSxDeVS9P.png) + +在我们之前的文章中,我们介绍了[什么是 LVM 以及能用 LVM 做什么][1],今天我们会给你介绍一些 LVM 的主要管理工具,使得你在设置和扩展安装时更游刃有余。 + +正如之前所述,LVM 是介于你的操作系统和物理硬盘驱动器之间的抽象层。这意味着你的物理硬盘驱动器和分区不再依赖于他们所在的硬盘驱动和分区。而是,你的操作系统所见的硬盘驱动和分区可以是由任意数目的独立硬盘驱动汇集而成或是一个软件磁盘阵列。 + +要管理 LVM,这里有很多可用的 GUI 工具,但要真正理解 LVM 配置发生的事情,最好要知道一些命令行工具。这当你在一个服务器或不提供 GUI 工具的发行版上管理 LVM 时尤为有用。 + +LVM 的大部分命令和彼此都非常相似。每个可用的命令都由以下其中之一开头: + +- Physical Volume = pv +- Volume Group = vg +- Logical Volume = lv + +物理卷命令用于在卷组中添加或删除硬盘驱动。卷组命令用于为你的逻辑卷操作更改显示的物理分区抽象集。逻辑卷命令会以分区形式显示卷组使得你的操作系统能使用指定的空间。 + +### 可下载的 LVM 备忘单 ### + +为了帮助你理解每个前缀可用的命令,我们制作了一个备忘单。我们会在该文章中介绍一些命令,但仍有很多你可用但没有介绍到的命令。 + +该列表中的所有命令都要以 root 身份运行,因为你更改的是会影响整个机器系统级设置。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/lvm-cheatsheet.png) + +### 如何查看当前 LVM 信息 ### + +你首先需要做的事情是检查你的 LVM 设置。s 和 display 命令和物理卷(pv)、卷组(vg)以及逻辑卷(lv)一起使用,是一个找出当前设置好的开始点。 + +display 命令会格式化输出信息,因此比 s 命令更易于理解。对每个命令你会看到名称和 pv/vg 的路径,它还会给出空闲和已使用空间的信息。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/01/539x225xpvdisplay.png.pagespeed.ic.u2XV5LBTYa.png) + +最重要的信息是 PV 名称和 VG 名称。用这两部分信息我们可以继续进行 LVM 设置。 + +### 创建一个逻辑卷 ### + +逻辑卷是你的操作系统在 LVM 中使用的分区。创建一个逻辑卷,首先需要拥有一个物理卷和卷组。下面是创建一个新的逻辑卷所需要的全部命令。 + +#### 创建物理卷 #### + +我们会从一个完全新的没有任何分区和信息的硬盘驱动开始。首先找出你将要使用的磁盘。(/dev/sda, sdb, 等) + +> 注意:记住所有的命令都要以 root 身份运行或者在命令前面添加 'sudo' 。 + + fdisk -l + +如果之前你的硬盘驱动从没有格式化或分区,在 fdisk 的输出中你很可能看到类似下面的信息。这完全正常,因为我们会在下面的步骤中创建需要的分区。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/fdisk.png.pagespeed.ce.AmAEsxm-7Q.png) + +我们的新磁盘位置是 /dev/sdb,让我们用 fdisk 命令在驱动上创建一个新的分区。 + +这里有大量能创建新分区的 GUI 工具,包括 [Gparted][2],但由于我们已经打开了终端,我们将使用 fdisk 命令创建需要的分区。 + +在终端中输入以下命令: + + fdisk /dev/sdb + +这会使你进入到一个特殊的 fdisk 提示符中。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x145xfdisk00.png.pagespeed.ic.I7S8bjoXQG.png) + +以指定的顺序输入命令创建一个使用新硬盘驱动 100% 空间的主分区并为 LVM 做好了准备。如果你需要更改分区的大小或相应多个分区,我建议使用 GParted 或自己了解关于 fdisk 命令的使用。 + +**警告:下面的步骤会格式化你的硬盘驱动。确保在进行下面步骤之前你的硬盘驱动中没有任何信息。** + +- n = 创建新分区 +- p = 创建主分区 +- 1 = 成为磁盘上的首个分区 + +输入 enter 键两次以接受默认的第一个和最后一个柱面。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/562x216xfdisk01.png.pagespeed.ic.DsSZ38kWcA.png) + +用下面的命令准备 LVM 所使用的分区。 + +- t = 更改分区类型 +- 8e = 更改为 LVM 分区类型 + +核实并将信息写入硬盘驱动器。 + +- p = 查看分区设置使得写入更改到磁盘之前可以回看 +- w = 写入更改到磁盘 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/560x339xfdisk03.png.pagespeed.ic.FC8foICZsb.png) + +运行这些命令之后,会退出 fdisk 提示符并返回到终端的 bash 提示符中。 + +输入 pvcreate /dev/sdb1 在刚创建的分区上新建一个 LVM 物理卷。 + +你也许会问为什么我们不用一个文件系统格式化分区,不用担心,该步骤在后面。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/pvcreate.png.pagespeed.ce.W7VAr-ig3t.png) + +#### 创建卷组 #### + +现在我们有了一个指定的分区和创建好的物理卷,我们需要创建一个卷组。很幸运这只需要一个命令。 + + vgcreate vgpool /dev/sdb1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgcreate.png.pagespeed.ce.fVLzSmPZou.png) + +Vgpool 是新创建的卷组的名称。你可以使用任何你喜欢的名称,但建议标签以 vg 开头,以便后面你使用它时能意识到这是一个卷组。 + +#### 创建逻辑卷 #### + +创建 LVM 将使用的逻辑卷: + + lvcreate -L 3G -n lvstuff vgpool + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvcreate.png.pagespeed.ce.vupLB-LJEW.png) + +-L 命令指定逻辑卷的大小,在该情况中是 3 GB,-n 命令指定卷的名称。 指定 vgpool 所以 lvcreate 命令知道从什么卷获取空间。 + +#### 格式化并挂载逻辑卷 #### + +最后一步是用一个文件系统格式化新的逻辑卷。如果你需要选择一个 Linux 文件系统的帮助,请阅读 [如果根据需要选取最合适的文件系统][3]。 + + mkfs -t ext3 /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/571x424xmkfs.png.pagespeed.ic.ERMan1Mz0P.png) + +创建挂载点并将卷挂载到你可以使用的地方。 + + mkdir /mnt/stuff + mount -t ext3 /dev/vgpool/lvstuff /mnt/stuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/510x69xmount.png.pagespeed.ic.k0i1tvqgcV.png) + +#### 重新设置逻辑卷大小 #### + +逻辑卷的一个好处是你能使你的共享物理变大或变小而不需要移动所有东西到一个更大的硬盘驱动。另外,你可以添加新的硬盘驱动并同时扩展你的卷组。或者如果你有一个不使用的硬盘驱动,你可以从卷组中移除它使得逻辑卷变小。 + +这里有三个用于使物理卷、卷组和逻辑卷变大或变小的基础工具。 + +注意:这些命令中的每个都要以 pv、vg 或 lv 开头,取决于你的工作对象。 + +- resize – 能压缩或扩展物理卷和逻辑卷,但卷组不能 +- extend – 能使卷组和逻辑卷变大但不能变小 +- reduce – 能使卷组和逻辑卷变小但不能变大 + +让我们来看一个如何向刚创建的逻辑卷 "lvstuff" 添加新硬盘驱动的例子。 + +#### 安装并格式化新硬盘驱动 #### + +按照上面创建新分区并更改分区类型为 LVM(8e) 的步骤安装一个新硬盘驱动。然后用 pvcreate 命令创建一个 LVM 能识别的物理卷。 + +#### 添加新硬盘驱动到卷组 #### + +要添加新的硬盘驱动到一个卷组,你只需要知道你的新分区,在我们的例子中是 /dev/sdc1,以及想要添加到的卷组的名称。 + +这会添加新物理卷到已存在的卷组中。 + + vgextend vgpool /dev/sdc1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/vgextend.png.pagespeed.ce.atRPT1yg5f.png) + +#### 扩展逻辑卷 #### + +调整逻辑卷的大小,我们需要指出的是通过大小而不是设备来扩展。在我们的例子中,我们会添加一个 8GB 的硬盘驱动到我们的 3GB vgpool。我们可以用 lvextend 或 lvresize 命令使该空间可用。 + + lvextend -L8G /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/lvextend1.png.pagespeed.ce.6scXbQVUTT.png) + +当这个命令工作的时候你会发现它实际上重新设置逻辑卷大小为 8GB 而不是我们期望的将 8GB 添加到已存在的卷上。要添加剩余的可用 3GB 你需要用下面的命令。 + + lvextend -L+3G /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/430x85xlvextend2.png.pagespeed.ic.7aBiTBrW03.png) + +现在我们的逻辑卷已经是 11GB 大小了。 + +#### 扩展文件系统 #### + +逻辑卷是 11GB 大小但是上面的文件系统仍然只有 3GB。要使文件系统使用整个的 11GB 可用空间你需要用 resize2fs 命令。你只需要指定 resize2fs 到 11GB 逻辑卷它就会帮你完成其余的工作。 + + resize2fs /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/650x150xresize2fs.png.pagespeed.ic.Mx74EdMuk_.png) + +**注意:如果你使用除 ext3/4 之外的文件系统,请查看调整你的文件系统大小的工具。** + +#### 压缩逻辑卷 #### + +如果你想从卷组中移除一个硬盘驱动你可以按照上面的步骤反向操作,并用 lvreduce 或 vgreduce 命令代替。 + +1. 调整文件系统大小 (调整之前确保已经移动文件到硬盘驱动安全的地方) +1. 减小逻辑卷 (除了 + 可以扩展大小,你也可以用 - 压缩大小) +1. 用 vgreduce 从卷组中移除硬盘驱动 + +#### 备份逻辑卷 #### + +快照是一些新的高级文件系统提供的功能,但是 ext3/4 文件系统并没有快照的功能。LVM 快照最棒的是你的文件系统永不掉线,你可以拥有你想要的任何大小而不需要额外的硬盘空间。 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/652x202xbanner-2.png.pagespeed.ic.VtOUuqYX1W.png) + +LVM 获取快照的时候,会有一张和逻辑卷完全相同的照片,该照片可以用于在不同的硬盘驱动上进行备份。生成一个备份的时候,任何需要添加到逻辑卷的新信息会如往常一样写入磁盘,但会跟踪更改使得原始快照永远不会损毁。 + +要创建一个快照,我们需要创建拥有足够空闲空间的逻辑卷,用于保存我们备份的时候会写入该逻辑卷的任何新信息。如果驱动并不是经常写入,你可以使用很小的一个存储空间。备份完成的时候我们只需要移除临时逻辑卷,原始逻辑卷会和往常一样。 + +#### 创建新快照 #### + +创建 lvstuff 的快照,用带 -s 标记的 lvcreate 命令。 + + lvcreate -L512M -s -n lvstuffbackup /dev/vgpool/lvstuff + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/597x68xlvcreate-snapshot.png.pagespeed.ic.Rw2ivtcpPg.png) + +这里我们创建了一个只有 512MB 的逻辑卷,因为驱动实际上并不会使用。512MB 的空间会保存备份时产生的任何新数据。 + +#### 挂载新快照 #### + +和之前一样,我们需要创建一个挂载点并挂载新快照,然后才能从中复制文件。 + + mkdir /mnt/lvstuffbackup + mount /dev/vgpool/lvstuffbackup /mnt/lvstuffbackup + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/565x68xmount-snapshot.png.pagespeed.ic.pVMkhK1o4x.png) + +#### 复制快照和删除逻辑卷 #### + +你剩下需要做的是从 /mnt/lvstuffbackup/ 中复制所有文件到一个外部的硬盘驱动或者打包所有文件到一个文件。 + +**注意:tar -c 会创建一个归档文件,-f 要指出归档文件的名称和路径。要获取 tar 命令的帮助信息,可以在终端中输入 man tar。** + + tar -cf /home/rothgar/Backup/lvstuff-ss /mnt/lvstuffbackup/ + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/627x67xsnapshot-backup.png.pagespeed.ic.tw-2AK_lfZ.png) + +记住备份发生的时候写到 lvstuff 的所有文件都会在我们之前创建的临时逻辑卷中被跟踪。确保备份的时候你有足够的空闲空间。 + +备份完成后,卸载卷并移除临时快照。 + + umount /mnt/lvstuffbackup + lvremove /dev/vgpool/lvstuffbackup/ + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/630x102xlvremove.png.pagespeed.ic.yBWk47X6lF.png) + +#### 删除逻辑卷 #### + +要删除一个逻辑卷,你首先需要确保卷已经卸载,然后你可以用 lvremove 命令删除它。逻辑卷删除后你可以移除卷组,卷组删除后你可以删除物理卷。 + +这是所有移除我们创建的卷和组的命令。 + + umount /mnt/lvstuff + lvremove /dev/vgpool/lvstuff + vgremove vgpool + pvremove /dev/sdb1 /dev/sdc1 + +![](http://cdn5.howtogeek.com/wp-content/uploads/2011/02/580x185xdelete-lvm.png.pagespeed.ic.3zJTo0Zu9k.png) + +这些已经囊括了关于 LVM 你需要了解的大部分知识。如果你有任何关于这些讨论的经验,请在下面的评论框中和大家分享。 + +-------------------------------------------------------------------------------- + +via: http://www.howtogeek.com/howto/40702/how-to-manage-and-use-lvm-logical-volume-management-in-ubuntu/ + +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://www.howtogeek.com/howto/36568/what-is-logical-volume-management-and-how-do-you-enable-it-in-ubuntu/ +[2]:http://www.howtogeek.com/howto/17001/how-to-format-a-usb-drive-in-ubuntu-using-gparted/ +[3]:http://www.howtogeek.com/howto/33552/htg-explains-which-linux-file-system-should-you-choose/ \ No newline at end of file diff --git a/translated/tech/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md b/translated/tech/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md deleted file mode 100644 index 580e68e9d7..0000000000 --- a/translated/tech/20150413 How to manage remote MySQL databases on Linux VPS using a GUI tool.md +++ /dev/null @@ -1,171 +0,0 @@ -Translating by demon -如何使用图形化工具远程管理Linux Vps上的MySql -================================================================================ -如果你在一个远程的VPS上运行了MYSQL server,你会如何管理你的远程数据库主机呢?基于web的数据库管理工具例如phpMyAdmin或者Adminer可能会是你一个想起的。这些基于web的管理工具需要一个后端的web服务和PHP引擎在正常运行。但是,如果你的VPS仅仅用来做数据库服务(e.g., for a multi-tier app),为临时的数据库管理提供一整套的LAMP是浪费VPS资源的。更糟的是,LAMP带有的HTTP端口可能会成为你VPS资源的安全漏洞。 - -作为一种选择,你可以使用在一台客户机上运行本地的Mysql客户端,当然,如果没有别的选择,一个纯净的命令行mysql客户端将是你的默认选择。但是命令行客户端的功能是有限的,因此它不适合在生产环境中使用,例如:sql开发,性能调优,模式验证等等。你是否在寻找一个成熟的MYSQL管理工具,那么一个MYSQL的图形化管理工具将会更好的满足你的需求。 - -什么是MySQL Workbench? - -作为一个由Oracle开发的成熟数据库管理工具,mysql workbench不仅仅是一个MySQL客户端。简而言之,Workbench是一个跨平台的(eg:Linux,MacOX,Windows)数据库设计,开发和管理图形工具。社区版本的Msyql Workbench是遵循GPL协议的。作为一个数据库管理者,你可以使用Workbench去配置Mysql服务,管理Mysql用户,完成数据库的备份与还原,监视数据库的健康状况,所有的都在对用户友好的图形化环境下处理。 - -在这个手册里,让我们演示下如何在Linux下安装和使用Mysql Workbench. - -在Linux上安装MySQL Workbench - -你可以在任何一个桌面linux机器上运行Mysql Workbench去设置你的数据库管理环境。然而一些Linux发行版(例如:Debian/Ubuntu)在他们的软件源中已经有了Mysql Workbench.从官方源中安装是一个好的方法,因为他们提供了最新的版本。这里介绍了如何设置一个官方的Workbench源和从中安装它。 - -#### Debian-based Desktop (Debia, Ubuntu, Mint): #### - -到其官方站点,选择一个和你环境匹配的DEB file源,并下载安装 - -For example, on Ubuntu 14.10: - - $ wget http://dev.mysql.com/get/mysql-apt-config_0.3.4-2ubuntu14.10_all.deb - $ sudo dpkg -i mysql-apt-config_0.3.4-2ubuntu14.10_all.deb - -on Debian 7: - - $ wget http://dev.mysql.com/get/mysql-apt-config_0.3.3-1debian7_all.deb - $ sudo dpkg -i mysql-apt-config_0.3.3-1debian7_all.deb - -当你安装DEB文件时,你会看到下面的配置菜单,并且选择配置那个Mysql产品 - -![](https://farm8.staticflickr.com/7702/16928715218_b1fcbcdbf3_c.jpg) - -选择“Utilities”.完成配置后,选择“Apply”去保存配置。然后,更新包索引,并且安装Workbench - - $ sudo apt-get update - $ sudo apt-get install mysql-workbench - -#### Red Hat-based Desktop (CentOS, Fedora, RHEL): #### - -去官网下载并安装适合你Linux环境的RPM源包 -For example, on CentOS 7: - - $ wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm - $ sudo yum localinstall mysql-community-release-el7-5.noarch.rpm - -on Fedora 21: - - $ wget http://dev.mysql.com/get/mysql-community-release-fc21-6.noarch.rpm - $ sudo yum localinstall mysql-community-release-fc21-6.noarch.rpm - -验证"MySQL Tools Community"源是否被安装 - $ yum repolis enabled - -![](https://farm9.staticflickr.com/8826/16494069254_15458ace52_c.jpg) - -安装Workbench - - $ sudo yum install mysql-workbench-community - -设置远程数据库的安全连接 - -接下来是为你运行Mysql服务的VPS设置一个远程连接,当然你可以直接通过图形化的Workbench连接你的远程Mysql服务器(在数据库开放了远程连接后)。然而,这样做有很大的安全风险,因为有些人很容易窃听你的数据库传输信息,并且一个公开的Mysql端口(默认为3306)被作为攻击入口。 - -一个比较好的方法是关掉远程访问数据库服务功能,(仅允许在127.0.0.1访问)。然后在本地客户机和远程Vps直接设置一个SSH隧道,这样的话,和mysql之间的数据能被安全的传输,仅在它的本地回环接口上。相比较设置一个SSL加密的连接来说,配置SSH隧道需要很少的操作,因为他仅仅需要SSH服务,并且在大多数的VPS上已经部署了。 - -让我们来看看如何来为一个Mysql Workbench设置一个SSH隧道,这里的设置,不需要你开放远程访问Mysql服务。 -在一个运行了Workbench的本地客户机上,键入下面的命令,替换'user' and 'remote_vps'为你自己的信息 - - $ ssh user@remote_vps -L 3306:127.0.0.1:3306 -N - -你会被要求输入你VPS的SSH密码,当你成功登陆VPS后,一个SSH隧道将会在本地的3306端口和远程VPS的3306端口将会被建立。这里你不会看到任何信息。 - -或者你可以选择在后台运行SSH隧道,按CTRL+Z停止当前的命令,然后输入bg并且ENTER - -![](https://farm8.staticflickr.com/7714/16928715438_bf0db49b3b_c.jpg) - -这样SSH隧道就会在后台运行了。 - -使用MySQL Workbench远程管理MySQL服务 - -在建立好SSH隧道后,你可以通过MySQL Workbench去远程连接Mysql服务了。 - -输入下面命令启动Workbench - - $ mysql-workbench - -![](https://farm9.staticflickr.com/8768/16494069294_0fce571ddb_c.jpg) - -点击Workbench页面上面的加号图标去创建一个新的数据库连接,接着会出现下面的连接信息。 - -- **Connection Name**: any description (e.g., My remote VPS database) -- **Hostname**: 127.0.0.1 -- **Port**: 3306 -- **Username**: MySQL username (e.g., root) - -![](https://farm8.staticflickr.com/7727/16928715288_d9ac3bfc7a_c.jpg) - -注意:因为隧道设置的是127.0.0.1:3306,所以主机名哪里必须是127.0.0.1,而不能是远程VPS的IP地址或者主机名 - -当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。 - -![](https://farm8.staticflickr.com/7650/17114969532_0252ffcd31_c.jpg) - -当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。 - -#### MySQL Server Status #### - -当你设置好一个新的数据库连接后,你会在Workbench窗口看到一个新的框,点击那个框就会实际去连接远程的MySQL服务了。 - -![](https://farm8.staticflickr.com/7627/16494069414_9d838d4138_c.jpg) - -#### Client Connections #### - -连接数是一个极其重要的监视资源,这个菜单显示了每个连接的详细信息。 - -![](https://farm9.staticflickr.com/8747/16909119337_a8d89772dd_c.jpg) - -#### 用户和权限 #### - -这个菜单允许你管理MySQL用户,包括他们的资源限制和权限。 - -![](https://farm9.staticflickr.com/8765/16494069384_760fc17c8f_c.jpg) - -#### MySQL Server Administration #### - -你可以启动或关闭MySQL服务,并且检查它的服务日志。 - -![](https://farm8.staticflickr.com/7588/17114969592_54526dfb32_c.jpg) - -#### Database Schema Management #### - -可以可视化的查看,更改,检查数据库结构,在“Schemas”标题下选择任何一个数据库或表,然后右击 - -![](https://farm8.staticflickr.com/7665/16496363973_fd03a96198_c.jpg) - -![](https://farm9.staticflickr.com/8744/16909119497_7c884617b8_c.jpg) - -#### Database Query #### - -你可以执行任何的语句(只要你的权限允许),并且检查他的结果。 - -![](https://farm8.staticflickr.com/7716/17114969692_c0f02bb277_c.jpg) - -此外,性能统计数据和报表仅用于MySQL5.6以上的版本。对于5.5及其以下的版本,性能部分会以灰色显示。 -### 结论 ### - -简介且直观的选项卡界面,丰富的特性,开源,使MySQL Workbench成为一个非常好的可视化数据库设计和管理工具。为其减分的是它的性能。我注意到在一台运行繁忙的服务器上,Workbench优势会变得异常缓慢,尽管它的性能差强人意,我依然认为MySQL Workbench是MySQL数据库管理员和设计人员必备的工具之一。 - -你曾在你的生产环境中用过Workbench吗?或者你还有别的GUI工具可以推荐?请分享你的经验吧。 - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/remote-mysql-databases-gui-tool.html - -作者:[Dan Nanni][a] -译者:[译者ID](https://github.com/tyzy313481929译者demon) -校对:[校对者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://ask.xmodulo.com/install-phpmyadmin-centos.html -[3]:http://xmodulo.com/set-web-based-database-management-system-adminer.html -[4]:http://mysqlworkbench.org/ -[5]:http://dev.mysql.com/downloads/repo/apt/ -[6]:http://dev.mysql.com/downloads/repo/yum/ -[7]:http://xmodulo.com/how-to-allow-remote-access-to-mysql.html diff --git a/translated/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 deleted file mode 100644 index 0344095bc2..0000000000 --- a/translated/tech/20150413 Linux FAQs with Answers--How to configure PCI-passthrough on virt-manager.md +++ /dev/null @@ -1,56 +0,0 @@ -Linux有问必答:如何在虚拟机上配置PCI-passthrough -================================================================================ -> **提问**:我想要设置一块物理网卡到用KVM创建的虚拟机上。我打算开启网卡的PCI passthrough给这台虚拟机。请问,我如何才能增加一个PCI设备通过PCI直通到虚拟机上? - -如今的hypervisor能够高效地在多个虚拟操作系统分享和模拟硬件资源。然而,虚拟资源分享,虚拟机的性能,或者是虚拟机需要硬件DMA的完全控制,不是总能使人满意。一项名叫“PCI passthrough”的技术可以用在一个虚拟机需要独享PCI设备时(例如:network/sound/video card)。本质上,PCI passthrough越过了虚拟层,直接扩展PCI设备到虚拟机。但是其他虚拟机不能同时共享。 - - -### 开启“PCI Passthrough”的准备 ### - -如果你想要为一台HVM实例开启PCI passthrough(例如,一台KVM创建的full虚拟机),你的母系统(包括CPU和主板)必须满足以下条件。但是如果你的虚拟机是para-V(由Xen创建),你可以挑过这步。 - -为了开启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]。 - -完成验证你的设备支持VT-d/AMD-Vi后,还有两件事情需要做。首先,确保VT-d/AMD-Vi已经在BIOS中开启。然后,在内核启动过程中开启IOMMU。IOMMU服务,是VT-d,/AMD-Vi提供,可以保护虚拟机访问的主机内存,同时它也是full虚拟机支持PCI passthrough的前提。 - -Intel处理器中,内核开启IOMMU通过在启动参数中修改“**intel_iommu=on**”。参看[这篇教程][2]获得如何通过GRUB修改内核启动参数。 - -配置完成启动参数后,重启电脑。 - -### 添加PCI设备到虚拟机 ### - -我们已经完成了开启PCI Passthrough的准备。事实上,只需通过虚拟机管理就可以给虚拟机分配一个PCI设备。 - -打开虚拟机设置,在左边工具栏点击‘增加硬件’按钮。 - -选择从PCI设备表一个PCI设备来分配,点击“完成”按钮 - -![](https://farm8.staticflickr.com/7587/17015584385_db49e96372_c.jpg) - -最后,开启实例。目前为止,主机的PCI设备已经可以由虚拟机直接访问了。 - -### 常见问题 ### - -在虚拟机启动时,如果你看见下列任何一个错误,这个错误有可能由于母机VT-d (或 IOMMU)未开启导致。 - - Error starting domain: unsupported configuration: host doesn't support passthrough of host PCI devices - ----------- - - Error starting domain: Unable to read from monitor: Connection reset by peer - -请确保"**intel_iommu=on**"启动参数已经按上文叙述开启。 - --------------------------------------------------------------------------------- - -via: http://ask.xmodulo.com/pci-passthrough-virt-manager.html - -作者:[Dan Nanni][a] -译者:[Vic020/VicYu](http://vicyu.net) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[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 diff --git a/translated/tech/20150515 Basic Networking Commands with Docker Containers.md b/translated/tech/20150515 Basic Networking Commands with Docker Containers.md deleted file mode 100644 index d4b90aa7f2..0000000000 --- a/translated/tech/20150515 Basic Networking Commands with Docker Containers.md +++ /dev/null @@ -1,106 +0,0 @@ -关于Docker容器的基础网络命令 -================================================================================ -各位好,今天我们将学习一些Docker容器的基础命令。Docker是一个提供了开放平台来打包、发布并以一个轻量级容器运行任意程序的开放平台。它没有语言支持、框架或者打包系统的限制,可在任何时间、任何地方在小到家用电脑大到高端服务器上运行。这使得在部署和扩展网络应用、数据库和终端服务时不依赖于特定的栈或者提供商。Docker注定是用于网络的如它正应用于数据中心、ISP和越来越多的网络服务。 - -因此,这里有一些你在管理Docker容器的时候会用到的一些命令。 - -### 1. 找到Docker接口 ### - -Docker默认会创建一个名为docker0的网桥接口来连接外部的世界。docker容器运行时直接连接到网桥接口docker0。默认上,docker会分配172.17.42.1/16给docker0,它是所有运行容器ip地址的子网。得到Docker接口的ip地址非常简单。要找出docker0网桥接口和连接到网桥上的docker容器,我们可以在终端或者安装了docker的shell中运行ip命令。 - - # ip a - -![Docker Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-interface.png) - -### 2. 得到Docker容器的ip地址 ### - -如我们上面读到的,docker在主机中创建了一个叫docker0的网桥接口。如我们创建一个心的docker容器一样,它自动被默认分配了一个在子网范围内的ip地址。因此,要检测运行中的Docker容器的ip地址,我们需要进入一个正在运行的容器并用下面的命令检查ip地址。首先,我们运行一个新的容器并进入。如果你已经有一个正在运行的容器,你可以跳过这个步骤。 - - # docker run -it ubuntu - -现在,我们可以运行ip a来得到容器的ip地址了。 - - # ip a - -![Docker Container IP](http://blog.linoxide.com/wp-content/uploads/2015/05/docker-container-ip.png) - -### 3. 映射暴露的端口 ### - -要映射配置在Dockerfile的暴露端口,我们只需用下面带上-P标志的命令。这会打开docker容器的随机端口并映射到Dockerfile中定义的端口。下面是使用-P来打开/映射定义的端口的例子。 - - # docker run -itd -P httpd - -![Mapping Expose Port](http://blog.linoxide.com/wp-content/uploads/2015/05/mapping-expose-port.png) - -上面的命令会映射Dockerfile中定义的httpd 80端口到容器的端口上。我们用下面的命令来查看正在运行的容器暴露的端口。 - - # docker ps - -并且可以用下面的curl命令来检查。 - - # curl http://localhost:49153 - -![Curl Exposed Port](http://blog.linoxide.com/wp-content/uploads/2015/05/curl-exposed-port-e1431034586219.png) - -### 4. 映射到特定的端口上 ### - -我们也可以映射暴露端口或者docker容器端口到我们指定的端口上。要实现这个,我们用-p标志来定义我们的需要。这里是我们的一个例子。 - - # docker run -itd -p 8080:80 httpd - -上面的命令会映射8080端口到80上。我们可以运行curl来检查这点。 - - # curl http://localhost:8080 - -![Mapping Specific Port](Curl Exposed Port) - -### 5. 创建自己的网桥 ### - -要给容器创建一个自定义的IP地址,在本篇中我们会创建一个名为bro的新网桥。要分配需要的ip地址,我们需要在运行docker的主机中运行下面的命令。 - - # stop docker.io - # ip link add br0 type bridge - # ip addr add 172.30.1.1/20 dev br0 - # ip link set br0 up - # docker -d -b br0 - -![Creating Bridge Interface](http://blog.linoxide.com/wp-content/uploads/2015/05/creating-bridge-interface.png) - -创建完docker网桥之后,我们要让docker的守护进程知道它。 - - # echo 'DOCKER_OPTS="-b=br0"' >> /etc/default/docker - # service docker.io start - -![Adding Interface to Docker](http://blog.linoxide.com/wp-content/uploads/2015/05/adding-interface-to-docker.png) - -到这里,桥接后的接口将会分配给容器新的在桥接子网内的ip地址。 - -### 6. 链接到另外一个容器上 ### - -我们可以用Dokcer连接一个容器到另外一个上。我们可以在不容的容器上运行不同的程序,并且相互连接或链接。链接允许容器间相互连接并安全地从一个容器上传输信息给另一个容器。要做到这个,我们可以使用--link标志。首先,我们使用--name标志来表示training/postgres镜像。 - - # docker run -d --name db training/postgres - -![Running db Container](http://blog.linoxide.com/wp-content/uploads/2015/05/running-db-container.png) - -完成之后,我们将容器db与training/webapp链接来形成新的叫web的容器。 - - # docker run -d -P --name web --link db:db training/webapp python app.py - -![linking two containers](http://blog.linoxide.com/wp-content/uploads/2015/05/linking-two-containers.png) - -### 总结 ### - -Docker网络很神奇也好玩,因为有我们可以对docker容器做很多事情。这里有些简单和基础的我们可以把玩docker网络命令。docker的网络是非常高级的。我们可以用它做很多事情。如果你有任何的问题、建议、反馈请在下面的评论栏写下来以便于我们我们可以提升或者更新文章的内容。谢谢! 玩得开心!:-) - --------------------------------------------------------------------------------- - -via: http://linoxide.com/linux-how-to/networking-commands-docker-containers/ - -作者:[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/ diff --git a/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md b/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md new file mode 100644 index 0000000000..4ce0ef80d0 --- /dev/null +++ b/translated/tech/20150515 Lolcat--A Command Line Tool to Output Rainbow Of Colors in Linux Terminal.md @@ -0,0 +1,175 @@ +Lolcat – 一个在 Linux 终端中输出彩虹特效的命令行工具 +================================================================================ +那些相信 Linux 命令行是单调无聊且没有任何乐趣的人们,你们错了,这里有一些有关 Linux 的文章,它们展示着 Linux 是如何的有趣和“淘气” 。 + +- [20 个有趣的 Linux 命令或在终端中 Linux 是有趣的][1] +- [6 个有趣的好玩 Linux 命令(在终端中的乐趣)][2] +- [在 Linux 终端中的乐趣 – 把玩文字和字符计数][3] + +在本文中,我将讨论一个名为“lolcat”的应用 – 它在终端中生成彩虹般的颜色。 + +![为终端生成彩虹般颜色的输出的 Lolcat 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Lolcat.png) + +为终端生成彩虹般颜色的输出的 Lolcat 命令 + +#### 何为 lolcat ? #### + +Lolcat 是一个针对 Linux,BSD 和 OSX 平台的应用,它类似于 [cat 命令][4],并为 `cat` 的输出添加彩虹般的色彩。 Lolcat 原本用于在 Linux 终端中为文本添加彩虹般的色彩。 + +### 在 Linux 中安装 Lolcat ### + +**1. Lolcat 应用在许多 Linux 发行版本的软件仓库中都可获取到,但可获得的版本都有些陈旧,而你可以通过 git 仓库下载和安装最新版本的 lolcat。** + +由于 Lolcat 是一个 ruby gem 程序,所以在你的系统中安装有最新版本的 RUBY 是必须的。 + + # apt-get install ruby [在基于 APT 的系统中] + # yum install ruby [在基于 Yum 的系统中] + # dnf install ruby [在基于 DNF 的系统中] + +一旦 ruby 软件包安装成功,请确保验证安装的 ruby 的版本。 + + # ruby --version + + ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] + +**2. 接着使用下面的命令来从 lolcat 的 git 仓库中下载和安装最新版本的 lolcat。** + + # wget https://github.com/busyloop/lolcat/archive/master.zip + # unzip master.zip + # cd lolcat-master/bin + # gem install lolcat + +一旦 lolcat 安装后,你可以检查它的版本号。 + + # lolcat --version + + lolcat 42.0.99 (c)2011 moe@busyloop.net + +### Lolcat 的用法 ### + +**3. 在开始使用 lolcat 之前,使用下面的命令来了解它可用的选项和其帮助文档。** + + # lolcat -h + +![Lolcat 的帮助文档](http://www.tecmint.com/wp-content/uploads/2015/06/Lolcat-Help1.png) + +Lolcat 的帮助文档 + +**4. 接着, 通过管道连接 lolcat 和其他命令,例如 ps, date 和 cal:** + + # ps | lolcat + # date | lolcat + # cal | lolcat + +![ps 命令的输出](http://www.tecmint.com/wp-content/uploads/2015/06/ps-command-output.png) + +ps 命令的输出 + +![Date 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Date.png) + +Date 的输出 + +![Calendar 的输出](http://www.tecmint.com/wp-content/uploads/2015/06/Cal.png) + +Calendar 的输出 + +**5. 使用 lolcat 来展示一个脚本文件的代码:** + + # lolcat test.sh + +![用 lolcat 来展示代码](http://www.tecmint.com/wp-content/uploads/2015/06/Script-Output.png) + +用 lolcat 来展示代码 + +**6. 通过管道连接 lolcat 和 figlet 命令。Figlet 是一个展示由常规的屏幕字符组成的巨大字符串的应用。我们可以通过管道将 figlet 的输出连接到 lolcat 中来给出如下的多彩输出:** + + # echo I ❤ Tecmint | lolcat + # figlet I Love Tecmint | lolcat + +![多彩的文字](http://www.tecmint.com/wp-content/uploads/2015/06/Colorful-Text.png) + +多彩的文字 + +**注**: 毫无疑问 ❤ 是一个 unicode 字符并且为了安装 figlet,你需要像下面那样使用 yum 和 apt 来得到这个软件包: + + # apt-get figlet + # yum install figlet + # dnf install figlet + +**7. 给文本赋予彩虹颜色的动画:** + + $ echo I ❤ Tecmit | lolcat -a -d 500 + +![动的文本](http://www.tecmint.com/wp-content/uploads/2015/06/Animated-Text.gif) + +动的文本 + +这里选项 `-a` 指的是 Animation(动画), `-d` 指的是 duration(持续时间)。在上面的例子中,持续 500 次动画。 + +**8. 在彩虹般的颜色下阅读 man 页(例如 `man ls`):** + + # man ls | lolcat + +![多彩地显示文件](http://www.tecmint.com/wp-content/uploads/2015/06/List-Files-Colorfully.png) + +多彩地显示文件 + +**9. 通过管道连接 lolcat 和 cowsay。cowsay 是一个可配置的正在思考或说话的奶牛,这个程序也支持其他的动物。** + +使用下面的命令来安装 cowsay : + + # apt-get cowsay + # yum install cowsay + # dnf install cowsay + +安装后,使用下面的命令来显示在 cowsay 中的所有动物: + + # cowsay -l + +**样例输出** + + Cow files in /usr/share/cowsay/cows: + apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default + dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep + ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala + mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep + skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey + turtle tux unipony unipony-smaller vader vader-koala www + +通过管道连接 lolcat 和 cowsay 后的输出,并且使用了‘gnu’cowfile。 + + # cowsay -f gnu ☛ Tecmint ☚ is the best Linux Resource Available online | lolcat + +![使用 Lolcat 的 Cowsay](http://www.tecmint.com/wp-content/uploads/2015/06/Cowsay-with-Lolcat.png) + +使用 Lolcat 的 Cowsay + +**注**: 你可以在管道中使用 lolcat 和其他任何命令来在终端中得到彩色的输出。 + +**10. 你可以为最常用的命令创建别名来使得命令的输出呈现出彩虹般的色彩。你可以像下面那样为 ‘ls -l‘ 命令创建别名,这个命令输出一个目录中包含内容的列表。** + + # alias lolls="ls -l | lolcat" + # lolls + +![多彩的 Alias 命令](http://www.tecmint.com/wp-content/uploads/2015/06/Alias-Commands-with-Colorful.png) + +多彩的 Alias 命令 + +你可以像上面建议的那样,为任何命令创建别名。为了使得别名永久生效,你必须添加相关的代码(上面的代码是 ls -l 的别名) 到 ~/.bashrc 文件中,并确保登出后再重新登录来使得更改生效。 + +现在就是这些了。我想知道你是否曾经注意过 lolcat 这个应用?你是否喜欢这篇文章?欢迎在下面的评论环节中给出你的建议和反馈。喜欢并分享我们,帮助我们传播。 +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/lolcat-command-to-output-rainbow-of-colors-in-linux-terminal/ + +作者:[Avishek Kumar][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal/ +[2]:http://www.tecmint.com/linux-funny-commands/ +[3]:http://www.tecmint.com/play-with-word-and-character-counts-in-linux/ +[4]:http://www.tecmint.com/13-basic-cat-command-examples-in-linux/ \ No newline at end of file diff --git a/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md b/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md deleted file mode 100644 index 4225cf9bb4..0000000000 --- a/translated/tech/20150518 10 Amazing and Mysterious Uses of Symbol or Operator in Linux Commands.md +++ /dev/null @@ -1,193 +0,0 @@ -10!Linux¾˺÷ -================================================================================ -`'!'`Linuxв񶨷ţʷ¼ȡ򲻼޸ĵִ֮ǰеѾBash Shellоȷеؼ顣ûԹ඼ڱShellСǽLinuxз`'!'`Ǿ˺÷ - -### 1. ʹִʷбһִ ### - -ҲûʶԴʷб֮ǰѾִеҳһСȣͨ"history"֮ǰš - - $ history - -![ʹhistoryҵִе](http://www.tecmint.com/wp-content/uploads/2015/05/history-Command.gif) - -ڣֻҪʹʷʾڸǰֱ磬һ`history`б1551 - - $ !1551 - -![ʹIDִе](http://www.tecmint.com/wp-content/uploads/2015/05/Run-Commands-By-number.gif) - -Ϊ1551[top][1]ˡͨIDִ֮ǰķʽãЩܳ¡ֻҪʹ**![history]**Ե - -### 2. ֮ǰĵڶ߸ ### - -һַʽ֮ǰִеͨʹ-1-2ڶ-7߸ȡ - -ʹhistoryִйбhistoryִкбҪΪͨȷû`rm command > file`ᵼΣյִеڰ˸ʮ - - $ history - $ !-6 - $ !-8 - $ !-10 - -![֮ͨǰִе](http://www.tecmint.com/wp-content/uploads/2015/05/3.gif) -֮ͨǰִе - -### 3. ݲԷµ ### - -Ҫʾ`/home/$USER/Binary/firefox`ļеݣִУ - - $ ls /home/$USER/Binary/firefox - -ʶӦִ'ls -l'鿴ĸļǿִļӦôҲҪҽҪµдIJƣ - - $ ls -l !$ - -`!$`ִеIJݵµС - -![һIJݸ](http://www.tecmint.com/wp-content/uploads/2015/05/4.gif) -һIJݸ - -### 4. ʹ!IJ ### - -˵洴һıļfile1.txt - - $ touch /home/avi/Desktop/1.txt - -Ȼcpʹþ·`/home/avi/Downloads` - - $ cp /home/avi/Desktop/1.txt /home/avi/downloads - -ڣǸcpһ`/home/avi/Desktop/1.txt`ڶ`/home/avi/Downloads`Ƿֱǣʹ`echo [arguments]`ӡͬIJ - - $ echo "1st Argument is : !^" - $ echo "2nd Argument is : !cp:2" - -עһʹ`"!^"`дӡͨ`"![]:[]"`ӡ - -Уһ`cp`ڶҲҪӡ`"!cp:2"`κxyzʱ5Ҫõĸʹ`"!xyz:4"`еIJͨ`"!*"`á - -![IJ](http://www.tecmint.com/wp-content/uploads/2015/05/5.gif) -IJ - -### 5. ԹؼΪִϸ ### - -ǿԹؼΪִϴִеԴ⣺ - - $ ls /home > /dev/null [1] - $ ls -l /home/avi/Desktop > /dev/null [2] - $ ls -la /home/avi/Downloads > /dev/null [3] - $ ls -lA /usr/bin > /dev/null [4] - -ʹͬlsвͬĿغͲͬIJļСңǻݵ`/dev/null`Dzδնɺܸɾ - -ԹؼΪִϸ - - $ ! ls [1] - $ ! ls -l [2] - $ ! ls -la [3] - $ ! ls -lA [4] - -淢ʹùؼ`ls`ִѾִй - -![ԹؼΪִ](http://www.tecmint.com/wp-content/uploads/2015/05/6.gif) -ԹؼΪִ - -### 6. !! ### - -ʹ`(!!)`/޸ϸеһЩ޸/ϸҸչʾһЩʵ龳 - -һнűҵ˽IPִˣ - - $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ - -ţͻȻҪűضһip.txtļˣҸôأҸضһļôһ򵥵Ľʹϵ`'> ip.txt'`ضļ - - $ ip addr show | grep inet | grep -v 'inet6'| grep -v '127.0.0.1' | awk '{print $2}' | cut -f1 -d/ > ip.txt - -л"ϵ"ڣһнű - - $ ifconfig | grep "inet addr:" | awk '{print $2}' | grep -v '127.0.0.1' | cut -f2 -d: - -һűBashʾ㷵˴Ϣ`"bash: ifconfig: command not found"`ԭ򲢲Ѳ£˱ӦrootȨ޵е - -ԣôأǺrootû¼ٴμϵҲˡˣҪ`"!!"`ȥţΪǸûϸ - - $ su -c "!!" root - -suлrootûģ`-c`ijûضҪIJ`!!`滻ΪϴеԵģҪṩroot롣 - -![!!](http://www.tecmint.com/wp-content/uploads/2015/05/7.gif) -!! - -ͨ龰ʹ`!!` - -1.ͨûapt-getͨյʾ˵ûȨִС - - $ apt-get upgrade && apt-get dist-upgrade - -ðɣд󡣵ģʹɹִ... - - $ su -c !! - -ͬڣ - - $ service apache2 start - - $ /etc/init.d/apache2 start - - $ systemctl start apache2 - -ͨûȨִЩУ - - $ su -c 'service apache2 start' - - $ su -c '/etc/init.d/apache2 start' - - $ su -c 'systemctl start apache2' - -### 7.һӰг![FILE_NAME]ļ ### - -`!`߼ǣԳ`'!'`ļеļ/չִ - -A.ļƳļ2.txt⡣ - - $ rm !(2.txt) - -B.ļƳеļͣpdfͳ⡣ - - $ rm !(*.pdf) - -### 8.ijļУ/home/avi/TecmintǷڣӡ ### - -ʹ`'! -d'`֤ļǷڣļвʱʹAND`(&&)`дӡļдʱʹOR`(||)`дӡ - -߼ϣ`[ ! -d /home/avi/Tecmint ]`Ϊ0ʱִAND߼ݣִOR߼`(||)`ݡ - - $ [ ! -d /home/avi/Tecmint ] && printf '\nno such /home/avi/Tecmint directory exist\n' || printf '\n/home/avi/Tecmint directory exist\n' - -### 9.ijļǷڣ˳ ### - -ﵱļвʱ˳ - - $ [ ! -d /home/avi/Tecmint ] && exit - -### 10.homeļڲһļУȷ˵test򴴽 ### - -ǽűеһõʵ֣ļвʱһ - - [ ! -d /home/avi/Tecmint ] && mkdir /home/avi/Tecmint - -ȫˡ֪żֵ˽`'!'`ʹ÷ڷĵطὨ顣ϵ - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/mysterious-uses-of-symbol-or-operator-in-linux-commands/ - -ߣ[Avishek Kumar][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://www.tecmint.com/author/avishek/ -[1]:http://www.tecmint.com/12-top-command-examples-in-linux/ diff --git a/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md b/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md deleted file mode 100644 index 7f3e37b3fe..0000000000 --- a/translated/tech/20150520 How to Use tmpfs on RHEL or CentOS 7.0.md +++ /dev/null @@ -1,64 +0,0 @@ -如何在RHEL/CentOS 7.0中使用tmpfs -================================================================================ - 7中的tmpfs,这是一个将所有文件和文件夹写到虚拟内存中而不是实际写到磁盘中的虚拟文件系统。这意味中tmpfs中所有的内容都是临时的,在取消挂载、系统重启或者电源切断后内容都将会丢失。技术的角度上来说,tmpfs将搜有的内容放在内核内部缓存中并且会增大或者缩小来容纳文件并可从交换空间中交换处不需要的页。 - -CentOS默认使用tmpfs做的事可用df -h命令的输出来看: - - # df –h - -![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs1.jpg) - -/dev - 含有针对所有设备的设备文件的目录 -/dev/shm – 包含共享内存分配 -/run - 用于系统日志 -/sys/fs/cgroup - 用于cgrpups, 一个针对特定进程限制、管制和审计资源利用的内核特性 - -/tmp目录, 你可以用下面的两种方法来做到: - -### 使用systemctl来在/tmp中启用tmpfs ### - -你可以使用systemctl命令在tmp目录启用tmpfs, 首先用下面的命令来检查这个特性是否可用: - - # systemctl is-enabled tmp.mount - -这会显示当先的状态,你可以使用下面的命令来启用它: - - # systemctl enable tmp.mount - -![systemctl](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs3.jpg) - -这会控制/tmp目录并挂载tmpfs。 - -### 手动挂载/tmp/文件系统 ### - -你可以在/etc/fstab中添加下面这行在/tmp挂载tmpfs。 - - tmpfs /tmp tmpfs size=512m 0 0 - -接着运行这条命令 - - # mount –a - -![df](http://blog.linoxide.com/wp-content/uploads/2015/05/tmpfs2.jpg) - -这应该就会在df -h中显示tmpfs了,同样也会在你下次重启是会自动挂载。 - -### 立即创建tmpfs ### - -如果由于一些原因,你写昂立即创建tmpfs,你可以使用下面的命令: - - # mount -t tmpfs -o size=1G tmpfs /mnt/mytmpfs - -当然你可以在size选项中指定你希望的大小和希望的挂载点,只要记住是有效的目录就行了。 - --------------------------------------------------------------------------------- - -via: http://linoxide.com/file-system/use-tmpfs-rhel-centos-7-0/ - -作者:[Adrian Dinu][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/adriand/ diff --git a/translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md b/translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md new file mode 100644 index 0000000000..5b6c2fc6bd --- /dev/null +++ b/translated/tech/20150602 Howto Configure OpenVPN Server-Client on Ubuntu 15.04.md @@ -0,0 +1,305 @@ +Ubuntu 15.04上配置OpenVPN服务器-客户端 +================================================================================ +虚拟专用网(VPN)是几种用于建立与其它网络连接的网络技术中常见的一个名称。它被称为虚拟网,因为各个节点的连接不是通过物理线路实现的。而由于没有网络所有者的正确授权是不能通过公共线路访问到网络,所以它是专用的。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/vpn_custom_illustration.jpg) + +[OpenVPN][1]软件通过TUN/TAP驱动的帮助,使用TCP和UDP协议来传输数据。UDP协议和TUN驱动允许NAT后的用户建立到OpenVPN服务器的连接。此外,OpenVPN允许指定自定义端口。它提额外提供了灵活的配置,可以帮助你避免防火墙限制。 + +OpenVPN中,由OpenSSL库和传输层安全协议(TLS)提供了安全和加密。TLS是SSL协议的一个改进版本。 + +OpenSSL提供了两种加密方法:对称和非对称。下面,我们展示了如何配置OpenVPN的服务器端,以及如何预备使用带有公共密钥非对称加密和TLS协议基础结构(PKI)。 + +### 服务器端配置 ### + +首先,我们必须安装OpenVPN。在Ubuntu 15.04和其它带有‘apt’报管理器的Unix系统中,可以通过如下命令安装: + + sudo apt-get install openvpn + +然后,我们必须配置一个密钥对,这可以通过默认的“openssl”工具完成。但是,这种方式十分难。这也是我们使用“easy-rsa”来实现此目的的原因。接下来的命令会将“easy-rsa”安装到系统中。 + + sudo apt-get unstall easy-rsa + +**注意**: 所有接下来的命令要以超级用户权限执行,如在“sudo -i”命令后;此外,你可以使用“sudo -E”作为接下来所有命令的前缀。 + +开始之前,我们需要拷贝“easy-rsa”到openvpn文件夹。 + + mkdir /etc/openvpn/easy-rsa + cp -r /usr/share/easy-rsa /etc/openvpn/easy-rsa + mv /etc/openvpn/easy-rsa/easy-rsa /etc/openvpn/easy-rsa/2.0 + +然后进入到该目录 + + cd /etc/openvpn/easy-rsa/2.0 + +这里,我们开启了一个密钥生成进程。 + +首先,我们编辑一个“var”文件。为了简化生成过程,我们需要在里面指定数据。这里是“var”文件的一个样例: + + export KEY_COUNTRY="US" + export KEY_PROVINCE="CA" + export KEY_CITY="SanFrancisco" + export KEY_ORG="Fort-Funston" + export KEY_EMAIL="my@myhost.mydomain" + export KEY_OU=server + +希望这些字段名称对你而言已经很清楚,不需要进一步说明了。 + +其次,我们需要拷贝openssl配置。另外一个版本已经有现成的配置文件,如果你没有特定要求,你可以使用它的上一个版本。这里是1.0.0版本。 + + cp openssl-1.0.0.cnf openssl.cnf + +第三,我们需要加载环境变量,这些变量已经在前面一步中编辑好了。 + + source ./vars + +生成密钥的最后一步准备工作是清空旧的证书和密钥,以及生成新密钥的序列号和索引文件。可以通过以下命令完成。 + + ./clean-all + +现在,我们完成了准备工作,准备好启动生成进程了。让我们先来生成证书。 + + ./build-ca + +在对话中,我们可以看到默认的变量,这些变量是我们先前在“vars”中指定的。我们可以检查以下,如有必要进行编辑,然后按回车几次。对话如下 + + Generating a 2048 bit RSA private key + .............................................+++ + ...................................................................................................+++ + writing new private key to 'ca.key' + ----- + 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) [US]: + State or Province Name (full name) [CA]: + Locality Name (eg, city) [SanFrancisco]: + Organization Name (eg, company) [Fort-Funston]: + Organizational Unit Name (eg, section) [MyOrganizationalUnit]: + Common Name (eg, your name or your server's hostname) [Fort-Funston CA]: + Name [EasyRSA]: + Email Address [me@myhost.mydomain]: + +接下来,我们需要生成一个服务器密钥 + + ./build-key-server server + +该命令的对话如下: + + Generating a 2048 bit RSA private key + ........................................................................+++ + ............................+++ + writing new private key to 'server.key' + ----- + 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) [US]: + State or Province Name (full name) [CA]: + Locality Name (eg, city) [SanFrancisco]: + Organization Name (eg, company) [Fort-Funston]: + Organizational Unit Name (eg, section) [MyOrganizationalUnit]: + Common Name (eg, your name or your server's hostname) [server]: + Name [EasyRSA]: + Email Address [me@myhost.mydomain]: + + Please enter the following 'extra' attributes + to be sent with your certificate request + A challenge password []: + An optional company name []: + Using configuration from /etc/openvpn/easy-rsa/2.0/openssl-1.0.0.cnf + Check that the request matches the signature + Signature ok + The Subject's Distinguished Name is as follows + countryName :PRINTABLE:'US' + stateOrProvinceName :PRINTABLE:'CA' + localityName :PRINTABLE:'SanFrancisco' + organizationName :PRINTABLE:'Fort-Funston' + organizationalUnitName:PRINTABLE:'MyOrganizationalUnit' + commonName :PRINTABLE:'server' + name :PRINTABLE:'EasyRSA' + emailAddress :IA5STRING:'me@myhost.mydomain' + Certificate is to be certified until May 22 19:00:25 2025 GMT (3650 days) + Sign the certificate? [y/n]:y + 1 out of 1 certificate requests certified, commit? [y/n]y + Write out database with 1 new entries + Data Base Updated + +这里,最后两个关于“签署证书”和“提交”的问题,我们必须回答“yes”。 + +现在,我们已经有了证书和服务器密钥。下一步,就是去省城Diffie-Hellman密钥。执行以下命令,耐心等待。在接下来的几分钟内,我们将看到许多点和加号。 + + ./build-dh + +该命令的输出样例如下 + + Generating DH parameters, 2048 bit long safe prime, generator 2 + This is going to take a long time + ................................+................ + +在漫长的等待之后,我们可以继续生成最后的密钥了,该密钥用于TLS验证。命令如下: + + openvpn --genkey --secret keys/ta.key + +现在,生成完毕,我们可以移动所有生成的文件到最后的位置中。 + + cp -r /etc/openvpn/easy-rsa/2.0/keys/ /etc/openvpn/ + +最后,我们来创建OpenVPN配置文件。让我们从样例中拷贝过来吧: + + cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/ + cd /etc/openvpn + gunzip -d /etc/openvpn/server.conf.gz + +然后编辑 + + vim /etc/openvpn/server.conf + +我们需要指定密钥的自定义路径 + + ca /etc/openvpn/keys/ca.crt + cert /etc/openvpn/keys/server.crt + key /etc/openvpn/keys/server.key # This file should be kept secret + dh /etc/openvpn/keys/dh2048.pem + +一切就绪。在重启OpenVPN后,服务器端配置就完成了。 + + service openvpn restart + +### Unix的客户端配置 ### + +假定我们有一台装有类Unix操作系统的设备,比如Ubuntu 15.04,并安装有OpenVPN。我们想要从先前的部分连接到OpenVPN服务器。首先,我们需要为客户端生成密钥。为了生成该密钥,请转到服务器上的目录中: + + cd /etc/openvpn/easy-rsa/2.0 + +加载环境变量 + + source vars + +然后创建客户端密钥 + + ./build-key client + +我们将看到一个与先前关于服务器密钥生成部分的章节描述一样的对话,填入客户端的实际信息。 + +如果需要密码保护密钥,你需要运行另外一个命令,命令如下 + + ./build-key-pass client + +在此种情况下,在建立VPN连接时,会提示你输入密码。 + +现在,我们需要将以下文件从服务器拷贝到客户端/etc/openvpn/keys/文件夹。 + +服务器文件列表: + +- ca.crt, +- dh2048.pem, +- client.crt, +- client.key, +- ta.key. + +在此之后,我们转到客户端,准备配置文件。配置文件位于/etc/openvpn/client.conf,内容如下 + + dev tun + proto udp + + # IP and Port of remote host with OpenVPN server + remote 111.222.333.444 1194 + + resolv-retry infinite + + ca /etc/openvpn/keys/ca.crt + cert /etc/openvpn/keys/client.crt + key /etc/openvpn/keys/client.key + tls-client + tls-auth /etc/openvpn/keys/ta.key 1 + auth SHA1 + cipher BF-CBC + remote-cert-tls server + comp-lzo + persist-key + persist-tun + + status openvpn-status.log + log /var/log/openvpn.log + verb 3 + mute 20 + +在此之后,我们需要重启OpenVPN以接受新配置。 + + service openvpn restart + +好了,客户端配置完成。 + +### 安卓客户端配置 ### + +安卓设备上的OpenVPN配置和Unix系统上的十分类似,我们需要一个含有配置文件、密钥和证书的包。文件列表如下: + +- configuration file (.ovpn), +- ca.crt, +- dh2048.pem, +- client.crt, +- client.key. + +客户端密钥生成方式和先前章节所述的一样。 + +配置文件内容如下 + + client tls-client + dev tun + proto udp + + # IP and Port of remote host with OpenVPN server + remote 111.222.333.444 1194 + + resolv-retry infinite + nobind + ca ca.crt + cert client.crt + key client.key + dh dh2048.pem + persist-tun + persist-key + + verb 3 + mute 20 + +所有这些文件我们必须移动我们设备的SD卡上。 + +然后,我们需要安装[OpenVPN连接][2]。 + +接下来,配置过程很是简单: + + open setting of OpenVPN and select Import options + select Import Profile from SD card option + in opened window go to folder with prepared files and select .ovpn file + application offered us to create a new profile + tap on the Connect button and wait a second + +搞定。现在,我们的安卓设备已经通过安全的VPN连接连接到我们的专用网。 + +### 尾声 ### + +虽然OpenVPN初始配置花费不少时间,但是简易客户端配置为我们弥补了时间上的损失,也提供了从任何设备连接的能力。此外,OpenVPN提供了一个很高的安全等级,以及从不同地方连接的能力,包括位于NAT后面的客户端。因此,OpenVPN可以同时在家和在企业中使用。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/configure-openvpn-server-client-ubuntu-15-04/ + +作者:[Ivan Zabrovskiy][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/ivanz/ +[1]:https://openvpn.net/ +[2]:https://play.google.com/store/apps/details?id=net.openvpn.openvpn diff --git a/translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md b/translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md new file mode 100644 index 0000000000..65ff38744e --- /dev/null +++ b/translated/tech/20150603 Installing Ruby on Rails using rbenv on Ubuntu 15.04.md @@ -0,0 +1,151 @@ +在Ubuntu 15.04中安装RUby on Rails +================================================================================ +本篇我们会学习如何用rbenv在Ubuntu 15.04中安装Ruby on Rails。我们选择Ubuntu作为操作系统因为Ubuntu是Linux发行版中自带很多包和完整文档的操作系统,因此我认为这是正确的选择。如果你不想安装最新的Ubuntu,你可以从[下载iso文件][1]开始。 + +### 安装 Ruby ### + +我们要做的第一件事是更新Ubuntu包并且为Ruby安装一些依赖。 + + sudo apt-get update + sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev + +有三种方法来安装Ruby比如rbenv,rvm和从源码安装。每种都有各自的好处,但是这些天开发者们更倾向使用rbenv而不是rvm和源码来安装。我们将安装最新的Ruby版本,2.2.2。 + +用rbenv来安装只有简单的两步。第一步安装rbenv接着是ruby-build: + + cd + git clone git://github.com/sstephenson/rbenv.git .rbenv + echo 'eval "$(rbenv init -)"' >> ~/.bashrc + exec $SHELL + + git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build + echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc + exec $SHELL + + git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash + + rbenv install 2.2.2 + rbenv global 2.2.2 + ruby -v + +我们需要安装Bundler但是我们要在安装之前告诉rubygems不要为每个包本地安装文档。 + + echo "gem: --no-ri --no-rdoc" > ~/.gemrc + gem install bundler + +### 配置 GIT ### + +配置git之前,你要创建一个github账号,你可以注册[git][2]。我们需要git作为版本控制系统,因此我们要设置来匹配github账号。 + +用户的github账号来代替下面的**Name** 和 **Email address** 。 + + git config --global color.ui true + git config --global user.name "YOUR NAME" + git config --global user.email "YOUR@EMAIL.com" + ssh-keygen -t rsa -C "YOUR@EMAIL.com" + +接下来用新生成的ssh key添加到github账号中。这样你需要复制下面命令的输出并[粘贴在这][3]。 + + cat ~/.ssh/id_rsa.pub + +如果你做完了,检查是否已经成功。 + + ssh -T git@github.com + +你应该得到下面这样的信息。 + + Hi excid3! You've successfully authenticated, but GitHub does not provide shell access. + +### 安装 Rails ### + +我们需要安装javascript运行时,像NodeJS因为这些天Rails带来很多依赖。这样我们可以结合并缩小你的javascript来提供一个更快的生产环境。 + +我们需要添加PPA来安装nodeJS。 + + sudo add-apt-repository ppa:chris-lea/node.js + sudo apt-get update + sudo apt-get install nodejs + +如果在更新是晕倒了问题,你可以试试这个命令: + + # Note the new setup script name for Node.js v0.12 + curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - + + # Then install with: + sudo apt-get install -y nodejs + +下一步,用这个命令: + + gem install rails -v 4.2.1 + +因为我们正在使用rbenv,用下面的命令来安装rails。 + + rbenv rehash + +要确保rails已经正确安炸u哪个,你可以运行rails -v,显示如下: + + rails -v + # Rails 4.2.1 + +如果你得到的是不同的结果可能是环境没有设置正确。 + +### 设置 MySQL ### + +或许你已经熟悉MySQL了,你可以从Ubuntu的仓库中安装MySQL的客户端与服务端。你可以在安装时设置root用户密码。这个信息将来会进入你rails程序的database.yml文件中、用下面的命令来安装mysql。 + + sudo apt-get install mysql-server mysql-client libmysqlclient-dev + +安装libmysqlclient-dev用于提供在设置rails程序时,rails在连接mysql所需要用到的用于编译mysql2 gem的文件。 + +### 最后一步 ### + +让我们尝试创建你的第一个rails程序: + + # Use MySQL + + rails new myapp -d mysql + + # Move into the application directory + + cd myapp + + # Create Database + + rake db:create + + rails server + +访问http://localhost:3000来访问你的新网站。现在你的电脑上已经可以构建rails程序了。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/localhost_3000.png) + +如果你在创建数据库时遇到了“Access denied for user 'root'@'localhost' (Using password: NO)”这个错误信息,你需要更新你的config/database.yml文件来匹配数据库的**用户名**和**密码**。 + + # Edit your database.yml in config folder + + nano config/database.yml + +接着输入MySql root用户的密码。 + +![](http://blog.linoxide.com/wp-content/uploads/2015/05/root_passw.png) + +退出 (Ctrl+X)并保存。 + +### 总结 ### + +Rails是用Ruby写的, 也就是随着rails一起使用的编程语言。在Ubuntu 15.04中Ruby on Rails可以用rbenv、 rvm和源码的方式来安装。本篇我们使用的是rbenv方式并用了MySQL作为数据库。有任何的问题或建议,请在评论栏指出。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/ubuntu-how-to/installing-ruby-rails-using-rbenv-ubuntu-15-04/ + +作者:[Obet][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/obetp/ +[1]:http://release.ubuntu.com/15.04 +[2]:http://github.com +[3]:https://github.com/settings/ssh diff --git a/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md b/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md new file mode 100644 index 0000000000..1d476d0f18 --- /dev/null +++ b/translated/tech/20150604 Nishita Agarwal Shares Her Interview Experience on Linux 'iptables' Firewall.md @@ -0,0 +1,205 @@ +Nishita Agarwal分享它关于Linux防火墙'iptables'的面试经验 +================================================================================ +Nishita Agarwal是Tecmint的用户,她将分享关于她刚刚经历的一家公司(私人公司Pune,印度)的面试经验。在面试中她被问及许多不同的问题,但她是iptables方面的专家,因此她想分享这些关于iptables的问题和相应的答案给那些以后可能会进行相关面试的人。 + +![Linux防火墙Iptables面试问题](http://www.tecmint.com/wp-content/uploads/2015/05/Linux-iptables-Interview-Questions.jpg) + +所有的问题和相应的答案都基于Nishita Agarwal的记忆并经过了重写。 + +> “嗨,朋友!我叫**Nishita Agarwal**。我已经取得了理学学士学位,我的专业集中在UNIX和它的变种(BSD,Linux)。它们一直深深的吸引着我。我在存储方面有1年多的经验。我正在寻求职业上的变化,并将供职于印度的Pune公司。” + +下面是我在面试中被问到的问题的集合。我已经把我记忆中有关iptables的问题和它们的答案记录了下来。希望这会对您未来的面试有所帮助。 + +### 1. 你听说过Linux下面的iptables和Firewalld么?知不知道它们是什么,是用来干什么的? ### + +> **答案** : iptables和Firewalld我都知道,并且我已经使用iptables好一段时间了。iptables主要由C语言写成,并且以GNU GPL许可证发布。它是从系统管理员的角度写的,最新的稳定版是iptables 1.4.21。iptables通常被认为是类UNIX系统中的防火墙,更准确的说,可以称为iptables/netfilter。管理员通过终端/GUI工具与iptables打交道,来添加和定义防火墙规则到预定义的表中。Netfilter是内核中的一个模块,它执行过滤的任务。 +> +> Firewalld是RHEL/CentOS 7(也许还有其他发行版,但我不太清楚)中最新的过滤规则的实现。它已经取代了iptables接口,并与netfilter相连接。 + +### 2. 你用过一些iptables的GUI或命令行工具么? ### + +> **答案** : 虽然我既用过GUI工具,比如与[Webmin][1]结合的Shorewall;以及直接通过终端访问iptables。但我必须承认通过Linux终端直接访问iptables能给予用户更高级的灵活性、以及对其背后工作更好的理解的能力。GUI适合初级管理员而终端适合有经验的管理员。 + +### 3. 那么iptables和firewalld的基本区别是什么呢? ### + +> **答案** : iptables和firewalld都有着同样的目的(包过滤),但它们使用不同的方式。iptables与firewalld不同,在每次发生更改时都刷新整个规则集。通常iptables配置文件位于‘/etc/sysconfig/iptables‘,而firewalld的配置文件位于‘/etc/firewalld/‘。firewalld的配置文件是一组XML文件。以XML为基础进行配置的firewalld比iptables的配置更加容易,但是两者都可以完成同样的任务。例如,firewalld可以在自己的命令行界面以及基于XML的配置文件下使用iptables。 + +### 4. 如果有机会的话,你会在你所有的服务器上用firewalld替换iptables么? ### + +> **答案** : 我对iptables很熟悉,它也工作的很好。如果没有任何需求需要firewalld的动态特性,那么没有理由把所有的配置都从iptables移动到firewalld。通常情况下,目前为止,我还没有看到iptables造成什么麻烦。IT技术的通用准则也说道“为什么要修一件没有坏的东西呢?”。上面是我自己的想法,但如果组织愿意用firewalld替换iptables的话,我不介意。 + +### 5. 你看上去对iptables很有信心,巧的是,我们的服务器也在使用iptables。 ### + +iptables使用的表有哪些?请简要的描述iptables使用的表以及它们所支持的链。 + +> **答案** : 谢谢您的赞赏。至于您问的问题,iptables使用的表有四个,它们是: +> +> Nat 表 +> Mangle 表 +> Filter 表 +> Raw 表 +> +> Nat表 : Nat表主要用于网络地址转换。根据表中的每一条规则修改网络包的IP地址。流中的包仅遍历一遍Nat表。例如,如果一个通过某个接口的包被修饰(修改了IP地址),该流中其余的包将不再遍历这个表。通常不建议在这个表中进行过滤,由NAT表支持的链称为PREROUTING Chain,POSTROUTING Chain和OUTPUT Chain。 +> +> Mangle表 : 正如它的名字一样,这个表用于校正网络包。它用来对特殊的包进行修改。它能够修改不同包的头部和内容。Mangle表不能用于地址伪装。支持的链包括PREROUTING Chain,OUTPUT Chain,Forward Chain,InputChain和POSTROUTING Chain。 +> +> Filter表 : Filter表是iptables中使用的默认表,它用来过滤网络包。如果没有定义任何规则,Filter表则被当作默认的表,并且基于它来过滤。支持的链有INPUT Chain,OUTPUT Chain,FORWARD Chain。 +> +> Raw表 : Raw表在我们想要配置之前被豁免的包时被使用。它支持PREROUTING Chain 和OUTPUT Chain。 + +### 6. 简要谈谈什么是iptables中的目标值(能被指定为目标),他们有什么用 ### + +> **答案** : 下面是在iptables中可以指定为目标的值: +> +> ACCEPT : 接受包 +> QUEUE : 将包传递到用户空间 (应用程序和驱动所在的地方) +> DROP : 丢弃包 +> RETURN : 将控制权交回调用的链并且为当前链中的包停止执行下一调规则 + +### 7. 让我们来谈谈iptables技术方面的东西,我的意思是说实际使用方面 ### + +你怎么检测在CentOS中安装iptables时需要的iptables的rpm? + +> **答案** : iptables已经被默认安装在CentOS中,我们不需要单独安装它。但可以这样检测rpm: +> +> # rpm -qa iptables +> +> iptables-1.4.21-13.el7.x86_64 +> +> 如果您需要安装它,您可以用yum来安装。 +> +> # yum install iptables-services + +### 8. 怎样检测并且确保iptables服务正在运行? ### + +> **答案** : 您可以在终端中运行下面的命令来检测iptables的状态。 +> +> # service status iptables [On CentOS 6/5] +> # systemctl status iptables [On CentOS 7] +> +> 如果iptables没有在运行,可以使用下面的语句 +> +> ---------------- 在CentOS 6/5下 ---------------- +> # chkconfig --level 35 iptables on +> # service iptables start +> +> ---------------- 在CentOS 7下 ---------------- +> # systemctl enable iptables +> # systemctl start iptables +> +> 我们还可以检测iptables的模块是否被加载: +> +> # lsmod | grep ip_tables + +### 9. 你怎么检查iptables中当前定义的规则呢? ### + +> **答案** : 当前的规则可以简单的用下面的命令查看: +> +> # iptables -L +> +> 示例输出 +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +### 10. 你怎样刷新所有的iptables规则或者特定的链呢? ### + +> **答案** : 您可以使用下面的命令来刷新一个特定的链。 +> +> # iptables --flush OUTPUT +> +> 要刷新所有的规则,可以用: +> +> # iptables --flush + +### 11. 请在iptables中添加一条规则,接受所有从一个信任的IP地址(例如,192.168.0.7)过来的包。 ### + +> **答案** : 上面的场景可以通过运行下面的命令来完成。 +> +> # iptables -A INPUT -s 192.168.0.7 -j ACCEPT +> +> 我们还可以在源IP中使用标准的斜线和子网掩码: +> +> # iptables -A INPUT -s 192.168.0.7/24 -j ACCEPT +> # iptables -A INPUT -s 192.168.0.7/255.255.255.0 -j ACCEPT + +### 12. 怎样在iptables中添加规则以ACCEPT,REJECT,DENY和DROP ssh的服务? ### + +> **答案** : 但愿ssh运行在22端口,那也是ssh的默认端口,我们可以在iptables中添加规则来ACCEPT ssh的tcp包(在22号端口上)。 +> +> # iptables -A INPUT -s -p tcp --dport 22 -j ACCEPT +> +> REJECT ssh服务(22号端口)的tcp包。 +> +> # iptables -A INPUT -s -p tcp --dport 22 -j REJECT +> +> DENY ssh服务(22号端口)的tcp包。 +> +> +> # iptables -A INPUT -s -p tcp --dport 22 -j DENY +> +> DROP ssh服务(22号端口)的tcp包。 +> +> +> # iptables -A INPUT -s -p tcp --dport 22 -j DROP + +### 13. 让我给你另一个场景,假如有一台电脑的本地IP地址是192.168.0.6。你需要封锁在21、22、23和80号端口上的连接,你会怎么做? ### + +> **答案** : 这时,我所需要的就是在iptables中使用‘multiport‘选项,并将要封锁的端口号跟在它后面。上面的场景可以用下面的一条语句搞定: +> +> # iptables -A INPUT -s 192.168.0.6 -p tcp -m multiport --dport 22,23,80,8080 -j DROP +> +> 可以用下面的语句查看写入的规则。 +> +> # iptables -L +> +> Chain INPUT (policy ACCEPT) +> target prot opt source destination +> ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED +> ACCEPT icmp -- anywhere anywhere +> ACCEPT all -- anywhere anywhere +> ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> DROP tcp -- 192.168.0.6 anywhere multiport dports ssh,telnet,http,webcache +> +> Chain FORWARD (policy ACCEPT) +> target prot opt source destination +> REJECT all -- anywhere anywhere reject-with icmp-host-prohibited +> +> Chain OUTPUT (policy ACCEPT) +> target prot opt source destination + +**面试官** : 好了,我问的就是这些。你是一个很有价值的雇员,我们不会错过你的。我将会向HR推荐你的名字。如果你有什么问题,请问我。 + +作为一个候选人我不愿不断的问将来要做的项目的事以及公司里其他的事,这样会打断愉快的对话。更不用说HR轮会不会比较难,总之,我获得了机会。 + +同时我要感谢Avishek和Ravi(我的朋友)花时间帮我整理我的面试。 + +朋友!如果您有过类似的面试,并且愿意与数百万Tecmint读者一起分享您的面试经历,请将您的问题和答案发送到admin@tecmint.com。 + +谢谢!保持联系。如果我能更好的回答我上面的问题的话,请记得告诉我。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/linux-firewall-iptables-interview-questions-and-answers/ + +作者:[Avishek Kumar][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://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/install-webmin-web-based-system-administration-tool-for-rhel-centos-fedora/ diff --git a/translated/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md b/translated/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md new file mode 100644 index 0000000000..9665855542 --- /dev/null +++ b/translated/tech/20150612 How to Configure Apache Containers with Docker on Fedora 22.md @@ -0,0 +1,279 @@ +如何在Fedora 22上面配置Apache的Docker容器 +============================================================================= +在这篇文章中,我们将会学习关于Docker的一些知识,如何使用Docker部署Apache httpd服务,并且共享到Docker Hub上面去。首先,我们学习怎样拉取和使用Docker Hub里面的镜像,然后交互式地安装Apache到一个Fedora 22的镜像里去,之后我们将会学习如何用一个Dockerfile文件来制作一个镜像,以一种更快,更优雅的方式。最后,我们会在Docker Hub上公开我们创建地镜像,这样以后任何人都可以下载并使用它。 + +### 安装Docker,运行hello world ### + +**要求** + +运行Docker,里至少需要满足这些: + +- 你需要一个64位的内核,版本3.10或者更高 +- Iptables 1.4 - Docker会用来做网络配置,如网络地址转换(NAT) +- Git 1.7 - Docker会使用Git来与仓库交流,如Docker Hub +- ps - 在大多数环境中这个工具都存在,在procps包里有提供 +- root - 防止一般用户可以通过TCP或者其他方式运行Docker,为了简化,我们会假定你就是root + +### 使用dnf安装docker ### + +以下的命令会安装Docker + + dnf update && dnf install docker + +**注意**:在Fedora 22里,你仍然可以使用Yum命令,但是被DNF取代了,而且在纯净安装时不可用了。 + +### 检查安装 ### + +我们将要使用的第一个命令是docker info,这会输出很多信息给你: + + docker info + +也可以试着用**docker version**: + + docker version + +### 启动Dcoker为守护进程 ### + +你应该启动一个docker实例,然后她会处理我们的请求。 + + docker -d + +让我们用Busybox来打印hello world: + + dockr run -t busybox /bin/echo "hello world" + +这个命令里,我们告诉Docker执行 /bin/echo "hello world",在Busybox镜像的一个实例/容器里。Busybox是一个小型的POSIX环境,将许多小工具都结合到了一个单独的可执行程序里。 + +如果Docker不能在你的系统里找到本地的Busybox镜像,她就会自动从Docker Hub里拉取镜像,正如你可以看下如下的快照: + +![Hello world with Busybox](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-hello-world-busybox-complete.png) + +Hello world with Busybox + +再次尝试相同的命令,这次由于Docker已经有了本地的Busybox镜像,所有你将会看到的就是echo的输出: + + docker run -t busybox /bin/echo "hello world" + +也可以尝试以下的命令进入到容器环境里去: + + docker run -it busybox /bin/sh + +使用**exit**命令可以离开容器并停止它 + +### 交互式地Docker化Apache ### + +拉取/下载 Fedora 镜像: + + docker pull fedora:22 + +起一个容器在后台运行: + + docker run -d -t fedora:22 /bin/bash + +列出正在运行地容器,并用名字标识,如下 + + docker ps + +![listing with docker ps and attaching with docker attach](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-ps-with-docker-attach-highlight.png) + +使用docker ps列出,并使用docker attach进入一个容器里 + +angry_noble是docker分配给我们容器的名字,所以我们来附上去: + + docker attach angry_noble + +注意:每次你起一个容器,就会被给与一个新的名字,如果你的容器需要一个固定的名字,你应该在 docker run 命令里使用 -name 参数。 + +### 安装Apache ### + +下面的命令会更新DNF的数据库,下载安装Apache(httpd包)并清理dnf缓存使镜像尽量小 + + dnf -y update && dnf -y install httpd && dnf -y clean all + +配置Apache + +我们需要修改httpd.conf的唯一地方就是ServerName,这会使Apache停止抱怨 + + sed -i.orig 's/#ServerName/ServerName/' /etc/httpd/conf/httpd.conf + +**设定环境** + +为了使Apache运行为单机模式,你必须以环境变量的格式提供一些信息,并且你也需要在这些变量里的目录设定,所以我们将会用一个小的shell脚本干这个工作,当然也会启动Apache + + vi /etc/httpd/run_apache_foreground + +---------- + + #!/bin/bash + + #set variables + APACHE_LOG_DI=R"/var/log/httpd" + APACHE_LOCK_DIR="/var/lock/httpd" + APACHE_RUN_USER="apache" + APACHE_RUN_GROUP="apache" + APACHE_PID_FILE="/var/run/httpd/httpd.pid" + APACHE_RUN_DIR="/var/run/httpd" + + #create directories if necessary + if ! [ -d /var/run/httpd ]; then mkdir /var/run/httpd;fi + if ! [ -d /var/log/httpd ]; then mkdir /var/log/httpd;fi + if ! [ -d /var/lock/httpd ]; then mkdir /var/lock/httpd;fi + + #run Apache + httpd -D FOREGROUND + +**另外地**,你可以粘贴这个片段代码到容器shell里并运行: + + dnf -y install git && git clone https://github.com/gaiada/run-apache-foreground.git && cd run-apach* && ./install && dnf erase git + +上面的内嵌脚本会安装Git,克隆[这个仓库][1],到文件里去运行脚本,并询问你是否卸载Git。 + +**保存你的容器状态** + +你的容器现在可以运行Apache,是时候保存容器当前的状态为一个镜像,以备你需要的时候使用。 + +为了离开容器环境,你必须顺序按下 **Ctrl+q** 和 **Ctrl+p**,如果你仅仅在shell执行exit,你同时也会停止容器,失去目前为止你做过的所有工作。 + +回到Docker主机,使用 **docker commit** 加容器和你期望的仓库名字/标签: + + docker commit angry_noble gaiada/apache + +现在,你保存了容器的状态到一个镜像里,可以使用 **docker stop** 停止容器了: + + docker stop angry_noble + +**运行并测试你的镜像** + +最后,从你的新镜像起一个容器,并且重定向80端口到容器: + + docker run -p 80:80 -d -t gaiada/apache /etc/httpd/run_apache_foreground + + + +到目前,你正在你的容器里运行Apache,打开你的浏览器访问该服务,在[http://localhost][2],你将会看到如下Apache默认的页面 + +![Apache default page running from Docker container](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-apache-running.png) + +在容器里运行的Apache默认页面 + +### 使用Dockerfile Docker化Apache ### + +现在,我们将要去创建一个新的Apache镜像,这次所有步骤会写在一个Dockerfile文件里,文件将会被用于生成该镜像。 + +首先,新建一个目录,在里面放Dockerfile文件,并进入该目录: + + mkdir apachedf; cd apachedf + +然后创建一个名为Dockerfile的文件,添加以下内容: + + FROM fedora:22 + + MAINTAINER Carlos Alberto + LABEL version="0.1" + + RUN dnf -y update && dnf -y install httpd && dnf -y clean all + + RUN [ -d /var/log/httpd ] || mkdir /var/log/httpd + RUN [ -d /var/run/httpd ] || mkdir /var/run/httpd + RUN [ -d /var/lock/httpd ] || mkdir /var/lock/httpd + + RUN sed -i.orig 's/#ServerName/ServerName/' /etc/httpd/conf/httpd.conf + + ENV APACHE_RUN_USER apache + ENV APACHE_RUN_GROUP apache + ENV APACHE_LOG_DIR /var/log/httpd + ENV APACHE_LOCK_DIR /var/lock/httpd + ENV APACHE_RUN_DIR /var/run/httpd + ENV APACHE_PID_FILE /var/run/httpd/httpd.pid + + EXPOSE 80 + + CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"] + + + +我们一起来看看Dockerfile里面有什么: + +**FROM** - 这告诉docker,我们将要使用Fedora 22作为基础镜像 + +**MAINTAINER** 和 **LABLE** - 这些命令对镜像没有直接作用,属于标记信息 + +**RUN** - 自动完成我们之前交互式做的工作,安装Apache,新建目录并编辑httpd.conf + +**ENV** - 设置环境变量,现在我们再不需要run_apache_foreground脚本 + +**EXPOSE** - 暴露80端口给外网 + +**CMD** - 设置默认的命令启动httpd服务,这样我们就不需要每次起一个新的容器都重复这个工作 + +**建立该镜像** + +现在,我们将要建立这个镜像,并为其添加tag gaiada/apachedf + + docker build -t gaiada/apachedf:0.1 . + +![docker build complete](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-build-complete.png) + +docker完成创建 + +使用 **docker images** 列出本地镜像,查看是否存在你新建的镜像: + + docker images + +然后运行新的镜像: + + docker run -t -p 80:80 gaiada/apachedf + +这就是Dockerfile的工作,使用这项功能会使得事情更加容易,快速并且可重复生成。 + +### 公开你的镜像 ### + +直到现在,你仅仅是从Docker Hub拉取了镜像,但是你也可以推送你的镜像,以后需要也可以再次拉取他们。实际上,其他人也可以下载你的镜像,在他们的系统中使用它而不需要改变任何东西。现在我们将要学习如何使我们的镜像对世界上的其他人可用。 + +**创建帐号** + +为了能够在Docker Hub上推送你的镜像,你需要创建一个帐号。访问 [https://hub.docker.com/account/signup/][3],填写下面的表格: + +![Docker Hub signup page](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-hub-signup.png) + +Docker Hub 注册页面 + +**登录** + +输入下面的命令,接着输入你注册时提供的用户名,密码和邮箱 + + docker login + +第一次登录过后,你的帐号信息会被记录在 **~/.dockercfg** + +**推送** + +推送镜像,使用 **docker push [registry/]your_login/repository_name[:tag]** + + docker push docker.io/gaiada/apachedf + +你可能会看见像这样的输出,在你的控制台上: + +![Docker push Apache image complete](http://blog.linoxide.com/wp-content/uploads/2015/06/docker-pushing-apachedf-complete.png) + +Docker推送Apache镜像完成 + +### 结论 ### + +现在,你知道如何Docker化Apache,试一试包含其他一些组块,Perl,PHP,proxy,HTTPS,或者任何你需要的东西。我希望你们这些家伙喜欢她,并推送你们自己的镜像到Docker Hub。 + +-------------------------------------------------------------------------------- + +via: http://linoxide.com/linux-how-to/configure-apache-containers-docker-fedora-22/ + +作者:[Carlos Alberto][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://linoxide.com/author/carlosal/ +[1]:https://github.com/gaiada/run-apache-foreground +[2]:http://localhost/ +[3]:https://hub.docker.com/account/signup/ + diff --git a/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md b/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md new file mode 100644 index 0000000000..5057c2e416 --- /dev/null +++ b/translated/tech/20150616 Installing LAMP Linux, Apache, MariaDB, PHP or PhpMyAdmin in RHEL or CentOS 7.0.md @@ -0,0 +1,239 @@ +在RHEL/CentOS 7.0中安装LAMP(Linux、 Apache、 MariaDB、 PHP/PhpMyAdmin) +================================================================================ +跳过LAMP的介绍因为我认为你们大多数已经知道了。这个教程会集中在如何在升级到Apache 2.4的 Red Hat Enterprise Linux 7.0 和 CentOS 7.0中安装和配置LAMP-Linux Apache、 MariaDB、 PHP、PhpMyAdmin。 + +![Install LAMP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-LAMP-in-CentOS-7.jpg) + +在RHEL/CentOS 7.0中安装LAMP + +#### 要求 #### + +根据使用的发行版,RHEL 或者 CentOS 7.0使用下面的链接来执行最小的系统安装,网络使用静态ip + +**对于RHEL 7.0** + +- [RHEL 7.0安装过程][1] +- [在RHEL 7.0中注册和启用订阅仓库][2] + +**对于 CentOS 7.0** + +- [CentOS 7.0 安装过程][3] + +### 第一步: 使用基本配置安装apache ### + +**1. 在执行最小系统安装并配置[在RHEL/CentOS 7.0中配置静态ip][4]**就可以从使用下面的命令从官方仓库安装最新的Apache 2.4 httpd服务。 + + # yum install httpd + +![Install Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-Apache-in-CentOS-7.png) + +安装apache服务 + +**2. 安装安城后,使用下面的命令来管理apache守护进程,因为RHEL and CentOS 7.0都将init脚本从SysV升级到了systemd - 你也可以同事使用SysV和Apache脚本来管理服务。** + + # systemctl status|start|stop|restart|reload httpd + + 或者 + + # service httpd status|start|stop|restart|reload + + 或者 + + # apachectl configtest| graceful + +![Start Apache in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Start-Apache-in-CentOS-7.png) + +启动apache服务 + +**3. 下一步使用systemd初始化脚本来启动apache服务并用firewall-cmd打开RHEL/CentOS 7.0防火墙规则, 这是通过firewalld守护进程管理iptables的默认命令。** + + # firewall-cmd --add-service=http + +**注意**:上面的命令会在系统重启或者firewalld服务重启后失效,因为它是即时的规则,它不会永久生效。要使iptables规则在fiewwall中持久化,使用-permanent选项并重启firewalld服务来生效。 + + # firewall-cmd --permanent --add-service=http + # systemctl restart firewalld + +![Enable Firewall in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Firewall-in-CentOS-7.png) + +在CentOS 7中启用Firewall + +下面是firewalld其他的重要选项: + + # firewall-cmd --state + # firewall-cmd --list-all + # firewall-cmd --list-interfaces + # firewall-cmd --get-service + # firewall-cmd --query-service service_name + # firewall-cmd --add-port=8080/tcp + +**4. 要验证apache的功能,打开一个远程浏览器并使用http协议输入你服务器的ip地址(http://server_IP), 应该会显示下图中的默认页面。** + +![Apache Default Page](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Default-Page.png) + +Apache默认页 + +**5. 现在apache的根地址在/var/www/html,该目录中没有提供任何index文件。如果你想要看见根目录下的文件夹列表,打开apache欢迎配置文件并设置 下Indexes前的状态从-到+,下面的截图就是一个例子。** + + # nano /etc/httpd/conf.d/welcome.conf + +![Apache Directory Listing](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Directory-Listing.png) + +Apache目录列出 + +**6. 关闭文件,重启apache服务来使设置生效,重载页面来看最终效果。** + + # systemctl restart httpd + +![Apache Index File](http://www.tecmint.com/wp-content/uploads/2014/07/Apache-Index-File.png) + +Apache Index 文件 + +### 第二步: 为Apache安装php5支持 ### + + +**7. 在为apache安装php支持之前,使用下面的命令的得到所有可用的php模块和扩展。** + + # yum search php + +![Install PHP in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-in-CentOS-7.png) + +在 + +**8. Depending on what type of applications you want to use, install the required PHP modules from the above list, but for a basic MariaDB support in PHP and PhpMyAdmin you need to install the following modules.** + + # yum install php php-mysql php-pdo php-gd php-mbstring + +![Install PHP Modules in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-Modules-in-CentOS-7.png) + +Install PHP Modules + +![Install PHP mbstring Module](http://www.tecmint.com/wp-content/uploads/2014/07/Install-PHP-mbstring-in-CentOs-7.png) + +Install PHP mbstring Module + +**9. To get a full information list on PHP from your browser, create a info.php file on Apache Document Root using the following command from root account, restart httpd service and direct your browser to the http://server_IP/info.php address.** + + # echo "" > /var/www/html/info.php + # systemctl restart httpd + +![Check PHP Info in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Check-PHP-Info-in-CentOS-7.png) + +Check PHP Info in CentOS 7 + +**10. If you get an error on PHP Date and Timezone, open php.ini configuration file, search and uncomment date.timezone statement, append your physical location and restart Apache daemon.** + + # nano /etc/php.ini + +Locate and change date.timezone line to look like this, using [PHP Supported Timezones list][5]. + + date.timezone = Continent/City + +![Set Timezone in PHP](http://www.tecmint.com/wp-content/uploads/2014/07/Set-Time-Zone-in-CentOS.png) + +Set Timezone in PHP + +### Step 3: Install and Configure MariaDB Database ### + +**11. Red Hat Enterprise Linux/CentOS 7.0 switched from MySQL to MariaDB for its default database management system. To install MariaDB database use the following command.** + + # yum install mariadb-server mariadb + +![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Install-MariaDB-in-CentOs-7.png) + +在CentOS 7中安装PHP + +***12. 安装MariaDB后,开启数据库守护进程并使用mysql_secure_installation脚本来保护数据库(设置root密码、禁止远程root登录、移除测试数据库、移除匿名用户)** + + # systemctl start mariadb + # mysql_secure_installation + +![Start MariaDB Database](http://www.tecmint.com/wp-content/uploads/2014/07/Start-MariaDB-in-CentOS-7.png) + +启动MariaDB数据库 + +![Secure MySQL Installation](http://www.tecmint.com/wp-content/uploads/2014/07/Secure-MySQL-Installation.png) + +MySQL安全设置 + +**13. 要测试数据库功能,使用root账户登录MariaDB并用quit退出。** + + mysql -u root -p + MariaDB > SHOW VARIABLES; + MariaDB > quit + +![Connect MySQL Database in CentOS](http://www.tecmint.com/wp-content/uploads/2014/07/Connect-MySQL-Installation.png) + +连接MySQL数据库 + +### 第四步: 安装PhpMyAdmin ### + +**14. RHEL 7.0 或者 CentOS 7.0仓库默认没有提供PhpMyAdmin二进制安装包。如果你不适应使用MySQL命令行来管理你的数据库,你可以通过下面的命令启用CentOS 7.0 rpmforge仓库来安装PhpMyAdmin。** + + # yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm + +启用rpmforge仓库后,下面安装PhpMyAdmin。 + + # yum install phpmyadmin + +![Enable RPMForge in CentOS 7](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-RPMForge-in-CentOS-7.png) + +启用RPMForge仓库 + +**15. 下面配置PhpMyAdmin的phpmyadmin.conf来允许远程连接,它位于Apache conf.d目录下,并注释掉下面的行。** + + # nano /etc/httpd/conf.d/phpmyadmin.conf + +使用#来注释掉行。 + + # Order Deny,Allow + # Deny from all + # Allow from 127.0.0.1 + +![Allow Remote PhpMyAdmin Access](http://www.tecmint.com/wp-content/uploads/2014/07/Allow-Remote-PhpMyAdmin-Access.png) + +允许远程PhpMyAdmin访问 + +**16. 要使用cookie验证来登录PhpMyAdmin,像下面的截图那样使用[生成字符串][6]添加一个blowfish字符串到config.inc.php文件下,重启apache服务并打开URL:http://server_IP/phpmyadmin/。** + + # nano /etc/httpd/conf.d/phpmyadmin.conf + # systemctl restart httpd + +![Add Blowfish in PhpMyAdmin](http://www.tecmint.com/wp-content/uploads/2014/07/Add-Blowfish-PhpMyAdmin.png) + +在PhpMyAdmin中添加Blowfish + +![PhpMyAdmin Dashboard](http://www.tecmint.com/wp-content/uploads/2014/07/Login-to-PhpMyAdmin.png) + +PhpMyAdmin面板 + +### 第五步: 系统范围启用LAMP ### + +**17. 如果你需要在重启后自动运行MariaDB和Apache服务,你需要系统级地启用它们。** + + # systemctl enable mariadb + # systemctl enable httpd + +![Enable Services System Wide](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-Services-System-Wide.png) + +系统级启用服务 + +这就是在Red Hat Enterprise 7.0或者CentOS 7.0中安装LAMP的过程。CentOS/RHEL 7.0上关于LAMP洗系列文章将会讨论在Apache中创建虚拟主机,生成SSL证书、密钥和添加SSL事物支持。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/install-lamp-in-centos-7/ + +作者:[Matei Cezar][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/cezarmatei/ +[1]:http://www.tecmint.com/redhat-enterprise-linux-7-installation/ +[2]:http://www.tecmint.com/enable-redhat-subscription-reposiories-and-updates-for-rhel-7/ +[3]:http://www.tecmint.com/centos-7-installation/ +[4]:http://www.tecmint.com/configure-network-interface-in-rhel-centos-7-0/ +[5]:http://php.net/manual/en/timezones.php +[6]:http://www.question-defense.com/tools/phpmyadmin-blowfish-secret-generator diff --git a/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md b/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md new file mode 100644 index 0000000000..fac7fa2e1b --- /dev/null +++ b/translated/tech/20150616 LINUX 101--POWER UP YOUR SHELL.md @@ -0,0 +1,177 @@ +LINUX 101: 让你的 SHELL 更强大 +================================================================================ +> 在我们的有关 shell 基础的指导下, 得到一个更灵活,功能更强大且多彩的命令行界面 + +**为何要这样做?** + +- 使得在 shell 提示符下过得更轻松,高效 +- 在失去连接后恢复先前的会话 +- Stop pushing around that fiddly rodent! (注: 我不知道这句该如何翻译) + +![bash1](http://www.linuxvoice.com/wp-content/uploads/2015/02/bash1-large15.png) + +Here’s our souped-up prompt on steroids.(注: 我不知道该如何翻译这句)对于这个细小的终端窗口来说,这或许有些长.但你可以根据你的喜好来调整它的大小. + +作为一个 Linux 用户, 对 shell (又名为命令行),你可能会熟悉. 或许你需要时不时的打开终端来完成那些不能在 GUI 下处理的必要任务,抑或是因为你处在一个平铺窗口管理器的环境中, 而 shell 是你与你的 linux 机器交互的主要方式. + +在上面的任一情况下,你可能正在使用你所使用的发行版本自带的 Bash 配置. 尽管对于大多数的任务而言,它足够强大,但它可以更加强大. 在本教程中,我们将向你展示如何使得你的 shell 更具信息性,更加实用且更适于在其中工作. 我们将对提示符进行自定义,让它比默认情况下提供更好的反馈,并向你展示如何使用炫酷的 `tmux` 工具来管理会话并同时运行多个程序. 并且,为了让眼睛舒服一点,我们还将关注配色方案. 接着,就让我们向前吧! + +### 让提示符 "唱歌" ### + +大多数的发行版本配置有一个非常简单的提示符 – 它们大多向你展示了一些基本信息, 但提示符可以为你提供更多的内容.例如,在 Debian 7 下,默认的提示符是这样的: + + mike@somebox:~$ + +上面的提示符展示出了用户,主机名,当前目录和账户类型符号(假如你切换到 root 账户, **$** 会变为 # ). 那这些信息是在哪里存储的呢? 答案是:在 **PS1** 环境变量中. 假如你键入 **echo $PS1**, 你将会在这个命令的输出字符串的最后有如下的字符: + + \u@\h:\w$ (注:这里没有加上斜杠 \,应该是没有转义 ,下面的有些命令也一样,我把 \ 都加上了,发表的时候也得注意一下) + +这看起来有一些丑陋,并在瞥见它的第一眼时,你可能会开始尖叫,认为它是令人恐惧的正则表达式,但我们不打算用这些复杂的字符来煎熬我们的大脑. 这不是正则表达式, 这里的斜杠是转义序列,它告诉提示符进行一些特别的处理. 例如,上面的 **u** 部分,告诉提示符展示用户名, 而 w 则展示工作路径. + +下面是一些你可以在提示符中用到的字符的列表: + +- d 当前的日期. +- h 主机名. +- n 代表新的一行的字符. +- A 当前的时间 (HH:MM). +- u 当前的用户. +- w (小写) 整个工作路径的全称. +- W (大写) 工作路径的简短名称. +- $ 一个提示符号,对于 root 用户为 # 号. +- ! 当前命令在 shell 历史记录中的序号. + +下面解释 **w** 和 **W** 选项的区别: 对于前者,你将看到你所在的工作路径的完整地址,(例如 **/usr/local/bin**), 而对于后者, 它则只显示 **bin** 这一部分. + +现在, 我们该怎样改变提示符呢? 你需要更改 **PS1** 环境变量的内容, 试试下面这个: + + export PS1=”I am \u and it is \A $” + +现在, 你的提示符将会像下面这样: + + I am mike and it is 11:26 $ + +从这个例子出发, 你就可以按照你的想法来试验一下上面列出的其他转义序列. 但稍等片刻 – 当你登出后,你的这些努力都将消失,因为在你每次打开终端时, **PS1** 环境变量的值都会被重置. 解决这个问题的最简单方式是打开 **.bashrc** 配置文件(在你的家目录下) 并在这个文件的最下方添加上完整的 `export` 命令.在每次你启动一个新的 shell 会话时,这个 **.bashrc** 会被 `Bash` 读取, 所以你的被加强了的提示符就可以一直出现.你还可以使用额外的颜色来装扮提示符.刚开始,这将有点棘手,因为你必须使用一些相当奇怪的转义序列,但结果是非常漂亮的. 将下面的字符添加到你的 **PS1**字符串中的某个位置,最终这将把文本变为红色: + + \[\e[31m\] + +你可以将这里的 31 更改为其他的数字来获得不同的颜色: + +- 30 黑色 +- 32 绿色 +- 33 黄色 +- 34 蓝色 +- 35 洋红色 +- 36 青色 +- 37 白色 + +所以,让我们使用先前看到的转义序列和颜色来创造一个提示符,以此来结束这一小节的内容. 深吸一口气,弯曲你的手指,然后键入下面这只"野兽": + + export PS1="(\!) \[\e[31m\] \[\A\] \[\e[32m\]\u@\h \[\e[34m\]\w \[\e[30m\]$" + +上面的命令提供了一个 Bash 命令历史序号, 当前的时间,用户或主机名与颜色之间的组合,以及工作路径.假如你"野心勃勃",利用一些惊人的组合,你还可以更改提示符的背景色和前景色.先前实用的 Arch wiki 有一个关于颜色代码的完整列表:[http://tinyurl.com/3gvz4ec][1]. + +> ### Shell 精要 ### +> +> 假如你是一个彻底的 Linux 新手并第一次阅读这份杂志,或许你会发觉阅读这些教程有些吃力. 所以这里有一些基础知识来让你熟悉一些 shell. 通常在你的菜单中, shell 指的是 Terminal, XTerm 或 Konsole, 但你启动它后, 最为实用的命令有这些: +> +> **ls** (列出文件名); **cp one.txt two.txt** (复制文件); **rm file.txt** (移除文件); **mv old.txt new.txt** (移动或重命名文件); +> +> **cd /some/directory** (改变目录); **cd ..** (回到上级目录); **./program** (在当前目录下运行一个程序); **ls > list.txt** (重定向输出到一个文件). +> +> 几乎每个命令都有一个手册页用来解释其选项(例如 **man ls** – 按 Q 来退出).在那里,你可以知晓命令的选项,这样你就知道 **ls -la** 展示一个详细的列表,其中也列出了隐藏文件, 并且在键入一个文件或目录的名字的一部分后, 可以使用 Tab 键来自动补全. + +### Tmux: 针对 shell 的窗口管理器 ### + +在文本模式的环境中使用一个窗口管理器 – 这听起来有点不可思议, 是吧? 然而,你应该记得当 Web 浏览器第一次实现分页浏览的时候吧? 在当时, 这是在可用性上的一个重大进步,它减少了桌面任务栏的杂乱无章和繁多的窗口列表. 对于你的浏览器来说,你只需要一个按钮便可以在浏览器中切换到你打开的每个单独网站, 而不是针对每个网站都有一个任务栏或导航图标. 这个功能非常有意义. + +若有时你同时运行着几个虚拟终端,你便会遇到相似的情况; 在这些终端之间跳转,或每次在任务栏或窗口列表中找到你所需要的那一个终端,都可能会让你觉得麻烦. 拥有一个文本模式的窗口管理器不仅可以让你像在同一个终端窗口中运行多个 shell 会话,而且你甚至还可以将这些窗口排列在一起. + +另外,这样还有另一个好处:可以将这些窗口进行分离和重新连接.想要看看这是如何运行的最好方式是自己尝试一下. 在一个终端窗口中,输入 **screen** (在大多数发行版本中,它被默认安装了或者可以在软件包仓库中找到). 某些欢迎的文字将会出现 – 只需敲击 Enter 键这些文字就会消失. 现在运行一个交互式的文本模式的程序,例如 **nano**, 并关闭这个终端窗口. + +在一个正常的 shell 对话中, 关闭窗口将会终止所有在该终端中运行的进程 – 所以刚才的 Nano 编辑对话也就被终止了, 但对于 screen 来说,并不是这样的. 打开一个新的终端并输入如下命令: + + screen -r + +瞧, 你刚开打开的 Nano 会话又回来了! + +当刚才你运行 **screen** 时, 它会创建了一个新的独立的 shell 会话, 它不与某个特定的终端窗口绑定在一起,所以可以在后面被分离并重新连接( 即 **-r** 选项). + +当你正使用 SSH 去连接另一台机器并做着某些工作, 但并不想因为一个单独的连接而毁掉你的所有进程时,这个方法尤其有用.假如你在一个 **screen** 会话中做着某些工作,并且你的连接突然中断了(或者你的笔记本没电了,又或者你的电脑报废了),你只需重新连接一个新的电脑或给电脑充电或重新买一台电脑,接着运行 **screen -r** 来重新连接到远程的电脑,并在刚才掉线的地方接着开始. + +现在,我们都一直在讨论 GNU 的 **screen**,但这个小节的标题提到的是 tmux. 实质上, **tmux** (terminal multiplexer) 就像是 **screen** 的一个进阶版本,带有许多有用的额外功能,所以现在我们开始关注 tmux. 某些发行版本默认包含了 **tmux**; 在其他的发行版本上,通常只需要一个 **apt-get, yum install** 或 **pacman -S** 命令便可以安装它. + +一旦你安装了它过后,键入 **tmux** 来启动它.接着你将注意到,在终端窗口的底部有一条绿色的信息栏,它非常像传统的窗口管理器中的任务栏: 上面显示着一个运行着的程序的列表,机器的主机名,当前时间和日期. 现在运行一个程序,又以 Nano 为例, 敲击 Ctrl+B 后接着按 C 键, 这将在 tmux 会话中创建一个新的窗口,你便可以在终端的底部的任务栏中看到如下的信息: + + 0:nano- 1:bash* + +每一个窗口都有一个数字,当前呈现的程序被一个星号所标记. Ctrl+B 是与 tmux 交互的标准方式, 所以若你敲击这个按键组合并带上一个窗口序号, 那么就会切换到对应的那个窗口.你也可以使用 Ctrl+B 再加上 N 或 P 来分别切换到下一个或上一个窗口 – 或者使用 Ctrl+B 加上 L 来在最近使用的两个窗口之间来进行切换(有点类似于桌面中的经典的 Alt+Tab 组合键的效果). 若需要知道窗口列表,使用 Ctrl+B 再加上 W. + +目前为止,一切都还好:现在你可以在一个单独的终端窗口中运行多个程序,避免混乱(尤其是当你经常与同一个远程主机保持多个 SSH 连接时.). 当想同时看两个程序又该怎么办呢? + +针对这种情况, 可以使用 tmux 中的窗格. 敲击 Ctrl+B 再加上 % , 则当前窗口将分为两个部分,一个在左一个在右.你可以使用 Ctrl+B 再加上 O 来在这两个部分之间切换. 这尤其在你想同时看两个东西时非常实用, – 例如一个窗格看指导手册,另一个窗格里用编辑器看一个配置文件. + +有时,你想对一个单独的窗格进行缩放,而这需要一定的技巧. 首先你需要敲击 Ctrl+B 再加上一个 :(分号),这将使得位于底部的 tmux 栏变为深橙色. 现在,你进入了命令模式,在这里你可以输入命令来操作 tmux. 输入 **resize-pane -R** 来使当前窗格向右移动一个字符的间距, 或使用 **-L** 来向左移动. 对于一个简单的操作,这些命令似乎有些长,但请注意,在 tmux 的命令模式(以前面提到的一个分号开始的模式)下,可以使用 Tab 键来补全命令. 另外需要提及的是, **tmux** 同样也有一个命令历史记录,所以若你想重复刚才的缩放操作,可以先敲击 Ctrl+B 再跟上一个分号并使用向上的箭头来取回刚才输入的命令. + +最后,让我们看一下分离和重新连接 - 即我们刚才介绍的 screen 的特色功能. 在 tmux 中,敲击 Ctrl+B 再加上 D 来从当前的终端窗口中分离当前的 tmux 会话, 这使得这个会话的一切工作都在后台中运行.使用 **tmux a** 可以再重新连接到刚才的会话. 但若你同时有多个 tmux 会话在运行时,又该怎么办呢? 我们可以使用下面的命令来列出它们: + + tmux ls + +这个命令将为每个会话分配一个序号; 假如你想重新连接到会话 1, 可以使用 `tmux a -t 1`. tmux 是可以高度定制的,你可以自定义按键绑定并更改配色方案, 所以一旦你适应了它的主要功能,请钻研指导手册以了解更多的内容. + +tmux: 一个针对 shell 的窗口管理器 + +![tmux](http://www.linuxvoice.com/wp-content/uploads/2015/02/tmux-large13.jpg) + +上图中, tmux 开启了两个窗格: 左边是 Vim 正在编辑一个配置文件,而右边则展示着指导手册页. + +> ### Zsh: 另一个 shell ### +> +> 选择是好的,但标准同样重要. 你要知道几乎每个主流的 Linux 发行版本都默认使用 Bash shell – 尽管还存在其他的 shell. Bash 为你提供了一个 shell 能够给你提供的几乎任何功能,包括命令历史记录,文件名补全和许多脚本编程的能力.它成熟,可靠并文档丰富 – 但它不是你唯一的选择. +> +> 许多高级用户热衷于 Zsh, 即 Z shell. 这是 Bash 的一个替代品并提供了 Bash 的几乎所有功能,令外还提供了一些额外的功能. 例如, 在 Zsh 中,你输入 **ls** - 并敲击 Tab 键可以得到 **ls** 可用的各种不同选项的一个大致描述. 而不需要再打开 man page 了! +> +> Zsh 还支持其他强大的自动补全功能: 例如,输入 **cd /u/lo/bi** 再敲击 Tab 键, 则完整的路径名 **/usr/local/bin** 就会出现(这里假设没有其他的路径包含 **u**, **lo** 和 **bi** 等字符.). 或者只输入 **cd** 再跟上 Tab 键,则你将看到着色后的路径名的列表 – 这比 Bash 给出的简单的结果好看得多. +> +> Zsh 在大多数的主要发行版本上都可以得到; 安装它后并输入 **zsh** 便可启动它. 要将你的默认 shell 从 Bash 改为 Zsh, 可以使用 **chsh** 命令. 若需了解更多的信息,请访问 [www.zsh.org][2]. + +### "未来" 的终端 ### + +你或许会好奇为什么包含你的命令行提示符的应用被叫做终端. 这需要追溯到 Unix 的早期, 那时人们一般工作在一个多用户的机器上,这个巨大的电脑主机将占据一座建筑中的一个房间, 人们在某些线路的配合下,使用屏幕和键盘来连接到这个主机, 这些终端机通常被称为 "哑终端", 因为它们不能靠自己做任何重要的执行任务 – 它们只展示通过线路从主机传来的信息,并输送回从键盘的敲击中得到的输入信息. + +今天,几乎所有的我们在自己的机器上执行实际的操作,所以我们的电脑不是传统意义下的终端, 这就是为什么诸如 **XTerm**, Gnome Terminal, Konsole 等程序被称为 "终端模拟器" 的原因 – 他们提供了同昔日的物理终端一样的功能.事实上,在许多方面它们并没有改变多少.诚然,现在我们有了反锯齿字体,更好的颜色和点击网址的能力,但总的来说,几十年来我们一直以同样的方式在工作. + +所以某些程序员正尝试改变这个状况. **Terminology** ([http://tinyurl.com/osopjv9][3]), 它来自于超级时髦的 Enlightenment 窗口管理器背后的团队,旨在将终端引入 21 世纪,例如带有在线媒体显示功能.你可以在一个充满图片的目录里输入 **ls** 命令,便可以看到它们的缩略图,或甚至可以直接在你的终端里播放视频. 这使得一个终端有点类似于一个文件管理器,意味着你可以快速地检查媒体文件的内容而不必用另一个应用来打开它们. + +接着还有 Xiki ([www.xiki.org][4]),它自身的描述为 "命令的革新".它就像是一个传统的 shell, 一个 GUI 和一个 wiki 之间的过渡; 你可以在任何地方输入命令,并在后面将它们的输出存储为笔记以作为参考,并可以创建非常强大的自定义命令.用几句话是很能描述它的,所以作者们已经创作了一个视频来展示它的潜力是多么的巨大(请看 **Xiki** 网站的截屏视频部分). + +并且 Xiki 绝不是那种在几个月之内就消亡的昙花一现的项目,作者们成功地进行了一次 Kickstarter 众筹,在七月底已募集到超过 $84,000. 是的,你没有看错 – $84K 来支持一个终端模拟器.这可能是最不寻常的集资活动,因为某些疯狂的家伙已经决定开始创办它们自己的 Linux 杂志 ...... + +### 下一代终端 ### + +许多命令行和基于文本的程序在功能上与它们的 GUI 程序是相同的,并且常常更加快速和高效. 我们的推荐有: +**Irssi** (IRC 客户端); **Mutt** (mail 客户端); **rTorrent** (BitTorrent); **Ranger** (文件管理器); **htop** (进程监视器). 若给定在终端的限制下来进行 Web 浏览, Elinks 确实做的很好,并且对于阅读那些以文字为主的网站例如 Wikipedia 来说,它非常实用. + +> ### 微调配色方案 ### +> +> 在 Linux Voice 中,我们并不迷恋养眼的东西,但当你每天花费几个小时盯着屏幕看东西时,我们确实认识到美学的重要性.我们中的许多人都喜欢调整我们的桌面和窗口管理器来达到完美的效果,调整阴影效果,摆弄不同的配色方案,直到我们 100% 的满意.(然后出于习惯,摆弄更多的东西.) +> +> 但我们倾向于忽视终端窗口,它理应也获得我们的喜爱, 并且在 [http://ciembor.github.io/4bit][5] 你将看到一个极其棒的配色方案设计器,对于所有受欢迎的终端模拟器(**XTerm, Gnome Terminal, Konsole and Xfce4 Terminal are among the apps supported.**),它可以色设定.移动滑动条直到你看到配色方案 norvana, 然后点击位于该页面右上角的 `得到方案` 按钮. +> +> 相似的,假如你在一个文本编辑器,如 Vim 或 Emacs 上花费很多的时间,使用一个精心设计的调色板也是非常值得的. **Solarized at** [http://ethanschoonover.com/solarized][6] 是一个卓越的方案,它不仅漂亮,而且因追求最大的可用性而设计,在其背后有着大量的研究和测试. +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/linux-101-power-up-your-shell-8/ + +作者:[Ben Everard][a] +译者:[FSSlc](https://github.com/FSSlc) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://tinyurl.com/3gvz4ec +[2]:http://www.zsh.org/ +[3]:http://tinyurl.com/osopjv9 +[4]:http://www.xiki.org/ +[5]:http://ciembor.github.io/4bit +[6]:http://ethanschoonover.com/solarized \ No newline at end of file diff --git a/translated/tech/20150616 XBMC--build a remote control.md b/translated/tech/20150616 XBMC--build a remote control.md new file mode 100644 index 0000000000..7347aca243 --- /dev/null +++ b/translated/tech/20150616 XBMC--build a remote control.md @@ -0,0 +1,264 @@ +XBMC:自制遥控 +================================================================================ +**通过运行在 Android 手机上的自制遥控器来控制你的家庭媒体播放器。** + +**XBMC** 一款很优秀的软件,能够将几乎所有电脑变身成媒体中心。它可以播放音乐和视频,显示图片,甚至还能显示天气预报。为了在配置成家庭影院后方便使用,你可以通过手机 app 访问运行在已连接到 Wi-Fi 的 XBMC 机器上的服务来控制它。可以找到很多这种工具,几乎覆盖所有智能手机系统。 + +> ### Kodi ### +> +> 在你阅读这篇文章的时候,**XBMC** 可能已经成为历史。因为法律原因(因为名字 **XBMC** 或 X**-Box Media Center** 里引用了不再支持的过时硬件)项目组决定使用新的名字 **Kodi**。不过,除了名字,其他的都会保持原样。或者说除开通常新版本中所期待的大量新改进。这一般不会影响到遥控软件,它应该能在已有的 **XBMC** 系统和新的 Kodi 系统上都能工作。 + +我们目前配置了一个 **XBMC** 系统用于播放音乐,不过我们找到的所有 XBMC 遥控没一个好用的,特别是和媒体中心连接的电视没打开的时候。它们都有点太复杂了,集成了太多功能在手机的小屏幕上。我们希望能有这样的系统,从最开始就是设计成只用于访问音乐库和电台插件,所以我们决定自己实现一个。它不需要用到 XBMC 的所有功能,因为除了音乐以外的任务,我们可以简单地切换使用通用的 XBMC 遥控。我们的测试系统是一个刷了 RaspBMC 发行版的树莓派,但是我们要做的工具并不受限于树莓派或那个发行版,它应该可以匹配任何安装了相关插件的基于 Linux 的 XBMC 系统。 + +首先,遥控程序需要一个用户界面。大多数 XBMC 遥控程序都是独立的 app。不过对于我们要做的这个音乐控制程序,我们希望用户可以不用安装任何东西就可以使用。显然我们需要使用网页界面。XBMC 本身自带网页服务器,但是为了获得更多权限,我们还是使用了独立的网页框架。在同一台电脑上跑两个以上网页服务器没有问题,只不过它们不能使用相同的端口。 + +有几个网页框架可以使用。而我们选用 Bottle 是因为它是一个简单高效的框架,而且我们也确实用不到任何高级功能。Bottle 是一个 Python 模块,所以这也将是我们编写服务器模块的语言。 + +你应该能在软件包管理器里找到 Bottle。在基于 Debian 的系统(包括 RaspBMC)里,你可以通过下面的命令安装: + + sudo apt-get install python-bottle + +遥控程序实际上只是连接用户和系统的中间层。Bottle 提供了和用户交互的方式,而我们将通过 JSON API 来和 **XBMC** 交互。这样可以让我们通过发送 JSON 格式消息的方式去控制媒体播放器。 + +我们将用到一个叫做 xbmcjson 的简单 XBMC JASON API 封装。足够用来发送控制请求,而不需要关心实际的 JSON 格式以及和服务器通讯的无聊事。它没有包含在 PIP 包管理中,所以你得直接从 **GitHub** 安装: + + git clone https://github.com/jcsaaddupuy/python-xbmc.git + cd python-xbmc + sudo python setup.py install + +万事俱备,只欠代码。 + +#### 先从 Bottle 开始 #### + +我们程序的基本结构: + + from xbmcjson import XBMC + from bottle import route, run, template, redirect, static_file, request + import os + xbmc = XBMC(“http://192.168.0.5/jsonrpc”, “xbmc”, “xbmc”) + @route(‘/hello/’) + def index(name): + return template(‘

Hello {{name}}!

’, name=name) + run(host=”0.0.0.0”, port=8000) + +这样程序将连接到 **XBMC**(不过实际上用不到);然后 Bottle 会开始伺服网站。在我们的代码里,它将监听主机 0.0.0.0(意味着允许所有主机连接)的端口 8000。它只设定了一个站点,就是 /hello/XXXX,这里的 XXXX 可以是任何内容。不管 XXXX 是什么都将作为参数名传递给 index()。然后再替换进去 HTML 网页模版。 + +你可以先试着把上面内容写到一个文件(我们取的名字是 remote.py),然后用下面的命令启动: + + python remote.py + +然后你可以在浏览器里访问 localhost:8000/hello/world 看看模版生效的效果。 + +@route() 用来设定网页服务器的路径,而函数 index() 会返回该路径的数据。通常是返回由模版生成的 HTML 页面,但是并不是说只能这样(后面会看到)。 + +随后,我们将给应用添加更多页面入口,让它变成一个全功能的 XBMC 遥控,但仍将采用相同代码结构。 + +XBMC JSON API 接口可以从和 XBMC 机器同网段的任意电脑上访问。也就是说你可以在自己的笔记本上开发,然后再布置到媒体中心上,而不需要浪费时间上传每次改动。 + +模版 - 比如前面例子里的那个简单模版 - 是一种结合 Python 和 HTML 来控制输出的方式。理论上,这俩能做很多很多事,但是会非常混乱。我们将只是用它们来生成正确格式的数据。不过,在开始动手之前,我们先得准备点数据。 + +> ### Paste ### +> +> Bottle 自带网页服务器,就是我们用来测试遥控程序的。不过,我们发现它性能有时不够好。当我们的遥控程序正式上线时,我们希望页面能更快一点显示出来。Bottle 可以和很多不同的网页服务器配合工作,而我们发现 Paste 用起来非常不错。而要使用的话,只要简单地安装(Debian 系统里的 python-paste 包),然后修改一下代码里的 run 调用: +> +> run(host=hostname, port=hostport, server=”paste”) +> +> 你可以在 [http://bottlepy.org/docs/dev/deployment.html][1] 找到如何使用其他服务器的相关细节。 + +#### 从 XBMC 获取数据 #### + +XBMC JSON API 分成 14 个命名空间:JSONRPC, Player, Playlist, Files, AudioLibrary, VideoLibrary, Input, Application, System, Favourites, Profiles, Settings, Textures 和 XBMC。每个都可以通过 Python 的 XBMC 对象访问(Favourites 除外,明显是个疏忽)。每个命名空间都包含许多方法用于对程序的控制。例如,Playlist.GetItems() 可以用来获取某个特定播放列表的内容。服务器会返回给我们 JSON 格式的数据,但 xbmcjson 模块会为我们转化成 Python 词典。 + +我们需要用到 XBMC 里的两个组件来控制播放:播放器和播放列表。播放器带有播放列表并在每首歌结束时从列表里取下一首。为了查看当前正在播放的内容,我们需要获取正在工作的播放器的 ID,然后根据它找到当前播放列表的 ID。这个可以通过下面的代码来实现: + + def get_playlistid(): + player = xbmc.Player.GetActivePlayers() + if len(player[‘result’]) > 0: + playlist_data = xbmc.Player.GetProperties({“playerid”:0, “properties”:[“playlistid”]}) + if len(playlist_data[‘result’]) > 0 and “playlistid” in playlist_data[‘result’].keys(): + return playlist_data[‘result’][‘playlistid’] + return -1 + +如果当前没有播放器在工作(就是说,返回数据的结果部分的长度是 0),或者当前播放器不带播放列表,这样的话函数会返回 -1。其他时候,它会返回当前播放列表的数字 ID。 + +当我们拿到当前播放列表的 ID 后,就可以获取列表的细节内容。按照我们的需求,有两个重要的地方:播放列表里包含的项,以及当前播放所处的位置(已经播放过的项并不会从播放列表移除,只是移动当前播放位置)。 + + def get_playlist(): + playlistid = get_playlistid() + if playlistid >= 0: + data = xbmc.Playlist.GetItems({“playlistid”:playlistid, “properties”: [“title”, “album”, “artist”, “file”]}) + position_data = xbmc.Player.GetProperties({“playerid”:0, ‘properties’:[“position”]}) + position = int(position_data[‘result’][‘position’]) + return data[‘result’][‘items’][position:], position + return [], -1 + +这样可以返回以正在播放的项开始的列表(因为我们并不关心已经播放过的内容),而且也包含了位置信息用来从列表里移除项。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc2-large.jpg) + +API 文档在这里:[http://wiki.xbmc.org/?title=JSON-RPC_API/v6][2]。它列出了所有支持的函数,但是关于具体如何使用的描述有点太简单了。 + +> ### JSON ### +> +> JSON 是 JavaScript Object Notation 的缩写,开始设计用于 JavaScript 对象的序列化。目前仍然起到这个作用,但是它也是用来编码任意数据的一种很好用的方式。 +> +> JSON 对象都是这样的格式: +> +> {property1:value1, property2:value2, property3:value3} +> +> 支持任意数目的属性/值配对。对 Python 程序员来说,看上去和字典数据结构很相似,不过这两个确实很像。 +> +> 在字典数据结构里,值本身可以是另一个 JSON 对象,或者一个列表,所以下面的格式也是正确的: +> +> {“name”:“Ben”, “jobs”:[“cook”, “bottle-washer”], “appearance”: {“height”:195, “skin”:“fair”}} +> +> JSON 通常在网络服务中用来发送和接收数据,并且大多数编程语言都能很好地支持,所以如果你熟悉 Python 的话,你应该可以使用你熟悉的编程语言调用相同的接口来轻松地控制 XBMC。 + +#### 整合到一起 #### + +把之前的功能连接到 HTML 页面很简单: + + @route(‘/juke’) + def index(): + current_playlist, position = get_playlist() + return template(‘list’, playlist=current_playlist, offset = position) + +只需要抓取播放列表(调用我们之前定义的函数),然后将结果传递给负责显示的模版。 + +负责显示列表数据的模版的主要部分是: + +

Currently Playing:

+ % if playlist is not None: + % position = offset + % for song in playlist: + {{song[‘title’]}} + % if song[‘type’] == ‘unknown’: + Radio + % else: + {{song[‘artist’][0]}} + % end + % if position != offset: +
remove + % else: + skip + % end +
+ % position += 1 + % end + +可以看到,模版大部分是用 HTML 写的,只有一小部分用来控制输出的其他代码。用两个括号括起来的变量是输出位置(像我们在第一个 ‘hello world’ 例子里看到的)。你也可以嵌入以百分号开头的 Python 代码。因为没有缩进,你需要用一个 % end 来结束当前的代码块(就像循环或 if 语句)。 + +这个模版首先检查列表是否为空,然后遍历里面的每一项。每一项会用粗体显示歌曲名字,然后是艺术家名字,然后是一个是否跳过(如果是当前正在播的歌曲)或从列表移除的链接。所有歌曲的类型都是 ‘song’,如果类型是 ‘unknown’,那就不是歌曲而是网络电台。 + +/remove/ 和 /skip/ 路径只是简单地封装了 XBMC 控制功能,在改动生效后重新加载 /juke: + + @route(‘/skip/’) + def index(position): + print xbmc.Player.GoTo({‘playerid’:0, ‘to’:’next’}) + redirect(“/juke”) + @route(‘/remove/’) + def index(position): + playlistid = get_playlistid() + if playlistid >= 0: + xbmc.Playlist.Remove({‘playlistid’:int(playlistid), ‘position’:int(position)}) + redirect(“/juke”) + +当然,如果不能往列表里添加歌曲的话那这个列表管理功能也不行。 + +因为一旦播放列表结束,它就消失了,所以你需要重新创建一个,这会让事情复杂一些。而且有点让人迷惑的是,播放列表是通过调用 Playlist.Clear() 方法来创建的。这个方法也还用来删除包含网络电台(类型是 unknown)的播放列表。另一个麻烦的地方是列表里的网络电台开始播放后就不会停,所以如果当前在播网络电台,也会需要清除播放列表。 + +这些页面包含了指向 /play/ 的链接来播放歌曲。通过下面的代码处理: + + @route(‘/play/’) + def index(id): + playlistid = get_playlistid() + playlist, not_needed= get_playlist() + if playlistid < 0 or playlist[0][‘type’] == ‘unknown’: + xbmc.Playlist.Clear({“playlistid”:0}) + xbmc.Playlist.Add({“playlistid”:0, “item”:{“songid”:int(id)}}) + xbmc.Player.open({“item”:{“playlistid”:0}}) + playlistid = 0 + else: + xbmc.Playlist.Add({“playlistid”:playlistid, “item”:{“songid”:int(id)}}) + remove_duplicates(playlistid) + redirect(“/juke”) + +最后一件事情是实现 remove_duplicates 调用。这并不是必须的 - 而且还有人并不喜欢这个 - 不过可以保证同一首歌不会多次出现在播放列表里。 + +我们也实现了一些页面用来列出收藏歌曲里所有艺术家,以及列出指定艺术家的歌曲和专辑。这些都非常简单,和 /juke 页面基本类似。 + +![Image](http://www.linuxvoice.com/wp-content/uploads/2015/04/xbmc1-large.jpg) + +还需要处理一下 UI,不过功能已经有了。 + +> ### 日志 ### +> +> 通常拿到 XBMC JSON API 并不清楚能用来做什么,而且它的文档也有点模糊。找出如何使用的一种方式是看别的遥控程序是怎么做的。如果打开日志功能,就可以在使用其他遥控程序的时候看到哪个 API 被调用了,然后就可以应用到在自己的代码里。 +> +> 要打开日志功能,把 XBMC 媒体中心 接到显示器上,再依次进入设置 > 系统 > 调试,打开允许调试日志。在打开日志功能后,还需要登录到 XBMC 机器上(比如通过 SSH),然后就可以查看日志了。日志文件的位置应该显示在 XBMC 界面左上角。在 RaspBMC 系统里,文件位置是 /home/pi/.xbmc/temp/xbmc.log。你可以通过下面的命令实时监视哪个 API 接口被调用了: +> +> cd /home/pi/.xbmc/temp +> tail -f xbmc.log | grep “JSON” + +#### 增加功能 #### + +上面的代码都是用来播放 XBMC 媒体库里的歌曲的,但我们还希望能播放网络电台。每个插件都有自己的独立 URL 可以通过普通的 XBMC JSON 命令来获取信息。举个例子,要从电台插件里获取选中的电台,可以使用; + + @route(‘/radio/’) + def index(): + my_stations = xbmc.Files.GetDirectory({“directory”:”plugin://plugin.audio.radio_de/stations/my/”, “properties”: + [“title”,”thumbnail”,”playcount”,”artist”,”album”,”episode”,”season”,”showtitle”]}) + if ‘result’ in my_stations.keys(): + return template(‘radio’, stations=my_stations[‘result’][‘files’]) + else: + return template(‘error’, error=’radio’) + +这样可以返回一个可以和歌曲一样能添加到播放列表的文件。不过,这些文件能一直播下去,所以(之前说过)在添加其他歌曲的时候需要重新创建列表。 + +#### 共享歌曲 #### + +除了伺服页面模版,Bottle 还支持静态文件。方便用于那些不会因为用户输入而改变的内容。可以是 CSS 文件,一张图片或是一首 MP3 歌曲。在我们的简单遥控程序里(目前)还没有任何用来美化的 CSS 或图片,不过我们增加了一个下载歌曲的途径。这个可以让媒体中心变成一个存放歌曲的 NAS 盒子。在需要传输大量数据的时候,最好还是用类似 Samba 的功能,但只是下几首歌到手机上的话使用静态文件也是很好的方式。 + +通过歌曲 ID 来下载的 Bottle 代码: + + @route(‘/download/’) + def index(id): + data = xbmc.AudioLibrary.GetSongDetails({“songid”:int(id), “properties”:[“file”]}) + full_filename = data[‘result’][‘songdetails’][‘file’] + path, filename = os.path.split(full_filename) + return static_file(filename, root=path, download=True) + +应用的时候,只需要为 /songsby/ 页面里的相应 ID 加个链接。 + +我们已经把所有的代码过了一遍,不过还需要一点工作来把它们集合到一起。可以自己去 GitHub 页面 [https://github.com/ben-ev/xbmc-remote][3] 看下。 + +> ### 设置 ### +> +> 我们的遥控程序已经开发完成,还需要保证让它在媒体中心每次开机的时候都能启动。有几种方式,最简单的是在 /etc/rc.local 里增加一行命令来启动。我们的文件位置在 /opt/xbmc-remote/remote.py,其他文件也和它一起。然后在 /etc/rc.local 最后的 exit 0 之前增加了下面一行。 +> +> cd /opt/xbmc-remote && python remote.py & + +> ### GitHub ### +> +> 这个项目目前还只是个架子,但是 - 我们运营杂志就意味着没有太多自由时间来编程。不过,我们启动了一个 GitHub 项目,希望能持续完善, 而如果你觉得这个项目有用的话,欢迎做出贡献。 +> +> 要查看最新的进展,请访问 [https://github.com/ben-ev/xbmc-remote][4] 看看所处的状态。你可以从页面里获取最新的代码,或者通过命令行复制。 +> +> 如果你希望改善它,可以复制项目到你自己的分支开发,然后在功能完成后发起合并请求。关于如何使用 GitHub 的更多信息,请访问 [https://github.com/features][5]。 + +-------------------------------------------------------------------------------- + +via: http://www.linuxvoice.com/xbmc-build-a-remote-control/ + +作者:[Ben Everard][a] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.linuxvoice.com/author/ben_everard/ +[1]:http://bottlepy.org/docs/dev/deployment.html +[2]:http://wiki.xbmc.org/?title=JSON-RPC_API/v6 +[3]:https://github.com/ben-ev/xbmc-remote +[4]:https://github.com/ben-ev/xbmc-remote +[5]:https://github.com/features diff --git a/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md b/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md new file mode 100644 index 0000000000..c094d8f916 --- /dev/null +++ b/translated/tech/20150629 4 Useful Tips on mkdir, tar and kill Commands in Linux.md @@ -0,0 +1,206 @@ +Linux mkdir、tar 和 kill 命令的 4 个有用小技巧 +================================================================================ +我们一直以常规的方式完成一个任务,直到我们知道有更好的处理方法。作为 [Linux 技巧和绝招系列][1] 的后续,我会在这里介绍能在各个方面给你帮助的 4 个小技巧。开始吧! + +![有用的 Linux 小技巧](http://www.tecmint.com/wp-content/uploads/2015/06/Linux-Useful-Tips.jpg) + +4 个有用的 Linux 小技巧 + +### 1. 假设你要创建一个类似于下面很长的/复杂的目录树。实现这最有效的方法是什么呢? ### + +类似下面要实现的目录树结构。 + + $ cd /home/$USER/Desktop + $ mkdir tecmint + $ mkdir tecmint/etc + $ mkdir tecmint/lib + $ mkdir tecmint/usr + $ mkdir tecmint/bin + $ mkdir tecmint/tmp + $ mkdir tecmint/opt + $ mkdir tecmint/var + $ mkdir tecmint/etc/x1 + $ mkdir tecmint/usr/x2 + $ mkdir tecmint/usr/x3 + $ mkdir tecmint/tmp/Y1 + $ mkdir tecmint/tmp/Y2 + $ mkdir tecmint/tmp/Y3 + $ mkdir tecmint/tmp/Y3/z + +上述情况可以简单地通过运行下面一行命令来实现。 + + $ mkdir -p /home/$USER/Desktop/tecmint/{etc/x1,lib,usr/{x2,x3},bin,tmp/{Y1,Y2,Y3/z},opt,var} + +你可以用 tree 命令验证。如果没有安装你可以使用 apt 或 yum 安装 ‘tree’ 软件包。 + + $ tree tecmint + +![检查目录结构](http://www.tecmint.com/wp-content/uploads/2015/06/Check-Directory-Structure.png) + +检查目录结构 + +我们可以用上面的方式创建任意复制的目录树结构。注意这仅仅是一个普通的命令,但是用 ‘{}’ 来创建层级目录。需要的时候如果在 shell 脚本中使用是非常有用的。 + +### 2. 在桌面(/home/$USER/Desktop)创建一个文件(例如 test)并填入以下内容。 ### + + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + +这种情况一个普通用户会怎么做呢? + +a. 他首先会创建文件,最好使用 [touch 命令][2],例如: + + $ touch /home/$USER/Desktop/test + +b. 他会用一个文本编辑器打开文件,这可能是 nano、vim 或其它编辑器。 + + $ nano /home/$USER/Desktop/test + +c. 然后他会将上面的内容输入到文件中,保存并退出。 + +忽略他/她使用的时间,他至少需要 3 步来执行上面的情况。 + +一个经验丰富的 Linux 用户会怎么做呢?他会在终端中输入下面的文本然后就完成所有任务。他不需要单独执行每一步。 + + cat << EOF > /home/$USER/Desktop/test + ABC + DEF + GHI + JKL + MNO + PQR + STU + VWX + Y + Z + EOF + +你可以用 ‘cat’ 命令检查是否成功创建了文件和内容。 + + $ cat /home/avi/Desktop/test + +![检查文件内容](http://www.tecmint.com/wp-content/uploads/2015/06/Check-File-Content.gif) + +### 3. 我们经常在 Linux 中处理归档文件(尤其是 TAR 包)。很多情况下我们会在某些位置,而不是在 Downloads 目录中使用 TAR 包。这种情况下我们怎么做呢? ### + +在这种情况下我们通常会做两件事。 + +a. 复制/移动 tar 包到目标位置并解压,例如: + + $ cp firefox-37.0.2.tar.bz2 /opt/ + 或 + $ mv firefox-37.0.2.tar.bz2 /opt/ + +b. cd 到 /opt/ 目录。 + + $ cd /opt/ + +c. 解压 tar 包。 + + # tar -jxvf firefox-37.0.2.tar.bz2 + +我们也可以采用另外一种方式。 + +我们可以在 Tar 包所在位置解压并复制/移动解压后的文件到所需的目标位置,例如: + + $ tar -jxvf firefox-37.0.2.tar.bz2 + $ cp -R firefox/ /opt/ + 或 + $ mv firefox/ /opt/ + +不管哪种方式都需要两步才能完成任务。专业的人可以只用一步就完成这个任务: + + $ tar -jxvf firefox-37.0.2.tar.bz2 -C /opt/ + +-C 选项提取文件到指定目录(这里是 /opt/)。 + +这并不是关于选项(-C)的问题,而是习惯的问题。养成使用带 -C 选项 tar 命令的习惯。这会使你的工作更加轻松。从现在开始不要再移动归档文件或复制/移动解压后的文件了,在 Downloads 文件夹保存 tar 包并解压到你想要的任何地方吧。 + +### 4. 常规方式我们怎样杀掉一个进程? ### + +最普遍的方法,我们首先用 `ps -A` 命令列出所有进程,然后通过管道输入到 grep 来查找进程/服务(假如 apache2),如下: + + $ ps -A | grep -i apache2 + +#### 输出样例 #### + + 1006 ? 00:00:00 apache2 + 2702 ? 00:00:00 apache2 + 2703 ? 00:00:00 apache2 + 2704 ? 00:00:00 apache2 + 2705 ? 00:00:00 apache2 + 2706 ? 00:00:00 apache2 + 2707 ? 00:00:00 apache2 + +上面的输出显示了所有正在运行 apache2 的进程以及它们的 PID,然后你可以使用这些 PID 在下面命令的帮助下杀掉 apache2。 + + # kill 1006 2702 2703 2704 2705 2706 2707 + +然后交叉检查是否还有名称中包含 ‘apache2’ 的进程/服务在运行,如下: + + $ ps -A | grep -i apache2 + +实际上我们可以使用类似 pgrep 和 pkill 的工具以一种更容易理解的方式实现。你可以使用 pgrep 找到和一个进程相关的信息。假如你要找和 apache2 相关的进程信息,你只需要运行: + + $ pgrep apache2 + +#### 输出样例 #### + + 15396 + 15400 + 15401 + 15402 + 15403 + 15404 + 15405 + +你也可以通过运行下面命令列出进程名称以及 pid。 + + $ pgrep -l apache2 + +#### 输出样例 #### + + 15396 apache2 + 15400 apache2 + 15401 apache2 + 15402 apache2 + 15403 apache2 + 15404 apache2 + 15405 apache2 + +用 pkill 杀掉进程非常简单。你只需要输入想要杀死的资源名称。我写了一篇关于 pkill 的博文,你可以参考: [http://www.tecmint.com/how-to-kill-a-process-in-linux/][3]。 + +用 pkill 杀死一个进程(例如 apache2),你只需要输入以下命令: + + # pkill apache2 + +你可以通过运行下面命令验证是否杀掉了 apache2。 + + $ pgrep -l apache2 + +它没有输出任何东西并返回到窗口意味着没有名称中包含 apache2 的进程在运行。 + +这就是我要说的所有东西。上面讨论的点肯定远远不够,但也肯定对你有所帮助。我们不仅仅是介绍教程使你学到一些新的东西,更重要的是想告诉你 ‘在同样的情况下如何变得更有效率’。在下面的评论框中告诉我们你的反馈吧。保持联系,继续评论。 + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/mkdir-tar-and-kill-commands-in-linux/ + +作者:[Avishek Kumar][a] +译者:[ictlyh](https://github.com/ictlyh) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/avishek/ +[1]:http://www.tecmint.com/tag/linux-tricks/ +[2]:http://www.tecmint.com/8-pratical-examples-of-linux-touch-command/ +[3]:http://www.tecmint.com/how-to-kill-a-process-in-linux/ \ No newline at end of file diff --git a/translated/tech/Tmux_doc_cn.md b/translated/tech/Tmux_doc_cn.md new file mode 100644 index 0000000000..5d2ac507c2 --- /dev/null +++ b/translated/tech/Tmux_doc_cn.md @@ -0,0 +1,1646 @@ +- [名称](#名称) +- [用法](#用法) +- [描述](#描述) +- [键绑定](#键绑定) +- [命令](#命令) +- [客户端和会话](#客户端和会话) +- [窗口和面板](#窗口和面板) + - [窗口和面板命令](#窗口和面板命令) +- [键绑定2](#键绑定2) + - [键绑定命令](#键绑定命令) +- [选项](#选项) + - [选项设置](#选项设置) + - [服务器选项](#服务器选项) + - [会话选项](#会话选项) + - [窗口选项](#窗口选项) +- [鼠标支持](#鼠标支持) +- [格式](#格式) +- [名称和标题](#名称和标题) +- [环境](#环境) +- [状态行](#状态行) +- [缓冲区](#缓冲区) +- [杂项](#杂项) +- [TERMINFO EXTENSIONS](#TERMINFO EXTENSIONS) +- [控制模式](#控制模式) +- [文件](#文件) +- [样例](#样例) + + +##名称 +tmux — terminal multiplexer(终端复用器) + +##用法: + + tmux [-2lCuv] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [command [flags]] + +##描述 + +tmux是一个终端复用器:它可以在单个屏幕中创建、访问以及控制多个终端。 +tmux也可以从窗口中脱离附着并且继续在后台运行,以便在之后再回到会话。 +当开启tmux之后,它会创建带有一个单独窗口的会话并且在屏幕中进行显示。 +在屏幕底部的状态行显示当前会话的信息并且用来进入交互式命令。 +一个会话是一个在tmux管理下的伪终端集合,每个会话具有一个或多个窗口与其链接。 +一个窗口占用了整个屏幕,并且可以被分割成长方形的面板,每个面板分别为一个伪终端。 +多个tmux实例可能连接到同一个会话,并且任何的窗口可能在一个会话中表示。 +当所有的会话被终止之后,tmux就会退出。 + +每个会话都是持久的并且可能在意外失联或故意脱离附着之后生存下来,tmux可以使用下面的命令来恢复原来的会话: + + $ tmux attach + +在tmux中,一个会话由一个客户端在整个屏幕中显示,并且所有的会话都是由一个单独的服务器进行管理的。 +这个服务器以及每个客户端是通过一个在/tmp中的socket进行交流的。 + +*选项描述*: + + '-2' + 强制tmux假设终端支持256颜色。 + + '-C' + 以控制模式开启,使用-CC来让echo失效 + + '-c shell-command' + 使用默认的shell来执行shell命令。 + 如果有必要的话,tmux服务器会开启来检索默认的shell选项。 + 这个选项用来当tmux作为一个登录shell时与sh进行兼容的。 + + '-f file' + 指定一个可选的配置文件,默认情况下,tmux会从/etc/tmux.conf中加载系统配置文件-如果这个文件存在的话。 + 然后会尝试查找用户的配置文件 ~/.tmux.conf。 + 配置文件是一个tmux命令集合,其中的命令在服务器第一次启动时按顺序执行的。 + tmux会在服务器进程启动之后加载一次配置文件。 + "source-file"命令可以用来在稍后加载一个文件。 + tmux在第一次会话创建时会显示配置文件中的命令出现的任何错误,但是会继续处理配置文件的余下部分。 + + '-L socket-name' + tmurx 将服务器*socsket*存储在*TMUX_TMPDIR*目录下,如果这个变量没有设置的话就会使用*TMPDIR*替换, + 或者当两者都不存在时,就会存储在 /tmp 目录下。默认的*socket*的名称为*default*。 + 这个选项允许指定一个不同的socket名称,允许多个独立的tmux服务器运行。 + 与-S不同的是,不需要使用全路经:所有的sockets文件会创建在一个相同的目录下。 + 如果socket被意外地删除了,那么SIGUSR1信号会发送给tmux服务器进程来重新创建socket文件(注意如果当之前描述的任何 + 父目录不存在的话会出错)。 + + '-l' + 当作一个登录shell使用,当前这个标记没有什么效果是当tmux被用来作为登录shell时与其他shell进行兼容的。 + + '-S socket-path' + 为服务器的socket指定一个可选的全路经,当这个选项指定之后,那么默认的目录不会被使用,并且-L选项会被忽略。 + + '-u' + tmux尝试通过第一个LC_ALL,LC_CTYPE和LANG环境变量来猜测终端是否可能支持UTF-8,这可能不会总是正确。 + -u 选项显式地告知tmux UTF-8是支持的。 + 如果服务器通过客户端传递-u或者检测到UTF-8进行启动的,那么utf8和status-utf8选项会分别在全局窗口和会话选项中生效。 + + '-v' + 请求详细登录,这个选项可能由于不断增长的修饰词被多次指定。登录消息会被存储在当前目录下的tmux-clientPID.log + 和tmux-serverPID.log文件中。其中的PID代表服务器或客户端进程ID。 + + 'command [flags]' + 这个用来指定命令集合中的一个来控制tmux,如果没有指定任何命令那么假设一个新建会话命令。 + +##键绑定 + +tmux可以通过一个前缀键与跟随的命令键进行结合的方式从一个附着的客户端进行控制,前缀键默认为'C-b' + +默认的命令键绑定为: + + 结合键 |含义 +-------------------------------------|--------------------- + C-b |给应用发送一个前缀键 C-b + C-o |将当前窗口中的面板向前切换。 + C-z |将tmux客户端挂起 + ! |将当前面板在窗口中突出显示 + " |将当前的面板分割为上下两个面板 + # |列出所有的粘贴缓存 + $ |重命名当前会话 + % |将当前面板分割为左右两个面板 + & |终止当前窗口 + ' |显示一个窗口索引来进行选择 + ( |将当前附着的客户端转换到前一个会话 + ) |将附着的客户端转换到下一个会话 + , |重命名当前窗口 + - |删除最近的复制文本缓存 + . |提示一个索引来移动当前窗口 + 0-9 |选择0-9个窗口 + : |输入tmux命令提示 + ; |移动到前面的活动面板 + = |从一个列表中选择一个缓存来交互式粘贴。 + ? |列出所有的键绑定 + D |选择一个客户端来脱离其附着 + L |将附着的客户端切换到最后一个会话中 + [ |输入赋值模式来复制文本或查看历史 + ] |粘贴最近复制的文本缓存 + c |创建一个新的窗口 + d |脱离当前的客户端 + f |提示在打开的窗口中搜索文本 + i |显示关于当前窗口的一些信息 + l |移动到之前选择的窗口 + n |移动到下一个窗口 + o |移动到当前窗口的下一个面板 + p |移动到之前的窗口 + q |简单地显示面板索引 + r |强制重绘附着的客户端 + s |为当前附着的客户端交互式地选择一个新的会话 + t |显示时间 + w |交互式地选择当前的窗口 + x |终止当前的面板 + z |切换当前面板的放大状态 + { |使用之前的面板来替换当前的面板 + } |使用下一个面板来替换当前的面板 + ~ |显示tmux之前的消息如果存在的话。 + PageUp |进入复制模式并且将页面向上滚动一页。 + Up,Down,Left,Right |转换到当前面板的上, 下,左,右 + M-1到M-5(M=Alt) |将面板按照预设的1-5个布局进行安排:偶数水平,偶数垂直,主水平,主垂直或平铺 + Space |将当前窗口按照下一个预设布局进行安排 + M-n |移动到下一个窗口并且带有一个响铃或者活动标记 + M-o |将当前窗口中的面板从前向后反转 + M-p |移动到前一个窗口并且带有响铃或者活动标记 + C-Up, C-Down C-Left, C-Right |以一个单格的步调调整当前面板的大小 + M-Up, M-Down M-Left, M-Right |以五个单格的步调调整当前面板的大小 + +键绑定可以通过bind-key和unbind-key命令来改变。 + + +##命令 + +这部分包含了tmux支持的命令列表,大部分的命令接收可选的-t参数与一个目标客户端,目标会话,目标窗口或者目标面板。 +它们指定了受命令影响的客户端,会话,窗口或面板 + +目标客户端应该为客户端链接的pty文件的名称,例如对于附着在/dev/ttyp1的客户端可能为 /dev/ttyp1或 +ttyp1。如果没有指定客户端,tmux会尝试当前使用的客户端; +如果失败的话,就会报告一个错误。客户端可以通过list-clients命令列出。 + +目标会话会按照以下顺序进行尝试: + + 1. 一个以$作为前缀的会话ID。 + 2. 一个精确的会话名称(会在list-sessions命令中列出)。 + 3. 会话名称的开始部分,例如“mysess”会匹配一个名为"mysession"的会话。 + 4. 一个与会话名称匹配的fnmatch 模式 + +如果找到了一个单独的会话,就会将其作为目标会话;如果匹配多个会话就会产生错误。 +如果忽略一个会话的话,那么就会使用当前的会话-如果可用的话;如果当前会话不可用,那么最近使用的会话就会被选择。 + +目标窗口通过session:window的格式来指定一个窗口。 会话按照target-session的规则,而窗口会按照以下的顺序来查找: + + 1. 一个下面列表中的特殊标记。 + 2. 一个窗口索引,例如'mysession:1'表示会话'mysession'中的第一个窗口。 + 3. 一个窗口ID,例如@1。 + 4. 一个精确的窗口名称,例如'mysession:mywindow'。 + 5. 一个窗口名称的开始部分,例如'mysession:mywin'。 + 6. 一个于窗口名称相匹配的fnmatch模式。 + 7. 一个空窗口名称制定了下一个未使用的索引如果合适的话(例如new-window或link-window命令), + 否则会话中的当前窗口就被选择。 + +下面的特殊标记可用来指定一个特定的窗口。每个都具有一个可选的单字符格式。 + + 符号 | 别名 | 含义 +--------------|------|--------------- + {start} | ^ | 最小数值的窗口 + {end} | $ | 最大数值的窗口 + {last} | ! | 最后一个窗口 + {next} | + | 按照数字的下一个窗口 + {previous}| - | 按照数字的上一个窗口 + {mouse} | = | 鼠标事件发生的窗口 + +目标面板可以是一个面板ID或者是一个与目标窗口相似的形式,但是带有一个额外可选的跟随面板索引或面板ID的点号“.”。 +如果忽略面板索引的话,那么指定窗口当前的活动面板就会被使用,下面的特殊符号可以作为面板索引使用: + + 符号 |别名 | 含义 +-------------------|------|------------- + {last} | ! | 最后一个面板 + {next} | + | 数字指定的下一个面板 + {previous} | - | 数字指定的前一个面板 + {top} | | 顶端面板 + {bottom} | | 底端面板 + {left} | | 最左端面板 + {right} | | 最右端面板 + {top-left} | | 左顶端面板 + {top-right} | | 右顶端面板 + {bottom-left} | | 左底端面板 + {bottom-right} | | 右底端面板 + {up} | | 活动面板上面的面板 + {down} | | 活动面板下面的面板 + {left} | | 活动面板左边的面板 + {right} | | 活动面板右边的面板 + {mouse} | = | 鼠标事件发生的面板 + +符号'+'和'-'可能跟随一个位移,例如: + + select-window -t:+2 + +会话,窗口和面板都通过一个唯一的ID来进行数字编码; +会话ID带有一个*$*前缀,窗口ID带有一个*@*前缀,面板ID带有一个*%*前缀。 +这些在tmux服务器中的会话,窗口或面板生命周期中都是唯一不变的。 +面板ID通过TMUX_PANE环境变量传递给面板的子进程, +ID可能使用'session_id','window_id'或'pane_id'何display-message,list-sesions,list-windows或list-panes命令的格式进行显示。 + +shell-command 参数是sh命令,这可能是一个传递给shell的参数,例如: + + new-window 'vi /etc/passwd' + +会运行: + /bin/sh -c 'vi /etc/passwd' + +此外,new-window,new-session,split-window, respawn-window以及respawn-pane命令允许 shell-command +作为多参数给定并且可以直接执行(不需要 'sh -C')。 者可以避免shell引用问题,例如: + + $ tmux new-window vi /etc/passwd + +会直接运行vi,而不需要调用shell。 + +命令 [参数] 指向一个tmux命令,命令和参数分别进行传递,例如: + + bind-key F1 set-window-option force-width 81 + +或者,如果使用sh的话: + + $ tmux bind-key F1 set-window-option force-width 81 + +多个命令可以作为命令序列的一部分一起指定,每个命令需要使用空格和分号来分隔; +命令按照从左至右的顺序执行,并且以反斜线结束的行会继续到下一行,除非被另外一个反斜线转义。 +一个字面量分号可以通过一个反斜线进行转义包含进来(例如,当需要制定一个命令行序列给键绑定时) + +tmux命令包含样例: + + refresh-client -t/dev/ttyp2 + rename-session -tfirst newname + set-window-option -t:0 monitor-activity on + new-window ; split-window -d + bind-key R source-file ~/.tmux.conf \; \ + display-message "source-file done" + +或者从sh中: + + $ tmux kill-window -t :1 + $ tmux new-window \; split-window -d + $ tmux new-session -d 'vi /etc/passwd' \; split-window -d \; attach + +##客户端和会话: + +tmux服务器管理客户端,会话,窗口和面板。 +客户端是附着在会话上来与他们交互的,不论他们是通过new-session命令或者之后的attach-session命令创建的会话。 +每个会话具有一个或多个窗口与其链接。 +窗口可以连接到多个会话上,窗口又是有一个或多个面板组成的,每个面板包含了一个伪终端。 +对于创建、链接或其他窗口操作的命令会在 [窗口和面板](#窗口和面板)部分详解。 + +下面的命令可以用来管理客户端和会话: + + attach-session [-dr] [-c working-directory] [-t target-session] + (别名: attach) + +如果在tmux外部来运行,会在当前终端中创建一个新的客户端并且将其附着在一个目标会话上。如果这个命令是在tmux中运行的,就会切换当前的客户端。 +-d 使附着在这个会话上的其他客户端就会脱离, +-r表示这个客户端时只读的(只有键绑定到detach-client或switch-client命令时具有效果)。 +如果没有启动服务器, attach-session 会尝试启动服务器;除非在配置文件中创建了会话否则就会失败。 +对于attach-session命令的目标会话规则稍微有一点调整:如果tmux需要选择最近使用的会话,会偏好选择最近使用的脱离附着的会话。 +-c 设置会话的工作目录(为新窗口所使用)为working-directory + + detach-client [-P] [-a] [-s target-session] [-t target-client] + (别名: detach) + +如果绑定了一个键时会脱离当前客户端,由-t来指定客户端,或者所有附着在由-s指定的会话中的客户端。 +-a选项会终止除-t指定的目标客户端之外的所有客户端。 +-P发送一个SIGHUP信号给当前客户端的父进程,一般是导致其触发退出动作。 + + has-session [-t target-session] + (别名: has) + +如果指定的会话不存在的话,就会报告一个错误并且退出,返回值为1. 如果存在的话,就会退出,返回值为0. + + kill-server + +终止tmux服务器和客户端并且销毁所有的会话。 + + kill-session [-a] [-t target-session] + +销毁指定的会话,关闭连接到会话的任何窗口,并且让所有附着在其上的客户端脱离。 +如果给定了-a选项的话,除了指定的会话之外的会话都被终止。 + + list-clients [-F format] [-t target-session] + (别名: lsc) + +列出附着在服务器上的所有客户端。 对于-F标记,可以参考 [FORMATS](#格式)部分。 +如果给定了目标会话的话,只列出连接到该会话上的客户端。 + + list-commands + (别名: lscm) + +列出所有tmux支持的所有命令语法。 + + list-sessions [-F format] + (别名: ls) + +列出服务器管理的所有会话,对于-F标记,参考 [FORMATS](#格式)部分。 + + lock-client [-t target-client] + (别名: lockc) + +锁定目标客户端, 可以参考 lock-server 命令。 + + lock-session [-t target-session] + (别名: locks) + +锁定附着在目标会话上的所有客户端。 + + new-session [-AdDP] [-c start-directory] [-F format] [-n window-name] [-s session-name] [-t target-session] [-x width] [-y height] [shell-command] + (别名:new) + +使用session-name 来创建一个新的会话。 + +除非给定-d选项,否则新的会话就会附着在当前的终端上。 window-name和shell-comand +是在初始化窗口中执行的窗口和shell命令名称。 +如果使用了-d选项, -x和-y用来指定初始窗口的大小(默认为80x24)。 +如果从终端中运行,任何的termios特殊字符都被保存并且在新会话中的新窗口中使用。 +-A 标记使得新会话与一个附着会话具有相同的行为,如果会话名称已经存在的话;这种情况下,对于attach-session来说-D具有与-d相同的行为。 +如果给定了-t选项,新的会话被分组到目标会话中。 +这就意味着他们共享相同的窗口集合--目标会话中的所有窗口都会连接到新的会话上,并且任何后续的新建窗口或关闭窗口都会被应用在两个会话上。 +当前的窗口和之前的窗口以及任何会话选项保持独立,并且每个会话都会在不影响其他会话的情况下被终止。 +-n或 shell-command只有在使用-t选项时合法。 +-P选项会在新会话创建之后来打印新会话相关信息。默认情况下,会使用'#{session_name}:'格式,但是可以通过-F来指定一个不同的格式。 + + refresh-client [-S] [-t target-client] + (别名:refresh) + +如果绑定了一个键的话会刷新当前客户端,如果使用-t指定了一个客户端的话会刷新单独的客户端。 +-S 只会更新客户端的状态条。 + + rename-session [-t target-session] new-name + (别名:rename) + +重命名会话为一个新名称。 + + show-messages [-IJT] [-t target-client] + (别名:showmsgs) + +显示客户端消息或服务器信息。 +所有显示在状态行的消息都存储在一个客户端独立的消息日志中,具有一个由message-limit选项设置的最大限制。 +-t 显示目标客户端的日志。 +-I,-J 和-T分别显示运行服务器,任务和终端的调试信息。 + + source-file path + (别名:source) + +从路径中来执行命令 + + start-server + (别名:start) + +开启tmux服务器,如果还没有运行,不会创建任何会话。 + + suspend-client [-t target-client] + (别名:suspendc) + +通过发送一个SIGTSTP(tty stop)信号来挂起一个客户端。 + + switch-client [-lnpr] [-c target-client] [-t target-session] [-T key-table] + (别名:switchc) + +将目标客户端所在的当前会话切换到目标会话中, +如果-l, -n或者-p被使用的话,客户端会被分别移动到最后,下一个或上一个会话中。 +-r 转换一个客户端的只读(可以参考attach-session命令) +-T 设置客户端的键表;来自客户端的下一个键会被解释为来自键表。 +这可能会被用在配置多个前缀键时或者绑定命令到一序列键值时使用。 + +例如,让键入'abc'来运行 list-keys命令: + + bind-key -Ttable2 c list-keys + bind-key -Ttable1 b switch-client -Ttable2 + bind-key -Troot a switch-client -Ttable1 + +##窗口和面板 + +一个tmux窗口可能会在处在多个模式中的某一个模式。 +默认的模式时直接访问附着在窗口上的终端。 +另外一个是复制模式,允许一个窗口的一部分或者其历史能够被复制到一个粘贴缓存中,以便稍候插入到另外的窗口中。 +这个模式时使用 copy-mode命令来进入的,默认绑定到'\['上。也会在一个命令产生输出时进入,例如通过键绑定执行的list-keys。 +可用的键依赖于是选择emacs还是vi模式(参考 mode-keys 选项)。 下面的键对于不同的模式具有合适的支持。 + + 函数 |vi模式 |emacs模式 +-------------------------------|-----------|---------------- + Append selection |A | + Back to indentation |^ |M-m + Bottom of history |G |M-< + Clear selection Escape |C-g | + Copy selection Enter |M-w | + Copy to named buffer |" | + Cursor down |j |Down + Cursor left |h |Left + Cursor right |l |Right + Cursor to bottom line |L | + Cursor to middle line |M |M-r + Cursor to top line |H |M-R + Cursor up |k |Up + Delete entire line |d |C-u + Delete/Copy to end of line |D |C-k + End of line |$ |C-e + Go to line |: |g + Half page down |C-d |M-Down + Half page up |C-u |M-Up + Jump again |; |; + Jump again in reverse |, |, + Jump backward |F |F + Jump forward |f |f + Jump to backward |T | + Jump to forward |t | + Next page |C-f |Page down + Next space |W | + Next space, end of word |E | + Next word |w | + Next word end |e |M-f + Other end of selection |o | + Paste buffer |p |C-y + Previous page |C-b |Page up + Previous space |B | + Previous word |b |M-b + Quit mode |q |Escape + Rectangle toggle |v |R + Scroll down |C-Down/C-e |C-Down + Scroll up |C-Up/C-y |C-Up + Search again |n |n + Search again in reverse |N |N + Search backward |? |C-r + Search forward |/ |C-s + Select line |V | + Start of line |0 |C-a + Start selection |Space |C-Space + Top of history |g |M-> + Transpose characters |C-t | + +下一个和上一个单词简默认使用空格和'-','_'以及'@'字符作为单词分隔符,但是可以通过设置会话的word-separators选项进行调整。 +下一个单词会移动到下一个单词的开始位置,下一个单词的末尾会移动到下一个单词的末尾位置, +前一个单词移动到前一个单词的开始位置。 三个下一个和前一个空格键具有相似的作用但是单独使用一个空格作为单词分隔符。 + +跳转命令允许在一个行中快速移动,例如,输入'f'跟随一个'/'会将光标移动到当前行的下一个'/'字符处。 +一个';'之后会移动到字符下一次出现的地方。 + +复制模式中的命令可能由一个可选的重复计数器作为前导,在vi键绑定下,通过数字键来输入前导; +使用emacs时,使用Alt(meta)+数字作为前导实体。例如,为了将光标向前移动10个单词使用'M-1 0 M-f'-对于emacs模式,'10w'-对于vi模式。 + +模式键绑定是通过一个命名表集合定义的:在命令提示的行编辑时使用vi-edit和emacs-edit键, +当从列表中选择时使用vi-choice和emacs-coice键,在复制模式中时使用vi-copy和emacs-copy键。 +这些表可以通过list-keys命令来查看,另外可以通过bind-key和unbund-key命令来修改或移除键。 +如果append-selection,copy-selection或者start-named-buffer给定-x标记,tmux将不会在复制之后退出复制模式。 +copy-pipe复制所选内容并且将其管道到一个命令。 + +例如下面的命令会绑定'C-w'在复制之后不会退出, 'C-q'将所选内容复制到/tmp和粘贴缓冲中。 + + bind-key -temacs-copy C-w copy-selection -x + bind-key -temacs-copy C-q copy-pipe "cat >/tmp/out" + +粘贴缓存键会从栈中顶端的粘贴缓存中粘贴第一行。 +copy-mode命令的简介为: + + copy-mode [-Mu] [-t target-pane] + +进入复制模式。-u选项向上滚动一页。 -M 开始一个鼠标拖拽(只有在绑定鼠标键绑定时有效,参考MOUSE SUPPORT) + +tmux显示的每个窗口可能会被分割为一个或多个面板;每个面板占用一个特定的区域进行显示并且具有一个单独的终端。 +一个窗口可以通过split-window名令分割为多个面板。窗口可以被水平分割(使用-h标记)或者垂直分割。 +面板可以通过resize-pane命令改变大小(默认绑定为'C-up','C-down','C-left','C-right'), +当前的面板可能会通过select-panel命令改变,而rotate-window和swap-panel命令可以在不改变面板位置的情况下切换面板。 +面板被从0开始的数字按顺序计数。 + +有一些默认的预设布局可用,这可以通过select-layout命令来选择或者使用next-layout命令循环选择(默认绑定为'Space'布局); +一旦布局被选定,其中的面板会被移动以及重新改变大小。 + +支持以下的布局: + +even-horizontal: 面板按照偶数地从左到右来分布在窗口中。 +even-vertical: 面板按照偶数地从上到下来分布在窗口中 +main-horizontal: 在窗口的顶端会显示一个大的面板,其余的面板按照从左到右的方式在底部左端的空间分布, +可以使用main-pane-height窗口选项来指定顶部面板的高度。 +main-vertical: 类似于main-horizontal,但是最大的面板会放置在窗口左边而其他的面板按照从上往下的方式在右边进行分布。 +可以参考main-pane-width窗口选项。 +tiled: 面板会尽量将面板在窗口中在行列上以偶数地方式分布。 + +此外,select-layout可以用来应用一个之前使用的布局,list-windows命令会以一个合适的格式显示每个窗口的布局来于select-layout命令结合使用,例如: + + $ tmux list-windows + + 0: ksh [159x48] layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0} + $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0} + +tmux自动地调整当前窗口大小中的布局大小。 注意,一个布局不能应用在多于布局默认定义的面板数量。 + +###窗口和面板命令 +与窗口和面板相关的命令如下: + + break-pane [-dP] [-F format] [-t target-pane] + (别名:breakp) + +将目标面板从其所在的窗口中终止,并将其作为一个新窗口中的唯一的面板。 如果指定-d,新的窗口不会称为当前的窗口。 +-P选项会在新窗口创建之后显示其信息。 默认会使用 +'#{session_name}:#{window_index}'的显示格式,但是可以通过-f来指定一个不同的格式。 + + capture-pane [-aepPq] [-b buffer-name] [-E end-line] [-S start-line] [-t target-pane] + (别名:capturep) +捕获一个面板的内容,如果指定-p,那么输出会到达stdou,否则会到达有-b指定的缓冲区(如果没有指定-b缓冲区的话就会指定一个新的缓冲区)。 +如果指定-a, 会使用备用屏幕,并且历史是不可以访问的。如果没有备用的屏幕,在没有指定-q的情况下会返回一个错误。 +如果指定-e,那么输出会包含文本转义序列和后台属性。 -C 也会转义非打印字符为八进制 \\xxx。 -J +会链接包裹的多行并且保留每行末尾尾随的空格。 -P 只会面板接受到的捕获开头是一个非完整转义序列的任意输出。 +-S 和 -E 指定开始和结束行的行数,0是可视面板的第一行,而负数时历史行。 '-'到 -S是历史的开始,而 +'-'到-E是可视面板的结尾。 默认情况下只会捕获面板的可视内容。 + + choose-client [-F format] [-t target-window] [template] +将一个窗口置于客户端选择模式,允许从一个列表中交互地选择一个客户端。 +在一个客户端被选择之后'%%'会由模板中的客户端pty路径替换,之后的结果会作为一个命令被执行。 +如果模板没有给定,会使用"detach-client -t '%%'"。 +对于-F标记,可以参考[FORMATS](#格式)部分。 这个命令只有在至少一个客户端被附着之后才工作。 + + choose-session [-F format] [-t target-window] [template] +将一个窗口置于会话选择模式中,可以从一个列表中交互式地选择一个会话。 +当一个会话被选择时,'%%'会由模板中的会话名称替换,之后的结果会作为一个命令被执行。 +如果模板没有给定,会使用"switch-client -t '%%'"。 +对于-F标记,可以参考[FORMATS](#格式)部分。这个命令只有在至少有一个客户端附着时工作。 + + choose-tree [-suw] [-b session-template] [-c window-template] [-S format] [-W format] [-t target-window] +将窗口置于一个树选择模式,其中的会话或窗口可能是从一个列表中交互地选择的。 +默认情况下,窗口属于一个会话主要为了显示他们与一个会话的关系。 +注意choose-window和choose-session命令被包裹在choose-tree中。 +如果给定-s会显示会话,如果给定-w会显示窗口。 +默认情形下,树是被折叠起来的,会话必须通过右箭头简将其展开为窗口。 -u选项会将所有的会话展开。 +如果给定-b,会重载默认的会话命令。 注意 '%%'可以被使用而且会被会话名称替换。如果没有指定的话,默认为"switch-client -t +'%%'"。 如果给定-c,会重载默认的窗口命令,与-b类似,'%%'可以被使用而且会被会话名与窗口索引替换。 +当一个窗口从列表中被选择时,会话命令会在窗口命令运行之前运行。 +如果给定-S,会显示指定的格式而不是默认的会话格式。如果给定-W,会显示指定的格式而不是默认的窗口格式。 +对于-s和-w选项的含义可以参考[FORMATS](#格式)部分。 +这个命令只有当至少有一个客户端附着时工作。 + + choose-window [-F format] [-t target-window] [template] +将一个窗口置于一个选择模式,其中的窗口可以从一个列表中交互地选择。 +当选择一个窗口之后,'%%'会被模板中的会话名称和窗括索引替换,之后的结果作为一个命令被执行。 +如果没有给定模板,"select-window -t '%%'"被使用。 +对于-F的含义可以参考[FORMATS](#格式)部分。 这个命令只有在至少一个客户端附着之后才会工作。 + + display-panes [-t target-client] + (别名:displayp) +由一个客户端来显示每个面板的可视化指示器,可以参考 display-panes-time, display-panes-colour和 +display-panes-active-colour会话选项。由于指示器在屏幕上,一个面板可以通过'0-9'键来选择。 + + find-window [-CNT] [-F format] [-t target-window] match-string + (别名:findw) +在窗口名称,标题和可见的内容中搜索fnmatch模式的匹配字符串。标记被用来控制匹配行为: -C只匹配可见窗口内容, +-N只匹配窗口名称,-T匹配窗口标题。 +默认为-CNT。如果只有一个窗口匹配,就会被自动选择,否则就会显示一个选项列表。 +对于-F标记可以参考[FORMATS](#格式)部分。这个命令只有在至少一个客户端被附着时会工作。 + + join-pane [-bdhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane] + (别名:joinp) +与split-window相似,但是取代分割dst-panel并创建一个新面板而代之的是,将其分割并将src-panel移动到空间中。 +这个可以用来逆转break-pane动作。-b选项使得src-pane被联接到dst-pane的左边或上边。 + + kill-pane [-a] [-t target-pane] + (别名:killp) +销毁给定的pane。如果所在窗口中没有剩余的面板,该窗口也会被销毁。 -a选项会销毁除由-t指定面板之外的所有面板。 + + kill-window [-a] [-t target-window] + (别名:killw) +终止当前窗口或目标窗口,将其从所链接的任意会话中移除。 -a选项终止除-t指定窗口之外的所有窗口。 + + last-pane [-de] [-t target-window] + (别名:lastp) +选择最后一个面板,-e 使得输入到面板生效,-d使得输入到面板失效。 + + last-window [-t target-session] + (别名:last) +选择最后一个窗口,如果没有目标窗口指定,选择当前会话中的最后一个窗口。 + + link-window [-dk] [-s src-window] [-t dst-window] + (别名:linkw) +将在src-window的窗口链接到指定的dst-window。如果dst-window被指定但是不存在的话,那么src-window会被链接导那儿。 +如果给定-k并且dst-window存在,那么就会将其终止,否则就会生成一个错误。如果给定-d,新链接的窗口不会被选择。 + + list-panes [-as] [-F format] [-t target] + (别名:lsp) +如果给定-a, 会湖绿target并且会列出服务器上的所有面板。 +如果给定-s,target就是一个会话(或者当前会话)。如果都没有指定,target就是一个窗口(或者当前窗口)。对于-F标记可以参考[FORMATS](#格式)部分。 + + list-windows [-a] [-F format] [-t target-session] + (别名:lsw) +如果给定-a,会列出服务器上的所有窗口。 否则会列出当前会话或target-session中的窗口。对于-F标记可以参考[FORMATS](#格式)部分。 + + move-pane [-bdhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane] + (别名:movep) +与join-pane类似,但是src-pane和dst-pane可以属于相同的窗口。 + + move-window [-rdk] [-s src-window] [-t dst-window] + (别名: movew) +这个于link-window相似,除了src-window中的窗口被移动到dst-window。给定-r会话中的所有窗口都会在遵照base-index选项下按照序列顺序重新编号。 + + new-window [-adkP] [-c start-directory] [-F format] [-n window-name] [-t target-window] [shell-command] + (别名:neww) +创建一个新的窗口,给定-a,新建的窗口会被插入到指定target-window的下一个索引上,必要的话会将窗口向上移,否则target-window就是这个新建的窗口。 + +如果给定-d, 会话不会将新建窗口作为当前窗口。target-window表示将会创建的窗口;如果目标窗口已经存在会显示一个错误,如果使用-k标记就会销毁。 +shell-command是将要执行的命令。如果没有指定shell-command, +default-command选项的值被默认使用。-c选项指定了新窗口创建的工作目录。 +当shell命令完成时,窗口关闭。 参考remain-on-exit选项来改变这个行为。 +对于运行在tmux中的所有程序需要将TERM环境变量设置为"screen"。 +新的窗口会自动将"TERM=screen"加到他们的环境中,但是必须注意不要在shell启动文件中重置这个变量。 +-P 选项在新窗口创建后会打印与之相关的信息。 +默认情况下,使用'#{session_name}:#{window_index}'的格式,但是可以通过使用-F来指定一个不同的格式。 + + next-layout [-t target-window] + (别名:nextl) +将窗口移动到下一个布局模式并且重新安排面板来使之适应。 + + next-window [-a] [-t target-session] + (别名:next) +移动到会话中的下一个窗口,如果-a指定,在移动到下一个窗口时带有警告。 + + pipe-pane [-o] [-t target-pane] [shell-command] + (别名:pipep) +将target-pane中程序的输出通过管道传递给一个shell命令。一个面板可能一次只能管道给一个命令,在shell-command命令执行之前任何存在的管道都会关闭。 +shell-command字符串可能会包含status-left选项所支持的特殊字符序列。 如果没有指定shell-command,那么当前的管道就会被关闭。 +-o选项只有在没有之前的管道存在时打开一个新管道,允许一个管道通过一个单键进行切换,例如: + + bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P' + + + previous-layout [-t target-window] + (别名:prevl ) +移动到会话之前的布局。 + + previous-window [-a] [-t target-session] + (别名:prev) +移动到会话之前的窗口,使用-a选项会带有一个警告。 + + rename-window [-t target-window] new-name + (别名: renamew) +重命名当前窗口或者由-t指定的target-window窗口为new-name + + resize-pane [-DLMRUZ] [-t target-pane] [-x width] [-y height] [adjustment] + (别名:resizep) +重新定义面板的大小,通过-U, -D, -L或-R来调整上下左右,或者通过-x/-y指定绝对值大小。 +调整是通过行或单元格来给定的(默认为1)。 +使用-Z时,活动面板会在放大(占用整个窗口)或未放大(在布局中的正常位置)之间进行切换。 +-M 开始鼠标重定义大小(只有在鼠标键绑定时有效,参考MOUSE SUPPORT部分) + + respawn-pane [-k] [-t target-pane] [shell-command] + (别名:respawnp) +在shell-comman退出之后重新激活面板(可以参考remain-on-exit 窗口选项)。如果没有给定shell-comman, +那么面板创建时所使用的命令会被执行。面板必须是已经激活的状态,如果给定-k,任何存在的命令都会被终止。 + + respawn-window [-k] [-t target-window] [shell-command] + (别名:respawnw) +在shell-command退出之后重新激活窗口(可以参考remain-on-exit窗口选项)。 如果没有指定shell-comman, +那么窗口创建时所使用的命令会被执行。 窗口必须是已经激活的状态,如果指定-k任何存在的命令都会被终止。 + + rotate-window [-DU] [-t target-window] + (别名:rotatew) +轮换窗口中面板的位置,或者通过-U向前或者向后。 + + select-layout [-nop] [-t target-window] [layout-name] + (别名:selectl) +为窗口选择一个特定的布局,如果没有指定布局名称,就会使用最后使用的预设布局并且重新布局。 + + select-pane [-DdegLlRU] [-P style] [-t target-pane] + (别名:selectp) +将target-pane面板作为target-window窗口中的活动面板,或者设置其风格(使用-P)。 +如果使用了-D,-L,-R或者-U的话,就会分别使用target-pane面板的下面,左边,右边或上面的面板。 +-l与使用last-pane命令效果一样。 -e使得输入到面板生效,-d使得输入到面板失效。 + +每个面板具有一个风格:默认使用window-style和window-active-style选项。select-pane -P 为单个面板设置风格。 +例如将第一个面板的北京设置为红色red: + + select-pane -t:.1 -P 'bg=red' + +-g 显示当前面板的样式。 + + select-window [-lnpT] [-t target-window] + (别名:selectw) +选择目标窗口。-l,-n和-p等价于last-window,next-window和previous-window命令。 +如果给定-T,而且选择的窗口已经是当前窗口,那么命令表现为last-windown命令。 + + split-window [-bdhvP] [-c start-directory] [-l size | -p percentage] [-t target-pane] [shell-command] [-F format] + (别名:splitw) +通过分割target-pane窗口来创建一个新面板: -h为水平分割,-v为垂直分割; 默认为垂直分割。 +-l和-p选项指定新面板的行(对于垂直分割)或单元格(水平分割),或者作为百分比。-b选项使得新建面板在target-pane的左边或上边。 +其他的任何选项的含义于new-window命令一样。 + + swap-pane [-dDU] [-s src-pane] [-t dst-pane] + (别名:swapp) +转换两个面板。如果使用-U并且没有通过-s来指定源面板的话,dst-pane会与之前的面板进行转换;-D与下一个面板进行转换。 +-d用来指示tmux不要改变活动面板。 + + swap-window [-d] [-s src-window] [-t dst-window] + (别名:swapw) +这个与link-window类似,除了源面板与目标面板相互转换之外。如果在src-window没有窗口的话会出错。 + + unlink-window [-k] [-t target-window] + (别名:unlinkw) +取消target-window的链接。除非给定-k选项,否则只有当一个窗口链接到多个会话时才会被取消链接-窗口不能链接到空会话; +如果指定-k选项,而且窗口只有与一个会话相关联,那么窗口会被取消该链接并且被销毁。 + +##键绑定2 + + tmux允许一个命令被绑定到大多数键上-无论是否带有前导键。当指定键时,大部分键代表其本身字面量含义(例如'A-Z')。 +Control键可能表示为'C-'或'^'前导,而Alt(meta)表示为'M-'。此外,特殊的键名称也是被接受的:Up,Down, Left, Right, +BSpace, BTab, DC(delete), End, Enter, Escape, F1-F12, Home, IC(insert), NPage/PageDown/PgDn, PPage/PageUp/PgUp, Space和Tab。 +注意为了绑定双引号或单引号键,引号标记是必需的,例如: + + bind-key '"' split-window + bind-key "'" new-window + +###键绑定命令 +与键绑定相关的命令如下: + + bind-key [-cnr] [-t mode-table] [-T key-table] key command [arguments] + (别名:bind) +将键绑定到命令。键被绑定到一个键表中。 +默认情况(没有'-T')时,键被绑定到前导键表中。这个表被用在前导键键入之后再键入的键(例如,'c'默认绑定为前导键表中的新建窗口命令, +所以'C-b c'会创建一个新窗口)。 +根键表被用在不需要前导键的键输入:将'c'在根键表中绑定为新建窗口命令时意味着一个普通的'c'键就会创建一个新窗口。 +'-n' 是 '-T root' 的别名。键同样可以绑定到客制化的键表中,'switch-client -T command' 用来从一个键绑定中切换到相应的键。 +'-r' 标记指定这个键可以重复,参考'repeat-time'选项。 + +如果出现-t选项,那么键会绑定到一个mode-table(模式表): 使用-c来绑定到命令模式,缺省时绑定为普通模式。 +可以参考WINDOWS AND PANES部分,并且 list-keys命令可以查看模式键绑定。 + +为了查看默认的绑定和可用的命令可以参考list-keys 命令: + + list-keys [-t mode-table] [-T key-table] + (别名:lsk) +列出所有的键绑定。 没有指定-T时会打印所有的键表,指定-T时只会打印key-table. +带-t时,在模式表中的键绑定会被列出来; 模式可能为以下之一:vi-edit,emacs-edit,vi-choice,emacs-choice, +vi-copy或emcas-copy。 + + send-keys [-lMR] [-t target-pane] key ... + (别名:send) +发送一个或多个键到一个窗口中,其中的每个参数key是发送的键的名称(例如'C-a'或者'npage'); +如果字符串不能作为键来识别,就会作为一系列字符串发送。 +-l标记让键名查找失效并且发送键的字面量值。所有的参数被按照先后顺序序列地发送。 +-R标记导致终端状态被重置。 +-M 通过一个鼠标时间传递(只有当绑定一个鼠标键绑定时有效,参考MOUSE SUPPORT)。 + + send-prefix [-2] [-t target-pane] +发送前导键-或者发送二级前导键如果与-2一起使用时-到一个窗口就像该键被按下一样。 + + unbind-key [-acn] [-t mode-table] [-T key-table] key + (别名:unbind) +取消命令到键的绑定,-c,-n,-T 和-t与bind-key命令的含义一样。 如果-a存在,所有的键绑定都会被移除。 + +##选项 +tmux的外观和行为可以通过修改各个选项的值来进行改变,具有三种选项:服务器选项,会话选项和窗口选项。 +tmux服务器具有一个全局选项集合--这个选项集合不会应用到任何特定的窗口或会话中。 +这些选项通过'set-option -s'命令进行修改,或者通过'show-options -s' 命令进行显示。 +此外,每个单独的会话可能具有一个会话选项集合,同时具有一个分开全局会话选项集合。 +没有特定选项配置的会话会从全局会话选项中继承其值。会话选项可以通过set-option命令进行设置或重置, +可以通过show-options命令来列出会话选项。可用的服务器和会话选项会在set-option命令下列出。 +类似地,每个窗口都附着了一个窗口选项集合,并且具有一个全局窗口集合来继承所有的重置选项。 +窗口选项使用set-window-option命令来进行修改,并且可以通过show-window-options命令来列出。 +所有的窗口选项使用set-window-option命令归档。 + +tmux也支持以'@'作为前导的用户选项, 用户选项可以具有任何名称,可以被设置为任何字符串,只要具有'@'作为前导,例如: + + $ tmux setw -q @foo "abc123" + $ tmux showw -v @foo + abc123 + +###选项设置 + +设置选项的命令如下: + + set-option [-agoqsuw] [-t target-session | target-window] option value + (别名:set) +通过-w来设置窗口选项(与set-window-option命令等价),-s设置服务器选项,否则设置会话选项。 +如果指定-g,那么全局会话或窗口选项就会被设置。 +-u标记用来重置选项,所以一个会话从全局选项中来继承,不能重置一个全局选项。 +-o标记阻止设置一个已经存在的选项。 +-q标记会取消位置选项发生的错误。 +带有-a时,如果选项期待一个字符串或者一个样式,那么只会被附加在已经设置的值后面,例如: + + set -g status-left "foo" + set -ag status-left "bar" + +会得到'foobar'结果,而: + + set -g status-style "bg=red" + set -ag status-style "fg=blue" + +会得到一个红色背景和蓝色前景的结果。 +没有-a时,这个值会使用默认的背景和一个蓝色前景。 +可用的窗口选项在set-window-option下列出。 +选项的值依赖于选项类型,可以为数字,字符串,或者一个标记(on/off/省略)。 + + + + +###服务器选项 +可选的服务器选项有: + + buffer-limit number +设置缓冲器数量; 新的缓冲器被放置在栈顶端,旧的缓冲器在维护最大长度时有必要时从栈底端移除。 + + default-terminal terminal +为会话中新创键的窗口设置一个默认的终端-默认值为TERM环境变量。为了让tmux正确工作,这个值必须设置为'screen','tmux'或者来自他们的一个派生值。 + + escape-time time +设置一个tmux用来在接受到一个转义字符输入时的等待毫秒数,以此让tmux来判断该字符时函数的一部分还是一个meta键序列的一部分。 +默认为500毫秒。 +设置一个tmux用来在接受到一个转义字符输入时的等待毫秒数,以此让tmux来判断该字符时函数的一部分还是一个meta键序列的一部分。 +默认为500毫秒。 + + exit-unattached [on | off] +如果生效,服务器会在没有任何附着的客户端时退出。 + + + focus-events [on | off] +如果生效,在终端支持的情况下会从终端获取聚焦事件请求,然后通过tmux中运行的应用来传递。 +附着的客户端应该被脱离附着状态然后在选项修改之后重新进行附着。 + + message-limit number +设置每个客户端保存到消息日志中的错误或信息消息的数量,默认为100。 + + set-clipboard [on | off] +尝试使用\e]52;...\007 xterm转义序列来设置终端的剪切版。 +如果在客户终端的terminfo描述中存在一个Ms实体,那么这个选项默认为on. 注意在xterm中需要设置以下资源来让这个特性生效: + + disallowedWindowOps: 20,21,SetXprop + +或者在需要的时候从xterm交互中改变这个属性值。 + + terminal-overrides string +包含了一个个实体列表来重载使用terminfo读取的终端描述信息。 +字符串是一个"逗号"分割的项目列表,每个项目是一个':'分割的字符串来组成终端类型模式以及一个name=value实体集合。 + +例如,为了给所有的终端类型设置terminfo实体'clear'为'\e[H\e[J',以及将'rxvt'终端类型的实体'dch1'的值设置为'\e[P', +那么这个选项会按照以下字符串进行设置: + + "*:clear=\e[H\e[2J,rxvt:dch1=\e[P" + +终端实体值会在解释之前通过strunvis传递,默认的值会强制地更新支持256colors的终端的'colors'实体: + + "*256col*:colors=256,xterm*:XT" + + + +###会话选项 + +可用的会话选项有: + + assume-paste-time milliseconds +如果被键入的键快于用毫秒指定的值,那么这些键会被假设为粘贴而不是键入,而且tmux键绑定不会被执行。默认为一毫秒,0用来让选项失效。 + + base-index index +设置在创建一个新窗口时应该搜索的未使用索引的基索引,默认为0。 + + bell-action [any | none | current] +窗口响铃动作,any表示连接到一个会话的任何窗口中的响铃会导致这个会话中的当前窗口中的一个响铃,none表示所有的响铃被忽略, +current表示除了当前窗口之外的窗口中的响铃将会被忽略。 + + bell-on-alert [on | off] +如果为on,在出现一个警告时,终端会响铃。 + + default-command shell-command +设置新窗口所使用的命令(如果没有指定就是窗口创建时的命令)为shell-command, 可能为任何sh命令。 +默认是一个空字符串,用来指示tmux使用默认shell选项来创建一个登录shell。 + + default-shell path +指定默认的shell, 当default-command为空时,这个会作为新建窗口的登录shell,这个path值必须为完整的路径名。 +在启动之后,tmux会尝试从第一个合适的SHELL环境变量中来设置为默认值,shell由'getpwuid'或者 '/bin/sh'。 +这个选项在将tmux作为一个登录shell使用时应该被配置。 + + destroy-unattached [on | off] +如果生效的话,当会话不再附着在任何客户端时就会被销毁。 + + detach-on-destroy [on | off] +如果为on(默认值), 当附着的会话被销毁时,客户端会脱离附着。 如果off,客户端会被切换为剩余会话中的最近活动的会话。 + + display-panes-active-colour colour +设置为活动面板显示指令的display-panes命令所使用的colour。 + + display-panes-colour colour +设置为不活动面板显示指令的display-panes命令所使用的colour。 + + display-panes-time time +以毫秒为淡灰来设置display-panes命令显示指令出现的时间。 + + display-time time +设置状态行消息和其他屏幕指令显示的时间总和,时间是以毫秒指定的。 + + history-limit lines +设置窗口历史持有的最大行数,这个设置只会应用在新窗口上--退出时窗口历史不会重写大小并且会保留在其创建时段的限制。 + + lock-after-time number +在number秒时间不活动后会锁定会话(与lock-session命令类似),如果lock-server选项被设置的话, +那么整个服务器(所有会话)都会被锁定。默认为不锁定(number为0)。 + + lock-command shell-command +锁定每个客户端时运行的命令,默认为lock -np 命令。 + + lock-server [on | off] +如果选项为on(默认值), 与每个会话单独锁定不同的是,整个服务器会在所有会话被锁定时锁定。 +作为一个会话选项这个没有什么影响,这个必须时一个全局选项。 + + message-command-style style +设置状态行命令样式,样式是一个由逗号分割的字符列表来指定的。 +这些样式可能时'bg=colour'来设置背景颜色,'fg=colour'来设置前景颜色,另外有下面指定的属性列表: + +颜色值可以为这些颜色中的一个:black,red,green, yellow, blue, magenta,cyan,white,aixterm bright +variants(如果支持的话,会有:brightred,breightgreen,等)。 +256-colour集合中从colour0到colour255为默认值,或者一个十六进制的RGB字符串,例如'#ffffff'-会从默认的256-colour集合中选择最匹配的颜色。 +属性既可以为none或者一个逗号分割一个或多个包含(bright(或bold),dim,underscore,blink,reverse, hidden或者italics)的列表来开启属性, +或者带有'no'前缀的属性来关闭属性。 + +样例: + + fg=yellow,bold,underscore,blink + bg=black,fg=default,noreverse + +如果set-option命令具有一个 '-a' 标记的话,新的样式会添加进来,否则已经存在的样式被替换。 + + message-style style +设置状态行消息样式,对于如何指定样式,可以参考message-command-style选项。 + + mouse [on | off] +如果为on,tmux会捕获鼠标并且允许鼠标时间作为键绑定进行结合。 可以参考MOUSE SUPPORT 部分详解。 + + mouse-utf8 [on | off] +如果生效,在UTF-8终端请求鼠标输入作为UTF-8。 + + prefix key +设置接收到的key作为前导键 + + prefix2 key +设置接收到的键作为二级前导键。 + + renumber-windows [on | off] +如果为on, 当一个窗口在会话中关闭时,自动地将其他窗口按照数字顺序重新编序。 +这回参考base-index选项如果设置了这个选项的话。如果为off,不会对窗口进行重新排序。 + + repeat-time time +允许指定的时间内(默认为500毫秒)在不重新输入前导键时输入多个命令。 +一个键是否可以重复可以在使用bind-key命令结合时使用-r选项进行设置。 +对于与resize-pane命令结合的默认键的重复是开启的。 + + set-remain-on-exit [on | off] +为在这个会话中任何第一次创建的窗口设置remain-on-exit窗口选项。 +当这个选项为true时,运行程序所在的窗口在程序退出时不会关闭,而是保持打开但是不活动。 +可以使用respawn-window命令来重新激活这个窗口,或者使用kill-window来销毁窗口。 + +如果tsl和fslterminfo实体存在的话,会尝试用其来设置客户终端的标题。 +如果终端显示为一个xterm的话tmux自动将其设置为\e]2;...\007序列。 +这个选项默认为off。注意elinks只会在设置了STY环境变量时才尝试设置窗口标题。 + + set-titles-string string +如果set-titles为on,那么字符串string就会用来设置窗口标题。 格式被扩展,参考[FORMATS](#格式)部分。 + + status [on | off] +显示或隐藏状态行。 + + status-interval interval +在每个间隔时间段更新状态栏。 默认时没15秒更新。如果为0会让时间间隔重绘状态失效。 + + status-justify [left | centre | right] +设置状态行窗口列表组件的位置:left,center,或者right对齐。 + + status-keys [vi | emacs] +在状态栏使用vi或者emacs-样式的键绑定,例如在命令提示时。默认为emacs, 除非VISUAL +或者EDITOR环境变量被设置并且包含字符串'vi'。 + + status-left string +将字符串(默认为会话名称)显示在状态栏的左边。字符串会通过strftime传递并且格式会被扩展,也可能会包含下面特殊字符序列的任意字符: + + 字符对 | 替换值 +---------------------------|--------------------------------- + #(shell-command) | 命令输出的首行。 + #[attributes] | 颜色或属性改变 + ## | 一个'#'字面量值。 + +'\#(shell-command)'形式执行'shell-command'然后插入其输出的首行。 +注意shell命令只会在由status-interval选项指定的时间间隔内执行一次:如果同时重绘状态的话,会使用之前输出结果。 +shell命令的执行会带有tmux的全局变量集合(参考 ENVIRONMENT部分)。 +对于如何设置名字和标题的细节可以参考NAMES AND TITLES 部分。 对于允许设定的属性可以参考message-command-style选项。 + +样例有: + + #(sysctl vm.loadavg) + #[fg=yellow,bold]#(apm -l)%%#[default] [#S] + +默认字符串中的UTF-8不会被解释,需要使用status-utf8选项来开启UTF-8。 +默认值为'[#s]'。 + + status-left-length length +设置状态栏左边组件的最大长度,默认为10。 + + status-left-style style +设置状态行左边部分的样式,参考message-style-style选项来指定样式。 + + status-position [top | bottom] +设置状态行的位置。 + + status-right string +显示字符串在状态栏的右边,默认为带双引号的当前窗口标题以及日期时间会被显示。 +与status-left类似,字符串也会传递给strftime,字符对会被替换而且UTF-8也依赖于status-utf8选项。 + + status-right-length length +设置状态栏右边组件的最大长度,默认为10。 + + status-right-style style +设置状态行右边部分的样式,参考message-command-style选项设置样式。 + + status-style style +设置状态行样式,参考message-command-style选项设置样式。 + + status-utf8 [on | off] +指示tmux将status-left和status-right中的字符串中的top-bit-set当作UTF-8处理;值得注意的时,这对于宽字符很重要。默认为off。 + + update-environment variables +设置一个包含由空格分开的环境变量列表字符串--这些环境变量会在新会话创建时或一个已存在的会话被附着时复制到会话环境中。 +任何在源环境中不存在的变量会从会话环境中设置为移除(类似于将-r传递给set-environment命令)。 +默认值为"DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY"。 + + visual-activity [on | off] +如果为on, 当活动出现在一个由monitor-activity窗口选项生效的窗口中时显示一个状态行。 + + visual-bell [on | off] +如果为on,响铃时会显示一个消息而不是将其传递到终端(会产生一个声音)。可以参考bell-action选项。 + + visual-silence [on | off] +如果monitor-silence生效的话,那么当时间间隔在一个指定窗口中过期时会打印一个消息。 + + word-separators string +设置会话关于单词分隔符字符的概念,主要是为了复制模式中的下一个或前一个单词命令的目的。默认为'-_@'。 + + set-window-option [-agoqu] [-t target-window] option value + (别名:setw) +Set a window option. The -a, -g, -o, -q and -u flags work similarly to the set-option command. + +###窗口选项 +支持的窗口选项有: + + aggressive-resize [on | off] +积极地重新调整所选窗口大小。意味着tmux会重新调整窗口的尺寸为当前窗口的最小会话尺寸,而不是其附着的最小的会话。 +在当前窗口改变为另外一个会话时窗口会重新调整大小;这个选项对于支持SIGWINCH的全屏程序有好处而对于交互式程序如shell不是太好。 + + allow-rename [on | off] +允许程序通过终端转义序列(\033k...\033\\)改变窗口名称。默认为on。 + + alternate-screen [on | off] +这个选项用来配置运行在tmux中的程序是否可以使用终端的被用屏幕特性-允许terminfo的smcup和rmcup能力。 +被用屏幕特性在一个交互式程序开启并且在从退出后恢复之后可以保留窗口的内容, +这样任何程序开始之前的可视输出会在程序退出之后重新出现。默认为on。 + + automatic-rename [on | off] +控制自动化窗口命名。当开启这个设置时,tmux会使用由automatic-rename-format指定的格式来自动地重命名窗口。 +对于由new-window和new-session在创建时,或者之后通过rename-window或者使用终端转义序列指定的窗口名称, 这个标识会自动失效。 + +可以通过以下方式来将其在全局范围内关闭: + + set-window-option -g automatic-rename off + + + automatic-rename-format format + +在automatic-rename选项生效时会使用这个格式, 参考 [FORMATS](#格式) 。 + + c0-change-interval interval + c0-change-trigger trigger +这两个选项配置面板改变时间间隔的一个简单格式。如果tmux在1毫秒内查看到除C0序列之外的触发器(例如回车,换行或删除) +修改屏幕,会立即停止更新面板。否则会在每个时间间隔内重绘整个面板。 +这个可以帮助来阻止快速输出(例如yes)覆盖整个终端。默认为触发器250, 时间间隔100。 +0触发器用来失效速率限制。 + + + + clock-mode-colour colour +设置时钟颜色。 + + clock-mode-style [12 | 24] +设置时钟小时格式 + + force-height height + force-width width +阻止tmux将窗口的大小值超过width或height, 0值会恢复默认无限制设置。 + + main-pane-height height + main-pane-width width +设置main-horizontal 或 main-vertical布局中的主面板的长和宽。 + + +mode-keys [vi | emacs] +在复制或选择模式中使用vi/emacs键绑定。与status-keys选项一样默认为emacs, 除非VISUAL或EDITOR包含了vi。 + +mode-style style +设置窗口模式样式, 参考message-command-style选项指定样式。 + +monitor-activity [on | off] +监视窗口中的活动。具有活动事件的窗口在状态栏上高亮显示。 + +monitor-silence [interval] +在一段时间间隔内对非活动窗口进行监控。时间间隔内沉默的窗口在状态栏高亮。 +0间隔值让其监控失效。 + + +other-pane-height height +设置main-horizontal布局中主面板之外的面板高度。默认为0-没有任何作用。 +如果main-pane-height和other-pane-height选项同时设置,主面板会变得来使得 +其他面板达到指定高度,但是不会反过来作用。 + +other-pane-width width +与other-pane-height类似,只是用来设置 main-vertical布局中的其他面板的宽度。 + +pane-active-border-style style +设置当前活动面板的边框样式。 参考 message-command-style选项来指定样式,属性被忽视。 + +pane-base-index index +与 base-index类似,只是用来设置面板的开始数字。 + +pane-border-style style +设置活动面板周围面板的样式。 参考 message-command-style选项来指定样式,属性被忽视。 + +remain-on-exit [on | off] +带有该标识设置的窗口在其中程序退出时不会被销毁。 +窗口可能使用respawn-window命令重新激活。 + +synchronize-panes [on | off] +将到任意面板的输入复制到相同窗口中的所有其他面板(没有在特殊模式中的面板)。 + +utf8 [on | off] +指示tmux期待在窗口中出现 UTF-8序列。 + +window-active-style style +设置窗口的活动面板的样式。参考 message-command-style选项来指定样式。 + +window-status-activity-style style +设置窗口的状态行样式带有一个活动警告。参考 message-command-style选项来指定样式。 + +window-status-bell-style style +设置窗口的状态行样式带有一个响铃警告。参考 message-command-style选项来指定样式。 + + window-status-current-format string +与 window-status-format类似,只是这个格式在窗口为当前窗口时使用。 + + window-status-current-style style +为当前的活动窗口设置状态行样式。 参考 message-command-style选项来指定样式。 + + window-status-format string +设置状态行列表中显示窗口的格式。 参考 status-left选项关于可用的特殊字符序列信息。默认值为'#I:#W#F'。 + + window-status-last-style style +为最后一个活动窗口设置状态行样式。参考 message-command-style选项来指定样式。 + + window-status-separator string +设置状态行中窗口之间的分隔符,默认为单个空格符。 + + window-status-style style +为单个窗口设置状态行样式。参考 message-command-style选项来指定样式。 + + window-style style +设置默认窗口样式。参考 message-command-style选项来指定样式。 + + xterm-keys [on | off] +设置该选项会使tmux生成xterm-style功能键序列; 这些包含了一个数字来指定修饰符如Shift,Alt或Ctrl。默认为off。 + + wrap-search [on | off] +设置这个选项会使得搜索动作包含面板内容的末尾。 默认为on。 + + show-options [-gqsvw] [-t target-session | target-window] [option] +(别名:show) +使用-w来显示窗口选项(可以指定单个窗口),使用-s显示服务器选项,否则显示target-session的会话选项。 +-g用来显示全局会话或窗口选项。 +-v只显示选项值,不包含名称。 +-q指示重置选项不会返回错误。 + + show-window-options [-gv] [-t target-window] [option] +(别名:showw) +列出窗口选项或者target-window指定的单个窗口选项。 +-g用来显示全局窗口选项。 +-v显示选项值,忽略选项名。 + +##鼠标支持 +如果鼠标选项开启(默认为关闭),tmux允许将鼠标时间作为键来结合。 +每个键的名称是由鼠标事件(例如'MouseUp1')和一个位置后缀('Pane'表示面板内容,'Border'面板边界 +或者'Status'状态行)组成的。可以使用以下的鼠标事件: + + MouseDown1 MouseUp1 MouseDrag1 + MouseDown2 MouseUp2 MouseDrag2 + MouseDown3 MouseUp3 MouseDrag3 + WheelUp WheelDown + +每个都需要带有一个位置后缀,例如'MouseDown1Status' + +特殊标记'{mouse}'或'='可能在命令中作为target-window或target-pane与鼠标键绑定进行结合。 +会在鼠标事件发生的位置解析为窗口或面板(例如,对于一个'MouseUp1Status'绑定在在状态行上的窗口, +或者对于'WheelDownPane'绑定面板上的鼠标滚动)。 + +'send-key -M'标记可以用来将一个鼠标时间转发到一个面板上。 + +默认的键绑定允许鼠标用来选择和改变面板大小,复制文本或者使用状态行来改变窗口。 +这些动作在开启鼠标选项时发生作用。 + + +##格式 + +有些命令接受由-F标记附带的格式参数。这个参数是一个控制命令输出格式的字符串。 +可替换的变量被包含在'#{'和'}'之间,例如'#{session_name}'。 +可用的变量在下表中列出,或者tmux选项的名称可以一个选项的值。 +有些变量具有一个简短的别名,例如'#s', 而'##'会使用一个单独的'#'来替换。 + + +条件可以通过'?'作为前缀,逗号作为分隔符来使用,如果指定的变量存在并且不是0,那么第一个选项被选择,否则选择第二个选项。 +例如'#{?session_attached,attached,not attached}'条件,当会话是附着的就会包含'attached'否则就会包含'not attached'。 +而对于'#{?automatic-rename, yes, no}'如果开启了automatic-rename的话会包含'yes'否则包含'no'。 +可以通过一个前缀'=',一个数字和一个冒号来作为字符串的长度限制,所以'#{=10:pane_title}'最多包含pane标题的前10个字符。 + +在合适的地方有以下的变量是可用的: + + 变量名 | 别名 | 替换值 + -----------------------|--------------|----------------------------------- + alternate_on | | If pane is in alternate screen + alternate_saved_x | | Saved cursor X in alternate screen + alternate_saved_y | | Saved cursor Y in alternate screen + buffer_sample | | Sample of start of buffer + buffer_size | | Size of the specified buffer in bytes + client_activity | | Integer time client last had activity + client_activity_string | | String time client last had activity + client_created | | Integer time client created + client_created_string | | String time client created + client_height | | Height of client + client_last_session | | Name of the client's last session + client_prefix | | 1 if prefix key has been pressed + client_readonly | | 1 if client is readonly + client_session | | Name of the client's session + client_termname | | Terminal name of client + client_tty | | Pseudo terminal of client + client_utf8 | | 1 if client supports utf8 + client_width | | Width of client + cursor_flag | | Pane cursor flag + cursor_x | | Cursor X position in pane + cursor_y | | Cursor Y position in pane + history_bytes | | Number of bytes in window history + history_limit | | Maximum window history lines + history_size | | Size of history in bytes + host | #H | Hostname of local host + host_short | #h | Hostname of local host (no domain name) + insert_flag | | Pane insert flag + keypad_cursor_flag | | Pane keypad cursor flag + keypad_flag | | Pane keypad flag + line | | Line number in the list + mouse_any_flag | | Pane mouse any flag + mouse_button_flag | | Pane mouse button flag + mouse_standard_flag | | Pane mouse standard flag + mouse_utf8_flag | | Pane mouse UTF-8 flag + pane_active | | 1 if active pane + pane_bottom | | Bottom of pane + pane_current_command | | Current command if available + pane_dead | | 1 if pane is dead + pane_dead_status | | Exit status of process in dead pane + pane_height | | Height of pane + pane_id | #D | Unique pane ID + pane_in_mode | | If pane is in a mode + pane_input_off | | If input to pane is disabled + pane_index | #P | Index of pane + pane_left | | Left of pane + pane_pid | | PID of first process in pane + pane_right | | Right of pane + pane_start_command | | Command pane started with + pane_synchronized | | If pane is synchronized + pane_tabs | | Pane tab positions + pane_title | #T | Title of pane + pane_top | | Top of pane + pane_tty | | Pseudo terminal of pane + pane_width | | Width of pane + saved_cursor_x | | Saved cursor X in pane + saved_cursor_y | | Saved cursor Y in pane + scroll_region_lower | | Bottom of scroll region in pane + scroll_region_upper | | Top of scroll region in pane + session_attached | | Number of clients session is attached to + session_activity | | Integer time of session last activity + session_activity_string| | String time of session last activity + session_created | | Integer time session created + session_created_string | | String time session created + session_group | | Number of session group + session_grouped | | 1 if session in a group + session_height | | Height of session + session_id | | Unique session ID + session_many_attached | | 1 if multiple clients attached + session_name | #S | Name of session + session_width | | Width of session + session_windows | | Number of windows in session + window_active | | 1 if window active + window_activity_flag | | 1 if window has activity alert + window_bell_flag | | 1 if window has bell + window_find_matches | | Matched data from the find-window + window_flags | #F | Window flags + window_height | | Height of window + window_id | | Unique window ID + window_index | #I | Index of window + window_last_flag | | 1 if window is the last used + window_layout | | Window layout description + window_name | #W | Name of window + window_panes | | Number of panes in window + window_silence_flag | | 1 if window has silence alert + window_width | | Width of window + window_zoomed_flag | | 1 if window is zoomed + wrap_flag | | Pane wrap flag + + +##名称和标题 + +tmux区分名称和标题,窗口和会话具有名称用来作为目标标识,并且在状态行和不同的列表中显示: +名称是tmux对于一个窗口或会话的标识符。 +只有pane面板有标题,面板的标题是由在其中运行的程序设置的并且不能由tmux改变。 +与X窗口管理器中的xterm窗口标题的设置所使用的机制相同。 +窗口本身没有标题----一个窗口的标题就是其活动面板的标题。 +tmux本身会设置客户端所在终端的标题,参考set-title选项。 + +A session's name is set with the new-session and rename-session commands. A window's name is set with one of: +一个会话的名称通过new-session和rename-session命令来设置的,一个窗口的名称可以通过以下方式设置: + + 1. 一个命令的参数(如new-window和new-session的-n参数) + 2. 一个转义序列: $ printf '\033kWINDOW_NAME\033\\' + +自动重命名会将名称设置为窗口活动面板中的活动程序,参考automatic-rename选项。 + +当一个面板第一次创建时,其标题为主机名hostname。一个面板的标题可以通过OSC标题设置序列进行设置,例如: + $ printf '\033]2;My Title\033\\' + +##环境 + +当tmux服务器启动时,tmux会将环境复制到全局环境中,此外每个会话具有一个会话环境。 +当一个窗口被创建时,会将会话环境和全局环境合并。 +如果一个变量存在两个环境中,会使用会话环境中的变量。结果就是初始环境传递给新进程。 + +当一个新会话创建或者一个就会话重新附着时,update-environment会话选项可以用来从一个客户端来更新会话环境。 +tmux也会使用一些内部信息来初始化TMUX变量以便允许命令在内部执行,TERM变量会设置为正确的终端'screen'。 + +修改和查看环境的命令有: + + set-environment [-gru] [-t target-session] name [value] + (别名:setenv) +设置或重置一个环境变量,如果使用-g,会在全局变量中进行改变;否则只会改变target-session的会话环境。 +-u标记用来重置一个变量。 -r用来指示在开起一个新进程时从环境中移除该变量。 + + show-environment [-g] [-t target-session] [variable] + (别名:showenv) +显示目标会话target-session或者全局环境(使用-g时)变量。 +如果忽略变量,会显示所有的变量。从环境中移除的变量会用'-'作为前导。 + +##状态行 +tmux包含了一个可选的状态行会显示在每个终端的底端行。 +默认状态行时有效的(可以通过status会话选项失效)并且被包含的,从左到右分别有: +包含在方括号中的当前会话名称;窗口列表;双引号包含的活动面板;以及时间和日期。 + +状态行由三部分组成: +可配置的左边和右边部分(可以包含shell命令输出的动态的内容,例如时间和日期, +参考status-left,status-left-length,status-right,status-right-length选项), 以及中间的窗口列表。 +默认窗口列表显示当前会话中按照数字升序排列窗口的索引,名称和标记(如果存在的话)。 +可以通过window-status-format和window-status-current-format选项客制化。 + +附加在窗口名称后面的标记可以是以下符号之一: + + 符号 | 含义 +---------|----------- + * | 表示当前窗口 + - | 最有一个选择的窗口。 + # | 窗口被监控并且活动会被检测。 + ! | 会在窗口中出现一个响铃。 + ~ | 窗口会在monitor-silence时间间隔中保持沉默。 + Z | 窗口的活动面板被放大了。 + +符号#与monitor-activity窗口选项相关。窗口名称会在有警告(响铃,活动或沉默)出现的时候以反转的颜色打印 + +状态行的颜色和属性是可以配置的,整个状态行使用status-style会话选项,单个的窗口使用window=status-style窗口选项配置。 + +状态行会自动地刷新如果当其在时间间隔内被改变的话,时间间隔可以通过status-interval会话选项控制。 + +与状态行相关的命令有: + + command-prompt [-I inputs] [-p prompts] [-t target-client] [template] +在客户端打开一个命令提示,可以在tmux内用用来执行交互式命令。 + +如果指定了template的话,其会被作为命令使用。 +-I是每个提示初始化文本列表-由逗号分割的。 +-p 提示是一个按照顺序显示的逗号分割的提示列表;否则只显示一个单独的构造于template(如果提供了的话)提示,否则使用':'。 +inputs和prompts都可能包含由status-left选项支持的特殊字符序列。 +在命令被执行之前,第一个出现的字符串'%%'和出现的所有'%1'都会被第一个提示的响应替换, +第二个'%%'和所有的'%2'会被第二个提示的响应替换,以此类推, 直到第九个提示可以被替换。 + + confirm-before [-p prompt] [-t target-client] command + (别名:confirm) +在执行命令之前进行确认,如果指定-p, 提示为prompt参数的显示,否则提示会从command来构造。 +可能会包含由status-left选项支持的特殊字符序列。 +这个命令只会在tmux中工作。 + + display-message [-p] [-c target-client] [-t target-pane] [message] + (别名:display) +显示一个消息, 如果没有给定-p, +那么输出会被打印到标准输出中,否则会显示在target-client的状态行上。 +消息的格式在[FORMTS](#格式)部分描述。 +如果给第-t就会从target-pane中获取信息,否则就会从附着在target-client的会话中的活动窗口中获取。 + +##缓冲区 +tmux维护了一个命名的粘贴缓冲区集合,每个可能显式地或自动地命名。 +显式地命名的缓冲区是在通过set-buffer或load-buffer命令创建时命名的, +或者是通过set-buffer -n 来重命名一个自动命名的缓冲区。 +自动命名的缓冲区的名称会类似于'buffer0001','buffer0002'等。 +当达到buffer-limit选项的限制时,最旧的自动命名的缓冲区被删除。 +显示命名的缓冲区不会收到buffer-limit的限制,可以通过delete-buffer命令删除。 + +缓冲区可以使用copy-mode或set-buffer以及load-buffer命令来添加,并且通过paste-buffer命令来将其粘贴到一个窗口。 +如果一个缓冲区命令没有指定缓冲区时,就会假设使用最近添加的自动命名的缓冲区。 + +每个窗口也会维护一个可配值的历史缓冲区,默认会保留到2000行;这个可以通过history-limit选项修改(参考set-option命令)。 + +缓冲区命令有: + choose-buffer [-F format] [-t target-window] [template] +将窗口置于缓冲区选择模式,一个缓冲区可以从一个列表中交互地选择。 +在选择一个缓冲区之后,'%%'会被template中的缓冲区名称替换,之后的结果会作为一个命令被执行。 +如果没有给定template,会使用"paste-buffer -b '%%'"来替换。 对于-F标记参考[FORMATS](#格式)部分。 +这个命令只有在至少有一个客户端附着时工作。 + + clear-history [-t target-pane] + (别名:clearhist) +对指定的pane删除并释放history。 + + delete-buffer [-b buffer-name] + (别名:deleteb) +删除名为buffer-name的缓冲区,在没有指定buffer-name时删除最佳男自动命名添加的缓冲区。 + + list-buffers [-F format] + (别名:lsb) +列出全局缓冲区,对于-F可以参考[FORMATS](#格式)部分。 + + load-buffer [-b buffer-name] path + (别名:loadb) +从path中加载指定粘贴缓冲区的内容。 + + paste-buffer [-dpr] [-b buffer-name] [-s separator] [-t target-pane] + (别名:pasteb) +将一个粘贴缓冲却中的内容插入到一个指定的pane中。如果没有指定target-pane,会被粘贴到当前的一个。 +-d 同时也会删除粘贴缓冲区。当输出时,任何粘贴缓冲区中的换行符会使用一个分隔符替换(默认为回车符)。 +-s 指定客制化分隔符。 +-r 标记意味着不做换行符的替换。 +-p 当应用程序请求大括号粘贴模式的话,粘贴的大括号控制代码会被插入到缓冲区中。 + + save-buffer [-a] [-b buffer-name] path + (别名:saveb) +将指定的粘贴缓冲区中的内容保存到一个路径path. -a选项用来指示附加模式而不是直接重写文件。 + + set-buffer [-a] [-b buffer-name] [-n new-buffer-name] data + (别名:setb) +将指定缓冲区的内容设置为data. +使用-a选项来将data附加到缓冲区而不是直接重写缓冲区。-n用来重命名缓冲区到一个new-buffer-name。 + + show-buffer [-b buffer-name] + (别名:showb) +显示指定缓冲区的内容。 + +##杂项 +其他杂项命令有: + clock-mode [-t target-pane] +显示一个大的时钟。 + + if-shell [-bF] [-t target-pane] shell-command command [command] + (别名:if) +如果shell-command返回成功的话执行第一个命令,否则执行第二个命令。 +在执行之前,shell-command会使用[FORMATS](#格式)部分指定的规则进行扩展,包括相关的target-pane。-b指示shell-command在后台运行。 +如果给定-F,shell-command不会被执行而是认为时成功的(如果既不是空的也不是0的话-在格式扩展之后)。 + + lock-server + (别名:lock) +通过运行lock-command选项指定的命令来分别锁定每个客户端。 + + run-shell [-b] [-t target-pane] shell-command + (别名:run) +在不创建一个窗口的前提下在后台中运行一个shell-command。 +执行之前,shell-command使用[FORMATS](#格式)部分指定的规则进行扩展。 +-b指示在后台运行。 +在完成之后,任何到标准输出的输出会在copy模式中显示(在由-t指定的pane或当前pane-如果缺省的话)。 +如果命令没有成功返回,退出状态也会被显示。 + + wait-for [-L | -S | -U] channel + (别名:wait) +当不带选项使用时,在使用相同的channel的wait-for -S唤醒之前阻止客户端退出。 +-L会锁定channel,任何尝试锁定相同channel的客户端会一直等待直到使用wait-for -U 解锁。 这个命令只有在tmux外部工作。 + +##TERMINFO EXTENSIONS + +tmux可以理解terminfo的一些扩展: +Cs, Cr +设置光标颜色,第一个使用一个单个字符串参数来设置颜色;第二个没有参数来恢复默认的光标颜色。 +如果设置的话一系列这样的值会被用来在tmux中改变光标颜色: + + $ printf '\033]12;red\033\\' + +Ss, Se +设置或重置光标样式。 如果设置以下的序列可能会用来将光标变为一个下划线: + + $ printf '\033[4 q' + +如果没有设置Se,Ss和参数0会被用来重新设置光标样式。 + +Ms +这个序列可以被tmux用来存储当前缓冲区到主机终端剪贴板中。可以参考set-clipboad选项和xterm的man页面。 + +##控制模式 + +tmux提供了一个成为control(控制)模式的文本界面。这使得应用程序可以通过一个简单的文本协议与tmux进行交流。 +在控制模式中,一个客户端发送tmux命令或以新行结束的命令序列到标准输入中。 +每个命令将会在标准输出中产生一个输出块。 +一个输出块包含了一个%begin行与跟随的输出(可能为空)。 +输出块会以一个%end或%error作为结尾。 +%begin和匹配的%end/%error具有两个参数:一个整数时间和命令编号,例如: + + %begin 1363006971 2 + 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active) + %end 1363006971 2 + +在控制模式中,tmux输出通知,一个通知不会出现在输出块中。 + +下面是通知的定义: + + %exit [reason] + +当tmux客户端没有附着在任何会话中或者出现错误时,tmux客户端会立即退出。如果存在的话,reason描述了客户端退出的原因。 + + %layout-change window-id window-layout + +一个带有window-id的窗口布局被改变,新的布局为window-layout。 + + %output pane-id value + +一个窗口面板产生的输出。 值会转义非打印字符而且饭斜线作为八进制\xxx。 + + %session-changed session-id name +客户端现在被附着在ID为session-id的会话上,并且使用name命名。 + + %session-renamed name +当前会话被重命名为name。 + + %sessions-changed + +一个会话被创建或销毁。 + + %unlinked-window-add window-id + +ID为window-id的窗口被创建,但是没有连接到当前会话。 + + %window-add window-id +ID为window-id的窗口被连接到当前会话。 + + %window-close window-id +ID为window-id的窗口被关闭。 + + %window-renamed window-id name +ID为window-id的窗口重命名为name。 + +##文件 +o + ~/.tmux.conf : 默认的tmux配置文件。 + /etc/tmux.conf : 系统范围的配置文件。 + +##样例 + +创建一个运行vi的新的tmux会话: + + $ tmux new-session vi + +大部分命令具有一个简短形式,也成为别名。例如new-session的别名为new: + $ tmux new vi + +可选地,一个命令最短的不混淆的简短格式是被接受的,如果有多个选项,会被列出: + + $ tmux n + ambiguous command: n, could be: new-session, new-window, next-window + +在一个活动会话中,一个新的窗口可以通过键入'C-b c'来创建(ctrl 跟随b 然后跟随c键)。 + +窗口可以使用'C-b 0-9'来在窗口0-9中导航,也可以通过'C-b n'选择下一个窗口,'C-b p'选择上一个窗口。 + +一个会话可以通过使用'C-b d'来脱离附着,也可以通过以下命令来重新附着: + $ tmux attach-session + +键入'C-b ?' 列出当前窗口中的当前键绑定; 使用上下箭头可以导航列表,'q'从其中退出。 + +当tmux启动时运行的命令可能放置在 ~/.tmux.conf配置文件中,常见样例包括: + +改变默认的前导键: + + set-option -g prefix C-a + unbind-key C-b + bind-key C-a send-prefix + +关闭状态行或者改变其颜色: + + set-option -g status off + set-option -g status-style bg=blue + +设置其他选项,例如默认命令或者在30分钟不活动之后锁定: + + set-option -g default-command "exec /bin/ksh" + set-option -g lock-after-time 1800 + +创建新的键绑定: + + bind-key b set-option status + bind-key / command-prompt "split-window 'exec man %%'" + bind-key S command-prompt "new-window -n %1 'ssh %1'" + +参考: pty(4) + +作者: Nicholas Marriott + +译者: Liang Guisheng